Skip to content

Commit 0b85baa

Browse files
robert-hoobonzini
authored andcommitted
KVM: VMX: Report tertiary_exec_control field in dump_vmcs()
Add tertiary_exec_control field report in dump_vmcs(). Meanwhile, reorganize the dump output of VMCS category as follows. Before change: *** Control State *** PinBased=0x000000ff CPUBased=0xb5a26dfa SecondaryExec=0x061037eb EntryControls=0000d1ff ExitControls=002befff After change: *** Control State *** CPUBased=0xb5a26dfa SecondaryExec=0x061037eb TertiaryExec=0x0000000000000010 PinBased=0x000000ff EntryControls=0000d1ff ExitControls=002befff Reviewed-by: Maxim Levitsky <[email protected]> Signed-off-by: Robert Hoo <[email protected]> Signed-off-by: Zeng Guang <[email protected]> Message-Id: <[email protected]> Signed-off-by: Paolo Bonzini <[email protected]>
1 parent 1ad4e54 commit 0b85baa

File tree

1 file changed

+13
-4
lines changed

1 file changed

+13
-4
lines changed

arch/x86/kvm/vmx/vmx.c

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5872,6 +5872,7 @@ void dump_vmcs(struct kvm_vcpu *vcpu)
58725872
struct vcpu_vmx *vmx = to_vmx(vcpu);
58735873
u32 vmentry_ctl, vmexit_ctl;
58745874
u32 cpu_based_exec_ctrl, pin_based_exec_ctrl, secondary_exec_control;
5875+
u64 tertiary_exec_control;
58755876
unsigned long cr4;
58765877
int efer_slot;
58775878

@@ -5885,9 +5886,16 @@ void dump_vmcs(struct kvm_vcpu *vcpu)
58855886
cpu_based_exec_ctrl = vmcs_read32(CPU_BASED_VM_EXEC_CONTROL);
58865887
pin_based_exec_ctrl = vmcs_read32(PIN_BASED_VM_EXEC_CONTROL);
58875888
cr4 = vmcs_readl(GUEST_CR4);
5888-
secondary_exec_control = 0;
5889+
58895890
if (cpu_has_secondary_exec_ctrls())
58905891
secondary_exec_control = vmcs_read32(SECONDARY_VM_EXEC_CONTROL);
5892+
else
5893+
secondary_exec_control = 0;
5894+
5895+
if (cpu_has_tertiary_exec_ctrls())
5896+
tertiary_exec_control = vmcs_read64(TERTIARY_VM_EXEC_CONTROL);
5897+
else
5898+
tertiary_exec_control = 0;
58915899

58925900
pr_err("VMCS %p, last attempted VM-entry on CPU %d\n",
58935901
vmx->loaded_vmcs->vmcs, vcpu->arch.last_vmentry_cpu);
@@ -5987,9 +5995,10 @@ void dump_vmcs(struct kvm_vcpu *vcpu)
59875995
vmx_dump_msrs("host autoload", &vmx->msr_autoload.host);
59885996

59895997
pr_err("*** Control State ***\n");
5990-
pr_err("PinBased=%08x CPUBased=%08x SecondaryExec=%08x\n",
5991-
pin_based_exec_ctrl, cpu_based_exec_ctrl, secondary_exec_control);
5992-
pr_err("EntryControls=%08x ExitControls=%08x\n", vmentry_ctl, vmexit_ctl);
5998+
pr_err("CPUBased=0x%08x SecondaryExec=0x%08x TertiaryExec=0x%016llx\n",
5999+
cpu_based_exec_ctrl, secondary_exec_control, tertiary_exec_control);
6000+
pr_err("PinBased=0x%08x EntryControls=%08x ExitControls=%08x\n",
6001+
pin_based_exec_ctrl, vmentry_ctl, vmexit_ctl);
59936002
pr_err("ExceptionBitmap=%08x PFECmask=%08x PFECmatch=%08x\n",
59946003
vmcs_read32(EXCEPTION_BITMAP),
59956004
vmcs_read32(PAGE_FAULT_ERROR_CODE_MASK),

0 commit comments

Comments
 (0)