All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/2] ppc/pnv: fixing external dtb
@ 2026-06-23  6:31 Shivang Upadhyay
  2026-06-23  6:31 ` [PATCH 1/2] ppc/pnv: avoid regenerating DTB if external DTB is present Shivang Upadhyay
                   ` (2 more replies)
  0 siblings, 3 replies; 15+ messages in thread
From: Shivang Upadhyay @ 2026-06-23  6:31 UTC (permalink / raw)
  To: qemu-devel, qemu-ppc; +Cc: adityag, harshpb, npiggin, milesg, Shivang Upadhyay

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/

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, 27 insertions(+), 2 deletions(-)

-- 
2.54.0



^ permalink raw reply	[flat|nested] 15+ messages in thread

* [PATCH 1/2] ppc/pnv: avoid regenerating DTB if external DTB is present
  2026-06-23  6:31 [PATCH 0/2] ppc/pnv: fixing external dtb Shivang Upadhyay
@ 2026-06-23  6:31 ` Shivang Upadhyay
  2026-06-25  7:51   ` Aditya Gupta
  2026-06-23  6:31 ` [PATCH 2/2] ppc/pnv: add test to verify external DTB is honored Shivang Upadhyay
  2026-06-26 11:22 ` [PATCH v2 0/2] ppc/pnv: fixing external dtb Shivang Upadhyay
  2 siblings, 1 reply; 15+ messages in thread
From: Shivang Upadhyay @ 2026-06-23  6:31 UTC (permalink / raw)
  To: qemu-devel, qemu-ppc; +Cc: adityag, harshpb, npiggin, milesg, Shivang Upadhyay

Signed-off-by: Shivang Upadhyay <shivangu@linux.ibm.com>
---
 hw/ppc/pnv.c | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/hw/ppc/pnv.c b/hw/ppc/pnv.c
index 62812f22f8..6a636b5192 100644
--- a/hw/ppc/pnv.c
+++ b/hw/ppc/pnv.c
@@ -803,8 +803,14 @@ static void pnv_reset(MachineState *machine, ResetType type)
         mpipl_write_succeeded = do_mpipl_write(pnv);
     }
 
