WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

Re: [Xen-devel] x86-64 machine_to_phys vs NX bit

To: "Keir Fraser" <Keir.Fraser@xxxxxxxxxxxx>, "John Byrne" <john.l.byrne@xxxxxx>
Subject: Re: [Xen-devel] x86-64 machine_to_phys vs NX bit
From: "Jan Beulich" <jbeulich@xxxxxxxxxx>
Date: Mon, 13 Nov 2006 08:07:03 +0000
Cc: xen-devel <xen-devel@xxxxxxxxxxxxxxxxxxx>
Delivery-date: Mon, 13 Nov 2006 00:06:18 -0800
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
In-reply-to: <45559E51.3010909@xxxxxx>
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
References: <455551D7.7050409@xxxxxx> <45559E51.3010909@xxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
>> While trying to debug a migration problem in Xen 3.0.3 I have noticed
>> this issue. I don't see a fix in xen-unstable. Has this gotten dropped
>> on the floor?
>> 
>> The suggested patch above is not quite correct or complete. My proposed
>> patch aqainst xen-unstable changeset 12364:d19deb173503 is attached. 
>> Note that there is also an issue in x86 PAE: machine_to_phys() currently 
>> will strip the NX bit.
>> 
>> Signed-off-by: John Byrne <john.l.byrne@xxxxxx>
>> 
><...snipped...>
>
>There was a bug in my previous patch. (There's nothing like trying to 
>get to sleep and realizing you've screwed up.) The x86 pae 
>PHYSICAL_PAGE_MASK I defined was incorrect because PAGE_MASK was only a 
>long. I hope I haven't done anything else wrong.

I don't think this is correct - machine_to_phys() translates a machine address
to a physical one, and in that translation the upper bits matter only as much
as mfn_to_pfn() should return an invalid indicator if any of them is set. In 
turn,
it should be the caller's responsibility to make sure the NX bit (and any 
potential
other one being set beyond bit 52) gets masked off *before* calling this
function. (Specifically, the preserving of the lower bits is to properly 
translate
a non-page aligned address, not to preserve attribute bits read from a page
table entry).

Jan

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel