Received: by 2002:ac0:a581:0:0:0:0:0 with SMTP id m1-v6csp1372343imm; Fri, 22 Jun 2018 15:43:20 -0700 (PDT) X-Google-Smtp-Source: ADUXVKKwq7+VZy5UPHe+b4aGA4er2DF6Gi7o5i+RKRQGxZmGhPpPyfe/LfHfRyTGnd+O+k62PYTZ X-Received: by 2002:a17:902:ab8e:: with SMTP id f14-v6mr3452558plr.5.1529707400132; Fri, 22 Jun 2018 15:43:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1529707400; cv=none; d=google.com; s=arc-20160816; b=yGD9AJ3Ro0BhvXT7UvguPHFYnUM9iL56CdI6HkeTqVm8Pg5ypInG3OCCxZCp8W0eAS zpgUvZ9q7Wk1Jm4OeIERkJmDKJMJ1aU/WXS9/Vjp7hs5TynUB4yIEwjvhz8mX2+SwH1t NlB25CrHtIW0pJ9prvXVTScjBgC6KyHEIFRLYa8LJLYbEMEB5W+d3p6E4QtpuOt1Lc1J jb6PqMqdpDjRphwtRcYhnxHMzdusL+U8zS0dttvZz34amhf+ACh9x0SZCbaW+By1hyZm x/Hm5I5zIchEuWYfpKrPLA48U8rErovyhJtAyOuP1TXQhRo56WWiuf42RsFZUO9nv18m KF5g== 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=0nkbTWyx4cPOTkObU0wXbh6rUpf9aLQ2VHibmo2M134=; b=Of5WrrWVY1ar+hFUzbXCq1moYtcIQNuRLDr/Av2AYd9PmDnBZuXUh9PhQvkGTUZzbi taKl/QD99abULnKPAjZ/eGrWRQpUXm/EzX1yUPfcMAcAbc/k1b6W0LVxyl0D0X8da52i zOeFcCGlpM0W++TQzBkAs1Aq0Kp/IOnblMII7WpEvQnCBLp2onG3sjtABSbCbeKomClK jgHT8PTJcrpu1twArElrI/qFquMQGgbrwLoWLdzpLI+/WdKrCfBWcZZuTCDKRj/Nntz8 ibax8s6c2vlqMpNf3gGXgeeWH3iJsjTmhVrqtxzUJQ+sz3nWiixF6eaOpapwpAOG1B67 b+OQ== 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 f5-v6si7120039pgu.103.2018.06.22.15.43.05; Fri, 22 Jun 2018 15:43:20 -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 S1754559AbeFVWm0 (ORCPT + 99 others); Fri, 22 Jun 2018 18:42:26 -0400 Received: from mga07.intel.com ([134.134.136.100]:38604 "EHLO mga07.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754184AbeFVWmZ (ORCPT ); Fri, 22 Jun 2018 18:42:25 -0400 X-Amp-Result: UNSCANNABLE X-Amp-File-Uploaded: False Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by orsmga105.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 22 Jun 2018 15:42:24 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.51,259,1526367600"; d="scan'208";a="239849725" Received: from romley-ivt3.sc.intel.com ([172.25.110.60]) by fmsmga006.fm.intel.com with ESMTP; 22 Jun 2018 15:42:24 -0700 Date: Fri, 22 Jun 2018 15:41:54 -0700 From: Fenghua Yu To: Thomas Gleixner Cc: Fenghua Yu , 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 02/16] x86/split_lock: Handle #AC exception for split lock in kernel mode Message-ID: <20180622224154.GD18979@romley-ivt3.sc.intel.com> References: <1527435965-202085-1-git-send-email-fenghua.yu@intel.com> <1527435965-202085-3-git-send-email-fenghua.yu@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: 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 Fri, Jun 22, 2018 at 01:59:44PM +0200, Thomas Gleixner wrote: > On Fri, 22 Jun 2018, Thomas Gleixner wrote: > > The whole thing is simply: > > > > handle_ac() > > { > > if (user_mode(regs)) { > > do_trap(AC, SIGBUS, ...); > > } else { > > disable_ac_on_local_cpu(); > > WARN_ONCE(1); > > } > > } > > > > That wants #AC enabled as early as possible so the kernel gets as much > > coverage as it can. If it trips in the kernel it's a bug and needs to be > > fixed and we can them fix ONE by ONE. > > That said, #AC is just yet another badly defined and hastily bolted on > (mis)feature. This should have been: > > Bit A: Enable #AC if CPL < 3 > Bit B: Enable #AC if CPL == 3 > > But that would have been too useful and would allow sensible use of #AC > without creating software trainwrecks. > > Aside of that the spec says: > > 31 Disable LOCK# assertion for split locked access. > > Can you pretty please make sure that this bit enforces #AC enable? If 31 is > ever set and such an access happens then the resulting havoc will takes > ages to decode. > > That bit is also mentioned in the SDM with ZERO explanation why it exists > in the first place and why anyone would ever enable it and without a big > fat warning about the possible consequences. Can this pretty please be > fixed? The bit 31 already exits on all processors. Hardware always sets its value as zero after power on. It has been legacy for 20 years. It was added for one customer 20 years ago. Now Intel hardware design team doesn't expect anyone to set the bit. Currently Linux kernel doesn't define this bit and doesn't set this bit. Thanks. -Fenghua