[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-devel] [PATCH] x86: deny access to the ACPI PM timer I/O port range for Dom0



Also move the declaration of pmtmr_ioport to a suitable header file.

Signed-off-by: Jan Beulich <jbeulich@xxxxxxxxxx>

--- 2009-10-27.orig/xen/arch/x86/acpi/boot.c    2009-10-07 13:31:36.000000000 
+0200
+++ 2009-10-27/xen/arch/x86/acpi/boot.c 2009-10-27 12:11:36.000000000 +0100
@@ -332,10 +332,6 @@ static int __init acpi_parse_hpet(struct
 #define        acpi_parse_hpet NULL
 #endif
 
-#ifdef CONFIG_X86_PM_TIMER
-extern u32 pmtmr_ioport;
-#endif
-
 #ifdef CONFIG_ACPI_SLEEP
 #define acpi_fadt_copy_address(dst, src, len) do {                     \
        if (fadt->header.revision >= FADT2_REVISION_ID)                 \
--- 2009-10-27.orig/xen/arch/x86/acpi/cpu_idle.c        2009-10-07 
13:31:36.000000000 +0200
+++ 2009-10-27/xen/arch/x86/acpi/cpu_idle.c     2009-10-27 12:11:36.000000000 
+0100
@@ -56,7 +56,6 @@ static void lapic_timer_nop(void) { }
 static void (*lapic_timer_off)(void);
 static void (*lapic_timer_on)(void);
 
-extern u32 pmtmr_ioport;
 extern void (*pm_idle) (void);
 extern void (*dead_idle) (void);
 extern void menu_get_trace_data(u32 *expected, u32 *pred);
--- 2009-10-27.orig/xen/arch/x86/domain_build.c 2009-10-07 13:31:36.000000000 
+0200
+++ 2009-10-27/xen/arch/x86/domain_build.c      2009-10-27 12:12:24.000000000 
+0100
@@ -29,6 +29,7 @@
 #include <asm/paging.h>
 #include <asm/p2m.h>
 #include <asm/e820.h>
+#include <asm/acpi.h>
 #include <asm/bzimage.h> /* for bzimage_parse */
 
 #include <public/version.h>
@@ -1064,6 +1065,9 @@ int __init construct_dom0(
     rc |= ioports_deny_access(dom0, 0x40, 0x43);
     /* PIT Channel 2 / PC Speaker Control. */
     rc |= ioports_deny_access(dom0, 0x61, 0x61);
+    /* ACPI PM Timer. */
+    if ( pmtmr_ioport )
+        rc |= ioports_deny_access(dom0, pmtmr_ioport, pmtmr_ioport + 3);
     /* PCI configuration space (NB. 0xcf8 has special treatment). */
     rc |= ioports_deny_access(dom0, 0xcfc, 0xcff);
     /* Command-line I/O ranges. */
--- 2009-10-27.orig/xen/arch/x86/time.c 2009-10-27 12:04:10.000000000 +0100
+++ 2009-10-27/xen/arch/x86/time.c      2009-10-27 12:11:36.000000000 +0100
@@ -30,6 +30,7 @@
 #include <asm/fixmap.h>
 #include <asm/mc146818rtc.h>
 #include <asm/div64.h>
+#include <asm/acpi.h>
 #include <asm/hpet.h>
 #include <io_ports.h>
 #include <asm/setup.h> /* for early_time_init */
--- 2009-10-27.orig/xen/include/asm-x86/acpi.h  2009-10-07 13:31:36.000000000 
+0200
+++ 2009-10-27/xen/include/asm-x86/acpi.h       2009-10-27 12:11:36.000000000 
+0100
@@ -153,6 +153,8 @@ struct acpi_sleep_info {
 extern u8 x86_acpiid_to_apicid[];
 #define MAX_LOCAL_APIC 256
 
+extern u32 pmtmr_ioport;
+
 int acpi_dmar_init(void);
 void acpi_mmcfg_init(void);
 



Attachment: xen-x86-pmtmr-ioport-deny.patch
Description: Text document

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.