Skip to contentSkip to conversation

always clear the X2APIC_ENABLE bit for PV guest

PATCH Applied Xin Li 3 participants 4 messages Dec 10, 2018 – Jan 14, 2019

Subsystems (2)
lore
Share & tools
lore

Xin Li

author
#0 lore raw

PATCH v2 1/1 always clear the X2APIC_ENABLE bit for PV guest

From: Talons Lee <[email protected]>

Commit e657fcc clears cpu capability bit instead of using fake cpuid value, the EXTD should always be off for PV guest without depending on cpuid value. So remove the cpuid check in xen_read_msr_safe() to always clear the X2APIC_ENABLE bit.

---
CC: Igor Druzhinin <[email protected]>
CC: Sergey Dyasli <[email protected]>
CC: Andrew Cooper <[email protected]>
CC: Juergen Gross <[email protected]>

v2:
don't use fake cpuid to cheat xen_read_msr_safe(), just always clear the EXTD bit.

---
 arch/x86/xen/enlighten_pv.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)
arch/x86/xen/enlighten_pv.c +1 -4
index 4b20082..17cf92b 100644
@@ -900,10 +900,7 @@ static u64 xen_read_msr_safe(unsigned int msr, int *err)
 	val = native_read_msr_safe(msr, err);
 	switch (msr) {
 	case MSR_IA32_APICBASE:
-#ifdef CONFIG_X86_X2APIC
-		if (!(cpuid_ecx(1) & (1 << (X86_FEATURE_X2APIC & 31))))
-#endif
-			val &= ~X2APIC_ENABLE;
+		val &= ~X2APIC_ENABLE;
 		break;
 	}
 	return val;
Signature · 7 lines
1.8.3.1


_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel
#1 lore raw

ping?

Quoted 30 lines · Xin Li

From: Talons Lee <[email protected]>

Commit e657fcc clears cpu capability bit instead of using fake cpuid value, the EXTD should always be off for PV guest without depending on cpuid value. So remove the cpuid check in xen_read_msr_safe() to always clear the X2APIC_ENABLE bit.

---
CC: Igor Druzhinin <[email protected]>
CC: Sergey Dyasli <[email protected]>
CC: Andrew Cooper <[email protected]>
CC: Juergen Gross <[email protected]>

v2:
don't use fake cpuid to cheat xen_read_msr_safe(), just always clear the EXTD bit.

---
 arch/x86/xen/enlighten_pv.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)
arch/x86/xen/enlighten_pv.c +0 -0
index 4b20082..17cf92b 100644
@@ -900,10 +900,7 @@ static u64 xen_read_msr_safe(unsigned int msr, int *err)
 	val = native_read_msr_safe(msr, err);

arch/x86/xen/enlighten_pv.c static u64 xen_read_msr_safe(unsigned int msr, int *err) · line 906

Quoted 10 lines
arch/x86/xen/enlighten_pv.c +1 -4
 	switch (msr) {
 	case MSR_IA32_APICBASE:
-#ifdef CONFIG_X86_X2APIC
-		if (!(cpuid_ecx(1) & (1 << (X86_FEATURE_X2APIC & 31))))
-#endif
-			val &= ~X2APIC_ENABLE;
+		val &= ~X2APIC_ENABLE;
 		break;
 	}
 	return val;

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel

reviewer Applied
#2 lore raw
Quoted 1 line · Igor Druzhinin

ping?

Applied to for-linus-4.21 (nka 5.0)

(this should have been copied to [email protected] and to me, which is partly the reason why it was missed)

-boris

Quoted 38 lines · Xin Li
Quoted 36 lines

From: Talons Lee <[email protected]>

Commit e657fcc clears cpu capability bit instead of using fake cpuid value, the EXTD should always be off for PV guest without depending on cpuid value. So remove the cpuid check in xen_read_msr_safe() to always clear the X2APIC_ENABLE bit.

---
CC: Igor Druzhinin <[email protected]>
CC: Sergey Dyasli <[email protected]>
CC: Andrew Cooper <[email protected]>
CC: Juergen Gross <[email protected]>

v2:
don't use fake cpuid to cheat xen_read_msr_safe(), just always clear the EXTD bit.

---
 arch/x86/xen/enlighten_pv.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)
arch/x86/xen/enlighten_pv.c +1 -4
index 4b20082..17cf92b 100644
@@ -900,10 +900,7 @@ static u64 xen_read_msr_safe(unsigned int msr, int *err)
 	val = native_read_msr_safe(msr, err);
 	switch (msr) {
 	case MSR_IA32_APICBASE:
-#ifdef CONFIG_X86_X2APIC
-		if (!(cpuid_ecx(1) & (1 << (X86_FEATURE_X2APIC & 31))))
-#endif
-			val &= ~X2APIC_ENABLE;
+		val &= ~X2APIC_ENABLE;
Quoted 8 lines

arch/x86/xen/enlighten_pv.c static u64 xen_read_msr_safe(unsigned int msr, int *err) · line 906

Quoted 4 lines
arch/x86/xen/enlighten_pv.c +0 -0
 		break;
 	}
 	return val;

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel

reviewer Applied
#3 lore raw
In reply to Igor Druzhinin
Quoted 1 line · Igor Druzhinin

ping?

Applied to for-linus-4.21 (nka 5.0)

(this should have been copied to [email protected] and to me, which is partly the reason why it was missed)

-boris

Quoted 46 lines · Xin Li
Quoted 30 lines

From: Talons Lee <[email protected]>

Commit e657fcc clears cpu capability bit instead of using fake cpuid value, the EXTD should always be off for PV guest without depending on cpuid value. So remove the cpuid check in xen_read_msr_safe() to always clear the X2APIC_ENABLE bit.

---
CC: Igor Druzhinin <[email protected]>
CC: Sergey Dyasli <[email protected]>
CC: Andrew Cooper <[email protected]>
CC: Juergen Gross <[email protected]>

v2:
don't use fake cpuid to cheat xen_read_msr_safe(), just always clear the EXTD bit.

---
 arch/x86/xen/enlighten_pv.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)
arch/x86/xen/enlighten_pv.c +0 -0
index 4b20082..17cf92b 100644
@@ -900,10 +900,7 @@ static u64 xen_read_msr_safe(unsigned int msr, int *err)
 	val = native_read_msr_safe(msr, err);

arch/x86/xen/enlighten_pv.c static u64 xen_read_msr_safe(unsigned int msr, int *err) · line 906

Quoted 10 lines
arch/x86/xen/enlighten_pv.c +1 -4
 	switch (msr) {
 	case MSR_IA32_APICBASE:
-#ifdef CONFIG_X86_X2APIC
-		if (!(cpuid_ecx(1) & (1 << (X86_FEATURE_X2APIC & 31))))
-#endif
-			val &= ~X2APIC_ENABLE;
+		val &= ~X2APIC_ENABLE;
 		break;
 	}
 	return val;

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel