mbox series

[v7,00/31] target-arm: Implement ARMv8.5-MemTag, user mode

Message ID 20210212184902.1251044-1-richard.henderson@linaro.org (mailing list archive)
Headers show
Series target-arm: Implement ARMv8.5-MemTag, user mode | expand

Message

Richard Henderson Feb. 12, 2021, 6:48 p.m. UTC
Changes for v7:
  * Fix bsd-user vs g2h_untagged.


r~


Richard Henderson (31):
  tcg: Introduce target-specific page data for user-only
  linux-user: Introduce PAGE_ANON
  exec: Use uintptr_t for guest_base
  exec: Use uintptr_t in cpu_ldst.h
  exec: Improve types for guest_addr_valid
  linux-user: Check for overflow in access_ok
  linux-user: Tidy VERIFY_READ/VERIFY_WRITE
  bsd-user: Tidy VERIFY_READ/VERIFY_WRITE
  linux-user: Do not use guest_addr_valid for h2g_valid
  linux-user: Fix guest_addr_valid vs reserved_va
  exec: Introduce cpu_untagged_addr
  exec: Use cpu_untagged_addr in g2h; split out g2h_untagged
  linux-user: Explicitly untag memory management syscalls
  linux-user: Use guest_range_valid in access_ok
  exec: Rename guest_{addr,range}_valid to *_untagged
  linux-user: Use cpu_untagged_addr in access_ok; split out *_untagged
  linux-user: Move lock_user et al out of line
  linux-user: Fix types in uaccess.c
  linux-user: Handle tags in lock_user/unlock_user
  linux-user/aarch64: Implement PR_TAGGED_ADDR_ENABLE
  target/arm: Improve gen_top_byte_ignore
  target/arm: Use the proper TBI settings for linux-user
  linux-user/aarch64: Implement PR_MTE_TCF and PR_MTE_TAG
  linux-user/aarch64: Implement PROT_MTE
  target/arm: Split out syndrome.h from internals.h
  linux-user/aarch64: Pass syndrome to EXC_*_ABORT
  linux-user/aarch64: Signal SEGV_MTESERR for sync tag check fault
  linux-user/aarch64: Signal SEGV_MTEAERR for async tag check error
  target/arm: Add allocation tag storage for user mode
  target/arm: Enable MTE for user-only
  tests/tcg/aarch64: Add mte smoke tests

 bsd-user/qemu.h                     |  17 +-
 include/exec/cpu-all.h              |  47 ++++-
 include/exec/cpu_ldst.h             |  39 ++--
 include/exec/exec-all.h             |   2 +-
 linux-user/aarch64/target_signal.h  |   3 +
 linux-user/aarch64/target_syscall.h |  13 ++
 linux-user/qemu.h                   |  76 +++-----
 linux-user/syscall_defs.h           |   1 +
 target/arm/cpu-param.h              |   3 +
 target/arm/cpu.h                    |  32 ++++
 target/arm/internals.h              | 249 +------------------------
 target/arm/syndrome.h               | 273 ++++++++++++++++++++++++++++
 tests/tcg/aarch64/mte.h             |  60 ++++++
 accel/tcg/translate-all.c           |  32 +++-
 accel/tcg/user-exec.c               |  51 +++---
 bsd-user/elfload.c                  |   2 +-
 bsd-user/main.c                     |   8 +-
 bsd-user/mmap.c                     |  23 +--
 linux-user/aarch64/cpu_loop.c       |  38 +++-
 linux-user/elfload.c                |  18 +-
 linux-user/flatload.c               |   2 +-
 linux-user/hppa/cpu_loop.c          |  39 ++--
 linux-user/i386/cpu_loop.c          |   6 +-
 linux-user/i386/signal.c            |   5 +-
 linux-user/main.c                   |   4 +-
 linux-user/mmap.c                   |  86 +++++----
 linux-user/ppc/signal.c             |   4 +-
 linux-user/syscall.c                | 165 +++++++++++++----
 linux-user/uaccess.c                |  82 +++++++--
 target/arm/cpu.c                    |  25 ++-
 target/arm/helper-a64.c             |   4 +-
 target/arm/mte_helper.c             |  39 +++-
 target/arm/tlb_helper.c             |  15 +-
 target/arm/translate-a64.c          |  25 +--
 target/hppa/op_helper.c             |   2 +-
 target/i386/tcg/mem_helper.c        |   2 +-
 target/s390x/mem_helper.c           |   4 +-
 tests/tcg/aarch64/mte-1.c           |  28 +++
 tests/tcg/aarch64/mte-2.c           |  45 +++++
 tests/tcg/aarch64/mte-3.c           |  51 ++++++
 tests/tcg/aarch64/mte-4.c           |  45 +++++
 tests/tcg/aarch64/pauth-2.c         |   1 -
 tests/tcg/aarch64/Makefile.target   |   6 +
 tests/tcg/configure.sh              |   4 +
 44 files changed, 1141 insertions(+), 535 deletions(-)
 create mode 100644 target/arm/syndrome.h
 create mode 100644 tests/tcg/aarch64/mte.h
 create mode 100644 tests/tcg/aarch64/mte-1.c
 create mode 100644 tests/tcg/aarch64/mte-2.c
 create mode 100644 tests/tcg/aarch64/mte-3.c
 create mode 100644 tests/tcg/aarch64/mte-4.c

