Received: by 2002:ac0:a581:0:0:0:0:0 with SMTP id m1-v6csp1582132imm; Fri, 22 Jun 2018 21:22:42 -0700 (PDT) X-Google-Smtp-Source: ADUXVKJ3XWUt13ShpIDxxtY4WygLmDwcWO+yP7l/gwtrNQjcCaXuod3Ov+IHyzjHKyL/obtad2MQ X-Received: by 2002:a17:902:6f0f:: with SMTP id w15-v6mr4065329plk.216.1529727762428; Fri, 22 Jun 2018 21:22:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1529727762; cv=none; d=google.com; s=arc-20160816; b=XvhX8EhtMBZLJMzk3XN489tuozVXH/Owr1qlnbuBKAzO8y1Q8aT4kbKxsO3OMm9pLq UnzUNeQKdViDqJPbFH7+LkftMfV0wSYqR2LUFw8Fdh76dQdOV0CJCXIlPV0IlpKQoAh+ JX3OnpFdR4gK+ynmqy7IRwdJtpYt9YSAyzNa1MF6qH6mKtOjTtpqlHQzGOinfem0AKBf b7IJtuRCayKaFfem7sHBrpWv7z+9FgqRwGCQU84rTtT0e7/EJ6Bs9Es/lxI4uMVeIisQ 6LbDXz7NpTCTRNZ/iEM5ggmdXugEoecgnqder4YxXtYvLZ83byoY2eKiHyIKPCBVd8H5 Yk9Q== 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=R32gwQDiQ4c/FtklA5oOakjcZ5mZ+no715pt4ElJcI4=; b=QzSpGgGXCH90279j6EEHa/TOn9fSLT+D93TmwaSSAD9FPGvgJGBeR4dBn6Fn6cuNHj kUtVcPzU1JQldMj3/+qxzpj5TME3ZWW3qIjChgTT4K5YmgYYdtBiuoc4smu3YkEwZsma M0SZGDDLkZHr11qulwB1eUIXRQoonSjExlbqOJ0r7vQyjBFm6ZO000KCGqRPPCLuO6Y9 aN51sHK/u0fb6JiyFpvF+IcLcdpMXGtP2Riw0My1wDJwskYkSerG58BtXjgubv4KvZEw h9MJxiul6UJfdZiXSQDEhtW7Na7IC/MUmVRxLzDaSk+k4cnzQ4NIdGyEVQuMC0MAzX3/ ev/Q== 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 k191-v6si7428671pgd.19.2018.06.22.21.22.14; Fri, 22 Jun 2018 21:22:42 -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 S1751023AbeFWEVL (ORCPT + 99 others); Sat, 23 Jun 2018 00:21:11 -0400 Received: from mga17.intel.com ([192.55.52.151]:24346 "EHLO mga17.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750777AbeFWEVK (ORCPT ); Sat, 23 Jun 2018 00:21:10 -0400 X-Amp-Result: UNKNOWN X-Amp-Original-Verdict: FILE UNKNOWN X-Amp-File-Uploaded: False Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by fmsmga107.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 22 Jun 2018 21:21:10 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.51,260,1526367600"; d="scan'208";a="65619580" Received: from romley-ivt3.sc.intel.com ([172.25.110.60]) by fmsmga004.fm.intel.com with ESMTP; 22 Jun 2018 21:21:03 -0700 Date: Fri, 22 Jun 2018 21:20:33 -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: <20180623042033.GF18979@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 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? 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. Thanks. -Fenghua