xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] x86/pvh: Initialize ioreq server for PVH guests
@ 2016-04-04 21:05 Boris Ostrovsky
  2016-04-05  8:15 ` Jan Beulich
  0 siblings, 1 reply; 2+ messages in thread
From: Boris Ostrovsky @ 2016-04-04 21:05 UTC (permalink / raw)
  To: keir, jbeulich, andrew.cooper3, paul.durrant; +Cc: Boris Ostrovsky, xen-devel

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.

Signed-off-by: Boris Ostrovsky <boris.ostrovsky@oracle.com>
---
 xen/arch/x86/hvm/hvm.c   | 4 ++--
 xen/arch/x86/hvm/ioreq.c | 3 ++-
 2 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/xen/arch/x86/hvm/hvm.c b/xen/arch/x86/hvm/hvm.c
index 9d4e5b8..a82318a 100644
--- a/xen/arch/x86/hvm/hvm.c
+++ b/xen/arch/x86/hvm/hvm.c
@@ -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;
 
diff --git a/xen/arch/x86/hvm/ioreq.c b/xen/arch/x86/hvm/ioreq.c
index e640eff..690e478 100644
--- a/xen/arch/x86/hvm/ioreq.c
+++ b/xen/arch/x86/hvm/ioreq.c
@@ -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);
 }
 
 /*
-- 
1.8.1.4


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] x86/pvh: Initialize ioreq server for PVH guests
  2016-04-04 21:05 [PATCH] x86/pvh: Initialize ioreq server for PVH guests Boris Ostrovsky
@ 2016-04-05  8:15 ` Jan Beulich
  0 siblings, 0 replies; 2+ messages in thread
From: Jan Beulich @ 2016-04-05  8:15 UTC (permalink / raw)
  To: Boris Ostrovsky; +Cc: andrew.cooper3, paul.durrant, keir, xen-devel

>>> On 04.04.16 at 23:05, <boris.ostrovsky@oracle.com> 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.
> 
> Signed-off-by: Boris Ostrovsky <boris.ostrovsky@oracle.com>

Reviewed-by: Jan Beulich <jbeulich@suse.com>




_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2016-04-05  8:15 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-04-04 21:05 [PATCH] x86/pvh: Initialize ioreq server for PVH guests Boris Ostrovsky
2016-04-05  8:15 ` Jan Beulich

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).