qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Alex Bennée" <alex.bennee@linaro.org>
To: qemu-devel@nongnu.org
Cc: fam@euphon.net, "Peter Maydell" <peter.maydell@linaro.org>,
	berrange@redhat.com, stefanha@redhat.com,
	"open list:Virt" <qemu-arm@nongnu.org>,
	crosa@redhat.com,
	"Richard Henderson" <richard.henderson@linaro.org>,
	aaron@os.amperecomputing.com, robhenry@microsoft.com,
	f4bug@amsat.org, mahmoudabdalghany@outlook.com, minyihh@uci.edu,
	cota@braap.org,
	"Wainer dos Santos Moschetta" <wainersm@redhat.com>,
	Luke.Craig@ll.mit.edu, pbonzini@redhat.com,
	kuhn.chenqun@huawei.com, ma.mandourr@gmail.com,
	"Alex Bennée" <alex.bennee@linaro.org>,
	aurelien@aurel32.net, "Beraldo Leal" <bleal@redhat.com>
Subject: [PATCH v1 01/15] tests/avocado: update aarch64_virt test to exercise -cpu max
Date: Fri,  8 Apr 2022 17:47:28 +0100	[thread overview]
Message-ID: <20220408164742.2844631-2-alex.bennee@linaro.org> (raw)
In-Reply-To: <20220408164742.2844631-1-alex.bennee@linaro.org>

The Fedora 29 kernel is quite old and importantly fails when running
in LPA2 scenarios. As it's not really exercising much of the CPU space
replace it with a custom 5.16.12 kernel with all the architecture
options turned on. There is a minimal buildroot initramfs included in
the kernel which has a few tools for stress testing the memory
subsystem. The userspace also targets the Neoverse N1 processor so
would fail with a v8.0 cpu like cortex-a53.

While we are at it move the test into its own file so it can have an
assigned maintainer.

Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
Acked-by: Richard Henderson <richard.henderson@linaro.org>
Tested-by: Richard Henderson <richard.henderson@linaro.org>
Message-Id: <20220315121251.2280317-3-alex.bennee@linaro.org>

---
v2
  - move test into own machine file
v3
  - minor reword of commit, added tags
---
 MAINTAINERS                           |  1 +
 tests/avocado/boot_linux_console.py   | 25 -------------
 tests/avocado/machine_aarch64_virt.py | 51 +++++++++++++++++++++++++++
 3 files changed, 52 insertions(+), 25 deletions(-)
 create mode 100644 tests/avocado/machine_aarch64_virt.py

diff --git a/MAINTAINERS b/MAINTAINERS
index 4ad2451e03..dcedfaed1f 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -942,6 +942,7 @@ S: Maintained
 F: hw/arm/virt*
 F: include/hw/arm/virt.h
 F: docs/system/arm/virt.rst
+F: tests/avocado/machine_aarch64_virt.py
 
 Xilinx Zynq
 M: Edgar E. Iglesias <edgar.iglesias@gmail.com>
diff --git a/tests/avocado/boot_linux_console.py b/tests/avocado/boot_linux_console.py
index b40a3abc81..45a2ceda22 100644
--- a/tests/avocado/boot_linux_console.py
+++ b/tests/avocado/boot_linux_console.py
@@ -325,31 +325,6 @@ def test_mips_malta32el_nanomips_64k_dbg(self):
         kernel_hash = '18d1c68f2e23429e266ca39ba5349ccd0aeb7180'
         self.do_test_mips_malta32el_nanomips(kernel_url, kernel_hash)
 
-    def test_aarch64_virt(self):
-        """
-        :avocado: tags=arch:aarch64
-        :avocado: tags=machine:virt
-        :avocado: tags=accel:tcg
-        :avocado: tags=cpu:cortex-a53
-        """
-        kernel_url = ('https://archives.fedoraproject.org/pub/archive/fedora'
-                      '/linux/releases/29/Everything/aarch64/os/images/pxeboot'
-                      '/vmlinuz')
-        kernel_hash = '8c73e469fc6ea06a58dc83a628fc695b693b8493'
-        kernel_path = self.fetch_asset(kernel_url, asset_hash=kernel_hash)
-
-        self.vm.set_console()
-        kernel_command_line = (self.KERNEL_COMMON_COMMAND_LINE +
-                               'console=ttyAMA0')
-        self.require_accelerator("tcg")
-        self.vm.add_args('-cpu', 'cortex-a53',
-                         '-accel', 'tcg',
-                         '-kernel', kernel_path,
-                         '-append', kernel_command_line)
-        self.vm.launch()
-        console_pattern = 'Kernel command line: %s' % kernel_command_line
-        self.wait_for_console_pattern(console_pattern)
-
     def test_aarch64_xlnx_versal_virt(self):
         """
         :avocado: tags=arch:aarch64
diff --git a/tests/avocado/machine_aarch64_virt.py b/tests/avocado/machine_aarch64_virt.py
new file mode 100644
index 0000000000..21848cba70
--- /dev/null
+++ b/tests/avocado/machine_aarch64_virt.py
@@ -0,0 +1,51 @@
+# Functional test that boots a Linux kernel and checks the console
+#
+# Copyright (c) 2022 Linaro Ltd.
+#
+# Author:
+#  Alex Bennée <alex.bennee@linaro.org>
+#
+# SPDX-License-Identifier: GPL-2.0-or-later
+
+import time
+
+from avocado_qemu import QemuSystemTest
+from avocado_qemu import wait_for_console_pattern
+from avocado_qemu import exec_command
+
+class Aarch64VirtMachine(QemuSystemTest):
+    KERNEL_COMMON_COMMAND_LINE = 'printk.time=0 '
+
+    def wait_for_console_pattern(self, success_message, vm=None):
+        wait_for_console_pattern(self, success_message,
+                                 failure_message='Kernel panic - not syncing',
+                                 vm=vm)
+
+    def test_aarch64_virt(self):
+        """
+        :avocado: tags=arch:aarch64
+        :avocado: tags=machine:virt
+        :avocado: tags=accel:tcg
+        :avocado: tags=cpu:max
+        """
+        kernel_url = ('https://fileserver.linaro.org/s/'
+                      'z6B2ARM7DQT3HWN/download')
+
+        kernel_hash = 'ed11daab50c151dde0e1e9c9cb8b2d9bd3215347'
+        kernel_path = self.fetch_asset(kernel_url, asset_hash=kernel_hash)
+
+        self.vm.set_console()
+        kernel_command_line = (self.KERNEL_COMMON_COMMAND_LINE +
+                               'console=ttyAMA0')
+        self.require_accelerator("tcg")
+        self.vm.add_args('-cpu', 'max,pauth-impdef=on',
+                         '-accel', 'tcg',
+                         '-kernel', kernel_path,
+                         '-append', kernel_command_line)
+        self.vm.launch()
+        self.wait_for_console_pattern('Welcome to Buildroot')
+        time.sleep(0.1)
+        exec_command(self, 'root')
+        time.sleep(0.1)
+        exec_command(self, 'cat /proc/self/maps')
+        time.sleep(0.1)
-- 
2.30.2



  reply	other threads:[~2022-04-08 16:57 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-04-08 16:47 [PATCH v1 00/15] testing, docs, tracepoints and cputlb hacks Alex Bennée
2022-04-08 16:47 ` Alex Bennée [this message]
2022-04-08 16:47 ` [PATCH v1 02/15] docs/devel: add some notes on the binfmt-image-debian targets Alex Bennée
2022-04-08 16:47 ` [PATCH v1 03/15] docs/devel: drop :hidden: and :includehidden: tags Alex Bennée
2022-04-08 16:47 ` [PATCH v1 04/15] accel/tcg: move trace events to correct location Alex Bennée
2022-04-09 15:54   ` Richard Henderson
2022-04-08 16:47 ` [PATCH v1 05/15] accel/tcg: add tb_invalidate_phy_pages_fast tracepoint Alex Bennée
2022-04-09 15:57   ` Richard Henderson
2022-04-08 16:47 ` [PATCH v1 06/15] monitor: expose monitor_puts to rest of code Alex Bennée
2022-04-09 15:58   ` Richard Henderson
2022-04-21 14:45   ` Markus Armbruster
2022-04-08 16:47 ` [PATCH v1 07/15] disas: generalise plugin_printf and use for monitor_disas Alex Bennée
2022-04-09 16:04   ` Richard Henderson
2022-04-08 16:47 ` [PATCH v1 08/15] disas: use result of ->read_memory_func Alex Bennée
2022-04-09 16:07   ` Richard Henderson
2022-04-08 16:47 ` [PATCH v1 09/15] cputlb: add tracepoints for the protect/unprotect helpers Alex Bennée
2022-04-09 16:09   ` Richard Henderson
2022-04-08 16:47 ` [PATCH v1 10/15] cputlb: add tracepoints for TB invalidation Alex Bennée
2022-04-09 16:10   ` Richard Henderson
2022-04-08 16:47 ` [PATCH v1 11/15] accel/tcg: add tb_invalidate_phys_page_range tracepoint Alex Bennée
2022-04-09 16:14   ` Richard Henderson
2022-04-08 16:47 ` [PATCH v1 12/15] tests/tcg: add memory-sve test for aarch64 Alex Bennée
2022-04-08 16:47 ` [PATCH v1 13/15] plugins: extend execlog to filter matches Alex Bennée
2022-04-08 16:47 ` [PATCH v1 14/15] plugins: Assert mmu_idx in range before use in qemu_plugin_get_hwaddr Alex Bennée
2022-04-08 16:47 ` [PATCH v1 15/15] accel/tcg: add heuristic to invalidate al TBs in a page [hack!] Alex Bennée

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220408164742.2844631-2-alex.bennee@linaro.org \
    --to=alex.bennee@linaro.org \
    --cc=Luke.Craig@ll.mit.edu \
    --cc=aaron@os.amperecomputing.com \
    --cc=aurelien@aurel32.net \
    --cc=berrange@redhat.com \
    --cc=bleal@redhat.com \
    --cc=cota@braap.org \
    --cc=crosa@redhat.com \
    --cc=f4bug@amsat.org \
    --cc=fam@euphon.net \
    --cc=kuhn.chenqun@huawei.com \
    --cc=ma.mandourr@gmail.com \
    --cc=mahmoudabdalghany@outlook.com \
    --cc=minyihh@uci.edu \
    --cc=pbonzini@redhat.com \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-arm@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    --cc=richard.henderson@linaro.org \
    --cc=robhenry@microsoft.com \
    --cc=stefanha@redhat.com \
    --cc=wainersm@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).