Commit ddb4c3f2 authored by Linus Torvalds's avatar Linus Torvalds
Browse files

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
parents f094ee78 802600eb
Loading
Loading
Loading
Loading
+10 −1
Original line number Diff line number Diff line
@@ -219,13 +219,21 @@ static __read_mostly unsigned int cpuid_leaf5_edx_val;
static void xen_cpuid(unsigned int *ax, unsigned int *bx,
		      unsigned int *cx, unsigned int *dx)
{
	unsigned maskebx = ~0;
	unsigned int maskebx = ~0;
	unsigned int or_ebx = 0;

	/*
	 * Mask out inconvenient features, to try and disable as many
	 * unsupported kernel subsystems as possible.
	 */
	switch (*ax) {
	case 0x1:
		/* Replace initial APIC ID in bits 24-31 of EBX. */
		/* See xen_pv_smp_config() for related topology preparations. */
		maskebx = 0x00ffffff;
		or_ebx = smp_processor_id() << 24;
		break;

	case CPUID_MWAIT_LEAF:
		/* Synthesize the values.. */
		*ax = 0;
@@ -248,6 +256,7 @@ static void xen_cpuid(unsigned int *ax, unsigned int *bx,
		: "0" (*ax), "2" (*cx));

	*bx &= maskebx;
	*bx |= or_ebx;
}

static bool __init xen_check_mwait(void)
+2 −2
Original line number Diff line number Diff line
@@ -154,9 +154,9 @@ static void __init xen_pv_smp_config(void)
	u32 apicid = 0;
	int i;

	topology_register_boot_apic(apicid++);
	topology_register_boot_apic(apicid);

	for (i = 1; i < nr_cpu_ids; i++)
	for (i = 0; i < nr_cpu_ids; i++)
		topology_register_apic(apicid++, CPU_ACPIID_INVALID, true);

	/* Pretend to be a proper enumerated system */