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: <20140820153115.GA20453@potion.brq.redhat.com>
Date:	Wed, 20 Aug 2014 17:31:16 +0200
From:	Radim Krčmář <rkrcmar@...hat.com>
To:	Paolo Bonzini <pbonzini@...hat.com>
Cc:	kvm@...r.kernel.org, linux-kernel@...r.kernel.org,
	Gleb Natapov <gleb@...nel.org>,
	Raghavendra KT <raghavendra.kt@...ux.vnet.ibm.com>,
	Vinod Chegu <chegu_vinod@...com>, Hui-Zhi <hui-zhi.zhao@...com>
Subject: Re: [PATCH 9/9] KVM: VMX: automatic PLE window maximum

2014-08-20 15:15+0200, Paolo Bonzini:
> Il 20/08/2014 14:41, Radim Krčmář ha scritto:
> >> > 	if (ple_window_grow < 1 || ple_window_actual_max < ple_window)
> >> > 		new = ple_window;
> >> > 	else if (ple_window_grow < ple_window)
> >> > 		new = max(ple_window_actual_max, old) * ple_window_grow;
> >> > 	else
> >> > 		new = max(ple_window_actual_max, old) + ple_window_grow;
> > Oh, I like that this can get rid of all overflows, ple_window_actual_max
> > (PW_effective_max?) is going to be set to
> > "ple_window_max [/-] ple_window_grow" in v2.
> > 
> >> > (I think the || in the first "if" can be eliminated with some creativity
> >> > in clamp_ple_window_max).
> > To do it, we'll want to intercept changes to ple_window as well.
> > (I disliked this patch a lot even before :)
> 
> What about setting ple_window_actual_max to 0 if ple_window_grow is 0
> (instead of just returning)?
> 
> Then the "if (ple_window_actual_max < ple_window)" will always fail and
> you'll go through "new = ple_window".  But perhaps it's more gross and
> worthless than creative. :)

That code can't use PW directly, because PW_actual_max needs to be one
PW_grow below PW_max, so I'd rather enforce minimal PW_actual_max.

Btw. without extra code, we are still going to overflow on races when
changing PW_grow, should they be covered as well?

(+ There is a bug in this patch -- clamp_ple_window_max() should be
 after param_set_int() ... damned unreviewed last-second changes.)
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