direct-io.hg

view patches/linux-2.6.16.29/i386-mach-io-check-nmi.patch @ 11750:d845c9522d9e

[HVM][SVM] Check if SVM is disabled by the BIOS before enabling it.

Newer BIOS implementations will be able to disable the SVM feature,
although an additional test of an MSR (VMCR 0xC0010114 bit 4) is
necessary (set equals disabled). Bit 4 of MSR 0xc0010114 returns 0
(SVM enabled) on machines with older BIOS' without the SVM disable
feature support.

Signed-off-by: Wei Huang <wei.huang2@amd.com>=20
Signed-off-by: Tom Woller <thomas.woller@amd.com>=20
author kfraser@localhost.localdomain
date Thu Oct 12 16:12:10 2006 +0100 (2006-10-12)
parents 041be3f6b38e
children
line source
1 diff -pruN ../orig-linux-2.6.16.29/arch/i386/kernel/traps.c ./arch/i386/kernel/traps.c
2 --- ../orig-linux-2.6.16.29/arch/i386/kernel/traps.c 2006-09-12 19:02:10.000000000 +0100
3 +++ ./arch/i386/kernel/traps.c 2006-09-19 13:59:06.000000000 +0100
4 @@ -567,18 +567,11 @@ static void mem_parity_error(unsigned ch
6 static void io_check_error(unsigned char reason, struct pt_regs * regs)
7 {
8 - unsigned long i;
9 -
10 printk(KERN_EMERG "NMI: IOCK error (debug interrupt?)\n");
11 show_registers(regs);
13 /* Re-enable the IOCK line, wait for a few seconds */
14 - reason = (reason & 0xf) | 8;
15 - outb(reason, 0x61);
16 - i = 2000;
17 - while (--i) udelay(1000);
18 - reason &= ~8;
19 - outb(reason, 0x61);
20 + clear_io_check_error(reason);
21 }
23 static void unknown_nmi_error(unsigned char reason, struct pt_regs * regs)
24 diff -pruN ../orig-linux-2.6.16.29/include/asm-i386/mach-default/mach_traps.h ./include/asm-i386/mach-default/mach_traps.h
25 --- ../orig-linux-2.6.16.29/include/asm-i386/mach-default/mach_traps.h 2006-09-12 19:02:10.000000000 +0100
26 +++ ./include/asm-i386/mach-default/mach_traps.h 2006-09-19 13:59:06.000000000 +0100
27 @@ -15,6 +15,18 @@ static inline void clear_mem_error(unsig
28 outb(reason, 0x61);
29 }
31 +static inline void clear_io_check_error(unsigned char reason)
32 +{
33 + unsigned long i;
34 +
35 + reason = (reason & 0xf) | 8;
36 + outb(reason, 0x61);
37 + i = 2000;
38 + while (--i) udelay(1000);
39 + reason &= ~8;
40 + outb(reason, 0x61);
41 +}
42 +
43 static inline unsigned char get_nmi_reason(void)
44 {
45 return inb(0x61);