All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] x86: fix hvm_migrate_irq assertion
@ 2018-11-12 14:04 Wei Liu
  2018-11-12 14:35 ` Jan Beulich
  2018-11-12 14:52 ` Roger Pau Monné
  0 siblings, 2 replies; 4+ messages in thread
From: Wei Liu @ 2018-11-12 14:04 UTC (permalink / raw)
  To: xen-devel; +Cc: Andrew Cooper, Wei Liu, Jan Beulich, Roger Pau Monné

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.

Signed-off-by: Wei Liu <wei.liu2@citrix.com>
---
 xen/arch/x86/hvm/hvm.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/xen/arch/x86/hvm/hvm.c b/xen/arch/x86/hvm/hvm.c
index 519282937b..5d263c4090 100644
--- a/xen/arch/x86/hvm/hvm.c
+++ b/xen/arch/x86/hvm/hvm.c
@@ -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.*/
-- 
2.11.0


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

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

* Re: [PATCH] x86: fix hvm_migrate_irq assertion
  2018-11-12 14:04 [PATCH] x86: fix hvm_migrate_irq assertion Wei Liu
@ 2018-11-12 14:35 ` Jan Beulich
  2018-11-12 15:13   ` Wei Liu
  2018-11-12 14:52 ` Roger Pau Monné
  1 sibling, 1 reply; 4+ messages in thread
From: Jan Beulich @ 2018-11-12 14:35 UTC (permalink / raw)
  To: Wei Liu; +Cc: Andrew Cooper, xen-devel, Roger Pau Monne

>>> On 12.11.18 at 15:04, <wei.liu2@citrix.com> 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.
> 
> Signed-off-by: Wei Liu <wei.liu2@citrix.com>

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

I'm sorry for the breakage.

Jan



_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

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

* Re: [PATCH] x86: fix hvm_migrate_irq assertion
  2018-11-12 14:04 [PATCH] x86: fix hvm_migrate_irq assertion Wei Liu
  2018-11-12 14:35 ` Jan Beulich
@ 2018-11-12 14:52 ` Roger Pau Monné
  1 sibling, 0 replies; 4+ messages in thread
From: Roger Pau Monné @ 2018-11-12 14:52 UTC (permalink / raw)
  To: Wei Liu; +Cc: xen-devel, Jan Beulich, Andrew Cooper

On Mon, Nov 12, 2018 at 02:04:59PM +0000, Wei Liu 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.
> 
> Signed-off-by: Wei Liu <wei.liu2@citrix.com>

Reviewed-by: Roger Pau Monné <roger.pau@citrix.com>

> ---
>  xen/arch/x86/hvm/hvm.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/xen/arch/x86/hvm/hvm.c b/xen/arch/x86/hvm/hvm.c
> index 519282937b..5d263c4090 100644
> --- a/xen/arch/x86/hvm/hvm.c
> +++ b/xen/arch/x86/hvm/hvm.c
> @@ -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
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

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

* Re: [PATCH] x86: fix hvm_migrate_irq assertion
  2018-11-12 14:35 ` Jan Beulich
@ 2018-11-12 15:13   ` Wei Liu
  0 siblings, 0 replies; 4+ messages in thread
From: Wei Liu @ 2018-11-12 15:13 UTC (permalink / raw)
  To: Jan Beulich; +Cc: Andrew Cooper, Wei Liu, xen-devel, Roger Pau Monne

On Mon, Nov 12, 2018 at 07:35:57AM -0700, Jan Beulich wrote:
> >>> On 12.11.18 at 15:04, <wei.liu2@citrix.com> 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.
> > 
> > Signed-off-by: Wei Liu <wei.liu2@citrix.com>
> 
> Reviewed-by: Jan Beulich <jbeulich@suse.com>
> 
> I'm sorry for the breakage.
> 

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

Wei.

> Jan
> 
> 

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

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

end of thread, other threads:[~2018-11-12 15:13 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-11-12 14:04 [PATCH] x86: fix hvm_migrate_irq assertion Wei Liu
2018-11-12 14:35 ` Jan Beulich
2018-11-12 15:13   ` Wei Liu
2018-11-12 14:52 ` Roger Pau Monné

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.