lkml.org 
[lkml]   [2022]   [Jul]   [14]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 2/4] KVM: x86/mmu: Defer "full" MMU setup until after vendor hardware_setup()
On Tue, Jul 12, 2022, Peter Xu wrote:
> On Fri, Jun 24, 2022 at 11:27:33PM +0000, Sean Christopherson wrote:
> > @@ -11937,6 +11932,10 @@ int kvm_arch_hardware_setup(void *opaque)
> >
> > kvm_ops_update(ops);
> >
> > + r = kvm_mmu_hardware_setup();
> > + if (r)
> > + goto out_unsetup;
> > +
> > kvm_register_perf_callbacks(ops->handle_intel_pt_intr);
> >
> > if (!kvm_cpu_cap_has(X86_FEATURE_XSAVES))
> > @@ -11960,12 +11959,18 @@ int kvm_arch_hardware_setup(void *opaque)
> > kvm_caps.default_tsc_scaling_ratio = 1ULL << kvm_caps.tsc_scaling_ratio_frac_bits;
> > kvm_init_msr_list();
> > return 0;
> > +
> > +out_unsetup:
> > + static_call(kvm_x86_hardware_unsetup)();
>
> Should this be kvm_mmu_hardware_unsetup()? Or did I miss something?..

There is no kvm_mmu_hardware_unsetup(). This path is called if kvm_mmu_hardware_setup()
fails, i.e. the common code doesn't need to unwind anything.

The vendor call is not shown in the patch diff, but it's before this as:

r = ops->hardware_setup();
if (r != 0)
return r

there's no existing error paths after that runs, which is why the vendor unsetup
call is new.

\
 
 \ /
  Last update: 2022-07-14 20:24    [W:0.174 / U:0.132 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site