Comments

no-reply@patchew.org Feb. 12, 2021, 7:39 p.m. UTC | #1
Patchew URL: https://patchew.org/QEMU/20210212184902.1251044-1-richard.henderson@linaro.org/



Hi,

This series seems to have some coding style problems. See output below for
more information:

Type: series
Message-id: 20210212184902.1251044-1-richard.henderson@linaro.org
Subject: [PATCH v7 00/31] target-arm: Implement ARMv8.5-MemTag, user mode

=== TEST SCRIPT BEGIN ===
#!/bin/bash
git rev-parse base > /dev/null || exit 0
git config --local diff.renamelimit 0
git config --local diff.renames True
git config --local diff.algorithm histogram
./scripts/checkpatch.pl --mailback base..
=== TEST SCRIPT END ===

Updating 3c8cf5a9c21ff8782164d1def7f44bd888713384
From https://github.com/patchew-project/qemu
 - [tag update]      patchew/20210205170019.25319-1-peter.maydell@linaro.org -> patchew/20210205170019.25319-1-peter.maydell@linaro.org
 - [tag update]      patchew/20210209193018.31339-1-mark.cave-ayland@ilande.co.uk -> patchew/20210209193018.31339-1-mark.cave-ayland@ilande.co.uk
 * [new tag]         patchew/20210212184902.1251044-1-richard.henderson@linaro.org -> patchew/20210212184902.1251044-1-richard.henderson@linaro.org
 - [tag update]      patchew/cover.1613150869.git.pkrempa@redhat.com -> patchew/cover.1613150869.git.pkrempa@redhat.com
Switched to a new branch 'test'
4cfeede tests/tcg/aarch64: Add mte smoke tests
0903d59 target/arm: Enable MTE for user-only
9df3d28 target/arm: Add allocation tag storage for user mode
3d09f6c linux-user/aarch64: Signal SEGV_MTEAERR for async tag check error
879da12 linux-user/aarch64: Signal SEGV_MTESERR for sync tag check fault
2dd5738 linux-user/aarch64: Pass syndrome to EXC_*_ABORT
b40490e target/arm: Split out syndrome.h from internals.h
63aaeca linux-user/aarch64: Implement PROT_MTE
900b086 linux-user/aarch64: Implement PR_MTE_TCF and PR_MTE_TAG
cb78c3c target/arm: Use the proper TBI settings for linux-user
78a9dec target/arm: Improve gen_top_byte_ignore
4a63561 linux-user/aarch64: Implement PR_TAGGED_ADDR_ENABLE
c66012b linux-user: Handle tags in lock_user/unlock_user
580506f linux-user: Fix types in uaccess.c
2195f03 linux-user: Move lock_user et al out of line
8397f7c linux-user: Use cpu_untagged_addr in access_ok; split out *_untagged
30d0a45 exec: Rename guest_{addr,range}_valid to *_untagged
a05e311 linux-user: Use guest_range_valid in access_ok
bdb38c8 linux-user: Explicitly untag memory management syscalls
42db09c exec: Use cpu_untagged_addr in g2h; split out g2h_untagged
0bd08b6 exec: Introduce cpu_untagged_addr
0800426 linux-user: Fix guest_addr_valid vs reserved_va
1fa4ffc linux-user: Do not use guest_addr_valid for h2g_valid
eb134c4 bsd-user: Tidy VERIFY_READ/VERIFY_WRITE
d58973b linux-user: Tidy VERIFY_READ/VERIFY_WRITE
0b39a7e linux-user: Check for overflow in access_ok
1a8ffb5 exec: Improve types for guest_addr_valid
4e09125 exec: Use uintptr_t in cpu_ldst.h
8ff95a1 exec: Use uintptr_t for guest_base
61d816a linux-user: Introduce PAGE_ANON
e4aaaca tcg: Introduce target-specific page data for user-only

