Skip to contentSkip to conversation

x86/pvh: Initialize ioreq server for PVH guests

PATCH In review Boris Ostrovsky 2 participants 2 messages Apr 4, 2016 – Apr 5, 2016

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 x86/pvh: Initialize ioreq server for PVH guests

ioreq server list needs to be initialized for PVH guests. This list is walked in handle_hvm_io_completion() by all guests in HVM containers and leaving it uninitialized may cause PVH guests to crash there.

---
 xen/arch/x86/hvm/hvm.c   | 4 ++--
 xen/arch/x86/hvm/ioreq.c | 3 ++-
 2 files changed, 4 insertions(+), 3 deletions(-)
xen/arch/x86/hvm/hvm.c +2 -2
index 9d4e5b8..a82318a 100644
@@ -621,6 +621,8 @@ int hvm_domain_initialise(struct domain *d)
 
     register_dpci_portio_handler(d);
 
+    hvm_ioreq_init(d);
+
     if ( is_pvh_domain(d) )
     {
         register_portio_handler(d, 0, 0x10003, handle_pvh_io);
@@ -645,8 +647,6 @@ int hvm_domain_initialise(struct domain *d)
 
     register_portio_handler(d, 0xe9, 1, hvm_print_line);
 
-    hvm_ioreq_init(d);
-
     if ( hvm_tsc_scaling_supported )
         d->arch.hvm_domain.tsc_scaling_ratio = hvm_default_tsc_scaling_ratio;
 
xen/arch/x86/hvm/ioreq.c +2 -1
index e640eff..690e478 100644
@@ -1361,7 +1361,8 @@ void hvm_ioreq_init(struct domain *d)
     spin_lock_init(&d->arch.hvm_domain.ioreq_server.lock);
     INIT_LIST_HEAD(&d->arch.hvm_domain.ioreq_server.list);
 
-    register_portio_handler(d, 0xcf8, 4, hvm_access_cf8);
+    if ( !is_pvh_domain(d) )
+        register_portio_handler(d, 0xcf8, 4, hvm_access_cf8);
 }
 
 /*
Signature · 7 lines
1.8.1.4


_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel
Reviewed-by on v1 1/1
#1 lore raw
Quoted 6 lines
Quoted 1 line
Quoted 1 line · On 04.04.16 at 23:05, <[email protected]> wrote:

ioreq server list needs to be initialized for PVH guests. This list is walked in handle_hvm_io_completion() by all guests in HVM containers and leaving it uninitialized may cause PVH guests to crash there.

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel