public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Alok Kataria <akataria@vmware.com>
To: "torvalds@linux-foundation.org" <torvalds@linux-foundation.org>,
	"H. Peter Anvin" <hpa@kernel.org>
Cc: Zach Amsden <zach@vmware.com>, Ingo Molnar <mingo@elte.hu>,
	the arch/x86 maintainers <x86@kernel.org>,
	LKML <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH]Fix broken VMI in 2.6.27-rc..
Date: Fri, 08 Aug 2008 12:15:57 -0700	[thread overview]
Message-ID: <1218222957.26510.16.camel@alok-dev1> (raw)
In-Reply-To: <489B6E83.7000202@kernel.org>

On Thu, 2008-08-07 at 14:52 -0700, H. Peter Anvin wrote:
> Zachary Amsden wrote:
> > My point is 1) these could be two separate calls, or 2) the lowmem
> > mapping table need not depend on max_low_pfn at all, it is safe to
> > create an extra large mapping which covers all possible lowmem instead
> > of the physical ram that is actually available.
> 
> Realistically speaking, any (virtual) machine which does *not* have a
> full complement of lowmem (i.e. less than 896 MB in the common case)
> will not suffer significatly from losing a few megabytes of address space.


Ok, since we are already past rc-2, I think we should fix the VMI
problem sooner than later.  Any approach that we eventually take to make
the fixmap's actually *fixed*, would be independent of this fix. 

Below is the patch which does away from the dependency of activating VMI
only after max_low_pfn is known. We move vmi_initialization very early
in the setup_arch code. 

Patch on top of current git. Please have a look and apply.
--
From: Alok N Kataria <akataria@vmware.com>

The lowmem mapping table created by VMI need not depend on max_low_pfn
at all.  Instead we now create an extra large mapping which covers all
possible lowmem instead of the physical ram that is actually available.

This allows the vmi initialization to be done before max_low_pfn could
be computed. We also move the vmi_init code very early in the boot process
so that nobody accidentally breaks the fixmap dependancy.

Signed-off-by: Alok N Kataria <akataria@vmware.com>
Acked-by: Zachary Amsden <zach@vmware.com>
---

 arch/x86/kernel/setup.c  |   16 ++++++++--------
 arch/x86/kernel/vmi_32.c |    3 ++-
 2 files changed, 10 insertions(+), 9 deletions(-)


diff --git a/arch/x86/kernel/setup.c b/arch/x86/kernel/setup.c
index 2d88858..6e5823b 100644
--- a/arch/x86/kernel/setup.c
+++ b/arch/x86/kernel/setup.c
@@ -604,6 +604,14 @@ void __init setup_arch(char **cmdline_p)
 	early_cpu_init();
 	early_ioremap_init();
 
+#if defined(CONFIG_VMI) && defined(CONFIG_X86_32)
+	/*
+	 * Must be before kernel pagetables are setup
+	 * or fixmap area is touched.
+	 */
+	vmi_init();
+#endif
+
 	ROOT_DEV = old_decode_dev(boot_params.hdr.root_dev);
 	screen_info = boot_params.screen_info;
 	edid_info = boot_params.edid_info;
@@ -817,14 +825,6 @@ void __init setup_arch(char **cmdline_p)
 	kvmclock_init();
 #endif
 
-#if defined(CONFIG_VMI) && defined(CONFIG_X86_32)
-	/*
-	 * Must be after max_low_pfn is determined, and before kernel
-	 * pagetables are setup.
-	 */
-	vmi_init();
-#endif
-
 	paravirt_pagetable_setup_start(swapper_pg_dir);
 	paging_init();
 	paravirt_pagetable_setup_done(swapper_pg_dir);
diff --git a/arch/x86/kernel/vmi_32.c b/arch/x86/kernel/vmi_32.c
index 0a1b1a9..6ca515d 100644
--- a/arch/x86/kernel/vmi_32.c
+++ b/arch/x86/kernel/vmi_32.c
@@ -37,6 +37,7 @@
 #include <asm/timer.h>
 #include <asm/vmi_time.h>
 #include <asm/kmap_types.h>
+#include <asm/setup.h>
 
 /* Convenient for calling VMI functions indirectly in the ROM */
 typedef u32 __attribute__((regparm(1))) (VROMFUNC)(void);
@@ -683,7 +684,7 @@ void vmi_bringup(void)
 {
  	/* We must establish the lowmem mapping for MMU ops to work */
 	if (vmi_ops.set_linear_mapping)
-		vmi_ops.set_linear_mapping(0, (void *)__PAGE_OFFSET, max_low_pfn, 0);
+		vmi_ops.set_linear_mapping(0, (void *)__PAGE_OFFSET, MAXMEM_PFN, 0);
 }
 
 /*





  parent reply	other threads:[~2008-08-08 19:16 UTC|newest]

Thread overview: 33+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-08-07 19:12 [PATCH]Fix broken VMI in 2.6.27-rc Alok Kataria
2008-08-07 21:20 ` H. Peter Anvin
2008-08-07 21:27   ` Zachary Amsden
2008-08-07 21:34     ` H. Peter Anvin
2008-08-07 21:42       ` Zachary Amsden
2008-08-07 21:52         ` H. Peter Anvin
2008-08-07 21:55           ` Zachary Amsden
2008-08-07 22:17             ` H. Peter Anvin
2008-08-07 22:38               ` Linus Torvalds
2008-08-07 22:58                 ` H. Peter Anvin
2008-08-07 23:08                   ` Linus Torvalds
2008-08-07 23:12                     ` H. Peter Anvin
2008-08-07 23:26                     ` Zachary Amsden
2008-08-07 23:49                       ` Jeremy Fitzhardinge
2008-08-07 23:23               ` Jeremy Fitzhardinge
2008-08-08 19:15           ` Alok Kataria [this message]
2008-08-08 22:23             ` H. Peter Anvin
2008-08-07 23:21     ` Jeremy Fitzhardinge
2008-08-07 23:27       ` H. Peter Anvin
2008-08-07 23:46         ` Jeremy Fitzhardinge
2008-08-07 23:51           ` H. Peter Anvin
2008-08-08  0:01             ` Yinghai Lu
2008-08-08  0:11               ` H. Peter Anvin
2008-08-08  0:10             ` Jeremy Fitzhardinge
2008-08-08  0:13               ` H. Peter Anvin
2008-08-08  0:23                 ` Jeremy Fitzhardinge
2008-08-08  0:29                   ` H. Peter Anvin
2008-08-08  6:10                 ` Jeremy Fitzhardinge
2008-08-08 16:13                   ` H. Peter Anvin
2008-08-08  1:14               ` Zachary Amsden
2008-08-08  1:19                 ` H. Peter Anvin
2008-08-08  1:28                   ` Zachary Amsden
2008-08-07 21:41   ` Alok Kataria

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=1218222957.26510.16.camel@alok-dev1 \
    --to=akataria@vmware.com \
    --cc=hpa@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=torvalds@linux-foundation.org \
    --cc=x86@kernel.org \
    --cc=zach@vmware.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox