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

Function print_svm_info

freebsd/x86/x86/identcpu.c:2327–2404  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2325}
2326
2327static void
2328print_svm_info(void)
2329{
2330 u_int features, regs[4];
2331 uint64_t msr;
2332 int comma;
2333
2334 printf("\n SVM: ");
2335 do_cpuid(0x8000000A, regs);
2336 features = regs[3];
2337
2338 msr = rdmsr(MSR_VM_CR);
2339 if ((msr & VM_CR_SVMDIS) == VM_CR_SVMDIS)
2340 printf("(disabled in BIOS) ");
2341
2342 if (!bootverbose) {
2343 comma = 0;
2344 if (features & (1 << 0)) {
2345 printf("%sNP", comma ? "," : "");
2346 comma = 1;
2347 }
2348 if (features & (1 << 3)) {
2349 printf("%sNRIP", comma ? "," : "");
2350 comma = 1;
2351 }
2352 if (features & (1 << 5)) {
2353 printf("%sVClean", comma ? "," : "");
2354 comma = 1;
2355 }
2356 if (features & (1 << 6)) {
2357 printf("%sAFlush", comma ? "," : "");
2358 comma = 1;
2359 }
2360 if (features & (1 << 7)) {
2361 printf("%sDAssist", comma ? "," : "");
2362 comma = 1;
2363 }
2364 printf("%sNAsids=%d", comma ? "," : "", regs[1]);
2365 return;
2366 }
2367
2368 printf("Features=0x%b", features,
2369 "\020"
2370 "\001NP" /* Nested paging */
2371 "\002LbrVirt" /* LBR virtualization */
2372 "\003SVML" /* SVM lock */
2373 "\004NRIPS" /* NRIP save */
2374 "\005TscRateMsr" /* MSR based TSC rate control */
2375 "\006VmcbClean" /* VMCB clean bits */
2376 "\007FlushByAsid" /* Flush by ASID */
2377 "\010DecodeAssist" /* Decode assist */
2378 "\011<b8>"
2379 "\012<b9>"
2380 "\013PauseFilter" /* PAUSE intercept filter */
2381 "\014EncryptedMcodePatch"
2382 "\015PauseFilterThreshold" /* PAUSE filter threshold */
2383 "\016AVIC" /* virtual interrupt controller */
2384 "\017<b14>"

Callers 1

printcpuinfoFunction · 0.85

Calls 3

printfFunction · 0.50
do_cpuidFunction · 0.50
rdmsrFunction · 0.50

Tested by

no test coverage detected