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]
Date:   Wed, 28 Mar 2018 22:24:57 +0200
From:   Radim Krčmář <rkrcmar@...hat.com>
To:     Babu Moger <babu.moger@....com>
Cc:     joro@...tes.org, tglx@...utronix.de, mingo@...hat.com,
        hpa@...or.com, x86@...nel.org, pbonzini@...hat.com,
        kvm@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH v2 2/5] KVM: VMX: Remove ple_window_actual_max

2018-03-16 16:37-0400, Babu Moger:
> Get rid of ple_window_actual_max, because its benefits are really
> minuscule and the logic is complicated.
> 
> The overflows(and underflow) are controlled in __ple_window_grow
> and _ple_window_shrink respectively.
> 
> Suggested-by: Radim Krčmář <rkrcmar@...hat.com>
> Signed-off-by: Babu Moger <babu.moger@....com>
> ---
>  arch/x86/kvm/vmx.c | 22 +---------------------
>  1 file changed, 1 insertion(+), 21 deletions(-)
> 
> diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c
> @@ -178,7 +178,6 @@
>  module_param(ple_window_shrink, uint, 0444);
>  
>  /* Default is to compute the maximum so we can never overflow. */
> -static uint ple_window_actual_max = KVM_VMX_DEFAULT_PLE_WINDOW_MAX;
>  static uint ple_window_max        = KVM_VMX_DEFAULT_PLE_WINDOW_MAX;
>  module_param(ple_window_max, uint, 0444);
>  
> @@ -6645,14 +6644,12 @@ static uint __grow_ple_window(uint val)
>  	if (ple_window_grow < 1)
>  		return ple_window;
>  
> -	val = min(val, ple_window_actual_max);
> -
>  	if (ple_window_grow < ple_window)
>  		val *= ple_window_grow;
>  	else
>  		val += ple_window_grow;
>  
> -	return val;
> +	return min(val, ple_window_max);

I added a bit of logic to avoid wraparounds.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