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: <Z8dqU4BGa2aZ2L81@lizhi-Precision-Tower-5810>
Date: Tue, 4 Mar 2025 16:02:11 -0500
From: Frank Li <Frank.li@....com>
To: Bjorn Helgaas <helgaas@...nel.org>
Cc: Jesper Nilsson <jesper.nilsson@...s.com>,
	Lars Persson <lars.persson@...s.com>, Rob Herring <robh@...nel.org>,
	Krzysztof Kozlowski <krzk+dt@...nel.org>,
	Conor Dooley <conor+dt@...nel.org>,
	Lorenzo Pieralisi <lpieralisi@...nel.org>,
	Krzysztof WilczyƄski <kw@...ux.com>,
	Manivannan Sadhasivam <manivannan.sadhasivam@...aro.org>,
	Bjorn Helgaas <bhelgaas@...gle.com>, linux-arm-kernel@...s.com,
	devicetree@...r.kernel.org, linux-kernel@...r.kernel.org,
	linux-pci@...r.kernel.org
Subject: Re: [PATCH RFC NOT TESTED 2/2] PCI: artpec6: Use
 use_parent_dt_ranges and clean up artpec6_pcie_cpu_addr_fixup()

On Tue, Mar 04, 2025 at 02:31:46PM -0600, Bjorn Helgaas wrote:
> On Tue, Mar 04, 2025 at 03:12:11PM -0500, Frank Li wrote:
> > On Tue, Mar 04, 2025 at 01:08:16PM -0600, Bjorn Helgaas wrote:
> > > On Tue, Mar 04, 2025 at 12:49:36PM -0500, Frank Li wrote:
> > > > Remove artpec6_pcie_cpu_addr_fixup() as the DT bus fabric should provide correct
> > > > address translation. Set use_parent_dt_ranges to allow the DWC core driver to
> > > > fetch address translation from the device tree.
> > >
> > > Shouldn't we be able to detect platforms where DT doesn't describe the
> > > translation correctly?  E.g., by running .cpu_addr_fixup() on a
> > > res.start value and comparing the result to the parent_bus_addr()?
> > > Then we could complain about it if they don't match.
> >
> > Can't detect because:
> >
> > There are case, driver have not provide .cpu_addr_fixup, but dts still be
> > wrong. such as
> >
> > bus@...00000
> > {
> > 	ranges = <0xdeaddead 0x1000000 size>;
> > 	pci@...00000 {
> >
> > 		reg = <...>, <0xdeaddead>;
> > 		reg-names = <...>, <config>;
> > 	}
> >
> > };
> >
> > above dts can work with current driver, but parent bus address 0xdeaddead
> > is totally fake address. We can't detect this case because no
> > .cpu_addr_fixup() at all.
>
> If there's no .cpu_addr_fixup(), primary-side ATU addresses must be
> identical to CPU addresses.  If the DT parent bus address is
> different, can't we assume the DT is broken?

I think so.

Frank

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