Re: [kvm-unit-tests PATCH v3 2/2] x86: nvmx: test max atomic switch MSRs

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



> > +static void atomic_switch_msrs_test(int count)
> > +{
> > +     struct vmx_msr_entry *vm_enter_load;
> > +        struct vmx_msr_entry *vm_exit_load;
> > +        struct vmx_msr_entry *vm_exit_store;
>
> Spaces need to be replaced with tabs.

Done.

> > +     /* Exceeding the max MSR list size at exit trigers KVM to abort. */
>
> s/trigers/triggers
>
> The whole sentence kinda is kinda funky.  Maybe

Done.

> > +     int exit_count = count > max_allowed ? max_allowed : count;
>
> If only we had MIN()... ;-)

Done, thanks :-).

> > +     /* Cleanup. */
> > +     vmcs_write(ENT_MSR_LD_CNT, 0);
> > +     vmcs_write(EXI_MSR_LD_CNT, 0);
> > +     vmcs_write(EXI_MSR_ST_CNT, 0);
> > +     for (i = 0; i < cleanup_count; i++) {
> > +             enter_guest();
> > +             skip_exit_vmcall();
> > +     }
>
> I'm missing something, why do we need to reenter the guest after setting
> the count to 0?

It's for the failure code path, which fails to get into the guest and
skip the single vmcall(). I've refactored the code to make this clear.
Let me know what you think.



[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux