Re: [PATCH 5/7] hw/i386/amd_iommu: Fix event log generation

2025-07-21 Thread Sairaj Kodilkar
On 7/16/2025 8:20 PM, Ethan MILON wrote: On 7/16/25 09:31, Sairaj Kodilkar wrote: Current event logging code is broken, because of following issues 1. The code uses '|' instead of '&' to test the bit field, which causes vIOMMU to generate overflow interrupt for

Re: [PATCH 6/7] hw/i386/amd_iommu: Fix handling device on buses != 0

2025-07-16 Thread Sairaj Kodilkar
On 7/16/2025 8:48 PM, Ethan MILON wrote: On 7/16/25 09:31, Sairaj Kodilkar wrote: The AMD IOMMU is set up at boot time and uses PCI bus numbers + devfn for indexing into DTE. The problem is that before the guest started, all PCI bus numbers are 0 as no PCI discovery happened yet (BIOS or/and

Re: [PATCH 4/7] hw/i386/amd_iommu: Support MMIO writes to the status register

2025-07-16 Thread Sairaj Kodilkar
On 7/16/2025 7:57 PM, Ethan MILON wrote: Hi, On 7/16/25 09:31, Sairaj Kodilkar wrote: Support the writes to the status register so that guest can reset the EventOverflow, EventLogInt, ComWaitIntr, etc bits after servicing the respective interrupt. Signed-off-by: Sairaj Kodilkar Reviewed

Re: [PATCH 0/7] hw/i386/amd_iommu: Cleanups and fixes

2025-07-16 Thread Sairaj Kodilkar
On 7/16/2025 6:59 PM, Michael S. Tsirkin wrote: On Wed, Jul 16, 2025 at 06:26:37PM +0530, Sairaj Kodilkar wrote: On 7/16/2025 6:07 PM, Philippe Mathieu-Daudé wrote: On 16/7/25 09:31, Sairaj Kodilkar wrote: This series provides few cleanups and fixes for the amd iommu The patches are

Re: [PATCH 0/7] hw/i386/amd_iommu: Cleanups and fixes

2025-07-16 Thread Sairaj Kodilkar
On 7/16/2025 6:07 PM, Philippe Mathieu-Daudé wrote: On 16/7/25 09:31, Sairaj Kodilkar wrote: This series provides few cleanups and fixes for the amd iommu The patches are based on top of 56c6e249b698 (v10.0.0-rc3) and Alejandro's DMA remapping series [1]. 56c6e249b698 is 4 month

[PATCH 0/7] hw/i386/amd_iommu: Cleanups and fixes

2025-07-16 Thread Sairaj Kodilkar
https://github.com/AMDESE/qemu-iommu/tree/sarunkod/alej%2Bcleanup-v1 Sairaj Kodilkar (7): hw/i386/amd_iommu: Fix MMIO register write tracing hw/i386/amd_iommu: Remove unused and wrongly set ats_enabled field hw/i386/amd_iommu: Move IOAPIC memory region initialization to the end hw/i386/amd_

[PATCH 7/7] hw/i386/amd_iommu: Support 64 bit address for IOTLB lookup

2025-07-16 Thread Sairaj Kodilkar
and lookup IOTLB entry. Fixes: d29a09ca6842 ("hw/i386: Introduce AMD IOMMU") Signed-off-by: Sairaj Kodilkar --- hw/i386/amd_iommu.c | 51 - hw/i386/amd_iommu.h | 5 +++-- 2 files changed, 35 insertions(+), 21 deletions(-) diff --git a/hw/i386/a

[PATCH 6/7] hw/i386/amd_iommu: Fix handling device on buses != 0

2025-07-16 Thread Sairaj Kodilkar
-off-by: Sairaj Kodilkar --- hw/i386/amd_iommu.c | 124 +++- hw/i386/amd_iommu.h | 2 +- 2 files changed, 76 insertions(+), 50 deletions(-) diff --git a/hw/i386/amd_iommu.c b/hw/i386/amd_iommu.c index a34062153194..33916b458611 100644 --- a/hw/i386

[PATCH 4/7] hw/i386/amd_iommu: Support MMIO writes to the status register

2025-07-16 Thread Sairaj Kodilkar
Support the writes to the status register so that guest can reset the EventOverflow, EventLogInt, ComWaitIntr, etc bits after servicing the respective interrupt. Signed-off-by: Sairaj Kodilkar Reviewed-by: Vasant Hegde --- hw/i386/amd_iommu.c | 3 +++ 1 file changed, 3 insertions(+) diff

[PATCH 5/7] hw/i386/amd_iommu: Fix event log generation

2025-07-16 Thread Sairaj Kodilkar
ssues, so that guest can process event log entries. Fixes: d29a09ca68428 ("hw/i386: Introduce AMD IOMMU") Signed-off-by: Sairaj Kodilkar Reviewed-by: Vasant Hegde --- hw/i386/amd_iommu.c | 20 hw/i386/amd_iommu.h | 1 + 2 files changed, 17 insertions(+), 4

[PATCH 3/7] hw/i386/amd_iommu: Move IOAPIC memory region initialization to the end

2025-07-16 Thread Sairaj Kodilkar
use the mr_sys and mr_ir regions after they are fully initialized. Fixes: 577c470f4326 ("x86_iommu/amd: Prepare for interrupt remap support") Signed-off-by: Sairaj Kodilkar Reviewed-by: Vasant Hegde --- hw/i386/amd_iommu.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) di

