qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Philippe Mathieu-Daudé" <philmd@linaro.org>
To: Sairaj Kodilkar <sarunkod@amd.com>, qemu-devel@nongnu.org
Cc: pbonzini@redhat.com, Suravee.Suthikulpanit@amd.com,
	Vasant.Hegde@amd.com,  Santosh Shukla <santosh.shukla@amd.com>,
	Phil Dennis-Jordan <phil@philjordan.eu>
Subject: Re: [PATCH] amd_iommu: Fix kvm_enable_x2apic link error with clang in non-KVM builds
Date: Fri, 29 Nov 2024 11:29:22 +0100	[thread overview]
Message-ID: <11a21260-cf71-495e-94bf-461fc0f39686@linaro.org> (raw)
In-Reply-To: <20241114114509.15350-1-sarunkod@amd.com>

On 14/11/24 12:45, Sairaj Kodilkar wrote:
> Commit b12cb3819 (amd_iommu: Check APIC ID > 255 for XTSup) throws
> linking error for the `kvm_enable_x2apic` when kvm is disabled
> and Clang is used for compilation.
> 
> This issue comes up because Clang does not remove the function callsite
> (kvm_enable_x2apic in this case) during optimization when if condition
> have variable. Intel IOMMU driver solves this issue by creating separate
> if condition for checking variables, which causes call site being
> optimized away by virtue of `kvm_irqchip_is_split()` being defined as 0.
> Implement same solution for the AMD driver.
> 
> Fixes: b12cb3819baf (amd_iommu: Check APIC ID > 255 for XTSup)
> Signed-off-by: Sairaj Kodilkar <sarunkod@amd.com>
> Signed-off-by: Santosh Shukla <santosh.shukla@amd.com>
> Tested-by: Phil Dennis-Jordan <phil@philjordan.eu>
> ---
>   hw/i386/amd_iommu.c | 8 +++++---
>   1 file changed, 5 insertions(+), 3 deletions(-)

Tested-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>

And queued, thanks.


  reply	other threads:[~2024-11-29 10:30 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-11-14 11:45 [PATCH] amd_iommu: Fix kvm_enable_x2apic link error with clang in non-KVM builds Sairaj Kodilkar
2024-11-29 10:29 ` Philippe Mathieu-Daudé [this message]
2024-11-29 15:51   ` Philippe Mathieu-Daudé
2024-11-29 15:51   ` Philippe Mathieu-Daudé
2024-11-29 11:23 ` Philippe Mathieu-Daudé

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=11a21260-cf71-495e-94bf-461fc0f39686@linaro.org \
    --to=philmd@linaro.org \
    --cc=Suravee.Suthikulpanit@amd.com \
    --cc=Vasant.Hegde@amd.com \
    --cc=pbonzini@redhat.com \
    --cc=phil@philjordan.eu \
    --cc=qemu-devel@nongnu.org \
    --cc=santosh.shukla@amd.com \
    --cc=sarunkod@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).