KVM: VMX: Add a wrapper around ROL16() to get a vmcs12 from a field encoding

Add a wrapper macro, ENC_TO_VMCS12_IDX(), to get a vmcs12 index given a
field encoding in anticipation of adding a macro to get from a vmcs12 index
back to the field encoding.  And because open coding ROL16(n, 6) everywhere
is gross.

No functional change intended.

Suggested-by: Xiaoyao Li <xiaoyao.li@intel.com>
Reviewed-by: Xiaoyao Li <xiaoyao.li@intel.com>
Link: https://patch.msgid.link/20260115173427.716021-3-seanjc@google.com
Signed-off-by: Sean Christopherson <seanjc@google.com>
This commit is contained in:
Sean Christopherson 2026-01-15 09:34:25 -08:00
commit c68feb605c
5 changed files with 6 additions and 5 deletions