-    /* Regenerate device tree */
-    fdt = pnv_dt_create(machine);
+    if (machine->dtb) {
+        int file_size; /* discard */
+        fdt = load_device_tree(machine->dtb, &file_size);
+    } else {
+        /* Regenerate device tree */
+        fdt = pnv_dt_create(machine);
+    }
+
     _FDT((fdt_pack(fdt)));
 
     /*
-- 
2.54.0



^ permalink raw reply related	[flat|nested] 15+ messages in thread

* [PATCH 2/2] ppc/pnv: add test to verify external DTB is honored
  2026-06-23  6:31 [PATCH 0/2] ppc/pnv: fixing external dtb Shivang Upadhyay
  2026-06-23  6:31 ` [PATCH 1/2] ppc/pnv: avoid regenerating DTB if external DTB is present Shivang Upadhyay
@ 2026-06-23  6:31 ` Shivang Upadhyay
  2026-06-23  6:57   ` Amit Machhiwal
  2026-06-25  7:02   ` Aditya Gupta
  2026-06-26 11:22 ` [PATCH v2 0/2] ppc/pnv: fixing external dtb Shivang Upadhyay
  2 siblings, 2 replies; 15+ messages in thread
From: Shivang Upadhyay @ 2026-06-23  6:31 UTC (permalink / raw)
  To: qemu-devel, qemu-ppc; +Cc: adityag, harshpb, npiggin, milesg, Shivang Upadhyay

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..80801ee3dc 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/output.dtb'),
+        '2dd3330561768fc5c8e4b93aa29bc44c64278d186f1e0f8c584cdf15c3f8cf43')
+
     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] 15+ messages in thread

* Re: [PATCH 2/2] ppc/pnv: add test to verify external DTB is honored
  2026-06-23  6:31 ` [PATCH 2/2] ppc/pnv: add test to verify external DTB is honored Shivang Upadhyay
@ 2026-06-23  6:57   ` Amit Machhiwal
  2026-06-23 15:42     ` Shivang Upadhyay
  2026-06-25  7:02   ` Aditya Gupta
  1 sibling, 1 reply; 15+ messages in thread
From: Amit Machhiwal @ 2026-06-23  6:57 UTC (permalink / raw)
  To: Shivang Upadhyay; +Cc: qemu-devel, qemu-ppc, adityag, harshpb, npiggin, milesg

On 2026/06/23 12:01 PM, Shivang Upadhyay wrote:
> Signed-off-by: Shivang Upadhyay <shivangu@linux.ibm.com>
> ---
>  tests/functional/ppc64/test_powernv.py | 19 +++++++++++++++++++
>  1 file changed, 19 insertions(+)

The test addition looks fine, but the commit message body is missing.
According to the official QEMU submission guidelines at:

  https://www.qemu.org/docs/master/devel/submitting-a-patch.html#write-a-meaningful-commit-message

  "Commit messages should be meaningful and should stand on their own as
  a historical record of why the changes you applied were necessary or
  useful."

You may want to add a commit message body in the next version.

Thanks,
Amit

> 
> diff --git a/tests/functional/ppc64/test_powernv.py b/tests/functional/ppc64/test_powernv.py
> index 0ea6c93e42..80801ee3dc 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/output.dtb'),
> +        '2dd3330561768fc5c8e4b93aa29bc44c64278d186f1e0f8c584cdf15c3f8cf43')
> +
>      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	[flat|nested] 15+ messages in thread

* Re: [PATCH 2/2] ppc/pnv: add test to verify external DTB is honored
  2026-06-23  6:57   ` Amit Machhiwal
@ 2026-06-23 15:42     ` Shivang Upadhyay
  0 siblings, 0 replies; 15+ messages in thread
From: Shivang Upadhyay @ 2026-06-23 15:42 UTC (permalink / raw)
  To: qemu-devel, qemu-ppc, adityag, harshpb, npiggin, milesg

On Tue, 2026-06-23 at 12:27 +0530, Amit Machhiwal wrote:
> The test addition looks fine, but the commit message body is missing.
> According to the official QEMU submission guidelines at:
> 
>  
> https://www.qemu.org/docs/master/devel/submitting-a-patch.html#write-a-meaningful-commit-message
> 
>   "Commit messages should be meaningful and should stand on their own
> as
>   a historical record of why the changes you applied were necessary
> or
>   useful."
> 
> You may want to add a commit message body in the next version.

Sure Amit, Ill add the body.

~Shivang.


^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PATCH 2/2] ppc/pnv: add test to verify external DTB is honored
  2026-06-23  6:31 ` [PATCH 2/2] ppc/pnv: add test to verify external DTB is honored Shivang Upadhyay
  2026-06-23  6:57   ` Amit Machhiwal
@ 2026-06-25  7:02   ` Aditya Gupta
  2026-06-25  7:30     ` Shivang Upadhyay
  1 sibling, 1 reply; 15+ messages in thread
From: Aditya Gupta @ 2026-06-25  7:02 UTC (permalink / raw)
  To: Shivang Upadhyay; +Cc: qemu-devel, qemu-ppc, harshpb, npiggin, milesg

On 26/06/23 12:01PM, Shivang Upadhyay wrote:
> Signed-off-by: Shivang Upadhyay <shivangu@linux.ibm.com>

description, as pointed by amit

> <...snip...>
> +    # 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/output.dtb'),
> +        '2dd3330561768fc5c8e4b93aa29bc44c64278d186f1e0f8c584cdf15c3f8cf43')
> +
>      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()

update the dtb also when you post v2, this dtb is of power10, works, but
better to have power11's dtb here

Thanks,
- Aditya G


^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PATCH 2/2] ppc/pnv: add test to verify external DTB is honored
  2026-06-25  7:02   ` Aditya Gupta
@ 2026-06-25  7:30     ` Shivang Upadhyay
  0 siblings, 0 replies; 15+ messages in thread
From: Shivang Upadhyay @ 2026-06-25  7:30 UTC (permalink / raw)
  To: Aditya Gupta; +Cc: qemu-devel, qemu-ppc, harshpb, npiggin, milesg

On Thu, 2026-06-25 at 12:32 +0530, Aditya Gupta wrote:
> > +        kernel_path = self.ASSET_KERNEL.fetch()
> > +        sample_dtb_path = self.ASSET_SAMPLE_DTB.fetch()
> 
> update the dtb also when you post v2, this dtb is of power10, works,
> but
> better to have power11's dtb here
Sure, ill change that. Is it possible we can put it somewhere else
other than personal github? 

~Shivang.


^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PATCH 1/2] ppc/pnv: avoid regenerating DTB if external DTB is present
  2026-06-23  6:31 ` [PATCH 1/2] ppc/pnv: avoid regenerating DTB if external DTB is present Shivang Upadhyay
@ 2026-06-25  7:51   ` Aditya Gupta
  2026-06-25  7:54     ` Shivang Upadhyay
  0 siblings, 1 reply; 15+ messages in thread
From: Aditya Gupta @ 2026-06-25  7:51 UTC (permalink / raw)
  To: Shivang Upadhyay; +Cc: qemu-devel, qemu-ppc, harshpb, npiggin, milesg

On 26/06/23 12:01PM, Shivang Upadhyay wrote:
> Signed-off-by: Shivang Upadhyay <shivangu@linux.ibm.com>
> ---
>  hw/ppc/pnv.c | 10 ++++++++--
>  1 file changed, 8 insertions(+), 2 deletions(-)
> 
> diff --git a/hw/ppc/pnv.c b/hw/ppc/pnv.c
> index 62812f22f8..6a636b5192 100644
> --- a/hw/ppc/pnv.c
> +++ b/hw/ppc/pnv.c
> @@ -803,8 +803,14 @@ static void pnv_reset(MachineState *machine, ResetType type)
>          mpipl_write_succeeded = do_mpipl_write(pnv);
>      }
>  
> -    /* Regenerate device tree */
> -    fdt = pnv_dt_create(machine);
> +    if (machine->dtb) {
> +        int file_size; /* discard */
> +        fdt = load_device_tree(machine->dtb, &file_size);
> +    } else {
> +        /* Regenerate device tree */
> +        fdt = pnv_dt_create(machine);
> +    }
> +

