* [PATCH v3 0/2] ppc/pnv: fixing external dtb
@ 2026-06-30 10:35 Shivang Upadhyay
2026-06-30 10:35 ` [PATCH v3 1/2] ppc/pnv: avoid regenerating DTB if external DTB is present Shivang Upadhyay
2026-06-30 10:35 ` [PATCH v3 2/2] ppc/pnv: add test to verify external DTB is honored Shivang Upadhyay
0 siblings, 2 replies; 5+ messages in thread
From: Shivang Upadhyay @ 2026-06-30 10:35 UTC (permalink / raw)
To: adityag, harshpb, qemu-devel, qemu-ppc
Cc: shivangu, milesg, npiggin, amachhiw
Currently powerpc pnv machines doesnt respect `-dtb`
argument passed from outside. During cpu start content of
machine->fdt is overwritten by `pnv_dt_create`.
This was previously found and fixed, during the discussion
for dumpdtb issue [1]. But reintroduced in MPIPL support
[2]. Saddly it skipped in the review phase [3].
Adding a functional test for checking the external dtb case
in powernv11.
[1] https://lore.kernel.org/all/20260323231612.GA2637687@ax162/
[2] https://lore.kernel.org/qemu-devel/20260310124619.3909045-8-adityag@linux.ibm.com/
[3] https://lore.kernel.org/qemu-devel/abAmBV7g_bGNw0Ax@shivang.upadyay/
Changelog
* V2: https://lore.kernel.org/all/20260626112239.177191-1-shivangu@linux.ibm.com/
- renamed dtb file appropriate name.
- addressed identation and spelling mistake by aditya.
- keeping reviewed by from aditya.
* V1: https://lore.kernel.org/all/20260623063156.1110370-1-shivangu@linux.ibm.com/
- change dtb from power10 to power11
- refactored pnv_reset code to not `load_device_tree` on each iteration.
- added commit message body.
Shivang Upadhyay (2):
ppc/pnv: avoid regenerating DTB if external DTB is present
ppc/pnv: add test to verify external DTB is honored
hw/ppc/pnv.c | 10 +++++++---
tests/functional/ppc64/test_powernv.py | 19 +++++++++++++++++++
2 files changed, 26 insertions(+), 3 deletions(-)
--
2.54.0
^ permalink raw reply [flat|nested] 5+ messages in thread
* [PATCH v3 1/2] ppc/pnv: avoid regenerating DTB if external DTB is present
2026-06-30 10:35 [PATCH v3 0/2] ppc/pnv: fixing external dtb Shivang Upadhyay
@ 2026-06-30 10:35 ` Shivang Upadhyay
2026-06-30 11:53 ` Amit Machhiwal
2026-06-30 10:35 ` [PATCH v3 2/2] ppc/pnv: add test to verify external DTB is honored Shivang Upadhyay
1 sibling, 1 reply; 5+ messages in thread
From: Shivang Upadhyay @ 2026-06-30 10:35 UTC (permalink / raw)
To: adityag, harshpb, qemu-devel, qemu-ppc
Cc: shivangu, milesg, npiggin, amachhiw
Currently externally provided dtb is overwritten in `pnv_reset`.
Fix this by only creating dtb if not provided from `-dtb`.
Reviewed-by: Aditya Gupta <adityag@linux.ibm.com>
Signed-off-by: Shivang Upadhyay <shivangu@linux.ibm.com>
---
hw/ppc/pnv.c | 10 +++++++---
1 file changed, 7 insertions(+), 3 deletions(-)
diff --git a/hw/ppc/pnv.c b/hw/ppc/pnv.c
index 62812f22f8..afb6019b10 100644
--- a/hw/ppc/pnv.c
+++ b/hw/ppc/pnv.c
@@ -803,9 +803,13 @@ static void pnv_reset(MachineState *machine, ResetType type)
mpipl_write_succeeded = do_mpipl_write(pnv);
}
- /* Regenerate device tree */
- fdt = pnv_dt_create(machine);
- _FDT((fdt_pack(fdt)));
+ /* Only create new dt if not provided in -dtb */
+ if (!machine->dtb) {
+ fdt = pnv_dt_create(machine);
+ _FDT((fdt_pack(fdt)));
+ } else {
+ fdt = machine->fdt;
+ }
/*
* If it's a MPIPL boot, add the "mpipl-boot" property, and reset the
--
2.54.0
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [PATCH v3 2/2] ppc/pnv: add test to verify external DTB is honored
2026-06-30 10:35 [PATCH v3 0/2] ppc/pnv: fixing external dtb Shivang Upadhyay
2026-06-30 10:35 ` [PATCH v3 1/2] ppc/pnv: avoid regenerating DTB if external DTB is present Shivang Upadhyay
@ 2026-06-30 10:35 ` Shivang Upadhyay
1 sibling, 0 replies; 5+ messages in thread
From: Shivang Upadhyay @ 2026-06-30 10:35 UTC (permalink / raw)
To: adityag, harshpb, qemu-devel, qemu-ppc
Cc: shivangu, milesg, npiggin, amachhiw
Test boots a powernv11 machine, using a custom dtb.
Custom dtb has the following bootargs.
chosen {
bootargs = "hello world";
};
Test Checks whether above bootargs make it to kernel's command line.
Reviewed-by: Aditya Gupta <adityag@linux.ibm.com>
Signed-off-by: Shivang Upadhyay <shivangu@linux.ibm.com>
---
tests/functional/ppc64/test_powernv.py | 19 +++++++++++++++++++
1 file changed, 19 insertions(+)
diff --git a/tests/functional/ppc64/test_powernv.py b/tests/functional/ppc64/test_powernv.py
index 0ea6c93e42..b5b2f0d158 100755
--- a/tests/functional/ppc64/test_powernv.py
+++ b/tests/functional/ppc64/test_powernv.py
@@ -27,6 +27,11 @@ class PowernvMachine(LinuxKernelTest):
'buildroot/qemu_ppc64le_powernv8-2025.02/rootfs.ext2'),
'aee2192b692077c4bde31cb56ce474424b358f17cec323d5c94af3970c9aada2')
+ # testdtb for power11, which contains string "hello world" in command line
+ ASSET_SAMPLE_DTB = Asset(
+ ('https://github.com/roz3x/qemu/raw/refs/heads/sample-dtb/qemu-powernv11.dtb'),
+ 'ea1271516264eea1eb58a067a99d0c2ca9528be8dc7d4e46bb2d5ae0d42fc568')
+
def do_test_linux_boot(self, command_line = KERNEL_COMMON_COMMAND_LINE):
self.require_accelerator("tcg")
kernel_path = self.ASSET_KERNEL.fetch()
@@ -104,6 +109,20 @@ def do_test_ppc64_powernv(self, proc):
# Device detection output driven by udev probing is sometimes cut off
# from console output, suspect S14silence-console init script.
+ def test_ppc64_powernv_external_dtb(self):
+ self.set_machine('powernv11')
+ self.require_accelerator("tcg")
+
+ kernel_path = self.ASSET_KERNEL.fetch()
+ sample_dtb_path = self.ASSET_SAMPLE_DTB.fetch()
+ self.vm.set_console()
+ self.vm.add_args('-kernel', kernel_path,
+ '-dtb', sample_dtb_path)
+ self.vm.launch()
+
+ # check if custom dtb is reflected or not
+ wait_for_console_pattern(self, "Kernel command line: hello world", self.panic_message)
+
def test_powernv8(self):
self.set_machine('powernv8')
self.do_test_ppc64_powernv('P8')
--
2.54.0
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH v3 1/2] ppc/pnv: avoid regenerating DTB if external DTB is present
2026-06-30 10:35 ` [PATCH v3 1/2] ppc/pnv: avoid regenerating DTB if external DTB is present Shivang Upadhyay
@ 2026-06-30 11:53 ` Amit Machhiwal
2026-07-01 8:45 ` Shivang Upadhyay
0 siblings, 1 reply; 5+ messages in thread
From: Amit Machhiwal @ 2026-06-30 11:53 UTC (permalink / raw)
To: Shivang Upadhyay
Cc: adityag, harshpb, qemu-devel, qemu-ppc, milesg, npiggin, amachhiw
On 2026/06/30 04:05 PM, Shivang Upadhyay wrote:
> Currently externally provided dtb is overwritten in `pnv_reset`.
> Fix this by only creating dtb if not provided from `-dtb`.
>
> Reviewed-by: Aditya Gupta <adityag@linux.ibm.com>
> Signed-off-by: Shivang Upadhyay <shivangu@linux.ibm.com>
> ---
> hw/ppc/pnv.c | 10 +++++++---
> 1 file changed, 7 insertions(+), 3 deletions(-)
LGTM.
Reviewed-by: Amit Machhiwal <amachhiw@linux.ibm.com>
~Amit
>
> diff --git a/hw/ppc/pnv.c b/hw/ppc/pnv.c
> index 62812f22f8..afb6019b10 100644
> --- a/hw/ppc/pnv.c
> +++ b/hw/ppc/pnv.c
> @@ -803,9 +803,13 @@ static void pnv_reset(MachineState *machine, ResetType type)
> mpipl_write_succeeded = do_mpipl_write(pnv);
> }
>
> - /* Regenerate device tree */
> - fdt = pnv_dt_create(machine);
> - _FDT((fdt_pack(fdt)));
> + /* Only create new dt if not provided in -dtb */
> + if (!machine->dtb) {
> + fdt = pnv_dt_create(machine);
> + _FDT((fdt_pack(fdt)));
> + } else {
> + fdt = machine->fdt;
> + }
>
> /*
> * If it's a MPIPL boot, add the "mpipl-boot" property, and reset the
> --
> 2.54.0
>
>
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH v3 1/2] ppc/pnv: avoid regenerating DTB if external DTB is present
2026-06-30 11:53 ` Amit Machhiwal
@ 2026-07-01 8:45 ` Shivang Upadhyay
0 siblings, 0 replies; 5+ messages in thread
From: Shivang Upadhyay @ 2026-07-01 8:45 UTC (permalink / raw)
To: adityag, harshpb, qemu-devel, qemu-ppc, milesg, npiggin
On Tue, 2026-06-30 at 17:23 +0530, Amit Machhiwal wrote:
> LGTM.
>
> Reviewed-by: Amit Machhiwal <amachhiw@linux.ibm.com>
>
> ~Amit
Thanks
~Shivang
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2026-07-01 8:45 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-06-30 10:35 [PATCH v3 0/2] ppc/pnv: fixing external dtb Shivang Upadhyay
2026-06-30 10:35 ` [PATCH v3 1/2] ppc/pnv: avoid regenerating DTB if external DTB is present Shivang Upadhyay
2026-06-30 11:53 ` Amit Machhiwal
2026-07-01 8:45 ` Shivang Upadhyay
2026-06-30 10:35 ` [PATCH v3 2/2] ppc/pnv: add test to verify external DTB is honored Shivang Upadhyay
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.