All of lore.kernel.org
 help / color / mirror / Atom feed
From: Teddy Astie <teddy.astie@vates.tech>
To: xen-devel@lists.xenproject.org
Cc: Teddy Astie <teddy.astie@vates.tech>,
	Andrew Cooper <andrew.cooper3@citrix.com>
Subject: [XEN PATCH v4 5/5] AMD-Vi: Disable intrerrupt remapping if cx16 is not supported
Date: Mon, 15 Apr 2024 12:16:29 +0000	[thread overview]
Message-ID: <26557d23386030166e89dfee240d99d07def6021.1713174878.git.teddy.astie@vates.tech> (raw)
In-Reply-To: <cover.1713174878.git.teddy.astie@vates.tech>

All hardware with AMD-Vi has CMPXCHG16 support.  Check this at initialisation
time, and remove the effectively-dead logic for the non-cx16 case.

Suggested-by: Andrew Cooper <andrew.cooper3@citrix.com>
Signed-off-by: Teddy Astie <teddy.astie@vates.tech>
---
 xen/drivers/passthrough/amd/iommu_intr.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/xen/drivers/passthrough/amd/iommu_intr.c b/xen/drivers/passthrough/amd/iommu_intr.c
index 7fc796dec2..9ab7c68749 100644
--- a/xen/drivers/passthrough/amd/iommu_intr.c
+++ b/xen/drivers/passthrough/amd/iommu_intr.c
@@ -649,6 +649,12 @@ bool __init cf_check iov_supports_xt(void)
     if ( !iommu_enable || !iommu_intremap )
         return false;
 
+    if ( unlikely(!cpu_has_cx16) )
+    {
+        AMD_IOMMU_WARN("CPU doesn't support CMPXCHG16B, disable interrupt remapping\n");
+        return false;
+    }
+
     if ( amd_iommu_prepare(true) )
         return false;
 
-- 
2.44.0



Teddy Astie | Vates XCP-ng Intern

XCP-ng & Xen Orchestra - Vates solutions

web: https://vates.tech


  parent reply	other threads:[~2024-04-15 12:16 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-04-15 12:16 [XEN PATCH v4 0/5] x86/iommu: Drop IOMMU support when cx16 isn't supported Teddy Astie
2024-04-15 12:16 ` [XEN PATCH v4 3/5] VT-d: Cleanup MAP_SINGLE_DEVICE and related code Teddy Astie
2024-04-15 12:16 ` [XEN PATCH v4 2/5] AMD-Vi: Disable IOMMU if cx16 isn't supported Teddy Astie
2024-04-15 12:16 ` [XEN PATCH v4 4/5] VT-d: Disable intrerrupt remapping if cx16 is not supported Teddy Astie
2024-04-15 12:16 ` [XEN PATCH v4 1/5] VT-d: Disable IOMMU if cx16 isn't supported Teddy Astie
2024-04-15 12:16 ` Teddy Astie [this message]
2024-04-15 13:58 ` [XEN PATCH v4 0/5] x86/iommu: Drop IOMMU support when " Teddy Astie

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=26557d23386030166e89dfee240d99d07def6021.1713174878.git.teddy.astie@vates.tech \
    --to=teddy.astie@vates.tech \
    --cc=andrew.cooper3@citrix.com \
    --cc=xen-devel@lists.xenproject.org \
    /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 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.