qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Alejandro Jimenez <alejandro.j.jimenez@oracle.com>
To: qemu-devel@nongnu.org
Cc: mst@redhat.com, pbonzini@redhat.com, mjt@tls.msk.ru,
	marcel.apfelbaum@gmail.com, richard.henderson@linaro.org,
	eduardo@habkost.net, vasant.hegde@amd.com,
	suravee.suthikulpanit@amd.com, santosh.shukla@amd.com,
	sarunkod@amd.com, joao.m.martins@oracle.com,
	boris.ostrovsky@oracle.com, alejandro.j.jimenez@oracle.com
Subject: [PATCH v2 5/7] amd_iommu: Fix mask to retrieve Interrupt Table Root Pointer from DTE
Date: Wed, 28 May 2025 22:17:22 +0000	[thread overview]
Message-ID: <20250528221725.3554040-6-alejandro.j.jimenez@oracle.com> (raw)
In-Reply-To: <20250528221725.3554040-1-alejandro.j.jimenez@oracle.com>

Fix an off-by-one error in the definition of AMDVI_IR_PHYS_ADDR_MASK. The
current definition masks off the most significant bit of the Interrupt Table
Root ptr i.e. it only generates a mask with bits [50:6] set. See the AMD I/O
Virtualization Technology (IOMMU) Specification for the Interrupt Table
Root Pointer[51:6] field in the Device Table Entry format.

Cc: qemu-stable@nongnu.org
Signed-off-by: Alejandro Jimenez <alejandro.j.jimenez@oracle.com>
---
 hw/i386/amd_iommu.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/hw/i386/amd_iommu.h b/hw/i386/amd_iommu.h
index 09352672bdcc2..1836b7061d848 100644
--- a/hw/i386/amd_iommu.h
+++ b/hw/i386/amd_iommu.h
@@ -231,7 +231,7 @@
 #define AMDVI_IR_INTCTL_PASS            1
 #define AMDVI_IR_INTCTL_REMAP           2
 
-#define AMDVI_IR_PHYS_ADDR_MASK         (((1ULL << 45) - 1) << 6)
+#define AMDVI_IR_PHYS_ADDR_MASK         GENMASK64(51, 6)
 
 /* MSI data 10:0 bits (section 2.2.5.1 Fig 14) */
 #define AMDVI_IRTE_OFFSET               0x7ff
-- 
2.43.5



  parent reply	other threads:[~2025-05-28 22:19 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-05-28 22:17 [PATCH v2 0/7] amd_iommu: Fixes to align with AMDVi specification Alejandro Jimenez
2025-05-28 22:17 ` [PATCH v2 1/7] amd_iommu: Fix Miscellanous Information Register 0 offsets Alejandro Jimenez
2025-05-28 22:17 ` [PATCH v2 2/7] amd_iommu: Fix Device ID decoding for INVALIDATE_IOTLB_PAGES command Alejandro Jimenez
2025-05-28 22:17 ` [PATCH v2 3/7] amd_iommu: Update bitmasks representing DTE reserved fields Alejandro Jimenez
2025-05-28 22:17 ` [PATCH v2 4/7] amd_iommu: Fix masks for various IOMMU MMIO Registers Alejandro Jimenez
2025-05-29  5:23   ` Vasant Hegde
2025-05-29 14:56     ` Alejandro Jimenez
2025-05-28 22:17 ` Alejandro Jimenez [this message]
2025-05-28 22:17 ` [PATCH v2 5/7] amd_iommu: Fix mask to retrive Interrupt Table Root Pointer from DTE Alejandro Jimenez
2025-05-29  4:28   ` Vasant Hegde
2025-05-28 22:17 ` [PATCH v2 6/7] amd_iommu: Fix the calculation for Device Table size Alejandro Jimenez
2025-05-28 22:17 ` [PATCH v2 7/7] amd_iommu: Remove duplicated definitions Alejandro Jimenez
2025-05-29  4:24   ` Vasant Hegde
2025-05-29  5:26 ` [PATCH v2 0/7] amd_iommu: Fixes to align with AMDVi specification Vasant Hegde
2025-05-29 15:08   ` Alejandro Jimenez

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=20250528221725.3554040-6-alejandro.j.jimenez@oracle.com \
    --to=alejandro.j.jimenez@oracle.com \
    --cc=boris.ostrovsky@oracle.com \
    --cc=eduardo@habkost.net \
    --cc=joao.m.martins@oracle.com \
    --cc=marcel.apfelbaum@gmail.com \
    --cc=mjt@tls.msk.ru \
    --cc=mst@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=richard.henderson@linaro.org \
    --cc=santosh.shukla@amd.com \
    --cc=sarunkod@amd.com \
    --cc=suravee.suthikulpanit@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).