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

Richard Henderson posted 31 patches 3 years, 3 months ago
Test checkpatch failed
Failed in applying to current master (apply log)
There is a newer version of this series
bsd-user/qemu.h                     |   9 +-
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               |  57 +++---
bsd-user/main.c                     |   4 +-
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 +
42 files changed, 1126 insertions(+), 519 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
[PATCH v5 00/31] target-arm: Implement ARMv8.5-MemTag, user mode
Posted by Richard Henderson 3 years, 3 months ago
The kernel abi was finally merged into 5.10.

Changes for v5:
  * Actually include the revamp for TARGET_TAGGED_ADDRESSES,
    which got lost at some point before posting v4.

    Patches lacking review are only the new ones:
    0011-exec-Introduce-cpu_untagged_addr.patch
    0012-exec-Use-cpu_untagged_addr-in-g2h-split-out-g2h_u.patch
    0013-linux-user-Explicitly-untag-memory-management-sys.patch
    0014-linux-user-Use-guest_range_valid-in-access_ok.patch
    0015-exec-Rename-guest_-addr-range-_valid-to-_untagged.patch
    0016-linux-user-Use-cpu_untagged_addr-in-access_ok-spl.patch
    0017-linux-user-Move-lock_user-et-al-out-of-line.patch
    0018-linux-user-Fix-types-in-uaccess.c.patch
    0019-linux-user-Handle-tags-in-lock_user-unlock_user.patch

Changes for v4:
  * Revamp "Add support for TARGET_TAGGED_ADDRESSES".  There are now two
    sets of functions in include/exec/, one for tagged and one for
    untagged addresses.  The former takes a CPUState, and does not
    assume current_cpu is a thing.  So much for the generic bits...
    However, use of current_cpu remains, pushed down to lock_user.
    Changing everything that touches that, or get/put_user, is daunting.
  * Fix tbi0 vs tbi1 for linux-user.
    This had a number of cascading effects.
  * Adjust when async errors are noticed.

Changes for v3:
  * Split out type changes to separate patches.
  * Add doc comments; tweak alloc so that the !PAGE_VALID case is clear.
  * Do not overlap PAGE_TARGET_2 with PAGE_RESERVED.
  * Use syndrome.h, arm_deliver_fault.


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                     |   9 +-
 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               |  57 +++---
 bsd-user/main.c                     |   4 +-
 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 +
 42 files changed, 1126 insertions(+), 519 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

-- 
2.25.1


