qemu-devel
[Top][All Lists]
Advanced

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

Re: [PATCH v2] hw/misc: use extract64 instead of 1 << i


From: Alex Bennée
Subject: Re: [PATCH v2] hw/misc: use extract64 instead of 1 << i
Date: Fri, 27 Dec 2024 12:37:02 +0000
User-agent: mu4e 1.12.8; emacs 29.4

Tigran Sogomonian <tsogomonian@astralinux.ru> writes:

> 1 << i is casted to uint64_t while bitwise and with val.
> So this value may become 0xffffffff80000000 but only
> 31th "start" bit is required.
> Use the bitfield extract() API instead.
>
> Found by Linux Verification Center (linuxtesting.org) with SVACE.
>
> Signed-off-by: Tigran Sogomonian <tsogomonian@astralinux.ru>

Reviewed-by: Alex Bennée <alex.bennee@linaro.org>

-- 
Alex Bennée
Virtualisation Tech Lead @ Linaro



reply via email to

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