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: <f3b5364c-3e3c-eca0-f973-1658bd619e87@gmail.com>
Date:   Mon, 9 Aug 2021 21:07:01 +0800
From:   Like Xu <like.xu.linux@...il.com>
To:     Yang Weijiang <weijiang.yang@...el.com>,
        Jim Mattson <jmattson@...gle.com>
Cc:     pbonzini@...hat.com, seanjc@...gle.com, vkuznets@...hat.com,
        wei.w.wang@...el.com, kvm@...r.kernel.org,
        linux-kernel@...r.kernel.org
Subject: Re: [PATCH v7 03/15] KVM: x86: Add Arch LBR MSRs to msrs_to_save_all
 list

On 6/8/2021 3:42 pm, Yang Weijiang wrote:
> Arch LBR MSR_ARCH_LBR_DEPTH and MSR_ARCH_LBR_CTL are {saved|restored}
> by userspace application if they're available.
> 
> Suggested-by: Jim Mattson <jmattson@...gle.com>
> Signed-off-by: Yang Weijiang <weijiang.yang@...el.com>
> Reviewed-by: Jim Mattson <jmattson@...gle.com>
> ---
>   arch/x86/kvm/x86.c | 6 ++++++
>   1 file changed, 6 insertions(+)
> 
> diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c
> index 4116567f3d44..4ae173ab2208 100644
> --- a/arch/x86/kvm/x86.c
> +++ b/arch/x86/kvm/x86.c
> @@ -1327,6 +1327,7 @@ static const u32 msrs_to_save_all[] = {
>   	MSR_ARCH_PERFMON_EVENTSEL0 + 12, MSR_ARCH_PERFMON_EVENTSEL0 + 13,
>   	MSR_ARCH_PERFMON_EVENTSEL0 + 14, MSR_ARCH_PERFMON_EVENTSEL0 + 15,
>   	MSR_ARCH_PERFMON_EVENTSEL0 + 16, MSR_ARCH_PERFMON_EVENTSEL0 + 17,
> +	MSR_ARCH_LBR_CTL, MSR_ARCH_LBR_DEPTH,

Hi Jim,

Do you have a particular reason for not putting the set of
MSR_ARCH_LBR_{FROM, TO, INFO} into msrs_to_save_all[]
for {saved|restored} by user space ?

>   };
>   
>   static u32 msrs_to_save[ARRAY_SIZE(msrs_to_save_all)];
> @@ -6229,6 +6230,11 @@ static void kvm_init_msr_list(void)
>   			    min(INTEL_PMC_MAX_GENERIC, x86_pmu.num_counters_gp))
>   				continue;
>   			break;
> +		case MSR_ARCH_LBR_DEPTH:
> +		case MSR_ARCH_LBR_CTL:
> +			if (!kvm_cpu_cap_has(X86_FEATURE_ARCH_LBR))
> +				continue;
> +			break;
>   		default:
>   			break;
>   		}
> 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