* Return 1 if SVM is enabled on this processor and 0 otherwise. */
| 221 | * Return 1 if SVM is enabled on this processor and 0 otherwise. |
| 222 | */ |
| 223 | static int |
| 224 | svm_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 | |
| 243 | static int |
| 244 | svm_modinit(int ipinum) |
no test coverage detected