Scott Parish
2005-Jun-08 22:33 UTC
Re: [Xen-devel] [patch] nx bit shouldn''t get set when disabled
On Wed, Jun 08, 2005 at 03:47:01PM -0700, Nakajima, Jun wrote:> Agree on that part. Should read like: > > pte = pte_offset_kernel(pmd, (vstart + (i*PAGE_SIZE))); > + pte->pte &= __supported_pte_mask; > pfn = pte->pte >> PAGE_SHIFT;I dissent. Same reason as yesterday: the above might work right now, but as soon as we enable NX the NX bit will end up in the pfn/mfn. sRp -- Scott Parish Signed-off-by: srparish@us.ibm.com _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Nakajima, Jun
2005-Jun-08 22:47 UTC
RE: [Xen-devel] [patch] nx bit shouldn''t get set when disabled
Keir Fraser wrote:> On 8 Jun 2005, at 22:56, Nakajima, Jun wrote: > >> These should not be necessary if pte is created correctly (w/ or w/o >> NX bit depending on __supported_pte_mask) in the first place, as Keir >> pointed out. That''s what I meant by "We should fix the creator of the >> pte (by __supported_pte_mask), not the consumer of it." And you >> always cut off the NX bit in your patch. >> >> So remove the changes to pci-dma.c and init.c. If that does not work, >> move check_efer to right before pda_init(0) in x86_64_start_kernel() >> in head64.c. > > I think the changes in pci-dma.c *are* required: that code currently > just does pte->pte >> PAGE_SHIFT, which certainly isn''t right. That''s > code that doesn''t exist in native Linux so it probably does need > fixing up for PAE/NX.Agree on that part. Should read like: pte = pte_offset_kernel(pmd, (vstart + (i*PAGE_SIZE))); + pte->pte &= __supported_pte_mask; pfn = pte->pte >> PAGE_SHIFT;> > But ''fixes'' to simple native functions like set_pud, set_pmd, etc. > ought not to be necessary. We shouldn''t have to fix ubiquitous > functions like that to support nx bit on xenlinux. If we do, it''s a > sign that something is very wrong! :-) > > -- KeirI found a bug in phys_pud_init(). I''ll send a patch. Jun --- Intel Open Source Technology Center _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel