qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [PULL 00/22] Functional tests and s390x patches for the softfreeze
@ 2025-11-03 10:57 Thomas Huth
  2025-11-03 10:57 ` [PULL 01/22] scripts/device-crash-test: fix spurious EOFError messages Thomas Huth
                   ` (22 more replies)
  0 siblings, 23 replies; 24+ messages in thread
From: Thomas Huth @ 2025-11-03 10:57 UTC (permalink / raw)
  To: qemu-devel; +Cc: Richard Henderson

 Hi Richard!

The following changes since commit 53b41bb78950912ba2d9809eef6b45e4df30c647:

  Merge tag 'pull-target-arm-20251031' of https://gitlab.com/pm215/qemu into staging (2025-11-01 10:52:48 +0100)

are available in the Git repository at:

  https://gitlab.com/thuth/qemu.git tags/pull-request-2025-11-03

for you to fetch changes up to 0408c61e27aca56c2d40aeb6ca0e5c5f8b8c3845:

  tests/tcg/s390x: Test SET CLOCK COMPARATOR (2025-11-03 08:27:59 +0100)

----------------------------------------------------------------
* Fix spurious EOFError messages from the device-crash-test script
* Fix various issues in the functional tests that pylint complained about
* Improve logging information in the functional tests
* Fix issue in the s390x clock-comparator code
* Use address generation for register branch targets on s390x

----------------------------------------------------------------
Daniel P. Berrangé (2):
      tests/functional: include logger name and function in messages
      tests/functional: include the lower level QMP log messages

Ilya Leoshkevich (4):
      target/s390x: Fix missing interrupts for small CKC values
      target/s390x: Fix missing clock-comparator interrupts after reset
      target/s390x: Use address generation for register branch targets
      tests/tcg/s390x: Test SET CLOCK COMPARATOR

John Snow (1):
      scripts/device-crash-test: fix spurious EOFError messages

Philippe Mathieu-Daudé (1):
      hw/s390x: Use memory_region_size()

Thomas Huth (12):
      tests/functional: Fix problems in asset.py reported by pylint
      tests/functional: Fix problems in decorators.py reported by pylint
      tests/functional: Fix problems in linuxkernel.py reported by pylint
      tests/functional: Fix problems in uncompress.py reported by pylint
      tests/functional: Fix problems in utils.py reported by pylint
      tests/functional/arm/test_aspeed_ast1030: Remove unused import
      tests/functional/migration: Fix bad indentation
      tests/functional/ppc64/test_mac99: Fix style issues reported by pylint
      tests/functional/rx/test_gdbsim: Remove unused variables
      tests/functional/x86_64/test_acpi_bits: Silence warnings reported by pylint
      tests/functional/x86_64/test_virtio_balloon: Fix cosmetic issues from pylint
      tests/functional/ppc64: Fix class names to silence pylint warnings

Vladimir Sementsov-Ogievskiy (2):
      tests/functional/.../testcase.py: better socketdir cleanup
      MAINTAINERS: fix functional tests section

 MAINTAINERS                                    |   1 +
 hw/s390x/s390-pci-inst.c                       |   2 +-
 target/s390x/tcg/mem_helper.c                  |  11 +-
 target/s390x/tcg/misc_helper.c                 |  12 +-
 target/s390x/tcg/translate.c                   |  11 +-
 scripts/device-crash-test                      |   2 +-
 tests/functional/arm/test_aspeed_ast1030.py    |   3 +-
 tests/functional/migration.py                  |   4 +-
 tests/functional/ppc/test_74xx.py              |   2 +-
 tests/functional/ppc/test_sam460ex.py          |   5 +-
 tests/functional/ppc64/test_mac99.py           |   8 +-
 tests/functional/ppc64/test_powernv.py         |   2 +-
 tests/functional/ppc64/test_pseries.py         |   2 +-
 tests/functional/ppc64/test_reverse_debug.py   |   2 +-
 tests/functional/qemu_test/asset.py            |  24 ++--
 tests/functional/qemu_test/decorators.py       | 176 ++++++++++++-------------
 tests/functional/qemu_test/linuxkernel.py      |   6 +-
 tests/functional/qemu_test/testcase.py         |   8 +-
 tests/functional/qemu_test/uncompress.py       |  40 +++---
 tests/functional/qemu_test/utils.py            |  22 ++--
 tests/functional/rx/test_gdbsim.py             |   6 +-
 tests/functional/x86_64/test_acpi_bits.py      |   8 +-
 tests/functional/x86_64/test_virtio_balloon.py |   8 +-
 tests/tcg/s390x/Makefile.softmmu-target        |   1 +
 tests/tcg/s390x/sckc.S                         |  63 +++++++++
 25 files changed, 256 insertions(+), 173 deletions(-)
 create mode 100644 tests/tcg/s390x/sckc.S



^ permalink raw reply	[flat|nested] 24+ messages in thread

* [PULL 01/22] scripts/device-crash-test: fix spurious EOFError messages
  2025-11-03 10:57 [PULL 00/22] Functional tests and s390x patches for the softfreeze Thomas Huth
@ 2025-11-03 10:57 ` Thomas Huth
  2025-11-03 10:57 ` [PULL 02/22] tests/functional: Fix problems in asset.py reported by pylint Thomas Huth
                   ` (21 subsequent siblings)
  22 siblings, 0 replies; 24+ messages in thread
From: Thomas Huth @ 2025-11-03 10:57 UTC (permalink / raw)
  To: qemu-devel; +Cc: Richard Henderson, John Snow

From: John Snow <jsnow@redhat.com>

When the QMP library was updated to match the standalone repository in
094ded52, I neglected to update the logging filter(s) in
device-crash-test, which allowed the spurious messages to leak through.

Update the log filter to re-suppress these messages.

Fixes: 094ded52
Reported-by: Thomas Huth <thuth@redhat.com>
Signed-off-by: John Snow <jsnow@redhat.com>
Message-ID: <20251022213109.395149-1-jsnow@redhat.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>
---
 scripts/device-crash-test | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/scripts/device-crash-test b/scripts/device-crash-test
index 1ecb9663ae8..c1576e8b966 100755
--- a/scripts/device-crash-test
+++ b/scripts/device-crash-test
@@ -527,7 +527,7 @@ def main():
         # Async QMP, when in use, is chatty about connection failures.
         # This script knowingly generates a ton of connection errors.
         # Silence this logger.
-        logging.getLogger('qemu.qmp.qmp_client').setLevel(logging.CRITICAL)
+        logging.getLogger('qemu.qmp.protocol').setLevel(logging.CRITICAL)
 
     fatal_failures = []
     wl_stats = {}
-- 
2.51.0



^ permalink raw reply related	[flat|nested] 24+ messages in thread

* [PULL 02/22] tests/functional: Fix problems in asset.py reported by pylint
  2025-11-03 10:57 [PULL 00/22] Functional tests and s390x patches for the softfreeze Thomas Huth
  2025-11-03 10:57 ` [PULL 01/22] scripts/device-crash-test: fix spurious EOFError messages Thomas Huth
@ 2025-11-03 10:57 ` Thomas Huth
  2025-11-03 10:58 ` [PULL 03/22] tests/functional: Fix problems in decorators.py " Thomas Huth
                   ` (20 subsequent siblings)
  22 siblings, 0 replies; 24+ messages in thread
From: Thomas Huth @ 2025-11-03 10:57 UTC (permalink / raw)
  To: qemu-devel; +Cc: Richard Henderson

From: Thomas Huth <thuth@redhat.com>

The "raise" without an Exception was a real problem, the other
spots are rather cosmetics.

Signed-off-by: Thomas Huth <thuth@redhat.com>
Message-ID: <20251015095454.1575318-2-thuth@redhat.com>
---
 tests/functional/qemu_test/asset.py | 24 +++++++++++++-----------
 1 file changed, 13 insertions(+), 11 deletions(-)

diff --git a/tests/functional/qemu_test/asset.py b/tests/functional/qemu_test/asset.py
index ab3a7bb591d..bae40765ce4 100644
--- a/tests/functional/qemu_test/asset.py
+++ b/tests/functional/qemu_test/asset.py
@@ -112,7 +112,7 @@ def _wait_for_other_download(self, tmp_cache_file):
                 return False
 
         self.log.debug("Time out while waiting for %s!", tmp_cache_file)
-        raise
+        raise TimeoutError(f"Time out while waiting for {tmp_cache_file}")
 
     def _save_time_stamp(self):
         '''
@@ -141,7 +141,7 @@ def fetch(self):
         self.log.info("Downloading %s to %s...", self.url, self.cache_file)
         tmp_cache_file = self.cache_file.with_suffix(".download")
 
-        for retries in range(3):
+        for _retries in range(3):
             try:
                 with tmp_cache_file.open("xb") as dst:
                     with urllib.request.urlopen(self.url) as resp:
@@ -181,7 +181,7 @@ def fetch(self):
                 # server or networking problem
                 if e.code == 404:
                     raise AssetError(self, "Unable to download: "
-                                     "HTTP error %d" % e.code)
+                                     "HTTP error %d" % e.code) from e
                 continue
             except URLError as e:
                 # This is typically a network/service level error
@@ -190,7 +190,7 @@ def fetch(self):
                 self.log.error("Unable to download %s: URL error %s",
                                self.url, e.reason)
                 raise AssetError(self, "Unable to download: URL error %s" %
-                                 e.reason, transient=True)
+                                 e.reason, transient=True) from e
             except ConnectionError as e:
                 # A socket connection failure, such as dropped conn
                 # or refused conn
@@ -201,7 +201,7 @@ def fetch(self):
             except Exception as e:
                 tmp_cache_file.unlink()
                 raise AssetError(self, "Unable to download: %s" % e,
-                                 transient=True)
+                                 transient=True) from e
 
         if not os.path.exists(tmp_cache_file):
             raise AssetError(self, "Download retries exceeded", transient=True)
@@ -214,7 +214,6 @@ def fetch(self):
                         self.hash.encode('utf8'))
         except Exception as e:
             self.log.debug("Unable to set xattr on %s: %s", tmp_cache_file, e)
-            pass
 
         if not self._check(tmp_cache_file):
             tmp_cache_file.unlink()
@@ -224,9 +223,10 @@ def fetch(self):
         # Remove write perms to stop tests accidentally modifying them
         os.chmod(self.cache_file, stat.S_IRUSR | stat.S_IRGRP)
 
-        self.log.info("Cached %s at %s" % (self.url, self.cache_file))
+        self.log.info("Cached %s at %s", self.url, self.cache_file)
         return str(self.cache_file)
 
+    @staticmethod
     def precache_test(test):
         log = logging.getLogger('qemu-test')
         log.setLevel(logging.DEBUG)
@@ -237,16 +237,17 @@ def precache_test(test):
         handler.setFormatter(formatter)
         log.addHandler(handler)
         for name, asset in vars(test.__class__).items():
-            if name.startswith("ASSET_") and type(asset) == Asset:
+            if name.startswith("ASSET_") and isinstance(asset, Asset):
                 try:
                     asset.fetch()
                 except AssetError as e:
                     if not e.transient:
                         raise
-                    log.error("%s: skipping asset precache" % e)
+                    log.error("%s: skipping asset precache", e)
 
         log.removeHandler(handler)
 
+    @staticmethod
     def precache_suite(suite):
         for test in suite:
             if isinstance(test, unittest.TestSuite):
@@ -254,9 +255,10 @@ def precache_suite(suite):
             elif isinstance(test, unittest.TestCase):
                 Asset.precache_test(test)
 
-    def precache_suites(path, cacheTstamp):
+    @staticmethod
+    def precache_suites(path, cache_tstamp):
         loader = unittest.loader.defaultTestLoader
         tests = loader.loadTestsFromNames([path], None)
 
-        with open(cacheTstamp, "w") as fh:
+        with open(cache_tstamp, "w", encoding='utf-8'):
             Asset.precache_suite(tests)
-- 
2.51.0



^ permalink raw reply related	[flat|nested] 24+ messages in thread

* [PULL 03/22] tests/functional: Fix problems in decorators.py reported by pylint
  2025-11-03 10:57 [PULL 00/22] Functional tests and s390x patches for the softfreeze Thomas Huth
  2025-11-03 10:57 ` [PULL 01/22] scripts/device-crash-test: fix spurious EOFError messages Thomas Huth
  2025-11-03 10:57 ` [PULL 02/22] tests/functional: Fix problems in asset.py reported by pylint Thomas Huth
@ 2025-11-03 10:58 ` Thomas Huth
  2025-11-03 10:58 ` [PULL 04/22] tests/functional: Fix problems in linuxkernel.py " Thomas Huth
                   ` (19 subsequent siblings)
  22 siblings, 0 replies; 24+ messages in thread
