Pull xen fixes from Juergen Gross: "Two fixes when running as Xen PV guests for issues introduced in the 6.9 merge window, both related to apic id handling" * tag 'for-linus-6.9a-rc7-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/xen/tip: x86/xen: return a sane initial apic id when running as PV guest x86/xen/smp_pv: Register the boot CPU APIC properly
Unified · Split
| @@ -219,13 +219,21 @@ static __read_mostly unsigned int cpuid_leaf5_edx_val; · 218 unmodified lines | ||
| 219 | 219 | static void xen_cpuid(unsigned int *ax, unsigned int *bx, |
| 220 | 220 | unsigned int *cx, unsigned int *dx) |
| 221 | 221 | { |
| 222 | − unsigned maskebx = ~0; | |
| 222 | + unsigned int maskebx = ~0; | |
| 223 | + unsigned int or_ebx = 0; | |
| 223 | 224 | |
| 224 | 225 | /* |
| 225 | 226 | * Mask out inconvenient features, to try and disable as many |
| 226 | 227 | * unsupported kernel subsystems as possible. |
| 227 | 228 | */ |
| 228 | 229 | switch (*ax) { |
| 230 | + case 0x1: | |
| 231 | + /* Replace initial APIC ID in bits 24-31 of EBX. */ | |
| 232 | + /* See xen_pv_smp_config() for related topology preparations. */ | |
| 233 | + maskebx = 0x00ffffff; | |
| 234 | + or_ebx = smp_processor_id() << 24; | |
| 235 | + break; | |
| 236 | + | |
| 229 | 237 | case CPUID_MWAIT_LEAF: |
| 230 | 238 | /* Synthesize the values.. */ |
| 231 | 239 | *ax = 0; |
| @@ -248,6 +256,7 @@ static void xen_cpuid(unsigned int *ax, unsigned int *bx, · 16 unmodified lines | ||
| 248 | 256 | : "0" (*ax), "2" (*cx)); |
| 249 | 257 | |
| 250 | 258 | *bx &= maskebx; |
| 259 | + *bx |= or_ebx; | |
| 251 | 260 | } |
| 252 | 261 | |
| 253 | 262 | static bool __init xen_check_mwait(void) |
| @@ -154,9 +154,9 @@ static void __init xen_pv_smp_config(void) · 153 unmodified lines | ||
| 154 | 154 | u32 apicid = 0; |
| 155 | 155 | int i; |
| 156 | 156 | |
| 157 | − topology_register_boot_apic(apicid++); | |
| 157 | + topology_register_boot_apic(apicid); | |
| 158 | 158 | |
| 159 | − for (i = 1; i < nr_cpu_ids; i++) | |
| 159 | + for (i = 0; i < nr_cpu_ids; i++) | |
| 160 | 160 | topology_register_apic(apicid++, CPU_ACPIID_INVALID, true); |
| 161 | 161 | |
| 162 | 162 | /* Pretend to be a proper enumerated system */ |