Received: by 2002:a25:7ec1:0:0:0:0:0 with SMTP id z184csp3670999ybc; Thu, 21 Nov 2019 11:51:12 -0800 (PST) X-Google-Smtp-Source: APXvYqyBgA4JV6B0ZWbADZOyclCKcwOKPJcOZ2NDe52tcZh6zx57Zhtb+Yrvm7ARplCMddc2RZ6M X-Received: by 2002:a17:906:4d99:: with SMTP id s25mr16384224eju.187.1574365872434; Thu, 21 Nov 2019 11:51:12 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1574365872; cv=none; d=google.com; s=arc-20160816; b=Iln0ci8OY7EAb3WM+x/VZEkMgIbOUPmuZBMZhf3yit2ywCa0SBQwT08ZX/O2r1yJuy 7V5q5qIbySWZZmC8i6uoHtIh/FpHBQn8IG9H1tw5KOQmjVCBGRZHQWQK/NWtccgu7IPG onhXPPmVUgCaP0M1hm7gdx+HlM1V2v5DDiE1gHUk6xusefadv1PFXcjs3isnmslQfV5g 8nWLkB5GlvmwRNpxRG4Q/BvsD9N07pJczLI51hq/XGYH/gJ+NYE2YJV07yidP44OclT2 5VMq2bQLcj+FOGvmGgaEHixghF3iE9OhP90bNo5hEq0wEAJCtVgeTpeGDc4gvtcXLQVb oo2Q== 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:dkim-signature; bh=uDnrPO1tl5vXSE/f3VQxCFB1olb1bF+zShCGCQYuB7o=; b=B+kbEtFjII25r2f4kL4axHrtnvAiHsBm6SKnh6lHM7n9ZdM6ilr8UlHiYtsh/bQmtd Oj3EWiqYuOdo6hJNNnGs2lIVNCqGQ7PJJn4MCOsHty0Tj1SsbIhp2RTxpBzoSBL86IYu vPRRSmSJegeu/SFBbNRxQRpGQYX29szFWhEM9m1CWS6cipCedIy6JuiLUhBF2rI0QSuJ jnSDBB6HyQUgz9LTQkTNYTiSHyYdoe9poTOX+HEuY35c3HiGY3gVIagxqK8U3NDR+dig JGeJQAtMHYP1fvhQeRKCs0BCjyjH9EnF0QwgMgZLK7MuJNwMuWYI+Y+QsJdczpPOPUS0 ko1w== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=pRKiYlpF; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d16si2496079ejc.277.2019.11.21.11.50.48; Thu, 21 Nov 2019 11:51:12 -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=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=pRKiYlpF; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726962AbfKUTrE (ORCPT + 99 others); Thu, 21 Nov 2019 14:47:04 -0500 Received: from bombadil.infradead.org ([198.137.202.133]:37274 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726563AbfKUTrE (ORCPT ); Thu, 21 Nov 2019 14:47:04 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20170209; h=In-Reply-To:Content-Type:MIME-Version :References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=uDnrPO1tl5vXSE/f3VQxCFB1olb1bF+zShCGCQYuB7o=; b=pRKiYlpFirip+dnTqEjeOQm+M u30mv3OXCjhLway7hxFFdcyw2HVKihH24n6UqZmV5TWf03EzMhmveRcv2ZRitUsyJKH+NybaRRwu9 eGlS5Tugqv0arzXWxuhdb3yAp9TZxODC+398uh93/vIf/2D/abx2ZbquPwxx6vvVe968QL10dfd+6 lHj1zNAVzoER5LNCmeNYb+eeY/uBIclmpiv3Vo0WL+ePxy8n1/zcKOvJWCcqOFJNPd3Cp/Fpn5ZiA L4L3RasJNBEhQhlD8Mbs6rnSH0wFRVnfCVze86eKvO/tcEdq6Lw6hSRZHHG1q5OBZC5VRAOoMeVWP 0zzCvmMEQ==; Received: from j217100.upc-j.chello.nl ([24.132.217.100] helo=noisy.programming.kicks-ass.net) by bombadil.infradead.org with esmtpsa (Exim 4.92.3 #3 (Red Hat Linux)) id 1iXsPl-0005mg-GO; Thu, 21 Nov 2019 19:46:53 +0000 Received: from hirez.programming.kicks-ass.net (hirez.programming.kicks-ass.net [192.168.1.225]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by noisy.programming.kicks-ass.net (Postfix) with ESMTPS id BD1EE300606; Thu, 21 Nov 2019 20:45:39 +0100 (CET) Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id B75F22022FCFB; Thu, 21 Nov 2019 20:46:50 +0100 (CET) Date: Thu, 21 Nov 2019 20:46:50 +0100 From: Peter Zijlstra To: Fenghua Yu Cc: 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 Subject: Re: [PATCH v10 6/6] x86/split_lock: Enable split lock detection by kernel parameter Message-ID: <20191121194650.GU4097@hirez.programming.kicks-ass.net> 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> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20191121185303.GB199273@romley-ivt3.sc.intel.com> User-Agent: Mutt/1.10.1 (2018-07-13) 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 10:53:03AM -0800, Fenghua Yu wrote: > We are working on a separate patch set to fix all split lock issues > in atomic bitops. Per Peter Anvin and Tony Luck suggestions: > 1. Still keep the byte optimization if nr is constant. No split lock. > 2. If type of *addr is unsigned long, do quadword atomic instruction > on addr. No split lock. > 3. If type of *addr is unsigned int, do word atomic instruction > on addr. No split lock. > 4. Otherwise, re-calculate addr to point the 32-bit address which contains > the bit and operate on the bit. No split lock. Yeah, let's not do that. That sounds overly complicated for no real purpose.