Re: [Qemu-devel] [PATCH v2 1/2] memory: Fix old portio word accesses

2011-09-26 Thread Avi Kivity
On 09/18/2011 03:51 PM, Jan Kiszka wrote: From: Jan Kiszka As we register old portio regions via ioport_register, we are also responsible for providing the word access wrapper. Signed-off-by: Jan Kiszka --- Oops, was lacking a shift for word reads. Thanks, applied; while I don't like it, v

Re: [Qemu-devel] [PATCH v2 1/2] memory: Fix old portio word accesses

2011-09-19 Thread Avi Kivity
On 09/19/2011 04:55 PM, Gerd Hoffmann wrote: If the register access is trivial then you don't need to call into the driver at all ... You can have a look at hw/intel-hda.c which actually implements something like this, with some commonly needed features: * The "offset" field already ment

Re: [Qemu-devel] [PATCH v2 1/2] memory: Fix old portio word accesses

2011-09-19 Thread Gerd Hoffmann
Hi, The trick of having a way to register N callbacks with one shot is worth growing. Ideally each register in a BAR would have a callback and we'd do something like MemoryRegionOps mydev_ops = { .registers = { { MYDEV_REG_x, 4, 4, mydev_reg_x_read, mydev_reg_x_wr

Re: [Qemu-devel] [PATCH v2 1/2] memory: Fix old portio word accesses

2011-09-19 Thread Avi Kivity
On 09/19/2011 03:55 PM, Jan Kiszka wrote: > > The trick of having a way to register N callbacks with one shot is worth > growing. Ideally each register in a BAR would have a callback and we'd > do something like > > MemoryRegionOps mydev_ops = { > .registers = { >

Re: [Qemu-devel] [PATCH v2 1/2] memory: Fix old portio word accesses

2011-09-19 Thread Jan Kiszka
On 2011-09-19 14:42, Avi Kivity wrote: > On 09/19/2011 03:32 PM, Jan Kiszka wrote: >> > It's opt-in. If a device sets >> > MemoryRegionOps::impl.{min,max}_access_size = 1, it will only be fed >> > byte accesses (the core will take care of breaking apart larger >> > writes). If it sets MemoryR

Re: [Qemu-devel] [PATCH v2 1/2] memory: Fix old portio word accesses

2011-09-19 Thread Avi Kivity
On 09/19/2011 03:32 PM, Jan Kiszka wrote: > It's opt-in. If a device sets > MemoryRegionOps::impl.{min,max}_access_size = 1, it will only be fed > byte accesses (the core will take care of breaking apart larger > writes). If it sets MemoryRegionOps::impl.{min,max}_access_size = 4, it > wil

Re: [Qemu-devel] [PATCH v2 1/2] memory: Fix old portio word accesses

2011-09-19 Thread Jan Kiszka
On 2011-09-19 14:19, Avi Kivity wrote: > On 09/18/2011 10:07 PM, Jan Kiszka wrote: >> On 2011-09-18 18:49, Avi Kivity wrote: >> > On 09/18/2011 07:28 PM, Jan Kiszka wrote: >> >> >> >> >> >> This is PIO, limited by the x86 address space to 16 bit. Will >> add a >> >> >> comment. >> >> > >>

Re: [Qemu-devel] [PATCH v2 1/2] memory: Fix old portio word accesses

2011-09-19 Thread Avi Kivity
On 09/18/2011 10:07 PM, Jan Kiszka wrote: On 2011-09-18 18:49, Avi Kivity wrote: > On 09/18/2011 07:28 PM, Jan Kiszka wrote: >> >> >> >> This is PIO, limited by the x86 address space to 16 bit. Will add a >> >> comment. >> > >> > x86 PIO is not limited to 16 bits, just ISA, which memo

Re: [Qemu-devel] [PATCH v2 1/2] memory: Fix old portio word accesses

2011-09-18 Thread Jan Kiszka
On 2011-09-18 18:49, Avi Kivity wrote: > On 09/18/2011 07:28 PM, Jan Kiszka wrote: >> >> >> >> This is PIO, limited by the x86 address space to 16 bit. Will add a >> >> comment. >> > >> > x86 PIO is not limited to 16 bits, just ISA, which memory.c knows >> > nothing about. >> >> Confused addres

Re: [Qemu-devel] [PATCH v2 1/2] memory: Fix old portio word accesses

2011-09-18 Thread Avi Kivity
On 09/18/2011 07:28 PM, Jan Kiszka wrote: >> >> This is PIO, limited by the x86 address space to 16 bit. Will add a >> comment. > > x86 PIO is not limited to 16 bits, just ISA, which memory.c knows > nothing about. Confused address and data, the former is limited 16, the latter can be 32 as

Re: [Qemu-devel] [PATCH v2 1/2] memory: Fix old portio word accesses

2011-09-18 Thread Jan Kiszka
On 2011-09-18 17:45, Avi Kivity wrote: > On 09/18/2011 06:43 PM, Jan Kiszka wrote: >> On 2011-09-18 17:37, Avi Kivity wrote: >> > On 09/18/2011 03:51 PM, Jan Kiszka wrote: >> >> From: Jan Kiszka >> >> >> >> As we register old portio regions via ioport_register, we are also >> >> responsible for

Re: [Qemu-devel] [PATCH v2 1/2] memory: Fix old portio word accesses

2011-09-18 Thread Avi Kivity
On 09/18/2011 06:43 PM, Jan Kiszka wrote: On 2011-09-18 17:37, Avi Kivity wrote: > On 09/18/2011 03:51 PM, Jan Kiszka wrote: >> From: Jan Kiszka >> >> As we register old portio regions via ioport_register, we are also >> responsible for providing the word access wrapper. >> >> Signed-off-by:

Re: [Qemu-devel] [PATCH v2 1/2] memory: Fix old portio word accesses

2011-09-18 Thread Jan Kiszka
On 2011-09-18 17:37, Avi Kivity wrote: > On 09/18/2011 03:51 PM, Jan Kiszka wrote: >> From: Jan Kiszka >> >> As we register old portio regions via ioport_register, we are also >> responsible for providing the word access wrapper. >> >> Signed-off-by: Jan Kiszka >> --- >> >> Oops, was lacking a shif

Re: [Qemu-devel] [PATCH v2 1/2] memory: Fix old portio word accesses

2011-09-18 Thread Avi Kivity
On 09/18/2011 03:51 PM, Jan Kiszka wrote: From: Jan Kiszka As we register old portio regions via ioport_register, we are also responsible for providing the word access wrapper. Signed-off-by: Jan Kiszka --- Oops, was lacking a shift for word reads. memory.c | 10 ++ 1 files chang