Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

x86, setup: "glove box" BIOS interrupts in the MCA code

Impact: BIOS proofing

"Glove box" off BIOS interrupts in the MCA code.

LKML-Reference: <49DE7F79.4030106@zytor.com>
Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
Cc: James Bottomley <James.Bottomley@HansenPartnership.com>

authored by

H. Peter Anvin and committed by
H. Peter Anvin
0a706db3 3435d347

+10 -13
+10 -13
arch/x86/boot/mca.c
··· 2 2 * 3 3 * Copyright (C) 1991, 1992 Linus Torvalds 4 4 * Copyright 2007 rPath, Inc. - All Rights Reserved 5 + * Copyright 2009 Intel Corporation; author H. Peter Anvin 5 6 * 6 7 * This file is part of the Linux kernel, and is made available under 7 8 * the terms of the GNU General Public License version 2. ··· 17 16 18 17 int query_mca(void) 19 18 { 20 - u8 err; 21 - u16 es, bx, len; 19 + struct biosregs ireg, oreg; 20 + u16 len; 22 21 23 - asm("pushw %%es ; " 24 - "int $0x15 ; " 25 - "setc %0 ; " 26 - "movw %%es, %1 ; " 27 - "popw %%es" 28 - : "=acd" (err), "=acdSD" (es), "=b" (bx) 29 - : "a" (0xc000)); 22 + initregs(&ireg); 23 + ireg.ah = 0xc0; 24 + intcall(0x15, &ireg, &oreg); 30 25 31 - if (err) 26 + if (oreg.eflags & X86_EFLAGS_CF) 32 27 return -1; /* No MCA present */ 33 28 34 - set_fs(es); 35 - len = rdfs16(bx); 29 + set_fs(oreg.es); 30 + len = rdfs16(oreg.bx); 36 31 37 32 if (len > sizeof(boot_params.sys_desc_table)) 38 33 len = sizeof(boot_params.sys_desc_table); 39 34 40 - copy_from_fs(&boot_params.sys_desc_table, bx, len); 35 + copy_from_fs(&boot_params.sys_desc_table, oreg.bx, len); 41 36 return 0; 42 37 }