qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Thomas Huth <thuth@redhat.com>
To: qemu-devel@nongnu.org
Cc: "Stefan Hajnoczi" <stefanha@redhat.com>,
	"Philippe Mathieu-Daudé" <philmd@linaro.org>
Subject: [PULL 07/27] tests/functional: Test both microblaze s3adsp1800 endianness variants
Date: Wed, 28 May 2025 12:04:47 +0200	[thread overview]
Message-ID: <20250528100507.313906-8-thuth@redhat.com> (raw)
In-Reply-To: <20250528100507.313906-1-thuth@redhat.com>

From: Thomas Huth <thuth@redhat.com>

Now that the endianness of the petalogix-s3adsp1800 can be configured,
we should test that the cross-endianness also works as expected, thus
test the big endian variant on the little endian target and vice versa.
(based on an original idea from Philippe Mathieu-Daudé)

Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Signed-off-by: Thomas Huth <thuth@redhat.com>
Message-ID: <20250515132019.569365-3-thuth@redhat.com>
---
 tests/functional/test_microblaze_s3adsp1800.py | 18 +++++++++++++-----
 .../functional/test_microblazeel_s3adsp1800.py |  6 +++++-
 2 files changed, 18 insertions(+), 6 deletions(-)

diff --git a/tests/functional/test_microblaze_s3adsp1800.py b/tests/functional/test_microblaze_s3adsp1800.py
index c93fa14232b..f093b162c0a 100755
--- a/tests/functional/test_microblaze_s3adsp1800.py
+++ b/tests/functional/test_microblaze_s3adsp1800.py
@@ -25,12 +25,14 @@ class MicroblazeMachine(QemuSystemTest):
         ('http://www.qemu-advent-calendar.org/2023/download/day13.tar.gz'),
         'b9b3d43c5dd79db88ada495cc6e0d1f591153fe41355e925d791fbf44de50c22')
 
-    def do_ballerina_be_test(self, machine):
-        self.set_machine(machine)
+    def do_ballerina_be_test(self, force_endianness=False):
+        self.set_machine('petalogix-s3adsp1800')
         self.archive_extract(self.ASSET_IMAGE_BE)
         self.vm.set_console()
         self.vm.add_args('-kernel',
                          self.scratch_file('day17', 'ballerina.bin'))
+        if force_endianness:
+            self.vm.add_args('-M', 'endianness=big')
         self.vm.launch()
         wait_for_console_pattern(self, 'This architecture does not have '
                                        'kernel memory protection')
@@ -39,12 +41,14 @@ def do_ballerina_be_test(self, machine):
         # message, that's why we don't test for a later string here. This
         # needs some investigation by a microblaze wizard one day...
 
-    def do_xmaton_le_test(self, machine):
+    def do_xmaton_le_test(self, force_endianness=False):
         self.require_netdev('user')
-        self.set_machine(machine)
+        self.set_machine('petalogix-s3adsp1800')
         self.archive_extract(self.ASSET_IMAGE_LE)
         self.vm.set_console()
         self.vm.add_args('-kernel', self.scratch_file('day13', 'xmaton.bin'))
+        if force_endianness:
+            self.vm.add_args('-M', 'endianness=little')
         tftproot = self.scratch_file('day13')
         self.vm.add_args('-nic', f'user,tftp={tftproot}')
         self.vm.launch()
@@ -59,9 +63,13 @@ def do_xmaton_le_test(self, machine):
 class MicroblazeBigEndianMachine(MicroblazeMachine):
 
     ASSET_IMAGE_BE = MicroblazeMachine.ASSET_IMAGE_BE
+    ASSET_IMAGE_LE = MicroblazeMachine.ASSET_IMAGE_LE
 
     def test_microblaze_s3adsp1800_legacy_be(self):
-        self.do_ballerina_be_test('petalogix-s3adsp1800')
+        self.do_ballerina_be_test()
+
+    def test_microblaze_s3adsp1800_legacy_le(self):
+        self.do_xmaton_le_test(force_endianness=True)
 
 
 if __name__ == '__main__':
diff --git a/tests/functional/test_microblazeel_s3adsp1800.py b/tests/functional/test_microblazeel_s3adsp1800.py
index ab59941d57a..915902d48bd 100755
--- a/tests/functional/test_microblazeel_s3adsp1800.py
+++ b/tests/functional/test_microblazeel_s3adsp1800.py
@@ -13,9 +13,13 @@
 class MicroblazeLittleEndianMachine(MicroblazeMachine):
 
     ASSET_IMAGE_LE = MicroblazeMachine.ASSET_IMAGE_LE
+    ASSET_IMAGE_BE = MicroblazeMachine.ASSET_IMAGE_BE
 
     def test_microblaze_s3adsp1800_legacy_le(self):
-        self.do_xmaton_le_test('petalogix-s3adsp1800')
+        self.do_xmaton_le_test()
+
+    def test_microblaze_s3adsp1800_legacy_be(self):
+        self.do_ballerina_be_test(force_endianness=True)
 
 
 if __name__ == '__main__':
