[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <Z8GCyyt0Dud0kvwq@gmail.com>
Date: Fri, 28 Feb 2025 10:32:59 +0100
From: Ingo Molnar <mingo@...nel.org>
To: WangYuli <wangyuli@...ontech.com>
Cc: dave.hansen@...ux.intel.com, luto@...nel.org, peterz@...radead.org,
tglx@...utronix.de, mingo@...hat.com, bp@...en8.de, x86@...nel.org,
hpa@...or.com, linux-kernel@...r.kernel.org, zhanjun@...ontech.com,
niecheng1@...ontech.com, chenlinxuan@...ontech.com,
Huacai Chen <chenhuacai@...ngson.cn>,
Wentao Guan <guanwentao@...ontech.com>
Subject: Re: [PATCH] x86/srat: Conditional apic_id vs MAX_LOCAL_APIC
comparison
* WangYuli <wangyuli@...ontech.com> wrote:
> The apic_id employed within the acpi_numa_processor_affinity_init()
> function is derived from the acpi_srat_cpu_affinity structure defined
> in acpi/actbl3.h.
>
> When CONFIG_X86_X2APIC is not enabled, its maximum value is limited
> to 255.
How does the compiler know the value is limited to 0-255?
<acpi/actbl3.h> has an u32 apic_id field:
struct acpi_srat_x2apic_cpu_affinity {
struct acpi_subtable_header header;
u16 reserved; /* Reserved, must be zero */
u32 proximity_domain;
u32 apic_id;
^^^^^^^^^^^^
u32 flags;
u32 clock_domain;
u32 reserved2;
};
and the apic_id local variable in acpi_numa_processor_affinity_init()
is an 'int':
int apic_id;
Neither is limited to 0-255.
Thanks,
Ingo
Powered by blists - more mailing lists