[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <fb3aa671-45bc-4d57-b90b-2056eeed0ea6@app.fastmail.com>
Date: Tue, 14 Jan 2025 19:20:09 +0000
From: "Jiaxun Yang" <jiaxun.yang@...goat.com>
To: "Arnd Bergmann" <arnd@...db.de>,
"Thomas Bogendoerfer" <tsbogend@...ha.franken.de>,
"Baoquan He" <bhe@...hat.com>
Cc: "linux-mips@...r.kernel.org" <linux-mips@...r.kernel.org>,
linux-kernel@...r.kernel.org,
"stable@...r.kernel.org" <stable@...r.kernel.org>,
Mateusz Jończyk <mat.jonczyk@...pl>
Subject: Re: [PATCH] MIPS: pci-legacy: Override pci_address_to_pio
在2025年1月14日一月 下午7:03,Arnd Bergmann写道:
> On Tue, Jan 14, 2025, at 19:11, Jiaxun Yang wrote:
>>
>> +unsigned long pci_address_to_pio(phys_addr_t address)
>> +{
>> + if (address > IO_SPACE_LIMIT)
>> + return (unsigned long)-1;
>> +
>> + return (unsigned long) address;
>> +}
>> +
>> /*
>
> Isn't the argument to this function a CPU physical address? I
> don't think there is a point comparing it to IO_SPACE_LIMIT
> on architectures where I/O space is memory mapped.
Actually not. It seems like the argument here is just raw PIO offset,
without applying mips_io_port_base.
We should validate it to ensure it's within the range specified by
mips_io_port_base (which is sized by IO_SPACE_LIMIT).
Thanks
>
> I see that you copied the above from the the non-PCI_IOBASE case
> of drivers/pci/pci.c, but that only really makes sense for
> architectures that have special port I/O instructions (x86,
> ia64) or that use logic_pio.
>
> Arnd
--
- Jiaxun
Powered by blists - more mailing lists