From: Thomas Huth @ 2025-11-03 10:58 UTC (permalink / raw)
  To: qemu-devel; +Cc: Richard Henderson, Philippe Mathieu-Daudé

From: Thomas Huth <thuth@redhat.com>

The documentation strings should follow the function definition
lines, not precede them.

Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Signed-off-by: Thomas Huth <thuth@redhat.com>
Message-ID: <20251015095454.1575318-3-thuth@redhat.com>
---
 tests/functional/qemu_test/decorators.py | 176 +++++++++++------------
 1 file changed, 87 insertions(+), 89 deletions(-)

diff --git a/tests/functional/qemu_test/decorators.py b/tests/functional/qemu_test/decorators.py
index b2392958041..807418359ab 100644
--- a/tests/functional/qemu_test/decorators.py
+++ b/tests/functional/qemu_test/decorators.py
@@ -10,136 +10,134 @@
 
 from .cmd import which
 
-'''
-Decorator to skip execution of a test if the provided
-environment variables are not set.
-Example:
 
-  @skipIfMissingEnv("QEMU_ENV_VAR0", "QEMU_ENV_VAR1")
-'''
 def skipIfMissingEnv(*vars_):
+    '''
+    Decorator to skip execution of a test if the provided
+    environment variables are not set.
+    Example:
+
+      @skipIfMissingEnv("QEMU_ENV_VAR0", "QEMU_ENV_VAR1")
+    '''
     missing_vars = []
     for var in vars_:
-        if os.getenv(var) == None:
+        if os.getenv(var) is None:
             missing_vars.append(var)
 
-    has_vars = True if len(missing_vars) == 0 else False
+    has_vars = len(missing_vars) == 0
 
     return skipUnless(has_vars, f"Missing env var(s): {', '.join(missing_vars)}")
 
-'''
-
-Decorator to skip execution of a test if the list
-of command binaries is not available in $PATH.
-Example:
-
-  @skipIfMissingCommands("mkisofs", "losetup")
-'''
 def skipIfMissingCommands(*args):
+    '''
+    Decorator to skip execution of a test if the list
+    of command binaries is not available in $PATH.
+    Example:
+
+      @skipIfMissingCommands("mkisofs", "losetup")
+    '''
     has_cmds = True
     for cmd in args:
-         if not which(cmd):
-             has_cmds = False
-             break
+        if not which(cmd):
+            has_cmds = False
+            break
 
     return skipUnless(has_cmds, 'required command(s) "%s" not installed' %
                                 ", ".join(args))
 
-'''
-Decorator to skip execution of a test if the current
-host operating system does match one of the prohibited
-ones.
-Example
-
-  @skipIfOperatingSystem("Linux", "Darwin")
-'''
 def skipIfOperatingSystem(*args):
+    '''
+    Decorator to skip execution of a test if the current host
+    operating system does match one of the prohibited ones.
+    Example:
+
+      @skipIfOperatingSystem("Linux", "Darwin")
+    '''
     return skipIf(platform.system() in args,
                   'running on an OS (%s) that is not able to run this test' %
                   ", ".join(args))
 
-'''
-Decorator to skip execution of a test if the current
-host machine does not match one of the permitted
-machines.
-Example
-
-  @skipIfNotMachine("x86_64", "aarch64")
-'''
 def skipIfNotMachine(*args):
+    '''
+    Decorator to skip execution of a test if the current
+    host machine does not match one of the permitted machines.
+    Example:
+
+      @skipIfNotMachine("x86_64", "aarch64")
+    '''
     return skipUnless(platform.machine() in args,
                       'not running on one of the required machine(s) "%s"' %
                       ", ".join(args))
 
-'''
-Decorator to skip execution of flaky tests, unless
-the $QEMU_TEST_FLAKY_TESTS environment variable is set.
-A bug URL must be provided that documents the observed
-failure behaviour, so it can be tracked & re-evaluated
-in future.
+def skipFlakyTest(bug_url):
+    '''
+    Decorator to skip execution of flaky tests, unless
+    the $QEMU_TEST_FLAKY_TESTS environment variable is set.
+    A bug URL must be provided that documents the observed
+    failure behaviour, so it can be tracked & re-evaluated
+    in future.
 
-Historical tests may be providing "None" as the bug_url
-but this should not be done for new test.
+    Historical tests may be providing "None" as the bug_url
+    but this should not be done for new test.
 
-Example:
+    Example:
 
-  @skipFlakyTest("https://gitlab.com/qemu-project/qemu/-/issues/NNN")
-'''
-def skipFlakyTest(bug_url):
+      @skipFlakyTest("https://gitlab.com/qemu-project/qemu/-/issues/NNN")
+    '''
     if bug_url is None:
         bug_url = "FIXME: reproduce flaky test and file bug report or remove"
     return skipUnless(os.getenv('QEMU_TEST_FLAKY_TESTS'),
                       f'Test is unstable: {bug_url}')
 
-'''
-Decorator to skip execution of tests which are likely
-to execute untrusted commands on the host, or commands
-which process untrusted code, unless the
-$QEMU_TEST_ALLOW_UNTRUSTED_CODE env var is set.
-Example:
-
-  @skipUntrustedTest()
-'''
 def skipUntrustedTest():
+    '''
+    Decorator to skip execution of tests which are likely
+    to execute untrusted commands on the host, or commands
+    which process untrusted code, unless the
+    $QEMU_TEST_ALLOW_UNTRUSTED_CODE env var is set.
+    Example:
+
+      @skipUntrustedTest()
+    '''
     return skipUnless(os.getenv('QEMU_TEST_ALLOW_UNTRUSTED_CODE'),
                       'Test runs untrusted code / processes untrusted data')
 
-'''
-Decorator to skip execution of tests which need large
-data storage (over around 500MB-1GB mark) on the host,
-unless the $QEMU_TEST_ALLOW_LARGE_STORAGE environment
-variable is set
+def skipBigDataTest():
+    '''
+    Decorator to skip execution of tests which need large
+    data storage (over around 500MB-1GB mark) on the host,
+    unless the $QEMU_TEST_ALLOW_LARGE_STORAGE environment
+    variable is set
 
-Example:
+    Example:
 
-  @skipBigDataTest()
-'''
-def skipBigDataTest():
+      @skipBigDataTest()
+    '''
     return skipUnless(os.getenv('QEMU_TEST_ALLOW_LARGE_STORAGE'),
                       'Test requires large host storage space')
 
-'''
-Decorator to skip execution of tests which have a really long
-runtime (and might e.g. time out if QEMU has been compiled with
-debugging enabled) unless the $QEMU_TEST_ALLOW_SLOW
-environment variable is set
+def skipSlowTest():
+    '''
+    Decorator to skip execution of tests which have a really long
+    runtime (and might e.g. time out if QEMU has been compiled with
+    debugging enabled) unless the $QEMU_TEST_ALLOW_SLOW
+    environment variable is set
 
-Example:
+    Example:
 
-  @skipSlowTest()
-'''
-def skipSlowTest():
+      @skipSlowTest()
+    '''
     return skipUnless(os.getenv('QEMU_TEST_ALLOW_SLOW'),
                       'Test has a very long runtime and might time out')
 
-'''
-Decorator to skip execution of a test if the list
-of python imports is not available.
-Example:
-
-  @skipIfMissingImports("numpy", "cv2")
-'''
 def skipIfMissingImports(*args):
+    '''
+    Decorator to skip execution of a test if the list
+    of python imports is not available.
+    Example:
+
+      @skipIfMissingImports("numpy", "cv2")
+    '''
     has_imports = True
     for impname in args:
         try:
@@ -151,15 +149,15 @@ def skipIfMissingImports(*args):
     return skipUnless(has_imports, 'required import(s) "%s" not installed' %
                                    ", ".join(args))
 
-'''
-Decorator to skip execution of a test if the system's
-locked memory limit is below the required threshold.
-Takes required locked memory threshold in kB.
-Example:
-
-  @skipLockedMemoryTest(2_097_152)
-'''
 def skipLockedMemoryTest(locked_memory):
+    '''
+    Decorator to skip execution of a test if the system's
+    locked memory limit is below the required threshold.
+    Takes required locked memory threshold in kB.
+    Example:
+
+      @skipLockedMemoryTest(2_097_152)
+    '''
     # get memlock hard limit in bytes
     _, ulimit_memory = resource.getrlimit(resource.RLIMIT_MEMLOCK)
 
-- 
2.51.0



^ permalink raw reply related	[flat|nested] 24+ messages in thread

* [PULL 04/22] tests/functional: Fix problems in linuxkernel.py reported by pylint
  2025-11-03 10:57 [PULL 00/22] Functional tests and s390x patches for the softfreeze Thomas Huth
                   ` (2 preceding siblings ...)
  2025-11-03 10:58 ` [PULL 03/22] tests/functional: Fix problems in decorators.py " Thomas Huth
@ 2025-11-03 10:58 ` Thomas Huth
  2025-11-03 10:58 ` [PULL 05/22] tests/functional: Fix problems in uncompress.py " Thomas Huth
                   ` (18 subsequent siblings)
  22 siblings, 0 replies; 24+ messages in thread
From: Thomas Huth @ 2025-11-03 10:58 UTC (permalink / raw)
  To: qemu-devel; +Cc: Richard Henderson

From: Thomas Huth <thuth@redhat.com>

Use proper indentation here.

Message-ID: <20251015095454.1575318-3-thuth@redhat.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>
---
 tests/functional/qemu_test/linuxkernel.py | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/tests/functional/qemu_test/linuxkernel.py b/tests/functional/qemu_test/linuxkernel.py
index c4767527daf..eb10a813353 100644
--- a/tests/functional/qemu_test/linuxkernel.py
+++ b/tests/functional/qemu_test/linuxkernel.py
@@ -83,12 +83,12 @@ def launch_kernel(self, kernel, initrd=None, dtb=None, console_index=0,
         self.vm.set_console(console_index=console_index)
         self.vm.add_args('-kernel', kernel)
         if initrd:
-                self.vm.add_args('-initrd', initrd)
+            self.vm.add_args('-initrd', initrd)
         if dtb:
-                self.vm.add_args('-dtb', dtb)
+            self.vm.add_args('-dtb', dtb)
         self.vm.launch()
         if wait_for:
-                self.wait_for_console_pattern(wait_for)
+            self.wait_for_console_pattern(wait_for)
 
     def check_http_download(self, filename, hashsum, guestport=8080,
                             pythoncmd='python3 -m http.server'):
-- 
2.51.0



^ permalink raw reply related	[flat|nested] 24+ messages in thread

* [PULL 05/22] tests/functional: Fix problems in uncompress.py reported by pylint
  2025-11-03 10:57 [PULL 00/22] Functional tests and s390x patches for the softfreeze Thomas Huth
                   ` (3 preceding siblings ...)
  2025-11-03 10:58 ` [PULL 04/22] tests/functional: Fix problems in linuxkernel.py " Thomas Huth
@ 2025-11-03 10:58 ` Thomas Huth
  2025-11-03 10:58 ` [PULL 06/22] tests/functional: Fix problems in utils.py " Thomas Huth
                   ` (17 subsequent siblings)
  22 siblings, 0 replies; 24+ messages in thread
From: Thomas Huth @ 2025-11-03 10:58 UTC (permalink / raw)
  To: qemu-devel; +Cc: Richard Henderson, Philippe Mathieu-Daudé

From: Thomas Huth <thuth@redhat.com>

- put the doc strings in the right locations (after the "def" line)
- use isinstance() instead of checking via type()

Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Signed-off-by: Thomas Huth <thuth@redhat.com>
Message-ID: <20251015095454.1575318-6-thuth@redhat.com>
---
 tests/functional/qemu_test/uncompress.py | 40 ++++++++++++------------
 1 file changed, 20 insertions(+), 20 deletions(-)

diff --git a/tests/functional/qemu_test/uncompress.py b/tests/functional/qemu_test/uncompress.py
index b7ef8f759b7..5bbdf8fe323 100644
--- a/tests/functional/qemu_test/uncompress.py
+++ b/tests/functional/qemu_test/uncompress.py
@@ -58,20 +58,20 @@ def zstd_uncompress(zstd_path, output_path):
     os.chmod(output_path, stat.S_IRUSR | stat.S_IWUSR)
 
 
-'''
-@params compressed: filename, Asset, or file-like object to uncompress
-@params uncompressed: filename to uncompress into
-@params format: optional compression format (gzip, lzma)
+def uncompress(compressed, uncompressed, format=None):
+    '''
+    @params compressed: filename, Asset, or file-like object to uncompress
+    @params uncompressed: filename to uncompress into
+    @params format: optional compression format (gzip, lzma)
 
-Uncompresses @compressed into @uncompressed
+    Uncompresses @compressed into @uncompressed
 
-If @format is None, heuristics will be applied to guess the format
-from the filename or Asset URL. @format must be non-None if @uncompressed
-is a file-like object.
+    If @format is None, heuristics will be applied to guess the
+    format from the filename or Asset URL. @format must be non-None
+    if @uncompressed is a file-like object.
 
-Returns the fully qualified path to the uncompessed file
-'''
-def uncompress(compressed, uncompressed, format=None):
+    Returns the fully qualified path to the uncompessed file
+    '''
     if format is None:
         format = guess_uncompress_format(compressed)
 
@@ -84,19 +84,19 @@ def uncompress(compressed, uncompressed, format=None):
     else:
         raise Exception(f"Unknown compression format {format}")
 
-'''
-@params compressed: filename, Asset, or file-like object to guess
-
-Guess the format of @compressed, raising an exception if
-no format can be determined
-'''
 def guess_uncompress_format(compressed):
-    if type(compressed) == Asset:
+    '''
+    @params compressed: filename, Asset, or file-like object to guess
+
+    Guess the format of @compressed, raising an exception if
+    no format can be determined
+    '''
+    if isinstance(compressed, Asset):
         compressed = urlparse(compressed.url).path
-    elif type(compressed) != str:
+    elif not isinstance(compressed, str):
         raise Exception(f"Unable to guess compression cformat for {compressed}")
 
-    (name, ext) = os.path.splitext(compressed)
+    (_name, ext) = os.path.splitext(compressed)
     if ext == ".xz":
         return "xz"
     elif ext == ".gz":
-- 
2.51.0



^ permalink raw reply related	[flat|nested] 24+ messages in thread

* [PULL 06/22] tests/functional: Fix problems in utils.py reported by pylint
  2025-11-03 10:57 [PULL 00/22] Functional tests and s390x patches for the softfreeze Thomas Huth
                   ` (4 preceding siblings ...)
  2025-11-03 10:58 ` [PULL 05/22] tests/functional: Fix problems in uncompress.py " Thomas Huth
@ 2025-11-03 10:58 ` Thomas Huth
  2025-11-03 10:58 ` [PULL 07/22] tests/functional/arm/test_aspeed_ast1030: Remove unused import Thomas Huth
                   ` (16 subsequent siblings)
  22 siblings, 0 replies; 24+ messages in thread
From: Thomas Huth @ 2025-11-03 10:58 UTC (permalink / raw)
  To: qemu-devel; +Cc: Richard Henderson, Philippe Mathieu-Daudé

From: Thomas Huth <thuth@redhat.com>

- put the doc strings in the right locations (after the "def" line)
- use the right indentation (4 spaces)

Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Signed-off-by: Thomas Huth <thuth@redhat.com>
Message-ID: <20251015095454.1575318-7-thuth@redhat.com>
---
 tests/functional/qemu_test/utils.py | 22 +++++++++++-----------
 1 file changed, 11 insertions(+), 11 deletions(-)

diff --git a/tests/functional/qemu_test/utils.py b/tests/functional/qemu_test/utils.py
index e7c8de81654..826c267785b 100644
--- a/tests/functional/qemu_test/utils.py
+++ b/tests/functional/qemu_test/utils.py
@@ -17,10 +17,10 @@ def get_usernet_hostfwd_port(vm):
     res = vm.cmd('human-monitor-command', command_line='info usernet')
     return get_info_usernet_hostfwd_port(res)
 
-"""
-Round up to next power of 2
-"""
 def pow2ceil(x):
+    """
+    Round up to next power of 2
+    """
     return 1 if x == 0 else 2**(x - 1).bit_length()
 
 def file_truncate(path, size):
@@ -28,12 +28,12 @@ def file_truncate(path, size):
         with open(path, 'ab+') as fd:
             fd.truncate(size)
 
-"""
-Expand file size to next power of 2
-"""
 def image_pow2ceil_expand(path):
-        size = os.path.getsize(path)
-        size_aligned = pow2ceil(size)
-        if size != size_aligned:
-            with open(path, 'ab+') as fd:
-                fd.truncate(size_aligned)
+    """
+    Expand file size to next power of 2
+    """
+    size = os.path.getsize(path)
+    size_aligned = pow2ceil(size)
+    if size != size_aligned:
+        with open(path, 'ab+') as fd:
+            fd.truncate(size_aligned)
-- 
2.51.0



^ permalink raw reply related	[flat|nested] 24+ messages in thread

* [PULL 07/22] tests/functional/arm/test_aspeed_ast1030: Remove unused import
  2025-11-03 10:57 [PULL 00/22] Functional tests and s390x patches for the softfreeze Thomas Huth
                   ` (5 preceding siblings ...)
  2025-11-03 10:58 ` [PULL 06/22] tests/functional: Fix problems in utils.py " Thomas Huth
@ 2025-11-03 10:58 ` Thomas Huth
  2025-11-03 10:58 ` [PULL 08/22] tests/functional/.../testcase.py: better socketdir cleanup Thomas Huth
                   ` (15 subsequent siblings)
  22 siblings, 0 replies; 24+ messages in thread
From: Thomas Huth @ 2025-11-03 10:58 UTC (permalink / raw)
  To: qemu-devel; +Cc: Richard Henderson, Cédric Le Goater

From: Thomas Huth <thuth@redhat.com>

This file does not use LinuxKernelTest directly (but AspeedTest),
so we can remove this unnecessary import here.

Reviewed-by: Cédric Le Goater <clg@redhat.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>
Message-ID: <20251024124016.799687-1-thuth@redhat.com>
---
 tests/functional/arm/test_aspeed_ast1030.py | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/tests/functional/arm/test_aspeed_ast1030.py b/tests/functional/arm/test_aspeed_ast1030.py
index 60e2b0251c6..d1822edd8f1 100755
--- a/tests/functional/arm/test_aspeed_ast1030.py
+++ b/tests/functional/arm/test_aspeed_ast1030.py
@@ -6,9 +6,8 @@
 #
 # SPDX-License-Identifier: GPL-2.0-or-later
 
-from qemu_test import LinuxKernelTest, Asset
 from aspeed import AspeedTest
-from qemu_test import exec_command_and_wait_for_pattern
+from qemu_test import Asset, exec_command_and_wait_for_pattern
 
 
 class AST1030Machine(AspeedTest):
-- 
2.51.0



^ permalink raw reply related	[flat|nested] 24+ messages in thread

* [PULL 08/22] tests/functional/.../testcase.py: better socketdir cleanup
  2025-11-03 10:57 [PULL 00/22] Functional tests and s390x patches for the softfreeze Thomas Huth
                   ` (6 preceding siblings ...)
  2025-11-03 10:58 ` [PULL 07/22] tests/functional/arm/test_aspeed_ast1030: Remove unused import Thomas Huth
@ 2025-11-03 10:58 ` Thomas Huth
  2025-11-03 10:58 ` [PULL 09/22] MAINTAINERS: fix functional tests section Thomas Huth
                   ` (14 subsequent siblings)
  22 siblings, 0 replies; 24+ messages in thread
From: Thomas Huth @ 2025-11-03 10:58 UTC (permalink / raw)
  To: qemu-devel; +Cc: Richard Henderson, Vladimir Sementsov-Ogievskiy

From: Vladimir Sementsov-Ogievskiy <vsementsov@yandex-team.ru>

TemporaryDirectory prefer explicit call to .cleanup() (or
use context manager). Otherwise it may produce a warning like:

   /usr/lib/python3.10/tempfile.py:1008: \
     ResourceWarning: Implicitly cleaning up \
     <TemporaryDirectory '/tmp/qemu_func_test_sock_4esmf5ba'>

Currently, the only test using socket_dir() is
tests/functional/x86_64/test_vfio_user_client.py, and it does
print this warning, at least with python 3.10.12. With this commit,
the warning disappears.

Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@yandex-team.ru>
Reviewed-by: Thomas Huth <thuth@redhat.com>
Message-ID: <20251025165809.930670-2-vsementsov@yandex-team.ru>
Signed-off-by: Thomas Huth <thuth@redhat.com>
---
 tests/functional/qemu_test/testcase.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tests/functional/qemu_test/testcase.py b/tests/functional/qemu_test/testcase.py
index 2c0abde3957..a122acb5609 100644
--- a/tests/functional/qemu_test/testcase.py
+++ b/tests/functional/qemu_test/testcase.py
@@ -233,7 +233,7 @@ def tearDown(self):
         if "QEMU_TEST_KEEP_SCRATCH" not in os.environ:
             shutil.rmtree(self.workdir)
         if self.socketdir is not None:
-            shutil.rmtree(self.socketdir.name)
+            self.socketdir.cleanup()
             self.socketdir = None
         self.machinelog.removeHandler(self._log_fh)
         self.log.removeHandler(self._log_fh)
-- 
2.51.0



^ permalink raw reply related	[flat|nested] 24+ messages in thread

* [PULL 09/22] MAINTAINERS: fix functional tests section
  2025-11-03 10:57 [PULL 00/22] Functional tests and s390x patches for the softfreeze Thomas Huth
                   ` (7 preceding siblings ...)
  2025-11-03 10:58 ` [PULL 08/22] tests/functional/.../testcase.py: better socketdir cleanup Thomas Huth
@ 2025-11-03 10:58 ` Thomas Huth
  2025-11-03 10:58 ` [PULL 10/22] tests/functional/migration: Fix bad indentation Thomas Huth
                   ` (13 subsequent siblings)
  22 siblings, 0 replies; 24+ messages in thread
From: Thomas Huth @ 2025-11-03 10:58 UTC (permalink / raw)
  To: qemu-devel; +Cc: Richard Henderson, Vladimir Sementsov-Ogievskiy

From: Vladimir Sementsov-Ogievskiy <vsementsov@yandex-team.ru>

Without "S: Maintained", ./scripts/get_maintainer.pl shows "unknown"
role instead of "maintainer" for "M: " entry, it's confusing. I really
hope that functional tests are maintained:)

Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@yandex-team.ru>
Reviewed-by: Thomas Huth <thuth@redhat.com>
Message-ID: <20251025165809.930670-3-vsementsov@yandex-team.ru>
Signed-off-by: Thomas Huth <thuth@redhat.com>
---
 MAINTAINERS | 1 +
 1 file changed, 1 insertion(+)

diff --git a/MAINTAINERS b/MAINTAINERS
index a6a1d36f52d..71c86ee8ce2 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -4412,6 +4412,7 @@ Functional testing framework
 M: Thomas Huth <thuth@redhat.com>
 R: Philippe Mathieu-Daudé <philmd@linaro.org>
 R: Daniel P. Berrange <berrange@redhat.com>
+S: Maintained
 F: docs/devel/testing/functional.rst
 F: scripts/clean_functional_cache.py
 F: tests/functional/qemu_test/
-- 
2.51.0



^ permalink raw reply related	[flat|nested] 24+ messages in thread

* [PULL 10/22] tests/functional/migration: Fix bad indentation
  2025-11-03 10:57 [PULL 00/22] Functional tests and s390x patches for the softfreeze Thomas Huth
                   ` (8 preceding siblings ...)
  2025-11-03 10:58 ` [PULL 09/22] MAINTAINERS: fix functional tests section Thomas Huth
@ 2025-11-03 10:58 ` Thomas Huth
  2025-11-03 10:58 ` [PULL 11/22] tests/functional/ppc64/test_mac99: Fix style issues reported by pylint Thomas Huth
                   ` (12 subsequent siblings)
  22 siblings, 0 replies; 24+ messages in thread
From: Thomas Huth @ 2025-11-03 10:58 UTC (permalink / raw)
  To: qemu-devel; +Cc: Richard Henderson, Philippe Mathieu-Daudé

From: Thomas Huth <thuth@redhat.com>

pylint complains about bad indentation in two lines. Use 12 spaces
instead of 11 spaces to get it right.

Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Signed-off-by: Thomas Huth <thuth@redhat.com>
Message-ID: <20251027112347.54190-1-thuth@redhat.com>
---
 tests/functional/migration.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/tests/functional/migration.py b/tests/functional/migration.py
index 07395544832..2bfb1f77901 100644
--- a/tests/functional/migration.py
+++ b/tests/functional/migration.py
@@ -30,11 +30,11 @@ def assert_migration(self, src_vm, dst_vm):
 
         end = time.monotonic() + self.timeout
         while time.monotonic() < end and not self.migration_finished(src_vm):
-           time.sleep(0.1)
+            time.sleep(0.1)
 
         end = time.monotonic() + self.timeout
         while time.monotonic() < end and not self.migration_finished(dst_vm):
-           time.sleep(0.1)
+            time.sleep(0.1)
 
         self.assertEqual(src_vm.cmd('query-migrate')['status'], 'completed')
         self.assertEqual(dst_vm.cmd('query-migrate')['status'], 'completed')
-- 
2.51.0



^ permalink raw reply related	[flat|nested] 24+ messages in thread

* [PULL 11/22] tests/functional/ppc64/test_mac99: Fix style issues reported by pylint
  2025-11-03 10:57 [PULL 00/22] Functional tests and s390x patches for the softfreeze Thomas Huth
                   ` (9 preceding siblings ...)
  2025-11-03 10:58 ` [PULL 10/22] tests/functional/migration: Fix bad indentation Thomas Huth
@ 2025-11-03 10:58 ` Thomas Huth
  2025-11-03 10:58 ` [PULL 12/22] tests/functional/rx/test_gdbsim: Remove unused variables Thomas Huth
                   ` (11 subsequent siblings)
  22 siblings, 0 replies; 24+ messages in thread
From: Thomas Huth @ 2025-11-03 10:58 UTC (permalink / raw)
  To: qemu-devel; +Cc: Richard Henderson, Manos Pitsidianakis

From: Thomas Huth <thuth@redhat.com>

Pylint complained about lines being too long here, and mac99Test not
following the usual CamelCase capitalization.

Reviewed-by: Manos Pitsidianakis <manos.pitsidianakis@linaro.org>
Signed-off-by: Thomas Huth <thuth@redhat.com>
Message-ID: <20251029080502.52938-1-thuth@redhat.com>
---
 tests/functional/ppc64/test_mac99.py | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/tests/functional/ppc64/test_mac99.py b/tests/functional/ppc64/test_mac99.py
index dfd9c01371d..a3261a8330a 100755
--- a/tests/functional/ppc64/test_mac99.py
+++ b/tests/functional/ppc64/test_mac99.py
@@ -7,14 +7,16 @@
 from qemu_test import LinuxKernelTest, Asset
 from qemu_test import exec_command_and_wait_for_pattern
 
-class mac99Test(LinuxKernelTest):
+class Mac99Test(LinuxKernelTest):
 
     ASSET_BR2_MAC99_LINUX = Asset(
-        'https://github.com/legoater/qemu-ppc-boot/raw/refs/heads/main/buildroot/qemu_ppc64_mac99-2023.11-8-gdcd9f0f6eb-20240105/vmlinux',
+        ('https://github.com/legoater/qemu-ppc-boot/raw/refs/heads/main'
+         '/buildroot/qemu_ppc64_mac99-2023.11-8-gdcd9f0f6eb-20240105/vmlinux'),
         'd59307437e4365f2cced0bbd1b04949f7397b282ef349b7cafd894d74aadfbff')
 
     ASSET_BR2_MAC99_ROOTFS = Asset(
-        'https://github.com/legoater/qemu-ppc-boot/raw/refs/heads/main//buildroot/qemu_ppc64_mac99-2023.11-8-gdcd9f0f6eb-20240105/rootfs.ext2',
+        ('https://github.com/legoater/qemu-ppc-boot/raw/refs/heads/main'
+         '/buildroot/qemu_ppc64_mac99-2023.11-8-gdcd9f0f6eb-20240105/rootfs.ext2'),
         'bbd5fd8af62f580bc4e585f326fe584e22856572633a8333178ea6d4ed4955a4')
 
     def test_ppc64_mac99_buildroot(self):
