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: <86h68o1ks1.wl-maz@kernel.org>
Date: Sun, 03 Nov 2024 13:58:38 +0000
From: Marc Zyngier <maz@...nel.org>
To: Frank Li <Frank.Li@....com>
Cc: Bjorn Helgaas <bhelgaas@...gle.com>,	Richard Zhu <hongxing.zhu@....com>,
	Lucas Stach <l.stach@...gutronix.de>,	Lorenzo Pieralisi
 <lpieralisi@...nel.org>,	Krzysztof WilczyƄski
 <kw@...ux.com>,	Manivannan Sadhasivam <manivannan.sadhasivam@...aro.org>,
	Rob Herring <robh@...nel.org>,	Shawn Guo <shawnguo@...nel.org>,	Sascha
 Hauer <s.hauer@...gutronix.de>,	Pengutronix Kernel Team
 <kernel@...gutronix.de>,	Fabio Estevam <festevam@...il.com>,
	linux-pci@...r.kernel.org,	linux-kernel@...r.kernel.org,
	linux-arm-kernel@...ts.infradead.org,	imx@...ts.linux.dev,
	Frank.li@....com,	alyssa@...enzweig.io,	bpf@...r.kernel.org,
	broonie@...nel.org,	jgg@...pe.ca,	joro@...tes.org,	lgirdwood@...il.com,
	p.zabel@...gutronix.de,	robin.murphy@....com,	will@...nel.org
Subject: Re: [PATCH v4 1/2] PCI: Add enable_device() and disable_device() callbacks for bridges

On Fri, 01 Nov 2024 21:04:39 +0000,
Frank Li <Frank.Li@....com> wrote:
> 
> Some PCIe host bridges require special handling when enabling or disabling
> PCIe Endpoints. For example, the i.MX95 platform has a lookup table to map
> Requester IDs to StreamIDs, which are used by the SMMU and MSI controller
> to identify the source of DMA accesses.
> 
> Without this mapping, DMA accesses may target unintended memory, which
> would corrupt memory or read the wrong data.
> 
> Add a host bridge .enable_device() hook the imx6 driver can use to
> configure the Requester ID to StreamID mapping. The hardware table isn't
> big enough to map all possible Requester IDs, so this hook may fail if no
> table space is available. In that case, return failure from
> pci_enable_device().
> 
> It might make more sense to make pci_set_master() decline to enable bus
> mastering and return failure, but it currently doesn't have a way to return
> failure.
> 
> Acked-by: Bjorn Helgaas <bhelgaas@...gle.com>
> Signed-off-by: Frank Li <Frank.Li@....com>

I converted the fruity PCIe controller over to this infrastructure,
and things seem to work fine. FWIW:

Reviewed-by: Marc Zyngier <maz@...nel.org>
Tested-by: Marc Zyngier <maz@...nel.org>

	M.

-- 
Without deviation from the norm, progress is not possible.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