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

[Xen-changelog] [xen master] x86/pvh: trap access to sensitive IO ports



commit 72d5acdc1d5b83107066e25054f9119e7771cf70
Author:     Roger Pau Monné <roger.pau@xxxxxxxxxx>
AuthorDate: Wed May 20 13:27:23 2015 +0200
Commit:     Jan Beulich <jbeulich@xxxxxxxx>
CommitDate: Wed May 20 13:27:23 2015 +0200

    x86/pvh: trap access to sensitive IO ports

    This is needed so Xen can properly trap 4 byte accesses to 0xcf8 in order to
    keep consistency with accesses to 0xcfc.

    The access to RTC ports also needs to be trapped in order to keep
    consistency, this includes RTC_PORT(0) and RTC_PORT(1) (0x70 and 0x71
    respectively).

    Signed-off-by: Roger Pau Monné <roger.pau@xxxxxxxxxx>
---
 xen/arch/x86/setup.c |   11 +++++++++++
 1 files changed, 11 insertions(+), 0 deletions(-)

diff --git a/xen/arch/x86/setup.c b/xen/arch/x86/setup.c
index cd333f9..2cc9185 100644
--- a/xen/arch/x86/setup.c
+++ b/xen/arch/x86/setup.c
@@ -49,6 +49,7 @@
 #include <xen/cpu.h>
 #include <asm/nmi.h>
 #include <asm/alternative.h>
+#include <asm/mc146818rtc.h>

 /* opt_nosmp: If true, secondary processors are ignored. */
 static bool_t __initdata opt_nosmp;
@@ -1534,6 +1535,16 @@ void __hwdom_init setup_io_bitmap(struct domain *d)
         rc = rangeset_report_ranges(d->arch.ioport_caps, 0, 0x10000,
                                     io_bitmap_cb, d);
         BUG_ON(rc);
+        /*
+         * NB: we need to trap accesses to 0xcf8 in order to intercept
+         * 4 byte accesses, that need to be handled by Xen in order to
+         * keep consistency.
+         * Access to 1 byte RTC ports also needs to be trapped in order
+         * to keep consistency with PV.
+         */
+        __set_bit(0xcf8, d->arch.hvm_domain.io_bitmap);
+        __set_bit(RTC_PORT(0), d->arch.hvm_domain.io_bitmap);
+        __set_bit(RTC_PORT(1), d->arch.hvm_domain.io_bitmap);
     }
 }

--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog

 


Rackspace

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