From: "Alex Bennée" <alex.bennee@linaro.org>
To: Torbjorn SVENSSON <torbjorn.svensson@foss.st.com>
Cc: <qemu-devel@nongnu.org>, <qemu-arm@nongnu.org>,
Peter Maydell <peter.maydell@linaro.org>,
Richard Henderson <richard.henderson@linaro.org>
Subject: Re: [PING] [PATCH 0/3] target/arm: add support for Cortex-M pointer authentication code
Date: Wed, 27 May 2026 13:58:39 +0100 [thread overview]
Message-ID: <87mrxlxb40.fsf@draig.linaro.org> (raw)
In-Reply-To: <b50cb0e2-5198-460c-abee-ba86c7002a96@foss.st.com> (Torbjorn SVENSSON's message of "Wed, 27 May 2026 09:36:03 +0200")
Torbjorn SVENSSON <torbjorn.svensson@foss.st.com> writes:
> Gentle ping! :)
>
> There is apparently also a ticket for this work (that I did not see before I sent the patches): https://linaro.atlassian.net/browse/QEMU-444
>
The Linaro tickets are public (because we work directly upstream)
although the existence of a ticket should not imply that we plan to work
on it. We create tickets for most of the Arm CPU features so we can
track dependencies, what is left to do and when others have patches that
need review.
Our actual planned roadmap can be seen here: https://linaro.atlassian.net/wiki/spaces/QEMU/overview
>
> On 2026-05-18 18:13, Torbjörn SVENSSON wrote:
>> Testing an arm-none-eabi GCC toolchain using QEMU gives unpredictable
>> test results for some test cases. In the GCC testsuite function
>> check_effective_target_arm_pacbti_hw, the testsuite tries to identify
>> if the target supports PACBTI instructions. The test consists of:
>> __attribute__ ((naked)) int
>> main (void)
>> {
>> asm ("pac r12, lr, sp");
>> asm ("mov r0, #0");
>> asm ("autg r12, lr, sp");
>> asm ("bx lr");
>> }
>> Running the above code in QEMU will cause LR to get corrupted.
>> The reson for the corruption is that AUTG overlaps with the SMMLA
>> instruction, and SMMLA will write the result to Rn, that for
>> `AUTG R12, LR, SP` happens to match `LR`.
>
> The above statement is not entirely true.
> SMMLA is writing the result to Rd and that happens to match PC, not Rn and LR.
> Sorry for the confusion this might have caused.
>
> Kind regards,
> Torbjörn
>
>> The solution to the above problem is to define the following new
>> Cortex-M instructions in QEMU:
>> * AUT
>> * AUTG
>> * BXAUT
>> * PAC
>> * PACBTI
>> * PACG
>> This patch series only implements the pointer authentication code
>> part
>> of PACBTI. The branch target identification part is not implemented.
>> Signed-off-by: Torbjörn SVENSSON <torbjorn.svensson@foss.st.com>
>> ---
>> Torbjörn SVENSSON (3):
>> target/arm/tcg: define cortex-m85 cpu
>> target/arm/tcg: add PAC related instructions
>> target/arm: implement v8.1-m PAC support
>> target/arm/cpu-features.h | 6 ++
>> target/arm/internals.h | 2 +
>> target/arm/tcg/cpu-v7m.c | 40 +++++++++++++
>> target/arm/tcg/m_helper.c | 17 ++++++
>> target/arm/tcg/t32.decode | 21 ++++++-
>> target/arm/tcg/translate.c | 138 +++++++++++++++++++++++++++++++++++++++++++++
>> 6 files changed, 221 insertions(+), 3 deletions(-)
>> ---
>> base-commit: ac6721b88df944ade0048822b2b74210f543d656
>> change-id: 20260518-pr-pacbti-366d7acbe1be
>> Best regards,
--
Alex Bennée
Virtualisation Tech Lead @ Linaro
next prev parent reply other threads:[~2026-05-27 12:58 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-05-18 16:13 [PATCH 0/3] target/arm: add support for Cortex-M pointer authentication code Torbjörn SVENSSON
2026-05-18 16:13 ` [PATCH 1/3] target/arm/tcg: define cortex-m85 cpu Torbjörn SVENSSON
2026-05-27 13:21 ` Alex Bennée
2026-05-28 10:22 ` Peter Maydell
2026-05-18 16:14 ` [PATCH 2/3] target/arm/tcg: add PAC related instructions Torbjörn SVENSSON
2026-05-27 13:33 ` Alex Bennée
2026-05-28 10:40 ` Peter Maydell
2026-05-18 16:14 ` [PATCH 3/3] target/arm: implement v8.1-m PAC support Torbjörn SVENSSON
2026-05-27 13:55 ` Alex Bennée
2026-05-27 16:38 ` Peter Maydell
2026-05-28 10:43 ` Peter Maydell
2026-05-27 7:36 ` [PING] [PATCH 0/3] target/arm: add support for Cortex-M pointer authentication code Torbjorn SVENSSON
2026-05-27 12:58 ` Alex Bennée [this message]
2026-05-28 10:50 ` Peter Maydell
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=87mrxlxb40.fsf@draig.linaro.org \
--to=alex.bennee@linaro.org \
--cc=peter.maydell@linaro.org \
--cc=qemu-arm@nongnu.org \
--cc=qemu-devel@nongnu.org \
--cc=richard.henderson@linaro.org \
--cc=torbjorn.svensson@foss.st.com \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.