Re: [PATCH 08/15] KVM: VMX: Configure list of user return MSRs at module init

From: Sean Christopherson
Date: Tue May 11 2021 - 16:10:13 EST


On Tue, May 11, 2021, Maxim Levitsky wrote:
> On Mon, 2021-05-10 at 15:13 +0000, Sean Christopherson wrote:
> > On Mon, May 10, 2021, Maxim Levitsky wrote:
> > > On Tue, 2021-05-04 at 10:17 -0700, Sean Christopherson wrote:
> > > > @@ -6929,18 +6942,10 @@ static int vmx_create_vcpu(struct kvm_vcpu *vcpu)
> > > > goto free_vpid;
> > > > }
> > > >
> > > > - BUILD_BUG_ON(ARRAY_SIZE(vmx_uret_msrs_list) != MAX_NR_USER_RETURN_MSRS);
> > > > + for (i = 0; i < vmx_nr_uret_msrs; ++i) {
> > > > + vmx->guest_uret_msrs[i].data = 0;
> > > >
> > > > - for (i = 0; i < ARRAY_SIZE(vmx_uret_msrs_list); ++i) {
> > > > - u32 index = vmx_uret_msrs_list[i];
> > > > - int j = vmx->nr_uret_msrs;
> > > > -
> > > > - if (kvm_probe_user_return_msr(index))
> > > > - continue;
> > > > -
> > > > - vmx->guest_uret_msrs[j].slot = i;
> > > I don't see anything initalizing the .slot after this patch.
> > > Now this code is removed later which masks this bug,
> > > but for the bisect sake, I think that this patch
> > > should still be fixed.
> >
> > Egad, indeed it's broken. I'll retest the whole series to verify the other
> > patches will bisect cleanly.
> >
> > Nice catch!
> >
> Thanks!

Unfortunately this made it's way to Linus before I could fix my goof. Fingers
crossed no one is unfortunate enough to land on this while bisecting...