All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Jan Beulich" <jbeulich@novell.com>
To: Keir Fraser <Keir.Fraser@cl.cam.ac.uk>, Rik van Riel <riel@redhat.com>
Cc: xen-devel@lists.xensource.com
Subject: Re: x86-64 machine_to_phys vs NX bit
Date: Fri, 25 Aug 2006 15:11:27 +0200	[thread overview]
Message-ID: <44EF131F.76E4.0078.0@novell.com> (raw)
In-Reply-To: <C114662D.C52%Keir.Fraser@cl.cam.ac.uk>

>>> Keir Fraser <Keir.Fraser@cl.cam.ac.uk> 25.08.06 09:32 >>>
>On 24/8/06 8:25 pm, "Rik van Riel" <riel@redhat.com> wrote:
>
>> Say, something like the following?
>> 
>> -    paddr_t phys = mfn_to_pfn(machine >> PAGE_SHIFT);
>> +    paddr_t phys = mfn_to_pfn((machine >> PAGE_SHIFT) & PHYSICAL_MASK);
>> 
>> I'm still thinking I may have missed something in the code
>> somewhere, but I've been looking at this for over an hour now
>> and can't seem to find it...
>> 
>> Any ideas?
>
>Your suggested patch looks reasonable but it'd be good to find out why this

I'd suggest not changing machine_to_phys(), but its callers (where needed), in
order to prevent hiding errors.

>hasn't caused us problems. For example, perhaps supported_pte_mask doesn't
>include PAGE_NX, so we're never setting the NX bit on 64-bit PTEs? That must

__supported_pte_mask is all ones on a system I just checked this on; pte_val()
for a page with _PAGE_NX set indeed returns (end_pfn << PAGE_SHIFT) | prot_flags.
With that I guess there are just too few pages making use of _PAGE_NX yet,
so the problem went unnoticed so far.

>be worth checking out, possibly also tracing machine_to_phys to find out
>where that bit 63 goes -- I agree that it looks like mfn_to_pfn() shouldn#t
>work if bit63 is set in the 'maddr' argument.

Jan

  reply	other threads:[~2006-08-25 13:11 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-08-24 19:25 x86-64 machine_to_phys vs NX bit Rik van Riel
2006-08-25  7:32 ` Keir Fraser
2006-08-25 13:11   ` Jan Beulich [this message]
2006-08-25 13:54   ` Rik van Riel
  -- strict thread matches above, loose matches on Subject: below --
2006-08-25 14:46 Nakajima, Jun
2006-08-25 15:10 ` Keir Fraser
2006-08-25 15:19   ` Rik van Riel
2006-08-25 15:27     ` Keir Fraser
2006-08-25 15:37 Nakajima, Jun
2006-08-25 15:56 Ian Pratt
2006-08-25 17:02 Nakajima, Jun
2006-11-11  4:30 John Byrne
2006-11-11  9:56 ` John Byrne
2006-11-13  8:07   ` Jan Beulich
2006-11-13  8:16     ` Keir Fraser
2006-11-13 20:45       ` John Byrne
2006-11-14  1:15         ` John Byrne
2006-11-14  8:05           ` Jan Beulich
2006-11-14  8:17             ` Keir Fraser

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=44EF131F.76E4.0078.0@novell.com \
    --to=jbeulich@novell.com \
    --cc=Keir.Fraser@cl.cam.ac.uk \
    --cc=riel@redhat.com \
    --cc=xen-devel@lists.xensource.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.