|
| From: | Avi Kivity |
| Subject: | Re: [Qemu-devel] [PATCH v2 1/2] memory: Fix old portio word accesses |
| Date: | Mon, 19 Sep 2011 15:42:45 +0300 |
| User-agent: | Mozilla/5.0 (X11; Linux x86_64; rv:6.0.2) Gecko/20110906 Thunderbird/6.0.2 |
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
> will only get long accesses (and the core will/should shift/mask or
> RMW). Refusing illegal access sizes is done using
> MemoryRegionOps::valid. Most of this is unimplemented unfortunately.
That makes sense (for non-old_portio users).
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_write, },
...
},
}
with hints to the core like "this register sits at this offset, use it
for reads instead of a callback", or, "this is a read-only register".
-- error compiling committee.c: too many arguments to function
| [Prev in Thread] | Current Thread | [Next in Thread] |