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: <a63db205-ca63-436e-a63a-871bb527f5b7@mailbox.org>
Date: Fri, 5 Sep 2025 13:38:12 +0200
From: Marek Vasut <marek.vasut@...lbox.org>
To: Jerome Brunet <jbrunet@...libre.com>
Cc: Niklas Cassel <cassel@...nel.org>, Damien Le Moal <dlemoal@...nel.org>,
 Marek Vasut <marek.vasut+renesas@...lbox.org>, linux-pci@...r.kernel.org,
 Krzysztof WilczyƄski <kwilczynski@...nel.org>,
 Bjorn Helgaas <bhelgaas@...gle.com>, Frank Li <Frank.Li@....com>,
 Kishon Vijay Abraham I <kishon@...nel.org>,
 Manivannan Sadhasivam <mani@...nel.org>, Wang Jiang <jiangwang@...inos.cn>,
 linux-kernel@...r.kernel.org, linux-renesas-soc@...r.kernel.org
Subject: Re: [PATCH] PCI: endpoint: pci-epf-test: Limit PCIe BAR size for
 fixed BARs

On 9/5/25 9:43 AM, Jerome Brunet wrote:

Hello Jerome,

>>> pci_epf_alloc_space() works like this:
>>> If the user requests a BAR size that is smaller than the fixed-size BAR,
>>> it will allocate space matching the fixed-size.
>>> As in most cases, having a BAR larger than needed by an EPF driver is
>>> still acceptable.
>>> However, if the user requests a size larger than the fixed-size BAR,
>>> as in your case, we will return an error, as we cannot fulfill the
>>> user's request.
>>> I don't see any alternative other than your/Damien's proposal above.
>>> Unfortunately, all EPF drivers would probably need this same change.
>>
>> It seems that pci-epf-ntb and pci-epf-vntb only use BAR0 (BAR_CONFIG) and
>> BAR0+BAR1 (BAR_CONFIG and BAR_DB) , so those should be OK on this
>> controller. NVMe EPF also seems to use only BAR0 and it specifically
>> handles fixed size BAR. It seems everything that is in the tree so far
>> managed to sidestep hitting fixed-size BAR4 problems on this hardware,
>> except for the test driver.
> 
> As it stands, a vNTB device needs 3 BARs minimum (CFG, DB and MW). The
> NTB one may get away with with 2 BARs, with DB and MW sharing one.

I clearly missed the MW, thanks for pointing this out.

> If you referring to Renesas about that BAR4, I did use it for vNTB.
> It is indeed not upstream ... yet [1]
> 
> I think it is possible to have vNTB on 2 BARs with some tweaks, putting
> CFG and DB on the same one.
> 
> [1]: https://lore.kernel.org/r/20250702-ntb-rcar-support-v3-2-4268d9c85eb7@baylibre.com

Nitpick, commit message, "Renesas R-Car Gen4" (Gen3 has a different PCIe 
controller) . Please CC linux-renesas-soc@...r.kernel.org on V3 , thank 
you !

-- 
Best regards,
Marek Vasut

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