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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <d212c92f-3742-de4e-132f-f2311a8ba0aa@redhat.com>
Date:	Wed, 15 Jun 2016 14:17:09 +0200
From:	Paolo Bonzini <pbonzini@...hat.com>
To:	Andy Lutomirski <luto@...capital.net>
Cc:	Roman Kagan <rkagan@...tuozzo.com>,
	"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
	kvm list <kvm@...r.kernel.org>,
	Minfei Huang <mnghuan@...il.com>,
	Andrew Lutomirski <luto@...nel.org>
Subject: Re: [PATCH] pvclock: introduce seqcount-like API



On 09/06/2016 20:08, Andy Lutomirski wrote:
> > __pvclock_read_cycles is pretty much the same as the code that is being
> > inlined.  Thus the only change is that __pvclock_read_cycles is called
> > inside the loop rather than outside, but the loop really is expected to
> > never roll so why make a copy in the first place?
>
> I feel like I had a reason, but I don't remember what it was.

I cannot see any substantial difference in the generated code with
this patch.  On the other hand, if I add this:

diff --git a/arch/x86/include/asm/pvclock.h b/arch/x86/include/asm/pvclock.h
index 0ee92db1e9f3..d019f0cc80ec 100644
--- a/arch/x86/include/asm/pvclock.h
+++ b/arch/x86/include/asm/pvclock.h
@@ -40,7 +40,7 @@ bool pvclock_read_retry(const struct pvclock_vcpu_time_info *src,
 {
 	/* Make sure that the version is re-read after the data. */
 	virt_rmb();
-	return version != src->version;
+	return unlikely(version != src->version);
 }
 
 /*

then vread_pvclock is inlined everywhere, which bloats the code somewhat (+80
code bytes).  Do you want me to mark vread_pvclock as noinline too?

Paolo

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