mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Dave Hansen <dave.hansen@intel.com>
To: Thomas Gleixner <tglx@linutronix.de>
Cc: Sean Christopherson <sean.j.christopherson@intel.com>,
	linux-kernel@vger.kernel.org, Ingo Molnar <mingo@redhat.com>,
	"H. Peter Anvin" <hpa@zytor.com>,
	x86@kernel.org
Subject: Re: [PATCH] x86/pkeys: Explicitly treat PK #PF on kernel address as a bad area
Date: Thu, 30 Aug 2018 16:33:43 -0700	[thread overview]
Message-ID: <356b4517-3c09-2bfa-a105-82bba3f1c4ff@intel.com> (raw)
In-Reply-To: <alpine.DEB.2.21.1808301239440.1210@nanos.tec.linutronix.de>

On 08/30/2018 03:40 AM, Thomas Gleixner wrote:
> Given the time span you should be close to ground water with your digging
> by now.

So, turns out that we start our spurious_fault() code with this check:

>         if (error_code != (X86_PF_WRITE | X86_PF_PROT) &&
>             error_code != (X86_PF_INSTR | X86_PF_PROT))
>                 return 0;

Which ensures that we only do spurious checking for *very* specific
error_code's.  That ends up making the X86_PF_PK check inside of
spurious_fault_check() dead code _anyway_.  It's totally unreachable as
far as I can tell.

We could add a comment above the error_code check to make it explicit
that it excludes pkeys.

But, otherwise, I think we can just axe the X86_PF_PK
spurious_fault_check().


  reply	other threads:[~2018-08-30 23:33 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-08-07 17:29 Sean Christopherson
2018-08-07 18:28 ` Dave Hansen
2018-08-30 10:40   ` Thomas Gleixner
2018-08-30 23:33     ` Dave Hansen [this message]
2018-08-31  2:38   ` Jann Horn
2018-08-31  3:08     ` Andy Lutomirski
2018-09-04 19:50 ` Sean Christopherson
2018-09-04 19:56   ` Andy Lutomirski
2018-09-04 21:21     ` Dave Hansen
2018-09-04 21:27       ` Andy Lutomirski
2018-09-05 21:35         ` Dave Hansen
2018-09-05 21:39           ` Andy Lutomirski

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=356b4517-3c09-2bfa-a105-82bba3f1c4ff@intel.com \
    --to=dave.hansen@intel.com \
    --cc=hpa@zytor.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=sean.j.christopherson@intel.com \
    --cc=tglx@linutronix.de \
    --cc=x86@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®