Re: [Qemu-devel] [PATCH] pci: Length-align config space accesses

2011-07-20 Thread Isaku Yamahata
Hi. This clean up looks good basically. But when conventional pci device is accessed via MMCONFIG area, addr = addr_mask doesn't work as expected. The config area of [256, 4K) of conventional pci should have no effect. thanks, On Tue, Jul 19, 2011 at 11:39:02PM +0200, Jan Kiszka wrote: From:

Re: [Qemu-devel] [PATCH] pci: Length-align config space accesses

2011-07-20 Thread Jan Kiszka
On 2011-07-20 14:00, Isaku Yamahata wrote: Hi. This clean up looks good basically. Oops, forgot to cc you. Sorry. But when conventional pci device is accessed via MMCONFIG area, addr = addr_mask doesn't work as expected. The config area of [256, 4K) of conventional pci should have no effect.

Re: [Qemu-devel] [PATCH] pci: Length-align config space accesses

2011-07-20 Thread Jan Kiszka
On 2011-07-20 14:15, Jan Kiszka wrote: On 2011-07-20 14:00, Isaku Yamahata wrote: Hi. This clean up looks good basically. Oops, forgot to cc you. Sorry. But when conventional pci device is accessed via MMCONFIG area, addr = addr_mask doesn't work as expected. The config area of [256, 4K)

Re: [Qemu-devel] [PATCH] pci: Length-align config space accesses

2011-07-20 Thread Michael S. Tsirkin
On Tue, Jul 19, 2011 at 11:39:02PM +0200, Jan Kiszka wrote: From: Jan Kiszka jan.kis...@siemens.com Introduce pci_config_read/write helpers to split up config space accesses that are not length-aligned. This particularly avoids that each and every device needs to check for config space

Re: [Qemu-devel] [PATCH] pci: Length-align config space accesses

2011-07-20 Thread Michael S. Tsirkin
On Wed, Jul 20, 2011 at 04:36:51PM +0200, Jan Kiszka wrote: A 4 byte access at address 255 would wrap around to 0 with this, while previously we ignored high bits on write and returned 0 on read. The question is rather what the spec or real hw demand from us. Do you have any insights on

Re: [Qemu-devel] [PATCH] pci: Length-align config space accesses

2011-07-20 Thread Jan Kiszka
On 2011-07-20 16:22, Michael S. Tsirkin wrote: On Tue, Jul 19, 2011 at 11:39:02PM +0200, Jan Kiszka wrote: From: Jan Kiszka jan.kis...@siemens.com Introduce pci_config_read/write helpers to split up config space accesses that are not length-aligned. This particularly avoids that each and

Re: [Qemu-devel] [PATCH] pci: Length-align config space accesses

2011-07-20 Thread Michael S. Tsirkin
On Thu, Jul 21, 2011 at 01:17:02AM +0900, Isaku Yamahata wrote: On Wed, Jul 20, 2011 at 04:27:08PM +0200, Jan Kiszka wrote: On 2011-07-20 14:15, Jan Kiszka wrote: On 2011-07-20 14:00, Isaku Yamahata wrote: Hi. This clean up looks good basically. Oops, forgot to cc you. Sorry.

Re: [Qemu-devel] [PATCH] pci: Length-align config space accesses

2011-07-20 Thread Isaku Yamahata
On Wed, Jul 20, 2011 at 04:27:08PM +0200, Jan Kiszka wrote: On 2011-07-20 14:15, Jan Kiszka wrote: On 2011-07-20 14:00, Isaku Yamahata wrote: Hi. This clean up looks good basically. Oops, forgot to cc you. Sorry. But when conventional pci device is accessed via MMCONFIG area, addr

Re: [Qemu-devel] [PATCH] pci: Length-align config space accesses

2011-07-20 Thread Jan Kiszka
On 2011-07-20 18:17, Isaku Yamahata wrote: On Wed, Jul 20, 2011 at 04:27:08PM +0200, Jan Kiszka wrote: On 2011-07-20 14:15, Jan Kiszka wrote: On 2011-07-20 14:00, Isaku Yamahata wrote: Hi. This clean up looks good basically. Oops, forgot to cc you. Sorry. But when conventional pci device

Re: [Qemu-devel] [PATCH] pci: Length-align config space accesses

2011-07-20 Thread Michael S. Tsirkin
On Wed, Jul 20, 2011 at 06:18:43PM +0200, Jan Kiszka wrote: On 2011-07-20 18:17, Isaku Yamahata wrote: On Wed, Jul 20, 2011 at 04:27:08PM +0200, Jan Kiszka wrote: On 2011-07-20 14:15, Jan Kiszka wrote: On 2011-07-20 14:00, Isaku Yamahata wrote: Hi. This clean up looks good basically.

Re: [Qemu-devel] [PATCH] pci: Length-align config space accesses

2011-07-20 Thread Isaku Yamahata
On Wed, Jul 20, 2011 at 06:18:43PM +0200, Jan Kiszka wrote: On 2011-07-20 18:17, Isaku Yamahata wrote: On Wed, Jul 20, 2011 at 04:27:08PM +0200, Jan Kiszka wrote: On 2011-07-20 14:15, Jan Kiszka wrote: On 2011-07-20 14:00, Isaku Yamahata wrote: Hi. This clean up looks good basically.

Re: [Qemu-devel] [PATCH] pci: Length-align config space accesses

2011-07-20 Thread Michael S. Tsirkin
On Wed, Jul 20, 2011 at 07:10:57PM +0200, Jan Kiszka wrote: On 2011-07-20 18:45, Michael S. Tsirkin wrote: On Wed, Jul 20, 2011 at 06:18:43PM +0200, Jan Kiszka wrote: On 2011-07-20 18:17, Isaku Yamahata wrote: On Wed, Jul 20, 2011 at 04:27:08PM +0200, Jan Kiszka wrote: On 2011-07-20

Re: [Qemu-devel] [PATCH] pci: Length-align config space accesses

2011-07-20 Thread Jan Kiszka
On 2011-07-20 18:45, Michael S. Tsirkin wrote: On Wed, Jul 20, 2011 at 06:18:43PM +0200, Jan Kiszka wrote: On 2011-07-20 18:17, Isaku Yamahata wrote: On Wed, Jul 20, 2011 at 04:27:08PM +0200, Jan Kiszka wrote: On 2011-07-20 14:15, Jan Kiszka wrote: On 2011-07-20 14:00, Isaku Yamahata wrote:

[Qemu-devel] [PATCH] pci: Length-align config space accesses

2011-07-19 Thread Jan Kiszka
From: Jan Kiszka jan.kis...@siemens.com Introduce pci_config_read/write helpers to split up config space accesses that are not length-aligned. This particularly avoids that each and every device needs to check for config space overruns. Also move the access length assertion to the new helpers.