Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933161Ab1FPVl7 (ORCPT ); Thu, 16 Jun 2011 17:41:59 -0400 Received: from claw.goop.org ([74.207.240.146]:53919 "EHLO claw.goop.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933104Ab1FPVlN (ORCPT ); Thu, 16 Jun 2011 17:41:13 -0400 From: Jeremy Fitzhardinge To: Peter Zijlstra Cc: "H. Peter Anvin" , Ingo Molnar , the arch/x86 maintainers , Linux Kernel Mailing List , Nick Piggin , Jeremy Fitzhardinge Subject: [PATCH 7/7] x86/ticketlock: prevent memory accesses from reordered out of lock region Date: Thu, 16 Jun 2011 14:40:54 -0700 Message-Id: <1a2b7854c6cca125d867281969cadb97f79a6c93.1308259496.git.jeremy.fitzhardinge@citrix.com> X-Mailer: git-send-email 1.7.5.4 In-Reply-To: References: In-Reply-To: References: Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 992 Lines: 27 From: Jeremy Fitzhardinge Signed-off-by: Jeremy Fitzhardinge --- arch/x86/include/asm/spinlock.h | 1 + 1 files changed, 1 insertions(+), 0 deletions(-) diff --git a/arch/x86/include/asm/spinlock.h b/arch/x86/include/asm/spinlock.h index 3afb1a7..dac6fc6 100644 --- a/arch/x86/include/asm/spinlock.h +++ b/arch/x86/include/asm/spinlock.h @@ -114,6 +114,7 @@ static __always_inline int __ticket_spin_trylock(arch_spinlock_t *lock) static __always_inline void __ticket_spin_unlock(arch_spinlock_t *lock) { + barrier(); /* prevent reordering out of locked region */ __ticket_unlock_release(lock); barrier(); /* prevent reordering into locked region */ } -- 1.7.5.4 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/