-- 
2.51.0



^ permalink raw reply related	[flat|nested] 24+ messages in thread

* [PULL 12/22] tests/functional/rx/test_gdbsim: Remove unused variables
  2025-11-03 10:57 [PULL 00/22] Functional tests and s390x patches for the softfreeze Thomas Huth
                   ` (10 preceding siblings ...)
  2025-11-03 10:58 ` [PULL 11/22] tests/functional/ppc64/test_mac99: Fix style issues reported by pylint Thomas Huth
@ 2025-11-03 10:58 ` Thomas Huth
  2025-11-03 10:58 ` [PULL 13/22] tests/functional/x86_64/test_acpi_bits: Silence warnings reported by pylint Thomas Huth
                   ` (10 subsequent siblings)
  22 siblings, 0 replies; 24+ messages in thread
From: Thomas Huth @ 2025-11-03 10:58 UTC (permalink / raw)
  To: qemu-devel; +Cc: Richard Henderson, Daniel P. Berrangé

From: Thomas Huth <thuth@redhat.com>

Remove/comment some unused variables to make pylint happy.

Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>
Message-ID: <20251029081805.63147-1-thuth@redhat.com>
---
 tests/functional/rx/test_gdbsim.py | 6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)

diff --git a/tests/functional/rx/test_gdbsim.py b/tests/functional/rx/test_gdbsim.py
index 49245793e17..d31f9a42d67 100755
--- a/tests/functional/rx/test_gdbsim.py
+++ b/tests/functional/rx/test_gdbsim.py
@@ -17,9 +17,6 @@
 
 class RxGdbSimMachine(QemuSystemTest):
 
-    timeout = 30
-    KERNEL_COMMON_COMMAND_LINE = 'printk.time=0 '
-
     ASSET_UBOOT = Asset(
         ('https://github.com/philmd/qemu-testing-blob/raw/rx-gdbsim/rx/gdbsim/'
          'u-boot.bin'),
@@ -47,7 +44,7 @@ def test_uboot(self):
         self.vm.launch()
         uboot_version = 'U-Boot 2016.05-rc3-23705-ga1ef3c71cb-dirty'
         wait_for_console_pattern(self, uboot_version)
-        gcc_version = 'rx-unknown-linux-gcc (GCC) 9.0.0 20181105 (experimental)'
+        #gcc_version = 'rx-unknown-linux-gcc (GCC) 9.0.0 20181105 (experimental)'
         # FIXME limit baudrate on chardev, else we type too fast
         #  https://gitlab.com/qemu-project/qemu/-/issues/2691
         #exec_command_and_wait_for_pattern(self, 'version', gcc_version)
@@ -63,7 +60,6 @@ def test_linux_sash(self):
         kernel_path = self.ASSET_KERNEL.fetch()
 
         self.vm.set_console()
-        kernel_command_line = self.KERNEL_COMMON_COMMAND_LINE + 'earlycon'
         self.vm.add_args('-kernel', kernel_path,
                          '-dtb', dtb_path,
                          '-no-reboot')
-- 
2.51.0



^ permalink raw reply related	[flat|nested] 24+ messages in thread

* [PULL 13/22] tests/functional/x86_64/test_acpi_bits: Silence warnings reported by pylint
  2025-11-03 10:57 [PULL 00/22] Functional tests and s390x patches for the softfreeze Thomas Huth
                   ` (11 preceding siblings ...)
  2025-11-03 10:58 ` [PULL 12/22] tests/functional/rx/test_gdbsim: Remove unused variables Thomas Huth
@ 2025-11-03 10:58 ` Thomas Huth
  2025-11-03 10:58 ` [PULL 14/22] tests/functional/x86_64/test_virtio_balloon: Fix cosmetic issues from pylint Thomas Huth
                   ` (9 subsequent siblings)
  22 siblings, 0 replies; 24+ messages in thread
From: Thomas Huth @ 2025-11-03 10:58 UTC (permalink / raw)
  To: qemu-devel; +Cc: Richard Henderson, Zhao Liu

From: Thomas Huth <thuth@redhat.com>

Pylint complains about too many positional arguments for the __init__
function of the QEMUBitsMachine class, use a "*" to enforce argument
passing by names instead (which the calling sites are doing here already).

Second, use lazy logging when calling self.log.info() with a "%s" format
string, and drop a superfluous "else:" that is not necessary after a
"raise" statement.

Reviewed-by: Zhao Liu <zhao1.liu@intel.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>
Message-ID: <20251029081514.60802-1-thuth@redhat.com>
---
 tests/functional/x86_64/test_acpi_bits.py | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/tests/functional/x86_64/test_acpi_bits.py b/tests/functional/x86_64/test_acpi_bits.py
index 9a2816533d6..ec716d643bf 100755
--- a/tests/functional/x86_64/test_acpi_bits.py
+++ b/tests/functional/x86_64/test_acpi_bits.py
@@ -57,6 +57,7 @@ class QEMUBitsMachine(QEMUMachine): # pylint: disable=too-few-public-methods
     """
     def __init__(self,
                  binary: str,
+                 *,
                  args: Sequence[str] = (),
                  wrapper: Sequence[str] = (),
                  name: Optional[str] = None,
@@ -225,7 +226,7 @@ def generate_bits_iso(self):
                                       stdout=subprocess.PIPE,
                                       stderr=subprocess.STDOUT,
                                       check=True)
-                self.log.info("grub-mkrescue output %s" % proc.stdout)
+                self.log.info("grub-mkrescue output %s", proc.stdout)
             else:
                 subprocess.check_call([mkrescue_script, '-o',
                                       iso_file, bits_dir],
@@ -287,9 +288,8 @@ def parse_log(self):
             except AssertionError as e:
                 self._print_log(log)
                 raise e
-            else:
-                if os.getenv('V') or os.getenv('BITS_DEBUG'):
-                    self._print_log(log)
+            if os.getenv('V') or os.getenv('BITS_DEBUG'):
+                self._print_log(log)
 
     def tearDown(self):
         """
-- 
2.51.0



^ permalink raw reply related	[flat|nested] 24+ messages in thread

* [PULL 14/22] tests/functional/x86_64/test_virtio_balloon: Fix cosmetic issues from pylint
  2025-11-03 10:57 [PULL 00/22] Functional tests and s390x patches for the softfreeze Thomas Huth
                   ` (12 preceding siblings ...)
  2025-11-03 10:58 ` [PULL 13/22] tests/functional/x86_64/test_acpi_bits: Silence warnings reported by pylint Thomas Huth
@ 2025-11-03 10:58 ` Thomas Huth
  2025-11-03 10:58 ` [PULL 15/22] tests/functional/ppc64: Fix class names to silence pylint warnings Thomas Huth
                   ` (8 subsequent siblings)
  22 siblings, 0 replies; 24+ messages in thread
From: Thomas Huth @ 2025-11-03 10:58 UTC (permalink / raw)
  To: qemu-devel; +Cc: Richard Henderson, Zhao Liu, Manos Pitsidianakis

From: Thomas Huth <thuth@redhat.com>

Pylint complains about some style issues in this file: Unused variables
should be marked with an underscore, "when > then and when < now"
can be simplified to "now > when > then" and expectData doesn't conform
to the usual snake_case naming style.

Reviewed-by: Zhao Liu <zhao1.liu@intel.com>
Reviewed-by: Manos Pitsidianakis <manos.pitsidianakis@linaro.org>
Signed-off-by: Thomas Huth <thuth@redhat.com>
Message-ID: <20251029075342.47335-1-thuth@redhat.com>
---
 tests/functional/x86_64/test_virtio_balloon.py | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/tests/functional/x86_64/test_virtio_balloon.py b/tests/functional/x86_64/test_virtio_balloon.py
index 5877b6c408c..7a579e0d69a 100755
--- a/tests/functional/x86_64/test_virtio_balloon.py
+++ b/tests/functional/x86_64/test_virtio_balloon.py
@@ -66,7 +66,7 @@ def assert_initial_stats(self):
         when = ret.get('last-update')
         assert when == 0
         stats = ret.get('stats')
-        for name, val in stats.items():
+        for _name, val in stats.items():
             assert val == UNSET_STATS_VALUE
 
     def assert_running_stats(self, then):
@@ -87,10 +87,10 @@ def assert_running_stats(self, then):
 
         now = time.time()
 
-        assert when > then and when < now
+        assert now > when > then
         stats = ret.get('stats')
         # Stat we expect this particular Kernel to have set
-        expectData = [
+        expect_data = [
             "stat-available-memory",
             "stat-disk-caches",
             "stat-free-memory",
@@ -103,7 +103,7 @@ def assert_running_stats(self, then):
             "stat-total-memory",
         ]
         for name, val in stats.items():
-            if name in expectData:
+            if name in expect_data:
                 assert val != UNSET_STATS_VALUE
             else:
                 assert val == UNSET_STATS_VALUE
-- 
2.51.0



^ permalink raw reply related	[flat|nested] 24+ messages in thread

* [PULL 15/22] tests/functional/ppc64: Fix class names to silence pylint warnings
  2025-11-03 10:57 [PULL 00/22] Functional tests and s390x patches for the softfreeze Thomas Huth
                   ` (13 preceding siblings ...)
  2025-11-03 10:58 ` [PULL 14/22] tests/functional/x86_64/test_virtio_balloon: Fix cosmetic issues from pylint Thomas Huth
@ 2025-11-03 10:58 ` Thomas Huth
  2025-11-03 10:58 ` [PULL 16/22] tests/functional: include logger name and function in messages Thomas Huth
                   ` (7 subsequent siblings)
  22 siblings, 0 replies; 24+ messages in thread
