File tree Expand file tree Collapse file tree 2 files changed +17
-0
lines changed Expand file tree Collapse file tree 2 files changed +17
-0
lines changed Original file line number Diff line number Diff line change 10
10
/* Bit 0 indicates whether guest VM is privileged */
11
11
#define ACRN_FEATURE_PRIVILEGED_VM BIT(0)
12
12
13
+ /*
14
+ * Timing Information.
15
+ * This leaf returns the current TSC frequency in kHz.
16
+ *
17
+ * EAX: (Virtual) TSC frequency in kHz.
18
+ * EBX, ECX, EDX: RESERVED (reserved fields are set to zero).
19
+ */
20
+ #define ACRN_CPUID_TIMING_INFO 0x40000010
21
+
13
22
void acrn_setup_intr_handler (void (* handler )(void ));
14
23
void acrn_remove_intr_handler (void );
15
24
@@ -21,6 +30,11 @@ static inline u32 acrn_cpuid_base(void)
21
30
return 0 ;
22
31
}
23
32
33
+ static inline unsigned long acrn_get_tsc_khz (void )
34
+ {
35
+ return cpuid_eax (ACRN_CPUID_TIMING_INFO );
36
+ }
37
+
24
38
/*
25
39
* Hypercalls for ACRN
26
40
*
Original file line number Diff line number Diff line change @@ -28,6 +28,9 @@ static void __init acrn_init_platform(void)
28
28
{
29
29
/* Setup the IDT for ACRN hypervisor callback */
30
30
alloc_intr_gate (HYPERVISOR_CALLBACK_VECTOR , asm_sysvec_acrn_hv_callback );
31
+
32
+ x86_platform .calibrate_tsc = acrn_get_tsc_khz ;
33
+ x86_platform .calibrate_cpu = acrn_get_tsc_khz ;
31
34
}
32
35
33
36
static bool acrn_x2apic_available (void )
You can’t perform that action at this time.
0 commit comments