qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH 0/6] target/arm: Complete ARMv8.3-PAuth linux-user
@ 2019-01-25 22:57 Richard Henderson
  2019-01-25 22:57 ` [Qemu-devel] [PATCH 1/6] target/arm: Always enable pac keys for user-only Richard Henderson
                   ` (7 more replies)
  0 siblings, 8 replies; 17+ messages in thread
From: Richard Henderson @ 2019-01-25 22:57 UTC (permalink / raw)
  To: qemu-devel; +Cc: peter.maydell

(1) Fix a bug I introduced at the last moment in the last
    patch set -- enable pac keys during reset, not before.
(2) Add the HWCAP bits.
(3) Add the new prctl
(4) Add a smoke test so that (1) doesn't happen again.


r~


Richard Henderson (6):
  target/arm: Always enable pac keys for user-only
  aarch64-linux-user: Update HWCAP bits from linux 5.0-rc1
  aarch64-linux-user: Enable HWCAP bits for PAuth
  linux-user: Initialize aarch64 pac keys
  linux-user: Implement PR_PAC_RESET_KEYS
  tests/tcg/aarch64: Add pauth smoke tests

 linux-user/aarch64/target_syscall.h |  9 +++++
 linux-user/aarch64/cpu_loop.c       | 31 ++++++++++++++-
 linux-user/elfload.c                | 10 +++++
 linux-user/syscall.c                | 33 ++++++++++++++++
 target/arm/cpu.c                    |  3 ++
 target/arm/cpu64.c                  | 60 -----------------------------
 tests/tcg/aarch64/pauth-1.c         | 23 +++++++++++
 tests/tcg/aarch64/Makefile.target   |  7 +++-
 8 files changed, 113 insertions(+), 63 deletions(-)
 create mode 100644 tests/tcg/aarch64/pauth-1.c

-- 
2.17.2

^ permalink raw reply	[flat|nested] 17+ messages in thread
* [Qemu-devel] [PATCH] target/arm: Fix validation of 32-bit address spaces for aa32
@ 2019-01-25 18:49 Richard Henderson
  2019-01-28 11:53 ` Peter Maydell
  0 siblings, 1 reply; 17+ messages in thread
From: Richard Henderson @ 2019-01-25 18:49 UTC (permalink / raw)
  To: qemu-devel; +Cc: peter.maydell

When tsz == 0, aarch32 selects the address space via exclusion,
and there are no "top_bits" remaining that require validation.

Fixes: ba97be9f4a4
Reported-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
---
 target/arm/helper.c | 19 +++++++++++++------
 1 file changed, 13 insertions(+), 6 deletions(-)

diff --git a/target/arm/helper.c b/target/arm/helper.c
index 92666e5208..e24689f767 100644
--- a/target/arm/helper.c
+++ b/target/arm/helper.c
@@ -10447,7 +10447,7 @@ static bool get_phys_addr_lpae(CPUARMState *env, target_ulong address,
     uint64_t ttbr;
     hwaddr descaddr, indexmask, indexmask_grainsize;
     uint32_t tableattrs;
-    target_ulong page_size, top_bits;
+    target_ulong page_size;
     uint32_t attrs;
     int32_t stride;
     int addrsize, inputsize;
@@ -10487,12 +10487,19 @@ static bool get_phys_addr_lpae(CPUARMState *env, target_ulong address,
      * We determined the region when collecting the parameters, but we
      * have not yet validated that the address is valid for the region.
      * Extract the top bits and verify that they all match select.
+     *
+     * For aa32, if inputsize == addrsize, then we have selected the
+     * region by exclusion in aa32_va_parameters and there is no more
+     * validation to do here.
      */
-    top_bits = sextract64(address, inputsize, addrsize - inputsize);
-    if (-top_bits != param.select || (param.select && !ttbr1_valid)) {
-        /* In the gap between the two regions, this is a Translation fault */
-        fault_type = ARMFault_Translation;
-        goto do_fault;
+    if (inputsize < addrsize) {
+        target_ulong top_bits = sextract64(address, inputsize,
+                                           addrsize - inputsize);
+        if (-top_bits != param.select || (param.select && !ttbr1_valid)) {
+            /* The gap between the two regions is a Translation fault */
+            fault_type = ARMFault_Translation;
+            goto do_fault;
+        }
     }
 
     if (param.using64k) {
-- 
2.17.1

^ permalink raw reply related	[flat|nested] 17+ messages in thread

end of thread, other threads:[~2019-02-01 19:55 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-01-25 22:57 [Qemu-devel] [PATCH 0/6] target/arm: Complete ARMv8.3-PAuth linux-user Richard Henderson
2019-01-25 22:57 ` [Qemu-devel] [PATCH 1/6] target/arm: Always enable pac keys for user-only Richard Henderson
2019-01-25 22:57 ` [Qemu-devel] [PATCH] target/arm: Fix validation of 32-bit address spaces for aa32 Richard Henderson
2019-01-25 22:57 ` [Qemu-devel] [PATCH 2/6] aarch64-linux-user: Update HWCAP bits from linux 5.0-rc1 Richard Henderson
2019-01-30 13:53   ` Laurent Vivier
2019-01-25 22:57 ` [Qemu-devel] [PATCH 3/6] aarch64-linux-user: Enable HWCAP bits for PAuth Richard Henderson
2019-01-25 22:57 ` [Qemu-devel] [PATCH 4/6] linux-user: Initialize aarch64 pac keys Richard Henderson
2019-02-01 15:11   ` Peter Maydell
2019-02-01 18:13     ` Richard Henderson
2019-01-25 22:57 ` [Qemu-devel] [PATCH 5/6] linux-user: Implement PR_PAC_RESET_KEYS Richard Henderson
2019-02-01 15:15   ` Peter Maydell
2019-01-25 22:57 ` [Qemu-devel] [PATCH 6/6] tests/tcg/aarch64: Add pauth smoke tests Richard Henderson
2019-01-28 11:06   ` Alex Bennée
2019-02-01 19:54     ` Richard Henderson
2019-02-01 15:18 ` [Qemu-devel] [PATCH 0/6] target/arm: Complete ARMv8.3-PAuth linux-user Peter Maydell
  -- strict thread matches above, loose matches on Subject: below --
2019-01-25 18:49 [Qemu-devel] [PATCH] target/arm: Fix validation of 32-bit address spaces for aa32 Richard Henderson
2019-01-28 11:53 ` Peter Maydell

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).