Received: by 2002:ac0:a581:0:0:0:0:0 with SMTP id m1-v6csp31543imm; Thu, 21 Jun 2018 13:21:07 -0700 (PDT) X-Google-Smtp-Source: ADUXVKLGCS9vqIghoDaBPRVtl8yLA3YKLO0TjfL+60uIY4KZEwc47bgqZ0ybLwRznm2FHaCdqulz X-Received: by 2002:a63:9611:: with SMTP id c17-v6mr23655714pge.361.1529612467110; Thu, 21 Jun 2018 13:21:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1529612467; cv=none; d=google.com; s=arc-20160816; b=GaQ9oZ09smuTkp7LKybf4IXP9tCw/Bf9Kp+qNN+Zfv3603bxXUK3N1hoBu4cFRfGo6 5R8EwPy0OsJs0d49hA2l0sNe4LQlCwJ6uOd81kCiME3/XJKokA1RRSsnzka3+hoWSM0X 2i8NG5bY87UuEHEc0QHljjpQdNUSKRsWQx4NDj174c3p7ecXe3BytJzneqDRPZNLej/b hVsS6ka16aIB4/dyGkxj72OCKFO9NVi4m25b0pOugq96lzv9a3szyROkCYzZSLbxkd2J yw6z7A2v0pW5Xtp+tFJikqXadB0N1mNh6ZmGB97ro2u90ADZPZpdd/eoBrhJ1MsYjPmL JF8g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:arc-authentication-results; bh=/9/v1LWaJamCE+73gqYWt4bxeuMSsw2mNBoiOUj/6zY=; b=YMaErAdWADbsN58eSbb1vGHx7rhebnHNsZVjShfC0aNU3xnD9EROe0ahUYpXa5gr+l RkGyZ9ectpQ8jVs0i1bGh+sO4tU8WVL0B0ZbSgsI1DQqtI2OWcsWYt+s/4qTTceqKDYz kRfSYHO7jbW59ZZzfiwwiVz0mPM46UD4DjEv0ggJRBaEsxhOo25MBJ4gPOSvRWknAxYd TDoYW+buqGzOHpkzUQ/A86kOINqy68HKSkdPEMf8JFl35pCmYnoASDLNon8x4fChxgR+ OT1XSEaQt9mMh0VDOVwrl8MwQ2GDWzeSBXd8LGkt1M1DkBwvNqt4j8zWM5v0d58TRwdY cRcQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 1-v6si5403413plj.411.2018.06.21.13.20.52; Thu, 21 Jun 2018 13:21:07 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933395AbeFUUTX (ORCPT + 99 others); Thu, 21 Jun 2018 16:19:23 -0400 Received: from mga12.intel.com ([192.55.52.136]:2722 "EHLO mga12.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932686AbeFUUTW (ORCPT ); Thu, 21 Jun 2018 16:19:22 -0400 X-Amp-Result: UNKNOWN X-Amp-Original-Verdict: FILE UNKNOWN X-Amp-File-Uploaded: False Received: from orsmga003.jf.intel.com ([10.7.209.27]) by fmsmga106.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 21 Jun 2018 13:19:21 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.51,253,1526367600"; d="scan'208";a="61180329" Received: from romley-ivt3.sc.intel.com ([172.25.110.60]) by orsmga003.jf.intel.com with ESMTP; 21 Jun 2018 13:19:21 -0700 Date: Thu, 21 Jun 2018 13:18:52 -0700 From: Fenghua Yu To: Peter Zijlstra Cc: Fenghua Yu , Thomas Gleixner , Ingo Molnar , "H. Peter Anvin" , Ashok Raj , Dave Hansen , Rafael Wysocki , Tony Luck , Alan Cox , Ravi V Shankar , Arjan van de Ven , linux-kernel , x86 Subject: Re: [RFC PATCH 00/16] x86/split_lock: Enable #AC exception for split locked accesses Message-ID: <20180621201851.GC114883@romley-ivt3.sc.intel.com> References: <1527435965-202085-1-git-send-email-fenghua.yu@intel.com> <20180621193738.GA13636@worktop.programming.kicks-ass.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180621193738.GA13636@worktop.programming.kicks-ass.net> User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Jun 21, 2018 at 09:37:38PM +0200, Peter Zijlstra wrote: > On Sun, May 27, 2018 at 08:45:49AM -0700, Fenghua Yu wrote: > > Currently we can trace split lock event counter for debug purpose. But > > How? A while ago I actually tried that, but I could not find a suitable > perf event. The event name is called sq_misc.split_lock. It's been supported in perf already. > > > Intel introduces mechanism to detect split lock via alignment > > check exception in Tremont and other future processors. If split lock is > > from user process, #AC handler can kill the process or re-execute faulting > > instruction depending on configuration. > > Ideally it would #AC any unaligned (implied) LOCK prefix instruction, > not just across lines. This feature only triggers #AC for unaligned cache line access, not for other aligned (4 bytes, 8 bytes, etc). This is not explicitly said in ISE. I can add this info in next version of patches. > > > To detect split lock, a new control bit (bit 29) in per-core TEST_CTL > > MSR 0x33 will be introduced in future x86 processors. When the bit 29 > > is set, the processor causes #AC exception for split locked accesses at > > all CPL. > > Per-Core is really unfortunate, but better than nothing. Agree with you! Per-core is at least for current hardware implementation. The code and locking in the code are supposed to work in the future on potential per-thread or even per-socket implmentation. Thanks. -Fenghua