[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <aXNKeKmkclah0eOp@ryzen>
Date: Fri, 23 Jan 2026 11:16:24 +0100
From: Niklas Cassel <cassel@...nel.org>
To: Koichiro Den <den@...inux.co.jp>, frank.li@....com
Cc: Manivannan Sadhasivam <mani@...nel.org>, bhelgaas@...gle.com,
kwilczynski@...nel.org, linux-pci@...r.kernel.org,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH v8 0/5] PCI: endpoint: BAR subrange mapping support
On Fri, Jan 23, 2026 at 09:35:01AM +0100, Niklas Cassel wrote:
>
> pci_epf_test_enable_doorbell() simply does:
> pci_epc_get_next_free_bar() to get a BAR, then writes the BAR
> number in the in the pci-epf-test command registers, offset:
> PCI_ENDPOINT_TEST_DB_BAR 0x34
>
> However, the doorbells are most likely very small, so the chances
> that reg->doorbell_offset will have a value that is smaller than
> BAR size seems likely... but not guaranteed... and there is no
>
> if (reg->doorbell_offset > epf->bar[bar].size)
> goto err_doorbell_cleanup;
>
> So it seems that this doorbell test just ignores the problem...
>
> Frank, could you perhaps send a patch to add something like the above?
Frank, I guess the check would actually have to be something like:
if (reg->doorbell_offset + size of the doorbell > epf->bar[bar].size)
goto err_doorbell_cleanup;
Kind regards,
Niklas
Powered by blists - more mailing lists