Received: by 2002:ac0:a581:0:0:0:0:0 with SMTP id m1-v6csp6954323imm; Wed, 27 Jun 2018 16:55:30 -0700 (PDT) X-Google-Smtp-Source: ADUXVKJslHA16kFi8+FVT1hGutLdGJzqTnwz9dFuLilTDwcboKn+gepzUi2cEY7lIl8xUS0VJk+M X-Received: by 2002:a63:a401:: with SMTP id c1-v6mr6838199pgf.147.1530143730293; Wed, 27 Jun 2018 16:55:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1530143730; cv=none; d=google.com; s=arc-20160816; b=e82gP37Yeg+4X6NeERS7XRPmGd0r9E+pftLy8R1+LkyoIBllp/4VRyJ9ki9rmeR7RR A6RhCgJr7Jo48h9cjS+M/A3FQ5lhJOH7QMTW7CeESHLQDjrqZmf0JcNyJuhZhPjTrtuQ o3mFTv215lClQIBxjoxOpPELx1d+fmGYUMqdqOAJAWsAcNY3nxjEgfnvlgjxbg5YlSBr eVZiTGnrEu1bBVFjK5G2TdpbzHZxudAonuGah9Y2FmGLpkTkRPsIXhPFsUKRTJQqch3Z Ta4bYLhH4o/YvjFxZuwXvvxFkekYdJjbkN8ynl6ciMRCBM9C0w5UvpnGIbpTZPG2pfnL 0dXA== 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=yKZLbsCeHKbJj08tsKV79gpSHWV17q6Yel1316MtxaU=; b=m4Y6TBNt9IcN+zhe/MrulFZoI+rVUfo+nAwZISa7cfvedPsfoGwuYviWcN5edLxkoN eF4YUGjB3SYqPij83Elz/C/KcxY7b/QNaBlamhJk3Jf7+9YQbb0GbShn/7DQG/rfkCBB pugOwBX3GzLGaq7jspj9A1yAm9mopAL6kIFinsgHSWdWgh/SzH1HWoZ9bcByCvcqP85V qLkbYqtNAxFj4xdPeEBlcIg2a9cqReMnlnB5mOKF1DtOomTaHXmDt0mmdYkDNLvhQiIU oVsCxrA/9RHInpfdaBjfvy58w+s7jbExvXEz4PSK6dtcB0drWVCw1C+PHqcgPXiyviPq 9W+g== 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 j10-v6si4809859pff.269.2018.06.27.16.55.16; Wed, 27 Jun 2018 16:55:30 -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 S1752608AbeF0Xfo (ORCPT + 99 others); Wed, 27 Jun 2018 19:35:44 -0400 Received: from mga11.intel.com ([192.55.52.93]:18097 "EHLO mga11.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752210AbeF0Xfm (ORCPT ); Wed, 27 Jun 2018 19:35:42 -0400 X-Amp-Result: UNKNOWN X-Amp-Original-Verdict: FILE UNKNOWN X-Amp-File-Uploaded: False Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by fmsmga102.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 27 Jun 2018 16:35:42 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.51,281,1526367600"; d="scan'208";a="240886657" Received: from romley-ivt3.sc.intel.com ([172.25.110.60]) by fmsmga005.fm.intel.com with ESMTP; 27 Jun 2018 16:35:42 -0700 Date: Wed, 27 Jun 2018 16:35:04 -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 04/16] x86/split_lock: Use non locked bit set instruction in set_cpu_cap Message-ID: <20180627233504.GJ18979@romley-ivt3.sc.intel.com> References: <1527435965-202085-1-git-send-email-fenghua.yu@intel.com> <1527435965-202085-5-git-send-email-fenghua.yu@intel.com> <20180621195540.GC13636@worktop.programming.kicks-ass.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180621195540.GC13636@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:55:40PM +0200, Peter Zijlstra wrote: > On Sun, May 27, 2018 at 08:45:53AM -0700, Fenghua Yu wrote: > > set_bit() called by set_cpu_cap() is a locked bit set instruction for > > atomic operation. > > > > Since the c->x86_capability can span two cache lines depending on kernel > > configuration and building evnironment, the locked bit set instruction may > > cause #AC exception when #AC exception for split lock is enabled. > > That doesn't make sense. Sure the bitmap may be longer, but depending on > if the argument is an immediate or not we either use a byte instruction > (which can never cross a cacheline boundary) or a 'word' aligned BTS. > And the bitmap really _should_ be 'unsigned long' aligned. > > If it is not aligned, fix that too. > > /me looks at cpuinfo_x86 and finds x86_capability is in fact a __u32 > array.. see that's broken and needs fixing first. Do you mean x86_capability's type should be changed from __u32 to unsigned long? Changing x86_capability's type won't directly fix the split lock in set_cpu_cap(), right? BTS still may access x86_capability across cache line no matter x86_capability's type. Thanks. -Fenghua