Testcase improvements and Power8E/NVL removal
cover Testcase improvements and Power8E/NVL removal
Overview
========
This patch series merges 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_refresh
* Gitlab pipeline: https://gitlab.com/adi-g15-ibm/qemu/-/pipelines/2622995621
* Successful ppc64 functional tests, qtests, boot tests, builds at all commits
Changelog
=========
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 | 3 +- 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 | 86 ++++++++++++++++++++++++++ tests/qtest/machine-none-test.c | 2 +- tests/qtest/pnv-host-i2c-test.c | 7 +-- tests/qtest/pnv-spi-seeprom-test.c | 21 +++++-- tests/qtest/pnv-xive2-test.c | 2 +- tests/qtest/pnv-xscom-test.c | 19 ++---- tests/qtest/pnv-xscom.h | 42 +++++++++---- 21 files changed, 154 insertions(+), 145 deletions(-)
base-commit: b83371668192a705b878e909c5ae9c1233cbd5fb
Signature · 1 line
2.54.0
PATCH 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 | 86 ++++++++++++++++++++++++++ 1 file changed, 86 insertions(+)
tests/functional/ppc64/test_powernv.py +86 -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,9 @@ class PowernvMachine(LinuxKernelTest): 'buildroot/qemu_ppc64le_powernv8-2025.02/rootfs.ext2'), 'aee2192b692077c4bde31cb56ce474424b358f17cec323d5c94af3970c9aada2') + def helper_exec_shell_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 +75,88 @@ 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 more sockets with as few CPUs as possible, increasing the + # probability to have remote interrupts from one chip to another + # also have e1000e network device to generate interrupts + self.vm.add_args('-smp', '4,sockets=4,threads=1') + self.vm.add_args('-device', 'e1000e,netdev=net0') + self.vm.add_args('-netdev', 'user,id=net0') + + 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) + + # RX, TX interrupts to chip/cpu 1 & 2 respectively + self.helper_exec_shell_command( + "export RX_IRQ=$(awk '/eth0-rx/ {print $1}' /proc/interrupts | tr -d ':')") + self.helper_exec_shell_command( + "export TX_IRQ=$(awk '/eth0-tx/ {print $1}' /proc/interrupts | tr -d ':')") + self.helper_exec_shell_command("echo 1 > /proc/irq/$RX_IRQ/smp_affinity_list") + self.helper_exec_shell_command("echo 2 > /proc/irq/$TX_IRQ/smp_affinity_list") + + # Capture interrupt counts before generating traffic + self.helper_exec_shell_command( + "export RX_BEFORE=$(awk '/eth0-rx/ {print $3}' /proc/interrupts)") + self.helper_exec_shell_command( + "export TX_BEFORE=$(awk '/eth0-tx/ {print $4}' /proc/interrupts)") + + # Wait up to 15 seconds for eth0 link to come up + self.helper_exec_shell_command( + "c=0; while ! ip addr show eth0 | grep 'inet 10.0.2'; do " + "sleep 1; c=$((c+1)); [ $c -gt 15 ] && break; done") + + fail_msg="Fail" + self.helper_exec_shell_command(f"export FAIL={fail_msg}") + exec_command_and_wait_for_pattern(self, + "ip addr show eth0 | grep 'inet 10.0.2' || echo $FAIL", + '#', fail_msg) + + # Generate network traffic to trigger remote interrupts + # Ping QEMU's user-mode network gateway (10.0.2.2) + self.helper_exec_shell_command("ping -W2 -c5 10.0.2.2") + + # Show final interrupt counts to verify remote interrupts occurred + self.helper_exec_shell_command("cat /proc/interrupts | grep eth0") + + # Verify interrupt counts increased (whether interrupts were delivered) + self.helper_exec_shell_command( + "export RX_AFTER=$(awk '/eth0-rx/ {print $3}' /proc/interrupts)") + self.helper_exec_shell_command( + "export TX_AFTER=$(awk '/eth0-tx/ {print $4}' /proc/interrupts)") + + # Check that interrupt counts increased + success_msg = "Interrupts increased" + self.helper_exec_shell_command(f"export PASS='{success_msg}'") + + exec_command_and_wait_for_pattern(self, + "[ $RX_AFTER -gt $RX_BEFORE ] && echo $PASS || echo $FAIL", + success_msg, fail_msg) + exec_command_and_wait_for_pattern(self, + "[ $TX_AFTER -gt $TX_BEFORE ] && echo $PASS || echo $FAIL", + success_msg, fail_msg) + 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 1/8] tests/functional: Add remote interrupts test for PowerNV
Quoted 4 lines · Aditya Gupta
+ # Check that interrupt counts increased
+success_msg= "Interrupts increased"
+ self.helper_exec_shell_command(f"export
PASS='{success_msg}'")
This is a great idea. Maybe in future we can pull this to a saperate function? something like the following.
self.is_booted = True
shell_check_pass_fail_command("asdf")
~Shivang.
Re: [PATCH 1/8] tests/functional: Add remote interrupts test for PowerNV
Quoted 10 lines · Shivang Upadhyay
Quoted 4 lines · Aditya Gupta
+ # Check that interrupt counts increased
+success_msg= "Interrupts increased"
+ self.helper_exec_shell_command(f"export
PASS='{success_msg}'")This is a great idea. Maybe in future we can pull this to a saperate function? something like the following.
self.is_booted = True
shell_check_pass_fail_command("asdf")
Makes sense. Will have a helper in v2.
Thanks,
- Aditya G
Quoted 2 lines
~Shivang.
Re: [PATCH 1/8] tests/functional: Add remote interrupts test for PowerNV
In reply to Aditya GuptaQuoted 47 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, 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]/
Signed-off-by Aditya Gupta <[email protected]>--- tests/functional/ppc64/test_powernv.py | 86 ++++++++++++++++++++++++++ 1 file changed, 86 insertions(+)tests/functional/ppc64/test_powernv.py +4
-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,9 @@ class PowernvMachine(LinuxKernelTest): 'buildroot/qemu_ppc64le_powernv8-2025.02/rootfs.ext2'), 'aee2192b692077c4bde31cb56ce474424b358f17cec323d5c94af3970c9aada2') + def helper_exec_shell_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()
tests/functional/ppc64/test_powernv.py def test_linux_smt_boot(self): · line 84
Quoted 10 lines
tests/functional/ppc64/test_powernv.py +7
-0@@ -71,6 +75,88 @@ 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 more sockets with as few CPUs as possible, increasing the + # probability to have remote interrupts from one chip to another + # also have e1000e network device to generate interrupts
Can you attach the PCI device to a PCI bus known to be on the second socket ? and then offline cpus on the second socket, so that all IRQ servers are on the first socket.
Quoted 78 lines
tests/functional/ppc64/test_powernv.py +75
-0+ self.vm.add_args('-smp', '4,sockets=4,threads=1') + self.vm.add_args('-device', 'e1000e,netdev=net0') + self.vm.add_args('-netdev', 'user,id=net0') + + 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) + + # RX, TX interrupts to chip/cpu 1 & 2 respectively + self.helper_exec_shell_command( + "export RX_IRQ=$(awk '/eth0-rx/ {print $1}' /proc/interrupts | tr -d ':')") + self.helper_exec_shell_command( + "export TX_IRQ=$(awk '/eth0-tx/ {print $1}' /proc/interrupts | tr -d ':')") + self.helper_exec_shell_command("echo 1 > /proc/irq/$RX_IRQ/smp_affinity_list") + self.helper_exec_shell_command("echo 2 > /proc/irq/$TX_IRQ/smp_affinity_list") + + # Capture interrupt counts before generating traffic + self.helper_exec_shell_command( + "export RX_BEFORE=$(awk '/eth0-rx/ {print $3}' /proc/interrupts)") + self.helper_exec_shell_command( + "export TX_BEFORE=$(awk '/eth0-tx/ {print $4}' /proc/interrupts)") + + # Wait up to 15 seconds for eth0 link to come up + self.helper_exec_shell_command( + "c=0; while ! ip addr show eth0 | grep 'inet 10.0.2'; do " + "sleep 1; c=$((c+1)); [ $c -gt 15 ] && break; done") + + fail_msg="Fail" + self.helper_exec_shell_command(f"export FAIL={fail_msg}") + exec_command_and_wait_for_pattern(self, + "ip addr show eth0 | grep 'inet 10.0.2' || echo $FAIL", + '#', fail_msg) + + # Generate network traffic to trigger remote interrupts + # Ping QEMU's user-mode network gateway (10.0.2.2) + self.helper_exec_shell_command("ping -W2 -c5 10.0.2.2") + + # Show final interrupt counts to verify remote interrupts occurred + self.helper_exec_shell_command("cat /proc/interrupts | grep eth0") + + # Verify interrupt counts increased (whether interrupts were delivered) + self.helper_exec_shell_command( + "export RX_AFTER=$(awk '/eth0-rx/ {print $3}' /proc/interrupts)") + self.helper_exec_shell_command( + "export TX_AFTER=$(awk '/eth0-tx/ {print $4}' /proc/interrupts)") + + # Check that interrupt counts increased + success_msg = "Interrupts increased" + self.helper_exec_shell_command(f"export PASS='{success_msg}'") + + exec_command_and_wait_for_pattern(self, + "[ $RX_AFTER -gt $RX_BEFORE ] && echo $PASS || echo $FAIL", + success_msg, fail_msg) + exec_command_and_wait_for_pattern(self, + "[ $TX_AFTER -gt $TX_BEFORE ] && echo $PASS || echo $FAIL", + success_msg, fail_msg) + def test_linux_big_boot(self): self.set_machine('powernv') self.vm.add_args('-smp', '16,threads=4,cores=2,sockets=2')
Re: [PATCH 1/8] tests/functional: Add remote interrupts test for PowerNV
Quoted 11 lines · Cédric Le Goater
Quoted 10 lines · Aditya Gupta
<...snip...>
defdo_test_linux_boot(self, command_line = KERNEL_COMMON_COMMAND_LINE):
self.require_accelerator("tcg")
kernel_path=self.ASSET_KERNEL.fetch()tests/functional/ppc64/test_powernv.py +3
-0@@ -71,6 +75,88 @@ 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')
Quoted 8 lines
tests/functional/ppc64/test_powernv.py def test_linux_smt_boot(self): · line 84
Quoted 4 lines
tests/functional/ppc64/test_powernv.py +4
-0+ + # have more sockets with as few CPUs as possible, increasing the + # probability to have remote interrupts from one chip to another + # also have e1000e network device to generate interruptsCan you attach the PCI device to a PCI bus known to be on the second socket ? and then offline cpus on the second socket, so that all IRQ servers are on the first socket.
Makes sense, thanks cedric ! will keep the device attached to 4th socket, and offline it's CPU, and let the other setting affinity part same
Thanks,
- Aditya G
PATCH 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 | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-)
tests/qtest/pnv-spi-seeprom-test.c +15 -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,17 @@ 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 ; + } + +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); +g_free (tname); + }return g_test_run (); }
Signature · 1 line
2.54.0
Re: [PATCH 2/8] tests/qtest/pnv_spi: Test Power11 PNV_SPI
Quoted 46 lines · Aditya Gupta
Currently 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.candpnv-host-i2c-test.c, but skip older chips, sinceTYPE_PNV_SPIonly exists from Power10 onwards, hence skip older machinesTests all the
pnv_chipssimilar to other qtestsSigned-off-by Aditya Gupta <[email protected]>--- tests/qtest/pnv-spi-seeprom-test.c | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-)tests/qtest/pnv-spi-seeprom-test.c +3
-2@@ -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,17 @@ static void test_spi_seeprom(const void *data)int main (int argc,char **argv)
tests/qtest/pnv-spi-seeprom-test.c static void test_spi_seeprom(const void *data) · line 107
Quoted 10 lines
tests/qtest/pnv-spi-seeprom-test.c +4
-4{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 ) {
Can we remove this chip_type field from the tests too ? see 248e4e924e87.
tests/qtest/pnv-spi-seeprom-test.c static void test_spi_seeprom(const void *data) · line 112
Quoted 5 lines
tests/qtest/pnv-spi-seeprom-test.c +5
-0+continue ; + } + +char *tname =g_strdup_printf ("pnv-xscom/spi-seeprom/%s" , + pnv_chips[i].cpu_model);
please consider g_autofree variables.
Quoted 5 lines
tests/qtest/pnv-spi-seeprom-test.c +3
-0+qtest_add_data_func (tname, &pnv_chips[i], test_spi_seeprom); +g_free (tname); + }return g_test_run (); }
Re: [PATCH 2/8] tests/qtest/pnv_spi: Test Power11 PNV_SPI
Quoted 13 lines · Cédric Le Goater
tests/qtest/pnv-spi-seeprom-test.c static void test_spi_seeprom(const void *data) · line 107
Quoted 11 lines · Aditya Gupta
<...snip...>
g_test_init(&argc, &argv, NULL);tests/qtest/pnv-spi-seeprom-test.c +4
-4-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 ) {
Quoted 1 line
Can we remove this
chip_typefield from the tests too ? see248e4e924e87.
I went through the usage, and don't see any fix currently, as the PnvChip structure these qtests are using is basic, and we need some way to identify the chip type, for things like which machine to use, xscom addresses, and to skip/do specific things for particular chip type. I went through the mentioned commit and its parent, seems it was possible with the compat property being handled by respective class_init. So currently I don't see a better way, what do you think ?
Quoted 8 lines
tests/qtest/pnv-spi-seeprom-test.c static void test_spi_seeprom(const void *data) · line 112
Quoted 6 lines
tests/qtest/pnv-spi-seeprom-test.c +5
-0+continue ; + } + +char *tname =g_strdup_printf ("pnv-xscom/spi-seeprom/%s" , + pnv_chips[i].cpu_model);please consider
g_autofreevariables.
Sure cedric, will use it in v2.
Thanks,
- Aditya G
Quoted 7 lines
Quoted 6 lines
tests/qtest/pnv-spi-seeprom-test.c +3
-0+qtest_add_data_func (tname, &pnv_chips[i], test_spi_seeprom); +g_free (tname); + }return g_test_run (); }
Re: [PATCH 2/8] tests/qtest/pnv_spi: Test Power11 PNV_SPI
Quoted 16 lines · Aditya Gupta
Quoted 13 lines · Cédric Le Goater
tests/qtest/pnv-spi-seeprom-test.c static void test_spi_seeprom(const void *data) · line 107
Quoted 11 lines · Aditya Gupta
<...snip...>
g_test_init(&argc, &argv, NULL);tests/qtest/pnv-spi-seeprom-test.c +4
-4-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 ) {Quoted 1 line
Can we remove this
chip_typefield from the tests too ? see248e4e924e87.
Quoted 7 lines
I went through the usage, and don't see any fix currently, as the PnvChip structure these qtests are using is basic, and we need some way to identify the chip type, for things like which machine to use, xscom addresses, and to skip/do specific things for particular chip type. I went through the mentioned commit and its parent, seems it was possible with the compat property being handled by respective
class_init. So currently I don't see a better way, what do you think ?
OK. Thanks for looking.
C.
Quoted 23 lines
Quoted 9 lines
tests/qtest/pnv-spi-seeprom-test.c static void test_spi_seeprom(const void *data) · line 112
Quoted 7 lines
tests/qtest/pnv-spi-seeprom-test.c +5
-0+continue ; + } + +char *tname =g_strdup_printf ("pnv-xscom/spi-seeprom/%s" , + pnv_chips[i].cpu_model);please consider
g_autofreevariables.Sure cedric, will use it in v2.
Thanks,
- Aditya GQuoted 7 lines
Quoted 6 lines
tests/qtest/pnv-spi-seeprom-test.c +3
-0+qtest_add_data_func (tname, &pnv_chips[i], test_spi_seeprom); +g_free (tname); + }return g_test_run (); }
Re: [PATCH 2/8] tests/qtest/pnv_spi: Test Power11 PNV_SPI
In reply to Aditya GuptaHi Aditya,
One comment below.
tests/qtest/pnv-spi-seeprom-test.c static void test_spi_seeprom(const void *data) · line 81
Quoted 6 lines · Aditya Gupta
tests/qtest/pnv-spi-seeprom-test.c +1
-0@@ -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" ;
Would it make sense to introduce pnv_get_machine_type() in patch 2 instead of patch 3? That would avoid hardcoding "powernv10" here and allow this patch to use the helper directly.
Otherwise, the patch looks good to me.
Thanks,
Nikhil
Re: [PATCH 2/8] tests/qtest/pnv_spi: Test Power11 PNV_SPI
Quoted 5 lines · Nikhil Kumar Singh
Hi Aditya,
One comment below.
On 23/06/26 19:49, Aditya Gupta wrote:
Quoted 8 lines
tests/qtest/pnv-spi-seeprom-test.c static void test_spi_seeprom(const void *data) · line 80
Quoted 5 lines
tests/qtest/pnv-spi-seeprom-test.c +1
-0@@ -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" ;Would it make sense to introduce
pnv_get_machine_type()in patch 2 instead of patch 3? That would avoid hardcoding"powernv10"here and allow this patch to use the helper directly.
Could be done, but i will prefer to keep it in current state, as of this patch, power11 wasn't added to this test, and the test only runs for powernv10, later as powern11 gets added in next patch this is changed to use pnv_get_machine_type.
If pnv_get_machine_type gets introduced in this patch, it makes sense to modify all other tests also to use it, which is more than what this patch intends to do (just remove hardcoded index in spi test). To me, it seems okay to keep it as is, what do you say ?
Quoted 2 lines
Otherwise, the patch looks good to me.
Thanks for reviewing, Nikhil !
- Aditya G
Quoted 3 lines
Thanks,
Nikhil
Re: [PATCH 2/8] tests/qtest/pnv_spi: Test Power11 PNV_SPI
Quoted 19 lines · Aditya Gupta
Quoted 5 lines · Nikhil Kumar Singh
Hi Aditya,
One comment below.
On 23/06/26 19:49, Aditya Gupta wrote:
Quoted 8 lines
tests/qtest/pnv-spi-seeprom-test.c static void test_spi_seeprom(const void *data) · line 80
Quoted 5 lines
tests/qtest/pnv-spi-seeprom-test.c +1
-0@@ -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" ;Would it make sense to introduce
pnv_get_machine_type()in patch 2 instead of patch 3? That would avoid hardcoding"powernv10"here and allow this patch to use the helper directly.Could be done, but i will prefer to keep it in current state, as of this patch, power11 wasn't added to this test, and the test only runs for powernv10, later as powern11 gets added in next patch this is changed to use
pnv_get_machine_type.
Quoted 4 lines
If
pnv_get_machine_typegets introduced in this patch, it makes sense to modify all other tests also to use it, which is more than what this patch intends to do (just remove hardcoded index in spi test). To me, it seems okay to keep it as is, what do you say ?
Thanks for the explanation. I agree with keeping it as is for this patch. Looks good to me.
~ Nikhil
Quoted 7 lines
Quoted 1 line
Otherwise, the patch looks good to me.
Thanks for reviewing, Nikhil !
- Aditya G
Quoted 2 lines
Thanks,
Nikhil
PATCH 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
--- tests/qtest/pnv-host-i2c-test.c | 7 +++---- tests/qtest/pnv-spi-seeprom-test.c | 2 +- tests/qtest/pnv-xive2-test.c | 2 +- tests/qtest/pnv-xscom-test.c | 19 ++++------------- tests/qtest/pnv-xscom.h | 33 +++++++++++++++++++++++++++--- 5 files changed, 39 insertions(+), 24 deletions(-)
tests/qtest/pnv-host-i2c-test.c +3 -4
@@ -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" ; }
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 +4 -15
@@ -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);
tests/qtest/pnv-xscom.h +30 -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,19 @@ 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) +{ +if (chip_type ==PNV_CHIP_POWER8 ) { +return "powernv8" ; + }else if (chip_type ==PNV_CHIP_POWER9 ) { +return "powernv9" ; + }else if (chip_type ==PNV_CHIP_POWER10 ) { +return "powernv10" ; + }else if (chip_type ==PNV_CHIP_POWER11 ) { +return "powernv11" ; + }else { +g_assert_not_reached (); + } +} +#endif /* PNV_XSCOM_H */
Signature · 1 line
2.54.0
Re: [PATCH 3/8] tests/qtest: Add Power11 chip & machine to qtests
Quoted 4 lines · Aditya Gupta
tests/qtest/pnv-xscom.h +4
-0+static const char *pnv_get_machine_type (enum PnvChipType chip_type) +{ + if (chip_type == PNV_CHIP_POWER8) { + return "powernv8";
tests/qtest/pnv-xscom.h static inline uint64_t pnv_xscom_addr(const PnvChip *chip, uint32_t pcba) · line 105
Quoted 10 lines
tests/qtest/pnv-xscom.h +10
-0+ } else if (chip_type == PNV_CHIP_POWER9) { + return "powernv9"; + } else if (chip_type == PNV_CHIP_POWER10) { + return "powernv10"; + } else if (chip_type == PNV_CHIP_POWER11) { + return "powernv11"; + } else { + g_assert_not_reached(); + } +}
How about refactoring to the following?
static const char *const machine_types[] = {
[PNV_CHIP_POWER8] = "powernv8",
[PNV_CHIP_POWER9] = "powernv9",
[PNV_CHIP_POWER10] = "powernv10",
[PNV_CHIP_POWER11] = "powernv11",
};
return machine_types[x];~Shivang.
Re: [PATCH 3/8] tests/qtest: Add Power11 chip & machine to qtests
Quoted 18 lines · Shivang Upadhyay
Quoted 4 lines · Aditya Gupta
tests/qtest/pnv-xscom.h +4
-0+static const char *pnv_get_machine_type (enum PnvChipType chip_type) +{ + if (chip_type == PNV_CHIP_POWER8) { + return "powernv8";tests/qtest/pnv-xscom.h static inline uint64_t pnv_xscom_addr(const PnvChip *chip, uint32_t pcba) · line 105
Quoted 10 lines
tests/qtest/pnv-xscom.h +10
-0+ } else if (chip_type == PNV_CHIP_POWER9) { + return "powernv9"; + } else if (chip_type == PNV_CHIP_POWER10) { + return "powernv10"; + } else if (chip_type == PNV_CHIP_POWER11) { + return "powernv11"; + } else { + g_assert_not_reached(); + } +}How about refactoring to the following?
Quoted 7 lines
static const char *const machine_types[] = {
[PNV_CHIP_POWER8] = "powernv8",
[PNV_CHIP_POWER9] = "powernv9",
[PNV_CHIP_POWER10] = "powernv10",
[PNV_CHIP_POWER11] = "powernv11",
};
return machine_types[x];Has a subtle difference, that it may not assert/segfault on unknown value for x, I want the test to crash/fail if this is called with an unknown/new processor chip. I believe the if-else/switch is better as it handles (by 'crashing') unknown values too.
- Aditya G
Quoted 2 lines
~Shivang.
Re: [PATCH 3/8] tests/qtest: Add Power11 chip & machine to qtests
Quoted 27 lines · Aditya Gupta
Quoted 18 lines · Shivang Upadhyay
Quoted 4 lines · Aditya Gupta
tests/qtest/pnv-xscom.h +4
-0+static const char *pnv_get_machine_type (enum PnvChipType chip_type) +{ + if (chip_type == PNV_CHIP_POWER8) { + return "powernv8";tests/qtest/pnv-xscom.h static inline uint64_t pnv_xscom_addr(const PnvChip *chip, uint32_t pcba) · line 105
Quoted 10 lines
tests/qtest/pnv-xscom.h +10
-0+ } else if (chip_type == PNV_CHIP_POWER9) { + return "powernv9"; + } else if (chip_type == PNV_CHIP_POWER10) { + return "powernv10"; + } else if (chip_type == PNV_CHIP_POWER11) { + return "powernv11"; + } else { + g_assert_not_reached(); + } +}How about refactoring to the following?
Quoted 7 lines
static const char *const machine_types[] = { [PNV_CHIP_POWER8] = "powernv8", [PNV_CHIP_POWER9] = "powernv9", [PNV_CHIP_POWER10] = "powernv10", [PNV_CHIP_POWER11] = "powernv11", }; return machine_types[x];
Quoted 4 lines
Has a subtle difference, that it may not assert/segfault on unknown value for x, I want the test to crash/fail if this is called with an unknown/new processor chip. I believe the if-else/switch is better as it handles (by 'crashing') unknown values too.
We could just do:
if (chip_type >= PNV_CHIP_MAX) {
g_assert_not_reached();
} else {
return machine_types[chip_type];
}That way just adding new array entry would work for future chips.
Quoted 5 lines
- Aditya G
Quoted 2 lines
~Shivang.
Re: [PATCH 3/8] tests/qtest: Add Power11 chip & machine to qtests
Quoted 33 lines · Harsh Prateek Bora
Quoted 27 lines · Aditya Gupta
Quoted 18 lines · Shivang Upadhyay
Quoted 4 lines · Aditya Gupta
tests/qtest/pnv-xscom.h +4
-0+static const char *pnv_get_machine_type (enum PnvChipType chip_type) +{ + if (chip_type == PNV_CHIP_POWER8) { + return "powernv8";tests/qtest/pnv-xscom.h static inline uint64_t pnv_xscom_addr(const PnvChip *chip, uint32_t pcba) · line 105
Quoted 10 lines
tests/qtest/pnv-xscom.h +10
-0+ } else if (chip_type == PNV_CHIP_POWER9) { + return "powernv9"; + } else if (chip_type == PNV_CHIP_POWER10) { + return "powernv10"; + } else if (chip_type == PNV_CHIP_POWER11) { + return "powernv11"; + } else { + g_assert_not_reached(); + } +}How about refactoring to the following?
Quoted 7 lines
static const char *const machine_types[] = { [PNV_CHIP_POWER8] = "powernv8", [PNV_CHIP_POWER9] = "powernv9", [PNV_CHIP_POWER10] = "powernv10", [PNV_CHIP_POWER11] = "powernv11", }; return machine_types[x];Quoted 4 lines
Has a subtle difference, that it may not assert/segfault on unknown value for x, I want the test to crash/fail if this is called with an unknown/new processor chip. I believe the if-else/switch is better as it handles (by 'crashing') unknown values too.
Quoted 7 lines
We could just do:
if (chip_type >= PNV_CHIP_MAX) { g_assert_not_reached(); } else {return machine_types[chip_type];
}
Or even g_assert(chip_type < PNV_CHIP_MAX); without the if?
Regards,
BALATON Zoltan
Quoted 10 lines
That way just adding new array entry would work for future chips.
Quoted 5 lines
- Aditya G
Quoted 2 lines
~Shivang.
Re: [PATCH 3/8] tests/qtest: Add Power11 chip & machine to qtests
Quoted 36 lines · BALATON Zoltan
Quoted 35 lines · Harsh Prateek Bora
Quoted 27 lines · Aditya Gupta
Quoted 18 lines · Shivang Upadhyay
Quoted 4 lines · Aditya Gupta
tests/qtest/pnv-xscom.h +4
-0+static const char *pnv_get_machine_type (enum PnvChipType chip_type) +{ + if (chip_type == PNV_CHIP_POWER8) { + return "powernv8";tests/qtest/pnv-xscom.h static inline uint64_t pnv_xscom_addr(const PnvChip *chip, uint32_t pcba) · line 105
Quoted 10 lines
tests/qtest/pnv-xscom.h +10
-0+ } else if (chip_type == PNV_CHIP_POWER9) { + return "powernv9"; + } else if (chip_type == PNV_CHIP_POWER10) { + return "powernv10"; + } else if (chip_type == PNV_CHIP_POWER11) { + return "powernv11"; + } else { + g_assert_not_reached(); + } +}How about refactoring to the following?
Quoted 7 lines
static const char *const machine_types[] = {
[PNV_CHIP_POWER8] = "powernv8",
[PNV_CHIP_POWER9] = "powernv9",
[PNV_CHIP_POWER10] = "powernv10",
[PNV_CHIP_POWER11] = "powernv11",
};
return machine_types[x];Quoted 4 lines
Has a subtle difference, that it may not assert/segfault on unknown value for x, I want the test to crash/fail if this is called with an unknown/new processor chip. I believe the if-else/switch is better as it handles (by 'crashing') unknown values too.
We could just do:
Quoted 7 lines
Quoted 5 lines
if (
chip_type>=PNV_CHIP_MAX) {
g_assert_not_reached();
} else {
return machine_types[chip_type];
}Or even
g_assert(chip_type < PNV_CHIP_MAX); without the if?
Absolutely :)
Quoted 14 lines
Regards,
BALATON ZoltanQuoted 10 lines
That way just adding new array entry would work for future chips.
Quoted 5 lines
- Aditya G
Quoted 2 lines
~Shivang.
Re: [PATCH 3/8] tests/qtest: Add Power11 chip & machine to qtests
In reply to BALATON ZoltanQuoted 42 lines · BALATON Zoltan
Quoted 33 lines · Harsh Prateek Bora
Quoted 27 lines · Aditya Gupta
Quoted 18 lines · Shivang Upadhyay
Quoted 4 lines · Aditya Gupta
tests/qtest/pnv-xscom.h +4
-0+static const char *pnv_get_machine_type (enum PnvChipType chip_type) +{ + if (chip_type == PNV_CHIP_POWER8) { + return "powernv8";tests/qtest/pnv-xscom.h static inline uint64_t pnv_xscom_addr(const PnvChip *chip, uint32_t pcba) · line 105
Quoted 10 lines
tests/qtest/pnv-xscom.h +10
-0+ } else if (chip_type == PNV_CHIP_POWER9) { + return "powernv9"; + } else if (chip_type == PNV_CHIP_POWER10) { + return "powernv10"; + } else if (chip_type == PNV_CHIP_POWER11) { + return "powernv11"; + } else { + g_assert_not_reached(); + } +}How about refactoring to the following?
Quoted 7 lines
static const char *const machine_types[] = { [PNV_CHIP_POWER8] = "powernv8", [PNV_CHIP_POWER9] = "powernv9", [PNV_CHIP_POWER10] = "powernv10", [PNV_CHIP_POWER11] = "powernv11", }; return machine_types[x];Quoted 4 lines
Has a subtle difference, that it may not assert/segfault on unknown value for x, I want the test to crash/fail if this is called with an unknown/new processor chip. I believe the if-else/switch is better as it handles (by 'crashing') unknown values too.
Quoted 7 lines
We could just do:
if (chip_type >= PNV_CHIP_MAX) { g_assert_not_reached(); } else {return machine_types[chip_type];
}
Quoted 6 lines
Or even
g_assert(chip_type < PNV_CHIP_MAX); without the if?Regards,
BALATON ZoltanQuoted 1 line
That way just adding new array entry would work for future chips.
will do in v3. thanks !
- Aditya G
Re: [PATCH 3/8] tests/qtest: Add Power11 chip & machine to qtests
In reply to Aditya GuptaHi Aditya,
One comment below regarding test coverage.
tests/qtest/pnv-xive2-test.c static void test_xive(void) · line 554
Quoted 9 lines · Aditya Gupta
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 );
By replacing the hardcoded machine type here instead of testing both, QEMU will no longer exercise the XIVE2 path on Power10.
If a future change breaks the Power10 machine initialization while Power11 continues to work, this test would still pass.
Would it make sense to run this test for both powernv10 and powernv11, similar to how the SPI qtest iterates over the supported machines?
Thanks,
Nikhil
Re: [PATCH 3/8] tests/qtest: Add Power11 chip & machine to qtests
Quoted 16 lines · Nikhil Kumar Singh
Hi Aditya,
One comment below regarding test coverage.
tests/qtest/pnv-xive2-test.c static void test_xive(void) · line 553
Quoted 8 lines · Aditya Gupta
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 );By replacing the hardcoded machine type here instead of testing both, QEMU will no longer exercise the XIVE2 path on Power10.
Quoted 6 lines
If a future change breaks the Power10 machine initialization while Power11 continues to work, this test would still pass.
Would it make sense to run this test for both
powernv10andpowernv11, similar to how the SPI qtest iterates over the supported machines?
Since power11's interrupt controller is the same as power10, power10's xive breakage should break power11 too.
But I get it, safer to have both, will do it in v4.
Thanks,
- Aditya G
Quoted 3 lines
Thanks,
Nikhil
PATCH 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 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 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 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 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 | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
MAINTAINERS +2 -1
@@ -1646,7 +1646,8 @@ 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]> +G: @adi-g15-ibm R: Glenn Miles <[email protected]> R: Harsh Prateek Bora <[email protected]> L: [email protected]
Signature · 1 line
2.54.0
Re: [PATCH 8/8] MAINTAINERS: Add self as maintainer for PowerNV
Quoted 13 lines · Aditya Gupta
Add myself as maintainer for PowerNV machine, and remove the reviewer entry
Signed-off-by Aditya Gupta <[email protected]>--- MAINTAINERS | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)MAINTAINERS +0
-0
MAINTAINERS F: tests/functional/ppc64/test_tuxrun.py · line 1650
Quoted 6 lines
MAINTAINERS +2
-1@@ -1646,7 +1646,8 @@ 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]> +G: @adi-g15-ibm
Please drop the G: line, as I'm changing the approach for recording this info to be more automatic.
Quoted 7 lines
MAINTAINERS +0
-0R: Glenn Miles <[email protected]> R: Harsh Prateek Bora <[email protected]> L: [email protected]Signature · 1 line
2.54.0
With regards,
Daniel
Signature · 3 lines
|: https://berrange.com ~~ https://hachyderm.io/@berrange :| |: https://libvirt.org ~~ https://entangle-photo.org :| |: https://pixelfed.art/berrange ~~ https://fstop138.berrange.com :|
Re: [PATCH 8/8] MAINTAINERS: Add self as maintainer for PowerNV
Quoted 15 lines · Daniel P. Berrangé
Quoted 14 lines · Aditya Gupta
Add myself as maintainer for PowerNV machine, and remove the reviewer entry
Signed-off-by Aditya Gupta <[email protected]>--- MAINTAINERS | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)MAINTAINERS +0
-0@@ -1646,7 +1646,8 @@ F: tests/functional/ppc64/test_tuxrun.py
Quoted 8 lines
MAINTAINERS F: tests/functional/ppc64/test_tuxrun.py · line 1650
Quoted 5 lines
MAINTAINERS +2
-1PowerNV (Non-Virtualized) M: Nicholas Piggin <[email protected]> -R: Aditya Gupta <[email protected]> +M: Aditya Gupta <[email protected]> +G: @adi-g15-ibmPlease drop the G: line, as I'm changing the approach for recording this info to be more automatic.
Sure Daniel, will remove it in v2.
Thanks,
- Aditya G
Re: [PATCH 8/8] MAINTAINERS: Add self as maintainer for PowerNV
In reply to Aditya GuptaHello Nick,
Are you still active on the qemu-ppc subsystem ?
Thanks,
C.
Quoted 22 lines · Aditya Gupta
Add myself as maintainer for PowerNV machine, and remove the reviewer entry
Signed-off-by Aditya Gupta <[email protected]>--- MAINTAINERS | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)MAINTAINERS +2
-1@@ -1646,7 +1646,8 @@ 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]> +G: @adi-g15-ibm R: Glenn Miles <[email protected]> R: Harsh Prateek Bora <[email protected]> L: [email protected]