mirror of
https://github.com/torvalds/linux.git
synced 2024-10-25 22:44:30 +00:00
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>
This commit is contained in:
parent
3435d3476c
commit
0a706db320
|
@ -2,6 +2,7 @@
|
||||||
*
|
*
|
||||||
* Copyright (C) 1991, 1992 Linus Torvalds
|
* Copyright (C) 1991, 1992 Linus Torvalds
|
||||||
* Copyright 2007 rPath, Inc. - All Rights Reserved
|
* Copyright 2007 rPath, Inc. - All Rights Reserved
|
||||||
|
* Copyright 2009 Intel Corporation; author H. Peter Anvin
|
||||||
*
|
*
|
||||||
* This file is part of the Linux kernel, and is made available under
|
* This file is part of the Linux kernel, and is made available under
|
||||||
* the terms of the GNU General Public License version 2.
|
* the terms of the GNU General Public License version 2.
|
||||||
|
@ -16,26 +17,22 @@
|
||||||
|
|
||||||
int query_mca(void)
|
int query_mca(void)
|
||||||
{
|
{
|
||||||
u8 err;
|
struct biosregs ireg, oreg;
|
||||||
u16 es, bx, len;
|
u16 len;
|
||||||
|
|
||||||
asm("pushw %%es ; "
|
initregs(&ireg);
|
||||||
"int $0x15 ; "
|
ireg.ah = 0xc0;
|
||||||
"setc %0 ; "
|
intcall(0x15, &ireg, &oreg);
|
||||||
"movw %%es, %1 ; "
|
|
||||||
"popw %%es"
|
|
||||||
: "=acd" (err), "=acdSD" (es), "=b" (bx)
|
|
||||||
: "a" (0xc000));
|
|
||||||
|
|
||||||
if (err)
|
if (oreg.eflags & X86_EFLAGS_CF)
|
||||||
return -1; /* No MCA present */
|
return -1; /* No MCA present */
|
||||||
|
|
||||||
set_fs(es);
|
set_fs(oreg.es);
|
||||||
len = rdfs16(bx);
|
len = rdfs16(oreg.bx);
|
||||||
|
|
||||||
if (len > sizeof(boot_params.sys_desc_table))
|
if (len > sizeof(boot_params.sys_desc_table))
|
||||||
len = sizeof(boot_params.sys_desc_table);
|
len = sizeof(boot_params.sys_desc_table);
|
||||||
|
|
||||||
copy_from_fs(&boot_params.sys_desc_table, bx, len);
|
copy_from_fs(&boot_params.sys_desc_table, oreg.bx, len);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user