load_device_tree is being done in pnv_init also, how about this ?

	/* only create new dt if -dtb wasn't explicity passed */
	if (!machine->dtb) {
		pnv_dt_create
		fdt_pack
	}

also, keep this before the mpipl block, ie. after qemu_devices_reset ?

Thanks,
- Aditya G



^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PATCH 1/2] ppc/pnv: avoid regenerating DTB if external DTB is present
  2026-06-25  7:51   ` Aditya Gupta
@ 2026-06-25  7:54     ` Shivang Upadhyay
  0 siblings, 0 replies; 15+ messages in thread
From: Shivang Upadhyay @ 2026-06-25  7:54 UTC (permalink / raw)
  To: Aditya Gupta; +Cc: qemu-devel, qemu-ppc, harshpb, npiggin, milesg

On Thu, 2026-06-25 at 13:21 +0530, Aditya Gupta wrote:
> On 26/06/23 12:01PM, Shivang Upadhyay wrote:
> > Signed-off-by: Shivang Upadhyay <shivangu@linux.ibm.com>
> > ---
> >  hw/ppc/pnv.c | 10 ++++++++--
> >  1 file changed, 8 insertions(+), 2 deletions(-)
> > 
> > diff --git a/hw/ppc/pnv.c b/hw/ppc/pnv.c
> > index 62812f22f8..6a636b5192 100644
> > --- a/hw/ppc/pnv.c
> > +++ b/hw/ppc/pnv.c
> > @@ -803,8 +803,14 @@ static void pnv_reset(MachineState *machine,
> > ResetType type)
> >          mpipl_write_succeeded = do_mpipl_write(pnv);
> >      }
> >  
> > -    /* Regenerate device tree */
> > -    fdt = pnv_dt_create(machine);
> > +    if (machine->dtb) {
> > +        int file_size; /* discard */
> > +        fdt = load_device_tree(machine->dtb, &file_size);
> > +    } else {
> > +        /* Regenerate device tree */
> > +        fdt = pnv_dt_create(machine);
> > +    }
> > +
> 
> load_device_tree is being done in pnv_init also, how about this ?
> 
> 	/* only create new dt if -dtb wasn't explicity passed */
> 	if (!machine->dtb) {
> 		pnv_dt_create
> 		fdt_pack
> 	}
> 
> also, keep this before the mpipl block, ie. after qemu_devices_reset
> ?
Yea, That makes sense. 
ill fix this in v2.
> 
> Thanks,
> - Aditya G

