KVM: SVM: enhance info printk's in SEV init
authorAlexander Mikhalitsyn <aleksandr.mikhalitsyn@canonical.com>
Mon, 22 May 2023 16:12:48 +0000 (18:12 +0200)
committerSean Christopherson <seanjc@google.com>
Tue, 6 Jun 2023 17:41:29 +0000 (10:41 -0700)
commit6d1bc9754b04075d938b47cf7f7800814b8911a7
tree3b3d9297a4d92de6373498c8aabd0fe186f50c84
parent791a089861fced01dc6d8a67507d711839659fb8
KVM: SVM: enhance info printk's in SEV init

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 <seanjc@google.com>
Cc: Paolo Bonzini <pbonzini@redhat.com>
Cc: Stéphane Graber <stgraber@ubuntu.com>
Cc: kvm@vger.kernel.org
Cc: linux-kernel@vger.kernel.org
Suggested-by: Sean Christopherson <seanjc@google.com>
Signed-off-by: Alexander Mikhalitsyn <aleksandr.mikhalitsyn@canonical.com>
Link: https://lore.kernel.org/r/20230522161249.800829-3-aleksandr.mikhalitsyn@canonical.com
[sean: print '0' for min SEV-ES ASID if there are no available ASIDs]
Signed-off-by: Sean Christopherson <seanjc@google.com>
arch/x86/kvm/svm/sev.c