Archive-only list for patches
 help / color / mirror / Atom feed
From: Jason Gunthorpe <jgg@nvidia.com>
To: Weinan Liu <wnliu@google.com>
Cc: iommu@lists.linux.dev, joro@8bytes.org,
	suravee.suthikulpanit@amd.com, will@kernel.org,
	patches@lists.linux.dev, robin.murphy@arm.com,
	vasant.hegde@amd.com, santosh.shukla@amd.com, chrisl@kernel.org
Subject: Re: [PATCH] iommu/amd: Fix precedence order in set_dte_passthrough()
Date: Thu, 30 Apr 2026 20:03:43 -0300	[thread overview]
Message-ID: <20260430230343.GC6829@nvidia.com> (raw)
In-Reply-To: <20260430225414.205094-1-wnliu@google.com>

On Thu, Apr 30, 2026 at 10:54:14PM +0000, Weinan Liu wrote:
> Bitwise OR | operator has a higher precedence than the ternary ?:
> operatior. It will be incorrectly evaluated as:
> 
> new->data[1] |= (FIELD_PREP(...) | dev_data->ats_enabled) ? DTE_FLAG_IOTLB : 0;
> 
> Wrap the conditional operation in parentheses to enforce the
> correct evaluation order.
> 
> Fixes: 93eee2a49c1b ("iommu/amd: Refactor logic to program the host page table in DTE")
> Signed-off-by: Weinan Liu <wnliu@google.com>
> ---
>  drivers/iommu/amd/iommu.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)

Reviewed-by: Jason Gunthorpe <jgg@nvidia.com>

This should go to rc

Jason

  reply	other threads:[~2026-04-30 23:03 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-04-30 22:54 [PATCH] iommu/amd: Fix precedence order in set_dte_passthrough() Weinan Liu
2026-04-30 23:03 ` Jason Gunthorpe [this message]
2026-05-04  4:36 ` Vasant Hegde
  -- strict thread matches above, loose matches on Subject: below --
2026-04-30 23:28 Weinan Liu
2026-05-01  0:00 ` Weinan Liu
2026-05-01  3:01   ` Chris Li
2026-05-04  4:57 ` Vasant Hegde

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=20260430230343.GC6829@nvidia.com \
    --to=jgg@nvidia.com \
    --cc=chrisl@kernel.org \
    --cc=iommu@lists.linux.dev \
    --cc=joro@8bytes.org \
    --cc=patches@lists.linux.dev \
    --cc=robin.murphy@arm.com \
    --cc=santosh.shukla@amd.com \
    --cc=suravee.suthikulpanit@amd.com \
    --cc=vasant.hegde@amd.com \
    --cc=will@kernel.org \
    --cc=wnliu@google.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