From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753857AbcEPKl4 (ORCPT ); Mon, 16 May 2016 06:41:56 -0400 Received: from terminus.zytor.com ([198.137.202.10]:40642 "EHLO terminus.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752526AbcEPKly (ORCPT ); Mon, 16 May 2016 06:41:54 -0400 Date: Mon, 16 May 2016 03:39:35 -0700 From: tip-bot for Borislav Petkov Message-ID: Cc: jolsa@redhat.com, alexander.shishkin@linux.intel.com, luto@amacapital.net, linux-kernel@vger.kernel.org, linux@roeck-us.net, tglx@linutronix.de, dvlasenk@redhat.com, brgerst@gmail.com, hpa@zytor.com, acme@redhat.com, bp@suse.de, bp@alien8.de, vincent.weaver@maine.edu, torvalds@linux-foundation.org, peterz@infradead.org, mingo@kernel.org, eranian@google.com Reply-To: brgerst@gmail.com, hpa@zytor.com, acme@redhat.com, bp@suse.de, bp@alien8.de, torvalds@linux-foundation.org, vincent.weaver@maine.edu, peterz@infradead.org, eranian@google.com, mingo@kernel.org, jolsa@redhat.com, alexander.shishkin@linux.intel.com, luto@amacapital.net, linux-kernel@vger.kernel.org, linux@roeck-us.net, tglx@linutronix.de, dvlasenk@redhat.com In-Reply-To: <20160516093428.GA26108@pd.tnic> References: <20160516093428.GA26108@pd.tnic> To: linux-tip-commits@vger.kernel.org Subject: [tip:locking/rwsem] locking/rwsem: Fix comment on register clobbering Git-Commit-ID: 4544ba8c6b1743499cabb682897a469911845f15 X-Mailer: tip-git-log-daemon Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset=UTF-8 Content-Disposition: inline Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Commit-ID: 4544ba8c6b1743499cabb682897a469911845f15 Gitweb: http://git.kernel.org/tip/4544ba8c6b1743499cabb682897a469911845f15 Author: Borislav Petkov AuthorDate: Mon, 16 May 2016 11:34:28 +0200 Committer: Ingo Molnar CommitDate: Mon, 16 May 2016 12:35:40 +0200 locking/rwsem: Fix comment on register clobbering Document explicitly that %edx can get clobbered on the slow path, on 32-bit kernels. Something I learned the hard way. :-\ Suggested-by: Linus Torvalds Signed-off-by: Borislav Petkov Cc: Alexander Shishkin Cc: Andy Lutomirski Cc: Arnaldo Carvalho de Melo Cc: Borislav Petkov Cc: Brian Gerst Cc: Denys Vlasenko Cc: Guenter Roeck Cc: H. Peter Anvin Cc: Jiri Olsa Cc: Peter Zijlstra Cc: Stephane Eranian Cc: Thomas Gleixner Cc: Vince Weaver Cc: linux-next@vger.kernel.org Link: http://lkml.kernel.org/r/20160516093428.GA26108@pd.tnic Signed-off-by: Ingo Molnar --- arch/x86/lib/rwsem.S | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/arch/x86/lib/rwsem.S b/arch/x86/lib/rwsem.S index a37462a..bf2c607 100644 --- a/arch/x86/lib/rwsem.S +++ b/arch/x86/lib/rwsem.S @@ -29,8 +29,10 @@ * there is contention on the semaphore. * * %eax contains the semaphore pointer on entry. Save the C-clobbered - * registers (%eax, %edx and %ecx) except %eax whish is either a return - * value or just clobbered.. + * registers (%eax, %edx and %ecx) except %eax which is either a return + * value or just gets clobbered. Same is true for %edx so make sure GCC + * reloads it after the slow path, by making it hold a temporary, for + * example see ____down_write(). */ #define save_common_regs \