[PATCH v11 00/12] linux-user: User support for AArch64 BTI

Richard Henderson posted 12 patches 3 years, 5 months ago
Test checkpatch failed
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/20201016184207.786698-1-richard.henderson@linaro.org
Maintainers: Laurent Vivier <laurent@vivier.eu>, Richard Henderson <rth@twiddle.net>, Peter Maydell <peter.maydell@linaro.org>, Paolo Bonzini <pbonzini@redhat.com>
There is a newer version of this series
include/elf.h                     |  22 ++
include/exec/cpu-all.h            |   2 +
linux-user/qemu.h                 |   4 +
linux-user/syscall_defs.h         |   4 +
target/arm/cpu.h                  |   5 +
linux-user/aarch64/signal.c       |  10 +-
linux-user/elfload.c              | 326 +++++++++++++++++++++++++-----
linux-user/mmap.c                 |  16 ++
target/arm/translate-a64.c        |   6 +-
tests/tcg/aarch64/bti-1.c         |  62 ++++++
tests/tcg/aarch64/bti-2.c         | 108 ++++++++++
tests/tcg/aarch64/bti-crt.inc.c   |  51 +++++
tests/tcg/aarch64/Makefile.target |  10 +
tests/tcg/configure.sh            |   4 +
14 files changed, 569 insertions(+), 61 deletions(-)
create mode 100644 tests/tcg/aarch64/bti-1.c
create mode 100644 tests/tcg/aarch64/bti-2.c
create mode 100644 tests/tcg/aarch64/bti-crt.inc.c
[PATCH v11 00/12] linux-user: User support for AArch64 BTI
Posted by Richard Henderson 3 years, 5 months ago
The kernel abi for this was merged in v5.8, just as the qemu 5.1
merge window was closing, so this slipped to the next dev cycle.

