From: Richard Henderson <richard.henderson@linaro.org>
To: mkei@sfc.wide.ad.jp, qemu-devel <qemu-devel@nongnu.org>
Cc: qemu-arm <qemu-arm@nongnu.org>, Peter Maydell <peter.maydell@linaro.org>
Subject: Re: [PATCH] target/arm: fix s2mmu input size check
Date: Thu, 5 May 2022 11:13:06 -0500 [thread overview]
Message-ID: <bc338b3d-06dd-6658-5601-0cc30d6689e2@linaro.org> (raw)
In-Reply-To: <20220505031234.20349-1-mkei@sfc.wide.ad.jp>
On 5/4/22 22:12, mkei@sfc.wide.ad.jp wrote:
> From: Keisuke Iida <mkei@sfc.wide.ad.jp>
>
> The maximum IPA size('inputsize') is constrained by the implemented PA size that is
> specified by ID_AA64MMFR0_EL1.PARange. Please reference Arm Architecture Reference
> Manual for A-profile architecture "Supported IPA size" on page D5-4788.
>
> Signed-off-by: Keisuke Iida <mkei@sfc.wide.ad.jp>
> ---
> target/arm/helper.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/target/arm/helper.c b/target/arm/helper.c
> index 5a244c3ed9..868e7a2c0b 100644
> --- a/target/arm/helper.c
> +++ b/target/arm/helper.c
> @@ -11116,7 +11116,7 @@ static bool check_s2_mmu_setup(ARMCPU *cpu, bool is_aa64, int level,
> }
>
> /* Inputsize checks. */
> - if (inputsize > outputsize &&
> + if (inputsize > arm_pamax(cpu) &&
This is incorrect -- arm_pamax has already been taken into account in computing
outputsize. There are many more constraints than just this.
You need to have a look at the computation of ps and tsz in aa64_va_parameters, and then
the computation of outputsize near the beginning of get_phys_addr_lpae, which takes
arm_pamax into account by bounding ps against ID_AA64MMFR0.PARANGE, and pamax_map.
What problem are you encountering?
r~
next prev parent reply other threads:[~2022-05-05 16:27 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-05-05 3:12 [PATCH] target/arm: fix s2mmu input size check mkei
2022-05-05 16:13 ` Richard Henderson [this message]
2022-05-07 14:09 ` Keisuke Iida
-- strict thread matches above, loose matches on Subject: below --
2022-05-05 0:40 mkei
2022-05-05 8:20 ` Peter Maydell
2022-05-05 12:30 ` Keisuke Iida
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=bc338b3d-06dd-6658-5601-0cc30d6689e2@linaro.org \
--to=richard.henderson@linaro.org \
--cc=mkei@sfc.wide.ad.jp \
--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).