qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH 05/13] target-arm: Add vexpress machine secure p


From: Peter Maydell
Subject: Re: [Qemu-devel] [PATCH 05/13] target-arm: Add vexpress machine secure property
Date: Fri, 5 Dec 2014 15:20:23 +0000

On 3 December 2014 at 20:05, Greg Bellows <address@hidden> wrote:
> Add "secure" Vexpress machine specific property to allow override of the
> default secure state configuration.  By default, when using the QEMU
> -kernel command line argument, Vexpress machines boot into NS/SVC.  When using
> the QEMU -bios command line argument, Vexpress machines boot into S/SVC.
>
> The secure state can be changed from the default specifying the secure
> state as a machine property.  For example, the below command line would enable
> secure state on a -linux boot:
>
>     aarch64-softmmu/qemu-system-aarch64
>         -machine type=vexpress-a15,secure=on
>         -kernel ...

> +static void vexpress_instance_init(Object *obj)
> +{
> +    VexpressMachineState *vms = VEXPRESS_MACHINE(obj);
> +
> +    /* All Vexpress machine instances have a secure property
> +     * Determine whether to start in a secure state or non-secure state based
> +     * on whether we are directly booting a kernel ("-kernel" option).  If we
> +     * are, then we default to booting into non-secure state.  Otherwise, we
> +     * default to the machine default which is secure EL1/SVC.
> +     * This may be overridden by the "secure" machine property.
> +     */
> +    if (qemu_opt_get(qemu_get_machine_opts(), "kernel")) {
> +        vms->secure = false;
> +    } else {
> +        vms->secure = true;
> +    }
> +
> +    object_property_add_bool(obj, "secure", vexpress_get_secure,
> +                             vexpress_set_secure, NULL);
> +}

What I had in mind when we were discussing this was that whether
you used -kernel or not wouldn't affect the configuration of the
CPU, but would affect what we started the CPU in (ie hw/arm/boot.c
code would put the CPU in some sensible initial state as required
by the kernel booting API). Sorry for the confusion.

-- PMM



reply via email to

[Prev in Thread] Current Thread [Next in Thread]