qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] hw/arm/virt: Fix non-secure flash mode
@ 2019-07-12  7:50 David Engraf
  2019-07-12 15:34 ` Peter Maydell
  0 siblings, 1 reply; 2+ messages in thread
From: David Engraf @ 2019-07-12  7:50 UTC (permalink / raw)
  To: peter.maydell, qemu-arm; +Cc: qemu-devel, David Engraf

Using the whole 128 MiB flash in non-secure mode is not working because
virt_flash_fdt() expects the same address for secure_sysmem and sysmem.
This is not correctly handled by caller because it forwards NULL for
secure_sysmem in non-secure flash mode.

Fixed by using sysmem when secure_sysmem is NULL.

Signed-off-by: David Engraf <david.engraf@sysgo.com>
---
 hw/arm/virt.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/hw/arm/virt.c b/hw/arm/virt.c
index 0b5138cb22..d9496c9363 100644
--- a/hw/arm/virt.c
+++ b/hw/arm/virt.c
@@ -1674,7 +1674,7 @@ static void machvirt_init(MachineState *machine)
                                     &machine->device_memory->mr);
     }
 
-    virt_flash_fdt(vms, sysmem, secure_sysmem);
+    virt_flash_fdt(vms, sysmem, secure_sysmem ?: sysmem);
 
     create_gic(vms, pic);
 
-- 
2.17.1



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

* Re: [Qemu-devel] [PATCH] hw/arm/virt: Fix non-secure flash mode
  2019-07-12  7:50 [Qemu-devel] [PATCH] hw/arm/virt: Fix non-secure flash mode David Engraf
@ 2019-07-12 15:34 ` Peter Maydell
  0 siblings, 0 replies; 2+ messages in thread
From: Peter Maydell @ 2019-07-12 15:34 UTC (permalink / raw)
  To: David Engraf; +Cc: qemu-arm, QEMU Developers

On Fri, 12 Jul 2019 at 08:53, David Engraf <david.engraf@sysgo.com> wrote:
>
> Using the whole 128 MiB flash in non-secure mode is not working because
> virt_flash_fdt() expects the same address for secure_sysmem and sysmem.
> This is not correctly handled by caller because it forwards NULL for
> secure_sysmem in non-secure flash mode.
>
> Fixed by using sysmem when secure_sysmem is NULL.
>
> Signed-off-by: David Engraf <david.engraf@sysgo.com>

Nice catch; applied to target-arm.next for 4.1.

thanks
-- PMM


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

end of thread, other threads:[~2019-07-12 15:35 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-07-12  7:50 [Qemu-devel] [PATCH] hw/arm/virt: Fix non-secure flash mode David Engraf
2019-07-12 15:34 ` Peter Maydell

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).