Skip to contentSkip to conversation

x86/xen: cpuid() cleanup

PATCH Superseded Juergen Gross 2 participants 12 messages Feb 17, 2017

Subsystems (2)

v1 of 3 Superseded Latest is v3 →

lore
Share & tools
lore

Juergen Gross

author maintainer
#0 lore raw

cover x86/xen: cpuid() cleanup

Reduce special casing of xen_cpuid() and disable DCA feature for pv domains as it isn't supported under Xen.

Juergen Gross (2):
x86/xen: don't indicate DCA support in pv domains x86/xen: use capabilities instead of fake cpuid values

 arch/x86/xen/enlighten.c | 14 ++++++--------
 1 file changed, 6 insertions(+), 8 deletions(-)
Signature · 1 line
2.10.2
author maintainer
#1 lore raw

PATCH 1/2 x86/xen: don't indicate DCA support in pv domains

Xen doesn't support DCA (direct cache access) for pv domains. Clear the corresponding capability indicator.

---
 arch/x86/xen/enlighten.c | 3 +++
 1 file changed, 3 insertions(+)
arch/x86/xen/enlighten.c +3 -0
index 51ef952..83399ce 100644
@@ -461,6 +461,9 @@ static void __init xen_init_cpuid_mask(void)
 		cpuid_leaf1_ecx_mask &= ~xsave_mask; /* disable XSAVE & OSXSAVE */
 	if (xen_check_mwait())
 		cpuid_leaf1_ecx_set_mask = (1 << (X86_FEATURE_MWAIT % 32));
+
+	/* Disable DCA feature. */
+	setup_clear_cpu_cap(X86_FEATURE_DCA);
 }
 
 static void xen_set_debugreg(int reg, unsigned long val)
Signature · 7 lines
2.10.2


_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel
author maintainer
#2 lore raw

PATCH 1/2 x86/xen: don't indicate DCA support in pv domains

In reply to Juergen Gross

Xen doesn't support DCA (direct cache access) for pv domains. Clear the corresponding capability indicator.

---
 arch/x86/xen/enlighten.c | 3 +++
 1 file changed, 3 insertions(+)
arch/x86/xen/enlighten.c +3 -0
index 51ef952..83399ce 100644
@@ -461,6 +461,9 @@ static void __init xen_init_cpuid_mask(void)
 		cpuid_leaf1_ecx_mask &= ~xsave_mask; /* disable XSAVE & OSXSAVE */
 	if (xen_check_mwait())
 		cpuid_leaf1_ecx_set_mask = (1 << (X86_FEATURE_MWAIT % 32));
+
+	/* Disable DCA feature. */
+	setup_clear_cpu_cap(X86_FEATURE_DCA);
 }
 
 static void xen_set_debugreg(int reg, unsigned long val)
Signature · 1 line
2.10.2
author maintainer
#3 lore raw

PATCH 2/2 x86/xen: use capabilities instead of fake cpuid values

In reply to Juergen Gross

When running as pv domain xen_cpuid() is being used instead of native_cpuid(). In xen_cpuid() the aperf/mperf feature is indicated as not being present by special casing the related cpuid leaf.

Instead of delivering fake cpuid values clear the cpu capability bit for aperf/mperf instead.

---
 arch/x86/xen/enlighten.c | 11 +++--------
 1 file changed, 3 insertions(+), 8 deletions(-)
arch/x86/xen/enlighten.c +3 -8
index 83399ce..0eebb75 100644
@@ -301,9 +301,6 @@ xen_running_on_version_or_later(unsigned int major, unsigned int minor)
 	return false;
 }
 
-#define CPUID_THERM_POWER_LEAF 6
-#define APERFMPERF_PRESENT 0
-
 static __read_mostly unsigned int cpuid_leaf1_edx_mask = ~0;
 static __read_mostly unsigned int cpuid_leaf1_ecx_mask = ~0;
 
@@ -337,11 +334,6 @@ static void xen_cpuid(unsigned int *ax, unsigned int *bx,
 		*dx = cpuid_leaf5_edx_val;
 		return;
 
-	case CPUID_THERM_POWER_LEAF:
-		/* Disabling APERFMPERF for kernel usage */
-		maskecx = ~(1 << APERFMPERF_PRESENT);
-		break;
-
 	case 0xb:
 		/* Suppress extended topology stuff */
 		maskebx = 0;
@@ -462,6 +454,9 @@ static void __init xen_init_cpuid_mask(void)
 	if (xen_check_mwait())
 		cpuid_leaf1_ecx_set_mask = (1 << (X86_FEATURE_MWAIT % 32));
 
+	/* Disable APERFMPERF feature. */
+	setup_clear_cpu_cap(X86_FEATURE_APERFMPERF);
+
 	/* Disable DCA feature. */
 	setup_clear_cpu_cap(X86_FEATURE_DCA);
 }
