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: <1430391243-7112-2-git-send-email-jgross@suse.com>
Date:	Thu, 30 Apr 2015 12:53:58 +0200
From:	Juergen Gross <jgross@...e.com>
To:	linux-kernel@...r.kernel.org, x86@...nel.org, hpa@...or.com,
	tglx@...utronix.de, mingo@...hat.com,
	xen-devel@...ts.xensource.com, konrad.wilk@...cle.com,
	david.vrabel@...rix.com, boris.ostrovsky@...cle.com,
	jeremy@...p.org, chrisw@...s-sol.org, akataria@...are.com,
	rusty@...tcorp.com.au, virtualization@...ts.linux-foundation.org,
	gleb@...nel.org, pbonzini@...hat.com, kvm@...r.kernel.org
Cc:	Juergen Gross <jgross@...e.com>
Subject: [PATCH 1/6] x86: use macro instead of "0" for setting TICKET_SLOWPATH_FLAG

For paravirtualized spinlocks setting the "slowpath" flag in
__ticket_enter_slowpath() is done via setting bit "0" in
lock->tickets.head instead of using a macro.

Change this by defining an appropriate macro.

Signed-off-by: Juergen Gross <jgross@...e.com>
---
 arch/x86/include/asm/spinlock.h       | 3 ++-
 arch/x86/include/asm/spinlock_types.h | 3 ++-
 2 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/arch/x86/include/asm/spinlock.h b/arch/x86/include/asm/spinlock.h
index cf87de3..8ceec8d 100644
--- a/arch/x86/include/asm/spinlock.h
+++ b/arch/x86/include/asm/spinlock.h
@@ -46,7 +46,8 @@ static __always_inline bool static_key_false(struct static_key *key);
 
 static inline void __ticket_enter_slowpath(arch_spinlock_t *lock)
 {
-	set_bit(0, (volatile unsigned long *)&lock->tickets.head);
+	set_bit(TICKET_SLOWPATH_BIT,
+		(volatile unsigned long *)&lock->tickets.head);
 }
 
 #else  /* !CONFIG_PARAVIRT_SPINLOCKS */
diff --git a/arch/x86/include/asm/spinlock_types.h b/arch/x86/include/asm/spinlock_types.h
index 5f9d757..579409a 100644
--- a/arch/x86/include/asm/spinlock_types.h
+++ b/arch/x86/include/asm/spinlock_types.h
@@ -4,8 +4,9 @@
 #include <linux/types.h>
 
 #ifdef CONFIG_PARAVIRT_SPINLOCKS
+#define TICKET_SLOWPATH_BIT	0
 #define __TICKET_LOCK_INC	2
-#define TICKET_SLOWPATH_FLAG	((__ticket_t)1)
+#define TICKET_SLOWPATH_FLAG	((__ticket_t)(1 << TICKET_SLOWPATH_BIT))
 #else
 #define __TICKET_LOCK_INC	1
 #define TICKET_SLOWPATH_FLAG	((__ticket_t)0)
-- 
2.1.4

--
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