|
| From: | Richard Henderson |
| Subject: | Re: [PATCH] target/arm: Limit LPA2 effective output address when TCR.DS == 0 |
| Date: | Wed, 16 Nov 2022 19:14:10 -0800 |
| User-agent: | Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.4.2 |
On 11/16/22 09:03, Ard Biesheuvel wrote:
diff --git a/target/arm/ptw.c b/target/arm/ptw.c
index 3745ac9723474332..9a6277d862fac229 100644
--- a/target/arm/ptw.c
+++ b/target/arm/ptw.c
@@ -1222,6 +1222,14 @@ static bool get_phys_addr_lpae(CPUARMState *env,
S1Translate *ptw,
ps = MIN(ps, param.ps);
assert(ps < ARRAY_SIZE(pamax_map));
outputsize = pamax_map[ps];
+
+ /*
+ * With LPA2, the effective output address (OA) size is at most 48 bits
+ * unless TCR.DS == 1
+ */
+ if (!param.ds && param.gran != Gran64K) {
+ outputsize = MIN(outputsize, 48);
+ }
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>I thought about moving this back into aa64_va_parameters, similar to how we bound tsz, but since this is the only use of param.ps, this placement is as good as any.
r~
| [Prev in Thread] | Current Thread | [Next in Thread] |