Skip to contentSkip to conversation

x86: fix hvm_migrate_irq assertion

PATCH In review Wei Liu 3 participants 4 messages Nov 12, 2018

lore
Share & tools
lore

Wei Liu

author
#0 lore raw

PATCH 1/1 x86: fix hvm_migrate_irq assertion

782cf8ba46 ("pass-through: adjust pIRQ migration") added an assertion to hvm_migrate_irq.

PVH Dom0 is broken because it doesn't have dpci allocated. Add an is_hardware_domain check to the assertion.

---
 xen/arch/x86/hvm/hvm.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
xen/arch/x86/hvm/hvm.c +2 -1
index 519282937b..5d263c4090 100644
@@ -464,7 +464,8 @@ void hvm_migrate_timers(struct vcpu *v)
 
 void hvm_migrate_pirq(struct hvm_pirq_dpci *pirq_dpci, const struct vcpu *v)
 {
-    ASSERT(iommu_enabled && hvm_domain_irq(v->domain)->dpci);
+    ASSERT(iommu_enabled &&
+           (is_hardware_domain(v->domain) || hvm_domain_irq(v->domain)->dpci));
 
     if ( (pirq_dpci->flags & HVM_IRQ_DPCI_MACH_MSI) &&
          /* Needn't migrate pirq if this pirq is delivered to guest directly.*/
Signature · 7 lines
2.11.0


_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel
Reviewed-by on v1 1/1
#1 lore raw
Quoted 8 lines
Quoted 1 line
Quoted 1 line · On 12.11.18 at 15:04, <[email protected]> wrote:

782cf8ba46 ("pass-through: adjust pIRQ migration") added an assertion to hvm_migrate_irq.

PVH Dom0 is broken because it doesn't have dpci allocated. Add an is_hardware_domain check to the assertion.

I'm sorry for the breakage.

Jan

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel

author
#2 lore raw
Quoted 4 lines · Jan Beulich
Quoted 4 lines
Quoted 1 line
Quoted 1 line · On 12.11.18 at 15:04, <[email protected]> wrote:

782cf8ba46 ("pass-through: adjust pIRQ migration") added an assertion to hvm_migrate_irq.

Quoted 9 lines
Quoted 4 lines

PVH Dom0 is broken because it doesn't have dpci allocated. Add an is_hardware_domain check to the assertion.

I'm sorry for the breakage.

No worries. I should have noticed this while reviewing your patch, so I don't blame you.

Wei.

Quoted 3 lines

Jan

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel

Reviewed-by on v1 1/1
#3 lore raw
In reply to Wei Liu
Quoted 7 lines · Wei Liu

782cf8ba46 ("pass-through: adjust pIRQ migration") added an assertion to hvm_migrate_irq.

PVH Dom0 is broken because it doesn't have dpci allocated. Add an is_hardware_domain check to the assertion.

Quoted 9 lines
---
 xen/arch/x86/hvm/hvm.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
xen/arch/x86/hvm/hvm.c +0 -0
index 519282937b..5d263c4090 100644

xen/arch/x86/hvm/hvm.c void hvm_migrate_timers(struct vcpu *v) · line 468

Quoted 6 lines
xen/arch/x86/hvm/hvm.c +2 -1
@@ -464,7 +464,8 @@ void hvm_migrate_timers(struct vcpu *v)
 
 void hvm_migrate_pirq(struct hvm_pirq_dpci *pirq_dpci, const struct vcpu *v)
 {
-    ASSERT(iommu_enabled && hvm_domain_irq(v->domain)->dpci);
+    ASSERT(iommu_enabled &&
+           (is_hardware_domain(v->domain) || hvm_domain_irq(v->domain)->dpci));

Albeit I would just remove the hvm_domain_irq(v->domain)->dpci part of the assert, AFAICT the function doesn't use it at all.

Thanks, Roger.

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel