lkml.org 
[lkml]   [2008]   [Dec]   [11]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] Fix VMI crash on boot in 2.6.27, 2.6.28 kernels
On Thu, Dec 11, 2008 at 02:23:11PM -0800, Zachary Amsden wrote:
> On Wed, 2008-12-10 at 19:31 -0800, Greg KH wrote:
>
> > > +#ifdef CONFIG_VMI
> > > + /* VMI may relocate the fixmap; do this before touching ioremap area */
> > > + vmi_init();
> > > +#endif
> >
> > Shouldn't the #ifdef not be needed here if the .h files are set up
> > properly for the vmi_init prototype? Please try to keep them out of .c
> > files wherever possible.
>
> Yes, they should. Judging by setup.c though, you would think the
> opposite... in any case I fixed it. Please apply - and yes, I tested
> compile both ways.

> VMI initialiation can relocate the fixmap, causing early_ioremap
> to malfunction if it is initialized before the relocation.
> To fix this, VMI activation is split into two phases; the detection,
> which must happen before setting up ioremap, and the activation,
> which must happen after parsing early boot parameters.
>
> This fixes a crash on boot when VMI is enabled under VMware.
>
> Signed-off-by: Zachary Amsden <zach@vmware.com>
>
> diff --git a/arch/x86/include/asm/vmi.h b/arch/x86/include/asm/vmi.h
> index b7c0dea..128958a 100644
> --- a/arch/x86/include/asm/vmi.h
> +++ b/arch/x86/include/asm/vmi.h
> @@ -223,9 +223,15 @@ struct pci_header {
> } __attribute__((packed));
>
> /* Function prototypes for bootstrapping */
> +#ifdef CONFIG_VMI
> extern void vmi_init(void);
> +extern void vmi_activate(void);
> extern void vmi_bringup(void);
> -extern void vmi_apply_boot_page_allocations(void);
> +#else
> +#define vmi_init()
> +#define vmi_activate()
> +#define vmi_bringup()
> +#endif

static inline please, don't use #defines for function prototypes, it's
not nice. See Andrew's previous rants about this for details :)

thanks,

greg k-h


\
 
 \ /
  Last update: 2008-12-11 22:49    [W:0.113 / U:0.124 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site