[PATCH v6 2/3] x86, apic: Add disable_cpu_apicid kernel parameter
Vivek Goyal
vgoyal at redhat.com
Thu Nov 21 16:33:00 EST 2013
On Thu, Nov 21, 2013 at 11:00:44AM +0900, HATAYAMA Daisuke wrote:
[..]
> @@ -2122,6 +2129,19 @@ void generic_processor_info(int apicid, int version)
> bool boot_cpu_detected = physid_isset(boot_cpu_physical_apicid,
> phys_cpu_present_map);
>
> + if (disabled_cpu_apicid != BAD_APICID &&
> + disabled_cpu_apicid != boot_cpu_physical_apicid &&
Hi Hatayama,
So we are comparing disabled_cpu_apicid with boot_cpu_physical_apicid
to make sure that one can not disable the cpu we are booting on. Can
we just read the apic id of booting cpu in local variable and compare
against that?
Something like as follows.
if (disabled_cpu_apicid != BAD_APICID &&
disabled_cpu_apicid == apicid &&
disabled_cpu_apicid != read_apic_id()) {
/* Disable cpu */
}
If above works, you will not need first patch in the series?
Thanks
Vivek
More information about the kexec
mailing list