@@ -315,6 +315,13 @@ int guest_rdmsr(struct vcpu *v, uint32_t
*val = msrs->tsc_aux;
break;
+ case MSR_K8_HWCR:
+ if ( !(cp->x86_vendor & (X86_VENDOR_AMD | X86_VENDOR_HYGON)) )
+ goto gp_fault;
+ *val = get_cpu_family(cp->basic.raw_fms, NULL, NULL) >= 0x10
+ ? K8_HWCR_TSC_FREQ_SEL : 0;
+ break;
+
case MSR_AMD64_DE_CFG:
if ( !(cp->x86_vendor & (X86_VENDOR_AMD | X86_VENDOR_HYGON)) )
goto gp_fault;
@@ -287,6 +287,8 @@
#define MSR_K7_HWCR 0xc0010015
#define MSR_K8_HWCR 0xc0010015
+#define K8_HWCR_TSC_FREQ_SEL (1ULL << 24)
+
#define MSR_K7_FID_VID_CTL 0xc0010041
#define MSR_K7_FID_VID_STATUS 0xc0010042
#define MSR_K8_PSTATE_LIMIT 0xc0010061