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

Function svm_setcap

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

Source from the content-addressed store, hash-verified

2304#endif
2305
2306static int
2307svm_setcap(void *arg, int vcpu, int type, int val)
2308{
2309 struct svm_softc *sc;
2310 int error;
2311
2312 sc = arg;
2313 error = 0;
2314 switch (type) {
2315 case VM_CAP_HALT_EXIT:
2316 svm_set_intercept(sc, vcpu, VMCB_CTRL1_INTCPT,
2317 VMCB_INTCPT_HLT, val);
2318 break;
2319 case VM_CAP_PAUSE_EXIT:
2320 svm_set_intercept(sc, vcpu, VMCB_CTRL1_INTCPT,
2321 VMCB_INTCPT_PAUSE, val);
2322 break;
2323 case VM_CAP_UNRESTRICTED_GUEST:
2324 /* Unrestricted guest execution cannot be disabled in SVM */
2325 if (val == 0)
2326 error = EINVAL;
2327 break;
2328 default:
2329 error = ENOENT;
2330 break;
2331 }
2332 return (error);
2333}
2334
2335static int
2336svm_getcap(void *arg, int vcpu, int type, int *retval)

Callers

nothing calls this directly

Calls 1

svm_set_interceptFunction · 0.85

Tested by

no test coverage detected