Received: by 2002:a25:7ec1:0:0:0:0:0 with SMTP id z184csp3766706ybc; Thu, 21 Nov 2019 13:26:21 -0800 (PST) X-Google-Smtp-Source: APXvYqxGLLovDkuBMmxl99sU2l2a4YbUGS59lM3EwPqh/kO3mdn51MzxyZdB68caFukSN82Yt7OX X-Received: by 2002:a1c:9804:: with SMTP id a4mr12412523wme.57.1574371581223; Thu, 21 Nov 2019 13:26:21 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1574371581; cv=none; d=google.com; s=arc-20160816; b=BBxftJxfaPN3cwLmHKIkjWh5sOetQtSxvyylIJOcvce8jQl1raJeEGFtE7W9UfaY8T 0JpxTY4lYSvWzamcscJfAqcl7f7fum/0b3XBF3f3TtTN4aYzjlbd+K4pUu86/57Acwcy OS7O8MlFPmebttLaSh+VL7XX9vg3Ect9cTKxDHuvkI9MGOJ8TXCKbL53GyTr/AVz8Q0h 92bdR7gYmc95/efp5QXpb4iqCr552Cc6hGxUFI0jPItUW/Jpy/cexuMURJYWRF5cOT4S vvrlw0ClouOBbOCElgaN2waHTSfl0wCrMEIYRlHp+va9mcS/MMQOY6mbTzn0sTdFBv5m fXhQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=Wj70+xO7fAesuu+AVHFMXAF4EGLVIxmWrI0J14qUXLE=; b=uT3e4FCySrMZTLUlqI8vmFqVxptqxlYeFX11C/YQU59ADMAjK68d6+DpHT21wys++i gN+8n8eBG8GLMTuENapADWvlQLzFopcXrXMOit2JiJk4oSMRv+uHhOhx27P3pZgDnqtP 0rtIWG3u2VXctUHxJlJ4x3nCiFDMI62O297UxgqZdKbALIL6g/bA46p4orTktpQS+NL8 pCNzSTRTTBFcmdpfq8QwiomXny4uSkBoQVPTn4oCq3nAwT1VbeljTY/Z6y/rGjNp5ttl kmk5SaOGMORJ9WhlCCqh5XNZshoQ1Xx9OmYeLBPXqFyeveB4pDKAy3azi1D9AGjakz3A Jabg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="1W83i/7e"; 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=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id l20si2884128edv.282.2019.11.21.13.25.57; Thu, 21 Nov 2019 13:26:21 -0800 (PST) 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; dkim=pass header.i=@kernel.org header.s=default header.b="1W83i/7e"; 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=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727126AbfKUVW1 (ORCPT + 99 others); Thu, 21 Nov 2019 16:22:27 -0500 Received: from mail.kernel.org ([198.145.29.99]:39256 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726329AbfKUVW1 (ORCPT ); Thu, 21 Nov 2019 16:22:27 -0500 Received: from mail-wm1-f50.google.com (mail-wm1-f50.google.com [209.85.128.50]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 1E73F2071B for ; Thu, 21 Nov 2019 21:22:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1574371346; bh=bniu8l82DVZK7Xcjyvbp1Kp51VrBQmOfOA8fDc6KI6s=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=1W83i/7eltRlSF7Z+DyLIIlHItx8a80Y6f5tU9FdKwcsb2iJufoFbaPfCr76zhjEB su3UsLAlY70TDmOycXobjCKUa5stZ0po+I01HnyIj+z1c8jzc4U91BMasKPjRJf0JH yZ8B83UABywnlwRrW3HoiepIoC7pWmXjp8KMcVRE= Received: by mail-wm1-f50.google.com with SMTP id x26so5034306wmk.4 for ; Thu, 21 Nov 2019 13:22:26 -0800 (PST) X-Gm-Message-State: APjAAAUTK4uLV7PijIBFriP/TRC0RBk8PYDY7fWDZMrA38CP1aBXtxNm Tw57JTyBrVd9RoJIXqITzlU4eN8rXTDLVb+dqZCCkg== X-Received: by 2002:a7b:c1ca:: with SMTP id a10mr13469841wmj.161.1574371344540; Thu, 21 Nov 2019 13:22:24 -0800 (PST) MIME-Version: 1.0 References: <1574297603-198156-1-git-send-email-fenghua.yu@intel.com> <1574297603-198156-7-git-send-email-fenghua.yu@intel.com> <20191121060444.GA55272@gmail.com> <20191121130153.GS4097@hirez.programming.kicks-ass.net> <20191121171214.GD12042@gmail.com> <3481175cbe14457a947f934343946d52@AcuMS.aculab.com> <20191121185303.GB199273@romley-ivt3.sc.intel.com> <20191121202508.GZ4097@hirez.programming.kicks-ass.net> In-Reply-To: <20191121202508.GZ4097@hirez.programming.kicks-ass.net> From: Andy Lutomirski Date: Thu, 21 Nov 2019 13:22:13 -0800 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH v10 6/6] x86/split_lock: Enable split lock detection by kernel parameter To: Peter Zijlstra Cc: Fenghua Yu , Andy Lutomirski , David Laight , Ingo Molnar , Thomas Gleixner , Ingo Molnar , Borislav Petkov , H Peter Anvin , Tony Luck , Ashok Raj , Ravi V Shankar , linux-kernel , x86 Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Nov 21, 2019 at 12:25 PM Peter Zijlstra wrote: > > On Thu, Nov 21, 2019 at 10:53:03AM -0800, Fenghua Yu wrote: > > > 4. Otherwise, re-calculate addr to point the 32-bit address which contains > > the bit and operate on the bit. No split lock. > > That sounds confused, Even BT{,CRS} have a RmW size. There is no > 'operate on the bit'. > > Specifically I hard rely on BTSL to be a 32bit RmW, see commit: > > 7aa54be29765 ("locking/qspinlock, x86: Provide liveness guarantee") > Okay, spent a bit of time trying to grok this. Are you saying that LOCK BTSL suffices in a case where LOCK BTSB or LOCK XCHG8 would not? On x86, all the LOCK operations are full barriers, so they should order with adjacent normal accesses even to unrelated addresses, right? I certainly understand that a *non-locked* RMW to a bit might need to have a certain width to get the right ordering guarantees, but those aren't affected by split-lock detection regardless. --Andy