public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Alok Kataria <akataria@vmware.com>
To: Ian Campbell <ian.campbell@citrix.com>
Cc: "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"H. Peter Anvin" <hpa@zytor.com>, Ingo Molnar <mingo@elte.hu>,
	Jeremy Fitzhardinge <jeremy@goop.org>
Subject: Re: [PATCH 2/3] vmi: disable highmem PTE allocation even when CONFIG_HIGHPTE=y
Date: Fri, 26 Feb 2010 17:43:41 -0800	[thread overview]
Message-ID: <1267235021.24798.36.camel@ank32> (raw)
In-Reply-To: <1267204562-11844-2-git-send-email-ian.campbell@citrix.com>


On Fri, 2010-02-26 at 09:16 -0800, Ian Campbell wrote:
> Preventing HIGHPTE allocations under VMI will allow us to remove the
> kmap_atomic_pte paravirt op.

Acked-by: Alok N Kataria <akataria@vmware.com>

Thanks,
Alok
> 
> Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
> Cc: Alok Kataria <akataria@vmware.com>
> Cc: H. Peter Anvin <hpa@zytor.com>
> Cc: Ingo Molnar <mingo@elte.hu>
> Cc: Jeremy Fitzhardinge <jeremy@goop.org>
> ---
>  arch/x86/kernel/vmi_32.c |   23 +++++++++++------------
>  1 files changed, 11 insertions(+), 12 deletions(-)
> 
> diff --git a/arch/x86/kernel/vmi_32.c b/arch/x86/kernel/vmi_32.c
> index d430e4c..58aca86 100644
> --- a/arch/x86/kernel/vmi_32.c
> +++ b/arch/x86/kernel/vmi_32.c
> @@ -33,6 +33,7 @@
>  #include <asm/fixmap.h>
>  #include <asm/apicdef.h>
>  #include <asm/apic.h>
> +#include <asm/pgalloc.h>
>  #include <asm/processor.h>
>  #include <asm/timer.h>
>  #include <asm/vmi_time.h>
> @@ -272,19 +273,11 @@ static void *vmi_kmap_atomic_pte(struct page *page, enum km_type type)
>  	void *va = kmap_atomic(page, type);
>  
>  	/*
> -	 * Internally, the VMI ROM must map virtual addresses to physical
> -	 * addresses for processing MMU updates.  By the time MMU updates
> -	 * are issued, this information is typically already lost.
> -	 * Fortunately, the VMI provides a cache of mapping slots for active
> -	 * page tables.
> -	 *
> -	 * We use slot zero for the linear mapping of physical memory, and
> -	 * in HIGHPTE kernels, slot 1 and 2 for KM_PTE0 and KM_PTE1.
> -	 *
> -	 *  args:                 SLOT                 VA    COUNT PFN
> +	 * We disable highmem allocations for page tables so we should never
> +	 * see any calls to kmap_atomic_pte on a highmem page.
>  	 */
> -	BUG_ON(type != KM_PTE0 && type != KM_PTE1);
> -	vmi_ops.set_linear_mapping((type - KM_PTE0)+1, va, 1, page_to_pfn(page));
> +
> +	BUG_ON(PageHighmem(page));
>  
>  	return va;
>  }
> @@ -640,6 +633,12 @@ static inline int __init activate_vmi(void)
>  	u64 reloc;
>  	const struct vmi_relocation_info *rel = (struct vmi_relocation_info *)&reloc;
>  
> +	/*
> +	 * Prevent page tables from being allocated in highmem, even if
> +	 * CONFIG_HIGHPTE is enabled.
> +	 */
> +	__userpte_alloc_gfp &= ~__GFP_HIGHMEM;
> +
>  	if (call_vrom_func(vmi_rom, vmi_init) != 0) {
>  		printk(KERN_ERR "VMI ROM failed to initialize!");
>  		return 0;


  reply	other threads:[~2010-02-27  1:43 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-02-26 17:15 [GIT 0/3] x86: remove kmap_atomic_pte paravirt op Ian Campbell
2010-02-26 17:16 ` [PATCH 1/3] xen: disable highmem PTE allocation even when CONFIG_HIGHPTE=y Ian Campbell
2010-02-26 17:16 ` [PATCH 2/3] vmi: " Ian Campbell
2010-02-27  1:43   ` Alok Kataria [this message]
2010-02-27 23:51   ` [tip:x86/mm] x86, vmi: Disable " tip-bot for Ian Campbell
2010-02-26 17:16 ` [PATCH 3/3] x86: remove kmap_atomic_pte paravirt op Ian Campbell
2010-02-27  1:42   ` Alok Kataria
2010-02-27 23:52   ` [tip:x86/mm] x86, paravirt: Remove " tip-bot for Ian Campbell

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=1267235021.24798.36.camel@ank32 \
    --to=akataria@vmware.com \
    --cc=hpa@zytor.com \
    --cc=ian.campbell@citrix.com \
    --cc=jeremy@goop.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    /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