xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v3 0/3] Fix xen crash when starting HVM guest due to missing io handler
@ 2016-05-21 23:42 suravee.suthikulpanit
  2016-05-21 23:42 ` [PATCH v3 1/3] x86/hvm: Add check when register " suravee.suthikulpanit
                   ` (3 more replies)
  0 siblings, 4 replies; 19+ messages in thread
From: suravee.suthikulpanit @ 2016-05-21 23:42 UTC (permalink / raw)
  To: xen-devel, paul.durrant, jbeulich, george.dunlap
  Cc: keir, Suravee Suthikulpanit

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

Hi All,

Changes from V2:
  * Use assert instead of sanity check before count increment in
    the hvm_next_io_handler().
  * Post-pone iommu_domain_init() and add proper error handling code
    to destroy hvm in case of failure.
  * Split out sanity check in guest_iommu_init() into a separate patch.

OVERVIEW:
 
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.

Thanks,
Suravee

Suravee Suthikulpanit (3):
  x86/hvm: Add check when register io handler
  svm: iommu: Only call guest_iommu_init() after initialized HVM domain
  AMD IOMMU: Check io_handler before registering mmio handler

 xen/arch/x86/domain.c                     | 9 ++++++---
 xen/arch/x86/hvm/intercept.c              | 2 ++
 xen/drivers/passthrough/amd/iommu_guest.c | 6 ++++++
 3 files changed, 14 insertions(+), 3 deletions(-)

-- 
1.9.1


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

^ permalink raw reply	[flat|nested] 19+ messages in thread
* [PATCH v3 0/3] Fix xen crash when starting HVM guest due to missing io handler
@ 2016-05-21 23:33 suravee.suthikulpanit
  2016-05-21 23:33 ` [PATCH v3 1/3] x86/hvm: Add check when register " suravee.suthikulpanit
  0 siblings, 1 reply; 19+ messages in thread
From: suravee.suthikulpanit @ 2016-05-21 23:33 UTC (permalink / raw)
  To: xen-devel, paul.durrant, jbeulich, george.dunlap
  Cc: keir, Suravee Suthikulpanit

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

Hi All,

Changes from V2:
  * Use assert instead of sanity check before count increment in
    the hvm_next_io_handler().
  * Post-pone iommu_domain_init() and add proper error handling code
    to destroy hvm in case of failure.
  * Split out sanity check in guest_iommu_init() into a separate patch.

OVERVIEW:
 
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.

Thanks,
Suravee

Suravee Suthikulpanit (3):
  x86/hvm: Add check when register io handler
  svm: iommu: Only call guest_iommu_init() after initialized HVM domain
  AMD IOMMU: Check io_handler before registering mmio handler

 xen/arch/x86/domain.c                     | 9 ++++++---
 xen/arch/x86/hvm/intercept.c              | 2 ++
 xen/drivers/passthrough/amd/iommu_guest.c | 6 ++++++
 3 files changed, 14 insertions(+), 3 deletions(-)

-- 
1.9.1


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

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

end of thread, other threads:[~2016-06-01  7:55 UTC | newest]

Thread overview: 19+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-05-21 23:42 [PATCH v3 0/3] Fix xen crash when starting HVM guest due to missing io handler suravee.suthikulpanit
2016-05-21 23:42 ` [PATCH v3 1/3] x86/hvm: Add check when register " suravee.suthikulpanit
2016-05-23  8:17   ` Paul Durrant
2016-05-23 11:46   ` Jan Beulich
2016-05-25 19:04     ` Suravee Suthikulanit
2016-05-21 23:42 ` [PATCH v3 2/3] svm: iommu: Only call guest_iommu_init() after initialized HVM domain suravee.suthikulpanit
2016-05-23  8:21   ` Paul Durrant
2016-05-23 11:54   ` Jan Beulich
2016-05-25 19:00     ` Suravee Suthikulanit
2016-05-26 15:44       ` Jan Beulich
2016-05-31 21:11         ` Suravee Suthikulanit
2016-06-01  7:55           ` Jan Beulich
2016-05-21 23:42 ` [PATCH v3 3/3] AMD IOMMU: Check io_handler before registering mmio handler suravee.suthikulpanit
2016-05-23  8:23   ` Paul Durrant
2016-05-25 18:52     ` Suravee Suthikulanit
2016-05-26  8:28       ` Paul Durrant
2016-05-26 15:47       ` Jan Beulich
2016-05-21 23:47 ` [PATCH v3 0/3] Fix xen crash when starting HVM guest due to missing io handler Suravee Suthikulpanit
  -- strict thread matches above, loose matches on Subject: below --
2016-05-21 23:33 suravee.suthikulpanit
2016-05-21 23:33 ` [PATCH v3 1/3] x86/hvm: Add check when register " 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).