qemu-devel
[Top][All Lists]
Advanced

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

Re: [PATCH] qemu/bitops.h: Locate changed bits


From: Ho, Tong
Subject: Re: [PATCH] qemu/bitops.h: Locate changed bits
Date: Wed, 29 May 2024 17:29:11 +0000

Point taken, and I am withdrawing this patch.

I will post a new implementation following the arbitrary-length array pattern
in a later date, and only as part of a series including the consuming code.

Thanks,
Tong Ho


From: Peter Maydell <peter.maydell@linaro.org>
Sent: Wednesday, May 29, 2024 6:44 AM
To: Ho, Tong <tong.ho@amd.com>
Cc: qemu-devel@nongnu.org <qemu-devel@nongnu.org>
Subject: Re: [PATCH] qemu/bitops.h: Locate changed bits
 
On Wed, 29 May 2024 at 06:05, Tong Ho <tong.ho@amd.com> wrote:
>
> Add inlined functions to obtain a mask of changed bits.  3 flavors
> are added: toggled, changed to 1, changed to 0.
>
> These newly added utilities aid common device behaviors where
> actions are taken only when a register's bit(s) are changed.

Generally we would expect this kind of "add new utility functions"
patch to appear in a series together with some patches which
actually use the new functions. Otherwise this is all dead code.

More generally:
 * the other bit operations in this file work on bit arrays
   which are arbitrary-length arrays of unsigned long, so
   these new functions don't fit the pattern
 * we have the bitops functions partly because they're inherited
   from the Linux kernel. The use of unsigned long works quite
   badly in QEMU, because for us 'long' is a type that is almost
   always wrong. QEMU devices usually want a type of a known
   length, which is either 'uint32_t' or 'uint64_t'. So I'm
   dubious about adding more functions that work on unsigned long.

thanks
-- PMM

reply via email to

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