From: Peter Maydell <peter.maydell@linaro.org>
To: qemu-arm@nongnu.org, qemu-devel@nongnu.org
Cc: qemu-stable@nongnu.org
Subject: Re: [PATCH 0/2] target/arm: Load correct half of 64-bit fields
Date: Tue, 2 May 2023 11:33:06 +0100 [thread overview]
Message-ID: <CAFEAcA8+uw3-Buu2MmKDPj3_za7JCOnwA5gnaiFhXrsfTHaryw@mail.gmail.com> (raw)
In-Reply-To: <20230424153909.1419369-1-peter.maydell@linaro.org>
On Mon, 24 Apr 2023 at 16:39, Peter Maydell <peter.maydell@linaro.org> wrote:
>
> This patchset fixes a bug where on a big-endian 64-bit host the
> guest would crash immediately when it did an ERET. This happens
> because when we load the new PC value from CPUARMState::esr_el[2]
> we do a 32-bit load even though the struct field is 64 bits.
> So on 64-bit BE we use the wrong half of the register.
>
> Patch 1 defines a new macro to load the low 32 bits from a
> 64-bit field, and uses it in the two places where we got this
> wrong. Patch 2 adds some compile-time assertions to the
> existing load_cpu_field() and store_cpu_field() macros that
> catch inadvertent uses on struct fields of the wrong size.
>
> This fix is necessary to be able to run the avocado tests for
> the orangepi on a 64-bit BE system.
Applied to target-arm.next, adjusted to use sizeof_field().
thanks
-- PMM
prev parent reply other threads:[~2023-05-02 10:33 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-04-24 15:39 [PATCH 0/2] target/arm: Load correct half of 64-bit fields Peter Maydell
2023-04-24 15:39 ` [PATCH 1/2] target/arm: Define and use new load_cpu_field_low32() Peter Maydell
2023-04-24 16:14 ` Richard Henderson
2023-04-24 15:39 ` [PATCH 2/2] target/arm: Add compile time asserts to load/store_cpu_field macros Peter Maydell
2023-04-24 16:14 ` Richard Henderson
2023-05-02 10:33 ` Peter Maydell [this message]
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=CAFEAcA8+uw3-Buu2MmKDPj3_za7JCOnwA5gnaiFhXrsfTHaryw@mail.gmail.com \
--to=peter.maydell@linaro.org \
--cc=qemu-arm@nongnu.org \
--cc=qemu-devel@nongnu.org \
--cc=qemu-stable@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).