Message ID | 20181214052410.11863-20-richard.henderson@linaro.org |
---|---|
State | Superseded |
Headers | show |
Series | target/arm: Implement ARMv8.3-PAuth | expand |
On Fri, 14 Dec 2018 at 05:24, Richard Henderson <richard.henderson@linaro.org> wrote: > > We need to reuse this from helper-a64.c. Provide a stub > definition for CONFIG_USER_ONLY. This matches the stub > definitions that we removed for arm_regime_tbi{0,1} before. > > Signed-off-by: Richard Henderson <richard.henderson@linaro.org> > --- > target/arm/internals.h | 17 +++++++++++++++++ > target/arm/helper.c | 4 ++-- > 2 files changed, 19 insertions(+), 2 deletions(-) > > diff --git a/target/arm/internals.h b/target/arm/internals.h > index 9ef9d01ee2..4fbef58126 100644 > --- a/target/arm/internals.h > +++ b/target/arm/internals.h > @@ -951,4 +951,21 @@ typedef struct ARMVAParameters { > bool using64k : 1; > } ARMVAParameters; > > +#ifdef CONFIG_USER_ONLY > +static inline ARMVAParameters aa64_va_parameters(CPUARMState *env, > + uint64_t va, > + ARMMMUIdx mmu_idx, bool data) > +{ > + return (ARMVAParameters) { > + /* 48-bit address space */ > + .tsz = 16, I assume 48 bits is what the kernel sets up for userspace ? Reviewed-by: Peter Maydell <peter.maydell@linaro.org> thanks -- PMM
On 1/7/19 9:45 PM, Peter Maydell wrote:
> I assume 48 bits is what the kernel sets up for userspace ?
Yep. There's been some discussion about what to do with 52-bit addressing, but
it hasn't landed upstream yet.
r~
diff --git a/target/arm/internals.h b/target/arm/internals.h index 9ef9d01ee2..4fbef58126 100644 --- a/target/arm/internals.h +++ b/target/arm/internals.h @@ -951,4 +951,21 @@ typedef struct ARMVAParameters { bool using64k : 1; } ARMVAParameters; +#ifdef CONFIG_USER_ONLY +static inline ARMVAParameters aa64_va_parameters(CPUARMState *env, + uint64_t va, + ARMMMUIdx mmu_idx, bool data) +{ + return (ARMVAParameters) { + /* 48-bit address space */ + .tsz = 16, + /* We can't handle tagged addresses properly in user-only mode */ + .tbi = false, + }; +} +#else +ARMVAParameters aa64_va_parameters(CPUARMState *env, uint64_t va, + ARMMMUIdx mmu_idx, bool data); +#endif + #endif diff --git a/target/arm/helper.c b/target/arm/helper.c index bd1b683766..b9ffc07fbc 100644 --- a/target/arm/helper.c +++ b/target/arm/helper.c @@ -9702,8 +9702,8 @@ static uint8_t convert_stage2_attrs(CPUARMState *env, uint8_t s2attrs) return (hiattr << 6) | (hihint << 4) | (loattr << 2) | lohint; } -static ARMVAParameters aa64_va_parameters(CPUARMState *env, uint64_t va, - ARMMMUIdx mmu_idx, bool data) +ARMVAParameters aa64_va_parameters(CPUARMState *env, uint64_t va, + ARMMMUIdx mmu_idx, bool data) { uint64_t tcr = regime_tcr(env, mmu_idx)->raw_tcr; uint32_t el = regime_el(env, mmu_idx);
We need to reuse this from helper-a64.c. Provide a stub definition for CONFIG_USER_ONLY. This matches the stub definitions that we removed for arm_regime_tbi{0,1} before. Signed-off-by: Richard Henderson <richard.henderson@linaro.org> --- target/arm/internals.h | 17 +++++++++++++++++ target/arm/helper.c | 4 ++-- 2 files changed, 19 insertions(+), 2 deletions(-) -- 2.17.2