Signature · 7 lines
2.10.2


_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel
author maintainer
#4 lore raw

PATCH 2/2 x86/xen: use capabilities instead of fake cpuid values

In reply to Juergen Gross

When running as pv domain xen_cpuid() is being used instead of native_cpuid(). In xen_cpuid() the aperf/mperf feature is indicated as not being present by special casing the related cpuid leaf.

Instead of delivering fake cpuid values clear the cpu capability bit for aperf/mperf instead.

---
 arch/x86/xen/enlighten.c | 11 +++--------
 1 file changed, 3 insertions(+), 8 deletions(-)
arch/x86/xen/enlighten.c +3 -8
index 83399ce..0eebb75 100644
@@ -301,9 +301,6 @@ xen_running_on_version_or_later(unsigned int major, unsigned int minor)
 	return false;
 }
 
-#define CPUID_THERM_POWER_LEAF 6
-#define APERFMPERF_PRESENT 0
-
 static __read_mostly unsigned int cpuid_leaf1_edx_mask = ~0;
 static __read_mostly unsigned int cpuid_leaf1_ecx_mask = ~0;
 
@@ -337,11 +334,6 @@ static void xen_cpuid(unsigned int *ax, unsigned int *bx,
 		*dx = cpuid_leaf5_edx_val;
 		return;
 
-	case CPUID_THERM_POWER_LEAF:
-		/* Disabling APERFMPERF for kernel usage */
-		maskecx = ~(1 << APERFMPERF_PRESENT);
-		break;
-
 	case 0xb:
 		/* Suppress extended topology stuff */
 		maskebx = 0;
@@ -462,6 +454,9 @@ static void __init xen_init_cpuid_mask(void)
 	if (xen_check_mwait())
 		cpuid_leaf1_ecx_set_mask = (1 << (X86_FEATURE_MWAIT % 32));
 
+	/* Disable APERFMPERF feature. */
+	setup_clear_cpu_cap(X86_FEATURE_APERFMPERF);
+
 	/* Disable DCA feature. */
 	setup_clear_cpu_cap(X86_FEATURE_DCA);
 }
Signature · 1 line
2.10.2
#5 lore raw

Re: [PATCH 2/2] x86/xen: use capabilities instead of fake cpuid values

Quoted 27 lines · Juergen Gross

When running as pv domain xen_cpuid() is being used instead of native_cpuid(). In xen_cpuid() the aperf/mperf feature is indicated as not being present by special casing the related cpuid leaf.

Instead of delivering fake cpuid values clear the cpu capability bit for aperf/mperf instead.

---
 arch/x86/xen/enlighten.c | 11 +++--------
 1 file changed, 3 insertions(+), 8 deletions(-)
arch/x86/xen/enlighten.c +0 -3
index 83399ce..0eebb75 100644
@@ -301,9 +301,6 @@ xen_running_on_version_or_later(unsigned int major, unsigned int minor)
 	return false;
 }
 
-#define CPUID_THERM_POWER_LEAF 6
-#define APERFMPERF_PRESENT 0
-
 static __read_mostly unsigned int cpuid_leaf1_edx_mask = ~0;
 static __read_mostly unsigned int cpuid_leaf1_ecx_mask = ~0;
 

