All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jason Gunthorpe <jgg@nvidia.com>
To: "Suthikulpanit, Suravee" <suravee.suthikulpanit@amd.com>
Cc: linux-kernel@vger.kernel.org, joro@8bytes.org,
	kevin.tian@intel.com, vasant.hegde@amd.com,
	iommu@lists.linux.dev, santosh.shukla@amd.com,
	sairaj.arunkodilkar@amd.com, jon.grimm@amd.com,
	prashanthpra@google.com, wvw@google.com, wnliu@google.com,
	gptran@google.com, kpsingh@google.com
Subject: Re: [PATCH] iommu/amd: Add support for hw_info for iommu capability query
Date: Tue, 26 Aug 2025 15:48:58 -0300	[thread overview]
Message-ID: <20250826184858.GI2130239@nvidia.com> (raw)
In-Reply-To: <a4260493-9f75-4446-ad01-61556ed8e034@amd.com>

On Tue, Aug 26, 2025 at 01:43:59PM -0500, Suthikulpanit, Suravee wrote:
> 
> 
> On 8/26/2025 12:58 PM, Jason Gunthorpe wrote:
> > On Tue, Aug 26, 2025 at 12:36:23PM -0500, Suthikulpanit, Suravee wrote:
> > > > I think you should probably just pass the raw HW value through and
> > > > require the VMM to figure out what bits it needs based on feature
> > > > flags elsewhere.
> > > 
> > > The problem is some of the features are virtualized by hardware, which needs
> > > enabling from the Linux AMD IOMMU driver. We cannot just provide all flags
> > > since VMM would not know if the kernel has the support enabled.
> > 
> > The VMM is not supposed to forward these flags as-is! It is sort of
> > some kind of maximum what the underlying HW can support.
> > 
> > If you forward as-is then the VMM will forward broken flags it doesn't
> > support when the kernel gets updated, that isn't OK.
> 
> I got this part. That's why we mask out unsupported feature flags before
> returning the EFR/EFR2 to the VMM.

The kernel can't do anything on behalf of the VMM, it doesn't know
what the VMM even supports emulating.

The VMM alone is responsible to build the efr/efr2 values. The VMM may
choose to copy only some bits from the kernel, but only if it knows it
can support whatever it is copying.

> > Each and every feature the VMM wants to show in the EFR has to figured
> > out on its own if it can be supported based on other kernel features.
> > 
> > The utility of the get_info return is for HW features that don't
> > require any special kernel enablement.
> 
> Not sure if I got this part. Are you referring to the struct
> vfio_iommu_type1_info and vfio_iommu_type1_get_info()?

Sorry hw_info.

Jason

      reply	other threads:[~2025-08-26 18:49 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-08-20  4:25 [PATCH] iommu/amd: Add support for hw_info for iommu capability query Suravee Suthikulpanit
2025-08-25 13:44 ` Jason Gunthorpe
2025-08-26 17:36   ` Suthikulpanit, Suravee
2025-08-26 17:58     ` Jason Gunthorpe
2025-08-26 18:43       ` Suthikulpanit, Suravee
2025-08-26 18:48         ` Jason Gunthorpe [this message]

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=20250826184858.GI2130239@nvidia.com \
    --to=jgg@nvidia.com \
    --cc=gptran@google.com \
    --cc=iommu@lists.linux.dev \
    --cc=jon.grimm@amd.com \
    --cc=joro@8bytes.org \
    --cc=kevin.tian@intel.com \
    --cc=kpsingh@google.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=prashanthpra@google.com \
    --cc=sairaj.arunkodilkar@amd.com \
    --cc=santosh.shukla@amd.com \
    --cc=suravee.suthikulpanit@amd.com \
    --cc=vasant.hegde@amd.com \
    --cc=wnliu@google.com \
    --cc=wvw@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 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.