qemu-devel
[Top][All Lists]
Advanced

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

Re: [PATCH v2] hw/arm_sysctl: fix extracting 31th bit of val


From: Peter Maydell
Subject: Re: [PATCH v2] hw/arm_sysctl: fix extracting 31th bit of val
Date: Fri, 10 Jan 2025 12:29:20 +0000

On Fri, 20 Dec 2024 at 12:54, Anastasia Belova <abelova@astralinux.ru> wrote:
>
> 1 << 31 is casted to uint64_t while bitwise and with val.
> So this value may become 0xffffffff80000000 but only
> 31th "start" bit is required.

This can't happen, because the MemoryRegionOps uses the
default max access size of 4 bytes, and so the high bytes
of val will always be zero. But the extract API is clearer
anyway, so the change is worthwhile.


Applied to target-arm.next with a clarification to the
commit message that there's no guest-visible wrong
behaviour; thanks.

-- PMM



reply via email to

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