lkml.org 
[lkml]   [2022]   [Dec]   [16]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] KVM: nVMX: Remove outdated comments in nested_vmx_setup_ctls_msrs().
On Fri, Dec 16, 2022, Yu Zhang wrote:
> >
> > Eh, just drop the comment. Pretty obvious this is for secondary execution controls.
> Thanks Sean. Well, I agree it is obvious.
>
> This line was kept because there are comments for other groups of
> control fields(e.g., exit/entry/pin-based/cpu-based controls etc.)
> in nested_vmx_setup_ctls_msrs(). If we do not keep the one for secondary
> cpu-based controls, we may just delete other comments as well. But
> is that really necessary?

Adding a patch to delete the various one-line comments is probably unnecessary
churn. The comments are kinda sorta helpful, but only because the function is a
giant and thus a bit hard to follow. A better solution than comments would be to
add helpers for each collection ("secondary_ctls" is a bit of a lie because it
handle VPID, EPT, VMFUNC, etc..., but whatever), e.g.

nested_vmx_setup_pinbased_ctls(msrs);
nested_vmx_setup_exit_ctls(msrs);
nested_vmx_setup_entry_ctls(msrs);
nested_vmx_setup_cpubased_ctls(msrs);
nested_vmx_setup_secondary_ctls(msrs);
nested_vmx_setup_misc_data(msrs);

\
 
 \ /
  Last update: 2022-12-16 17:52    [W:0.107 / U:0.264 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site