RE: [PATCHv2] pci: Update VPD size with correct length

2015-12-16 Thread Seymour, Shane M
> The only 'error' cases I've encountered so far is a read of all zeroes (and a > halting the machine once you've read beyond a certain point) or a read of > 0xff throughout the entire area. So that approach would work for both of them. I should add that I'd tested the previous patch and this

Re: [PATCHv2] pci: Update VPD size with correct length

2015-12-16 Thread Hannes Reinecke
On Wednesday, December 16, 2015 09:13:35 AM Alexander Duyck wrote: > On Wed, Dec 16, 2015 at 9:01 AM, Hannes Reinecke wrote: > > On Wednesday, December 16, 2015 08:52:10 AM Alexander Duyck wrote: > >> On Wed, Dec 16, 2015 at 2:49 AM, Hannes Reinecke wrote: > >> > + if (header[0] ==

Re: [PATCHv2] pci: Update VPD size with correct length

2015-12-16 Thread Alexander Duyck
On Wed, Dec 16, 2015 at 9:01 AM, Hannes Reinecke wrote: > On Wednesday, December 16, 2015 08:52:10 AM Alexander Duyck wrote: >> On Wed, Dec 16, 2015 at 2:49 AM, Hannes Reinecke wrote: >> > + if (header[0] == 0xff) { >> > + /* Invalid data from VPD read */ >>

Re: [PATCHv2] pci: Update VPD size with correct length

2015-12-16 Thread Hannes Reinecke
On Wednesday, December 16, 2015 08:52:10 AM Alexander Duyck wrote: > On Wed, Dec 16, 2015 at 2:49 AM, Hannes Reinecke wrote: > > PCI-2.2 VPD entries have a maximum size of 32k, but might actually > > be smaller than that. To figure out the actual size one has to read > > the VPD area until the

Re: [PATCHv2] pci: Update VPD size with correct length

2015-12-16 Thread Alexander Duyck
On Wed, Dec 16, 2015 at 2:49 AM, Hannes Reinecke wrote: > PCI-2.2 VPD entries have a maximum size of 32k, but might actually > be smaller than that. To figure out the actual size one has to read > the VPD area until the 'end marker' is reached. > Trying to read VPD data beyond that marker results

[PATCHv2] pci: Update VPD size with correct length

2015-12-16 Thread Hannes Reinecke
PCI-2.2 VPD entries have a maximum size of 32k, but might actually be smaller than that. To figure out the actual size one has to read the VPD area until the 'end marker' is reached. Trying to read VPD data beyond that marker results in 'interesting' effects, from simple read errors to crashing

Re: [PATCHv2] pci: Update VPD size with correct length

2015-12-16 Thread Alexander Duyck
On Wed, Dec 16, 2015 at 9:01 AM, Hannes Reinecke wrote: > On Wednesday, December 16, 2015 08:52:10 AM Alexander Duyck wrote: >> On Wed, Dec 16, 2015 at 2:49 AM, Hannes Reinecke wrote: >> > + if (header[0] == 0xff) { >> > + /*

Re: [PATCHv2] pci: Update VPD size with correct length

2015-12-16 Thread Alexander Duyck
On Wed, Dec 16, 2015 at 2:49 AM, Hannes Reinecke wrote: > PCI-2.2 VPD entries have a maximum size of 32k, but might actually > be smaller than that. To figure out the actual size one has to read > the VPD area until the 'end marker' is reached. > Trying to read VPD data beyond that

Re: [PATCHv2] pci: Update VPD size with correct length

2015-12-16 Thread Hannes Reinecke
On Wednesday, December 16, 2015 08:52:10 AM Alexander Duyck wrote: > On Wed, Dec 16, 2015 at 2:49 AM, Hannes Reinecke wrote: > > PCI-2.2 VPD entries have a maximum size of 32k, but might actually > > be smaller than that. To figure out the actual size one has to read > > the VPD

Re: [PATCHv2] pci: Update VPD size with correct length

2015-12-16 Thread Hannes Reinecke
On Wednesday, December 16, 2015 09:13:35 AM Alexander Duyck wrote: > On Wed, Dec 16, 2015 at 9:01 AM, Hannes Reinecke wrote: > > On Wednesday, December 16, 2015 08:52:10 AM Alexander Duyck wrote: > >> On Wed, Dec 16, 2015 at 2:49 AM, Hannes Reinecke wrote: > >> > +

RE: [PATCHv2] pci: Update VPD size with correct length

2015-12-16 Thread Seymour, Shane M
> The only 'error' cases I've encountered so far is a read of all zeroes (and a > halting the machine once you've read beyond a certain point) or a read of > 0xff throughout the entire area. So that approach would work for both of them. I should add that I'd tested the previous patch and this

[PATCHv2] pci: Update VPD size with correct length

2015-12-16 Thread Hannes Reinecke
PCI-2.2 VPD entries have a maximum size of 32k, but might actually be smaller than that. To figure out the actual size one has to read the VPD area until the 'end marker' is reached. Trying to read VPD data beyond that marker results in 'interesting' effects, from simple read errors to crashing