[Xen-devel,03/13] xen/arm: setup: Check errata for boot CPU later on

Message ID 20180522174254.27551-4-julien.grall@arm.com
State Superseded
Headers show
Series
  • xen/arm: SSBD (aka Spectre-v4) mitigation (XSA-263)
Related show

Commit Message

Julien Grall May 22, 2018, 5:42 p.m.
Some errata will rely on the SMCCC version which is detected by
psci_init().

This is part of XSA-263.

Signed-off-by: Julien Grall <julien.grall@arm.com>
---
 xen/arch/arm/setup.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

Comments

Stefano Stabellini May 23, 2018, 9:34 p.m. | #1
On Tue, 22 May 2018, Julien Grall wrote:
> Some errata will rely on the SMCCC version which is detected by
> psci_init().
> 
> This is part of XSA-263.
> 
> Signed-off-by: Julien Grall <julien.grall@arm.com>

Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>

> ---
>  xen/arch/arm/setup.c | 8 ++++++--
>  1 file changed, 6 insertions(+), 2 deletions(-)
> 
> diff --git a/xen/arch/arm/setup.c b/xen/arch/arm/setup.c
> index 1d6f6bf37e..ac93de4786 100644
> --- a/xen/arch/arm/setup.c
> +++ b/xen/arch/arm/setup.c
> @@ -171,8 +171,6 @@ static void __init processor_id(void)
>      }
>  
>      processor_setup();
> -
> -    check_local_cpu_errata();
>  }
>  
>  void dt_unreserved_regions(paddr_t s, paddr_t e,
> @@ -779,6 +777,12 @@ void __init start_xen(unsigned long boot_phys_offset,
>      printk(XENLOG_INFO "SMP: Allowing %u CPUs\n", cpus);
>      nr_cpu_ids = cpus;
>  
> +    /*
> +     * Some errata relies on SMCCC version which is detected by psci_init()
> +     * (called from smp_init_cpus()).
> +     */
> +    check_local_cpu_errata();
> +
>      init_xen_time();
>  
>      gic_init();
> -- 
> 2.11.0
>
Julien Grall May 25, 2018, 7:51 p.m. | #2
Hi Stefano,

On 05/23/2018 10:34 PM, Stefano Stabellini wrote:
> On Tue, 22 May 2018, Julien Grall wrote:
>> Some errata will rely on the SMCCC version which is detected by
>> psci_init().
>>
>> This is part of XSA-263.
>>
>> Signed-off-by: Julien Grall <julien.grall@arm.com>
>
> Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>

Thank you for the review. On an internal review Andre's suggested to 
move psci_init() outside smp_init_cpus(). Something like:

    processor_id();

     /* Need PSCI version for firmware based errata workarounds */
     psci_init();

     check_local_cpu_errata();

     smp_init_cpus();

I am wondering whether it would be clearer to have. What do you think?

Cheers,

> 
>> ---
>>   xen/arch/arm/setup.c | 8 ++++++--
>>   1 file changed, 6 insertions(+), 2 deletions(-)
>>
>> diff --git a/xen/arch/arm/setup.c b/xen/arch/arm/setup.c
>> index 1d6f6bf37e..ac93de4786 100644
>> --- a/xen/arch/arm/setup.c
>> +++ b/xen/arch/arm/setup.c
>> @@ -171,8 +171,6 @@ static void __init processor_id(void)
>>       }
>>   
>>       processor_setup();
>> -
>> -    check_local_cpu_errata();
>>   }
>>   
>>   void dt_unreserved_regions(paddr_t s, paddr_t e,
>> @@ -779,6 +777,12 @@ void __init start_xen(unsigned long boot_phys_offset,
>>       printk(XENLOG_INFO "SMP: Allowing %u CPUs\n", cpus);
>>       nr_cpu_ids = cpus;
>>   
>> +    /*
>> +     * Some errata relies on SMCCC version which is detected by psci_init()
>> +     * (called from smp_init_cpus()).
>> +     */
>> +    check_local_cpu_errata();
>> +
>>       init_xen_time();
>>   
>>       gic_init();
>> -- 
>> 2.11.0
>>
Stefano Stabellini May 29, 2018, 9:30 p.m. | #3
On Fri, 25 May 2018, Julien Grall wrote:
> Hi Stefano,
> 
> On 05/23/2018 10:34 PM, Stefano Stabellini wrote:
> > On Tue, 22 May 2018, Julien Grall wrote:
> > > Some errata will rely on the SMCCC version which is detected by
> > > psci_init().
> > > 
> > > This is part of XSA-263.
> > > 
> > > Signed-off-by: Julien Grall <julien.grall@arm.com>
> > 
> > Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
> 
> Thank you for the review. On an internal review Andre's suggested to move
> psci_init() outside smp_init_cpus(). Something like:
> 
>    processor_id();
> 
>     /* Need PSCI version for firmware based errata workarounds */
>     psci_init();
> 
>     check_local_cpu_errata();
> 
>     smp_init_cpus();
> 
> I am wondering whether it would be clearer to have. What do you think?

That also works. I am fine either way, they both look OK to me.


> 
> > 
> > > ---
> > >   xen/arch/arm/setup.c | 8 ++++++--
> > >   1 file changed, 6 insertions(+), 2 deletions(-)
> > > 
> > > diff --git a/xen/arch/arm/setup.c b/xen/arch/arm/setup.c
> > > index 1d6f6bf37e..ac93de4786 100644
> > > --- a/xen/arch/arm/setup.c
> > > +++ b/xen/arch/arm/setup.c
> > > @@ -171,8 +171,6 @@ static void __init processor_id(void)
> > >       }
> > >         processor_setup();
> > > -
> > > -    check_local_cpu_errata();
> > >   }
> > >     void dt_unreserved_regions(paddr_t s, paddr_t e,
> > > @@ -779,6 +777,12 @@ void __init start_xen(unsigned long boot_phys_offset,
> > >       printk(XENLOG_INFO "SMP: Allowing %u CPUs\n", cpus);
> > >       nr_cpu_ids = cpus;
> > >   +    /*
> > > +     * Some errata relies on SMCCC version which is detected by
> > > psci_init()
> > > +     * (called from smp_init_cpus()).
> > > +     */
> > > +    check_local_cpu_errata();
> > > +
> > >       init_xen_time();
> > >         gic_init();
> > > -- 
> > > 2.11.0
> > > 
> 
> -- 
> Julien Grall
>
Julien Grall May 30, 2018, 9:17 a.m. | #4
Hi Stefano,

On 05/29/2018 10:30 PM, Stefano Stabellini wrote:
> On Fri, 25 May 2018, Julien Grall wrote:
>> Hi Stefano,
>>
>> On 05/23/2018 10:34 PM, Stefano Stabellini wrote:
>>> On Tue, 22 May 2018, Julien Grall wrote:
>>>> Some errata will rely on the SMCCC version which is detected by
>>>> psci_init().
>>>>
>>>> This is part of XSA-263.
>>>>
>>>> Signed-off-by: Julien Grall <julien.grall@arm.com>
>>>
>>> Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
>>
>> Thank you for the review. On an internal review Andre's suggested to move
>> psci_init() outside smp_init_cpus(). Something like:
>>
>>     processor_id();
>>
>>      /* Need PSCI version for firmware based errata workarounds */
>>      psci_init();
>>
>>      check_local_cpu_errata();
>>
>>      smp_init_cpus();
>>
>> I am wondering whether it would be clearer to have. What do you think?
> 
> That also works. I am fine either way, they both look OK to me.

I will keep the current version then.

Cheers,

> 
> 
>>
>>>
>>>> ---
>>>>    xen/arch/arm/setup.c | 8 ++++++--
>>>>    1 file changed, 6 insertions(+), 2 deletions(-)
>>>>
>>>> diff --git a/xen/arch/arm/setup.c b/xen/arch/arm/setup.c
>>>> index 1d6f6bf37e..ac93de4786 100644
>>>> --- a/xen/arch/arm/setup.c
>>>> +++ b/xen/arch/arm/setup.c
>>>> @@ -171,8 +171,6 @@ static void __init processor_id(void)
>>>>        }
>>>>          processor_setup();
>>>> -
>>>> -    check_local_cpu_errata();
>>>>    }
>>>>      void dt_unreserved_regions(paddr_t s, paddr_t e,
>>>> @@ -779,6 +777,12 @@ void __init start_xen(unsigned long boot_phys_offset,
>>>>        printk(XENLOG_INFO "SMP: Allowing %u CPUs\n", cpus);
>>>>        nr_cpu_ids = cpus;
>>>>    +    /*
>>>> +     * Some errata relies on SMCCC version which is detected by
>>>> psci_init()
>>>> +     * (called from smp_init_cpus()).
>>>> +     */
>>>> +    check_local_cpu_errata();
>>>> +
>>>>        init_xen_time();
>>>>          gic_init();
>>>> -- 
>>>> 2.11.0
>>>>
>>
>> -- 
>> Julien Grall
>>

Patch

diff --git a/xen/arch/arm/setup.c b/xen/arch/arm/setup.c
index 1d6f6bf37e..ac93de4786 100644
--- a/xen/arch/arm/setup.c
+++ b/xen/arch/arm/setup.c
@@ -171,8 +171,6 @@  static void __init processor_id(void)
     }
 
     processor_setup();
-
-    check_local_cpu_errata();
 }
 
 void dt_unreserved_regions(paddr_t s, paddr_t e,
@@ -779,6 +777,12 @@  void __init start_xen(unsigned long boot_phys_offset,
     printk(XENLOG_INFO "SMP: Allowing %u CPUs\n", cpus);
     nr_cpu_ids = cpus;
 
+    /*
+     * Some errata relies on SMCCC version which is detected by psci_init()
+     * (called from smp_init_cpus()).
+     */
+    check_local_cpu_errata();
+
     init_xen_time();
 
     gic_init();