bug-hurd
[Top][All Lists]
Advanced

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

Re: [PATCH v2 gnumach] cpu_number: Short circuit if smp init not done


From: Samuel Thibault
Subject: Re: [PATCH v2 gnumach] cpu_number: Short circuit if smp init not done
Date: Mon, 13 Feb 2023 01:31:23 +0100
User-agent: NeoMutt/20170609 (1.8.3)

Applied, thanks!

Damien Zammit, le sam. 04 févr. 2023 10:15:36 +0000, a ecrit:
> This depends on serialised AP init patch.
> 
> Fixes warnings spewing at boot with APIC and SMP
> ---
>  i386/i386/cpu_number.c | 5 +++++
>  i386/i386/mp_desc.h    | 2 ++
>  2 files changed, 7 insertions(+)
> 
> diff --git a/i386/i386/cpu_number.c b/i386/i386/cpu_number.c
> index 42aa6ea1..1d2fab3a 100644
> --- a/i386/i386/cpu_number.c
> +++ b/i386/i386/cpu_number.c
> @@ -19,12 +19,17 @@
>  #include <i386/apic.h>
>  #include <i386/smp.h>
>  #include <i386/cpu.h>
> +#include <i386/mp_desc.h>
>  #include <kern/printf.h>
> 
>  #if NCPUS > 1
>  int cpu_number(void)
>  {
>       int kernel_id, apic_id;
> +
> +     if (bspdone == 0)
> +             return 0;
> +
>       apic_id = apic_get_current_cpu();
>       if (apic_id < 0) {
>               printf("apic_get_current_cpu() failed, assuming BSP\n");
> diff --git a/i386/i386/mp_desc.h b/i386/i386/mp_desc.h
> index 59d50e77..fea42cd3 100644
> --- a/i386/i386/mp_desc.h
> +++ b/i386/i386/mp_desc.h
> @@ -76,6 +76,8 @@ extern struct real_descriptor       *mp_gdt[NCPUS];
> 
>  extern uint8_t solid_intstack[];
> 
> +extern int bspdone;
> +
>  /*
>   * Each CPU calls this routine to set up its descriptor tables.
>   */
> --
> 2.34.1
> 
> 
> 

-- 
Samuel
---
Pour une évaluation indépendante, transparente et rigoureuse !
Je soutiens la Commission d'Évaluation de l'Inria.



reply via email to

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