From: Thomas Huth @ 2025-11-03 10:58 UTC (permalink / raw)
  To: qemu-devel; +Cc: Richard Henderson, Glenn Miles

From: Thomas Huth <thuth@redhat.com>

Pylint complains about inconsistent CamelCase names here, so let's
slightly change the names to make pylint happy again.

In the sam460ex test, also split a line where pylint was complaining
about it being too long.

Reviewed-by: Glenn Miles <milesg@linux.ibm.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>
Message-ID: <20251029141946.86110-1-thuth@redhat.com>
---
 tests/functional/ppc/test_74xx.py            | 2 +-
 tests/functional/ppc/test_sam460ex.py        | 5 +++--
 tests/functional/ppc64/test_powernv.py       | 2 +-
 tests/functional/ppc64/test_pseries.py       | 2 +-
 tests/functional/ppc64/test_reverse_debug.py | 2 +-
 5 files changed, 7 insertions(+), 6 deletions(-)

diff --git a/tests/functional/ppc/test_74xx.py b/tests/functional/ppc/test_74xx.py
index 5386016f261..219c7991aca 100755
--- a/tests/functional/ppc/test_74xx.py
+++ b/tests/functional/ppc/test_74xx.py
@@ -10,7 +10,7 @@
 from qemu_test import QemuSystemTest
 from qemu_test import wait_for_console_pattern
 
-class ppc74xxCpu(QemuSystemTest):
+class Ppc74xxCpu(QemuSystemTest):
 
     timeout = 5
 
diff --git a/tests/functional/ppc/test_sam460ex.py b/tests/functional/ppc/test_sam460ex.py
index 31cf9dd6de8..024406d155c 100755
--- a/tests/functional/ppc/test_sam460ex.py
+++ b/tests/functional/ppc/test_sam460ex.py
@@ -8,10 +8,11 @@
 from qemu_test import exec_command_and_wait_for_pattern
 
 
-class sam460exTest(LinuxKernelTest):
+class Sam460exTest(LinuxKernelTest):
 
     ASSET_BR2_SAM460EX_LINUX = Asset(
-        'https://github.com/legoater/qemu-ppc-boot/raw/refs/heads/main/buildroot/qemu_ppc_sam460ex-2023.11-8-gdcd9f0f6eb-20240105/vmlinux',
+        ('https://github.com/legoater/qemu-ppc-boot/raw/refs/heads/main'
+         '/buildroot/qemu_ppc_sam460ex-2023.11-8-gdcd9f0f6eb-20240105/vmlinux'),
         '6f46346f3e20e8b5fc050ff363f350f8b9d76a051b9e0bd7ea470cc680c14df2')
 
     def test_ppc_sam460ex_buildroot(self):
diff --git a/tests/functional/ppc64/test_powernv.py b/tests/functional/ppc64/test_powernv.py
index 9ada832b781..0ea6c93e428 100755
--- a/tests/functional/ppc64/test_powernv.py
+++ b/tests/functional/ppc64/test_powernv.py
@@ -10,7 +10,7 @@
 from qemu_test import LinuxKernelTest, Asset
 from qemu_test import wait_for_console_pattern
 
-class powernvMachine(LinuxKernelTest):
+class PowernvMachine(LinuxKernelTest):
 
     timeout = 90
     KERNEL_COMMON_COMMAND_LINE = 'printk.time=0 console=hvc0 '
diff --git a/tests/functional/ppc64/test_pseries.py b/tests/functional/ppc64/test_pseries.py
index 67057934e8d..7840c4e3ff8 100755
--- a/tests/functional/ppc64/test_pseries.py
+++ b/tests/functional/ppc64/test_pseries.py
@@ -10,7 +10,7 @@
 from qemu_test import QemuSystemTest, Asset
 from qemu_test import wait_for_console_pattern
 
-class pseriesMachine(QemuSystemTest):
+class PseriesMachine(QemuSystemTest):
 
     timeout = 90
     KERNEL_COMMON_COMMAND_LINE = 'printk.time=0 console=hvc0 '
diff --git a/tests/functional/ppc64/test_reverse_debug.py b/tests/functional/ppc64/test_reverse_debug.py
index 69551fb84df..4eef779936d 100755
--- a/tests/functional/ppc64/test_reverse_debug.py
+++ b/tests/functional/ppc64/test_reverse_debug.py
@@ -18,7 +18,7 @@
 from reverse_debugging import ReverseDebugging
 
 
-class ReverseDebugging_ppc64(ReverseDebugging):
+class ReverseDebuggingPpc64(ReverseDebugging):
 
     @skipFlakyTest("https://gitlab.com/qemu-project/qemu/-/issues/1992")
     def test_ppc64_pseries(self):
-- 
2.51.0



^ permalink raw reply related	[flat|nested] 24+ messages in thread

* [PULL 16/22] tests/functional: include logger name and function in messages
  2025-11-03 10:57 [PULL 00/22] Functional tests and s390x patches for the softfreeze Thomas Huth
                   ` (14 preceding siblings ...)
  2025-11-03 10:58 ` [PULL 15/22] tests/functional/ppc64: Fix class names to silence pylint warnings Thomas Huth
@ 2025-11-03 10:58 ` Thomas Huth
  2025-11-03 10:58 ` [PULL 17/22] tests/functional: include the lower level QMP log messages Thomas Huth
                   ` (6 subsequent siblings)
  22 siblings, 0 replies; 24+ messages in thread
From: Thomas Huth @ 2025-11-03 10:58 UTC (permalink / raw)
  To: qemu-devel; +Cc: Richard Henderson, Daniel P. Berrangé

From: Daniel P. Berrangé <berrange@redhat.com>

As we collect debug logs from a wide range of code it becomes
increasingly confusing to understand where each log messages comes
from. Adding "%(name)s" gives us the logger name, which is usually
based on the python __name__ symbol, aka the code module name.
Then "%(funcName)s" completes the story by identifying the function.

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
Reviewed-by: Thomas Huth <thuth@redhat.com>
Message-ID: <20251028182651.873256-2-berrange@redhat.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>
---
 tests/functional/qemu_test/testcase.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tests/functional/qemu_test/testcase.py b/tests/functional/qemu_test/testcase.py
index a122acb5609..d9d114e63e3 100644
--- a/tests/functional/qemu_test/testcase.py
+++ b/tests/functional/qemu_test/testcase.py
@@ -217,7 +217,7 @@ def setUp(self):
         self._log_fh = logging.FileHandler(self.log_filename, mode='w')
         self._log_fh.setLevel(logging.DEBUG)
         fileFormatter = logging.Formatter(
-            '%(asctime)s - %(levelname)s: %(message)s')
+            '%(asctime)s - %(levelname)s: %(name)s.%(funcName)s %(message)s')
         self._log_fh.setFormatter(fileFormatter)
         self.log.addHandler(self._log_fh)
 
-- 
2.51.0



^ permalink raw reply related	[flat|nested] 24+ messages in thread

* [PULL 17/22] tests/functional: include the lower level QMP log messages
  2025-11-03 10:57 [PULL 00/22] Functional tests and s390x patches for the softfreeze Thomas Huth
                   ` (15 preceding siblings ...)
  2025-11-03 10:58 ` [PULL 16/22] tests/functional: include logger name and function in messages Thomas Huth
@ 2025-11-03 10:58 ` Thomas Huth
  2025-11-03 10:58 ` [PULL 18/22] hw/s390x: Use memory_region_size() Thomas Huth
                   ` (5 subsequent siblings)
  22 siblings, 0 replies; 24+ messages in thread
From: Thomas Huth @ 2025-11-03 10:58 UTC (permalink / raw)
  To: qemu-devel; +Cc: Richard Henderson, Daniel P. Berrangé

From: Daniel P. Berrangé <berrange@redhat.com>

We've seen a GitLab CI timeout failure in the test_pseries.py test,
where it appears likely that the test has hung in a self.qmp('quit')
call, but we don't have conclusive proof. Adding the QMP log category
to what we capture should help us diagnose this, at the cost of the
base.log file becoming significantly more verbose. The previous
commit to include the logger category name and function should at
least help understanding the more verbose logs.

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
Reviewed-by: Thomas Huth <thuth@redhat.com>
Message-ID: <20251028182651.873256-3-berrange@redhat.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>
---
 tests/functional/qemu_test/testcase.py | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/tests/functional/qemu_test/testcase.py b/tests/functional/qemu_test/testcase.py
index d9d114e63e3..1d773dd697d 100644
--- a/tests/functional/qemu_test/testcase.py
+++ b/tests/functional/qemu_test/testcase.py
@@ -225,6 +225,9 @@ def setUp(self):
         self.machinelog = logging.getLogger('qemu.machine')
         self.machinelog.setLevel(logging.DEBUG)
         self.machinelog.addHandler(self._log_fh)
+        self.qmplog = logging.getLogger('qemu.qmp')
+        self.qmplog.setLevel(logging.DEBUG)
+        self.qmplog.addHandler(self._log_fh)
 
         if not self.assets_available():
             self.skipTest('One or more assets is not available')
@@ -235,6 +238,7 @@ def tearDown(self):
         if self.socketdir is not None:
             self.socketdir.cleanup()
             self.socketdir = None
+        self.qmplog.removeHandler(self._log_fh)
         self.machinelog.removeHandler(self._log_fh)
         self.log.removeHandler(self._log_fh)
         self._log_fh.close()
-- 
2.51.0



^ permalink raw reply related	[flat|nested] 24+ messages in thread

* [PULL 18/22] hw/s390x: Use memory_region_size()
  2025-11-03 10:57 [PULL 00/22] Functional tests and s390x patches for the softfreeze Thomas Huth
                   ` (16 preceding siblings ...)
  2025-11-03 10:58 ` [PULL 17/22] tests/functional: include the lower level QMP log messages Thomas Huth