Re: [PATCH v5 00/31] target-arm: Implement ARMv8.5-MemTag, user mode
Posted by no-reply@patchew.org 3 years, 3 months ago
Patchew URL: https://patchew.org/QEMU/20210203190010.759771-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: 20210203190010.759771-1-richard.henderson@linaro.org
Subject: [PATCH v5 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
   99ae0cd..1ed9228  master     -> master
 - [tag update]      patchew/20210203113243.280883-1-thuth@redhat.com -> patchew/20210203113243.280883-1-thuth@redhat.com
 - [tag update]      patchew/20210203131828.156467-1-pbonzini@redhat.com -> patchew/20210203131828.156467-1-pbonzini@redhat.com
 - [tag update]      patchew/20210203165552.16306-1-michael.nawrocki@gtri.gatech.edu -> patchew/20210203165552.16306-1-michael.nawrocki@gtri.gatech.edu
 - [tag update]      patchew/20210203171832.483176-1-thuth@redhat.com -> patchew/20210203171832.483176-1-thuth@redhat.com
 * [new tag]         patchew/20210203190010.759771-1-richard.henderson@linaro.org -> patchew/20210203190010.759771-1-richard.henderson@linaro.org
Switched to a new branch 'test'
9e18fe8 tests/tcg/aarch64: Add mte smoke tests
1343d13 target/arm: Enable MTE for user-only
b0637f9 target/arm: Add allocation tag storage for user mode
7dbe8ae linux-user/aarch64: Signal SEGV_MTEAERR for async tag check error
a8a9e4b linux-user/aarch64: Signal SEGV_MTESERR for sync tag check fault
8a46469 linux-user/aarch64: Pass syndrome to EXC_*_ABORT
0bdd89c target/arm: Split out syndrome.h from internals.h
1413717 linux-user/aarch64: Implement PROT_MTE
b121145 linux-user/aarch64: Implement PR_MTE_TCF and PR_MTE_TAG
9fabfe6 target/arm: Use the proper TBI settings for linux-user
0d277c2 target/arm: Improve gen_top_byte_ignore
8dab68f linux-user/aarch64: Implement PR_TAGGED_ADDR_ENABLE
8859ad9 linux-user: Handle tags in lock_user/unlock_user
cffec9c linux-user: Fix types in uaccess.c
b927a1f linux-user: Move lock_user et al out of line
9fe72ac linux-user: Use cpu_untagged_addr in access_ok; split out *_untagged
cc06f39 exec: Rename guest_{addr,range}_valid to *_untagged
6f6a813 linux-user: Use guest_range_valid in access_ok
dd4ad16 linux-user: Explicitly untag memory management syscalls
152f923 exec: Use cpu_untagged_addr in g2h; split out g2h_untagged
871d472 exec: Introduce cpu_untagged_addr
d413972 linux-user: Fix guest_addr_valid vs reserved_va
3734711 linux-user: Do not use guest_addr_valid for h2g_valid
f972c0f bsd-user: Tidy VERIFY_READ/VERIFY_WRITE
4b41ae7 linux-user: Tidy VERIFY_READ/VERIFY_WRITE
9598219 linux-user: Check for overflow in access_ok
3fd7719 exec: Improve types for guest_addr_valid
78b573c exec: Use uintptr_t in cpu_ldst.h
17e666c exec: Use uintptr_t for guest_base
c4d6188 linux-user: Introduce PAGE_ANON
a131719 tcg: Introduce target-specific page data for user-only

=== OUTPUT BEGIN ===
1/31 Checking commit a1317196bf48 (tcg: Introduce target-specific page data for user-only)
2/31 Checking commit c4d6188c23c1 (linux-user: Introduce PAGE_ANON)
3/31 Checking commit 17e666c400ce (exec: Use uintptr_t for guest_base)
4/31 Checking commit 78b573ca012e (exec: Use uintptr_t in cpu_ldst.h)
5/31 Checking commit 3fd7719254c6 (exec: Improve types for guest_addr_valid)
6/31 Checking commit 9598219b9a92 (linux-user: Check for overflow in access_ok)
7/31 Checking commit 4b41ae7fbd9a (linux-user: Tidy VERIFY_READ/VERIFY_WRITE)
8/31 Checking commit f972c0fa3acd (bsd-user: Tidy VERIFY_READ/VERIFY_WRITE)
9/31 Checking commit 3734711323de (linux-user: Do not use guest_addr_valid for h2g_valid)
10/31 Checking commit d41397266800 (linux-user: Fix guest_addr_valid vs reserved_va)
11/31 Checking commit 871d472c35da (exec: Introduce cpu_untagged_addr)
12/31 Checking commit 152f9231963a (exec: Use cpu_untagged_addr in g2h; split out g2h_untagged)
ERROR: braces {} are necessary for all arms of this statement
#535: 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
#697: FILE: linux-user/qemu.h:669:
+    if (host_ptr == g2h_untagged(guest_addr))
[...]

total: 2 errors, 0 warnings, 814 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 dd4ad1690343 (linux-user: Explicitly untag memory management syscalls)
14/31 Checking commit 6f6a813a06db (linux-user: Use guest_range_valid in access_ok)
15/31 Checking commit cc06f39dff6d (exec: Rename guest_{addr,range}_valid to *_untagged)
16/31 Checking commit 9fe72acec2fc (linux-user: Use cpu_untagged_addr in access_ok; split out *_untagged)
ERROR: braces {} are necessary for all arms of this statement
#31: 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 b927a1f15e1b (linux-user: Move lock_user et al out of line)
ERROR: externs should be avoided in .c files
#116: 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 cffec9c75fbb (linux-user: Fix types in uaccess.c)
ERROR: externs should be avoided in .c files
#87: FILE: linux-user/uaccess.c:29:
+void unlock_user(void *host_ptr, abi_ulong guest_addr, size_t len);

total: 1 errors, 0 warnings, 142 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 8859ad90d24a (linux-user: Handle tags in lock_user/unlock_user)
20/31 Checking commit 8dab68fc73ef (linux-user/aarch64: Implement PR_TAGGED_ADDR_ENABLE)
21/31 Checking commit 0d277c229ee7 (target/arm: Improve gen_top_byte_ignore)
22/31 Checking commit 9fabfe6269c8 (target/arm: Use the proper TBI settings for linux-user)
23/31 Checking commit b1211455cdde (linux-user/aarch64: Implement PR_MTE_TCF and PR_MTE_TAG)
24/31 Checking commit 141371770278 (linux-user/aarch64: Implement PROT_MTE)
25/31 Checking commit 0bdd89c67062 (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 8a464692dd13 (linux-user/aarch64: Pass syndrome to EXC_*_ABORT)
27/31 Checking commit a8a9e4ba68a2 (linux-user/aarch64: Signal SEGV_MTESERR for sync tag check fault)
28/31 Checking commit 7dbe8ae490db (linux-user/aarch64: Signal SEGV_MTEAERR for async tag check error)
29/31 Checking commit b0637f953e22 (target/arm: Add allocation tag storage for user mode)
30/31 Checking commit 1343d132c7b2 (target/arm: Enable MTE for user-only)
31/31 Checking commit 9e18fe86d431 (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/20210203190010.759771-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