[PATCH 0/2] target/arm: Fix unaligned mte checks

Richard Henderson posted 2 patches 3 years ago
Test checkpatch failed
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/20210402053728.265173-1-richard.henderson@linaro.org
Maintainers: Peter Maydell <peter.maydell@linaro.org>
target/arm/helper-a64.h           |   3 +-
target/arm/internals.h            |  13 +--
target/arm/translate-a64.h        |   2 +-
target/arm/mte_helper.c           | 171 ++++++++++++------------------
target/arm/sve_helper.c           |  96 ++++++-----------
target/arm/translate-a64.c        |  52 ++++-----
target/arm/translate-sve.c        |   9 +-
tests/tcg/aarch64/mte-5.c         |  44 ++++++++
tests/tcg/aarch64/Makefile.target |   2 +-
9 files changed, 179 insertions(+), 213 deletions(-)
create mode 100644 tests/tcg/aarch64/mte-5.c
[PATCH 0/2] target/arm: Fix unaligned mte checks
Posted by Richard Henderson 3 years ago
I was incorrectly assuming that only the first byte of an MTE access
is checked against the tags.  But per the ARM, unaligned accesses are
pre-decomposed into single-byte accesses.  So by the time we reach the
actual MTE check in the ARM pseudocode, all accesses are aligned.

There's probably more that could be simplified here, but I did try to
keep the patch small-ish.


r~


Richare Henderson (2):
  target/arm: Check PAGE_WRITE_ORG for MTE writeability
  target/arm: Fix unaligned mte checks

 target/arm/helper-a64.h           |   3 +-
 target/arm/internals.h            |  13 +--
 target/arm/translate-a64.h        |   2 +-
 target/arm/mte_helper.c           | 171 ++++++++++++------------------
 target/arm/sve_helper.c           |  96 ++++++-----------
 target/arm/translate-a64.c        |  52 ++++-----
 target/arm/translate-sve.c        |   9 +-
 tests/tcg/aarch64/mte-5.c         |  44 ++++++++
 tests/tcg/aarch64/Makefile.target |   2 +-
 9 files changed, 179 insertions(+), 213 deletions(-)
 create mode 100644 tests/tcg/aarch64/mte-5.c

-- 
2.25.1


Re: [PATCH 0/2] target/arm: Fix unaligned mte checks
Posted by no-reply@patchew.org 3 years ago
Patchew URL: https://patchew.org/QEMU/20210402053728.265173-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: 20210402053728.265173-1-richard.henderson@linaro.org
Subject: [PATCH 0/2] target/arm: Fix unaligned mte checks

=== 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
   00084ba..415fa2f  master     -> master
 - [tag update]      patchew/20210401125808.89241-1-fanwentao.0130@bytedance.com -> patchew/20210401125808.89241-1-fanwentao.0130@bytedance.com
 * [new tag]         patchew/20210402053728.265173-1-richard.henderson@linaro.org -> patchew/20210402053728.265173-1-richard.henderson@linaro.org
Switched to a new branch 'test'
7730030 target/arm: Fix unaligned mte checks
ef1ac97 target/arm: Check PAGE_WRITE_ORG for MTE writeability

=== OUTPUT BEGIN ===
1/2 Checking commit ef1ac978a003 (target/arm: Check PAGE_WRITE_ORG for MTE writeability)
WARNING: line over 80 characters
#28: FILE: target/arm/mte_helper.c:86:
+    if (!(flags & (ptr_access == MMU_DATA_STORE ? PAGE_WRITE_ORG : PAGE_READ))) {

total: 0 errors, 1 warnings, 8 lines checked

Patch 1/2 has style problems, please review.  If any of these errors
are false positives report them to the maintainer, see
CHECKPATCH in MAINTAINERS.
2/2 Checking commit 77300300fa91 (target/arm: Fix unaligned mte checks)
Use of uninitialized value $acpi_testexpected in string eq at ./scripts/checkpatch.pl line 1529.
ERROR: spaces required around that '*' (ctx:WxV)
#407: FILE: target/arm/sve_helper.c:4438:
+               sve_ldst1_tlb_fn *tlb_fn)
                                 ^

ERROR: spaces required around that '*' (ctx:WxV)
#517: FILE: target/arm/sve_helper.c:5063:
+               sve_ldst1_tlb_fn *tlb_fn)
                                 ^

WARNING: added, moved or deleted file(s), does MAINTAINERS need updating?
#787: 
new file mode 100644

total: 2 errors, 1 warnings, 719 lines checked

Patch 2/2 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/20210402053728.265173-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