Changes from v10:
  * Include Phil's plug of interp_name memory leak.
  * Convert error reporting to Error api.
  * Mirror the kernel's code structure for parsing notes
    (though Error means that it's not exactly the same).
  * Split aarch64 stuff from basic note parsing patch.

Changes from v9:
  * Split what is now patch 7 into 3 more (pmm).
  * All prerequisites are now upstream.


r~


Philippe Mathieu-Daudé (1):
  linux-user/elfload: Avoid leaking interp_name using GLib memory API

Richard Henderson (11):
  linux-user/aarch64: Reset btype for signals
  linux-user: Set PAGE_TARGET_1 for TARGET_PROT_BTI
  include/elf: Add defines related to GNU property notes for AArch64
  linux-user/elfload: Fix coding style in load_elf_image
  linux-user/elfload: Adjust iteration over phdr
  linux-user/elfload: Move PT_INTERP detection to first loop
  linux-user/elfload: Use Error for load_elf_image
  linux-user/elfload: Use Error for load_elf_interp
  linux-user/elfload: Parse NT_GNU_PROPERTY_TYPE_0 notes
  linux-user/elfload: Parse GNU_PROPERTY_AARCH64_FEATURE_1_AND
  tests/tcg/aarch64: Add bti smoke tests

 include/elf.h                     |  22 ++
 include/exec/cpu-all.h            |   2 +
 linux-user/qemu.h                 |   4 +
 linux-user/syscall_defs.h         |   4 +
 target/arm/cpu.h                  |   5 +
 linux-user/aarch64/signal.c       |  10 +-
 linux-user/elfload.c              | 326 +++++++++++++++++++++++++-----
 linux-user/mmap.c                 |  16 ++
 target/arm/translate-a64.c        |   6 +-
 tests/tcg/aarch64/bti-1.c         |  62 ++++++
 tests/tcg/aarch64/bti-2.c         | 108 ++++++++++
 tests/tcg/aarch64/bti-crt.inc.c   |  51 +++++
 tests/tcg/aarch64/Makefile.target |  10 +
 tests/tcg/configure.sh            |   4 +
 14 files changed, 569 insertions(+), 61 deletions(-)
 create mode 100644 tests/tcg/aarch64/bti-1.c
 create mode 100644 tests/tcg/aarch64/bti-2.c
 create mode 100644 tests/tcg/aarch64/bti-crt.inc.c

-- 
2.25.1


Re: [PATCH v11 00/12] linux-user: User support for AArch64 BTI
Posted by no-reply@patchew.org 3 years, 5 months ago
Patchew URL: https://patchew.org/QEMU/20201016184207.786698-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: 20201016184207.786698-1-richard.henderson@linaro.org
Subject: [PATCH v11 00/12] linux-user: User support for AArch64 BTI

=== 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
 * [new tag]         patchew/20201016184207.786698-1-richard.henderson@linaro.org -> patchew/20201016184207.786698-1-richard.henderson@linaro.org
Switched to a new branch 'test'
adddebd tests/tcg/aarch64: Add bti smoke tests
6de9e12 linux-user/elfload: Parse GNU_PROPERTY_AARCH64_FEATURE_1_AND
9b05077 linux-user/elfload: Parse NT_GNU_PROPERTY_TYPE_0 notes
e063fde linux-user/elfload: Use Error for load_elf_interp
5fa6305 linux-user/elfload: Use Error for load_elf_image
0bdf3b9 linux-user/elfload: Move PT_INTERP detection to first loop
3192943 linux-user/elfload: Adjust iteration over phdr
d35ac0e linux-user/elfload: Fix coding style in load_elf_image
f1019c0 linux-user/elfload: Avoid leaking interp_name using GLib memory API
46b8e04 include/elf: Add defines related to GNU property notes for AArch64
15162b4 linux-user: Set PAGE_TARGET_1 for TARGET_PROT_BTI
49ed74b linux-user/aarch64: Reset btype for signals

=== OUTPUT BEGIN ===
1/12 Checking commit 49ed74bc1aee (linux-user/aarch64: Reset btype for signals)
2/12 Checking commit 15162b4dcbec (linux-user: Set PAGE_TARGET_1 for TARGET_PROT_BTI)
3/12 Checking commit 46b8e04781a1 (include/elf: Add defines related to GNU property notes for AArch64)
4/12 Checking commit f1019c0416c3 (linux-user/elfload: Avoid leaking interp_name using GLib memory API)
5/12 Checking commit d35ac0e1930b (linux-user/elfload: Fix coding style in load_elf_image)
6/12 Checking commit 3192943b8d75 (linux-user/elfload: Adjust iteration over phdr)
7/12 Checking commit 0bdf3b9c07f6 (linux-user/elfload: Move PT_INTERP detection to first loop)
8/12 Checking commit 5fa63056e084 (linux-user/elfload: Use Error for load_elf_image)
9/12 Checking commit e063fde7d4b1 (linux-user/elfload: Use Error for load_elf_interp)
10/12 Checking commit 9b05077fa2ed (linux-user/elfload: Parse NT_GNU_PROPERTY_TYPE_0 notes)
11/12 Checking commit 6de9e12b2adf (linux-user/elfload: Parse GNU_PROPERTY_AARCH64_FEATURE_1_AND)
12/12 Checking commit adddebd8a702 (tests/tcg/aarch64: Add bti smoke tests)
WARNING: added, moved or deleted file(s), does MAINTAINERS need updating?
#37: 
new file mode 100644

ERROR: externs should be avoided in .c files
#165: FILE: tests/tcg/aarch64/bti-2.c:56:
+extern char test_begin[], test_end[];

ERROR: use qemu_real_host_page_size instead of getpagesize()
#199: FILE: tests/tcg/aarch64/bti-2.c:90:
+    void *p = mmap(0, getpagesize(),

ERROR: externs should be avoided in .c files
#236: FILE: tests/tcg/aarch64/bti-crt.inc.c:13:
+int main(void);

total: 3 errors, 1 warnings, 247 lines checked

Patch 12/12 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/20201016184207.786698-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
Re: [PATCH v11 00/12] linux-user: User support for AArch64 BTI
Posted by Peter Maydell 3 years, 5 months ago
On Fri, 16 Oct 2020 at 19:42, Richard Henderson
<richard.henderson@linaro.org> wrote:
>
> The kernel abi for this was merged in v5.8, just as the qemu 5.1
> merge window was closing, so this slipped to the next dev cycle.
>
> Changes from v10:
>   * Include Phil's plug of interp_name memory leak.
>   * Convert error reporting to Error api.
>   * Mirror the kernel's code structure for parsing notes
>     (though Error means that it's not exactly the same).
>   * Split aarch64 stuff from basic note parsing patch.
>
> Changes from v9:
>   * Split what is now patch 7 into 3 more (pmm).
>   * All prerequisites are now upstream.

Unfortunately the bti-2 test dumps core (x86-64 Linux host):

make[2]: Entering directory
'/home/petmay01/linaro/qemu-for-merges/build/all-linux-static/tests/tcg/aarch64-linux-user'
timeout 60  /home/petmay01/linaro/qemu-for-merges/build/all-linux-static/qemu-aarch64
-cpu max pauth-5 >  pauth-5.out
make[2]: Leaving directory
'/home/petmay01/linaro/qemu-for-merges/build/all-linux-static/tests/tcg/aarch64-linux-user'
make[2]: Entering directory
'/home/petmay01/linaro/qemu-for-merges/build/all-linux-static/tests/tcg/aarch64-linux-user'
timeout 60  /home/petmay01/linaro/qemu-for-merges/build/all-linux-static/qemu-aarch64
 bti-2 >  bti-2.out
qemu: uncaught target signal 11 (Segmentation fault) - core dumped
timeout: the monitored command dumped core
Segmentation fault
../Makefile.target:152: recipe for target 'run-bti-2' failed
make[2]: *** [run-bti-2] Error 139
make[2]: Leaving directory
'/home/petmay01/linaro/qemu-for-merges/build/all-linux-static/tests/tcg/aarch64-linux-user'
/home/petmay01/linaro/qemu-for-merges/tests/tcg/Makefile.qemu:85:
recipe for target 'run-guest-tests' failed
make[1]: *** [run-guest-tests] Error 2
/home/petmay01/linaro/qemu-for-merges/tests/Makefile.include:61:
recipe for target 'run-tcg-tests-aarch64-linux-user' failed
make: *** [run-tcg-tests-aarch64-linux-user] Error 2

I've dropped the series from the pullreq.

thanks
-- PMM

Re: [PATCH v11 00/12] linux-user: User support for AArch64 BTI
Posted by Richard Henderson 3 years, 5 months ago
On 10/20/20 1:09 PM, Peter Maydell wrote:
> On Fri, 16 Oct 2020 at 19:42, Richard Henderson
> <richard.henderson@linaro.org> wrote:
>>
>> The kernel abi for this was merged in v5.8, just as the qemu 5.1
>> merge window was closing, so this slipped to the next dev cycle.
>>
>> Changes from v10:
>>   * Include Phil's plug of interp_name memory leak.
>>   * Convert error reporting to Error api.
>>   * Mirror the kernel's code structure for parsing notes
>>     (though Error means that it's not exactly the same).
>>   * Split aarch64 stuff from basic note parsing patch.
>>
>> Changes from v9:
>>   * Split what is now patch 7 into 3 more (pmm).
>>   * All prerequisites are now upstream.
> 
> Unfortunately the bti-2 test dumps core (x86-64 Linux host):

This is odd.  Works on my laptop,

  TEST    pauth-1 on aarch64
  TEST    pauth-2 on aarch64
  TEST    pauth-4 on aarch64
  TEST    pauth-5 on aarch64
  TEST    bti-1 on aarch64
  TEST    bti-2 on aarch64
  TEST    semihosting on aarch64

However, this crashes on an aarch64 host.  Looking at the trace, the compiler
generated bad code -- the difference of two symbols resulted in 0.  So we never
copied the test code to the mmaped page.

I assume your x86_64 build is using the docker images for cross-compile?  I
wonder if my laptop is picking up a local cross-compiler instead.  And then the
aarch64 host compiler has the same problem as the docker version?


r~

Re: [PATCH v11 00/12] linux-user: User support for AArch64 BTI
Posted by Peter Maydell 3 years, 5 months ago
On Fri, 16 Oct 2020 at 19:42, Richard Henderson
<richard.henderson@linaro.org> wrote:
>
> The kernel abi for this was merged in v5.8, just as the qemu 5.1
> merge window was closing, so this slipped to the next dev cycle.
>
> Changes from v10:
>   * Include Phil's plug of interp_name memory leak.
>   * Convert error reporting to Error api.
>   * Mirror the kernel's code structure for parsing notes
>     (though Error means that it's not exactly the same).
>   * Split aarch64 stuff from basic note parsing patch.
>
> Changes from v9:
>   * Split what is now patch 7 into 3 more (pmm).
>   * All prerequisites are now upstream.
>



Applied to target-arm.next, thanks.

-- PMM