Received: by 2002:ac0:a581:0:0:0:0:0 with SMTP id m1-v6csp1772760imm; Sat, 23 Jun 2018 02:19:24 -0700 (PDT) X-Google-Smtp-Source: ADUXVKJ0r+IcLgf54C0u7ux7nfqylSdx3g13cGV9Ze1F2WsX+LMBBHVG2JSy0Ki8+KylS+L4tJ0s X-Received: by 2002:a62:ff1d:: with SMTP id b29-v6mr5126976pfn.181.1529745564826; Sat, 23 Jun 2018 02:19:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1529745564; cv=none; d=google.com; s=arc-20160816; b=y81PD5IvKVDl+KH+R6uUrVadR0F4y2LB6Xwub1Jsaa27ldmBD0cCfXPvZhsJgisLpx K+Qj9xKR5Hy7Yg4NffUuL0btbPmvGL5jzORc7wFwI/HfUje909MBT6Dreqr0RnInjNVm 9ADOmZkIRnftPaR4xiBRvwYeE5irVBAL3hXtPgH1rwZNl2TbsvOCUfDxuWwWeJGc6FhS UtfUUYiy/65HPZZBnBoG2uVk3CWhtSMlZkkafgsBH7IoNKj2r1kzP6c2QnS0qQeCYWuY vP17LupAxoz5fech3SITCJE0yNXNjmbKdP1tg9r7+VRnkCUN/+AptqbhKxTActFn5lBD aAIg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :message-id:in-reply-to:subject:cc:to:from:date :arc-authentication-results; bh=AOruK1bUBWWjWX/SsLgHx2AiC6v8j+ScoE6YTlti/WA=; b=l0uokwIzOhVtvnWJ3DkQqbcrVKzoOGxs7wTNhe66gfRaBNoobQvpoP39219OgrPRS9 Hhn8ZOtYfrFu+fGPuyvHC3xJQ5pq/O0tdhuMdYwFJr2BV7VPJVA0279MGfgvbnjoa3p1 mwXakJfrhCjLamM64PKIXzdmZRxP3pYyChL5oA53Og7imSPLTHk/SIfDAFR/iN+OXMK3 IqFoflcvnzezFG8ySmJ4pN5M5Rekl2pRy3ypiH4Z+7ZtZa+LobJv0V3isVjBkrug1LBU jadjwicY+B1R0VqCqc0Ig5c2kx0GrUFI3tWE3C5JBxhVClp3ILPkgtmW6qZ1qrJpp2uC c+RA== 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id c2-v6si7613194pgp.134.2018.06.23.02.19.10; Sat, 23 Jun 2018 02:19:24 -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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751819AbeFWJRL (ORCPT + 99 others); Sat, 23 Jun 2018 05:17:11 -0400 Received: from Galois.linutronix.de ([146.0.238.70]:43196 "EHLO Galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751766AbeFWJRK (ORCPT ); Sat, 23 Jun 2018 05:17:10 -0400 Received: from p4fea482e.dip0.t-ipconnect.de ([79.234.72.46] helo=nanos.glx-home) by Galois.linutronix.de with esmtpsa (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1fWefI-0003hN-Bs; Sat, 23 Jun 2018 11:17:04 +0200 Date: Sat, 23 Jun 2018 11:17:03 +0200 (CEST) From: Thomas Gleixner To: Fenghua Yu cc: 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 In-Reply-To: <20180623042033.GF18979@romley-ivt3.sc.intel.com> Message-ID: References: <1527435965-202085-1-git-send-email-fenghua.yu@intel.com> <1527435965-202085-3-git-send-email-fenghua.yu@intel.com> <20180623042033.GF18979@romley-ivt3.sc.intel.com> User-Agent: Alpine 2.21 (DEB 202 2017-01-01) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII X-Linutronix-Spam-Score: -1.0 X-Linutronix-Spam-Level: - X-Linutronix-Spam-Status: No , -1.0 points, 5.0 required, ALL_TRUSTED=-1,SHORTCIRCUIT=-0.0001 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, 22 Jun 2018, Fenghua Yu wrote: > On Fri, Jun 22, 2018 at 12:49:00PM +0200, Thomas Gleixner wrote: > > On Sun, 27 May 2018, Fenghua Yu wrote: > > > +static void wait_for_reexecution(void) > > > +{ > > > + while (time_before(jiffies, disable_split_lock_jiffies + > > > + reenable_split_lock_delay)) > > > + cpu_relax(); > > > +} > > > + > > > +/* > > > + * TEST_CTL MSR is shared among threads on the same core. To simplify > > > + * situation, disable_split_lock_jiffies is global instead of per core. > > > > This patch surely earns extra points in the trainwreck engineering contest, > > but that's not taking place on LKML. > > > > The whole thing is simply: > > > > handle_ac() > > { > > if (user_mode(regs)) { > > do_trap(AC, SIGBUS, ...); > > } else { > > disable_ac_on_local_cpu(); > > WARN_ONCE(1); > > } > > } > > Should I add kernel parameter or control knob to opt-out the feature? A simple command line option 'acoff' or something more sensible should be ok. No sysfs knobs or whatever please. The Kconfig option is not required either. > I'm afraid firmware may hang system after handling split lock if the > feature is enabled by kernel, e.g. "reboot" hits split lock in firmware > and firmware hangs the system after handling #AC. Have you observed the problem in reality? I mean why would 'reboot' be the critical path? I'd rather expect that EFI callbacks or SMM 'value add' would trip over it. Vs. reboot. If that is the only problem then we might just have to clear #AC enable before issuing it, but that does not need to be part of the initial patch set. Its an orthogonal issue. Thanks, tglx