arch/x86/xen/enlighten.c static void xen_cpuid(unsigned int *ax, unsigned int *bx, · line 344

Quoted 8 lines
arch/x86/xen/enlighten.c +0 -5
@@ -337,11 +334,6 @@ static void xen_cpuid(unsigned int *ax, unsigned int *bx,
 		*dx = cpuid_leaf5_edx_val;
 		return;
 
-	case CPUID_THERM_POWER_LEAF:
-		/* Disabling APERFMPERF for kernel usage */
-		maskecx = ~(1 << APERFMPERF_PRESENT);
-		break;
-

But now APERF/MPERF will be reported as supported by CPUID, won't it?

arch/x86/xen/enlighten.c static void __init xen_init_cpuid_mask(void) · line 461

Quoted 12 lines
arch/x86/xen/enlighten.c +3 -0
 	case 0xb:
 		/* Suppress extended topology stuff */
 		maskebx = 0;
@@ -462,6 +454,9 @@ static void __init xen_init_cpuid_mask(void)
 	if (xen_check_mwait())
 		cpuid_leaf1_ecx_set_mask = (1 << (X86_FEATURE_MWAIT % 32));
 
+	/* Disable APERFMPERF feature. */
+	setup_clear_cpu_cap(X86_FEATURE_APERFMPERF);
+
 	/* Disable DCA feature. */
 	setup_clear_cpu_cap(X86_FEATURE_DCA);

I think both of those can go to xen_set_cpu_features().

-boris

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

#6 lore raw

Re: [PATCH 2/2] x86/xen: use capabilities instead of fake cpuid values

In reply to Juergen Gross
Quoted 27 lines · Juergen Gross

When running as pv domain xen_cpuid() is being used instead of native_cpuid(). In xen_cpuid() the aperf/mperf feature is indicated as not being present by special casing the related cpuid leaf.

Instead of delivering fake cpuid values clear the cpu capability bit for aperf/mperf instead.

---
 arch/x86/xen/enlighten.c | 11 +++--------
 1 file changed, 3 insertions(+), 8 deletions(-)
arch/x86/xen/enlighten.c +0 -3
index 83399ce..0eebb75 100644
@@ -301,9 +301,6 @@ xen_running_on_version_or_later(unsigned int major, unsigned int minor)
 	return false;
 }
 
-#define CPUID_THERM_POWER_LEAF 6
-#define APERFMPERF_PRESENT 0
-
 static __read_mostly unsigned int cpuid_leaf1_edx_mask = ~0;
 static __read_mostly unsigned int cpuid_leaf1_ecx_mask = ~0;
 

arch/x86/xen/enlighten.c static void xen_cpuid(unsigned int *ax, unsigned int *bx, · line 344

Quoted 8 lines
arch/x86/xen/enlighten.c +0 -5
@@ -337,11 +334,6 @@ static void xen_cpuid(unsigned int *ax, unsigned int *bx,
 		*dx = cpuid_leaf5_edx_val;
 		return;
 
-	case CPUID_THERM_POWER_LEAF:
-		/* Disabling APERFMPERF for kernel usage */
-		maskecx = ~(1 << APERFMPERF_PRESENT);
-		break;
-

But now APERF/MPERF will be reported as supported by CPUID, won't it?

arch/x86/xen/enlighten.c static void __init xen_init_cpuid_mask(void) · line 461

Quoted 12 lines
arch/x86/xen/enlighten.c +3 -0
 	case 0xb:
 		/* Suppress extended topology stuff */
 		maskebx = 0;
@@ -462,6 +454,9 @@ static void __init xen_init_cpuid_mask(void)
 	if (xen_check_mwait())
 		cpuid_leaf1_ecx_set_mask = (1 << (X86_FEATURE_MWAIT % 32));
 
+	/* Disable APERFMPERF feature. */
+	setup_clear_cpu_cap(X86_FEATURE_APERFMPERF);
+
 	/* Disable DCA feature. */
 	setup_clear_cpu_cap(X86_FEATURE_DCA);

I think both of those can go to xen_set_cpu_features().

-boris

author maintainer
#7 lore raw

Re: [PATCH 2/2] x86/xen: use capabilities instead of fake cpuid values

Quoted 35 lines · Boris Ostrovsky
Quoted 32 lines · Juergen Gross

When running as pv domain xen_cpuid() is being used instead of native_cpuid(). In xen_cpuid() the aperf/mperf feature is indicated as not being present by special casing the related cpuid leaf.

Instead of delivering fake cpuid values clear the cpu capability bit for aperf/mperf instead.

---
 arch/x86/xen/enlighten.c | 11 +++--------
 1 file changed, 3 insertions(+), 8 deletions(-)
arch/x86/xen/enlighten.c +0 -3
index 83399ce..0eebb75 100644
@@ -301,9 +301,6 @@ xen_running_on_version_or_later(unsigned int
 major, unsigned int minor)
     return false;
 }
 
-#define CPUID_THERM_POWER_LEAF 6
-#define APERFMPERF_PRESENT 0
-
 static __read_mostly unsigned int cpuid_leaf1_edx_mask = ~0;
 static __read_mostly unsigned int cpuid_leaf1_ecx_mask = ~0;
@@ -337,11 +334,6 @@ static void xen_cpuid(unsigned int *ax, unsigned
 int *bx,
         *dx = cpuid_leaf5_edx_val;
         return;
 
Quoted 8 lines

arch/x86/xen/enlighten.c static void xen_cpuid(unsigned int *ax, unsigned int *bx, · line 344

Quoted 5 lines
arch/x86/xen/enlighten.c +0 -5
-    case CPUID_THERM_POWER_LEAF:
-        /* Disabling APERFMPERF for kernel usage */
-        maskecx = ~(1 << APERFMPERF_PRESENT);
-        break;
-

But now APERF/MPERF will be reported as supported by CPUID, won't it?

Yes. But this shouldn't be a problem as the kernel is always testing X86_FEATURE_APERFMPERF for testing the support.

Quoted 7 lines
Quoted 7 lines
arch/x86/xen/enlighten.c +0 -0
     case 0xb:
         /* Suppress extended topology stuff */
         maskebx = 0;
arch/x86/xen/enlighten.c +0 -0
@@ -462,6 +454,9 @@ static void __init xen_init_cpuid_mask(void)
     if (xen_check_mwait())
         cpuid_leaf1_ecx_set_mask = (1 << (X86_FEATURE_MWAIT % 32));
 
Quoted 8 lines

arch/x86/xen/enlighten.c static void __init xen_init_cpuid_mask(void) · line 461

Quoted 5 lines
arch/x86/xen/enlighten.c +3 -0
+    /* Disable APERFMPERF feature. */
+    setup_clear_cpu_cap(X86_FEATURE_APERFMPERF);
+
     /* Disable DCA feature. */
     setup_clear_cpu_cap(X86_FEATURE_DCA);

I think both of those can go to xen_set_cpu_features().

Okay. I'll move them.

I think we can convert some of the remaining cpuid bit modifications to cpu capabilities as well.

Juergen

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

author maintainer
#8 lore raw

Re: [PATCH 2/2] x86/xen: use capabilities instead of fake cpuid values

In reply to Boris Ostrovsky
Quoted 35 lines · Boris Ostrovsky
Quoted 32 lines · Juergen Gross

When running as pv domain xen_cpuid() is being used instead of native_cpuid(). In xen_cpuid() the aperf/mperf feature is indicated as not being present by special casing the related cpuid leaf.

Instead of delivering fake cpuid values clear the cpu capability bit for aperf/mperf instead.

---
 arch/x86/xen/enlighten.c | 11 +++--------
 1 file changed, 3 insertions(+), 8 deletions(-)
arch/x86/xen/enlighten.c +0 -3
index 83399ce..0eebb75 100644
@@ -301,9 +301,6 @@ xen_running_on_version_or_later(unsigned int
 major, unsigned int minor)
     return false;
 }
 
-#define CPUID_THERM_POWER_LEAF 6
-#define APERFMPERF_PRESENT 0
-
 static __read_mostly unsigned int cpuid_leaf1_edx_mask = ~0;
 static __read_mostly unsigned int cpuid_leaf1_ecx_mask = ~0;
@@ -337,11 +334,6 @@ static void xen_cpuid(unsigned int *ax, unsigned
 int *bx,
         *dx = cpuid_leaf5_edx_val;
         return;
 
Quoted 8 lines

arch/x86/xen/enlighten.c static void xen_cpuid(unsigned int *ax, unsigned int *bx, · line 344

Quoted 5 lines
arch/x86/xen/enlighten.c +0 -5
-    case CPUID_THERM_POWER_LEAF:
-        /* Disabling APERFMPERF for kernel usage */
-        maskecx = ~(1 << APERFMPERF_PRESENT);
-        break;
-

But now APERF/MPERF will be reported as supported by CPUID, won't it?

Yes. But this shouldn't be a problem as the kernel is always testing X86_FEATURE_APERFMPERF for testing the support.

Quoted 7 lines
Quoted 7 lines
arch/x86/xen/enlighten.c +0 -0
     case 0xb:
         /* Suppress extended topology stuff */
         maskebx = 0;
arch/x86/xen/enlighten.c +0 -0
@@ -462,6 +454,9 @@ static void __init xen_init_cpuid_mask(void)
     if (xen_check_mwait())
         cpuid_leaf1_ecx_set_mask = (1 << (X86_FEATURE_MWAIT % 32));
 
Quoted 8 lines

arch/x86/xen/enlighten.c static void __init xen_init_cpuid_mask(void) · line 461

Quoted 5 lines
arch/x86/xen/enlighten.c +3 -0
+    /* Disable APERFMPERF feature. */
+    setup_clear_cpu_cap(X86_FEATURE_APERFMPERF);
+
     /* Disable DCA feature. */
     setup_clear_cpu_cap(X86_FEATURE_DCA);

I think both of those can go to xen_set_cpu_features().

Okay. I'll move them.

I think we can convert some of the remaining cpuid bit modifications to cpu capabilities as well.

Juergen

#9 lore raw

Re: [PATCH 2/2] x86/xen: use capabilities instead of fake cpuid values

Quoted 45 lines · Juergen Gross
Quoted 35 lines · Boris Ostrovsky
Quoted 32 lines · Juergen Gross

When running as pv domain xen_cpuid() is being used instead of native_cpuid(). In xen_cpuid() the aperf/mperf feature is indicated as not being present by special casing the related cpuid leaf.

Instead of delivering fake cpuid values clear the cpu capability bit for aperf/mperf instead.

---
 arch/x86/xen/enlighten.c | 11 +++--------
 1 file changed, 3 insertions(+), 8 deletions(-)
arch/x86/xen/enlighten.c +0 -3
index 83399ce..0eebb75 100644
@@ -301,9 +301,6 @@ xen_running_on_version_or_later(unsigned int
 major, unsigned int minor)
     return false;
 }
 
-#define CPUID_THERM_POWER_LEAF 6
-#define APERFMPERF_PRESENT 0
-
 static __read_mostly unsigned int cpuid_leaf1_edx_mask = ~0;
 static __read_mostly unsigned int cpuid_leaf1_ecx_mask = ~0;
@@ -337,11 +334,6 @@ static void xen_cpuid(unsigned int *ax, unsigned
 int *bx,
         *dx = cpuid_leaf5_edx_val;
         return;
 
Quoted 8 lines

arch/x86/xen/enlighten.c static void xen_cpuid(unsigned int *ax, unsigned int *bx, · line 344

Quoted 5 lines
arch/x86/xen/enlighten.c +0 -5
-    case CPUID_THERM_POWER_LEAF:
-        /* Disabling APERFMPERF for kernel usage */
-        maskecx = ~(1 << APERFMPERF_PRESENT);
-        break;
-

But now APERF/MPERF will be reported as supported by CPUID, won't it?

Quoted 2 lines

Yes. But this shouldn't be a problem as the kernel is always testing X86_FEATURE_APERFMPERF for testing the support.

But X86_FEATURE_APERFMPERF cap is set based on CPUID query.

-boris

Quoted 17 lines
Quoted 8 lines
Quoted 8 lines
arch/x86/xen/enlighten.c +0 -0
     case 0xb:
         /* Suppress extended topology stuff */
         maskebx = 0;
arch/x86/xen/enlighten.c +0 -0
@@ -462,6 +454,9 @@ static void __init xen_init_cpuid_mask(void)
     if (xen_check_mwait())
         cpuid_leaf1_ecx_set_mask = (1 << (X86_FEATURE_MWAIT % 32));
 
Quoted 8 lines

arch/x86/xen/enlighten.c static void __init xen_init_cpuid_mask(void) · line 461

Quoted 5 lines
arch/x86/xen/enlighten.c +3 -0
+    /* Disable APERFMPERF feature. */
+    setup_clear_cpu_cap(X86_FEATURE_APERFMPERF);
+
     /* Disable DCA feature. */
     setup_clear_cpu_cap(X86_FEATURE_DCA);

I think both of those can go to xen_set_cpu_features().

Quoted 8 lines

Okay. I'll move them.

I think we can convert some of the remaining cpuid bit modifications to cpu capabilities as well.

Juergen

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

author maintainer
#10 lore raw

Re: [PATCH 2/2] x86/xen: use capabilities instead of fake cpuid values

Quoted 48 lines · Boris Ostrovsky
Quoted 45 lines · Juergen Gross
Quoted 43 lines · Boris Ostrovsky
Quoted 28 lines · Juergen Gross

When running as pv domain xen_cpuid() is being used instead of native_cpuid(). In xen_cpuid() the aperf/mperf feature is indicated as not being present by special casing the related cpuid leaf.

Instead of delivering fake cpuid values clear the cpu capability bit for aperf/mperf instead.

---
 arch/x86/xen/enlighten.c | 11 +++--------
 1 file changed, 3 insertions(+), 8 deletions(-)
arch/x86/xen/enlighten.c +0 -3
index 83399ce..0eebb75 100644
@@ -301,9 +301,6 @@ xen_running_on_version_or_later(unsigned int
 major, unsigned int minor)
     return false;
 }
 
-#define CPUID_THERM_POWER_LEAF 6
-#define APERFMPERF_PRESENT 0
-
 static __read_mostly unsigned int cpuid_leaf1_edx_mask = ~0;
 static __read_mostly unsigned int cpuid_leaf1_ecx_mask = ~0;

arch/x86/xen/enlighten.c static void xen_cpuid(unsigned int *ax, unsigned · line 345

Quoted 9 lines
arch/x86/xen/enlighten.c +0 -5
@@ -337,11 +334,6 @@ static void xen_cpuid(unsigned int *ax, unsigned
 int *bx,
         *dx = cpuid_leaf5_edx_val;
         return;
 
-    case CPUID_THERM_POWER_LEAF:
-        /* Disabling APERFMPERF for kernel usage */
-        maskecx = ~(1 << APERFMPERF_PRESENT);
-        break;
-

But now APERF/MPERF will be reported as supported by CPUID, won't it?

Quoted 5 lines
Quoted 2 lines

Yes. But this shouldn't be a problem as the kernel is always testing X86_FEATURE_APERFMPERF for testing the support.

But X86_FEATURE_APERFMPERF cap is set based on CPUID query.

Right. And setup_clear_cpu_cap() will result in removing the feature from the capabilities (removes it from boot cpu capabilities at once and is setting it in the mask which is negated and anded into the capabilities after issuing the cpuid queries).

Juergen

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

author maintainer
#11 lore raw

Re: [PATCH 2/2] x86/xen: use capabilities instead of fake cpuid values

In reply to Boris Ostrovsky
Quoted 48 lines · Boris Ostrovsky
Quoted 45 lines · Juergen Gross
Quoted 43 lines · Boris Ostrovsky
Quoted 28 lines · Juergen Gross

When running as pv domain xen_cpuid() is being used instead of native_cpuid(). In xen_cpuid() the aperf/mperf feature is indicated as not being present by special casing the related cpuid leaf.

Instead of delivering fake cpuid values clear the cpu capability bit for aperf/mperf instead.

---
 arch/x86/xen/enlighten.c | 11 +++--------
 1 file changed, 3 insertions(+), 8 deletions(-)
arch/x86/xen/enlighten.c +0 -3
index 83399ce..0eebb75 100644
@@ -301,9 +301,6 @@ xen_running_on_version_or_later(unsigned int
 major, unsigned int minor)
     return false;
 }
 
-#define CPUID_THERM_POWER_LEAF 6
-#define APERFMPERF_PRESENT 0
-
 static __read_mostly unsigned int cpuid_leaf1_edx_mask = ~0;
 static __read_mostly unsigned int cpuid_leaf1_ecx_mask = ~0;

arch/x86/xen/enlighten.c static void xen_cpuid(unsigned int *ax, unsigned · line 345

Quoted 9 lines
arch/x86/xen/enlighten.c +0 -5
@@ -337,11 +334,6 @@ static void xen_cpuid(unsigned int *ax, unsigned
 int *bx,
         *dx = cpuid_leaf5_edx_val;
         return;
 
-    case CPUID_THERM_POWER_LEAF:
-        /* Disabling APERFMPERF for kernel usage */
-        maskecx = ~(1 << APERFMPERF_PRESENT);
-        break;
-

But now APERF/MPERF will be reported as supported by CPUID, won't it?

Quoted 5 lines
Quoted 2 lines

Yes. But this shouldn't be a problem as the kernel is always testing X86_FEATURE_APERFMPERF for testing the support.

But X86_FEATURE_APERFMPERF cap is set based on CPUID query.

Right. And setup_clear_cpu_cap() will result in removing the feature from the capabilities (removes it from boot cpu capabilities at once and is setting it in the mask which is negated and anded into the capabilities after issuing the cpuid queries).

Juergen