[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <YQxns0wQ74d4X5VD@google.com>
Date: Thu, 5 Aug 2021 22:35:31 +0000
From: Sean Christopherson <seanjc@...gle.com>
To: Zeng Guang <guang.zeng@...el.com>
Cc: Paolo Bonzini <pbonzini@...hat.com>,
Vitaly Kuznetsov <vkuznets@...hat.com>,
Wanpeng Li <wanpengli@...cent.com>,
Jim Mattson <jmattson@...gle.com>,
Joerg Roedel <joro@...tes.org>, kvm@...r.kernel.org,
Dave Hansen <dave.hansen@...ux.intel.com>,
Tony Luck <tony.luck@...el.com>,
Kan Liang <kan.liang@...ux.intel.com>,
Thomas Gleixner <tglx@...utronix.de>,
Ingo Molnar <mingo@...hat.com>, Borislav Petkov <bp@...en8.de>,
"H. Peter Anvin" <hpa@...or.com>,
Kim Phillips <kim.phillips@....com>,
Jarkko Sakkinen <jarkko@...nel.org>,
Jethro Beekman <jethro@...tanix.com>,
Kai Huang <kai.huang@...el.com>, x86@...nel.org,
linux-kernel@...r.kernel.org, Robert Hu <robert.hu@...el.com>,
Gao Chao <chao.gao@...el.com>,
Robert Hoo <robert.hu@...ux.intel.com>
Subject: Re: [PATCH v3 3/6] KVM: VMX: Detect Tertiary VM-Execution control
when setup VMCS config
On Thu, Aug 05, 2021, Zeng Guang wrote:
> +u64 vmx_tertiary_exec_control(struct vcpu_vmx *vmx)
Make this static and drop the declaration from vmx.h, there's no nested user (yet),
and I'm also working on a patch to rework how prepare_vmcs02_early() gets KVMs
desires without having to call these heleprs, i.e. I want to bury all of these in
vmx.c.
> +{
> + return vmcs_config.cpu_based_3rd_exec_ctrl;
> +}
> +
> /*
> * Adjust a single secondary execution control bit to intercept/allow an
> * instruction in the guest. This is usually done based on whether or not a
> @@ -4319,6 +4354,9 @@ static void init_vmcs(struct vcpu_vmx *vmx)
> secondary_exec_controls_set(vmx, vmx->secondary_exec_control);
> }
>
> + if (cpu_has_tertiary_exec_ctrls())
> + tertiary_exec_controls_set(vmx, vmx_tertiary_exec_control(vmx));
> +
> if (kvm_vcpu_apicv_active(&vmx->vcpu)) {
> vmcs_write64(EOI_EXIT_BITMAP0, 0);
> vmcs_write64(EOI_EXIT_BITMAP1, 0);
> diff --git a/arch/x86/kvm/vmx/vmx.h b/arch/x86/kvm/vmx/vmx.h
> index 945c6639ce24..448006bd8fa7 100644
> --- a/arch/x86/kvm/vmx/vmx.h
> +++ b/arch/x86/kvm/vmx/vmx.h
> @@ -478,6 +478,7 @@ static inline u32 vmx_vmexit_ctrl(void)
>
> u32 vmx_exec_control(struct vcpu_vmx *vmx);
> u32 vmx_pin_based_exec_ctrl(struct vcpu_vmx *vmx);
> +u64 vmx_tertiary_exec_control(struct vcpu_vmx *vmx);
>
> static inline struct kvm_vmx *to_kvm_vmx(struct kvm *kvm)
> {
> --
> 2.25.1
>
Powered by blists - more mailing lists