MCPcopy Create free account
hub / github.com/F-Stack/f-stack / svm_available

Function svm_available

freebsd/amd64/vmm/amd/svm.c:223–241  ·  view source on GitHub ↗

* Return 1 if SVM is enabled on this processor and 0 otherwise. */

Source from the content-addressed store, hash-verified

221 * Return 1 if SVM is enabled on this processor and 0 otherwise.
222 */
223static int
224svm_available(void)
225{
226 uint64_t msr;
227
228 /* Section 15.4 Enabling SVM from APM2. */
229 if ((amd_feature2 & AMDID2_SVM) == 0) {
230 printf("SVM: not available.\n");
231 return (0);
232 }
233
234 msr = rdmsr(MSR_VM_CR);
235 if ((msr & VM_CR_SVMDIS) != 0) {
236 printf("SVM: disabled by BIOS.\n");
237 return (0);
238 }
239
240 return (1);
241}
242
243static int
244svm_modinit(int ipinum)

Callers 1

svm_modinitFunction · 0.85

Calls 2

printfFunction · 0.50
rdmsrFunction · 0.50

Tested by

no test coverage detected