All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 0/2] KVM: SVM: small tweaks for sev_hardware_setup
@ 2023-05-22 16:12 Alexander Mikhalitsyn
  2023-05-22 16:12 ` [PATCH v2 1/2] KVM: SVM: free sev_*asid_bitmap init if SEV init fails Alexander Mikhalitsyn
                   ` (2 more replies)
  0 siblings, 3 replies; 8+ messages in thread
From: Alexander Mikhalitsyn @ 2023-05-22 16:12 UTC (permalink / raw)
  To: pbonzini
  Cc: Alexander Mikhalitsyn, Sean Christopherson, Stéphane Graber,
	kvm, linux-kernel, Thomas Gleixner, Ingo Molnar, Borislav Petkov,
	Dave Hansen, x86, H. Peter Anvin

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)

==
   
KVM: SVM: free sev_*asid_bitmap init if SEV init fails

If misc_cg_set_capacity() fails for some reason then we have
a memleak for sev_reclaim_asid_bitmap/sev_asid_bitmap. It's
not a case right now, because misc_cg_set_capacity() just can't
fail and check inside it is always successful.

But let's fix that for code consistency.

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
Signed-off-by: Alexander Mikhalitsyn <aleksandr.mikhalitsyn@canonical.com>

Alexander Mikhalitsyn (2):
  KVM: SVM: free sev_*asid_bitmap init if SEV init fails
  KVM: SVM: enhance info printk's in SEV init

 arch/x86/kvm/svm/sev.c | 16 +++++++++++++---
 1 file changed, 13 insertions(+), 3 deletions(-)

-- 
2.34.1


^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2023-06-06 18:53 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-05-22 16:12 [PATCH v2 0/2] KVM: SVM: small tweaks for sev_hardware_setup Alexander Mikhalitsyn
2023-05-22 16:12 ` [PATCH v2 1/2] KVM: SVM: free sev_*asid_bitmap init if SEV init fails Alexander Mikhalitsyn
2023-06-06 18:45   ` Sean Christopherson
2023-06-06 18:51     ` Aleksandr Mikhalitsyn
2023-05-22 16:12 ` [PATCH v2 2/2] KVM: SVM: enhance info printk's in SEV init Alexander Mikhalitsyn
2023-06-06 18:46   ` Sean Christopherson
2023-06-06 18:52     ` Aleksandr Mikhalitsyn
2023-06-06 18:48 ` [PATCH v2 0/2] KVM: SVM: small tweaks for sev_hardware_setup Sean Christopherson

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.