Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1443484

Re: [PATCH 4/4] x86: use pte_none() to test for empty PTE

From Dave Hansen <dave.hansen@intel.com>
Newsgroups linux.kernel
Subject Re: [PATCH 4/4] x86: use pte_none() to test for empty PTE
Date 2016-07-14 16:30 +0200
Message-ID <rUPOh-2or-23@gated-at.bofh.it> (permalink)
References <rSrGp-5Fj-5@gated-at.bofh.it> <rSrQ5-5JH-5@gated-at.bofh.it> <rUPbB-1TY-33@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On 07/14/2016 06:47 AM, Vlastimil Babka wrote:
> So, this might be just because I know next to nothing about (para)virt,
> but...
> 
> in arch/x86/include/asm/paravirt.h, pte_val is implemented via some
> pvops, which suggests that obtaining a pte value is different than just
> reading it from memory. But I don't see pte_none() defined to be using
> this on paravirt, and it shares (before patch 2/4) the "return !pte.pte"
> implementation, AFAICS?
> 
> So that itself is suspicious to me. And now that this patches does
> things like this:
> 
> -              if (pte_val(*pte)) {
> +              if (!pte_none(*pte)) {
> 
> So previously on paravirt these tests would read pte via the pvops, and
> now they won't. Is that OK?

I've cc'd a few Xen guys.  I think they're the only ones that would care.

But, as far as I can tell, the Xen pte_val() will take a _PAGE_PRESENT
PTE and muck with it.  But its answer will never differ for an all 0 PTE
from !pte_none() because that PTE does not have _PAGE_PRESENT set.

It does seem fragile that Xen is doing it this way, but I guess it works.

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

Re: [PATCH 4/4] x86: use pte_none() to test for empty PTE Vlastimil Babka <vbabka@suse.cz> - 2016-07-14 15:50 +0200
  Re: [PATCH 4/4] x86: use pte_none() to test for empty PTE Dave Hansen <dave.hansen@intel.com> - 2016-07-14 16:30 +0200
    Re: [PATCH 4/4] x86: use pte_none() to test for empty PTE David Vrabel <david.vrabel@citrix.com> - 2016-07-14 17:00 +0200

csiph-web