On Thu, Nov 18, 2021 at 07:53:10PM -0800, Philip Guenther wrote: > The diff below does the following: > > * add vmm_cpuid_level as the max cpuid leaf currently enabled: > - what the CPU does > - ...except we'll fake at least to 0x15 if tsc_is_invariant > - ...unless locked to 0x2 by MISC_ENABLE_LIMIT_CPUID_MAXVAL > That is then used by the clamp logic and for cpuid(0).eax > > * put the leaf and subleaf input values (from rax/rcx) into local > variables, truncating them to 32bit as documented by the SDM and > verified on an Intel CPU in a Lenovo T510. Use that in the clamping > logic and all the tests > > * only invoke the underlying cpuid instruction if the real CPU might > support the leaf and always pass the subleaf. Delete the CPUID_LEAF() > calls made superfluous by always passing the subleaf > > * fix cpuid(0x40000000).eax to return the highest supported vm leaf > > > OpenBSD seems to work under vmm on my X1gen? with not-unexpected values > returned by cpuid in the guest, but that really doesn't test the clamping > behaviors. Built with VMM_DEBUG to verify format strings, but not run > with that.
I have tested, and the fdc(4) driver is not invoked, as with Dave's. Here is the VMM_DEBUG output: vm_impl_init_vmx: created vm_map @ 0xfffffd81b9df5560 vm_resetcpu: resetting vm 1 vcpu 0 to power on defaults Guest EPTP = 0x21ccae01e vmm_alloc_vpid: allocated VPID/ASID 1 vmm_handle_cpuid: function 0x0a (arch. perf mon) not supported vmx_handle_cr: mov to cr0 @ 100149e, data=0x80010031 vmx_handle_wrmsr: wrmsr exit, msr=0x8b, discarding data written from guest=0x0:0x0 vmx_handle_wrmsr: wrmsr exit, msr=0x8b, discarding data written from guest=0x0:0x0 vmm_handle_cpuid: unsupported rax=0x40000100 vmm_handle_cpuid: function 0x06 (thermal/power mgt) not supported vmm_handle_cpuid: function 0x0a (arch. perf mon) not supported vmm_free_vpid: freed VPID/ASID 1
