aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJan Beulich <jbeulich@suse.com>2013-02-25 13:20:22 +0100
committerJan Beulich <jbeulich@suse.com>2013-02-25 13:20:22 +0100
commitb5445b141f6809dd4fa3ee4a11926eab6fc1f50c (patch)
treecc04ca978619eb0af98a467c330e9a25931d1d1c
parent6f0f339dd4378d062a211969f45cd23af12bf386 (diff)
downloadxen-b5445b141f6809dd4fa3ee4a11926eab6fc1f50c.tar.gz
xen-b5445b141f6809dd4fa3ee4a11926eab6fc1f50c.tar.bz2
xen-b5445b141f6809dd4fa3ee4a11926eab6fc1f50c.zip
x86_32: fix acpi_dmar_init()
map_pages_to_xen() can't be used here on x86_32, need to use up to 2 newly introduced fixmap entries for this instead. Signed-off-by: Jan Beulich <jbeulich@suse.com>
-rw-r--r--xen/drivers/passthrough/vtd/dmar.c15
-rw-r--r--xen/include/asm-x86/fixmap.h2
2 files changed, 17 insertions, 0 deletions
diff --git a/xen/drivers/passthrough/vtd/dmar.c b/xen/drivers/passthrough/vtd/dmar.c
index 73ad1d7dbd..a88f46b5b3 100644
--- a/xen/drivers/passthrough/vtd/dmar.c
+++ b/xen/drivers/passthrough/vtd/dmar.c
@@ -776,6 +776,7 @@ out:
}
#ifdef CONFIG_X86
+#include <asm/fixmap.h>
#include <asm/tboot.h>
/* ACPI tables may not be DMA protected by tboot, so use DMAR copy */
/* SINIT saved in SinitMleData in TXT heap (which is DMA protected) */
@@ -792,12 +793,26 @@ int __init acpi_dmar_init(void)
if ( ACPI_SUCCESS(acpi_get_table_phys(ACPI_SIG_DMAR, 0,
&dmar_addr, &dmar_len)) )
{
+#ifdef CONFIG_X86_32
+ if ( dmar_addr + dmar_len > (DIRECTMAP_MBYTES << 20) )
+ {
+ unsigned long offset = dmar_addr & (PAGE_SIZE - 1);
+ unsigned long mapped_size = PAGE_SIZE - offset;
+
+ set_fixmap(FIX_DMAR_ZAP_LO, dmar_addr);
+ if ( mapped_size < sizeof(*dmar_table) )
+ set_fixmap(FIX_DMAR_ZAP_HI, dmar_addr + PAGE_SIZE);
+ dmar_table = (void *)fix_to_virt(FIX_DMAR_ZAP_LO) + offset;
+ goto exit;
+ }
+#endif
map_pages_to_xen((unsigned long)__va(dmar_addr), PFN_DOWN(dmar_addr),
PFN_UP(dmar_addr + dmar_len) - PFN_DOWN(dmar_addr),
PAGE_HYPERVISOR);
dmar_table = __va(dmar_addr);
}
+ exit: __attribute__((__unused__))
return parse_dmar_table(acpi_parse_dmar);
}
diff --git a/xen/include/asm-x86/fixmap.h b/xen/include/asm-x86/fixmap.h
index 695e8d95f8..0a7aafa830 100644
--- a/xen/include/asm-x86/fixmap.h
+++ b/xen/include/asm-x86/fixmap.h
@@ -37,6 +37,8 @@ enum fixed_addresses {
FIX_PAE_HIGHMEM_END = FIX_PAE_HIGHMEM_0 + NR_CPUS-1,
#define FIX_VGC_END FIX_PAE_HIGHMEM_0
#define FIX_VGC_BEGIN FIX_PAE_HIGHMEM_END
+ FIX_DMAR_ZAP_HI,
+ FIX_DMAR_ZAP_LO,
#else
FIX_VGC_END,
FIX_VGC_BEGIN = FIX_VGC_END