[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 28/49] target/arm: Implement pauth_strip
From: |
Peter Maydell |
Subject: |
[Qemu-devel] [PULL 28/49] target/arm: Implement pauth_strip |
Date: |
Fri, 18 Jan 2019 14:57:44 +0000 |
From: Richard Henderson <address@hidden>
Stripping out the authentication data does not require any crypto,
it merely requires the virtual address parameters.
Reviewed-by: Peter Maydell <address@hidden>
Signed-off-by: Richard Henderson <address@hidden>
Message-id: address@hidden
Signed-off-by: Peter Maydell <address@hidden>
---
target/arm/pauth_helper.c | 14 +++++++++++++-
1 file changed, 13 insertions(+), 1 deletion(-)
diff --git a/target/arm/pauth_helper.c b/target/arm/pauth_helper.c
index 902f68a24cc..e02376a2d02 100644
--- a/target/arm/pauth_helper.c
+++ b/target/arm/pauth_helper.c
@@ -38,6 +38,15 @@ static uint64_t pauth_addpac(CPUARMState *env, uint64_t ptr,
uint64_t modifier,
g_assert_not_reached(); /* FIXME */
}
+static uint64_t pauth_original_ptr(uint64_t ptr, ARMVAParameters param)
+{
+ uint64_t extfield = -param.select;
+ int bot_pac_bit = 64 - param.tsz;
+ int top_pac_bit = 64 - 8 * param.tbi;
+
+ return deposit64(ptr, bot_pac_bit, top_pac_bit - bot_pac_bit, extfield);
+}
+
static uint64_t pauth_auth(CPUARMState *env, uint64_t ptr, uint64_t modifier,
ARMPACKey *key, bool data, int keynumber)
{
@@ -46,7 +55,10 @@ static uint64_t pauth_auth(CPUARMState *env, uint64_t ptr,
uint64_t modifier,
static uint64_t pauth_strip(CPUARMState *env, uint64_t ptr, bool data)
{
- g_assert_not_reached(); /* FIXME */
+ ARMMMUIdx mmu_idx = arm_stage1_mmu_idx(env);
+ ARMVAParameters param = aa64_va_parameters(env, ptr, mmu_idx, data);
+
+ return pauth_original_ptr(ptr, param);
}
static void QEMU_NORETURN pauth_trap(CPUARMState *env, int target_el,
--
2.20.1
- [Qemu-devel] [PULL 08/49] target/arm: Introduce raise_exception_ra, (continued)
- [Qemu-devel] [PULL 08/49] target/arm: Introduce raise_exception_ra, Peter Maydell, 2019/01/18
- [Qemu-devel] [PULL 21/49] target/arm: Introduce arm_stage1_mmu_idx, Peter Maydell, 2019/01/18
- [Qemu-devel] [PULL 18/49] target/arm: Decode Load/store register (pac), Peter Maydell, 2019/01/18
- [Qemu-devel] [PULL 15/49] target/arm: Add new_pc argument to helper_exception_return, Peter Maydell, 2019/01/18
- [Qemu-devel] [PULL 11/49] target/arm: Rearrange decode in disas_data_proc_1src, Peter Maydell, 2019/01/18
- [Qemu-devel] [PULL 17/49] target/arm: Decode PAuth within disas_uncond_b_reg, Peter Maydell, 2019/01/18
- [Qemu-devel] [PULL 20/49] target/arm: Introduce arm_mmu_idx, Peter Maydell, 2019/01/18
- [Qemu-devel] [PULL 16/49] target/arm: Rearrange decode in disas_uncond_b_reg, Peter Maydell, 2019/01/18
- [Qemu-devel] [PULL 22/49] target/arm: Create ARMVAParameters and helpers, Peter Maydell, 2019/01/18
- [Qemu-devel] [PULL 33/49] target/arm: Enable PAuth for -cpu max, Peter Maydell, 2019/01/18
- [Qemu-devel] [PULL 28/49] target/arm: Implement pauth_strip,
Peter Maydell <=
- [Qemu-devel] [PULL 34/49] target/arm: Enable PAuth for user-only, Peter Maydell, 2019/01/18
- [Qemu-devel] [PULL 13/49] target/arm: Decode PAuth within disas_data_proc_2src, Peter Maydell, 2019/01/18
- [Qemu-devel] [PULL 24/49] target/arm: Export aa64_va_parameters to internals.h, Peter Maydell, 2019/01/18
- [Qemu-devel] [PULL 25/49] target/arm: Add aa64_va_parameters_both, Peter Maydell, 2019/01/18
- [Qemu-devel] [PULL 10/49] target/arm: Decode PAuth within system hint space, Peter Maydell, 2019/01/18
- [Qemu-devel] [PULL 12/49] target/arm: Decode PAuth within disas_data_proc_1src, Peter Maydell, 2019/01/18
- [Qemu-devel] [PULL 29/49] target/arm: Implement pauth_auth, Peter Maydell, 2019/01/18
- [Qemu-devel] [PULL 23/49] target/arm: Merge TBFLAG_AA_TB{0, 1} to TBII, Peter Maydell, 2019/01/18
- [Qemu-devel] [PULL 27/49] target/arm: Reuse aa64_va_parameters for setting tbflags, Peter Maydell, 2019/01/18
- [Qemu-devel] [PULL 30/49] target/arm: Implement pauth_addpac, Peter Maydell, 2019/01/18