public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/2] KVM: SVM: small tweaks for sev_hardware_setup
@ 2023-04-04 12:26 Alexander Mikhalitsyn
  2023-04-04 12:26 ` [PATCH 1/2] KVM: SVM: free sev_*asid_bitmap init if SEV init fails Alexander Mikhalitsyn
                   ` (2 more replies)
  0 siblings, 3 replies; 14+ messages in thread
From: Alexander Mikhalitsyn @ 2023-04-04 12:26 UTC (permalink / raw)
  To: pbonzini
  Cc: Alexander Mikhalitsyn, Sean Christopherson, Stéphane Graber,
	kvm, linux-kernel

KVM: SVM: add some info prints to SEV init
    
Let's add a few pr_info's to sev_hardware_setup to make SEV/SEV-ES
enabling a little bit handier for users. Right now it's too hard
to guess why SEV/SEV-ES are failing 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: add some info prints to SEV init

 arch/x86/kvm/svm/sev.c | 34 +++++++++++++++++++++++++++-------
 1 file changed, 27 insertions(+), 7 deletions(-)

-- 
2.34.1


^ permalink raw reply	[flat|nested] 14+ messages in thread
* [PATCH 0/2] KVM: SVM: small tweaks for sev_hardware_setup
@ 2023-04-04 12:12 Alexander Mikhalitsyn
  0 siblings, 0 replies; 14+ messages in thread
From: Alexander Mikhalitsyn @ 2023-04-04 12:12 UTC (permalink / raw)
  To: pbonzini
  Cc: Alexander Mikhalitsyn, Sean Christopherson, Stéphane Graber,
	kvm, linux-kernel

KVM: SVM: add some info prints to SEV init
    
Let's add a few pr_info's to sev_hardware_setup to make SEV/SEV-ES
enabling a little bit handier for users. Right now it's too hard
to guess why SEV/SEV-ES are failing 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: add some info prints to SEV init

 arch/x86/kvm/svm/sev.c | 34 +++++++++++++++++++++++++++-------
 1 file changed, 27 insertions(+), 7 deletions(-)

-- 
2.34.1


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

end of thread, other threads:[~2023-05-19 21:02 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-04-04 12:26 [PATCH 0/2] KVM: SVM: small tweaks for sev_hardware_setup Alexander Mikhalitsyn
2023-04-04 12:26 ` [PATCH 1/2] KVM: SVM: free sev_*asid_bitmap init if SEV init fails Alexander Mikhalitsyn
2023-04-11 19:47   ` Zhi Wang
2023-04-12 14:52     ` Aleksandr Mikhalitsyn
2023-04-13  5:07       ` Zhi Wang
2023-04-04 12:26 ` [PATCH 2/2] KVM: SVM: add some info prints to SEV init Alexander Mikhalitsyn
2023-04-11 19:43   ` Zhi Wang
2023-04-12 14:55     ` Aleksandr Mikhalitsyn
2023-05-19 18:17   ` Sean Christopherson
2023-05-19 19:03     ` Aleksandr Mikhalitsyn
2023-05-19 21:02       ` Sean Christopherson
2023-04-06  3:32 ` [PATCH 0/2] KVM: SVM: small tweaks for sev_hardware_setup Sean Christopherson
2023-04-06  7:07   ` Aleksandr Mikhalitsyn
  -- strict thread matches above, loose matches on Subject: below --
2023-04-04 12:12 Alexander Mikhalitsyn

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox