mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] iommu/amd: Propagate the error code returned by __modify_irte_ga() in modify_irte_ga()
@ 2025-11-20 15:47 Jinhui Guo
  2025-11-21  4:35 ` Ankit Soni
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Jinhui Guo @ 2025-11-20 15:47 UTC (permalink / raw)
  To: joro, suravee.suthikulpanit; +Cc: guojinhui.liam, iommu, linux-kernel, stable

The return type of __modify_irte_ga() is int, but modify_irte_ga()
treats it as a bool. Casting the int to bool discards the error code.

To fix the issue, change the type of ret to int in modify_irte_ga().

Fixes: 57cdb720eaa5 ("iommu/amd: Do not flush IRTE when only updating isRun and destination fields")
Cc: stable@vger.kernel.org
Signed-off-by: Jinhui Guo <guojinhui.liam@bytedance.com>
---
 drivers/iommu/amd/iommu.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/iommu/amd/iommu.c b/drivers/iommu/amd/iommu.c
index 2e1865daa1ce..a38304f1a8df 100644
--- a/drivers/iommu/amd/iommu.c
+++ b/drivers/iommu/amd/iommu.c
@@ -3354,7 +3354,7 @@ static int __modify_irte_ga(struct amd_iommu *iommu, u16 devid, int index,
 static int modify_irte_ga(struct amd_iommu *iommu, u16 devid, int index,
 			  struct irte_ga *irte)
 {
-	bool ret;
+	int ret;
 
 	ret = __modify_irte_ga(iommu, devid, index, irte);
 	if (ret)
-- 
2.20.1

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] iommu/amd: Propagate the error code returned by __modify_irte_ga() in modify_irte_ga()
  2025-11-20 15:47 [PATCH] iommu/amd: Propagate the error code returned by __modify_irte_ga() in modify_irte_ga() Jinhui Guo
@ 2025-11-21  4:35 ` Ankit Soni
  2025-11-21  8:13 ` Vasant Hegde
  2025-11-25 14:10 ` Jörg Rödel
  2 siblings, 0 replies; 4+ messages in thread
From: Ankit Soni @ 2025-11-21  4:35 UTC (permalink / raw)
  To: Jinhui Guo; +Cc: joro, suravee.suthikulpanit, iommu, linux-kernel, stable

On Thu, Nov 20, 2025 at 11:47:25PM +0800, Jinhui Guo wrote:
> The return type of __modify_irte_ga() is int, but modify_irte_ga()
> treats it as a bool. Casting the int to bool discards the error code.
> 
> To fix the issue, change the type of ret to int in modify_irte_ga().
> 
> Fixes: 57cdb720eaa5 ("iommu/amd: Do not flush IRTE when only updating isRun and destination fields")
> Cc: stable@vger.kernel.org
> Signed-off-by: Jinhui Guo <guojinhui.liam@bytedance.com>
> ---

Hi, 
Thanks for the patch. The subject line exceeds the recommended length.
can you please resend patch with concise subject line.

>  drivers/iommu/amd/iommu.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/iommu/amd/iommu.c b/drivers/iommu/amd/iommu.c
> index 2e1865daa1ce..a38304f1a8df 100644
> --- a/drivers/iommu/amd/iommu.c
> +++ b/drivers/iommu/amd/iommu.c
> @@ -3354,7 +3354,7 @@ static int __modify_irte_ga(struct amd_iommu *iommu, u16 devid, int index,
>  static int modify_irte_ga(struct amd_iommu *iommu, u16 devid, int index,
>  			  struct irte_ga *irte)
>  {
> -	bool ret;
> +	int ret;
>  
>  	ret = __modify_irte_ga(iommu, devid, index, irte);
>  	if (ret)
> -- 
> 2.20.1

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] iommu/amd: Propagate the error code returned by __modify_irte_ga() in modify_irte_ga()
  2025-11-20 15:47 [PATCH] iommu/amd: Propagate the error code returned by __modify_irte_ga() in modify_irte_ga() Jinhui Guo
  2025-11-21  4:35 ` Ankit Soni
@ 2025-11-21  8:13 ` Vasant Hegde
  2025-11-25 14:10 ` Jörg Rödel
  2 siblings, 0 replies; 4+ messages in thread
From: Vasant Hegde @ 2025-11-21  8:13 UTC (permalink / raw)
  To: Jinhui Guo, joro, suravee.suthikulpanit; +Cc: iommu, linux-kernel, stable

On 11/20/2025 9:17 PM, Jinhui Guo wrote:
> The return type of __modify_irte_ga() is int, but modify_irte_ga()
> treats it as a bool. Casting the int to bool discards the error code.
> 
> To fix the issue, change the type of ret to int in modify_irte_ga().
> 
> Fixes: 57cdb720eaa5 ("iommu/amd: Do not flush IRTE when only updating isRun and destination fields")
> Cc: stable@vger.kernel.org
> Signed-off-by: Jinhui Guo <guojinhui.liam@bytedance.com>

Reviewed-by: Vasant Hegde <vasant.hegde@amd.com>

-Vasant


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] iommu/amd: Propagate the error code returned by __modify_irte_ga() in modify_irte_ga()
  2025-11-20 15:47 [PATCH] iommu/amd: Propagate the error code returned by __modify_irte_ga() in modify_irte_ga() Jinhui Guo
  2025-11-21  4:35 ` Ankit Soni
  2025-11-21  8:13 ` Vasant Hegde
@ 2025-11-25 14:10 ` Jörg Rödel
  2 siblings, 0 replies; 4+ messages in thread
From: Jörg Rödel @ 2025-11-25 14:10 UTC (permalink / raw)
  To: Jinhui Guo; +Cc: suravee.suthikulpanit, iommu, linux-kernel, stable

On Thu, Nov 20, 2025 at 11:47:25PM +0800, Jinhui Guo wrote:
> The return type of __modify_irte_ga() is int, but modify_irte_ga()
> treats it as a bool. Casting the int to bool discards the error code.
> 
> To fix the issue, change the type of ret to int in modify_irte_ga().
> 
> Fixes: 57cdb720eaa5 ("iommu/amd: Do not flush IRTE when only updating isRun and destination fields")
> Cc: stable@vger.kernel.org
> Signed-off-by: Jinhui Guo <guojinhui.liam@bytedance.com>
> ---
>  drivers/iommu/amd/iommu.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

Applied, thanks.

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2025-11-25 14:10 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-11-20 15:47 [PATCH] iommu/amd: Propagate the error code returned by __modify_irte_ga() in modify_irte_ga() Jinhui Guo
2025-11-21  4:35 ` Ankit Soni
2025-11-21  8:13 ` Vasant Hegde
2025-11-25 14:10 ` Jörg Rödel

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®