=== OUTPUT BEGIN ===
1/31 Checking commit e4aaaca9e919 (tcg: Introduce target-specific page data for user-only)
2/31 Checking commit 61d816a5eced (linux-user: Introduce PAGE_ANON)
3/31 Checking commit 8ff95a1e9714 (exec: Use uintptr_t for guest_base)
4/31 Checking commit 4e0912550e2c (exec: Use uintptr_t in cpu_ldst.h)
5/31 Checking commit 1a8ffb5feb79 (exec: Improve types for guest_addr_valid)
6/31 Checking commit 0b39a7ecec65 (linux-user: Check for overflow in access_ok)
7/31 Checking commit d58973b39d42 (linux-user: Tidy VERIFY_READ/VERIFY_WRITE)
8/31 Checking commit eb134c450d25 (bsd-user: Tidy VERIFY_READ/VERIFY_WRITE)
9/31 Checking commit 1fa4ffce22f6 (linux-user: Do not use guest_addr_valid for h2g_valid)
10/31 Checking commit 0800426455c1 (linux-user: Fix guest_addr_valid vs reserved_va)
11/31 Checking commit 0bd08b6bce82 (exec: Introduce cpu_untagged_addr)
12/31 Checking commit 42db09c16bdd (exec: Use cpu_untagged_addr in g2h; split out g2h_untagged)
ERROR: braces {} are necessary for all arms of this statement
#446: FILE: bsd-user/qemu.h:379:
+    if (host_ptr == g2h_untagged(guest_addr))
[...]

ERROR: braces {} are necessary for all arms of this statement
#703: FILE: linux-user/mmap.c:222:
+        if (pread(fd, g2h_untagged(start), end - start, offset) == -1)
[...]

ERROR: braces {} are necessary for all arms of this statement
#865: FILE: linux-user/qemu.h:669:
+    if (host_ptr == g2h_untagged(guest_addr))
[...]

total: 3 errors, 0 warnings, 946 lines checked

Patch 12/31 has style problems, please review.  If any of these errors
are false positives report them to the maintainer, see
CHECKPATCH in MAINTAINERS.

13/31 Checking commit bdb38c8bbd1d (linux-user: Explicitly untag memory management syscalls)
14/31 Checking commit a05e311b4a85 (linux-user: Use guest_range_valid in access_ok)
15/31 Checking commit 30d0a450a9fb (exec: Rename guest_{addr,range}_valid to *_untagged)
16/31 Checking commit 8397f7cdd64e (linux-user: Use cpu_untagged_addr in access_ok; split out *_untagged)
ERROR: braces {} are necessary for all arms of this statement
#32: FILE: linux-user/elfload.c:3503:
+    if (!access_ok_untagged(VERIFY_READ, vma->vma_start, TARGET_PAGE_SIZE))
[...]

total: 1 errors, 0 warnings, 108 lines checked

Patch 16/31 has style problems, please review.  If any of these errors
are false positives report them to the maintainer, see
CHECKPATCH in MAINTAINERS.

17/31 Checking commit 2195f0397597 (linux-user: Move lock_user et al out of line)
ERROR: externs should be avoided in .c files
#117: FILE: linux-user/uaccess.c:29:
+void unlock_user(void *host_ptr, abi_ulong guest_addr, long len);

total: 1 errors, 0 warnings, 115 lines checked

Patch 17/31 has style problems, please review.  If any of these errors
are false positives report them to the maintainer, see
CHECKPATCH in MAINTAINERS.

18/31 Checking commit 580506fc0f64 (linux-user: Fix types in uaccess.c)
ERROR: externs should be avoided in .c files
#88: FILE: linux-user/uaccess.c:29:
+void unlock_user(void *host_ptr, abi_ulong guest_addr, size_t len);

total: 1 errors, 0 warnings, 150 lines checked

Patch 18/31 has style problems, please review.  If any of these errors
are false positives report them to the maintainer, see
CHECKPATCH in MAINTAINERS.

19/31 Checking commit c66012be54a4 (linux-user: Handle tags in lock_user/unlock_user)
20/31 Checking commit 4a635616e265 (linux-user/aarch64: Implement PR_TAGGED_ADDR_ENABLE)
21/31 Checking commit 78a9dec1544d (target/arm: Improve gen_top_byte_ignore)
22/31 Checking commit cb78c3c27e30 (target/arm: Use the proper TBI settings for linux-user)
23/31 Checking commit 900b08671fd4 (linux-user/aarch64: Implement PR_MTE_TCF and PR_MTE_TAG)
24/31 Checking commit 63aaecabd9f8 (linux-user/aarch64: Implement PROT_MTE)
25/31 Checking commit b40490e84eda (target/arm: Split out syndrome.h from internals.h)
WARNING: added, moved or deleted file(s), does MAINTAINERS need updating?
#282: 
new file mode 100644

total: 0 errors, 1 warnings, 530 lines checked

Patch 25/31 has style problems, please review.  If any of these errors
are false positives report them to the maintainer, see
CHECKPATCH in MAINTAINERS.
26/31 Checking commit 2dd573861fd2 (linux-user/aarch64: Pass syndrome to EXC_*_ABORT)
27/31 Checking commit 879da12083b7 (linux-user/aarch64: Signal SEGV_MTESERR for sync tag check fault)
28/31 Checking commit 3d09f6c90e91 (linux-user/aarch64: Signal SEGV_MTEAERR for async tag check error)
29/31 Checking commit 9df3d2884569 (target/arm: Add allocation tag storage for user mode)
30/31 Checking commit 0903d5945e4e (target/arm: Enable MTE for user-only)
31/31 Checking commit 4cfeedee16d4 (tests/tcg/aarch64: Add mte smoke tests)
WARNING: added, moved or deleted file(s), does MAINTAINERS need updating?
#38: 
new file mode 100644

ERROR: trailing statements should be on next line
#177: FILE: tests/tcg/aarch64/mte-3.c:50:
+    while (1);

ERROR: braces {} are necessary for all arms of this statement
#177: FILE: tests/tcg/aarch64/mte-3.c:50:
+    while (1);
[...]

ERROR: use qemu_real_host_page_size instead of getpagesize()
#215: FILE: tests/tcg/aarch64/mte-4.c:31:
+    size_t size = getpagesize() * 4;

total: 3 errors, 1 warnings, 251 lines checked

Patch 31/31 has style problems, please review.  If any of these errors
are false positives report them to the maintainer, see
CHECKPATCH in MAINTAINERS.

=== OUTPUT END ===

Test command exited with code: 1


The full log is available at
http://patchew.org/logs/20210212184902.1251044-1-richard.henderson@linaro.org/testing.checkpatch/?type=message.
---
Email generated automatically by Patchew [https://patchew.org/].
Please send your feedback to patchew-devel@redhat.com
Peter Maydell Feb. 16, 2021, 1:49 p.m. UTC | #2
On Fri, 12 Feb 2021 at 18:49, Richard Henderson
<richard.henderson@linaro.org> wrote:
>
> Changes for v7:
>   * Fix bsd-user vs g2h_untagged.
>
>



Applied to target-arm.next (with the ifdef tweak in patches 17/18), thanks.

-- PMM