[PATCH 2/7] hw/i386/amd_iommu: Remove unused and wrongly set ats_enabled field

2025-07-16 Thread Sairaj Kodilkar
The ats_enabled field is set using HTTUNEN, which is wrong. Fix this by removing the field as it is never used. Fixes: d29a09ca68428 ("hw/i386: Introduce AMD IOMMU") Signed-off-by: Sairaj Kodilkar Reviewed-by: Vasant Hegde --- hw/i386/amd_iommu.c | 2 -- hw/i386/amd_iommu.h | 1

[PATCH 1/7] hw/i386/amd_iommu: Fix MMIO register write tracing

2025-07-16 Thread Sairaj Kodilkar
Define separate functions to trace MMIO write accesses instead of using `trace_amdvi_mmio_read()` for both read and write. Signed-off-by: Sairaj Kodilkar Reviewed-by: Vasant Hegde --- hw/i386/amd_iommu.c | 23 ++- 1 file changed, 18 insertions(+), 5 deletions(-) diff --git

Re: [PATCH v2 09/20] amd_iommu: Add basic structure to support IOMMU notifier updates

2025-06-23 Thread Sairaj Kodilkar
fails to compile (GCC works ok). Thanks Sairaj Kodilkar

Re: [PATCH v2 16/20] amd_iommu: Set all address spaces to default translation mode on reset

2025-06-13 Thread Sairaj Kodilkar
On 5/31/2025 3:00 AM, Alejandro Jimenez wrote: Hey Sairaj, On 5/29/25 2:16 AM, Sairaj Kodilkar wrote: On 5/2/2025 7:46 AM, Alejandro Jimenez wrote: On reset, restore the default address translation mode for all the address spaces managed by the vIOMMU. Signed-off-by: Alejandro Jimenez

Re: [PATCH v2 18/20] amd_iommu: Toggle address translation mode on devtab entry invalidation

2025-06-12 Thread Sairaj Kodilkar
On 6/12/2025 1:57 PM, Ethan MILON wrote: Hi, On 5/2/25 4:16 AM, Alejandro Jimenez wrote: Caution: External email. Do not open attachments or click links, unless this email comes from a known sender and you know the content is safe. A guest must issue an INVALIDATE_DEVTAB_ENTRY command aft

Re: [PATCH v2 11/20] amd_iommu: Use iova_tree records to determine large page size on UNMAP

