FreeBSD/sys/amd64/vmm/amd/svm.c
/*
 * Verify that all the features required by bhyve are available.
 */
Verify that all the features required by bhyve are available.
Verify that all the features required by bhyve are available .
static int
check_svm_features(void)
{
	u_int regs[4];
	do_cpuid(0x8000000A, regs);
	svm_feature &= regs[3];
	if (nasid == 0 || nasid > regs[1])
		nasid = regs[1];
	KASSERT(nasid > 1, ("Insufficient ASIDs for guests: %#x", nasid));
	if (!(svm_feature & AMD_CPUID_SVM_NP)) {
		printf("SVM: Nested Paging feature not available.\n");
		return (ENXIO);
	}
	if (!(svm_feature & AMD_CPUID_SVM_NRIP_SAVE)) {
		printf("SVM: NRIP Save feature not available.\n");
		return (ENXIO);
	}
	return (0);
}
static int check_svm_features ( void ) { u_int regs [ 4 ] ; do_cpuid ( 0x8000000A , regs ) ; svm_feature &= regs [ 3 ] ; if ( nasid == 0 || nasid > regs [ 1 ] ) nasid = regs [ 1 ] ; KASSERT ( nasid > 1 , ( " " , nasid ) ) ; if ( ! ( svm_feature & AMD_CPUID_SVM_NP ) ) { printf ( " \n " ) ; return ( ENXIO ) ; } if ( ! ( svm_feature & AMD_CPUID_SVM_NRIP_SAVE ) ) { printf ( " \n " ) ; return ( ENXIO ) ; } return ( 0 ) ; }
Verify that all the features required by bhyve are available.
Verify that all the features required by bhyve are available .
/* CPUID Fn8000_000A is for SVM */ /*
	 * The number of ASIDs can be configured to be less than what is
	 * supported by the hardware but not more.
	 */ /* bhyve requires the Nested Paging feature */ /* bhyve requires the NRIP Save feature */