xen/pvh: trap access to sensitive IO ports
PATCH v3 1/1 xen/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 same treatment is needed for RTC ports.
Signed-off-by Roger Pau Monné <[email protected]>
Cc Jan Beulich <[email protected]>
Cc Andrew Cooper <[email protected]>
---
Changes since v2:
- Trap RTC ports.
Changes since v1:
- Only trap on accesses to 0xcf8.
--- xen/arch/x86/setup.c | 9 +++++++++ 1 file changed, 9 insertions(+)
xen/arch/x86/setup.c +9 -0
@@ -1535,6 +1535,15 @@ 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. +* The same applies to RTC ports. +*/ +__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); } }
Signature · 7 lines
1.9.5 (Apple Git-50.3) _______________________________________________ Xen-devel mailing list [email protected] http://lists.xen.org/xen-devel
Quoted 4 lines
Quoted 1 line
Quoted 1 line · On 08.05.15 at 16:05, <[email protected]> wrote:
This is needed so Xen can properly trap 4 byte accesses to
0xcf8in order to keep consistency with accesses to0xcfc. The same treatment is needed for RTC ports.
I guess I'll try to remember re-wording this and the respective code comment on commit: "The same" can be mistaken to also include the "4 byte accesses".
Jan