lguest update for mm: simplify boot_params
PATCH 1/2 lguest update for mm: simplify boot_params
Andrew patched up lguest after the boot parameters became a proper structure, but in fact it can be considerably neatened.
Signed-off-by Rusty Russell <[email protected]>
drivers/lguest/lguest.c +1 -2
@@ -444,8 +444,7 @@ __init void lguest_init(void *boot) {/* Copy boot parameters first. */ memcpy (&boot_params, boot,PARAM_SIZE ); -memcpy (boot_command_line, -__va (*(unsigned long *)((void *)&boot_params +NEW_CL_POINTER )), +memcpy (boot_command_line,__va (boot_params.hdr.cmd_line_ptr),COMMAND_LINE_SIZE ); paravirt_ops.name ="lguest" ;
PATCH 2/2 lguest update for mm: disable tsc, don't set PGE bit
Lguest guests don't use the TSC, and so we must disable it otherwise sched-clock.c barfs.
Also, we no longer need to explicitly set the PGE feature bit:cpu_detect->cpuid->lguest_cpuid does that for us now that cpu_detect uses paravirt_ops (IIRC it used to do a direct cpuid from assembler).
Signed-off-by Rusty Russell <[email protected]>
drivers/lguest/lguest.c +2 -2
@@ -504,10 +504,10 @@ __init void lguest_init(void *boot)reserve_top_address (lguest_data.reserve_mem);cpu_detect (&new_cpu_data); -/* Need this before paging_init. */ -set_bit (X86_FEATURE_PGE , new_cpu_data.x86_capability);/* Math is always hard! */ new_cpu_data.hard_math =1 ; + + tsc_disable =1 ;#ifdef CONFIG_X86_MCE mce_disabled =1 ;