Received: by 2002:a25:7ec1:0:0:0:0:0 with SMTP id z184csp3855156ybc; Thu, 21 Nov 2019 15:03:46 -0800 (PST) X-Google-Smtp-Source: APXvYqytkpJRLX09n/BJP7QbvwxsAqGodvQrOaL+Xfdh4NWXQHYcvbgsWUHiiJivUdgbY3tXBcHy X-Received: by 2002:a17:906:970a:: with SMTP id k10mr16624199ejx.314.1574377426353; Thu, 21 Nov 2019 15:03:46 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1574377426; cv=none; d=google.com; s=arc-20160816; b=sION+5Zt4Hrj91kJDItV2YIggweacO62Y22TKX38KKRWnfY90hDWvG4Sy8VcoY30AV CimicqXn9QsvbpLLz7EXPfyN/HmwEqguWvZ2F/tgnIBULuVWa7ky/GNnGc01xcUNpca5 bG3v5LbnAaZv3+uaR2ZlTF6pdUO8SeXa93Bidk7dujKzXgrMfG+5cJwNsWx5HeNgZn4h bD9FXP25zTBKkbjLga9YMSQlw0m2SC8dUrtHptzaR3m0DlmdPRfs3s2nWrs1u9CyrCL+ YW3GYd2uwzdcYVV6MpDFGGicXeLjAHea2fI/fmUmcajRhvBLQAcNOxGOeQi65q0aRmx0 alwA== 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-transfer-encoding:content-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=Fj2t7ImDo7ucVO8hPYrfzx7tQsOxfGQvcVICHAm7RwE=; b=YYaFcF51LbmGkHjKk84tYfd0VruXeN8dcCQ6iU5LQN6ONCzKHeKrqbqZrEZnzThMOo fLDq2hZOdE98BqPvSWyF3uSA7eaKD3dWGt7LjwKX3oS5sKzMyBzip0mBQAXX9EWX4BOO 8IaRfv3k7d3lBK7F910Sy+hMBYMvLanRklLzhxTsWUA9ltdRlMBkrqoy/OarieZIr6Lh X5ZYfNBV23dsPwF9mTD39mBrz0dXs/QMxnopX4C86EEwmzjDrkrsXPHfGeZMYdPJQ0nr lFwTDyuh3oyhpIuz5tNXXWZnwTyIPV8RtXlZR08mx5kqsmLpN7Xp4JSJIl1DUytKx/Qp 4EPQ== 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 k7si3449587edb.265.2019.11.21.15.03.20; Thu, 21 Nov 2019 15:03:46 -0800 (PST) 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 S1726408AbfKUXCC (ORCPT + 99 others); Thu, 21 Nov 2019 18:02:02 -0500 Received: from mga06.intel.com ([134.134.136.31]:21331 "EHLO mga06.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725936AbfKUXCC (ORCPT ); Thu, 21 Nov 2019 18:02:02 -0500 X-Amp-Result: UNKNOWN X-Amp-Original-Verdict: FILE UNKNOWN X-Amp-File-Uploaded: False Received: from orsmga002.jf.intel.com ([10.7.209.21]) by orsmga104.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 21 Nov 2019 15:02:01 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.69,227,1571727600"; d="scan'208";a="219259419" Received: from romley-ivt3.sc.intel.com ([172.25.110.60]) by orsmga002.jf.intel.com with ESMTP; 21 Nov 2019 15:02:00 -0800 Date: Thu, 21 Nov 2019 15:14:11 -0800 From: Fenghua Yu To: Andy Lutomirski Cc: Thomas Gleixner , Ingo Molnar , Borislav Petkov , H Peter Anvin , Peter Zijlstra , Tony Luck , Ashok Raj , Ravi V Shankar , linux-kernel , x86 Subject: Re: [PATCH v10 5/6] x86/split_lock: Handle #AC exception for split lock Message-ID: <20191121231410.GD199273@romley-ivt3.sc.intel.com> References: <1574297603-198156-6-git-send-email-fenghua.yu@intel.com> <5BDDAE0C-2D31-4779-B3A0-5BF206FF3E50@amacapital.net> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <5BDDAE0C-2D31-4779-B3A0-5BF206FF3E50@amacapital.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, Nov 21, 2019 at 02:10:38PM -0800, Andy Lutomirski wrote: > > > > On Nov 20, 2019, at 5:45 PM, Fenghua Yu wrote: > > > > + if (!user_mode(regs) && split_lock_detect_enabled) > > + panic("Split lock detected\n"); > > NAK. > > 1. Don’t say “split lock detected” if you don’t know that you detected a split lock. Or is this genuinely the only way to get #AC from kernel mode? Intel hardware design team confirmed that the only reason for #AC in ring 0 is split lock. > > 2. Don’t panic. Use die() just like every other error where nothing is corrupted. Ok. Will change to die() which provides all the trace information and allow multiple split lock in one boot. > > And maybe instead turn off split lock detection and print a stack trace instead. Then the kernel is even more likely to survive to log something useful. How about we just use simple policy die() in this patch set to allow detect and debug split lock issues and extend the code base to handle split lock with different policies (panic, disable split lock, maybe other options) in the future? Thanks. -Fenghua