From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:38746) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Y0Z7J-0003Ax-2b for qemu-devel@nongnu.org; Mon, 15 Dec 2014 12:07:34 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Y0Z7B-0007xe-9v for qemu-devel@nongnu.org; Mon, 15 Dec 2014 12:07:28 -0500 Received: from mail-lb0-f171.google.com ([209.85.217.171]:40634) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Y0Z7B-0007xY-46 for qemu-devel@nongnu.org; Mon, 15 Dec 2014 12:07:21 -0500 Received: by mail-lb0-f171.google.com with SMTP id w7so5160076lbi.2 for ; Mon, 15 Dec 2014 09:07:20 -0800 (PST) MIME-Version: 1.0 In-Reply-To: <1418340569-30519-13-git-send-email-greg.bellows@linaro.org> References: <1418340569-30519-1-git-send-email-greg.bellows@linaro.org> <1418340569-30519-13-git-send-email-greg.bellows@linaro.org> From: Peter Maydell Date: Mon, 15 Dec 2014 17:07:00 +0000 Message-ID: Content-Type: text/plain; charset=UTF-8 Subject: Re: [Qemu-devel] [PATCH v2 12/15] target-arm: Set CPU has_el3 prop during virt init List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Greg Bellows Cc: Sergey Fedorov , QEMU Developers , Fabian Aggeler , "Edgar E. Iglesias" On 11 December 2014 at 23:29, Greg Bellows wrote: > Adds setting of the CPU has_el3 property based on the virt machine > secure state property during initialization. This enables/disables EL3 > state during start-up. Changes include adding an additional secure state > boolean during virt CPU initialization. Also disables the ARM secure boot > by default. > > Signed-off-by: Greg Bellows > > --- > > v1 -> v2 > - Changes CPU property name from "secure" to "has_el3" > - Change conditional to handle machine state default of secure. The check > now checks if the machine secure property has been disabled which causes the > CPU EL3 feature to be disabled. > - Add setting of arm_boot_info.secure_boot to false > --- > hw/arm/virt.c | 13 +++++++++++++ > 1 file changed, 13 insertions(+) > > diff --git a/hw/arm/virt.c b/hw/arm/virt.c > index 3eacc43..19d6174 100644 > --- a/hw/arm/virt.c > +++ b/hw/arm/virt.c > @@ -547,6 +547,7 @@ static void *machvirt_dtb(const struct arm_boot_info *binfo, int *fdt_size) > > static void machvirt_init(MachineState *machine) > { > + VirtMachineState *vms = VIRT_MACHINE(machine); > qemu_irq pic[NUM_IRQS]; > MemoryRegion *sysmem = get_system_memory(); > int n; > @@ -584,6 +585,16 @@ static void machvirt_init(MachineState *machine) > } > cpuobj = object_new(object_class_get_name(oc)); > > + if (!vms->secure) { > + Error *err = NULL; > + object_property_set_bool(cpuobj, false, "has_el3", &err); > + if (err) { > + error_report("'secure' machine property not supported " > + "with %s cpu", cpu_model); > + exit(1); > + } > + } As with vexpress, we should silently continue if the CPU object doesn't have has_el3. > + > object_property_set_int(cpuobj, QEMU_PSCI_CONDUIT_HVC, "psci-conduit", > NULL); > > @@ -630,6 +641,8 @@ static void machvirt_init(MachineState *machine) > vbi->bootinfo.board_id = -1; > vbi->bootinfo.loader_start = vbi->memmap[VIRT_MEM].base; > vbi->bootinfo.get_dtb = machvirt_dtb; > + /* Indicate that when booting Linux we should be in non-secure state */ > + vbi->bootinfo.secure_boot = false; You don't need to set this, false is the default. > arm_load_kernel(ARM_CPU(first_cpu), &vbi->bootinfo); > } thanks -- PMM