Revert "x86: add the RTC io space to the blocked access list"
authorJan Beulich <jbeulich@suse.com>
Fri, 8 May 2015 12:12:20 +0000 (14:12 +0200)
committerJan Beulich <jbeulich@suse.com>
Fri, 8 May 2015 12:12:20 +0000 (14:12 +0200)
This reverts commit 3b22924062b2648b3df83e9ebda6da52a28c1316, as it
breaks Dom0 access to CMOS/RTC.

xen/arch/x86/domain_build.c
xen/arch/x86/traps.c

index 2a23746a8270368b115137f735262800884c6844..03e4bfeb84f3b201b94eff4fba433309b3cc27fc 100644 (file)
@@ -37,7 +37,6 @@
 #include <asm/io_apic.h>
 #include <asm/hap.h>
 #include <asm/hpet.h>
-#include <asm/mc146818rtc.h>
 
 #include <public/version.h>
 
@@ -1549,8 +1548,6 @@ int __init construct_dom0(
         rc |= ioports_deny_access(d, pmtmr_ioport, pmtmr_ioport + 3);
     /* PCI configuration space (NB. 0xcf8 has special treatment). */
     rc |= ioports_deny_access(d, 0xcfc, 0xcff);
-    /* Never permit direct access to the RTC/CMOS registers. */
-    rc |= ioports_deny_access(d, RTC_PORT(0), RTC_PORT(1));
     /* Command-line I/O ranges. */
     process_dom0_ioports_disable(d);
 
index 0b0c5e96def5a73a6834dd981d8502406fca321f..22cdfc48ae8e4e19d5d3a930d1266ce2baed735e 100644 (file)
@@ -1765,6 +1765,10 @@ static int admin_io_okay(
     if ( (port == 0xcf8) && (bytes == 4) )
         return 0;
 
+    /* We also never permit direct access to the RTC/CMOS registers. */
+    if ( ((port & ~1) == RTC_PORT(0)) )
+        return 0;
+
     return ioports_access_permitted(v->domain, port, port + bytes - 1);
 }