@ 2025-11-03 10:58 ` Thomas Huth
  2025-11-03 10:58 ` [PULL 19/22] target/s390x: Fix missing interrupts for small CKC values Thomas Huth
                   ` (4 subsequent siblings)
  22 siblings, 0 replies; 24+ messages in thread
From: Thomas Huth @ 2025-11-03 10:58 UTC (permalink / raw)
  To: qemu-devel
  Cc: Richard Henderson, Philippe Mathieu-Daudé, David Hildenbrand

From: Philippe Mathieu-Daudé <philmd@linaro.org>

MemoryRegion::size is private data of MemoryRegion,
use the proper memory_region_size() getter to get it.

Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Message-ID: <20251028181300.41475-10-philmd@linaro.org>
Reviewed-by: Thomas Huth <thuth@redhat.com>
Reviewed-by: David Hildenbrand <david@redhat.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>
---
 hw/s390x/s390-pci-inst.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/hw/s390x/s390-pci-inst.c b/hw/s390x/s390-pci-inst.c
index a3bb5aa2216..5841dfc4fec 100644
--- a/hw/s390x/s390-pci-inst.c
+++ b/hw/s390x/s390-pci-inst.c
@@ -396,7 +396,7 @@ static MemoryRegion *s390_get_subregion(MemoryRegion *mr, uint64_t offset,
     uint64_t subregion_size;
 
     QTAILQ_FOREACH(subregion, &mr->subregions, subregions_link) {
-        subregion_size = int128_get64(subregion->size);
+        subregion_size = memory_region_size(subregion);
         if ((offset >= subregion->addr) &&
             (offset + len) <= (subregion->addr + subregion_size)) {
             mr = subregion;
-- 
2.51.0



^ permalink raw reply related	[flat|nested] 24+ messages in thread

* [PULL 19/22] target/s390x: Fix missing interrupts for small CKC values
  2025-11-03 10:57 [PULL 00/22] Functional tests and s390x patches for the softfreeze Thomas Huth
                   ` (17 preceding siblings ...)
  2025-11-03 10:58 ` [PULL 18/22] hw/s390x: Use memory_region_size() Thomas Huth
@ 2025-11-03 10:58 ` Thomas Huth
  2025-11-03 10:58 ` [PULL 20/22] target/s390x: Fix missing clock-comparator interrupts after reset Thomas Huth
                   ` (3 subsequent siblings)
  22 siblings, 0 replies; 24+ messages in thread
From: Thomas Huth @ 2025-11-03 10:58 UTC (permalink / raw)
  To: qemu-devel; +Cc: Richard Henderson, qemu-stable, Ilya Leoshkevich

From: Ilya Leoshkevich <iii@linux.ibm.com>

Suppose TOD clock value is 0x1111111111111111 and clock-comparator
value is 0, in which case clock-comparator interruption should occur
immediately.

With the current code, tod2time(env->ckc - td->base.low) ends up being
a very large number, so this interruption never happens.

Fix by firing the timer immediately if env->ckc < td->base.low.

Cc: qemu-stable@nongnu.org
Reviewed-by: Thomas Huth <thuth@redhat.com>
Signed-off-by: Ilya Leoshkevich <iii@linux.ibm.com>
Message-ID: <20251016175954.41153-2-iii@linux.ibm.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>
---
 target/s390x/tcg/misc_helper.c | 12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)

diff --git a/target/s390x/tcg/misc_helper.c b/target/s390x/tcg/misc_helper.c
index 6d9d601d29a..215b5b9d933 100644
--- a/target/s390x/tcg/misc_helper.c
+++ b/target/s390x/tcg/misc_helper.c
@@ -199,11 +199,15 @@ static void update_ckc_timer(CPUS390XState *env)
         return;
     }
 
-    /* difference between origins */
-    time = env->ckc - td->base.low;
+    if (env->ckc < td->base.low) {
+        time = 0;
+    } else {
+        /* difference between origins */
+        time = env->ckc - td->base.low;
 
-    /* nanoseconds */
-    time = tod2time(time);
+        /* nanoseconds */
+        time = tod2time(time);
+    }
 
     timer_mod(env->tod_timer, time);
 }
-- 
2.51.0



^ permalink raw reply related	[flat|nested] 24+ messages in thread

* [PULL 20/22] target/s390x: Fix missing clock-comparator interrupts after reset
  2025-11-03 10:57 [PULL 00/22] Functional tests and s390x patches for the softfreeze Thomas Huth
                   ` (18 preceding siblings ...)
  2025-11-03 10:58 ` [PULL 19/22] target/s390x: Fix missing interrupts for small CKC values Thomas Huth
@ 2025-11-03 10:58 ` Thomas Huth
  2025-11-03 10:58 ` [PULL 21/22] target/s390x: Use address generation for register branch targets Thomas Huth
                   ` (2 subsequent siblings)
  22 siblings, 0 replies; 24+ messages in thread
From: Thomas Huth @ 2025-11-03 10:58 UTC (permalink / raw)
  To: qemu-devel; +Cc: Richard Henderson, qemu-stable, Ilya Leoshkevich

From: Ilya Leoshkevich <iii@linux.ibm.com>

After reset, CKC value is set to 0, so if clock-comparator interrupts
are enabled, one should occur very shortly thereafter.

Currently the code that loads the respective control register does not
set tod_timer, so this does not happen.

Fix by adding a tcg_s390_tod_updated() call to LCTL and LCTLG.

Cc: qemu-stable@nongnu.org
Suggested-by: Thomas Huth <thuth@redhat.com>
Reviewed-by: Thomas Huth <thuth@redhat.com>
Signed-off-by: Ilya Leoshkevich <iii@linux.ibm.com>
Message-ID: <20251016175954.41153-3-iii@linux.ibm.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>
---
 target/s390x/tcg/mem_helper.c | 11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)

diff --git a/target/s390x/tcg/mem_helper.c b/target/s390x/tcg/mem_helper.c
index f1acb1618f7..24675fc818d 100644
--- a/target/s390x/tcg/mem_helper.c
+++ b/target/s390x/tcg/mem_helper.c
@@ -1959,6 +1959,10 @@ void HELPER(lctlg)(CPUS390XState *env, uint32_t r1, uint64_t a2, uint32_t r3)
         if (env->cregs[i] != val && i >= 9 && i <= 11) {
             PERchanged = true;
         }
+        if (i == 0 && !(env->cregs[i] & CR0_CKC_SC) && (val & CR0_CKC_SC)) {
+            BQL_LOCK_GUARD();
+            tcg_s390_tod_updated(env_cpu(env), RUN_ON_CPU_NULL);
+        }
         env->cregs[i] = val;
         HELPER_LOG("load ctl %d from 0x%" PRIx64 " == 0x%" PRIx64 "\n",
                    i, src, val);
@@ -1989,10 +1993,15 @@ void HELPER(lctl)(CPUS390XState *env, uint32_t r1, uint64_t a2, uint32_t r3)
 
     for (i = r1;; i = (i + 1) % 16) {
         uint32_t val = cpu_ldl_data_ra(env, src, ra);
+        uint64_t val64 = deposit64(env->cregs[i], 0, 32, val);
         if ((uint32_t)env->cregs[i] != val && i >= 9 && i <= 11) {
             PERchanged = true;
         }
-        env->cregs[i] = deposit64(env->cregs[i], 0, 32, val);
+        if (i == 0 && !(env->cregs[i] & CR0_CKC_SC) && (val64 & CR0_CKC_SC)) {
+            BQL_LOCK_GUARD();
+            tcg_s390_tod_updated(env_cpu(env), RUN_ON_CPU_NULL);
+        }
+        env->cregs[i] = val64;
         HELPER_LOG("load ctl %d from 0x%" PRIx64 " == 0x%x\n", i, src, val);
         src += sizeof(uint32_t);
 
-- 
2.51.0



^ permalink raw reply related	[flat|nested] 24+ messages in thread

* [PULL 21/22] target/s390x: Use address generation for register branch targets
  2025-11-03 10:57 [PULL 00/22] Functional tests and s390x patches for the softfreeze Thomas Huth
                   ` (19 preceding siblings ...)
  2025-11-03 10:58 ` [PULL 20/22] target/s390x: Fix missing clock-comparator interrupts after reset Thomas Huth
@ 2025-11-03 10:58 ` Thomas Huth
  2025-11-03 10:58 ` [PULL 22/22] tests/tcg/s390x: Test SET CLOCK COMPARATOR Thomas Huth
  2025-11-04 13:57 ` [PULL 00/22] Functional tests and s390x patches for the softfreeze Richard Henderson
  22 siblings, 0 replies; 24+ messages in thread
From: Thomas Huth @ 2025-11-03 10:58 UTC (permalink / raw)
  To: qemu-devel
  Cc: Richard Henderson, Thomas Weißschuh, Heiko Carstens,
	qemu-stable, Ilya Leoshkevich

From: Ilya Leoshkevich <iii@linux.ibm.com>

Indirect branches to addresses taken from registers go through address
generation, e.g., for BRANCH ON CONDITION Principles of Operation says:

    In the RR format, the contents of general register R2 are used to
    generate the branch address

QEMU uses r2_nz handler for the respective register operands. Currently
it does not zero out extra bits in 24- and 31-bit addressing modes as
required by address generation. The very frequently used
s390x_tr_init_disas_context() function has a workaround for this,
but the code for saving an old PSW during an interrupt does not.

Add the missing masking to r2_nz. Enforce PSW validity by replacing the
workaround with an assertion.

Reported-by: Thomas Weißschuh <linux@weissschuh.net>
Reported-by: Heiko Carstens <hca@linux.ibm.com>
Link: https://lore.kernel.org/lkml/ab3131a2-c42a-47ff-bf03-e9f68ac053c0@t-8ch.de/
Cc: qemu-stable@nongnu.org
Signed-off-by: Ilya Leoshkevich <iii@linux.ibm.com>
Tested-by: Thomas Weißschuh <linux@weissschuh.net>
Message-ID: <20251016175954.41153-4-iii@linux.ibm.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>
---
 target/s390x/tcg/translate.c | 11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)

diff --git a/target/s390x/tcg/translate.c b/target/s390x/tcg/translate.c
index ec9e5a07516..4d2b8c5e2be 100644
--- a/target/s390x/tcg/translate.c
+++ b/target/s390x/tcg/translate.c
@@ -5613,6 +5613,7 @@ static void in2_r2_nz(DisasContext *s, DisasOps *o)
     int r2 = get_field(s, r2);
     if (r2 != 0) {
         o->in2 = load_reg(r2);
+        gen_addi_and_wrap_i64(s, o->in2, o->in2, 0);
     }
 }
 #define SPEC_in2_r2_nz 0
