Browse Source
* update copyright year to 2026 * Some more universal-binary work for the s390x code done by Philippe * Fix reverse debugging for s390x and add a functional test for it -----BEGIN PGP SIGNATURE----- iQJFBAABCgAvFiEEJ7iIR+7gJQEY8+q5LtnXdP5wLbUFAmlk81cRHHRodXRoQHJl ZGhhdC5jb20ACgkQLtnXdP5wLbWxhxAAlvaTwC7trSsFY3sTMwenG0GHfg0M840H vYXHm69uHigT4IyC2pXOjCN0Yq9zujCymtUIWOKY8l+Hx/x5tgi5fKhOXqqZBhJP KyBKZqJx3cVZC54qlNWF0vxSYCi32wi6xQmVlMYtbBZPfbMfY1Vi55PAknpXCWjv YfBB72LQhS3uPBLOi2Dg3mkGq9+cqHoAVCDVguOBx0N4SdkotvbKrG4XOhFfzjVu VrLgwF2LBLQzlU2JZ/b2u1IOSju67c0qW29dx86p5n6JZdLqNhsOjQ81ToHpQML2 S/X2Nv0uyZTSzjdriBvkyOnM6L35wpZ2qyPrRekfnwzUNKEyHN9b+WTqAZdvCrm1 eKrs87HQ7u3XUu3lR43fFCVlAgpstsF2I9UyyiMMEqGlKAjllDzgy7U3SYaP04Zm pgv7cLt1jgh5GoLB7TC/XRdy1P7Ya1cZ76tL2Uj93CF4w7E2vtHtVzCA6YQk9kVJ jn9pxjYXw/qsoQgM2Ze7UI/d5MYqVHVPK83T5natq1sXf9ardmf2OGQWLrp1JaUl O8xeVpMR08tElxPlcEL+3zd5YAw4QrNJ9D7GhfJQWKOgnOkT/4Kslcyqp8wLP4/D oeNVrv/aEXA8Lf+ozHyIEejmmWJnmgHlAnfL+wi9KV1JzWAsskg5ClR8G3ZzAa69 CUnS7mOSnsw= =N/we -----END PGP SIGNATURE----- Merge tag 'pull-request-2026-01-12' of https://gitlab.com/thuth/qemu into staging * Check functional tests with pylint * update copyright year to 2026 * Some more universal-binary work for the s390x code done by Philippe * Fix reverse debugging for s390x and add a functional test for it # -----BEGIN PGP SIGNATURE----- # # iQJFBAABCgAvFiEEJ7iIR+7gJQEY8+q5LtnXdP5wLbUFAmlk81cRHHRodXRoQHJl # ZGhhdC5jb20ACgkQLtnXdP5wLbWxhxAAlvaTwC7trSsFY3sTMwenG0GHfg0M840H # vYXHm69uHigT4IyC2pXOjCN0Yq9zujCymtUIWOKY8l+Hx/x5tgi5fKhOXqqZBhJP # KyBKZqJx3cVZC54qlNWF0vxSYCi32wi6xQmVlMYtbBZPfbMfY1Vi55PAknpXCWjv # YfBB72LQhS3uPBLOi2Dg3mkGq9+cqHoAVCDVguOBx0N4SdkotvbKrG4XOhFfzjVu # VrLgwF2LBLQzlU2JZ/b2u1IOSju67c0qW29dx86p5n6JZdLqNhsOjQ81ToHpQML2 # S/X2Nv0uyZTSzjdriBvkyOnM6L35wpZ2qyPrRekfnwzUNKEyHN9b+WTqAZdvCrm1 # eKrs87HQ7u3XUu3lR43fFCVlAgpstsF2I9UyyiMMEqGlKAjllDzgy7U3SYaP04Zm # pgv7cLt1jgh5GoLB7TC/XRdy1P7Ya1cZ76tL2Uj93CF4w7E2vtHtVzCA6YQk9kVJ # jn9pxjYXw/qsoQgM2Ze7UI/d5MYqVHVPK83T5natq1sXf9ardmf2OGQWLrp1JaUl # O8xeVpMR08tElxPlcEL+3zd5YAw4QrNJ9D7GhfJQWKOgnOkT/4Kslcyqp8wLP4/D # oeNVrv/aEXA8Lf+ozHyIEejmmWJnmgHlAnfL+wi9KV1JzWAsskg5ClR8G3ZzAa69 # CUnS7mOSnsw= # =N/we # -----END PGP SIGNATURE----- # gpg: Signature made Tue 13 Jan 2026 12:12:55 AM AEDT # gpg: using RSA key 27B88847EEE0250118F3EAB92ED9D774FE702DB5 # gpg: issuer "thuth@redhat.com" # gpg: Good signature from "Thomas Huth <th.huth@gmx.de>" [unknown] # gpg: aka "Thomas Huth <thuth@redhat.com>" [unknown] # gpg: aka "Thomas Huth <th.huth@posteo.de>" [unknown] # gpg: aka "Thomas Huth <huth@tuxfamily.org>" [unknown] # gpg: WARNING: The key's User ID is not certified with a trusted signature! # gpg: There is no indication that the signature belongs to the owner. # Primary key fingerprint: 27B8 8847 EEE0 2501 18F3 EAB9 2ED9 D774 FE70 2DB5 * tag 'pull-request-2026-01-12' of https://gitlab.com/thuth/qemu: tests/functional/s390x: Add reverse debugging test for s390x target/s390x: Fix infinite loop during replay target/s390x: Un-inline s390_is_pv() target/s390x: Simplify S390_ADAPTER_SUPPRESSIBLE definition target/s390x: Remove unused 'gdbstub/helpers.h' header in helper.c target/s390x: Replace target_ulong -> uint64_t in gdb_write_register() target/s390x: Use vaddr for $pc in get_next_pc() target/s390x: Restrict WatchPoint API to TCG docs: update copyright year to 2026 tests/functional: Add a generic test that checks the files with pylint tests/functional/aarch64/test_smmu: Silence warning from pylint tests/functional/aarch64/test_virt_gpu: Fix style issues tests/functional/ppc64/test_hv: Silence warnings reported by pylint tests/functional/mips/test_malta: Silence warnings reported by pylint tests/functional: Add a pylintrc file Signed-off-by: Richard Henderson <richard.henderson@linaro.org>pull/316/head
33 changed files with 368 additions and 144 deletions
@ -0,0 +1,11 @@ |
|||
/*
|
|||
* SPDX-License-Identifier: GPL-2.0-or-later |
|||
*/ |
|||
|
|||
#include "qemu/osdep.h" |
|||
#include "hw/core/cpu.h" |
|||
|
|||
void async_run_on_cpu(CPUState *cpu, run_on_cpu_func func, run_on_cpu_data data) |
|||
{ |
|||
abort(); |
|||
} |
|||
@ -0,0 +1,8 @@ |
|||
/*
|
|||
* SPDX-License-Identifier: GPL-2.0-or-later |
|||
*/ |
|||
|
|||
#include "qemu/osdep.h" |
|||
#include "hw/core/cpu.h" |
|||
|
|||
CPUTailQ cpus_queue = QTAILQ_HEAD_INITIALIZER(cpus_queue); |
|||
@ -0,0 +1,85 @@ |
|||
/*
|
|||
* QEMU S/390 debug routines |
|||
* |
|||
* SPDX-License-Identifier: GPL-2.0-or-later |
|||
*/ |
|||
|
|||
#include "qemu/osdep.h" |
|||
#include "exec/breakpoint.h" |
|||
#include "exec/watchpoint.h" |
|||
#include "target/s390x/cpu.h" |
|||
#include "target/s390x/s390x-internal.h" |
|||
#include "tcg_s390x.h" |
|||
|
|||
void s390_cpu_recompute_watchpoints(CPUState *cs) |
|||
{ |
|||
const int wp_flags = BP_CPU | BP_MEM_WRITE | BP_STOP_BEFORE_ACCESS; |
|||
CPUS390XState *env = cpu_env(cs); |
|||
|
|||
/* We are called when the watchpoints have changed. First
|
|||
remove them all. */ |
|||
cpu_watchpoint_remove_all(cs, BP_CPU); |
|||
|
|||
/* Return if PER is not enabled */ |
|||
if (!(env->psw.mask & PSW_MASK_PER)) { |
|||
return; |
|||
} |
|||
|
|||
/* Return if storage-alteration event is not enabled. */ |
|||
if (!(env->cregs[9] & PER_CR9_EVENT_STORE)) { |
|||
return; |
|||
} |
|||
|
|||
if (env->cregs[10] == 0 && env->cregs[11] == -1LL) { |
|||
/* We can't create a watchoint spanning the whole memory range, so
|
|||
split it in two parts. */ |
|||
cpu_watchpoint_insert(cs, 0, 1ULL << 63, wp_flags, NULL); |
|||
cpu_watchpoint_insert(cs, 1ULL << 63, 1ULL << 63, wp_flags, NULL); |
|||
} else if (env->cregs[10] > env->cregs[11]) { |
|||
/* The address range loops, create two watchpoints. */ |
|||
cpu_watchpoint_insert(cs, env->cregs[10], -env->cregs[10], |
|||
wp_flags, NULL); |
|||
cpu_watchpoint_insert(cs, 0, env->cregs[11] + 1, wp_flags, NULL); |
|||
|
|||
} else { |
|||
/* Default case, create a single watchpoint. */ |
|||
cpu_watchpoint_insert(cs, env->cregs[10], |
|||
env->cregs[11] - env->cregs[10] + 1, |
|||
wp_flags, NULL); |
|||
} |
|||
} |
|||
|
|||
void s390x_cpu_debug_excp_handler(CPUState *cs) |
|||
{ |
|||
CPUS390XState *env = cpu_env(cs); |
|||
CPUWatchpoint *wp_hit = cs->watchpoint_hit; |
|||
|
|||
if (wp_hit && wp_hit->flags & BP_CPU) { |
|||
/*
|
|||
* FIXME: When the storage-alteration-space control bit is set, |
|||
* the exception should only be triggered if the memory access |
|||
* is done using an address space with the storage-alteration-event |
|||
* bit set. We have no way to detect that with the current |
|||
* watchpoint code. |
|||
*/ |
|||
cs->watchpoint_hit = NULL; |
|||
|
|||
env->per_address = env->psw.addr; |
|||
env->per_perc_atmid |= PER_CODE_EVENT_STORE | get_per_atmid(env); |
|||
/*
|
|||
* FIXME: We currently no way to detect the address space used |
|||
* to trigger the watchpoint. For now just consider it is the |
|||
* current default ASC. This turn to be true except when MVCP |
|||
* and MVCS instructions are not used. |
|||
*/ |
|||
env->per_perc_atmid |= env->psw.mask & (PSW_MASK_ASC) >> 46; |
|||
|
|||
/*
|
|||
* Remove all watchpoints to re-execute the code. A PER exception |
|||
* will be triggered, it will call s390_cpu_set_psw which will |
|||
* recompute the watchpoints. |
|||
*/ |
|||
cpu_watchpoint_remove_all(cs, BP_CPU); |
|||
cpu_loop_exit_noexc(cs); |
|||
} |
|||
} |
|||
@ -0,0 +1,41 @@ |
|||
#!/usr/bin/env python3 |
|||
# |
|||
# SPDX-License-Identifier: GPL-2.0-or-later |
|||
# |
|||
'''Python linter tests''' |
|||
|
|||
import os |
|||
|
|||
from pathlib import Path |
|||
from qemu_test import QemuBaseTest, skipIfMissingImports |
|||
|
|||
|
|||
class LinterTest(QemuBaseTest): |
|||
''' |
|||
Run python linters on the test *.py files |
|||
''' |
|||
|
|||
@skipIfMissingImports("pylint") |
|||
def test_pylint(self): |
|||
'''Check source files with pylint''' |
|||
from pylint.lint import Run as pylint_run |
|||
from pylint.reporters.collecting_reporter import CollectingReporter |
|||
srcdir = os.path.join(Path(__file__).parent.parent, self.arch) |
|||
rcfile = os.path.join(Path(__file__).parent.parent, "pylintrc") |
|||
self.log.info('Checking files in %s with pylint', srcdir) |
|||
reporter = CollectingReporter() |
|||
pylint_run(["--rcfile", rcfile, srcdir], reporter=reporter, exit=False) |
|||
if reporter.messages: |
|||
fmt = '"{path}:{line}: {msg_id}: {msg} ({symbol})"' |
|||
for msg in reporter.messages: |
|||
if msg.category == "error": |
|||
self.log.error(msg.format(fmt)) |
|||
elif msg.category == "warning": |
|||
self.log.warning(msg.format(fmt)) |
|||
else: |
|||
self.log.info(msg.format(fmt)) |
|||
self.fail("Pylint failed, see base.log for details.") |
|||
|
|||
|
|||
if __name__ == '__main__': |
|||
QemuBaseTest.main() |
|||
@ -0,0 +1,84 @@ |
|||
# Config file for checking the functional tests with pylint |
|||
# |
|||
# SPDX-License-Identifier: GPL-2.0-or-later |
|||
|
|||
[DESIGN] |
|||
|
|||
# Maximum number of arguments for function / method. |
|||
max-args=9 |
|||
|
|||
# Maximum number of attributes for a class (see R0902). |
|||
max-attributes=7 |
|||
|
|||
# Maximum number of boolean expressions in an if statement (see R0916). |
|||
max-bool-expr=5 |
|||
|
|||
# Maximum number of branch for function / method body. |
|||
max-branches=12 |
|||
|
|||
# Maximum number of locals for function / method body. |
|||
max-locals=15 |
|||
|
|||
# Maximum number of parents for a class (see R0901). |
|||
max-parents=7 |
|||
|
|||
# Maximum number of positional arguments for function / method. |
|||
max-positional-arguments=7 |
|||
|
|||
# Maximum number of public methods for a class (see R0904). |
|||
max-public-methods=20 |
|||
|
|||
# Maximum number of return / yield for function / method body. |
|||
max-returns=6 |
|||
|
|||
# Maximum number of statements in function / method body. |
|||
max-statements=50 |
|||
|
|||
# Minimum number of public methods for a class (see R0903). |
|||
min-public-methods=2 |
|||
|
|||
|
|||
[MESSAGES CONTROL] |
|||
|
|||
# Only show warnings with the listed confidence levels. Leave empty to show |
|||
# all. Valid levels: HIGH, CONTROL_FLOW, INFERENCE, INFERENCE_FAILURE, |
|||
# UNDEFINED. |
|||
confidence=HIGH, |
|||
CONTROL_FLOW, |
|||
INFERENCE, |
|||
INFERENCE_FAILURE |
|||
|
|||
# Disable the message, report, category or checker with the given id(s). You |
|||
# can either give multiple identifiers separated by comma (,) or put this |
|||
# option multiple times (only on the command line, not in the configuration |
|||
# file where it should appear only once). You can also use "--disable=all" to |
|||
# disable everything first and then re-enable specific checks. For example, if |
|||
# you want to run only the similarities checker, you can use "--disable=all |
|||
# --enable=similarities". If you want to run only the classes checker, but have |
|||
# no Warning level messages displayed, use "--disable=all --enable=classes |
|||
# --disable=W". |
|||
disable=bad-inline-option, |
|||
consider-using-f-string, |
|||
file-ignored, |
|||
fixme, |
|||
import-outside-toplevel, |
|||
locally-disabled, |
|||
logging-fstring-interpolation, |
|||
logging-not-lazy, |
|||
missing-function-docstring, |
|||
missing-module-docstring, |
|||
missing-class-docstring, |
|||
raw-checker-failed, |
|||
suppressed-message, |
|||
too-many-locals, |
|||
too-many-statements, |
|||
use-implicit-booleaness-not-comparison-to-string, |
|||
use-implicit-booleaness-not-comparison-to-zero, |
|||
use-symbolic-message-instead, |
|||
useless-suppression, |
|||
|
|||
|
|||
[SIMILARITIES] |
|||
|
|||
# Minimum lines number of a similarity. |
|||
min-similarity-lines=20 |
|||
@ -0,0 +1,21 @@ |
|||
#!/usr/bin/env python3 |
|||
# |
|||
# SPDX-License-Identifier: GPL-2.0-or-later |
|||
# |
|||
''' |
|||
Reverse debugging test for s390x |
|||
''' |
|||
|
|||
from reverse_debugging import ReverseDebugging |
|||
|
|||
|
|||
class ReverseDebuggingS390x(ReverseDebugging): |
|||
|
|||
def test_revdbg(self): |
|||
self.set_machine('s390-ccw-virtio') |
|||
self.reverse_debugging(gdb_arch='s390:64-bit', shift=6, |
|||
big_endian=True, args=('-no-shutdown',)) |
|||
|
|||
|
|||
if __name__ == '__main__': |
|||
ReverseDebugging.main() |
|||
Loading…
Reference in new issue