xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/2] Fix xen crash when starting HVM guest due to missing io handler
@ 2016-05-13 17:09 suravee.suthikulpanit
  2016-05-13 17:10 ` [PATCH 1/2] x86/hvm: Add check when register " suravee.suthikulpanit
  2016-05-13 17:10 ` [PATCH 2/2] svm: iommu: Only call guest_iommu_init() after initialized HVM domain suravee.suthikulpanit
  0 siblings, 2 replies; 3+ messages in thread
From: suravee.suthikulpanit @ 2016-05-13 17:09 UTC (permalink / raw)
  To: xen-devel, george.dunlap, ian.campbell, jbeulich
  Cc: paul.durrant, Suravee Suthikulpanit

From: Suravee Suthikulpanit <Suravee.Suthikulpanit@amd.com>

Hi All,

On systems with iommu v2 enabled, the hypervisor crashes when trying
to start up an HVM guest. 

Investigating shows that the guest_iommu_init() is called before the
HVM domain is initialized. It then tries to register_mmio_handler()
causing the hvm_next_io_handler() to increment the io_handler_count.
However, the registration fails silently and left the I/O handler
uninitialized.

At later time, hvm_find_io_handler() is called and iterate through
the registered handlered, but then resulting in referencing NULL
pointers.

This patch series proposes fix for this issue.

NOTE: For patch 2, since guest IOMMU emulation is still incompleted,
this change is tentative and will be verified in the future. Alterantively,
I can just simply remove the guest_iommu_init()/destroy() for now.
I will be also looking at re-enabling this feature in Xen.

Thanks,
Suravee

Suravee Suthikulpanit (2):
  x86/hvm: Add check when register io handler
  svm: iommu: Only call guest_iommu_init() after initialized HVM domain

 xen/arch/x86/hvm/intercept.c                |  8 ++++++--
 xen/arch/x86/hvm/svm/svm.c                  | 10 ++++++++++
 xen/drivers/passthrough/amd/iommu_guest.c   |  6 ++++++
 xen/drivers/passthrough/amd/pci_amd_iommu.c |  4 ----
 4 files changed, 22 insertions(+), 6 deletions(-)

-- 
1.9.1


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

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

end of thread, other threads:[~2016-05-13 17:10 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-05-13 17:09 [PATCH 0/2] Fix xen crash when starting HVM guest due to missing io handler suravee.suthikulpanit
2016-05-13 17:10 ` [PATCH 1/2] x86/hvm: Add check when register " suravee.suthikulpanit
2016-05-13 17:10 ` [PATCH 2/2] svm: iommu: Only call guest_iommu_init() after initialized HVM domain suravee.suthikulpanit

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).