]> Git Repo - linux.git/commitdiff
KVM: SVM: enhance info printk's in SEV init
authorAlexander Mikhalitsyn <[email protected]>
Mon, 22 May 2023 16:12:48 +0000 (18:12 +0200)
committerSean Christopherson <[email protected]>
Tue, 6 Jun 2023 17:41:29 +0000 (10:41 -0700)
Let's print available ASID ranges for SEV/SEV-ES guests.
This information can be useful for system administrator
to debug if SEV/SEV-ES fails to enable.

There are a few reasons.
SEV:
- NPT is disabled (module parameter)
- CPU lacks some features (sev, decodeassists)
- Maximum SEV ASID is 0

SEV-ES:
- mmio_caching is disabled (module parameter)
- CPU lacks sev_es feature
- Minimum SEV ASID value is 1 (can be adjusted in BIOS/UEFI)

Cc: Sean Christopherson <[email protected]>
Cc: Paolo Bonzini <[email protected]>
Cc: Stéphane Graber <[email protected]>
Cc: [email protected]
Cc: [email protected]
Suggested-by: Sean Christopherson <[email protected]>
Signed-off-by: Alexander Mikhalitsyn <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
[sean: print '0' for min SEV-ES ASID if there are no available ASIDs]
Signed-off-by: Sean Christopherson <[email protected]>
arch/x86/kvm/svm/sev.c

index 69ae5e1b31207f1d6ac115fe7b594ace375930c2..d65578d8784d834f5e3f9a283bb04485367d6cf5 100644 (file)
@@ -2219,7 +2219,6 @@ void __init sev_hardware_setup(void)
        if (misc_cg_set_capacity(MISC_CG_RES_SEV, sev_asid_count))
                goto out;
 
-       pr_info("SEV supported: %u ASIDs\n", sev_asid_count);
        sev_supported = true;
 
        /* SEV-ES support requested? */
@@ -2247,10 +2246,18 @@ void __init sev_hardware_setup(void)
        if (misc_cg_set_capacity(MISC_CG_RES_SEV_ES, sev_es_asid_count))
                goto out;
 
-       pr_info("SEV-ES supported: %u ASIDs\n", sev_es_asid_count);
        sev_es_supported = true;
 
 out:
+       if (boot_cpu_has(X86_FEATURE_SEV))
+               pr_info("SEV %s (ASIDs %u - %u)\n",
+                       sev_supported ? "enabled" : "disabled",
+                       min_sev_asid, max_sev_asid);
+       if (boot_cpu_has(X86_FEATURE_SEV_ES))
+               pr_info("SEV-ES %s (ASIDs %u - %u)\n",
+                       sev_es_supported ? "enabled" : "disabled",
+                       min_sev_asid > 1 ? 1 : 0, min_sev_asid - 1);
+
        sev_enabled = sev_supported;
        sev_es_enabled = sev_es_supported;
 #endif
This page took 0.063571 seconds and 4 git commands to generate.