Skip to content

Commit

Permalink
lguest: restrict CPUID to avoid perf counter wrmsr
Browse files Browse the repository at this point in the history
Avoid the following:
[    0.012093] WARNING: at arch/x86/kernel/apic/apic.c:249 native_apic_write_dummy+0x2f/0x40()

Rather than chase each new cpuid-detected feature, just lie about the highest
valid CPUID so this code is never run.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
  • Loading branch information
Rusty Russell committed Jul 17, 2009
1 parent 27de22d commit 7a50492
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions arch/x86/lguest/boot.c
Original file line number Diff line number Diff line change
Expand Up @@ -379,6 +379,11 @@ static void lguest_cpuid(unsigned int *ax, unsigned int *bx,

native_cpuid(ax, bx, cx, dx);
switch (function) {
case 0: /* ID and highest CPUID. Futureproof a little by sticking to
* older ones. */
if (*ax > 5)
*ax = 5;
break;
case 1: /* Basic feature request. */
/* We only allow kernel to see SSE3, CMPXCHG16B and SSSE3 */
*cx &= 0x00002201;
Expand Down

0 comments on commit 7a50492

Please sign in to comment.