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

Re: [Xen-devel] [PATCH v3 3/4] x86/smp: check APIC ID on AP bringup



On 04.12.2019 17:20, Roger Pau Monne wrote:
> Check that the processor to be woken up APIC ID is addressable in the
> current APIC mode.
> 
> Note that in practice systems with APIC IDs > 255 should already have
> x2APIC enabled by the firmware, and hence this is mostly a safety
> belt.
> 
> Signed-off-by: Roger Pau Monné <roger.pau@xxxxxxxxxx>
> ---
> Changes since v2:
>  - Reword error message.
> ---
>  xen/arch/x86/smpboot.c | 7 +++++++
>  1 file changed, 7 insertions(+)
> 
> diff --git a/xen/arch/x86/smpboot.c b/xen/arch/x86/smpboot.c
> index fa691b6ba0..8cbb7173a4 100644
> --- a/xen/arch/x86/smpboot.c
> +++ b/xen/arch/x86/smpboot.c
> @@ -1317,6 +1317,13 @@ int __cpu_up(unsigned int cpu)
>      if ( (apicid = x86_cpu_to_apicid[cpu]) == BAD_APICID )
>          return -ENODEV;
>  
> +    if ( (!x2apic_enabled || !iommu_intremap) && (apicid >> 8) )

Btw, I'll change the right side to "apicid >= 0xff", as that ID is
special. Or perhaps this should really be

    if ( (!x2apic_enabled && apicid >= APIC_ALL_CPUS) ||
         (!iommu_intremap && (apicid >> 8)) )

Thoughts?

Jan

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/mailman/listinfo/xen-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.