~Shivang.


^ permalink raw reply	[flat|nested] 15+ messages in thread

* [PATCH v2 0/2] ppc/pnv: fixing external dtb
  2026-06-23  6:31 [PATCH 0/2] ppc/pnv: fixing external dtb Shivang Upadhyay
  2026-06-23  6:31 ` [PATCH 1/2] ppc/pnv: avoid regenerating DTB if external DTB is present Shivang Upadhyay
  2026-06-23  6:31 ` [PATCH 2/2] ppc/pnv: add test to verify external DTB is honored Shivang Upadhyay
@ 2026-06-26 11:22 ` Shivang Upadhyay
  2026-06-26 11:22   ` [PATCH v2 1/2] ppc/pnv: avoid regenerating DTB if external DTB is present Shivang Upadhyay
  2026-06-26 11:22   ` [PATCH v2 2/2] ppc/pnv: add test to verify external DTB is honored Shivang Upadhyay
  2 siblings, 2 replies; 15+ messages in thread
From: Shivang Upadhyay @ 2026-06-26 11:22 UTC (permalink / raw)
  To: shivangu; +Cc: adityag, harshpb, milesg, npiggin, qemu-devel, qemu-ppc

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
* 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] 15+ messages in thread

* [PATCH v2 1/2] ppc/pnv: avoid regenerating DTB if external DTB is present
  2026-06-26 11:22 ` [PATCH v2 0/2] ppc/pnv: fixing external dtb Shivang Upadhyay
@ 2026-06-26 11:22   ` Shivang Upadhyay
  2026-06-29 11:41     ` Aditya Gupta
  2026-06-26 11:22   ` [PATCH v2 2/2] ppc/pnv: add test to verify external DTB is honored Shivang Upadhyay
  1 sibling, 1 reply; 15+ messages in thread
From: Shivang Upadhyay @ 2026-06-26 11:22 UTC (permalink / raw)
  To: shivangu; +Cc: adityag, harshpb, milesg, npiggin, qemu-devel, qemu-ppc

Currently externally provided dtb is overwritten in `pnv_reset`.
Fix this by only creating dtb if not provided from `-dtb`.

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..e44fb7e2dc 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] 15+ messages in thread

* [PATCH v2 2/2] ppc/pnv: add test to verify external DTB is honored
  2026-06-26 11:22 ` [PATCH v2 0/2] ppc/pnv: fixing external dtb Shivang Upadhyay
  2026-06-26 11:22   ` [PATCH v2 1/2] ppc/pnv: avoid regenerating DTB if external DTB is present Shivang Upadhyay
@ 2026-06-26 11:22   ` Shivang Upadhyay
  2026-06-29 11:53     ` Aditya Gupta
  1 sibling, 1 reply; 15+ messages in thread
From: Shivang Upadhyay @ 2026-06-26 11:22 UTC (permalink / raw)
  To: shivangu; +Cc: adityag, harshpb, milesg, npiggin, qemu-devel, qemu-ppc

Test boots a powernv11 machine, using a custom dtb.
Custom dtb has the following bootargs.

    chosen {
        bootargs = "hello world";
    };

Test Checks wheather above bootargs make it to kernel's command line.

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..cb8f6545a0 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/output.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] 15+ messages in thread

* Re: [PATCH v2 1/2] ppc/pnv: avoid regenerating DTB if external DTB is present
  2026-06-26 11:22   ` [PATCH v2 1/2] ppc/pnv: avoid regenerating DTB if external DTB is present Shivang Upadhyay
