History

Merge tag 'for-linus-6.9a-rc7-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/xen/tip

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

Linus Torvalds committed 2 years ago

Commit ddb4c3f2 parents f094ee7 802600e2 files · +12 −3Browse files

Unified · Split

2 files
  1. arch/x86/xen/enlighten_pv.c +10 −1
  2. arch/x86/xen/smp_pv.c +2 −2
arch/x86/xen/enlighten_pv.c+10−1
@@ -219,13 +219,21 @@ static __read_mostly unsigned int cpuid_leaf5_edx_val; · 218 unmodified lines
219219 static void xen_cpuid(unsigned int *ax, unsigned int *bx,
220220 unsigned int *cx, unsigned int *dx)
221221 {
222− unsigned maskebx = ~0;
222+ unsigned int maskebx = ~0;
223+ unsigned int or_ebx = 0;
223224
224225 /*
225226 * Mask out inconvenient features, to try and disable as many
226227 * unsupported kernel subsystems as possible.
227228 */
228229 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+
229237 case CPUID_MWAIT_LEAF:
230238 /* Synthesize the values.. */
231239 *ax = 0;
@@ -248,6 +256,7 @@ static void xen_cpuid(unsigned int *ax, unsigned int *bx, · 16 unmodified lines
248256 : "0" (*ax), "2" (*cx));
249257
250258 *bx &= maskebx;
259+ *bx |= or_ebx;
251260 }
252261
253262 static bool __init xen_check_mwait(void)
arch/x86/xen/smp_pv.c+2−2
@@ -154,9 +154,9 @@ static void __init xen_pv_smp_config(void) · 153 unmodified lines
154154 u32 apicid = 0;
155155 int i;
156156
157− topology_register_boot_apic(apicid++);
157+ topology_register_boot_apic(apicid);
158158
159− for (i = 1; i < nr_cpu_ids; i++)
159+ for (i = 0; i < nr_cpu_ids; i++)
160160 topology_register_apic(apicid++, CPU_ACPIID_INVALID, true);
161161
162162 /* Pretend to be a proper enumerated system */

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t