Skip to contentSkip to conversation

fix apic id reading in x2apic mode

PATCH Applied Gleb Natapov 2 participants 2 messages Aug 25, 2009 – Aug 26, 2009

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 fix apic id reading in x2apic mode

Format of apic id register is different in x2apic mode. Return correct apic id when apic is in x2apic mode.

arch/x86/kvm/lapic.c +6 -0
index e41e948..bd3a402 100644
@@ -551,6 +551,12 @@ static u32 __apic_read(struct kvm_lapic *apic, unsigned int offset)
 		return 0;
 
 	switch (offset) {
+	case APIC_ID:
+		if (apic_x2apic_mode(apic))
+			val = kvm_apic_id(apic);
+		else
+			val = kvm_apic_id(apic) << 24;
+		break;
 	case APIC_ARBPRI:
 		printk(KERN_WARNING "Access APIC ARBPRI register "
 		       "which is for P6\n");

--
Gleb.

Applied
#1 lore raw
Quoted 4 lines · Gleb Natapov

Format of apic id register is different in x2apic mode. Return correct apic id when apic is in x2apic mode.

Applied, thanks.

Signature · 1 line
error compiling committee.c: too many arguments to function