[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <71636309-3bf1-4e7a-b586-c61fea30f7c0@suse.com>
Date: Tue, 14 Nov 2023 16:36:59 +0200
From: Nikolay Borisov <nik.borisov@...e.com>
To: Xin Li <xin3.li@...el.com>, kvm@...r.kernel.org,
linux-doc@...r.kernel.org, linux-kernel@...r.kernel.org,
linux-hyperv@...r.kernel.org, linux-kselftest@...r.kernel.org
Cc: seanjc@...gle.com, pbonzini@...hat.com, corbet@....net,
kys@...rosoft.com, haiyangz@...rosoft.com, wei.liu@...nel.org,
decui@...rosoft.com, tglx@...utronix.de, mingo@...hat.com,
bp@...en8.de, dave.hansen@...ux.intel.com, x86@...nel.org,
hpa@...or.com, vkuznets@...hat.com, peterz@...radead.org,
ravi.v.shankar@...el.com
Subject: Re: [PATCH v1 14/23] KVM: VMX: Dump FRED context in dump_vmcs()
On 8.11.23 г. 20:29 ч., Xin Li wrote:
> Add FRED related VMCS fields to dump_vmcs() to have it dump FRED context.
>
> Tested-by: Shan Kang <shan.kang@...el.com>
> Signed-off-by: Xin Li <xin3.li@...el.com>
> ---
> arch/x86/kvm/vmx/vmx.c | 48 ++++++++++++++++++++++++++++++++++++------
> 1 file changed, 41 insertions(+), 7 deletions(-)
>
> diff --git a/arch/x86/kvm/vmx/vmx.c b/arch/x86/kvm/vmx/vmx.c
> index 518e68ee5a0d..b826dc188fc7 100644
> --- a/arch/x86/kvm/vmx/vmx.c
> +++ b/arch/x86/kvm/vmx/vmx.c
> @@ -6429,7 +6429,7 @@ void dump_vmcs(struct kvm_vcpu *vcpu)
> struct vcpu_vmx *vmx = to_vmx(vcpu);
> u32 vmentry_ctl, vmexit_ctl;
> u32 cpu_based_exec_ctrl, pin_based_exec_ctrl, secondary_exec_control;
> - u64 tertiary_exec_control;
> + u64 tertiary_exec_control, secondary_vmexit_ctl;
> unsigned long cr4;
> int efer_slot;
>
> @@ -6440,6 +6440,8 @@ void dump_vmcs(struct kvm_vcpu *vcpu)
>
> vmentry_ctl = vmcs_read32(VM_ENTRY_CONTROLS);
> vmexit_ctl = vmcs_read32(VM_EXIT_CONTROLS);
> + secondary_vmexit_ctl = cpu_has_secondary_vmexit_ctrls() ?
> + vmcs_read64(SECONDARY_VM_EXIT_CONTROLS) : 0;
> cpu_based_exec_ctrl = vmcs_read32(CPU_BASED_VM_EXEC_CONTROL);
> pin_based_exec_ctrl = vmcs_read32(PIN_BASED_VM_EXEC_CONTROL);
> cr4 = vmcs_readl(GUEST_CR4);
> @@ -6486,6 +6488,19 @@ void dump_vmcs(struct kvm_vcpu *vcpu)
> vmx_dump_sel("LDTR:", GUEST_LDTR_SELECTOR);
> vmx_dump_dtsel("IDTR:", GUEST_IDTR_LIMIT);
> vmx_dump_sel("TR: ", GUEST_TR_SELECTOR);
> +#ifdef CONFIG_X86_64
> + if (cpu_feature_enabled(X86_FEATURE_FRED)) {
Shouldn't this be gated on whether FRED is enabled in kvm aka the CPUID
bit is enumerated ?
<snip>
Powered by blists - more mailing lists