aboutsummaryrefslogtreecommitdiff
path: root/linux-user
diff options
context:
space:
mode:
authorRichard Henderson <richard.henderson@linaro.org>2019-03-14 17:28:32 -0700
committerRichard Henderson <richard.henderson@linaro.org>2019-05-22 12:38:54 -0400
commit108b3ba891408c4dce93df78261ec4aca38c0e2e (patch)
tree6d2b4b3ea1bfd13acceb2853088ba20febea94f5 /linux-user
parente8196d2111d2eb060a42feadef119de3aadae4f6 (diff)
downloadqemu-108b3ba891408c4dce93df78261ec4aca38c0e2e.zip
qemu-108b3ba891408c4dce93df78261ec4aca38c0e2e.tar.gz
qemu-108b3ba891408c4dce93df78261ec4aca38c0e2e.tar.bz2
target/arm: Put all PAC keys into a structure
This allows us to use a single syscall to initialize them all. Reviewed-by: Laurent Vivier <lvivier@redhat.com> Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Diffstat (limited to 'linux-user')
-rw-r--r--linux-user/aarch64/cpu_loop.c6
-rw-r--r--linux-user/syscall.c10
2 files changed, 6 insertions, 10 deletions
diff --git a/linux-user/aarch64/cpu_loop.c b/linux-user/aarch64/cpu_loop.c
index cedad39..2f2f63e 100644
--- a/linux-user/aarch64/cpu_loop.c
+++ b/linux-user/aarch64/cpu_loop.c
@@ -175,11 +175,7 @@ void target_cpu_copy_regs(CPUArchState *env, struct target_pt_regs *regs)
#endif
if (cpu_isar_feature(aa64_pauth, cpu)) {
- qemu_guest_getrandom_nofail(&env->apia_key, sizeof(ARMPACKey));
- qemu_guest_getrandom_nofail(&env->apib_key, sizeof(ARMPACKey));
- qemu_guest_getrandom_nofail(&env->apda_key, sizeof(ARMPACKey));
- qemu_guest_getrandom_nofail(&env->apdb_key, sizeof(ARMPACKey));
- qemu_guest_getrandom_nofail(&env->apga_key, sizeof(ARMPACKey));
+ qemu_guest_getrandom_nofail(&env->keys, sizeof(env->keys));
}
ts->stack_base = info->start_stack;
diff --git a/linux-user/syscall.c b/linux-user/syscall.c
index 72e43b5..3de792a 100644
--- a/linux-user/syscall.c
+++ b/linux-user/syscall.c
@@ -9775,23 +9775,23 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1,
return -TARGET_EINVAL;
}
if (arg2 & TARGET_PR_PAC_APIAKEY) {
- ret |= qemu_guest_getrandom(&env->apia_key,
+ ret |= qemu_guest_getrandom(&env->keys.apia,
sizeof(ARMPACKey), &err);
}
if (arg2 & TARGET_PR_PAC_APIBKEY) {
- ret |= qemu_guest_getrandom(&env->apib_key,
+ ret |= qemu_guest_getrandom(&env->keys.apib,
sizeof(ARMPACKey), &err);
}
if (arg2 & TARGET_PR_PAC_APDAKEY) {
- ret |= qemu_guest_getrandom(&env->apda_key,
+ ret |= qemu_guest_getrandom(&env->keys.apda,
sizeof(ARMPACKey), &err);
}
if (arg2 & TARGET_PR_PAC_APDBKEY) {
- ret |= qemu_guest_getrandom(&env->apdb_key,
+ ret |= qemu_guest_getrandom(&env->keys.apdb,
sizeof(ARMPACKey), &err);
}
if (arg2 & TARGET_PR_PAC_APGAKEY) {
- ret |= qemu_guest_getrandom(&env->apga_key,
+ ret |= qemu_guest_getrandom(&env->keys.apga,
sizeof(ARMPACKey), &err);
}
if (ret != 0) {