2025-06-11 Thread Sairaj Kodilkar
lejandro, While experimenting with iommu.forcedac=1, I found that above line causes unsigned integer overflow for 64 bit IOVAs. This results in an infinite loop. Please add a overflow check here. Thanks Sairaj Kodilkar

Re: [PATCH v3 0/2] amd_iommu: Fixes

2025-06-10 Thread Sairaj Kodilkar
On 6/3/2025 2:24 AM, Michael Tokarev wrote: On 16.05.2025 13:05, Sairaj Kodilkar wrote: Fix following two issues in the amd viommu 1. The guest fails to setup the passthrough device when for following setup     because amd iommu enables the no DMA memory region even when guest is     using

Re: [PATCH v2 00/20] AMD vIOMMU: DMA remapping support for VFIO devices

2025-06-01 Thread Sairaj Kodilkar
Sairaj: Are you passing a full NVME device to the guest (i.e. a PF)? I ask because the BDF in '-device vfio-pci,host=:44:00.0' doesn't look like a typical VF... Hey Alejandro, I am passing full NVME device to the guest (not just VF). Thanks Sairaj

Re: [PATCH v2 16/20] amd_iommu: Set all address spaces to default translation mode on reset

2025-05-28 Thread Sairaj Kodilkar
ddr_translation flag to "false" before switching all the address spaces. Without this, the devices will keep using IOMMU address space. Regards Sairaj Kodilkar } static void amdvi_sysbus_realize(DeviceState *dev, Error **errp)

Re: [PATCH v2 00/20] AMD vIOMMU: DMA remapping support for VFIO devices

2025-05-20 Thread Sairaj Kodilkar
On 5/21/2025 8:05 AM, Alejandro Jimenez wrote: Hi Sairaj On 5/16/25 4:07 AM, Sairaj Kodilkar wrote: On 5/2/2025 7:45 AM, Alejandro Jimenez wrote: Hi Alejandro, Tested the v2, everything looks good when I boot guest with upstream kernel. But I observed that NVME driver fails to load

Re: [PATCH v3 1/2] hw/i386/amd_iommu: Fix device setup failure when PT is on.

2025-05-18 Thread Sairaj Kodilkar
On 5/16/2025 8:13 PM, Philippe Mathieu-Daudé wrote: On 16/5/25 12:05, Sairaj Kodilkar wrote: Commit c1f46999ef506 ("amd_iommu: Add support for pass though mode") introduces the support for "pt" flag by enabling nodma memory when "pt=off". This allowed VFIO de

Re: [PATCH v3 0/2] amd_iommu: Fixes

2025-05-16 Thread Sairaj Kodilkar
On 5/16/2025 4:06 PM, Michael S. Tsirkin wrote: On Fri, May 16, 2025 at 03:35:33PM +0530, Sairaj Kodilkar wrote: Fix following two issues in the amd viommu 1. The guest fails to setup the passthrough device when for following setup because amd iommu enables the no DMA memory region even

[PATCH v3 2/2] hw/i386/amd_iommu: Fix xtsup when vcpus < 255

2025-05-16 Thread Sairaj Kodilkar
XTSup feature") Reported-by: Alejandro Jimenez Tested-by: Tested-by: Alejandro Jimenez Cc: Philippe Mathieu-Daudé Cc: Joao Martins Signed-off-by: Vasant Hegde Signed-off-by: Sairaj Kodilkar --- hw/i386/amd_iommu.c | 8 1 file changed, 8 insertions(+) diff --git a/hw/i386/amd_iomm

[PATCH v3 1/2] hw/i386/amd_iommu: Fix device setup failure when PT is on.

2025-05-16 Thread Sairaj Kodilkar
memory region. But this will once again cause VFIO devices to fail while registering the notifiers with AMD IOMMU memory region. Fixes: c1f46999ef506 ("amd_iommu: Add support for pass though mode") Signed-off-by: Sairaj Kodilkar Reviewed-by: Vasant Hegde --- hw/i386/amd_iommu.c | 12 ++

[PATCH v3 0/2] amd_iommu: Fixes

