Testcase improvements and Power8E/NVL removal
v3 cover Testcase improvements and Power8E/NVL removal
Overview
========
This patch series merged two patch series sent earlier:
"Testcase improvements for PowerNV"
"Remove deprecated Power8E and 8NVL CPUs"
since the Power8E removal series depended on the former due to pnv-spi test
Broadly contains 3 changes:
1. Testcase improvements:
Add a testcase to detect regression in remote interrupts when XIVE changes, since such regression had occurred during Power11 XIVE changes:
https://lore.kernel.org/qemu-devel/[email protected]/
Also add Power11 chip and testcase in qtests, and fadump functional test
2. Power8E/Power8NVL removal
Power8E and Power8NVL were deprecated since QEMU 10.1, with commit 264a604e7163 ("target/ppc: Deprecate Power8E and Power8NVL")
Hence, remove usage (chip and core types) of Power8E and 8NVL from PowerNV, PSeries as well as testcases.
3. Maintainer changes
Add myself as maintainer for PowerNV machine
Testing
=======
* Git tree for testing: https://gitlab.com/adi-g15-ibm/qemu/tree/feat_maintainer-v3
* Gitlab pipeline: https://gitlab.com/adi-g15-ibm/qemu/-/pipelines/2635562383
* Successful ppc64 functional tests, qtests, boot tests, builds at all commits
Changelog
=========
v3:
+ #3: use machine_type array in pnv_xscom_addr, as suggested by shivang, harsh and balaton
v2:
+ #1: put e1000e on socket 1, and disable it's cpu, as suggested by cedric
+ #1: pull out command fail checks into a helper, as suggested by shivang
+ #2: use g_autofree, suggested by cedric
+ #3: use g_autofree in tests updated
+ #8: remove G:, as suggested by daniel
+ rebased to upstream
from previous split series:
+ #1: added checks to see if network is up and interrupts happened, based on shivang's review
+ #3: replaced common if-else-if check for machine type with pnv_get_machine_type
+ #7: added doc in removed-features, as suggested by cedric
+ #6,7: added rb from philippe
+ #8: new patch, maintainer change
Aditya Gupta (8):
tests/functional: Add remote interrupts test for PowerNV tests/qtest/pnv_spi: Test Power11 PNV_SPI tests/qtest: Add Power11 chip & machine to qtests tests/functional: Use default powernv machine instead of power10 ppc/pnv: Replace Power8E with Power11 for 'none' machine test ppc/pnv: Remove Power8E and Power8NVL pnv chips ppc/pnv: Remove Power8E and Power8NVL CPUs
MAINTAINERS: Add self as maintainer for PowerNV
MAINTAINERS | 2 +- docs/about/deprecated.rst | 9 --- docs/about/removed-features.rst | 8 +++ docs/system/ppc/powernv.rst | 2 +- docs/system/ppc/pseries.rst | 2 +- hw/ppc/pnv.c | 62 ----------------- hw/ppc/pnv_core.c | 2 - hw/ppc/spapr_cpu_core.c | 2 - include/hw/ppc/pnv.h | 8 --- target/ppc/cpu-models.c | 6 -- target/ppc/cpu-models.h | 4 -- target/ppc/cpu_init.c | 6 -- target/ppc/kvm.c | 4 +- tests/functional/ppc64/test_fadump.py | 2 +- tests/functional/ppc64/test_powernv.py | 95 ++++++++++++++++++++++++++ tests/qtest/machine-none-test.c | 2 +- tests/qtest/pnv-host-i2c-test.c | 10 ++- tests/qtest/pnv-spi-seeprom-test.c | 20 ++++-- tests/qtest/pnv-xive2-test.c | 2 +- tests/qtest/pnv-xscom-test.c | 22 ++---- tests/qtest/pnv-xscom.h | 41 +++++++---- 21 files changed, 162 insertions(+), 149 deletions(-)
base-commit: 20553466cc47af6a8c95f665b601fce3c852e503
Signature · 1 line
2.54.0
PATCH v3 1/8 tests/functional: Add remote interrupts test for PowerNV
In the past there have been hard to recreate issues where XIVE changes cause qemu crashes due to multi-socket interrupts such as in [1].
Add a functional test explicitly to test whether remote interrupts work.
The test can also work as additional boot test for multi-socket boot, initrd boot test, as well as a check for e1000e to be working in powernv, though that's not a target goal, and are additional benefits.
From docs/system/devices/net.rst:
In order to check that the user mode network is working, you can ping the address 10.0.2.2 and verify that you got an address in the range 10.0.2.x from the QEMU virtual DHCP server.
Hence use 10.0.2.2 with ping.
[1]: https://lore.kernel.org/qemu-devel/[email protected]/
--- tests/functional/ppc64/test_powernv.py | 95 ++++++++++++++++++++++++++ 1 file changed, 95 insertions(+)
tests/functional/ppc64/test_powernv.py +95 -0
@@ -9,6 +9,7 @@ from qemu_test import LinuxKernelTest, Asset from qemu_test import wait_for_console_pattern +from qemu_test import exec_command_and_wait_for_pattern class PowernvMachine(LinuxKernelTest):
@@ -27,6 +28,17 @@ class PowernvMachine(LinuxKernelTest): 'buildroot/qemu_ppc64le_powernv8-2025.02/rootfs.ext2'), 'aee2192b692077c4bde31cb56ce474424b358f17cec323d5c94af3970c9aada2') + def shell_exec_command_check_fail(self, command): + fail_msg="Fail" + self.shell_exec_command(f"export __FAIL_MSG={fail_msg}") + + # If the exit code for the command is non 0, print fail message + command = command + " || echo $__FAIL_MSG" + exec_command_and_wait_for_pattern(self, command, '#', fail_msg) + + def shell_exec_command(self, command): + exec_command_and_wait_for_pattern(self, command, '#', self.panic_message) + def do_test_linux_boot(self, command_line = KERNEL_COMMON_COMMAND_LINE): self.require_accelerator("tcg") kernel_path = self.ASSET_KERNEL.fetch()
@@ -71,6 +83,89 @@ def test_linux_smt_boot(self): wait_for_console_pattern(self, console_pattern, self.panic_message) wait_for_console_pattern(self, self.good_message, self.panic_message) + def test_linux_remote_interrupts(self): + self.require_accelerator("tcg") + self.set_machine('powernv') + + # Have below setup in this test: + # 1. e1000e attached to pcie.6, which is from 7th PHB, belonging to 2nd + # socket (chip 1), in a powernv boot with default 6 PHBs per socket + # 2. CPU on 2nd socket (chip 1) disabled + # 3. RX IRQ's affinity to chip 2, and TX IRQ's affinity to chip 3 + # + # Then ping is done, to generate interrupts from e1000e which should go + # to IRQ server on the remote sockets + self.vm.add_args('-smp', '4,sockets=4,threads=1') + self.vm.add_args('-netdev', 'user,id=net0') + self.vm.add_args('-device', 'e1000e,netdev=net0,bus=pcie.6') + + kernel_path = self.ASSET_KERNEL.fetch() + rootfs_path = self.ASSET_INITRD.fetch() + self.vm.set_console() + self.vm.add_args('-kernel', kernel_path, + '-drive', + f'file={rootfs_path},format=raw,if=none,id=drive0,readonly=on', + '-append', 'root=/dev/nvme0n1 console=hvc0', + '-device', 'nvme,drive=drive0,bus=pcie.2,addr=0x0,serial=1234') + self.vm.launch() + + # Wait for boot to complete + console_pattern = 'CPU maps initialized for 1 thread per core' + wait_for_console_pattern(self, console_pattern, self.panic_message) + console_pattern = 'smp: Brought up 4 nodes, 4 CPUs' + wait_for_console_pattern(self, console_pattern, self.panic_message) + wait_for_console_pattern(self, 'Run /sbin/init as init process', + self.panic_message) + + # Wait for login prompt and login as root (no password in buildroot) + wait_for_console_pattern(self, 'login:', self.panic_message) + exec_command_and_wait_for_pattern(self, 'root', '#', self.panic_message) + + # e1000e is connected to socket 1, disable the CPU on socket 1 + self.shell_exec_command("echo 0 > /sys/devices/system/cpu/cpu1/online") + self.shell_exec_command( + "export CPU1_STATE=$(cat /sys/devices/system/cpu/cpu1/online)") + self.shell_exec_command_check_fail("[ $CPU1_STATE -eq 0 ]") + + # RX, TX interrupts to chip/cpu 2 & 3 respectively + self.shell_exec_command( + "export RX_IRQ=$(awk '/eth0-rx/ {print $1}' /proc/interrupts | tr -d ':')") + self.shell_exec_command( + "export TX_IRQ=$(awk '/eth0-tx/ {print $1}' /proc/interrupts | tr -d ':')") + self.shell_exec_command("echo 2 > /proc/irq/$RX_IRQ/smp_affinity_list") + self.shell_exec_command("echo 3 > /proc/irq/$TX_IRQ/smp_affinity_list") + + # Capture interrupt counts before generating traffic + self.shell_exec_command( + "export RX_BEFORE=$(awk '/eth0-rx/ {print $3}' /proc/interrupts)") + self.shell_exec_command( + "export TX_BEFORE=$(awk '/eth0-tx/ {print $4}' /proc/interrupts)") + + # Wait up to 15 seconds for eth0 link to come up + self.shell_exec_command( + "c=0; while ! ip addr show eth0 | grep 'inet 10.0.2'; do " + "sleep 1; c=$((c+1)); [ $c -gt 15 ] && break; done") + + self.shell_exec_command_check_fail( + "ip addr show eth0 | grep 'inet 10.0.2'") + + # Generate network traffic to trigger remote interrupts + # Ping QEMU's user-mode network gateway (10.0.2.2) + self.shell_exec_command("ping -W2 -c5 10.0.2.2") + + # Show final interrupt counts to verify remote interrupts occurred + self.shell_exec_command("cat /proc/interrupts | grep eth0") + + # Verify interrupt counts increased (whether interrupts were delivered) + self.shell_exec_command( + "export RX_AFTER=$(awk '/eth0-rx/ {print $3}' /proc/interrupts)") + self.shell_exec_command( + "export TX_AFTER=$(awk '/eth0-tx/ {print $4}' /proc/interrupts)") + + # Check that interrupt counts increased + self.shell_exec_command_check_fail("[ $RX_AFTER -gt $RX_BEFORE ]") + self.shell_exec_command_check_fail("[ $TX_AFTER -gt $TX_BEFORE ]") + def test_linux_big_boot(self): self.set_machine('powernv') self.vm.add_args('-smp', '16,threads=4,cores=2,sockets=2')
Signature · 1 line
2.54.0
Re: [PATCH v3 1/8] tests/functional: Add remote interrupts test for PowerNV
Quoted 7 lines · Aditya Gupta
In the past there have been hard to recreate issues where XIVE changes cause qemu crashes due to multi-socket interrupts such as in [1].
Add a functional test explicitly to test whether remote interrupts work.
The test can also work as additional boot test for multi-socket boot, initrd boot test, as well as a check for e1000e to be working in powernv,
you should consider moving to a more modern nic model: igb, which has sr-iov support too.
C.
Quoted 139 lines
though that's not a target goal, and are additional benefits.
From
docs/system/devices/net.rst:In order to check that the user mode network is working, you can ping the address 10.0.2.2 and verify that you got an address in the range 10.0.2.x from the QEMU virtual DHCP server.
Hence use 10.0.2.2 with ping.
[1]: https://lore.kernel.org/qemu-devel/[email protected]/
Tested-by Shivang Upadhyay <[email protected]>Reviewed-by Shivang Upadhyay <[email protected]>Signed-off-by Aditya Gupta <[email protected]>--- tests/functional/ppc64/test_powernv.py | 95 ++++++++++++++++++++++++++ 1 file changed, 95 insertions(+)tests/functional/ppc64/test_powernv.py +95
-0@@ -9,6 +9,7 @@ from qemu_test import LinuxKernelTest, Asset from qemu_test import wait_for_console_pattern +from qemu_test import exec_command_and_wait_for_pattern class PowernvMachine(LinuxKernelTest):@@ -27,6 +28,17 @@ class PowernvMachine(LinuxKernelTest): 'buildroot/qemu_ppc64le_powernv8-2025.02/rootfs.ext2'), 'aee2192b692077c4bde31cb56ce474424b358f17cec323d5c94af3970c9aada2') + def shell_exec_command_check_fail(self, command): + fail_msg="Fail" + self.shell_exec_command(f"export __FAIL_MSG={fail_msg}") + + # If the exit code for the command is non 0, print fail message + command = command + " || echo $__FAIL_MSG" + exec_command_and_wait_for_pattern(self, command, '#', fail_msg) + + def shell_exec_command(self, command): + exec_command_and_wait_for_pattern(self, command, '#', self.panic_message) + def do_test_linux_boot(self, command_line = KERNEL_COMMON_COMMAND_LINE): self.require_accelerator("tcg") kernel_path = self.ASSET_KERNEL.fetch()@@ -71,6 +83,89 @@ def test_linux_smt_boot(self): wait_for_console_pattern(self, console_pattern, self.panic_message) wait_for_console_pattern(self, self.good_message, self.panic_message) + def test_linux_remote_interrupts(self): + self.require_accelerator("tcg") + self.set_machine('powernv') + + # Have below setup in this test: + # 1. e1000e attached to pcie.6, which is from 7th PHB, belonging to 2nd + # socket (chip 1), in a powernv boot with default 6 PHBs per socket + # 2. CPU on 2nd socket (chip 1) disabled + # 3. RX IRQ's affinity to chip 2, and TX IRQ's affinity to chip 3 + # + # Then ping is done, to generate interrupts from e1000e which should go + # to IRQ server on the remote sockets + self.vm.add_args('-smp', '4,sockets=4,threads=1') + self.vm.add_args('-netdev', 'user,id=net0') + self.vm.add_args('-device', 'e1000e,netdev=net0,bus=pcie.6') + + kernel_path = self.ASSET_KERNEL.fetch() + rootfs_path = self.ASSET_INITRD.fetch() + self.vm.set_console() + self.vm.add_args('-kernel', kernel_path, + '-drive', + f'file={rootfs_path},format=raw,if=none,id=drive0,readonly=on', + '-append', 'root=/dev/nvme0n1 console=hvc0', + '-device', 'nvme,drive=drive0,bus=pcie.2,addr=0x0,serial=1234') + self.vm.launch() + + # Wait for boot to complete + console_pattern = 'CPU maps initialized for 1 thread per core' + wait_for_console_pattern(self, console_pattern, self.panic_message) + console_pattern = 'smp: Brought up 4 nodes, 4 CPUs' + wait_for_console_pattern(self, console_pattern, self.panic_message) + wait_for_console_pattern(self, 'Run /sbin/init as init process', + self.panic_message) + + # Wait for login prompt and login as root (no password in buildroot) + wait_for_console_pattern(self, 'login:', self.panic_message) + exec_command_and_wait_for_pattern(self, 'root', '#', self.panic_message) + + # e1000e is connected to socket 1, disable the CPU on socket 1 + self.shell_exec_command("echo 0 > /sys/devices/system/cpu/cpu1/online") + self.shell_exec_command( + "export CPU1_STATE=$(cat /sys/devices/system/cpu/cpu1/online)") + self.shell_exec_command_check_fail("[ $CPU1_STATE -eq 0 ]") + + # RX, TX interrupts to chip/cpu 2 & 3 respectively + self.shell_exec_command( + "export RX_IRQ=$(awk '/eth0-rx/ {print $1}' /proc/interrupts | tr -d ':')") + self.shell_exec_command( + "export TX_IRQ=$(awk '/eth0-tx/ {print $1}' /proc/interrupts | tr -d ':')") + self.shell_exec_command("echo 2 > /proc/irq/$RX_IRQ/smp_affinity_list") + self.shell_exec_command("echo 3 > /proc/irq/$TX_IRQ/smp_affinity_list") + + # Capture interrupt counts before generating traffic + self.shell_exec_command( + "export RX_BEFORE=$(awk '/eth0-rx/ {print $3}' /proc/interrupts)") + self.shell_exec_command( + "export TX_BEFORE=$(awk '/eth0-tx/ {print $4}' /proc/interrupts)") + + # Wait up to 15 seconds for eth0 link to come up + self.shell_exec_command( + "c=0; while ! ip addr show eth0 | grep 'inet 10.0.2'; do " + "sleep 1; c=$((c+1)); [ $c -gt 15 ] && break; done") + + self.shell_exec_command_check_fail( + "ip addr show eth0 | grep 'inet 10.0.2'") + + # Generate network traffic to trigger remote interrupts + # Ping QEMU's user-mode network gateway (10.0.2.2) + self.shell_exec_command("ping -W2 -c5 10.0.2.2") + + # Show final interrupt counts to verify remote interrupts occurred + self.shell_exec_command("cat /proc/interrupts | grep eth0") + + # Verify interrupt counts increased (whether interrupts were delivered) + self.shell_exec_command( + "export RX_AFTER=$(awk '/eth0-rx/ {print $3}' /proc/interrupts)") + self.shell_exec_command( + "export TX_AFTER=$(awk '/eth0-tx/ {print $4}' /proc/interrupts)") + + # Check that interrupt counts increased + self.shell_exec_command_check_fail("[ $RX_AFTER -gt $RX_BEFORE ]") + self.shell_exec_command_check_fail("[ $TX_AFTER -gt $TX_BEFORE ]") + def test_linux_big_boot(self): self.set_machine('powernv') self.vm.add_args('-smp', '16,threads=4,cores=2,sockets=2')
Re: [PATCH v3 1/8] tests/functional: Add remote interrupts test for PowerNV
Quoted 11 lines · Cédric Le Goater
Quoted 7 lines · Aditya Gupta
In the past there have been hard to recreate issues where XIVE changes cause qemu crashes due to multi-socket interrupts such as in [1].
Add a functional test explicitly to test whether remote interrupts work.
The test can also work as additional boot test for multi-socket boot, initrd boot test, as well as a check for e1000e to be working in powernv,
you should consider moving to a more modern nic model: igb, which has sr-iov support too.
yes, can do. with igb i see multiple irqs, so test will have to take sum of all rx irqs, and compare:
2026-06-29 17:00:46,288: cat /proc/interrupts | grep eth0 2026-06-29 17:00:46,391: 135: 0 0 0 PNV-PCI-MSI 2416443392 Edge eth0 2026-06-29 17:00:46,393: 136: 0 6 0 PNV-PCI-MSI 2416443393 Edge eth0-rx-0 2026-06-29 17:00:46,394: 137: 0 14 0 PNV-PCI-MSI 2416443394 Edge eth0-rx-1 2026-06-29 17:00:46,395: 138: 0 4 0 PNV-PCI-MSI 2416443395 Edge eth0-rx-2 2026-06-29 17:00:46,397: 139: 0 4 0 PNV-PCI-MSI 2416443396 Edge eth0-rx-3 2026-06-29 17:00:46,398: 140: 0 16 0 PNV-PCI-MSI 2416443397 Edge eth0-tx-0 2026-06-29 17:00:46,399: 141: 0 6 0 PNV-PCI-MSI 2416443398 Edge eth0-tx-1 2026-06-29 17:00:46,399: 142: 0 6 0 PNV-PCI-MSI 2416443399 Edge eth0-tx-2 2026-06-29 17:00:46,400: 143: 0 4 0 PNV-PCI-MSI 2416443400 Edge eth0-tx-3
I feel e1000e suffices for this test, should i stay with e1000e or use igb here ?
Thanks,
- Aditya G
Re: [PATCH v3 1/8] tests/functional: Add remote interrupts test for PowerNV
Quoted 27 lines · Aditya Gupta
Quoted 11 lines · Cédric Le Goater
Quoted 7 lines · Aditya Gupta
In the past there have been hard to recreate issues where XIVE changes cause qemu crashes due to multi-socket interrupts such as in [1].
Add a functional test explicitly to test whether remote interrupts work.
The test can also work as additional boot test for multi-socket boot, initrd boot test, as well as a check for e1000e to be working in powernv,
you should consider moving to a more modern nic model: igb, which has sr-iov support too.
yes, can do. with igb i see multiple irqs, so test will have to take sum of all rx irqs, and compare:
2026-06-29 17:00:46,288: cat /proc/interrupts | grep eth0 2026-06-29 17:00:46,391: 135: 0 0 0 PNV-PCI-MSI 2416443392 Edge eth0 2026-06-29 17:00:46,393: 136: 0 6 0 PNV-PCI-MSI 2416443393 Edge eth0-rx-0 2026-06-29 17:00:46,394: 137: 0 14 0 PNV-PCI-MSI 2416443394 Edge eth0-rx-1 2026-06-29 17:00:46,395: 138: 0 4 0 PNV-PCI-MSI 2416443395 Edge eth0-rx-2 2026-06-29 17:00:46,397: 139: 0 4 0 PNV-PCI-MSI 2416443396 Edge eth0-rx-3 2026-06-29 17:00:46,398: 140: 0 16 0 PNV-PCI-MSI 2416443397 Edge eth0-tx-0 2026-06-29 17:00:46,399: 141: 0 6 0 PNV-PCI-MSI 2416443398 Edge eth0-tx-1 2026-06-29 17:00:46,399: 142: 0 6 0 PNV-PCI-MSI 2416443399 Edge eth0-tx-2 2026-06-29 17:00:46,400: 143: 0 4 0 PNV-PCI-MSI 2416443400 Edge eth0-tx-3
Quoted 2 lines
I feel e1000e suffices for this test, should i stay with e1000e or use igb here ?
or use a single cpu per socket config. Which seems better for the test.
Thanks,
C.
Re: [PATCH v3 1/8] tests/functional: Add remote interrupts test for PowerNV
Quoted 28 lines · Cédric Le Goater
Quoted 27 lines · Aditya Gupta
Quoted 11 lines · Cédric Le Goater
Quoted 7 lines · Aditya Gupta
In the past there have been hard to recreate issues where XIVE changes cause qemu crashes due to multi-socket interrupts such as in [1].
Add a functional test explicitly to test whether remote interrupts work.
The test can also work as additional boot test for multi-socket boot, initrd boot test, as well as a check for e1000e to be working in powernv,
you should consider moving to a more modern nic model: igb, which has sr-iov support too.
yes, can do. with igb i see multiple irqs, so test will have to take sum of all rx irqs, and compare:
2026-06-29 17:00:46,288: cat /proc/interrupts | grep eth0 2026-06-29 17:00:46,391: 135: 0 0 0 PNV-PCI-MSI 2416443392 Edge eth0 2026-06-29 17:00:46,393: 136: 0 6 0 PNV-PCI-MSI 2416443393 Edge eth0-rx-0 2026-06-29 17:00:46,394: 137: 0 14 0 PNV-PCI-MSI 2416443394 Edge eth0-rx-1 2026-06-29 17:00:46,395: 138: 0 4 0 PNV-PCI-MSI 2416443395 Edge eth0-rx-2 2026-06-29 17:00:46,397: 139: 0 4 0 PNV-PCI-MSI 2416443396 Edge eth0-rx-3 2026-06-29 17:00:46,398: 140: 0 16 0 PNV-PCI-MSI 2416443397 Edge eth0-tx-0 2026-06-29 17:00:46,399: 141: 0 6 0 PNV-PCI-MSI 2416443398 Edge eth0-tx-1 2026-06-29 17:00:46,399: 142: 0 6 0 PNV-PCI-MSI 2416443399 Edge eth0-tx-2 2026-06-29 17:00:46,400: 143: 0 4 0 PNV-PCI-MSI 2416443400 Edge eth0-tx-3
Quoted 4 lines
Quoted 2 lines
I feel e1000e suffices for this test, should i stay with e1000e or use igb here ?
or use a single cpu per socket config. Which seems better for the test.
The test uses single cpu per socket, since i have -smp 4,sockets=4,threads=1. Was this what you meant ?
Thanks,
- Aditya G
Re: [PATCH v3 1/8] tests/functional: Add remote interrupts test for PowerNV
Quoted 30 lines · Aditya Gupta
Quoted 28 lines · Cédric Le Goater
Quoted 27 lines · Aditya Gupta
Quoted 11 lines · Cédric Le Goater
Quoted 7 lines · Aditya Gupta
In the past there have been hard to recreate issues where XIVE changes cause qemu crashes due to multi-socket interrupts such as in [1].
Add a functional test explicitly to test whether remote interrupts work.
The test can also work as additional boot test for multi-socket boot, initrd boot test, as well as a check for e1000e to be working in powernv,
you should consider moving to a more modern nic model: igb, which has sr-iov support too.
yes, can do. with igb i see multiple irqs, so test will have to take sum of all rx irqs, and compare:
2026-06-29 17:00:46,288: cat /proc/interrupts | grep eth0 2026-06-29 17:00:46,391: 135: 0 0 0 PNV-PCI-MSI 2416443392 Edge eth0 2026-06-29 17:00:46,393: 136: 0 6 0 PNV-PCI-MSI 2416443393 Edge eth0-rx-0 2026-06-29 17:00:46,394: 137: 0 14 0 PNV-PCI-MSI 2416443394 Edge eth0-rx-1 2026-06-29 17:00:46,395: 138: 0 4 0 PNV-PCI-MSI 2416443395 Edge eth0-rx-2 2026-06-29 17:00:46,397: 139: 0 4 0 PNV-PCI-MSI 2416443396 Edge eth0-rx-3 2026-06-29 17:00:46,398: 140: 0 16 0 PNV-PCI-MSI 2416443397 Edge eth0-tx-0 2026-06-29 17:00:46,399: 141: 0 6 0 PNV-PCI-MSI 2416443398 Edge eth0-tx-1 2026-06-29 17:00:46,399: 142: 0 6 0 PNV-PCI-MSI 2416443399 Edge eth0-tx-2 2026-06-29 17:00:46,400: 143: 0 4 0 PNV-PCI-MSI 2416443400 Edge eth0-tx-3
Quoted 7 lines
Quoted 4 lines
Quoted 2 lines
I feel e1000e suffices for this test, should i stay with e1000e or use igb here ?
or use a single cpu per socket config. Which seems better for the test.
The test uses single cpu per socket, since i have
-smp 4,sockets=4,threads=1. Was this what you meant ?
yes. or cores=1, as you wish.
Thanks,
C.
Re: [PATCH v3 1/8] tests/functional: Add remote interrupts test for PowerNV
Quoted 34 lines · Cédric Le Goater
Quoted 33 lines · Aditya Gupta
Quoted 31 lines · Cédric Le Goater
Quoted 29 lines · Aditya Gupta
Quoted 11 lines · Cédric Le Goater
Quoted 7 lines · Aditya Gupta
In the past there have been hard to recreate issues where XIVE changes cause qemu crashes due to multi-socket interrupts such as in [1].
Add a functional test explicitly to test whether remote interrupts work.
The test can also work as additional boot test for multi-socket boot, initrd boot test, as well as a check for e1000e to be working in powernv,
you should consider moving to a more modern nic model: igb, which has sr-iov support too.
yes, can do. with igb i see multiple irqs, so test will have to take sum of all rx irqs, and compare:
2026-06-29 17:00:46,288: cat /proc/interrupts | grep eth0 2026-06-29 17:00:46,391: 135: 0 0 0 PNV-PCI-MSI 2416443392 Edge eth0 2026-06-29 17:00:46,393: 136: 0 6 0 PNV-PCI-MSI 2416443393 Edge eth0-rx-0 2026-06-29 17:00:46,394: 137: 0 14 0 PNV-PCI-MSI 2416443394 Edge eth0-rx-1 2026-06-29 17:00:46,395: 138: 0 4 0 PNV-PCI-MSI 2416443395 Edge eth0-rx-2 2026-06-29 17:00:46,397: 139: 0 4 0 PNV-PCI-MSI 2416443396 Edge eth0-rx-3 2026-06-29 17:00:46,398: 140: 0 16 0 PNV-PCI-MSI 2416443397 Edge eth0-tx-0 2026-06-29 17:00:46,399: 141: 0 6 0 PNV-PCI-MSI 2416443398 Edge eth0-tx-1 2026-06-29 17:00:46,399: 142: 0 6 0 PNV-PCI-MSI 2416443399 Edge eth0-tx-2 2026-06-29 17:00:46,400: 143: 0 4 0 PNV-PCI-MSI 2416443400 Edge eth0-tx-3I feel e1000e suffices for this test, should i stay with e1000e or use igb here ?
Quoted 6 lines
Quoted 4 lines
Quoted 1 line
or use a single cpu per socket config. Which seems better for the test.
The test uses single cpu per socket, since i have
-smp 4,sockets=4,threads=1. Was this what you meant ?yes. or cores=1, as you wish.
sure, will add cores=1 for clarity.
do you have any further comments before i send a v4 with this change, and #include's removed ?
Thanks,
- Aditya G
Quoted 5 lines
Thanks,
C.
Re: [PATCH v3 1/8] tests/functional: Add remote interrupts test for PowerNV
Quoted 38 lines · Aditya Gupta
Quoted 37 lines · Cédric Le Goater
Quoted 36 lines · Aditya Gupta
Quoted 32 lines · Cédric Le Goater
Quoted 27 lines · Aditya Gupta
Quoted 11 lines · Cédric Le Goater
Quoted 7 lines · Aditya Gupta
In the past there have been hard to recreate issues where XIVE changes cause qemu crashes due to multi-socket interrupts such as in [1].
Add a functional test explicitly to test whether remote interrupts work.
The test can also work as additional boot test for multi-socket boot, initrd boot test, as well as a check for e1000e to be working in powernv,
you should consider moving to a more modern nic model: igb, which has sr-iov support too.
yes, can do. with igb i see multiple irqs, so test will have to take sum of all rx irqs, and compare:
2026-06-29 17:00:46,288: cat /proc/interrupts | grep eth0 2026-06-29 17:00:46,391: 135: 0 0 0 PNV-PCI-MSI 2416443392 Edge eth0 2026-06-29 17:00:46,393: 136: 0 6 0 PNV-PCI-MSI 2416443393 Edge eth0-rx-0 2026-06-29 17:00:46,394: 137: 0 14 0 PNV-PCI-MSI 2416443394 Edge eth0-rx-1 2026-06-29 17:00:46,395: 138: 0 4 0 PNV-PCI-MSI 2416443395 Edge eth0-rx-2 2026-06-29 17:00:46,397: 139: 0 4 0 PNV-PCI-MSI 2416443396 Edge eth0-rx-3 2026-06-29 17:00:46,398: 140: 0 16 0 PNV-PCI-MSI 2416443397 Edge eth0-tx-0 2026-06-29 17:00:46,399: 141: 0 6 0 PNV-PCI-MSI 2416443398 Edge eth0-tx-1 2026-06-29 17:00:46,399: 142: 0 6 0 PNV-PCI-MSI 2416443399 Edge eth0-tx-2 2026-06-29 17:00:46,400: 143: 0 4 0 PNV-PCI-MSI 2416443400 Edge eth0-tx-3Quoted 2 lines
I feel e1000e suffices for this test, should i stay with e1000e or use igb here ?
or use a single cpu per socket config. Which seems better for the test.
Quoted 8 lines
Quoted 3 lines
Quoted 1 line
The test uses single cpu per socket, since i have
-smp 4,sockets=4,threads=1. Was this what you meant ?yes. or cores=1, as you wish.
sure, will add cores=1 for clarity.
do you have any further comments before i send a v4 with this change, and #include's removed ?
It looked ok.
Thanks,
C.
Re: [PATCH v3 1/8] tests/functional: Add remote interrupts test for PowerNV
In reply to Aditya GuptaDo you have any further comments before i send a v4 with the #include's removed ?
Thanks,
- Aditya G
PATCH v3 2/8 tests/qtest/pnv_spi: Test Power11 PNV_SPI
In reply to Aditya GuptaCurrently pnv-spi-seeprom-test was hardcoded to test the 4th chip in pnv_chips (power10 as of now).
This requires ensuring to update the index when removing/adding entries in pnv_chips, such as when Power8E or Power11 gets removed/added in future commits.
Iterate over all the chips instead, similar to other tests in pnv-xscom-test.c and pnv-host-i2c-test.c, but skip older chips, since TYPE_PNV_SPI only exists from Power10 onwards, hence skip older machines
Tests all the pnv_chips similar to other qtests
--- tests/qtest/pnv-spi-seeprom-test.c | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-)
tests/qtest/pnv-spi-seeprom-test.c +14 -6
@@ -77,6 +77,7 @@ static void test_spi_seeprom(const void *data)const PnvChip *chip = data;QTestState *qts =NULL ; g_autofree char *tmp_path = NULL; +const char *machine ="powernv10" ;int ret;int fd;
@@ -87,11 +88,11 @@ static void test_spi_seeprom(const void *data)g_assert (ret ==0 );close (fd); - qts =qtest_initf ("-machine powernv10 -smp 2,cores=2," + qts =qtest_initf ("-machine %s -smp 2,cores=2," "threads=1 -accel tcg,thread=single -nographic " "-blockdev node-name=pib_spic2,driver=file," "filename=%s -device 25csm04,bus=chip0.spi.2,cs=0," -"drive=pib_spic2" , tmp_path); +"drive=pib_spic2" , machine, tmp_path);spi_seeprom_transaction (qts, chip);qtest_quit (qts);unlink (tmp_path);
@@ -100,9 +101,16 @@ static void test_spi_seeprom(const void *data)int main (int argc,char **argv) {g_test_init (&argc, &argv,NULL ); -char *tname =g_strdup_printf ("pnv-xscom/spi-seeprom/%s" , - pnv_chips[3 ].cpu_model); -qtest_add_data_func (tname, &pnv_chips[3 ], test_spi_seeprom); -g_free (tname); + +for (int i =0 ; i <ARRAY_SIZE (pnv_chips); i++) { +/* TYPE_PNV_SPI is not instantiated for older Power8/9 machines */ +if (pnv_chips[i].chip_type <PNV_CHIP_POWER10 ) { +continue ; + } + + g_autofree char *tname = g_strdup_printf("pnv-xscom/spi-seeprom/%s", + pnv_chips[i].cpu_model); +qtest_add_data_func (tname, &pnv_chips[i], test_spi_seeprom); + }return g_test_run (); }
Signature · 1 line
2.54.0
PATCH v3 3/8 tests/qtest: Add Power11 chip & machine to qtests
In reply to Aditya GuptaPreviously the machines/chips tested by qtest was till Power10, update the tests to also test PowerNV11 and Power11 PNV Chip
Since if-else-if ladder was common pattern to get machine type, implement pnv_get_machine_type so new processor cases can be implemented in one location in pnv_get_machine_type
While at it, also add g_autofree to allocation by g_strdup_printf in modified tests
--- tests/qtest/pnv-host-i2c-test.c | 10 ++++------ tests/qtest/pnv-spi-seeprom-test.c | 2 +- tests/qtest/pnv-xive2-test.c | 2 +- tests/qtest/pnv-xscom-test.c | 22 +++++--------------- tests/qtest/pnv-xscom.h | 32 +++++++++++++++++++++++++++--- 5 files changed, 40 insertions(+), 28 deletions(-)
tests/qtest/pnv-host-i2c-test.c +4 -6
@@ -402,15 +402,14 @@ static void reset_all(QTestState *qts, const PnvChip *chip)static void test_host_i2c (const void *data) {const PnvChip *chip = data; +const char *machine =pnv_get_machine_type (chip->chip_type);QTestState *qts; -const char *machine ="powernv8" ;PnvI2cCtlr ctlr;PnvI2cDev pca9552;PnvI2cDev pca9554; -if (chip->chip_type ==PNV_CHIP_POWER9 ) { - machine ="powernv9" ; - }else if (chip->chip_type ==PNV_CHIP_POWER10 ) { +/* i2c is initialised for rainier in case of P10 */ +if (chip->chip_type ==PNV_CHIP_POWER10 ) { machine ="powernv10-rainier" ; }
@@ -473,10 +472,9 @@ static void add_test(const char *name, void (*test)(const void *data))int i;for (i =0 ; i <ARRAY_SIZE (pnv_chips); i++) { -char *tname =g_strdup_printf ("pnv-xscom/%s/%s" , name, + g_autofree char *tname = g_strdup_printf("pnv-xscom/%s/%s", name, pnv_chips[i].cpu_model);qtest_add_data_func (tname, &pnv_chips[i], test); -g_free (tname); } }
tests/qtest/pnv-spi-seeprom-test.c +1 -1
@@ -77,7 +77,7 @@ static void test_spi_seeprom(const void *data)const PnvChip *chip = data;QTestState *qts =NULL ; g_autofree char *tmp_path = NULL; -const char *machine ="powernv10" ; +const char *machine =pnv_get_machine_type (chip->chip_type);int ret;int fd;
tests/qtest/pnv-xive2-test.c +1 -1
@@ -548,7 +548,7 @@ static void test_xive(void) {QTestState *qts; - qts =qtest_initf ("-M powernv10 -smp %d,cores=1,threads=%d -nographic " + qts =qtest_initf ("-M powernv11 -smp %d,cores=1,threads=%d -nographic " "-nodefaults -serial mon:stdio -S " "-d guest_errors -trace '*xive*'" ,SMT ,SMT );
tests/qtest/pnv-xscom-test.c +5 -17
@@ -28,15 +28,9 @@ static void test_xscom_cfam_id(QTestState *qts, const PnvChip *chip)static void test_cfam_id (const void *data) {const PnvChip *chip = data; -const char *machine ="powernv8" ; +const char *machine =pnv_get_machine_type (chip->chip_type);QTestState *qts; -if (chip->chip_type ==PNV_CHIP_POWER9 ) { - machine ="powernv9" ; - }else if (chip->chip_type ==PNV_CHIP_POWER10 ) { - machine ="powernv10" ; - } - qts =qtest_initf ("-M %s -accel tcg -cpu %s" , machine, chip->cpu_model);test_xscom_cfam_id (qts, chip);
@@ -57,7 +51,8 @@ static void test_cfam_id(const void *data)static void test_xscom_core (QTestState *qts,const PnvChip *chip) { -if (chip->chip_type ==PNV_CHIP_POWER10 ) { +if ((chip->chip_type ==PNV_CHIP_POWER10 ) || + (chip->chip_type ==PNV_CHIP_POWER11 )) {uint32_t first_core_thread_state =PNV_XSCOM_P10_EC_BASE (chip->first_core) +0x412 ;uint64_t thread_state;
@@ -84,14 +79,8 @@ static void test_xscom_core(QTestState *qts, const PnvChip *chip)static void test_core (const void *data) {const PnvChip *chip = data; +const char *machine =pnv_get_machine_type (chip->chip_type);QTestState *qts; -const char *machine ="powernv8" ; - -if (chip->chip_type ==PNV_CHIP_POWER9 ) { - machine ="powernv9" ; - }else if (chip->chip_type ==PNV_CHIP_POWER10 ) { - machine ="powernv10" ; - } qts =qtest_initf ("-M %s -accel tcg -cpu %s" , machine, chip->cpu_model);
@@ -104,10 +93,9 @@ static void add_test(const char *name, void (*test)(const void *data))int i;for (i =0 ; i <ARRAY_SIZE (pnv_chips); i++) { -char *tname =g_strdup_printf ("pnv-xscom/%s/%s" , name, + g_autofree char *tname = g_strdup_printf("pnv-xscom/%s/%s", name, pnv_chips[i].cpu_model);qtest_add_data_func (tname, &pnv_chips[i], test); -g_free (tname); } }
tests/qtest/pnv-xscom.h +29 -3
@@ -9,6 +9,9 @@ #ifndef PNV_XSCOM_H #define PNV_XSCOM_H +#include <stdint.h> +#include <assert.h> + #define SMT 4 /* some tests will break if less than 4 */ typedef enum PnvChipType {
@@ -17,6 +20,7 @@ typedef enum PnvChipType {PNV_CHIP_POWER8NVL ,/* AKA Naples */ PNV_CHIP_POWER9 ,/* AKA Nimbus */ PNV_CHIP_POWER10 , +PNV_CHIP_POWER11 , } PnvChipType; typedef struct PnvChip {
@@ -60,15 +64,23 @@ static const PnvChip pnv_chips[] = { .first_core = 0x0, .num_i2c = 4, }, + { + .chip_type = PNV_CHIP_POWER11, + .cpu_model = "Power11", + .xscom_base = 0x000603fc00000000ull, + .cfam_id = 0x220da04980000000ull, + .first_core = 0x0, + .num_i2c = 0, + }, };static inline uint64_t pnv_xscom_addr (const PnvChip *chip,uint32_t pcba) {uint64_t addr = chip->xscom_base; -if (chip->chip_type ==PNV_CHIP_POWER10 ) { - addr |= ((uint64_t ) pcba <<3 ); - }else if (chip->chip_type ==PNV_CHIP_POWER9 ) { +if ((chip->chip_type ==PNV_CHIP_POWER11 ) || + (chip->chip_type ==PNV_CHIP_POWER10 ) || + (chip->chip_type ==PNV_CHIP_POWER9 )) { addr |= ((uint64_t ) pcba <<3 ); }else { addr |= (((uint64_t) pcba << 4) & ~0xffull) |
@@ -77,4 +89,18 @@ static inline uint64_t pnv_xscom_addr(const PnvChip *chip, uint32_t pcba) return addr; } +static const char *pnv_get_machine_type (enum PnvChipType chip_type) +{ +static const char *const machine_types[] = { + [PNV_CHIP_POWER8 ] ="powernv8" , + [PNV_CHIP_POWER9 ] ="powernv9" , + [PNV_CHIP_POWER10 ] ="powernv10" , + [PNV_CHIP_POWER11 ] ="powernv11" , + }; + +g_assert (chip_type <=PNV_CHIP_POWER11 ); + +return machine_types[chip_type]; +} +#endif /* PNV_XSCOM_H */
Signature · 1 line
2.54.0
Re: [PATCH v3 3/8] tests/qtest: Add Power11 chip & machine to qtests
Quoted 30 lines · Aditya Gupta
Previously the machines/chips tested by qtest was till Power10, update the tests to also test PowerNV11 and Power11 PNV Chip
Since if-else-if ladder was common pattern to get machine type, implement
pnv_get_machine_typeso new processor cases can be implemented in one location inpnv_get_machine_typeWhile at it, also add
g_autofreeto allocation byg_strdup_printfin modified testsSigned-off-by Aditya Gupta <[email protected]>--- tests/qtest/pnv-host-i2c-test.c | 10 ++++------ tests/qtest/pnv-spi-seeprom-test.c | 2 +- tests/qtest/pnv-xive2-test.c | 2 +- tests/qtest/pnv-xscom-test.c | 22 +++++--------------- tests/qtest/pnv-xscom.h | 32 +++++++++++++++++++++++++++--- 5 files changed, 40 insertions(+), 28 deletions(-)tests/qtest/pnv-host-i2c-test.c +1
-1@@ -402,15 +402,14 @@ static void reset_all(QTestState *qts, const PnvChip *chip)static void test_host_i2c (const void *data) {const PnvChip *chip = data; +const char *machine =pnv_get_machine_type (chip->chip_type);QTestState *qts; -const char *machine ="powernv8" ;
tests/qtest/pnv-host-i2c-test.c static void reset_all(QTestState *qts, const PnvChip *chip) · line 413
Quoted 10 lines
tests/qtest/pnv-host-i2c-test.c +2
-3PnvI2cCtlr ctlr;PnvI2cDev pca9552;PnvI2cDev pca9554; -if (chip->chip_type ==PNV_CHIP_POWER9 ) { - machine ="powernv9" ; - }else if (chip->chip_type ==PNV_CHIP_POWER10 ) { +/* i2c is initialised for rainier in case of P10 */ +if (chip->chip_type ==PNV_CHIP_POWER10 ) { machine ="powernv10-rainier" ;
Is that true for all tests ? in that case, pnv_get_machine_type() could return "powernv10-rainier".
Quoted 104 lines
tests/qtest/pnv-host-i2c-test.c +1
-2}@@ -473,10 +472,9 @@ static void add_test(const char *name, void (*test)(const void *data))int i;for (i =0 ; i <ARRAY_SIZE (pnv_chips); i++) { -char *tname =g_strdup_printf ("pnv-xscom/%s/%s" , name, + g_autofree char *tname = g_strdup_printf("pnv-xscom/%s/%s", name, pnv_chips[i].cpu_model);qtest_add_data_func (tname, &pnv_chips[i], test); -g_free (tname); } }tests/qtest/pnv-spi-seeprom-test.c +1
-1@@ -77,7 +77,7 @@ static void test_spi_seeprom(const void *data)const PnvChip *chip = data;QTestState *qts =NULL ; g_autofree char *tmp_path = NULL; -const char *machine ="powernv10" ; +const char *machine =pnv_get_machine_type (chip->chip_type);int ret;int fd;tests/qtest/pnv-xive2-test.c +1
-1@@ -548,7 +548,7 @@ static void test_xive(void) {QTestState *qts; - qts =qtest_initf ("-M powernv10 -smp %d,cores=1,threads=%d -nographic " + qts =qtest_initf ("-M powernv11 -smp %d,cores=1,threads=%d -nographic " "-nodefaults -serial mon:stdio -S " "-d guest_errors -trace '*xive*'" ,SMT ,SMT );tests/qtest/pnv-xscom-test.c +5
-17@@ -28,15 +28,9 @@ static void test_xscom_cfam_id(QTestState *qts, const PnvChip *chip)static void test_cfam_id (const void *data) {const PnvChip *chip = data; -const char *machine ="powernv8" ; +const char *machine =pnv_get_machine_type (chip->chip_type);QTestState *qts; -if (chip->chip_type ==PNV_CHIP_POWER9 ) { - machine ="powernv9" ; - }else if (chip->chip_type ==PNV_CHIP_POWER10 ) { - machine ="powernv10" ; - } - qts =qtest_initf ("-M %s -accel tcg -cpu %s" , machine, chip->cpu_model);test_xscom_cfam_id (qts, chip);@@ -57,7 +51,8 @@ static void test_cfam_id(const void *data)static void test_xscom_core (QTestState *qts,const PnvChip *chip) { -if (chip->chip_type ==PNV_CHIP_POWER10 ) { +if ((chip->chip_type ==PNV_CHIP_POWER10 ) || + (chip->chip_type ==PNV_CHIP_POWER11 )) {uint32_t first_core_thread_state =PNV_XSCOM_P10_EC_BASE (chip->first_core) +0x412 ;uint64_t thread_state;@@ -84,14 +79,8 @@ static void test_xscom_core(QTestState *qts, const PnvChip *chip)static void test_core (const void *data) {const PnvChip *chip = data; +const char *machine =pnv_get_machine_type (chip->chip_type);QTestState *qts; -const char *machine ="powernv8" ; - -if (chip->chip_type ==PNV_CHIP_POWER9 ) { - machine ="powernv9" ; - }else if (chip->chip_type ==PNV_CHIP_POWER10 ) { - machine ="powernv10" ; - } qts =qtest_initf ("-M %s -accel tcg -cpu %s" , machine, chip->cpu_model);@@ -104,10 +93,9 @@ static void add_test(const char *name, void (*test)(const void *data))int i;for (i =0 ; i <ARRAY_SIZE (pnv_chips); i++) { -char *tname =g_strdup_printf ("pnv-xscom/%s/%s" , name, + g_autofree char *tname = g_strdup_printf("pnv-xscom/%s/%s", name, pnv_chips[i].cpu_model);qtest_add_data_func (tname, &pnv_chips[i], test); -g_free (tname); } }tests/qtest/pnv-xscom.h +0
-0
tests/qtest/pnv-xscom.h line 13
Quoted 5 lines
tests/qtest/pnv-xscom.h +2
-0@@ -9,6 +9,9 @@#ifndef PNV_XSCOM_H #define PNV_XSCOM_H +#include <stdint.h> +#include <assert.h>
Seems unrelated. Why do you need these includes ?
Thanks,
C.
Quoted 58 lines
tests/qtest/pnv-xscom.h +27
-3+#define SMT 4/* some tests will break if less than 4 */ typedef enum PnvChipType {@@ -17,6 +20,7 @@ typedef enum PnvChipType {PNV_CHIP_POWER8NVL ,/* AKA Naples */ PNV_CHIP_POWER9 ,/* AKA Nimbus */ PNV_CHIP_POWER10 , +PNV_CHIP_POWER11 , } PnvChipType; typedef struct PnvChip {@@ -60,15 +64,23 @@ static const PnvChip pnv_chips[] = { .first_core = 0x0, .num_i2c = 4, }, + { + .chip_type = PNV_CHIP_POWER11, + .cpu_model = "Power11", + .xscom_base = 0x000603fc00000000ull, + .cfam_id = 0x220da04980000000ull, + .first_core = 0x0, + .num_i2c = 0, + }, };static inline uint64_t pnv_xscom_addr (const PnvChip *chip,uint32_t pcba) {uint64_t addr = chip->xscom_base; -if (chip->chip_type ==PNV_CHIP_POWER10 ) { - addr |= ((uint64_t ) pcba <<3 ); - }else if (chip->chip_type ==PNV_CHIP_POWER9 ) { +if ((chip->chip_type ==PNV_CHIP_POWER11 ) || + (chip->chip_type ==PNV_CHIP_POWER10 ) || + (chip->chip_type ==PNV_CHIP_POWER9 )) { addr |= ((uint64_t ) pcba <<3 ); }else { addr |= (((uint64_t) pcba << 4) & ~0xffull) |@@ -77,4 +89,18 @@ static inline uint64_t pnv_xscom_addr(const PnvChip *chip, uint32_t pcba) return addr; } +static const char *pnv_get_machine_type (enum PnvChipType chip_type) +{ +static const char *const machine_types[] = { + [PNV_CHIP_POWER8 ] ="powernv8" , + [PNV_CHIP_POWER9 ] ="powernv9" , + [PNV_CHIP_POWER10 ] ="powernv10" , + [PNV_CHIP_POWER11 ] ="powernv11" , + }; + +g_assert (chip_type <=PNV_CHIP_POWER11 ); + +return machine_types[chip_type]; +} +#endif /* PNV_XSCOM_H */
Re: [PATCH v3 3/8] tests/qtest: Add Power11 chip & machine to qtests
Quoted 15 lines · Cédric Le Goater
Quoted 14 lines · Aditya Gupta
<...snip...>
tests/qtest/pnv-host-i2c-test.c +1
-2@@ -402,15 +402,14 @@ static void reset_all(QTestState *qts, const PnvChip *chip)static void test_host_i2c (const void *data) {const PnvChip *chip = data; +const char *machine =pnv_get_machine_type (chip->chip_type);QTestState *qts; -const char *machine ="powernv8" ;PnvI2cCtlr ctlr;PnvI2cDev pca9552;PnvI2cDev pca9554; -if (chip->chip_type ==PNV_CHIP_POWER9 ) {
Quoted 9 lines
tests/qtest/pnv-host-i2c-test.c static void reset_all(QTestState *qts, const PnvChip *chip) · line 413
Quoted 5 lines
tests/qtest/pnv-host-i2c-test.c +2
-2- machine ="powernv9" ; - }else if (chip->chip_type ==PNV_CHIP_POWER10 ) { +/* i2c is initialised for rainier in case of P10 */ +if (chip->chip_type ==PNV_CHIP_POWER10 ) { machine ="powernv10-rainier" ;Is that true for all tests ? in that case,
pnv_get_machine_type()could return "powernv10-rainier".
No this i2c test is the only test which specifically requires rainier, other tests like pnv-spi-seeprom-test and pnv-xscom-test.
Quoted 14 lines
tests/qtest/pnv-xscom.h line 12
Quoted 11 lines
<...snip...>
tests/qtest/pnv-xscom.h +2
-0@@ -9,6 +9,9 @@#ifndef PNV_XSCOM_H #define PNV_XSCOM_H +#include <stdint.h> +#include <assert.h> Seems unrelated. Why do you need these includes ?
Not really cedric, i had added stdint.h since PnvChip used uint64_t, and assert.h since i used assert in v1 & v2, which is not the case now. I can remove these in v4.
Thanks for the reviews Cedric !
Quoted 4 lines
Thanks,
C.
PATCH v3 4/8 tests/functional: Use default powernv machine instead of power10
In reply to Aditya GuptaThe default powernv machine has been recently changed to powernv11, though fadump functional test used powernv10
Change it to use default 'powernv' machine for the tests instead of being fixed to powernv10
--- tests/functional/ppc64/test_fadump.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
tests/functional/ppc64/test_fadump.py +1 -1
@@ -53,7 +53,7 @@ def do_test_fadump(self, is_kvm=False, is_powernv=False): self.require_accelerator("tcg") if is_powernv: - self.set_machine("powernv10") + self.set_machine("powernv") else: # SLOF takes upto >20s in startup time, use VOF self.set_machine("pseries")
Signature · 1 line
2.54.0
PATCH v3 5/8 ppc/pnv: Replace Power8E with Power11 for 'none' machine test
In reply to Aditya GuptaPower8E and Power8NVL were deprecated since QEMU 10.1, with commit 264a604e7163 ("target/ppc: Deprecate Power8E and Power8NVL")
As Power8E chip is removed in future commits, remove the use of Power8E chip for use with the none machine test, and replace with Power11 for ppc64 test coverage for the test
--- tests/qtest/machine-none-test.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
tests/qtest/machine-none-test.c +1 -1
@@ -38,7 +38,7 @@ static struct arch2cpu cpus_map[] = { { "mips64el", "I6500" }, { "or1k", "or1200" }, { "ppc", "604" }, - { "ppc64", "power8e_v2.1" }, + { "ppc64", "power11_v2.0" }, { "s390x", "qemu" }, { "sh4", "sh7750r" }, { "sh4eb", "sh7751r" },
Signature · 1 line
2.54.0
PATCH v3 6/8 ppc/pnv: Remove Power8E and Power8NVL pnv chips
In reply to Aditya GuptaPower8E and Power8NVL were deprecated since QEMU 10.1, with commit 264a604e7163 ("target/ppc: Deprecate Power8E and Power8NVL")
Accordingly, remove usage of 8E and 8NVL chips from powernv, as it's old and unmaintained now.
--- docs/system/ppc/powernv.rst | 2 +- hw/ppc/pnv.c | 62 ------------------------------------- hw/ppc/pnv_core.c | 2 -- include/hw/ppc/pnv.h | 8 ----- tests/qtest/pnv-xscom.h | 9 ------ 5 files changed, 1 insertion(+), 82 deletions(-)
docs/system/ppc/powernv.rst +1 -1
@@ -15,7 +15,7 @@ beyond the scope of what QEMU addresses today. Supported devices ----------------- - * Multi processor support for POWER8, POWER8NVL, POWER9, Power10 and Power11. + * Multi processor support for POWER8, POWER9, Power10 and Power11. * XSCOM, serial communication sideband bus to configure chiplets. * Simple LPC Controller. * Processor Service Interface (PSI) Controller.
hw/ppc/pnv.c +0 -62
92 lines not on this page · raw message
hw/ppc/pnv_core.c +0 -2
@@ -515,9 +515,7 @@ static const TypeInfo pnv_core_infos[] = { .class_init = pnv_core_class_init, .abstract = true, }, -DEFINE_PNV_CORE_TYPE (power8,"power8e_v2.1" ),DEFINE_PNV_CORE_TYPE (power8,"power8_v2.0" ), -DEFINE_PNV_CORE_TYPE (power8,"power8nvl_v1.0" ),DEFINE_PNV_CORE_TYPE (power9,"power9_v2.2" ),DEFINE_PNV_CORE_TYPE (power10,"power10_v2.0" ), DEFINE_PNV_CORE_TYPE(power11, "power11_v2.0"),
include/hw/ppc/pnv.h +0 -8
@@ -39,18 +39,10 @@ typedef struct Pnv10Chip Pnv11Chip;#define PNV_CHIP_TYPE_SUFFIX "-" TYPE_PNV_CHIP#define PNV_CHIP_TYPE_NAME (cpu_model) cpu_model PNV_CHIP_TYPE_SUFFIX -#define TYPE_PNV_CHIP_POWER8E PNV_CHIP_TYPE_NAME("power8e_v2.1") -DECLARE_INSTANCE_CHECKER (PnvChip,PNV_CHIP_POWER8E , - TYPE_PNV_CHIP_POWER8E) -#define TYPE_PNV_CHIP_POWER8 PNV_CHIP_TYPE_NAME("power8_v2.0")DECLARE_INSTANCE_CHECKER (PnvChip,PNV_CHIP_POWER8 , TYPE_PNV_CHIP_POWER8) -#define TYPE_PNV_CHIP_POWER8NVL PNV_CHIP_TYPE_NAME("power8nvl_v1.0") -DECLARE_INSTANCE_CHECKER (PnvChip,PNV_CHIP_POWER8NVL , - TYPE_PNV_CHIP_POWER8NVL) -#define TYPE_PNV_CHIP_POWER9 PNV_CHIP_TYPE_NAME("power9_v2.2")DECLARE_INSTANCE_CHECKER (PnvChip,PNV_CHIP_POWER9 ,TYPE_PNV_CHIP_POWER9 )
tests/qtest/pnv-xscom.h +0 -9
@@ -15,9 +15,7 @@#define SMT 4/* some tests will break if less than 4 */ typedef enum PnvChipType { - PNV_CHIP_POWER8E, /* AKA Murano (default) */ PNV_CHIP_POWER8, /* AKA Venice */ - PNV_CHIP_POWER8NVL, /* AKA Naples */ PNV_CHIP_POWER9, /* AKA Nimbus */ PNV_CHIP_POWER10, PNV_CHIP_POWER11,
@@ -40,13 +38,6 @@ static const PnvChip pnv_chips[] = { .cfam_id = 0x220ea04980000000ull, .first_core = 0x1, .num_i2c = 0, - }, { - .chip_type = PNV_CHIP_POWER8NVL, - .cpu_model = "POWER8NVL", - .xscom_base = 0x0003fc0000000000ull, - .cfam_id = 0x120d304980000000ull, - .first_core = 0x1, - .num_i2c = 0, }, { .chip_type = PNV_CHIP_POWER9,
Signature · 1 line
2.54.0
PATCH v3 7/8 ppc/pnv: Remove Power8E and Power8NVL CPUs
In reply to Aditya GuptaPower8E and Power8NVL were deprecated since QEMU 10.1, with commit 264a604e7163 ("target/ppc: Deprecate Power8E and Power8NVL")
Remove the corresponding 8E and 8NVL CPU cores from spapr/pseries
Also, with no use of 8E and 8NVL, in powernv chips or spapr cores, remove the CPU definitions for the cores
--- docs/about/deprecated.rst | 9 --------- docs/about/removed-features.rst | 8 ++++++++ docs/system/ppc/pseries.rst | 2 +- hw/ppc/spapr_cpu_core.c | 2 -- target/ppc/cpu-models.c | 6 ------ target/ppc/cpu-models.h | 4 ---- target/ppc/cpu_init.c | 6 ------ target/ppc/kvm.c | 4 +--- 8 files changed, 10 insertions(+), 31 deletions(-)
docs/about/deprecated.rst +0 -9
@@ -215,15 +215,6 @@ embedded 405 for power management (OCC) and other internal tasks, it is theoretically possible to use QEMU to model them. Let's keep the CPU implementation for a while before removing all support. -Power8E and Power8NVL CPUs and corresponding Pnv chips (since 10.1) -''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' - -The Power8E and Power8NVL variants of Power8 are not really useful anymore -in qemu, and are old and unmaintained now. - -The CPUs as well as corresponding Power8NVL and Power8E PnvChips will also -be considered deprecated. - System emulator machines ------------------------
docs/about/removed-features.rst +8 -0
@@ -1038,6 +1038,14 @@ initial RISC-V QEMU port. Its usage was always been unclear: users don't know what to expect from a CPU called 'any', and in fact the CPU does not do anything special that isn't already done by the default CPUs rv32/rv64. +Power8E and Power8NVL CPUs (removed in 11.1) +'''''''''''''''''''''''''''''''''''''''''''' + +The Power8E and Power8NVL variants of Power8 are not really useful anymore +in qemu, and are old and unmaintained. +Hence, the CPUs as well as corresponding Power8NVL and Power8E PnvChips have +been removed + System accelerators -------------------
docs/system/ppc/pseries.rst +1 -1
@@ -16,7 +16,7 @@ Supported devices * Multi processor support for many Power processors generations: - POWER7, POWER7+ - - POWER8, POWER8NVL + - POWER8 - POWER9 - Power10 - Power11
hw/ppc/spapr_cpu_core.c +0 -2
@@ -408,8 +408,6 @@ static const TypeInfo spapr_cpu_core_type_infos[] = {DEFINE_SPAPR_CPU_CORE_TYPE ("power7_v2.3" ),DEFINE_SPAPR_CPU_CORE_TYPE ("power7p_v2.1" ),DEFINE_SPAPR_CPU_CORE_TYPE ("power8_v2.0" ), -DEFINE_SPAPR_CPU_CORE_TYPE ("power8e_v2.1" ), -DEFINE_SPAPR_CPU_CORE_TYPE ("power8nvl_v1.0" ),DEFINE_SPAPR_CPU_CORE_TYPE ("power9_v2.0" ),DEFINE_SPAPR_CPU_CORE_TYPE ("power9_v2.2" ), DEFINE_SPAPR_CPU_CORE_TYPE("power10_v2.0"),
target/ppc/cpu-models.c +0 -6
@@ -734,12 +734,8 @@ "POWER7 v2.3") POWERPC_DEF("power7p_v2.1", CPU_POWERPC_POWER7P_v21, POWER7, "POWER7+ v2.1") - POWERPC_DEPRECATED_CPU("power8e_v2.1", CPU_POWERPC_POWER8E_v21, POWER8, - "POWER8E v2.1", "CPU is unmaintained.") POWERPC_DEF("power8_v2.0", CPU_POWERPC_POWER8_v20, POWER8, "POWER8 v2.0") - POWERPC_DEPRECATED_CPU("power8nvl_v1.0", CPU_POWERPC_POWER8NVL_v10, POWER8, - "POWER8NVL v1.0", "CPU is unmaintained.") POWERPC_DEF("power9_v2.0", CPU_POWERPC_POWER9_DD20, POWER9, "POWER9 v2.0") POWERPC_DEF("power9_v2.2", CPU_POWERPC_POWER9_DD22, POWER9,
@@ -918,9 +914,7 @@ PowerPCCPUAlias ppc_cpu_aliases[] = { { "power7", "power7_v2.3" }, { "power7+", "power7p_v2.1" }, { "power7+_v2.1", "power7p_v2.1" }, - { "power8e", "power8e_v2.1" }, { "power8", "power8_v2.0" }, - { "power8nvl", "power8nvl_v1.0" }, { "power9", "power9_v2.2" }, { "power10", "power10_v2.0" }, { "power11", "power11_v2.0" },
target/ppc/cpu-models.h +0 -4
@@ -341,12 +341,8 @@ enum { CPU_POWERPC_POWER7_v23 =0x003F0203 ,CPU_POWERPC_POWER7P_BASE =0x004A0000 , CPU_POWERPC_POWER7P_v21 =0x004A0201 , -CPU_POWERPC_POWER8E_BASE =0x004B0000 , - CPU_POWERPC_POWER8E_v21 =0x004B0201 ,CPU_POWERPC_POWER8_BASE =0x004D0000 , CPU_POWERPC_POWER8_v20 =0x004D0200 , -CPU_POWERPC_POWER8NVL_BASE =0x004C0000 , - CPU_POWERPC_POWER8NVL_v10 =0x004C0100 ,CPU_POWERPC_POWER9_BASE =0x004E0000 ,CPU_POWERPC_POWER9_DD1 =0x004E1100 , CPU_POWERPC_POWER9_DD20 = 0x004E1200,
target/ppc/cpu_init.c +0 -6
@@ -6311,12 +6311,6 @@ static bool ppc_pvr_match_power8(PowerPCCPUClass *pcc, uint32_t pvr, bool best)if (base ==CPU_POWERPC_POWER8_BASE ) {return true; } -if (base ==CPU_POWERPC_POWER8E_BASE ) { -return true; - } -if (base ==CPU_POWERPC_POWER8NVL_BASE ) { -return true; - } }if (base != pcc_base) {return false;
target/ppc/kvm.c +1 -3
@@ -2437,9 +2437,7 @@ static bool kvmppc_power8_host(void)#ifdef TARGET_PPC64 {uint32_t base_pvr =CPU_POWERPC_POWER_SERVER_MASK &mfpvr (); - ret = (base_pvr ==CPU_POWERPC_POWER8E_BASE ) || - (base_pvr ==CPU_POWERPC_POWER8NVL_BASE ) || - (base_pvr ==CPU_POWERPC_POWER8_BASE ); + ret = (base_pvr ==CPU_POWERPC_POWER8_BASE ); }#endif /* TARGET_PPC64 */ return ret;
Signature · 1 line
2.54.0
PATCH v3 8/8 MAINTAINERS: Add self as maintainer for PowerNV
In reply to Aditya GuptaAdd myself as maintainer for PowerNV machine, and remove the reviewer entry
--- MAINTAINERS | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
MAINTAINERS +1 -1
@@ -1647,7 +1647,7 @@ F: tests/functional/ppc64/test_tuxrun.py PowerNV (Non-Virtualized) M: Nicholas Piggin <[email protected]> -R: Aditya Gupta <[email protected]> +M: Aditya Gupta <[email protected]> R: Glenn Miles <[email protected]> R: Harsh Prateek Bora <[email protected]> L: [email protected]
Signature · 1 line
2.54.0
Quoted 97 lines · Aditya Gupta
Overview
========This patch series merged two patch series sent earlier:
"Testcase improvements for PowerNV"
"Remove deprecated Power8E and 8NVL CPUs"
since the Power8E removal series depended on the former due to pnv-spi testBroadly contains 3 changes:
1. Testcase improvements:
Add a testcase to detect regression in remote interrupts when XIVE
changes,
since such regression had occurred during Power11 XIVE changes:https://lore.kernel.org/qemu-devel/[email protected]/
Also add Power11 chip and testcase in qtests, and fadump functional
test2. Power8E/Power8NVL removal
Power8E and Power8NVL were deprecated since QEMU 10.1, with commit264a604e7163("target/ppc: Deprecate Power8E and Power8NVL")Hence, remove usage (chip and core types) of Power8E and 8NVL from
PowerNV,
PSeries as well as testcases.3. Maintainer changes
Add myself as maintainer for PowerNV machineTesting
=======* Git tree for testing:
https://gitlab.com/adi-g15-ibm/qemu/tree/feat_maintainer-v3
* Gitlab pipeline: https://gitlab.com/adi-g15-ibm/qemu/-/pipelines/2635562383
* Successful ppc64 functional tests, qtests, boot tests, builds at all commitsChangelog
=========
v3:
+ #3: usemachine_typearray inpnv_xscom_addr, as suggested by shivang, harsh and balatonv2:
+ #1: put e1000e on socket 1, and disable it's cpu, as suggested by cedric
+ #1: pull out command fail checks into a helper, as suggested by shivang
+ #2: useg_autofree, suggested by cedric
+ #3: useg_autofreein tests updated
+ #8: remove G:, as suggested by daniel
+ rebased to upstreamfrom previous split series:
+ #1: added checks to see if network is up and interrupts happened, based on shivang's review
+ #3: replaced common if-else-if check for machine type withpnv_get_machine_type
+ #7: added doc in removed-features, as suggested by cedric
+ #6,7: added rb from philippe
+ #8: new patch, maintainer changeAditya Gupta (8):
tests/functional: Add remote interrupts test for PowerNV tests/qtest/pnv_spi: Test Power11PNV_SPItests/qtest: Add Power11 chip & machine to qtests tests/functional: Use default powernv machine instead of power10 ppc/pnv: Replace Power8E with Power11 for 'none' machine test ppc/pnv: Remove Power8E and Power8NVL pnv chips ppc/pnv: Remove Power8E and Power8NVL CPUs
MAINTAINERS: Add self as maintainer for PowerNVMAINTAINERS | 2 +- docs/about/deprecated.rst | 9 --- docs/about/removed-features.rst | 8 +++ docs/system/ppc/powernv.rst | 2 +- docs/system/ppc/pseries.rst | 2 +- hw/ppc/pnv.c | 62 ----------------- hw/ppc/pnv_core.c | 2 - hw/ppc/spapr_cpu_core.c | 2 - include/hw/ppc/pnv.h | 8 --- target/ppc/cpu-models.c | 6 -- target/ppc/cpu-models.h | 4 -- target/ppc/cpu_init.c | 6 -- target/ppc/kvm.c | 4 +- tests/functional/ppc64/test_fadump.py | 2 +- tests/functional/ppc64/test_powernv.py | 95 ++++++++++++++++++++++++++ tests/qtest/machine-none-test.c | 2 +- tests/qtest/pnv-host-i2c-test.c | 10 ++- tests/qtest/pnv-spi-seeprom-test.c | 20 ++++-- tests/qtest/pnv-xive2-test.c | 2 +- tests/qtest/pnv-xscom-test.c | 22 ++---- tests/qtest/pnv-xscom.h | 41 +++++++---- 21 files changed, 162 insertions(+), 149 deletions(-)
Quoted 1 line
base-commit:
20553466cc47af6a8c95f665b601fce3c852e503
Hi Aditya,
I've tested the v3 patch series on PowerNV and pSeries guests including the new remote interrupts functional test and Power8E/NVL removal.
Testing Environment:
- Host: Fedora 42 ppc64le
- Arch: ppc64le
- QEMU: emulator version 11.0.50 (v11.0.0-2400-g20553466cc-dirty)
PowerNV Guest Bringup
Status: Success
qemu-system-ppc64 -name test-vm -machine powernv -m 4096 -smp 4 -nographic -kernel ~/.cache/qemu/download/6fd29aff9ad4362511ea5d0acbb510667c7031928e97d64ec15bbc5daf4b8151 -drive file=~/.cache/qemu/download/aee2192b692077c4bde31cb56ce474424b358f17cec323d5c94af3970c9aada2,format=raw,if=none,id=drive0,readonly=on -device nvme,drive=drive0,bus=pcie.2,addr=0x0,serial=1234 -append "root=/dev/nvme0n1 console=tty0 console=hvc0"
PSeries Guest Bringup
Status: Success
qemu-system-ppc64 -name test-vm -machine pseries,accel=kvm -m 4096 smp 8,sockets=1,cores=8,threads=1 -nographic -serial mon:stdio -drive file=/home/kvmci/tests/data/avocado-vt/images/rhel8.0devel-ppc64le.qcow2,if=virtio,format=qcow2 -netdev bridge,id=net0,br=virbr0 -device virtio-net-pci,netdev=net0
Power8E/NVL Removal Verification
Status: Success (both correctly rejected after removal)
qemu-system-ppc64: unable to find CPU model 'power8e_v2.1'
qemu-system-ppc64: unable to find CPU model 'power8nvl_v1.0'
QEMU Functional Test Results (make check-functional-ppc64)
Status: Success Ok: 12 Fail: 0 Skipped: 4
QEMU Unit Test Results (make check-qtest-ppc64)
Status: Success Ok: 33 Fail: 0 Skipped: 0
Result: All tests passed successfully.
Thanks,
Misbah Anjum N
Quoted 46 lines · Misbah Anjum N
Quoted 3 lines · Aditya Gupta
<...snip...>
base-commit:
20553466cc47af6a8c95f665b601fce3c852e503Hi Aditya,
I've tested the v3 patch series on PowerNV and pSeries guests including the new remote interrupts functional test and Power8E/NVL removal.
Testing Environment:
- Host: Fedora 42 ppc64le
- Arch: ppc64le
- QEMU: emulator version 11.0.50 (v11.0.0-2400-g20553466cc-dirty)PowerNV Guest Bringup
Status: Success
qemu-system-ppc64 -name test-vm -machine powernv -m 4096 -smp 4
-nographic -kernel
~/.cache/qemu/download/6fd29aff9ad4362511ea5d0acbb510667c7031928e97d64ec15bbc5daf4b8151
-drive file=~/.cache/qemu/download/aee2192b692077c4bde31cb56ce474424b358f17cec323d5c94af3970c9aada2,format=raw,if=none,id=drive0,readonly=on -device nvme,drive=drive0,bus=pcie.2,addr=0x0,serial=1234 -append
"root=/dev/nvme0n1 console=tty0 console=hvc0"PSeries Guest Bringup
Status: Success
qemu-system-ppc64 -name test-vm -machine pseries,accel=kvm -m 4096 smp 8,sockets=1,cores=8,threads=1 -nographic -serial mon:stdio -drive file=/home/kvmci/tests/data/avocado-vt/images/rhel8.0devel-ppc64le.qcow2,if=virtio,format=qcow2 -netdev bridge,id=net0,br=virbr0 -device virtio-net-pci,netdev=net0Power8E/NVL Removal Verification
Status: Success (both correctly rejected after removal)
qemu-system-ppc64: unable to find CPU model 'power8e_v2.1'
qemu-system-ppc64: unable to find CPU model 'power8nvl_v1.0'QEMU Functional Test Results (make check-functional-ppc64)
Status: Success
Ok: 12
Fail: 0
Skipped: 4QEMU Unit Test Results (make check-qtest-ppc64)
Status: Success
Ok: 33
Fail: 0
Skipped: 0
Quoted 3 lines
Result: All tests passed successfully.
Tested-by Misbah Anjum N <[email protected]>
Thank you for thoroughly testing this misbah !
- Aditya G
Quoted 3 lines
Thanks,
Misbah Anjum N