diff options
author | Keir Fraser <keir@xensource.com> | 2007-09-26 14:14:16 +0100 |
---|---|---|
committer | Keir Fraser <keir@xensource.com> | 2007-09-26 14:14:16 +0100 |
commit | 1906b3ab6683ce6669d298279211bca575eea2ed (patch) | |
tree | 7deeef1ead7680dfae582228ff4e116e86ae295c /xen/arch/x86/dmi_scan.c | |
parent | b85210e23c64c43efefa86fa1f701d5172d4556b (diff) | |
download | xen-1906b3ab6683ce6669d298279211bca575eea2ed.tar.gz xen-1906b3ab6683ce6669d298279211bca575eea2ed.tar.bz2 xen-1906b3ab6683ce6669d298279211bca575eea2ed.zip |
x86: force DMI table to not be in E820 RAM region
In order for Dom0 to be able to map the DMI table, it must not be in
E820 RAM; since some BIOS versions apparently fail to set the type
correctly for the page(s) containing this table, adjust it before
starting to consume memory.
Signed-off-by: Jan Beulich <jbeulich@novell.com>
Signed-off-by: Keir Fraser <keir@xensource.com>
Diffstat (limited to 'xen/arch/x86/dmi_scan.c')
-rw-r--r-- | xen/arch/x86/dmi_scan.c | 29 |
1 files changed, 19 insertions, 10 deletions
diff --git a/xen/arch/x86/dmi_scan.c b/xen/arch/x86/dmi_scan.c index 1827d83061..cdc4674bdc 100644 --- a/xen/arch/x86/dmi_scan.c +++ b/xen/arch/x86/dmi_scan.c @@ -100,23 +100,32 @@ inline static int __init dmi_checksum(u8 *buf) return (sum==0); } +int __init dmi_get_table(u32 *base, u32 *len) +{ + u8 buf[15]; + char __iomem *p, *q; + + p = maddr_to_virt(0xF0000); + for (q = p; q < p + 0x10000; q += 16) { + memcpy_fromio(buf, q, 15); + if (memcmp(buf, "_DMI_", 5)==0 && dmi_checksum(buf)) { + *base=buf[11]<<24|buf[10]<<16|buf[9]<<8|buf[8]; + *len=buf[7]<<8|buf[6]; + return 0; + } + } + return -1; +} + static int __init dmi_iterate(void (*decode)(struct dmi_header *)) { u8 buf[15]; char __iomem *p, *q; - /* - * no iounmap() for that ioremap(); it would be a no-op, but it's - * so early in setup that sucker gets confused into doing what - * it shouldn't if we actually call it. - */ - p = ioremap(0xF0000, 0x10000); - if (p == NULL) - return -1; + p = maddr_to_virt(0xF0000); for (q = p; q < p + 0x10000; q += 16) { memcpy_fromio(buf, q, 15); - if(memcmp(buf, "_DMI_", 5)==0 && dmi_checksum(buf)) - { + if (memcmp(buf, "_DMI_", 5)==0 && dmi_checksum(buf)) { u16 num=buf[13]<<8|buf[12]; u16 len=buf[7]<<8|buf[6]; u32 base=buf[11]<<24|buf[10]<<16|buf[9]<<8|buf[8]; |