Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F163361486
D37269.id112617.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D37269.id112617.diff
View Options
diff --git a/sys/amd64/vmm/intel/vmx.h b/sys/amd64/vmm/intel/vmx.h
--- a/sys/amd64/vmm/intel/vmx.h
+++ b/sys/amd64/vmm/intel/vmx.h
@@ -140,6 +140,7 @@
uint64_t eptp;
struct vm *vm;
long eptgen[MAXCPU]; /* cached pmap->pm_eptgen */
+ bool have_msr_tsc_aux;
};
#define VMX_GUEST_VMEXIT 0
@@ -159,15 +160,8 @@
static inline bool
vmx_have_msr_tsc_aux(struct vmx *vmx)
{
- int rdpid_rdtscp_bits = ((1 << VM_CAP_RDPID) | (1 << VM_CAP_RDTSCP));
- /*
- * Since the values of these bits are uniform across all vCPUs
- * (see discussion in vmx_modinit() and initialization of these bits
- * in vmx_init()), just always use vCPU-zero's capability set and
- * remove the need to require a vcpuid argument.
- */
- return ((vmx->vcpus[0].cap.set & rdpid_rdtscp_bits) != 0);
+ return (vmx->have_msr_tsc_aux);
}
#endif
diff --git a/sys/amd64/vmm/intel/vmx.c b/sys/amd64/vmm/intel/vmx.c
--- a/sys/amd64/vmm/intel/vmx.c
+++ b/sys/amd64/vmm/intel/vmx.c
@@ -1105,6 +1105,8 @@
KASSERT(error == 0, ("vm_map_mmio(apicbase) error %d", error));
}
+ vmx->have_msr_tsc_aux = (cap_rdpid != 0 || cap_rdtscp != 0);
+
for (i = 0; i < maxcpus; i++) {
vcpu = &vmx->vcpus[i];
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Thu, Jul 23, 12:32 PM (14 h, 23 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
35402087
Default Alt Text
D37269.id112617.diff (1 KB)
Attached To
Mode
D37269: vmm vmx: Add a global bool to indicate if the host has the TSC_AUX MSR.
Attached
Detach File
Event Timeline
Log In to Comment