[VTD] Fixes to ACPI DMAR flag checks.
authorAllen Kay <allen.m.kay@intel.com>
Wed, 6 Apr 2011 08:11:02 +0000 (09:11 +0100)
committerAllen Kay <allen.m.kay@intel.com>
Wed, 6 Apr 2011 08:11:02 +0000 (09:11 +0100)
 * platform_supports_{intremap,x2apic} should not be marked __init as
   they are used during S3 resume.
 * DMAR flags should be taken from the table passed to
   acpi_parse_dmar() -- this is the trusted copy of the DMAR, when
   running in TXT mode.

Signed-off-by: Allen Kay <allen.m.kay@intel.com>
xen/drivers/passthrough/vtd/dmar.c
xen/drivers/passthrough/vtd/extern.h

index aadbe1b058611420272521343e12bbb3758c5491..26e1305954513e789bd9bfe899dc7dc5b06a9ed9 100644 (file)
@@ -675,6 +675,7 @@ static int __init acpi_parse_dmar(struct acpi_table_header *table)
     int ret = 0;
 
     dmar = (struct acpi_table_dmar *)table;
+    dmar_flags = dmar->flags;
 
     if ( !iommu_enabled )
     {
@@ -762,12 +763,7 @@ out:
 
 int __init acpi_dmar_init(void)
 {
-    struct acpi_table_dmar *dmar;
-
     acpi_get_table(ACPI_SIG_DMAR, 0, &dmar_table);
-    dmar = (struct acpi_table_dmar *) dmar_table;
-    dmar_flags = dmar->flags;
-
     return parse_dmar_table(acpi_parse_dmar);
 }
 
@@ -787,7 +783,7 @@ void acpi_dmar_zap(void)
     dmar_table->checksum -= 'X'-'D';
 }
 
-int __init platform_supports_intremap(void)
+int platform_supports_intremap(void)
 {
     unsigned int flags = 0;
 
@@ -795,7 +791,7 @@ int __init platform_supports_intremap(void)
     return ((dmar_flags & flags) == DMAR_INTR_REMAP);
 }
 
-int __init platform_supports_x2apic(void)
+int platform_supports_x2apic(void)
 {
     unsigned int flags = 0;
 
index a9c3f1c33920dc5b862c4bc97170f00881c5b446..60b7ac44f2194be832517d8d94397396b1cda71a 100644 (file)
@@ -119,7 +119,7 @@ void vtd_ops_preamble_quirk(struct iommu* iommu);
 void vtd_ops_postamble_quirk(struct iommu* iommu);
 void me_wifi_quirk(struct domain *domain, u8 bus, u8 devfn, int map);
 void pci_vtd_quirk(struct pci_dev *pdev);
-int __init platform_supports_intremap(void);
-int __init platform_supports_x2apic(void);
+int platform_supports_intremap(void);
+int platform_supports_x2apic(void);
 
 #endif // _VTD_EXTERN_H_