On 05/19/2015 03:43 PM, Rustad, Mark D wrote:
On May 19, 2015, at 2:17 PM, Alexander Duyck <alexander.duyck@xxxxxxxxx> wrote:
Any chance you could point me toward the software in question? Just wondering because it seems like what you are fixing with this is an implementation issue in the application since you really shouldn't be accessing areas outside the scope of the VPD data structure, and doing so is undefined in terms of what happens if you do.
I don't have it, but if you dump VPD via sysfs you will see it comes out as 32k in size. The kernel just blindly provides access to the full 32K space provided by the spec. I'm sure that we agree that the kernel should not go parse it and find the actual size. If it is read via stdio, say fread, the read access would be whatever buffer size it chooses to use.
If you looked at the quirks, you might have noticed that Broadcom limited the VPD access for some devices for functional reasons. That is what gave me the idea for limiting access to what was possibly there. With the existing Intel Ethernet quirk, it seemed like a simple thing to do.
Actually we probably should be parsing through the VPD data. The PCIe
spec doesn't define what happens if you read past the end marker, and I
suspect most applications are probably performing sequential reads of
the data instead of just accessing offsets anyway since that is how this
is really meant to be accessed. So if we moved this to a sequenced
interface instead of a memory mapped style interface it would probably
work out better anyway since we could perform multiple reads in sequence
instead of one at a time.
- Alex
--
To unsubscribe from this list: send the line "unsubscribe linux-pci" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html