File tree Expand file tree Collapse file tree 2 files changed +21
-0
lines changed Expand file tree Collapse file tree 2 files changed +21
-0
lines changed Original file line number Diff line number Diff line change @@ -32,6 +32,7 @@ extern bool handle_user_split_lock(struct pt_regs *regs, long error_code);
32
32
extern bool handle_guest_split_lock (unsigned long ip );
33
33
extern void handle_bus_lock (struct pt_regs * regs );
34
34
u8 get_this_hybrid_cpu_type (void );
35
+ u32 get_this_hybrid_cpu_native_id (void );
35
36
#else
36
37
static inline void __init sld_setup (struct cpuinfo_x86 * c ) {}
37
38
static inline bool handle_user_split_lock (struct pt_regs * regs , long error_code )
@@ -50,6 +51,11 @@ static inline u8 get_this_hybrid_cpu_type(void)
50
51
{
51
52
return 0 ;
52
53
}
54
+
55
+ static inline u32 get_this_hybrid_cpu_native_id (void )
56
+ {
57
+ return 0 ;
58
+ }
53
59
#endif
54
60
#ifdef CONFIG_IA32_FEAT_CTL
55
61
void init_ia32_feat_ctl (struct cpuinfo_x86 * c );
Original file line number Diff line number Diff line change @@ -1299,3 +1299,18 @@ u8 get_this_hybrid_cpu_type(void)
1299
1299
1300
1300
return cpuid_eax (0x0000001a ) >> X86_HYBRID_CPU_TYPE_ID_SHIFT ;
1301
1301
}
1302
+
1303
+ /**
1304
+ * get_this_hybrid_cpu_native_id() - Get the native id of this hybrid CPU
1305
+ *
1306
+ * Returns the uarch native ID [23:0] of a CPU in a hybrid processor.
1307
+ * If the processor is not hybrid, returns 0.
1308
+ */
1309
+ u32 get_this_hybrid_cpu_native_id (void )
1310
+ {
1311
+ if (!cpu_feature_enabled (X86_FEATURE_HYBRID_CPU ))
1312
+ return 0 ;
1313
+
1314
+ return cpuid_eax (0x0000001a ) &
1315
+ (BIT_ULL (X86_HYBRID_CPU_TYPE_ID_SHIFT ) - 1 );
1316
+ }
You can’t perform that action at this time.
0 commit comments