Re: [PATCH v2 4/5] hw/arm: enable secure EL2 timers for virt machine

2025-01-22 Thread Alex Bennée
Peter Maydell  writes:

> On Wed, 18 Dec 2024 at 18:15, Alex Bennée  wrote:
>>
>> Signed-off-by: Alex Bennée 
>> Cc: [email protected]
>> ---
>>  hw/arm/virt.c | 2 ++
>>  1 file changed, 2 insertions(+)
>>
>> diff --git a/hw/arm/virt.c b/hw/arm/virt.c
>> index 333eaf67ea..5e3589dc6a 100644
>> --- a/hw/arm/virt.c
>> +++ b/hw/arm/virt.c
>> @@ -873,6 +873,8 @@ static void create_gic(VirtMachineState *vms, 
>> MemoryRegion *mem)
>>  [GTIMER_HYP]  = ARCH_TIMER_NS_EL2_IRQ,
>>  [GTIMER_SEC]  = ARCH_TIMER_S_EL1_IRQ,
>>  [GTIMER_HYPVIRT] = ARCH_TIMER_NS_EL2_VIRT_IRQ,
>> +[GTIMER_SEC_PEL2] = ARCH_TIMER_S_EL2_IRQ,
>> +[GTIMER_SEC_VEL2] = ARCH_TIMER_S_EL2_VIRT_IRQ,
>>  };
>>
>>  for (unsigned irq = 0; irq < ARRAY_SIZE(timer_irq); irq++) {
>
> Do these timer interrupts have a defined devicetree binding that
> we need to set up in fdt_add_timer_nodes()? How about ACPI?

The DT in the kernel doesn't care (why would it, it never sees the SEL2
timers). The hafnium test case works without it.

I'm not sure where there is a DT specification that describes what
should be there for SEL2.

>
> thanks
> -- PMM

-- 
Alex Bennée
Virtualisation Tech Lead @ Linaro



Re: [PATCH v2 4/5] hw/arm: enable secure EL2 timers for virt machine

2025-01-10 Thread Peter Maydell
On Wed, 18 Dec 2024 at 18:15, Alex Bennée  wrote:
>
> Signed-off-by: Alex Bennée 
> Cc: [email protected]
> ---
>  hw/arm/virt.c | 2 ++
>  1 file changed, 2 insertions(+)
>
> diff --git a/hw/arm/virt.c b/hw/arm/virt.c
> index 333eaf67ea..5e3589dc6a 100644
> --- a/hw/arm/virt.c
> +++ b/hw/arm/virt.c
> @@ -873,6 +873,8 @@ static void create_gic(VirtMachineState *vms, 
> MemoryRegion *mem)
>  [GTIMER_HYP]  = ARCH_TIMER_NS_EL2_IRQ,
>  [GTIMER_SEC]  = ARCH_TIMER_S_EL1_IRQ,
>  [GTIMER_HYPVIRT] = ARCH_TIMER_NS_EL2_VIRT_IRQ,
> +[GTIMER_SEC_PEL2] = ARCH_TIMER_S_EL2_IRQ,
> +[GTIMER_SEC_VEL2] = ARCH_TIMER_S_EL2_VIRT_IRQ,
>  };
>
>  for (unsigned irq = 0; irq < ARRAY_SIZE(timer_irq); irq++) {

Do these timer interrupts have a defined devicetree binding that
we need to set up in fdt_add_timer_nodes()? How about ACPI?

thanks
-- PMM