From: Ian Campbell <Ian.Campbell@citrix.com>
To: Mark McLoughlin <markmc@redhat.com>
Cc: Jon Swanson <jswanson@valuecommerce.co.jp>,
fedora-virt@redhat.com, Jeremy Fitzhardinge <jeremy@goop.org>,
Ingo Molnar <mingo@elte.hu>,
linux-kernel@vger.kernel.org, stable@kernel.org
Subject: Re: [PATCH] xen: do not set NX bit when making initial pagetables readonly
Date: Fri, 30 Jan 2009 18:50:49 +0000 [thread overview]
Message-ID: <1233341449.7436.4.camel@localhost.localdomain> (raw)
In-Reply-To: <1233339562-24011-1-git-send-email-Ian.Campbell@citrix.com>
I meant to CC lkml and stable@ (some of the original reports are against
2.6.27) and fat-fingered the to: line.
A few previous threads on the subject:
http://lists.xensource.com/archives/html/xen-devel/2009-01/msg00176.html
http://www.redhat.com/archives/fedora-xen/2009-January/msg00022.html
http://www.redhat.com/archives/fedora-virt/2009-January/msg00013.html
Ian.
On Fri, 2009-01-30 at 18:19 +0000, Ian Campbell wrote:
> __supported_pte_mask has not been correctly configured at this point
> and Xen prevents us from using the NX bit if the hardware does not
> support it. Some BIOSes seem to offer the option to disable NX.
>
> Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
> Cc: Mark McLoughlin <markmc@redhat.com>
> Cc: Jon Swanson <jswanson@valuecommerce.co.jp>
> Cc: fedora-virt@redhat.com
> Cc: Jeremy Fitzhardinge <jeremy@goop.org>
> Cc: Ingo Molnar <mingo@elte.hu>
> ---
> arch/x86/xen/enlighten.c | 24 +++++++++++++-----------
> 1 files changed, 13 insertions(+), 11 deletions(-)
>
> diff --git a/arch/x86/xen/enlighten.c b/arch/x86/xen/enlighten.c
> index bea2152..e705bdf 100644
> --- a/arch/x86/xen/enlighten.c
> +++ b/arch/x86/xen/enlighten.c
> @@ -53,6 +53,8 @@
> #include "mmu.h"
> #include "multicalls.h"
>
> +#define _KERNPG_TABLE_RO __pgprot(_KERNPG_TABLE & ~_PAGE_RW)
> +
> EXPORT_SYMBOL_GPL(hypercall_page);
>
> DEFINE_PER_CPU(struct vcpu_info *, xen_vcpu);
> @@ -1487,9 +1489,9 @@ static __init void xen_map_identity_early(pmd_t *pmd, unsigned long max_pfn)
> }
>
> for (pteidx = 0; pteidx < ident_pte; pteidx += PTRS_PER_PTE)
> - set_page_prot(&level1_ident_pgt[pteidx], PAGE_KERNEL_RO);
> + set_page_prot(&level1_ident_pgt[pteidx], _KERNPG_TABLE_RO);
>
> - set_page_prot(pmd, PAGE_KERNEL_RO);
> + set_page_prot(pmd, _KERNPG_TABLE_RO);
> }
>
> #ifdef CONFIG_X86_64
> @@ -1543,12 +1545,12 @@ static __init pgd_t *xen_setup_kernel_pagetable(pgd_t *pgd,
> xen_map_identity_early(level2_ident_pgt, max_pfn);
>
> /* Make pagetable pieces RO */
> - set_page_prot(init_level4_pgt, PAGE_KERNEL_RO);
> - set_page_prot(level3_ident_pgt, PAGE_KERNEL_RO);
> - set_page_prot(level3_kernel_pgt, PAGE_KERNEL_RO);
> - set_page_prot(level3_user_vsyscall, PAGE_KERNEL_RO);
> - set_page_prot(level2_kernel_pgt, PAGE_KERNEL_RO);
> - set_page_prot(level2_fixmap_pgt, PAGE_KERNEL_RO);
> + set_page_prot(init_level4_pgt, _KERNPG_TABLE_RO);
> + set_page_prot(level3_ident_pgt, _KERNPG_TABLE_RO);
> + set_page_prot(level3_kernel_pgt, _KERNPG_TABLE_RO);
> + set_page_prot(level3_user_vsyscall, _KERNPG_TABLE_RO);
> + set_page_prot(level2_kernel_pgt, _KERNPG_TABLE_RO);
> + set_page_prot(level2_fixmap_pgt, _KERNPG_TABLE_RO);
>
> /* Pin down new L4 */
> pin_pagetable_pfn(MMUEXT_PIN_L4_TABLE,
> @@ -1597,9 +1599,9 @@ static __init pgd_t *xen_setup_kernel_pagetable(pgd_t *pgd,
> set_pgd(&swapper_pg_dir[KERNEL_PGD_BOUNDARY],
> __pgd(__pa(level2_kernel_pgt) | _PAGE_PRESENT));
>
> - set_page_prot(level2_kernel_pgt, PAGE_KERNEL_RO);
> - set_page_prot(swapper_pg_dir, PAGE_KERNEL_RO);
> - set_page_prot(empty_zero_page, PAGE_KERNEL_RO);
> + set_page_prot(level2_kernel_pgt, _KERNPG_TABLE_RO);
> + set_page_prot(swapper_pg_dir, _KERNPG_TABLE_RO);
> + set_page_prot(empty_zero_page, _KERNPG_TABLE_RO);
>
> pin_pagetable_pfn(MMUEXT_UNPIN_TABLE, PFN_DOWN(__pa(pgd)));
>
parent reply other threads:[~2009-01-30 18:51 UTC|newest]
Thread overview: expand[flat|nested] mbox.gz Atom feed
[parent not found: <1233339562-24011-1-git-send-email-Ian.Campbell@citrix.com>]
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=1233341449.7436.4.camel@localhost.localdomain \
--to=ian.campbell@citrix.com \
--cc=fedora-virt@redhat.com \
--cc=jeremy@goop.org \
--cc=jswanson@valuecommerce.co.jp \
--cc=linux-kernel@vger.kernel.org \
--cc=markmc@redhat.com \
--cc=mingo@elte.hu \
--cc=stable@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
Powered by JetHome