Message ID | 1446747358-18214-15-git-send-email-peter.maydell@linaro.org |
---|---|
State | Superseded |
Headers | show |
On 6 November 2015 at 14:45, Edgar E. Iglesias <edgar.iglesias@gmail.com> wrote: > On Thu, Nov 05, 2015 at 06:15:56PM +0000, Peter Maydell wrote: >> Wire up the system memory region to the CPUs explicitly >> by setting the QOM property. This doesn't change anything >> over letting it default, but will be needed for adding >> a secure memory region later. >> >> Signed-off-by: Peter Maydell <peter.maydell@linaro.org> > > I'm not sure I understand this, if not set, wouldn't "memory" > just default to sysmem anyway regardless of if we set > "secure-memory" or not? I'm probably missing something > in the init/setup sequence... > > Anyway, I don't mind explicitely setting "memory": > Reviewed-by: Edgar E. Iglesias <edgar.iglesias@xilinx.com> Yes, you're right, it would default to the same thing; but it seemed clearer to me if the board is going to be setting memory regions explicitly on the CPU to set them all rather than letting one default and one not. (Also it provides an example in the code base of how to do it right ;-)) thanks -- PMM
diff --git a/hw/arm/virt.c b/hw/arm/virt.c index 77d9267..3ab31e0 100644 --- a/hw/arm/virt.c +++ b/hw/arm/virt.c @@ -1020,6 +1020,9 @@ static void machvirt_init(MachineState *machine) "reset-cbar", &error_abort); } + object_property_set_link(cpuobj, OBJECT(sysmem), "memory", + &error_abort); + object_property_set_bool(cpuobj, true, "realized", NULL); } g_strfreev(cpustr);
Wire up the system memory region to the CPUs explicitly by setting the QOM property. This doesn't change anything over letting it default, but will be needed for adding a secure memory region later. Signed-off-by: Peter Maydell <peter.maydell@linaro.org> --- hw/arm/virt.c | 3 +++ 1 file changed, 3 insertions(+) -- 1.9.1