From: Richard Henderson <richard.henderson@linaro.org>
To: Peter Maydell <peter.maydell@linaro.org>,
qemu-arm@nongnu.org, qemu-devel@nongnu.org
Subject: Re: [PATCH] target/arm: Use correct entrypoint for SVC taken from Hyp to Hyp
Date: Fri, 28 Jan 2022 11:23:28 +1100 [thread overview]
Message-ID: <e49aaa62-5c98-c930-c6d3-eaaf0f7d492e@linaro.org> (raw)
In-Reply-To: <20220117131953.3936137-1-peter.maydell@linaro.org>
On 1/18/22 00:19, Peter Maydell wrote:
> The exception caused by an SVC instruction may be taken to AArch32
> Hyp mode for two reasons:
> * HCR.TGE indicates that exceptions from EL0 should trap to EL2
> * we were already in Hyp mode
>
> The entrypoint in the vector table to be used differs in these two
> cases: for an exception routed to Hyp mode from EL0, we enter at the
> common 0x14 "hyp trap" entrypoint. For SVC from Hyp mode to Hyp
> mode, we enter at the 0x08 (svc/hvc trap) entrypoint.
> In the v8A Arm ARM pseudocode this is done in AArch32.TakeSVCException.
>
> QEMU incorrectly routed both of these exceptions to the 0x14
> entrypoint. Correct the entrypoint for SVC from Hyp to Hyp by making
> use of the existing logic which handles "normal entrypoint for
> Hyp-to-Hyp, otherwise 0x14" for traps like UNDEF and data/prefetch
> aborts (reproduced here since it's outside the visible context
> in the diff for this commit):
>
> if (arm_current_el(env) != 2 && addr < 0x14) {
> addr = 0x14;
> }
>
> Signed-off-by: Peter Maydell<peter.maydell@linaro.org>
> ---
> target/arm/helper.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
r~
prev parent reply other threads:[~2022-01-28 0:24 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-01-17 13:19 [PATCH] target/arm: Use correct entrypoint for SVC taken from Hyp to Hyp Peter Maydell
2022-01-27 16:31 ` Peter Maydell
2022-01-28 0:08 ` Edgar E. Iglesias
2022-01-28 0:23 ` Richard Henderson [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=e49aaa62-5c98-c930-c6d3-eaaf0f7d492e@linaro.org \
--to=richard.henderson@linaro.org \
--cc=peter.maydell@linaro.org \
--cc=qemu-arm@nongnu.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).