lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <Z65d4wr1D3F5bBeC@Asurada-Nvidia>
Date: Thu, 13 Feb 2025 13:02:27 -0800
From: Nicolin Chen <nicolinc@...dia.com>
To: Jacob Pan <jacob.pan@...ux.microsoft.com>
CC: <jgg@...dia.com>, <kevin.tian@...el.com>, <tglx@...utronix.de>,
	<maz@...nel.org>, <joro@...tes.org>, <will@...nel.org>,
	<robin.murphy@....com>, <shuah@...nel.org>, <iommu@...ts.linux.dev>,
	<linux-kernel@...r.kernel.org>, <linux-arm-kernel@...ts.infradead.org>,
	<linux-kselftest@...r.kernel.org>, <eric.auger@...hat.com>,
	<baolu.lu@...ux.intel.com>, <yi.l.liu@...el.com>, <yury.norov@...il.com>,
	<patches@...ts.linux.dev>
Subject: Re: [PATCH v1 01/13] genirq/msi: Store the IOMMU IOVA directly in
 msi_desc instead of iommu_cookie

On Thu, Feb 13, 2025 at 12:28:49PM -0800, Jacob Pan wrote:
> Hi Nicolin,
> 
> On Sat, 8 Feb 2025 01:02:34 -0800
> Nicolin Chen <nicolinc@...dia.com> wrote:
> 
> > -static inline void msi_desc_set_iommu_cookie(struct msi_desc *desc,
> > -					     const void
> > *iommu_cookie) +/**
> > + * iommu_dma_compose_msi_msg() - Apply translation to an MSI message
> > + * @desc: MSI descriptor prepared by iommu_dma_prepare_msi()
> > + * @msg: MSI message containing target physical address
> > + */
> Is it IOVA not PA?

This is moved from dma-iommu.c so we didn't change that.

And I think it's correct to say "target physical address" as the
irqchip driver does pass in a PA via @msg.

Then iommu_dma_compose_msi_msg() kind of reverse-translates that,
overwriting the msg with the "IOVA" from @desc.

Thanks
Nicolin

> > +static inline void iommu_dma_compose_msi_msg(struct msi_desc *desc,
> > +					     struct msi_msg *msg)
> >  {
> > -}
> > +#ifdef CONFIG_IRQ_MSI_IOMMU
> > +	if (desc->iommu_msi_page_shift) {
> > +		u64 msi_iova = desc->iommu_msi_iova
> > +			       << desc->iommu_msi_page_shift;
> > +
> > +		msg->address_hi = upper_32_bits(msi_iova);
> > +		msg->address_lo = lower_32_bits(msi_iova) |
> > +				  (msg->address_lo &
> > +				   ((1 <<
> > desc->iommu_msi_page_shift) - 1));
> > +	}
> >  #endif
> > +}

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