[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <yq5a8qk29ejr.fsf@kernel.org>
Date: Sat, 02 Aug 2025 16:27:28 +0530
From: Aneesh Kumar K.V <aneesh.kumar@...nel.org>
To: Arto Merilainen <amerilainen@...dia.com>
Cc: linux-pci@...r.kernel.org, linux-kernel@...r.kernel.org, aik@....com,
linux-coco@...ts.linux.dev, lukas@...ner.de, kvmarm@...ts.linux.dev,
Samuel Ortiz <sameo@...osinc.com>,
Xu Yilun <yilun.xu@...ux.intel.com>,
Jason Gunthorpe <jgg@...pe.ca>,
Suzuki K Poulose <Suzuki.Poulose@....com>,
Steven Price <steven.price@....com>,
Catalin Marinas <catalin.marinas@....com>,
Marc Zyngier <maz@...nel.org>, Will Deacon <will@...nel.org>,
Oliver Upton <oliver.upton@...ux.dev>
Subject: Re: [RFC PATCH v1 13/38] coco: host: arm64: Create a PDEV with rmm
Arto Merilainen <amerilainen@...dia.com> writes:
> On 28.7.2025 16.51, Aneesh Kumar K.V (Arm) wrote:
>
>> +static int pci_res_to_pdev_addr(struct rmi_pdev_addr_range *pdev_addr,
>> + unsigned int naddr, struct resource *res,
>> + unsigned int nres)
>> +{
>> + int i, j;
>> +
>> + for (i = 0, j = 0; i < naddr && j < nres; j++) {
>> + if (res[j].flags & IORESOURCE_MEM) {
>> + pdev_addr[i].base = res[j].start;
>> + pdev_addr[i].top = res[j].end;
>
> I think there is an off-by-one bug in res[j].end. As per the RMM
> specification the base address is inclusive and the top address is
> exclusive. Both res[j].start and res[j].end are inclusive, and hence
> res[j].end seems wrong.
>
>> + /* use the rid and MMIO resources of the epdev */
>> + params->rid_top = params->rid_base = rid;
>
> Similar issue here. As per the specification the rid_base is inclusive
> and the rid_top exclusive.
>
Thanks for the review comments. I'll update the patch with the suggested changes.
-aneesh
Powered by blists - more mailing lists