From: Richard Henderson <richard.henderson@linaro.org>
To: "Peter Maydell" <peter.maydell@linaro.org>,
"Alex Bennée" <alex.bennee@linaro.org>
Cc: Helge Deller <deller@kernel.org>,
qemu-devel@nongnu.org, linux-parisc@vger.kernel.org
Subject: Re: {PATCH] accel/tcg: Fix CPU specific unaligned behaviour
Date: Thu, 3 Oct 2024 16:08:48 -0700 [thread overview]
Message-ID: <9635d3ed-b60f-4406-aa57-3d8764b4f5bb@linaro.org> (raw)
In-Reply-To: <CAFEAcA81YtAGO0iFZRWXGjJb91DhWEDTGr+cjWbNWEW4yJDksQ@mail.gmail.com>
On 10/2/24 08:47, Peter Maydell wrote:
> There's also something curious going on here -- this patch
> says "we check alignment before permissions, and that's wrong
> on PARISC". But there's a comment in target/arm/ptw.c that
> says "we check permissions before alignment, and that's
> wrong on Arm":
>
> * Enable alignment checks on Device memory.
> *
> * Per R_XCHFJ, this check is mis-ordered. The correct ordering
> * for alignment, permission, and stage 2 faults should be:
> * - Alignment fault caused by the memory type
> * - Permission fault
> * - A stage 2 fault on the memory access
> * but due to the way the TCG softmmu TLB operates, we will have
> * implicitly done the permission check and the stage2 lookup in
> * finding the TLB entry, so the alignment check cannot be done sooner.
>
> So do we check alignment first, or permissions first, or does
> the order vary depending on what we're doing?
There are two different alignment fault checks. The one for 'alignment fault caused by
memory type' is later, after we verify that the TLB entry is for the correct page, which
implicitly tests r/w permissions.
r~
next prev parent reply other threads:[~2024-10-03 23:09 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-10-02 2:37 {PATCH] accel/tcg: Fix CPU specific unaligned behaviour Helge Deller
2024-10-02 15:35 ` Alex Bennée
2024-10-02 15:47 ` Peter Maydell
2024-10-02 17:25 ` Alex Bennée
2024-10-02 19:38 ` Helge Deller
2024-10-03 23:08 ` Richard Henderson [this message]
2024-10-04 14:24 ` Richard Henderson
2024-10-05 16:55 ` Richard Henderson
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=9635d3ed-b60f-4406-aa57-3d8764b4f5bb@linaro.org \
--to=richard.henderson@linaro.org \
--cc=alex.bennee@linaro.org \
--cc=deller@kernel.org \
--cc=linux-parisc@vger.kernel.org \
--cc=peter.maydell@linaro.org \
--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).