From: Richard Henderson <richard.henderson@linaro.org>
To: qemu-devel <qemu-devel@nongnu.org>, Bibo Mao <maobibo@loongson.cn>
Subject: target/loongarch: Support QMP dump-guest-memory
Date: Fri, 13 Sep 2024 13:47:08 -0700 [thread overview]
Message-ID: <a554dc1c-7c6b-412f-915c-2f3ce3a11cc2@linaro.org> (raw)
In-Reply-To: <a6e35fdd-d8fb-4368-918f-e5f9cdb90105@twiddle.net>
On 9/13/24 11:44, scan-admin@coverity.com wrote:
> ** CID 1561133: Integer handling issues (BAD_SHIFT)
> /builds/qemu-project/qemu/target/loongarch/arch_dump.c: 102 in loongarch_write_elf64_fprpreg()
>
>
> ________________________________________________________________________________________________________
> *** CID 1561133: Integer handling issues (BAD_SHIFT)
> /builds/qemu-project/qemu/target/loongarch/arch_dump.c: 102 in loongarch_write_elf64_fprpreg()
> 96 int ret, i;
> 97
> 98 loongarch_note_init(¬e, s, "CORE", 5, NT_PRFPREG, sizeof(note.fpu));
> 99 note.fpu.fcsr = cpu_to_dump64(s, env->fcsr0);
> 100
> 101 for (i = 0; i < 8; i++) {
>>>> CID 1561133: Integer handling issues (BAD_SHIFT)
>>>> In expression "env->cf[i] << 8 * i", left shifting by more than 31 bits has undefined behavior. The shift amount, "8 * i", is as much as 56.
> 102 note.fpu.fcc |= env->cf[i] << (8 * i);
Coverity is correct that 'bool' can't be shifted by 56.
However there's an existing read_fcc() that gets this correct.
r~
parent reply other threads:[~2024-09-13 20:50 UTC|newest]
Thread overview: expand[flat|nested] mbox.gz Atom feed
[parent not found: <a6e35fdd-d8fb-4368-918f-e5f9cdb90105@twiddle.net>]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=a554dc1c-7c6b-412f-915c-2f3ce3a11cc2@linaro.org \
--to=richard.henderson@linaro.org \
--cc=maobibo@loongson.cn \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).