Received: by 2002:ac0:a581:0:0:0:0:0 with SMTP id m1-v6csp1399194imm; Fri, 22 Jun 2018 16:20:37 -0700 (PDT) X-Google-Smtp-Source: ADUXVKJIgWvHm1CXWKyCqV5d6GuaQ0D1rks9DCAGulM6tZR2TBOjDFZ2RS5Jpy4gMDuvZknNvVeo X-Received: by 2002:a63:6e44:: with SMTP id j65-v6mr3080830pgc.14.1529709637669; Fri, 22 Jun 2018 16:20:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1529709637; cv=none; d=google.com; s=arc-20160816; b=dwi2hO459Xf2nsCsZoxngHk35gw2D0Lg3CccMHV3r7l5hVhUTfMy/IuLwcP7mltTsX uwnJycBRNVd/jub/HiwwwE5KWdRySRjiwfgHCkAccZZ2Oz/3rIKJgIYKvhI8p3CbiZHP T8LHarC8tSPO3AR5/L9sUbm86gHw/2GO0nQcoI/cR9mwWHdQXwKpF3+CdYTJGpkCUgz2 +oTRc5lSHqZr1Fto32iPdeSLSnywpk8+rW9CT/0B7V4JGIKxTjVkwFAdE7jwf3tFRAJ/ o4TKbmx7HQfUc8MJ4Kr4Wf+iiA0wQSvlHngci7tYQd3rMjm5xjEfNiNq+hyhQovb4jkK HLTA== 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=SkLDyRImkrxLK4foO5RFStxm0/lWK4hYMGrfh+dz50w=; b=shXmcOGMH++24B6/RUUK5TcpQ6O8W6gPFtJChq/EI5ax4ep802/G5H9X41WdI0NZZn sOVbh6XqQ6J3BtNd4gKWa/SoJErisEbIcaAHWDTyGRkQXQAJgobn/2mHsGQpoHvJI8po GZDX6e1+JHBOvOwPVKhRbQghd4R0ZxXoCST5Uz1i94pFReYBiojsErztwYhx2hbYuhn/ X9OcELn/Y071dz89k6fDWcTXvLU4H3K1yU6a6oWxTUKA0lTTuoQuhbJv5TKQk5xipNlf WRFqTNDwkolymyGSAi8DXREjCe0a9jEOpfS3bIRNFexhb/1KRoFmfW1x3j6BiwsFQUO7 Pdcw== 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 o3-v6si7196603pgc.381.2018.06.22.16.20.22; Fri, 22 Jun 2018 16:20:37 -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 S1754715AbeFVXSp (ORCPT + 99 others); Fri, 22 Jun 2018 19:18:45 -0400 Received: from mga18.intel.com ([134.134.136.126]:18093 "EHLO mga18.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754552AbeFVXSo (ORCPT ); Fri, 22 Jun 2018 19:18:44 -0400 X-Amp-Result: UNSCANNABLE X-Amp-File-Uploaded: False Received: from orsmga003.jf.intel.com ([10.7.209.27]) by orsmga106.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 22 Jun 2018 16:18:44 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.51,259,1526367600"; d="scan'208";a="61474460" Received: from romley-ivt3.sc.intel.com ([172.25.110.60]) by orsmga003.jf.intel.com with ESMTP; 22 Jun 2018 16:18:43 -0700 Date: Fri, 22 Jun 2018 16:18:13 -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: <20180622231813.GE18979@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. > The two bits would be ideal. So I will do SIGBUG for user and WARN/disable for kernel in the next version. Thanks. -Fenghua