All of lore.kernel.org
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] kvm: x86: Fix kvm_arch_fixup_msi_route for remap-less case
@ 2018-08-27  8:47 Jan Kiszka
  2018-08-27  9:01 ` Peter Xu
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Jan Kiszka @ 2018-08-27  8:47 UTC (permalink / raw)
  To: qemu-devel, Paolo Bonzini
  Cc: Michael S. Tsirkin, Peter Xu, Christopher Goldsworthy

The AMD IOMMU does not (yet) support interrupt remapping. But
kvm_arch_fixup_msi_route assumes that all implementations do and crashes
when the AMD IOMMU is used in KVM mode.

Fixes: 8b5ed7dffa1f ("intel_iommu: add support for split irqchip")
Reported-by: Christopher Goldsworthy <christopher.goldsworthy@outlook.com>
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
---
 target/i386/kvm.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/target/i386/kvm.c b/target/i386/kvm.c
index 9313602d3d..1fe3a73a10 100644
--- a/target/i386/kvm.c
+++ b/target/i386/kvm.c
@@ -3677,6 +3677,10 @@ int kvm_arch_fixup_msi_route(struct kvm_irq_routing_entry *route,
         MSIMessage src, dst;
         X86IOMMUClass *class = X86_IOMMU_GET_CLASS(iommu);
 
+        if (!class->int_remap) {
+            return 0;
+        }
+
         src.address = route->u.msi.address_hi;
         src.address <<= VTD_MSI_ADDR_HI_SHIFT;
         src.address |= route->u.msi.address_lo;
-- 
2.16.4

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

* Re: [Qemu-devel] [PATCH] kvm: x86: Fix kvm_arch_fixup_msi_route for remap-less case
  2018-08-27  8:47 [Qemu-devel] [PATCH] kvm: x86: Fix kvm_arch_fixup_msi_route for remap-less case Jan Kiszka
@ 2018-08-27  9:01 ` Peter Xu
  2018-09-07 20:36 ` Michael S. Tsirkin
  2018-09-11 13:09 ` Paolo Bonzini
  2 siblings, 0 replies; 4+ messages in thread
From: Peter Xu @ 2018-08-27  9:01 UTC (permalink / raw)
  To: Jan Kiszka
  Cc: qemu-devel, Paolo Bonzini, Michael S. Tsirkin,
	Christopher Goldsworthy

On Mon, Aug 27, 2018 at 10:47:51AM +0200, Jan Kiszka wrote:
> The AMD IOMMU does not (yet) support interrupt remapping. But
> kvm_arch_fixup_msi_route assumes that all implementations do and crashes
> when the AMD IOMMU is used in KVM mode.
> 
> Fixes: 8b5ed7dffa1f ("intel_iommu: add support for split irqchip")
> Reported-by: Christopher Goldsworthy <christopher.goldsworthy@outlook.com>
> Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>

Reviewed-by: Peter Xu <peterx@redhat.com>

Thanks!

-- 
Peter Xu

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

* Re: [Qemu-devel] [PATCH] kvm: x86: Fix kvm_arch_fixup_msi_route for remap-less case
  2018-08-27  8:47 [Qemu-devel] [PATCH] kvm: x86: Fix kvm_arch_fixup_msi_route for remap-less case Jan Kiszka
  2018-08-27  9:01 ` Peter Xu
@ 2018-09-07 20:36 ` Michael S. Tsirkin
  2018-09-11 13:09 ` Paolo Bonzini
  2 siblings, 0 replies; 4+ messages in thread
From: Michael S. Tsirkin @ 2018-09-07 20:36 UTC (permalink / raw)
  To: Jan Kiszka; +Cc: qemu-devel, Paolo Bonzini, Peter Xu, Christopher Goldsworthy

On Mon, Aug 27, 2018 at 10:47:51AM +0200, Jan Kiszka wrote:
> The AMD IOMMU does not (yet) support interrupt remapping. But
> kvm_arch_fixup_msi_route assumes that all implementations do and crashes
> when the AMD IOMMU is used in KVM mode.
> 
> Fixes: 8b5ed7dffa1f ("intel_iommu: add support for split irqchip")
> Reported-by: Christopher Goldsworthy <christopher.goldsworthy@outlook.com>
> Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>

Reviewed-by: Michael S. Tsirkin <mst@redhat.com>

> ---
>  target/i386/kvm.c | 4 ++++
>  1 file changed, 4 insertions(+)
> 
> diff --git a/target/i386/kvm.c b/target/i386/kvm.c
> index 9313602d3d..1fe3a73a10 100644
> --- a/target/i386/kvm.c
> +++ b/target/i386/kvm.c
> @@ -3677,6 +3677,10 @@ int kvm_arch_fixup_msi_route(struct kvm_irq_routing_entry *route,
>          MSIMessage src, dst;
>          X86IOMMUClass *class = X86_IOMMU_GET_CLASS(iommu);
>  
> +        if (!class->int_remap) {
> +            return 0;
> +        }
> +
>          src.address = route->u.msi.address_hi;
>          src.address <<= VTD_MSI_ADDR_HI_SHIFT;
>          src.address |= route->u.msi.address_lo;
> -- 
> 2.16.4

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

* Re: [Qemu-devel] [PATCH] kvm: x86: Fix kvm_arch_fixup_msi_route for remap-less case
  2018-08-27  8:47 [Qemu-devel] [PATCH] kvm: x86: Fix kvm_arch_fixup_msi_route for remap-less case Jan Kiszka
  2018-08-27  9:01 ` Peter Xu
  2018-09-07 20:36 ` Michael S. Tsirkin
@ 2018-09-11 13:09 ` Paolo Bonzini
  2 siblings, 0 replies; 4+ messages in thread
From: Paolo Bonzini @ 2018-09-11 13:09 UTC (permalink / raw)
  To: Jan Kiszka, qemu-devel
  Cc: Michael S. Tsirkin, Peter Xu, Christopher Goldsworthy

On 27/08/2018 10:47, Jan Kiszka wrote:
> The AMD IOMMU does not (yet) support interrupt remapping. But
> kvm_arch_fixup_msi_route assumes that all implementations do and crashes
> when the AMD IOMMU is used in KVM mode.
> 
> Fixes: 8b5ed7dffa1f ("intel_iommu: add support for split irqchip")
> Reported-by: Christopher Goldsworthy <christopher.goldsworthy@outlook.com>
> Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
> ---
>  target/i386/kvm.c | 4 ++++
>  1 file changed, 4 insertions(+)
> 
> diff --git a/target/i386/kvm.c b/target/i386/kvm.c
> index 9313602d3d..1fe3a73a10 100644
> --- a/target/i386/kvm.c
> +++ b/target/i386/kvm.c
> @@ -3677,6 +3677,10 @@ int kvm_arch_fixup_msi_route(struct kvm_irq_routing_entry *route,
>          MSIMessage src, dst;
>          X86IOMMUClass *class = X86_IOMMU_GET_CLASS(iommu);
>  
> +        if (!class->int_remap) {
> +            return 0;
> +        }
> +
>          src.address = route->u.msi.address_hi;
>          src.address <<= VTD_MSI_ADDR_HI_SHIFT;
>          src.address |= route->u.msi.address_lo;
> 

Queued, thanks.

Paolo

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

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

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-08-27  8:47 [Qemu-devel] [PATCH] kvm: x86: Fix kvm_arch_fixup_msi_route for remap-less case Jan Kiszka
2018-08-27  9:01 ` Peter Xu
2018-09-07 20:36 ` Michael S. Tsirkin
2018-09-11 13:09 ` Paolo Bonzini

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.