2025-05-16 Thread Sairaj Kodilkar
The guest fails to boot with xtsup=on and <= 255 vCPUs, because amd_iommu does not enable x2apic mode. base commit 56c6e249b6988c1b6edc2dd34ebb0f1e570a1365 (v10.0.0-rc3) Sairaj Kodilkar (1): hw/i386/amd_iommu: Fix device setup failure when PT is on. Vasant Hegde (1): hw/i386/amd_iommu: F

Re: [PATCH v2 19/20] amd_iommu: Do not assume passthrough translation when DTE[TV]=0

2025-05-16 Thread Sairaj Kodilkar
On 5/15/2025 3:19 AM, Alejandro Jimenez wrote: On 5/12/25 3:00 AM, Sairaj Kodilkar wrote: On 5/2/2025 7:46 AM, Alejandro Jimenez wrote: -    if (pte & AMDVI_DEV_TRANSLATION_VALID) { -    level = get_pte_translation_mode(pte); -    if (level

Re: [PATCH v2 00/20] AMD vIOMMU: DMA remapping support for VFIO devices

2025-05-16 Thread Sairaj Kodilkar
cket,id=SOCKET1,server=on,wait=off,path=qemu.mon.user \ -mon chardev=SOCKET1,mode=control \ -device vfio-pci,host=:44:00.0 Do you have any idea what might trigger this. I see the error only when I am using emulated AMD IOMMU with passthrough device. Regular passthrough works fine. Regard

Re: [PATCH v2 19/20] amd_iommu: Do not assume passthrough translation when DTE[TV]=0

2025-05-12 Thread Sairaj Kodilkar
f the amdvi_page_walk(), amdvi_do_translate() checks the return value of amdvi_as_to_dte(). amdvi_do_translate() returns when it encounters -AMDVI_FR_DTE_TV and does not call amdvi_page_walk(). Regards Sairaj Kodilkar

Re: [PATCH v2 15/20] amd_iommu: Toggle memory regions based on address translation mode

2025-05-11 Thread Sairaj Kodilkar
be introduced in follow up changes). Signed-off-by: Alejandro Jimenez Regards Sairaj Kodilkar

Re: [PATCH v2 09/20] amd_iommu: Add basic structure to support IOMMU notifier updates

2025-05-11 Thread Sairaj Kodilkar
"currently supported", as->bus_num, PCI_SLOT(as->devfn), + PCI_FUNC(as->devfn)); Redundant whitespace changes, please revert. Regards Sairaj Kodilkar

Re: [PATCH v2 05/20] amd_iommu: Add helper function to extract the DTE

