lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <005c16a4-b88c-4389-8834-a4fc98a8ba02@intel.com>
Date: Mon, 1 Apr 2024 14:27:28 +0800
From: Xiaoyao Li <xiaoyao.li@...el.com>
To: Sean Christopherson <seanjc@...gle.com>,
 Thomas Gleixner <tglx@...utronix.de>, Ingo Molnar <mingo@...hat.com>,
 Borislav Petkov <bp@...en8.de>, Dave Hansen <dave.hansen@...ux.intel.com>,
 x86@...nel.org, Paolo Bonzini <pbonzini@...hat.com>,
 Andy Lutomirski <luto@...nel.org>, Peter Zijlstra <peterz@...radead.org>
Cc: linux-kernel@...r.kernel.org, kvm@...r.kernel.org,
 Shan Kang <shan.kang@...el.com>, Kai Huang <kai.huang@...el.com>,
 Xin Li <xin3.li@...el.com>
Subject: Re: [PATCH v6 5/9] KVM: VMX: Track CPU's MSR_IA32_VMX_BASIC as a
 single 64-bit value

On 3/9/2024 9:27 AM, Sean Christopherson wrote:
> Track the "basic" capabilities VMX MSR as a single u64 in vmcs_config
> instead of splitting it across three fields, that obviously don't combine
> into a single 64-bit value, so that KVM can use the macros that define MSR
> bits using their absolute position.  Replace all open coded shifts and
> masks, many of which are relative to the "high" half, with the appropriate
> macro.
> 
> Opportunistically use VMX_BASIC_32BIT_PHYS_ADDR_ONLY instead of an open
> coded equivalent, and clean up the related comment to not reference a
> specific SDM section (to the surprise of no one, the comment is stale).
> 
> No functional change intended (though obviously the code generation will
> be quite different).
> 
> Cc: Shan Kang <shan.kang@...el.com>
> Cc: Kai Huang <kai.huang@...el.com>
> Signed-off-by: Xin Li <xin3.li@...el.com>
> [sean: split to separate patch, write changelog]

The patch author doesn't match with the signed-off

> Signed-off-by: Sean Christopherson <seanjc@...gle.com>
> ---
>   arch/x86/include/asm/vmx.h      |  5 +++++
>   arch/x86/kvm/vmx/capabilities.h |  6 ++----
>   arch/x86/kvm/vmx/vmx.c          | 28 ++++++++++++++--------------
>   3 files changed, 21 insertions(+), 18 deletions(-)
> 
> diff --git a/arch/x86/include/asm/vmx.h b/arch/x86/include/asm/vmx.h
> index c3a97dca4a33..ce6d166fc3c5 100644
> --- a/arch/x86/include/asm/vmx.h
> +++ b/arch/x86/include/asm/vmx.h
> @@ -150,6 +150,11 @@ static inline u32 vmx_basic_vmcs_size(u64 vmx_basic)
>   	return (vmx_basic & GENMASK_ULL(44, 32)) >> 32;
>   }
>   
> +static inline u32 vmx_basic_vmcs_mem_type(u64 vmx_basic)
> +{
> +	return (vmx_basic & GENMASK_ULL(53, 50)) >> 50;

#define VMX_BASIC_MEM_TYPE_SHIFT		50

We have the shift defined in previous patch, we need to use it I think,
Any maybe, we can define the MASK as well.

Otherwise, this cleanup is good.

Reviewed-by: Xiaoyao Li <xiaoyao.li@...el.com>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