qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [RFC 0/5] Memory transaction attributes API


From: Peter Maydell
Subject: Re: [Qemu-devel] [RFC 0/5] Memory transaction attributes API
Date: Wed, 18 Mar 2015 10:23:34 +0000

On 18 March 2015 at 08:38, Edgar E. Iglesias <address@hidden> wrote:
> 2. The series introduces the read and write _with_attrs. Another
> approach could be to add a (for example) single .access callback.
> The callback could take a structure pointer as input, e.g:
>
> struct MemTx {
>     bool rw;
>     hwaddr addr;
>     int size;
>     uint64_t data;
>     MemTxAttrs attrs;
> }
>
> MemTxResult access(MemTx *tx)
>
> The benefit I see is that this will make it easier for us in the
> future to add new fields if needed.

I see the reasoning, but I looked at this and it just felt
awkward when I tried writing the code that way -- the code
calling the access function ends up having to create and
mutate this MemTx struct as it loops round calling the
access callback. In particular, memory.c has kept the
read and write paths separate all the way through, so
squashing them back together into a single callback
which will then immediately want to split them back out
into read vs write seemed a bit daft.

-- PMM



reply via email to

[Prev in Thread] Current Thread [Next in Thread]