qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Alejandro Jimenez <alejandro.j.jimenez@oracle.com>
To: Santosh Shukla <santosh.shukla@amd.com>, qemu-devel@nongnu.org
Cc: pbonzini@redhat.com, joao.m.martins@oracle.com,
	Suravee.Suthikulpanit@amd.com, vasant.hegde@amd.com,
	mtosatti@redhat.com, mst@redhat.com, marcel.apfelbaum@gmail.com
Subject: Re: [PATCH v2 5/5] amd_iommu: Check APIC ID > 255 for XTSup
Date: Fri, 20 Sep 2024 16:26:53 -0400	[thread overview]
Message-ID: <34eeb085-22f8-4e7f-9814-8cae599b9747@oracle.com> (raw)
In-Reply-To: <20240916143116.169693-6-santosh.shukla@amd.com>



On 9/16/24 10:31, Santosh Shukla wrote:
> From: Suravee Suthikulpanit <suravee.suthikulpanit@amd.com>
> 
> The XTSup mode enables x2APIC support for AMD IOMMU, which is needed
> to support vcpu w/ APIC ID > 255.
> 
> Signed-off-by: Suravee Suthikulpanit <suravee.suthikulpanit@amd.com>
> Signed-off-by: Santosh Shukla <santosh.shukla@amd.com>
> ---
> v2:
> - Fixed non-kvm build issue by adding a check for kvm_irqchip_is_split()
> 
>   hw/i386/amd_iommu.c | 11 +++++++++++
>   1 file changed, 11 insertions(+)
> 
> diff --git a/hw/i386/amd_iommu.c b/hw/i386/amd_iommu.c
> index 9095146525e6..24eebf053df0 100644
> --- a/hw/i386/amd_iommu.c
> +++ b/hw/i386/amd_iommu.c
> @@ -32,6 +32,7 @@
>   #include "trace.h"
>   #include "hw/i386/apic-msidef.h"
>   #include "hw/qdev-properties.h"
> +#include "kvm/kvm_i386.h"
>   
>   /* used AMD-Vi MMIO registers */
>   const char *amdvi_mmio_low[] = {
> @@ -1651,6 +1652,16 @@ static void amdvi_sysbus_realize(DeviceState *dev, Error **errp)
>       memory_region_add_subregion_overlap(&s->mr_sys, AMDVI_INT_ADDR_FIRST,
>                                           &s->mr_ir, 1);
>   
> +    /* AMD IOMMU with x2APIC mode requires xtsup=on */
> +    if (x86ms->apic_id_limit > 255 && !s->xtsup) {
> +        error_report("AMD IOMMU with x2APIC confguration requires xtsup=on");
> +        exit(EXIT_FAILURE);
> +    }
> +    if (s->xtsup && kvm_irqchip_is_split() && !kvm_enable_x2apic()) {
> +        error_report("AMD IOMMU xt=on requires support on the KVM side");

Use "xtsup=on" on the error message, "xt" is not a valid option IIUC.

Alejandro

> +        exit(EXIT_FAILURE);
> +    }
> +
>       pci_setup_iommu(bus, &amdvi_iommu_ops, s);
>       amdvi_init(s);
>   }


  reply	other threads:[~2024-09-20 20:27 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-09-16 14:31 [PATCH v2 0/5] Interrupt Remap support for emulated amd viommu Santosh Shukla
2024-09-16 14:31 ` [PATCH v2 1/5] amd_iommu: Rename variable mmio to mr_mmio Santosh Shukla
2024-09-16 14:31 ` [PATCH v2 2/5] amd_iommu: Add support for pass though mode Santosh Shukla
2024-09-20 20:26   ` Alejandro Jimenez
2024-09-27 14:06     ` Shukla, Santosh
2024-09-16 14:31 ` [PATCH v2 3/5] amd_iommu: Use shared memory region for Interrupt Remapping Santosh Shukla
2024-09-16 14:31 ` [PATCH v2 4/5] amd_iommu: Send notification when invaldate interrupt entry cache Santosh Shukla
2024-09-20 20:26   ` Alejandro Jimenez
2024-09-23 12:03     ` Shukla, Santosh
2024-09-16 14:31 ` [PATCH v2 5/5] amd_iommu: Check APIC ID > 255 for XTSup Santosh Shukla
2024-09-20 20:26   ` Alejandro Jimenez [this message]
2024-09-23 12:04     ` Shukla, Santosh
2024-09-20 20:39 ` [PATCH v2 0/5] Interrupt Remap support for emulated amd viommu Alejandro Jimenez
2024-09-23 12:05   ` Shukla, Santosh

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=34eeb085-22f8-4e7f-9814-8cae599b9747@oracle.com \
    --to=alejandro.j.jimenez@oracle.com \
    --cc=Suravee.Suthikulpanit@amd.com \
    --cc=joao.m.martins@oracle.com \
    --cc=marcel.apfelbaum@gmail.com \
    --cc=mst@redhat.com \
    --cc=mtosatti@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=santosh.shukla@amd.com \
    --cc=vasant.hegde@amd.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).