-- 
2.49.0



  parent reply	other threads:[~2025-05-28 10:05 UTC|newest]

Thread overview: 33+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-05-28 10:04 [PULL 00/27] Functional tests, Microblaze endianness & pc/q35 cleanups Thomas Huth
2025-05-28 10:04 ` [PULL 01/27] tests/functional/test_sparc64_tuxrun: Explicitly set the 'sun4u' machine Thomas Huth
2025-05-28 10:04 ` [PULL 02/27] tests/functional/test_mips_malta: Re-enable the check for the PCI host bridge Thomas Huth
2025-05-28 10:04 ` [PULL 03/27] tests/functional/test_mem_addr_space: Use set_machine() to select the machine Thomas Huth
2025-05-28 10:04 ` [PULL 04/27] tests/functional: add skipLockedMemoryTest decorator Thomas Huth
2025-05-28 10:04 ` [PULL 05/27] tests/functional: add memlock tests Thomas Huth
2025-05-28 10:04 ` [PULL 06/27] hw/microblaze: Add endianness property to the petalogix_s3adsp1800 machine Thomas Huth
2025-05-28 10:04 ` Thomas Huth [this message]
2025-05-28 10:04 ` [PULL 08/27] hw/microblaze: Remove the big-endian variants of ml605 and xlnx-zynqmp-pmu Thomas Huth
2025-05-28 10:04 ` [PULL 09/27] docs: Deprecate the qemu-system-microblazeel binary Thomas Huth
2025-05-28 10:04 ` [PULL 10/27] hw/i386/pc: Remove deprecated pc-q35-2.4 and pc-i440fx-2.4 machines Thomas Huth
2025-05-28 10:04 ` [PULL 11/27] hw/i386/pc: Remove PCMachineClass::broken_reserved_end field Thomas Huth
2025-05-28 10:04 ` [PULL 12/27] hw/i386/pc: Remove pc_compat_2_4[] array Thomas Huth
2025-05-28 10:04 ` [PULL 13/27] hw/core/machine: Remove hw_compat_2_4[] array Thomas Huth
2025-05-28 10:04 ` [PULL 14/27] hw/net/e1000: Remove unused E1000_FLAG_MAC flag Thomas Huth
2025-05-28 10:04 ` [PULL 15/27] hw/virtio/virtio-pci: Remove VIRTIO_PCI_FLAG_MIGRATE_EXTRA definition Thomas Huth
2025-05-28 10:04 ` [PULL 16/27] hw/virtio/virtio-pci: Remove VIRTIO_PCI_FLAG_DISABLE_PCIE definition Thomas Huth
2025-05-28 10:04 ` [PULL 17/27] hw/i386/pc: Remove deprecated pc-q35-2.5 and pc-i440fx-2.5 machines Thomas Huth
2025-05-28 10:04 ` [PULL 18/27] hw/i386/x86: Remove X86MachineClass::save_tsc_khz field Thomas Huth
2025-05-28 10:04 ` [PULL 19/27] hw/nvram/fw_cfg: Remove legacy FW_CFG_ORDER_OVERRIDE Thomas Huth
2025-05-28 10:05 ` [PULL 20/27] hw/core/machine: Remove hw_compat_2_5[] array Thomas Huth
2025-05-28 10:05 ` [PULL 21/27] hw/scsi/vmw_pvscsi: Remove PVSCSI_COMPAT_OLD_PCI_CONFIGURATION definition Thomas Huth
2025-05-28 10:05 ` [PULL 22/27] hw/scsi/vmw_pvscsi: Remove PVSCSI_COMPAT_DISABLE_PCIE_BIT definition Thomas Huth
2025-05-28 10:05 ` [PULL 23/27] hw/scsi/vmw_pvscsi: Convert DeviceRealize -> InstanceInit Thomas Huth
2025-05-28 10:05 ` [PULL 24/27] hw/net/vmxnet3: Remove VMXNET3_COMPAT_FLAG_OLD_MSI_OFFSETS definition Thomas Huth
2025-05-28 10:05 ` [PULL 25/27] hw/net/vmxnet3: Remove VMXNET3_COMPAT_FLAG_DISABLE_PCIE definition Thomas Huth
2025-05-28 10:05 ` [PULL 26/27] hw/net/vmxnet3: Merge DeviceRealize in InstanceInit Thomas Huth
2025-05-28 10:05 ` [PULL 27/27] tests/unit/test-util-sockets: fix mem-leak on error object Thomas Huth
2025-05-28 19:23 ` [PULL 00/27] Functional tests, Microblaze endianness & pc/q35 cleanups Stefan Hajnoczi
2025-05-28 20:12   ` Thomas Huth
2025-06-04  7:51     ` Alexandr Moshkov
2025-06-04 13:11       ` Stefan Hajnoczi
2025-06-04 13:19         ` Thomas Huth

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=20250528100507.313906-8-thuth@redhat.com \
    --to=thuth@redhat.com \
    --cc=philmd@linaro.org \
    --cc=qemu-devel@nongnu.org \
    --cc=stefanha@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).