@@ -6379,10 +6380,12 @@ static void s390x_tr_init_disas_context(DisasContextBase *dcbase, CPUState *cs)
 {
     DisasContext *dc = container_of(dcbase, DisasContext, base);
 
-    /* 31-bit mode */
-    if (!(dc->base.tb->flags & FLAG_MASK_64)) {
-        dc->base.pc_first &= 0x7fffffff;
-        dc->base.pc_next = dc->base.pc_first;
+    if (dc->base.tb->flags & FLAG_MASK_32) {
+        if (!(dc->base.tb->flags & FLAG_MASK_64)) {
+            assert(!(dc->base.pc_first & ~((1ULL << 31) - 1)));
+        }
+    } else {
+        assert(!(dc->base.pc_first & ~((1ULL << 24) - 1)));
     }
 
     dc->cc_op = CC_OP_DYNAMIC;
-- 
2.51.0



^ permalink raw reply related	[flat|nested] 24+ messages in thread

* [PULL 22/22] tests/tcg/s390x: Test SET CLOCK COMPARATOR
  2025-11-03 10:57 [PULL 00/22] Functional tests and s390x patches for the softfreeze Thomas Huth
                   ` (20 preceding siblings ...)
  2025-11-03 10:58 ` [PULL 21/22] target/s390x: Use address generation for register branch targets Thomas Huth
@ 2025-11-03 10:58 ` Thomas Huth
  2025-11-04 13:57 ` [PULL 00/22] Functional tests and s390x patches for the softfreeze Richard Henderson
  22 siblings, 0 replies; 24+ messages in thread
From: Thomas Huth @ 2025-11-03 10:58 UTC (permalink / raw)
  To: qemu-devel; +Cc: Richard Henderson, qemu-stable, Ilya Leoshkevich

From: Ilya Leoshkevich <iii@linux.ibm.com>

Add a small test to prevent regressions.

Cc: qemu-stable@nongnu.org
Reviewed-by: Thomas Huth <thuth@redhat.com>
Signed-off-by: Ilya Leoshkevich <iii@linux.ibm.com>
Message-ID: <20251016175954.41153-5-iii@linux.ibm.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>
---
 tests/tcg/s390x/Makefile.softmmu-target |  1 +
 tests/tcg/s390x/sckc.S                  | 63 +++++++++++++++++++++++++
 2 files changed, 64 insertions(+)
 create mode 100644 tests/tcg/s390x/sckc.S

diff --git a/tests/tcg/s390x/Makefile.softmmu-target b/tests/tcg/s390x/Makefile.softmmu-target
index 8cd4667c63b..a4425d3184a 100644
--- a/tests/tcg/s390x/Makefile.softmmu-target
+++ b/tests/tcg/s390x/Makefile.softmmu-target
@@ -28,6 +28,7 @@ ASM_TESTS =                                                                    \
     mc                                                                         \
     per                                                                        \
     precise-smc-softmmu                                                        \
+    sckc                                                                       \
     ssm-early                                                                  \
     stosm-early                                                                \
     stpq                                                                       \
diff --git a/tests/tcg/s390x/sckc.S b/tests/tcg/s390x/sckc.S
new file mode 100644
index 00000000000..ecd64a3059e
--- /dev/null
+++ b/tests/tcg/s390x/sckc.S
@@ -0,0 +1,63 @@
+/*
+ * Test clock comparator.
+ *
+ * SPDX-License-Identifier: GPL-2.0-or-later
+ */
+    .org 0x130
+ext_old_psw:
+    .org 0x1b0
+ext_new_psw:
+    .quad 0x180000000, _ext            /* 64-bit mode */
+    .org 0x1d0
+pgm_new_psw:
+    .quad 0x2000000000000,0            /* disabled wait */
+    .org 0x200                         /* lowcore padding */
+
+    .globl _start
+_start:
+    lpswe start31_psw
+_start31:
+    stctg %c0,%c0,c0
+    oi c0+6,8                          /* set clock-comparator subclass mask */
+    lctlg %c0,%c0,c0
+
+0:
+    brasl %r14,_f                      /* %r14's most significant bit is 1 */
+    jg 0b
+_f:
+    br %r14                            /* it must not end up in ext_old_psw */
+
+_ext:
+    stg %r0,ext_saved_r0
+
+    lg %r0,ext_counter
+    aghi %r0,1
+    stg %r0,ext_counter
+
+    cgfi %r0,0x1000
+    jnz 0f
+    lpswe success_psw
+0:
+
+    stck clock
+    lg %r0,clock
+    agfi %r0,0x40000                   /* 64us * 0x1000 =~ 0.25s */
+    stg %r0,clock
+    sckc clock
+
+    lg %r0,ext_saved_r0
+    lpswe ext_old_psw
+
+    .align 8
+start31_psw:
+    .quad 0x100000080000000,_start31   /* EX, 31-bit mode */
+success_psw:
+    .quad 0x2000000000000,0xfff        /* see is_special_wait_psw() */
+c0:
+    .skip 8
+clock:
+    .quad 0
+ext_counter:
+    .quad 0
+ext_saved_r0:
+    .skip 8
-- 
2.51.0



^ permalink raw reply related	[flat|nested] 24+ messages in thread

* Re: [PULL 00/22] Functional tests and s390x patches for the softfreeze
  2025-11-03 10:57 [PULL 00/22] Functional tests and s390x patches for the softfreeze Thomas Huth
                   ` (21 preceding siblings ...)
  2025-11-03 10:58 ` [PULL 22/22] tests/tcg/s390x: Test SET CLOCK COMPARATOR Thomas Huth
@ 2025-11-04 13:57 ` Richard Henderson
  22 siblings, 0 replies; 24+ messages in thread
From: Richard Henderson @ 2025-11-04 13:57 UTC (permalink / raw)
  To: Thomas Huth, qemu-devel

On 11/3/25 11:57, Thomas Huth wrote:
>   Hi Richard!
> 
> The following changes since commit 53b41bb78950912ba2d9809eef6b45e4df30c647:
> 
>    Merge tag 'pull-target-arm-20251031' ofhttps://gitlab.com/pm215/qemu into staging (2025-11-01 10:52:48 +0100)
> 
> are available in the Git repository at:
> 
>    https://gitlab.com/thuth/qemu.git tags/pull-request-2025-11-03
> 
> for you to fetch changes up to 0408c61e27aca56c2d40aeb6ca0e5c5f8b8c3845:
> 
>    tests/tcg/s390x: Test SET CLOCK COMPARATOR (2025-11-03 08:27:59 +0100)
> 
> ----------------------------------------------------------------
> * Fix spurious EOFError messages from the device-crash-test script
> * Fix various issues in the functional tests that pylint complained about
> * Improve logging information in the functional tests
> * Fix issue in the s390x clock-comparator code
> * Use address generation for register branch targets on s390x

Applied, thanks.  Please update https://wiki.qemu.org/ChangeLog/10.2 as appropriate.

r~


^ permalink raw reply	[flat|nested] 24+ messages in thread

end of thread, other threads:[~2025-11-04 13:57 UTC | newest]

Thread overview: 24+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-11-03 10:57 [PULL 00/22] Functional tests and s390x patches for the softfreeze Thomas Huth
2025-11-03 10:57 ` [PULL 01/22] scripts/device-crash-test: fix spurious EOFError messages Thomas Huth
2025-11-03 10:57 ` [PULL 02/22] tests/functional: Fix problems in asset.py reported by pylint Thomas Huth
2025-11-03 10:58 ` [PULL 03/22] tests/functional: Fix problems in decorators.py " Thomas Huth
2025-11-03 10:58 ` [PULL 04/22] tests/functional: Fix problems in linuxkernel.py " Thomas Huth
2025-11-03 10:58 ` [PULL 05/22] tests/functional: Fix problems in uncompress.py " Thomas Huth
2025-11-03 10:58 ` [PULL 06/22] tests/functional: Fix problems in utils.py " Thomas Huth
2025-11-03 10:58 ` [PULL 07/22] tests/functional/arm/test_aspeed_ast1030: Remove unused import Thomas Huth
2025-11-03 10:58 ` [PULL 08/22] tests/functional/.../testcase.py: better socketdir cleanup Thomas Huth
2025-11-03 10:58 ` [PULL 09/22] MAINTAINERS: fix functional tests section Thomas Huth
2025-11-03 10:58 ` [PULL 10/22] tests/functional/migration: Fix bad indentation Thomas Huth
2025-11-03 10:58 ` [PULL 11/22] tests/functional/ppc64/test_mac99: Fix style issues reported by pylint Thomas Huth
2025-11-03 10:58 ` [PULL 12/22] tests/functional/rx/test_gdbsim: Remove unused variables Thomas Huth
2025-11-03 10:58 ` [PULL 13/22] tests/functional/x86_64/test_acpi_bits: Silence warnings reported by pylint Thomas Huth
2025-11-03 10:58 ` [PULL 14/22] tests/functional/x86_64/test_virtio_balloon: Fix cosmetic issues from pylint Thomas Huth
2025-11-03 10:58 ` [PULL 15/22] tests/functional/ppc64: Fix class names to silence pylint warnings Thomas Huth
2025-11-03 10:58 ` [PULL 16/22] tests/functional: include logger name and function in messages Thomas Huth
2025-11-03 10:58 ` [PULL 17/22] tests/functional: include the lower level QMP log messages Thomas Huth
2025-11-03 10:58 ` [PULL 18/22] hw/s390x: Use memory_region_size() Thomas Huth
2025-11-03 10:58 ` [PULL 19/22] target/s390x: Fix missing interrupts for small CKC values Thomas Huth
2025-11-03 10:58 ` [PULL 20/22] target/s390x: Fix missing clock-comparator interrupts after reset Thomas Huth
2025-11-03 10:58 ` [PULL 21/22] target/s390x: Use address generation for register branch targets Thomas Huth
2025-11-03 10:58 ` [PULL 22/22] tests/tcg/s390x: Test SET CLOCK COMPARATOR Thomas Huth
2025-11-04 13:57 ` [PULL 00/22] Functional tests and s390x patches for the softfreeze Richard Henderson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).