@ 2026-06-29 11:41     ` Aditya Gupta
  0 siblings, 0 replies; 15+ messages in thread
From: Aditya Gupta @ 2026-06-29 11:41 UTC (permalink / raw)
  To: Shivang Upadhyay; +Cc: harshpb, milesg, npiggin, qemu-devel, qemu-ppc

On 26/06/26 04:52PM, Shivang Upadhyay wrote:
> Currently externally provided dtb is overwritten in `pnv_reset`.
> Fix this by only creating dtb if not provided from `-dtb`.
> 
> 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..e44fb7e2dc 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;
> +	}

nit: indent is wrong

with indentation fixed, feel free to add:
Reviewed-by: Aditya Gupta <adityag@linux.ibm.com>

- Aditya G



^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PATCH v2 2/2] ppc/pnv: add test to verify external DTB is honored
  2026-06-26 11:22   ` [PATCH v2 2/2] ppc/pnv: add test to verify external DTB is honored Shivang Upadhyay
@ 2026-06-29 11:53     ` Aditya Gupta
  2026-06-30  9:37       ` Shivang Upadhyay
  0 siblings, 1 reply; 15+ messages in thread
From: Aditya Gupta @ 2026-06-29 11:53 UTC (permalink / raw)
  To: Shivang Upadhyay; +Cc: harshpb, milesg, npiggin, qemu-devel, qemu-ppc

On 26/06/26 04:52PM, Shivang Upadhyay wrote:
> Test boots a powernv11 machine, using a custom dtb.
> Custom dtb has the following bootargs.
> 
>     chosen {
>         bootargs = "hello world";
>     };
> 
> Test Checks wheather above bootargs make it to kernel's command line.

nit: s/wheather/whether

> +    # 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/output.dtb'),
> +        'ea1271516264eea1eb58a067a99d0c2ca9528be8dc7d4e46bb2d5ae0d42fc568')

nit: since you are anyways sending a v3, can you rename output.dtb to
something like qemu-powernv10.dtb, etc so in future you don't modify
this generic path unknowingly ?

> +
>      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)
> +

Reviewed-by: Aditya Gupta <adityag@linux.ibm.com>

Thanks,
- Aditya G



^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PATCH v2 2/2] ppc/pnv: add test to verify external DTB is honored
  2026-06-29 11:53     ` Aditya Gupta
@ 2026-06-30  9:37       ` Shivang Upadhyay
  0 siblings, 0 replies; 15+ messages in thread
From: Shivang Upadhyay @ 2026-06-30  9:37 UTC (permalink / raw)
  To: Aditya Gupta; +Cc: harshpb, milesg, npiggin, qemu-devel, qemu-ppc

On Mon, 2026-06-29 at 17:23 +0530, Aditya Gupta wrote:
> > +    # 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/output.dt
> > b'),
> > +       
> > 'ea1271516264eea1eb58a067a99d0c2ca9528be8dc7d4e46bb2d5ae0d42fc568')
> 
> nit: since you are anyways sending a v3, can you rename output.dtb to
> something like qemu-powernv10.dtb, etc so in future you don't modify
> this generic path unknowingly ?

Yeah, Sounds like a good idea.
Ill send the next revision.

~Shivang.


^ permalink raw reply	[flat|nested] 15+ messages in thread

end of thread, other threads:[~2026-06-30  9:37 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-06-23  6:31 [PATCH 0/2] ppc/pnv: fixing external dtb Shivang Upadhyay
2026-06-23  6:31 ` [PATCH 1/2] ppc/pnv: avoid regenerating DTB if external DTB is present Shivang Upadhyay
2026-06-25  7:51   ` Aditya Gupta
2026-06-25  7:54     ` Shivang Upadhyay
2026-06-23  6:31 ` [PATCH 2/2] ppc/pnv: add test to verify external DTB is honored Shivang Upadhyay
2026-06-23  6:57   ` Amit Machhiwal
2026-06-23 15:42     ` Shivang Upadhyay
2026-06-25  7:02   ` Aditya Gupta
2026-06-25  7:30     ` Shivang Upadhyay
2026-06-26 11:22 ` [PATCH v2 0/2] ppc/pnv: fixing external dtb Shivang Upadhyay
2026-06-26 11:22   ` [PATCH v2 1/2] ppc/pnv: avoid regenerating DTB if external DTB is present Shivang Upadhyay
2026-06-29 11:41     ` Aditya Gupta
2026-06-26 11:22   ` [PATCH v2 2/2] ppc/pnv: add test to verify external DTB is honored Shivang Upadhyay
2026-06-29 11:53     ` Aditya Gupta
2026-06-30  9:37       ` 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.