| 2304 | #endif |
| 2305 | |
| 2306 | static int |
| 2307 | svm_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 | |
| 2335 | static int |
| 2336 | svm_getcap(void *arg, int vcpu, int type, int *retval) |
nothing calls this directly
no test coverage detected