2025-05-11 Thread Sairaj Kodilkar
/* DTE[V]=0, address is passed untranslated */ goto out; +} else if (dte_ret == -AMDVI_FR_DTE_TV) { +return; } Hi Alejandro, You missed to handle -AMDVI_FR_DTE_RTR_ERR. Regards Sairaj Kodilkar amdvi_page_walk(as, entry, ret,

Re: [PATCH v2 0/2] amd_iommu: Fixes

2025-05-11 Thread Sairaj Kodilkar
++ Philippe Mathieu-Daudé On 5/9/2025 12:15 PM, Sairaj Kodilkar wrote: Fix following two issues in the amd viommu 1. The guest fails to setup the passthrough device when for following setup because amd iommu enables the no DMA memory region even when guest is using DMA remapping mode

Re: [PATCH v2 0/2] amd_iommu: Fixes

2025-05-11 Thread Sairaj Kodilkar
On 5/11/2025 11:22 PM, Michael S. Tsirkin wrote: On Fri, May 09, 2025 at 12:15:24PM +0530, Sairaj Kodilkar wrote: Fix following two issues in the amd viommu 1. The guest fails to setup the passthrough device when for following setup because amd iommu enables the no DMA memory region even

[PATCH v2 1/2] hw/i386/amd_iommu: Fix device setup failure when PT is on.

2025-05-11 Thread Sairaj Kodilkar
t; (i.e. pass the check in memory_region_is_iommu()), and later fail when trying to register the notifier. Fixes: c1f46999ef506 ("amd_iommu: Add support for pass though mode") Signed-off-by: Sairaj Kodilkar Reviewed-by: Vasant Hegde --- hw/i386/amd_iommu.c | 12 ++-- 1 file ch

[PATCH v2 2/2] hw/i386/amd_iommu: Fix xtsup when vcpus < 255

2025-05-11 Thread Sairaj Kodilkar
From: Vasant Hegde If vCPUs > 255 then x86 common code (x86_cpus_init()) call kvm_enable_x2apic(). But if vCPUs <= 255 then it won't call kvm_enable_x2apic(). Booting guest in x2apic mode, amd-iommu,xtsup=on and <= 255 vCPUs is broken as it fails to call kvm_enable_x2apic(). Fix this by adding

[PATCH v2 0/2] amd_iommu: Fixes

2025-05-08 Thread Sairaj Kodilkar
The guest fails to boot with xtsup=on and <= 255 vCPUs, because amd_iommu does not enable x2apic mode. base commit 56c6e249b6988c1b6edc2dd34ebb0f1e570a1365 (v10.0.0-rc3) Sairaj Kodilkar (1): hw/i386/amd_iommu: Fix device setup failure when PT is on. Vasant Hegde (1): hw/i386/amd_iommu: F

Re: [PATCH 00/18] AMD vIOMMU: DMA remapping support for VFIO devices

2025-04-23 Thread Sairaj Kodilkar
On 4/23/2025 4:15 PM, Sairaj Kodilkar wrote: On 4/14/2025 7:32 AM, Alejandro Jimenez wrote: This series adds support for guests using the AMD vIOMMU to enable DMA remapping for VFIO devices. In addition to the currently supported passthrough (PT) mode, guest kernels are now able to to

Re: [PATCH 00/18] AMD vIOMMU: DMA remapping support for VFIO devices

2025-04-23 Thread Sairaj Kodilkar
-- I see that nopt (emulate IOMMU) has a huge performance. I wonder if the DMA remapping is really useful with such performance penalty. Regards Sairaj Kodilkar

Re: [PATCH 09/18] amd_iommu: Add helpers to walk AMD v1 Page Table format

2025-04-23 Thread Sairaj Kodilkar
, the caller no longer needs to be aware of the fact that the value has been casted from a negative number, which reduces the risk of writing things like (pte < 0). I prefer the out parameter solution but let's see what other reviews say. I think having pte as out parameter is the bett

Re: [PATCH 18/18] amd_iommu: Do not emit I/O page fault events during replay()

2025-04-22 Thread Sairaj Kodilkar
are paths (other than emulated device write) that calls translate(). So lets keep this patch but remove or change the example. Regards Sairaj Kodilkar to sync the dirty bitmap, or after registering a new notifier. The guest would get IO_PAGE_FAULT events for all the regions where a mapping doesn&#x

Re: [PATCH 16/18] amd_iommu: Do not assume passthrough translation when DTE[TV]=0

2025-04-22 Thread Sairaj Kodilkar
TV=0". Regards Sairaj Kodilkar If a request requires a table walk, the walk is terminated when this condition is encountered. Do not assume that addresses for a device with DTE[TV]=0 are passed through (i.e. not remapped) and instead terminate the page table walk early. Fixes: d29a09ca6842

Re: [PATCH 14/18] amd_iommu: Toggle address translation on device table entry invalidation

2025-04-22 Thread Sairaj Kodilkar
r, hence mr->iommu_notify list is empty and we do not unmap the shadow page table. Code works fine because eventually vfio_iommu_map_notify maps entire the address space, but we should keep the right ordering. Regards Sairaj Kodilkar +} +} else if (!as->addr_translation) { +

Re: [PATCH 11/18] amd_iommu: Sync shadow page tables on page invalidation

2025-04-22 Thread Sairaj Kodilkar
ed because code will call the UNMAP notifier even if the pte is present (which should be wrong). Could you please explain why we are unmapping IOVAs with present pte ? Regards Sairaj Kodilkar +if (as->notifier_flags & IOMMU_NOTIFIER_MAP) { + +/* Syn

Re: [PATCH 11/18] amd_iommu: Sync shadow page tables on page invalidation

2025-04-22 Thread Sairaj Kodilkar
ed because code will call the UNMAP notifier even if the pte is present (which should be wrong). Could you please explain why we are unmapping IOVAs with present pte ? Regards Sairaj Kodilkar +if (as->notifier_flags & IOMMU_NOTIFIER_MAP) { + +/* Syn

Re: [PATCH 08/18] amd_iommu: Helper to decode size of page invalidation command

2025-04-22 Thread Sairaj Kodilkar
On 4/14/2025 7:32 AM, Alejandro Jimenez wrote: The size of the region to invalidate depends on the S bit and address encoded in the command. Add a helper to extract this information, which will be used to sync shadow page tables in upcoming changes. Signed-off-by: Alejandro Jimenez --- hw/

Re: [PATCH 05/18] amd_iommu: Toggle memory regions based on address translation mode

2025-04-22 Thread Sairaj Kodilkar
gnew0 initializes addr_translation to 0. but should we explicitly initialize it to 0 ? in order to make it more readable. Regards Sairaj Kodilkar +/* Enabling DMA region */ +memory_region_set_enabled(&amdvi_as->iommu_nodma, false); +memory_region_set_enabled(MEMORY_REGION

Re: [PATCH 03/18] amd_iommu: Add support for IOMMU notifier

2025-04-18 Thread Sairaj Kodilkar
On 4/17/2025 9:51 PM, Alejandro Jimenez wrote: On 4/17/25 6:19 AM, Sairaj Kodilkar wrote: On 4/17/2025 3:47 AM, Alejandro Jimenez wrote: On 4/16/25 8:14 AM, Sairaj Kodilkar wrote: + +    /* DMA address translation */ +    bool dma_remap; I think you should use this flag in the

Re: [PATCH 1/2] hw/i386/amd_iommu: Fix device setup failure when PT is on.

2025-04-17 Thread Sairaj Kodilkar
On 4/15/2025 11:58 PM, Alejandro Jimenez wrote: On 4/15/25 2:38 AM, Sairaj Kodilkar wrote: Hi Alejandro, On 4/15/2025 1:56 AM, Alejandro Jimenez wrote: Hi Sairaj, I'm conflicted by the implementation of the change, so I'd like to make sure I fully understand... On 4/10/

Re: [PATCH 03/18] amd_iommu: Add support for IOMMU notifier

2025-04-17 Thread Sairaj Kodilkar
On 4/17/2025 3:47 AM, Alejandro Jimenez wrote: On 4/16/25 8:14 AM, Sairaj Kodilkar wrote: + +    /* DMA address translation support */ +    IOMMUNotifierFlag notifier_flags; +    /* entry in list of Address spaces with registered notifiers */ +    QLIST_ENTRY(AMDVIAddressSpace) next

Re: [PATCH 03/18] amd_iommu: Add support for IOMMU notifier

2025-04-16 Thread Sairaj Kodilkar
on scenario). [1] https://www.amd.com/content/dam/amd/en/documents/processor-tech-docs/specifications/48882_IOMMU.pdf Regards Sairaj Kodilkar PS: Sorry If I missed something here, I haven't progressed much in the series. }; uint64_t amdvi_extended_feature_register(AMDVIState *s);

Re: [PATCH 02/18] amd_iommu: Add helper function to extract the DTE

2025-04-16 Thread Sairaj Kodilkar
ces with V = 0 are not translated */ -if (!(entry[0] & AMDVI_DEV_VALID)) { +if (dte_ret == -AMDVI_FR_DTE_V) { +/* DTE[V]=0, address is passed untranslated */ goto out; +} else if (dte_ret == -AMDVI_FR_DTE_TV) { +return; } amdvi_page_walk(as, entry, ret, Regards Sairaj Kodilkar

Re: [PATCH 1/2] hw/i386/amd_iommu: Fix device setup failure when PT is on.

2025-04-14 Thread Sairaj Kodilkar
Hi Alejandro, On 4/15/2025 1:56 AM, Alejandro Jimenez wrote: Hi Sairaj, I'm conflicted by the implementation of the change, so I'd like to make sure I fully understand... On 4/10/25 2:44 AM, Sairaj Kodilkar wrote: Current amd_iommu enables the iommu_nodma address

[PATCH 1/2] hw/i386/amd_iommu: Fix device setup failure when PT is on.

2025-04-10 Thread Sairaj Kodilkar
check and disabling nodma memory region. Adding pt_supported requires additional changes and we will look into it later. Fixes: c1f46999ef506 ("amd_iommu: Add support for pass though mode") Signed-off-by: Sairaj Kodilkar --- hw/i386/amd_iommu.c | 12 ++-- 1 file changed, 2

[PATCH 2/2] hw/i386/amd_iommu: Fix xtsup when vcpus < 255

2025-04-10 Thread Sairaj Kodilkar
From: Vasant Hegde If vCPUs > 255 then x86 common code (x86_cpus_init()) call kvm_enable_x2apic(). But if vCPUs <= 255 then it won't call kvm_enable_x2apic(). Booting guest in x2apic mode, amd-iommu,xtsup=on and <= 255 vCPUs is broken as it fails to call kvm_enable_x2apic(). Fix this by adding

[PATCH 0/2] amd_iommu: Fixes

2025-04-09 Thread Sairaj Kodilkar
not enable x2apic mode. base commit 56c6e249b6988c1b6edc2dd34ebb0f1e570a1365 (v10.0.0-rc3) Sairaj Kodilkar (1): hw/i386/amd_iommu: Fix device setup failure when PT is on. Vasant Hegde (1): hw/i386/amd_iommu: Fix xtsup when vcpus < 255 hw/i386/amd_iommu.c | 20 ++-- 1 file c

[PATCH v2 0/2] Emulated AMD IOMMU cleanup and fixes

2025-02-06 Thread Sairaj Kodilkar
base address from the IVRS table and not the one provided by PCI capability. Sairaj Kodilkar (2): amd_iommu: Use correct DTE field for interrupt passthrough amd_iommu: Use correct bitmask to set capability BAR hw/i386/amd_iommu.c | 10 +- hw/i386/amd_iommu.h | 2 +- 2

[PATCH 2/2] amd_iommu: Use correct bitmask to set capability BAR

2025-02-06 Thread Sairaj Kodilkar
AMD IOMMU provides the base address of control registers through IVRS table and PCI capability. Since this base address is of 64 bit, use 32 bits mask (instead of 16 bits) to set BAR low and high. Fixes: d29a09ca68 ("hw/i386: Introduce AMD IOMMU") Signed-off-by: Sairaj Kodilkar R

[PATCH 1/2] amd_iommu: Use correct DTE field for interrupt passthrough

2025-02-06 Thread Sairaj Kodilkar
Interrupt passthrough is determine by the bits 191,190,187-184. These bits are part of the 3rd quad word (i.e. index 2) in DTE. Hence replace dte[3] by dte[2]. Fixes: b44159fe0 ("x86_iommu/amd: Add interrupt remap support when VAPIC is not enabled") Signed-off-by: Sairaj Kodilkar R

[PATCH] amd_iommu: Fix kvm_enable_x2apic link error with clang in non-KVM builds

2024-11-14 Thread Sairaj Kodilkar
mmu: Check APIC ID > 255 for XTSup) Signed-off-by: Sairaj Kodilkar Signed-off-by: Santosh Shukla Tested-by: Phil Dennis-Jordan --- hw/i386/amd_iommu.c | 8 +--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/hw/i386/amd_iommu.c b/hw/i386/amd_iommu.c index 13af7211e11d..af0f4d