Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp3627043imm; Tue, 29 May 2018 10:27:15 -0700 (PDT) X-Google-Smtp-Source: AB8JxZqaz3xli8ADbv3oZEJz0TaFjWbTipf74ZWhOvfyP73AocPIBgoqlDCOLzHbSO+sHofgB/Ew X-Received: by 2002:a62:581:: with SMTP id 123-v6mr18320800pff.38.1527614835674; Tue, 29 May 2018 10:27:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1527614835; cv=none; d=google.com; s=arc-20160816; b=q/qYCbm6Jt+Mky7VBTUlzY7GLWIaXyYLe95eem2Pc2lQX0rE/7oOpRwBdnTXOYzhSa QhO3XnhiWPJXAvEyeGSAY3Zkz0wpQnM6uqBG74zoK1mfCZjswPqnSkyL4rO58F1ORrOl fZ46ZpS8cbD1oovSRSI+4kJIanOpqYEDfLJObegcaREnOQ9VF+4ThaWixX04zB1Mmy9y 5DetLF7RE4aqMoQNq8RyW9TXUrv+JEVe37arXFaAksOEMQ9jiiE+txyWY/f7aM989Xfe MB/c2FboCd6ThmAA9Qil8ZeXpzLD45igsfCwMHVIkm/rjafnqq5E3L4FIDIdFCA10v/S SQ4g== 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=XfA09LfIW2NpjwUve05ZsA0GwefapI/jTVn3DMlg0Uk=; b=tylpH+uRri4vCwd8cRyqApM2QDjRwzgi56FJbZAmk7zmDEmYJgpbJWLmirHTqQ69UT USCc5eJSOOrw+7NyI0LBuBx6qojXuhe9/+4nI44kFxSzErxlqHGZl1e3ElRu38vf6yYH pBMPTowvkZ/xdAAZdUfmYLQwZIWQgkno5V9Bt37Mhrt67ZrjxnS6hgtfR0DLnWPEL1e+ WUMcKI2jrNT5D2wCKTXpRNnONy7HDHElBbpzKFgkhY+65Y41/HYMqiQLGBnczrGXyc7g CnHq0rMseFtxlWIvIO9H16YCsWF9GY9qmPnvZ6dpXMI6zl0qOZkBQJaDE/5emhURunho aOeg== 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 a24-v6si8985485pgw.213.2018.05.29.10.27.01; Tue, 29 May 2018 10:27:15 -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 S965452AbeE2RZI (ORCPT + 99 others); Tue, 29 May 2018 13:25:08 -0400 Received: from mga14.intel.com ([192.55.52.115]:36070 "EHLO mga14.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S965424AbeE2RZH (ORCPT ); Tue, 29 May 2018 13:25:07 -0400 X-Amp-Result: UNKNOWN X-Amp-Original-Verdict: FILE UNKNOWN X-Amp-File-Uploaded: False Received: from orsmga001.jf.intel.com ([10.7.209.18]) by fmsmga103.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 29 May 2018 10:25:06 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.49,457,1520924400"; d="scan'208";a="60076865" Received: from romley-ivt3.sc.intel.com ([172.25.110.60]) by orsmga001.jf.intel.com with ESMTP; 29 May 2018 10:25:06 -0700 Date: Tue, 29 May 2018 10:25:13 -0700 From: Fenghua Yu To: Dave Hansen Cc: Fenghua Yu , Thomas Gleixner , Ingo Molnar , "H. Peter Anvin" , Ashok Raj , Rafael Wysocki , Tony Luck , Alan Cox , Ravi V Shankar , Arjan van de Ven , linux-kernel , x86 Subject: Re: [RFC PATCH 00/16] x86/split_lock: Enable #AC exception for split locked accesses Message-ID: <20180529172511.GA212416@romley-ivt3.sc.intel.com> References: <1527435965-202085-1-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 Tue, May 29, 2018 at 09:39:01AM -0700, Dave Hansen wrote: > On 05/27/2018 08:45 AM, Fenghua Yu wrote: > > ==Detect Split Lock== > > > > To detect split lock, a new control bit (bit 29) in per-core TEST_CTL > > MSR 0x33 will be introduced in future x86 processors. When the bit 29 > > is set, the processor causes #AC exception for split locked accesses at > > all CPL. > > > > The bit 29 specification in MSR TEST_CTL is published in the latest > > Intel Architecture Instruction Set Extensions and Future Features > > Programming Reference. > > The fact that this is per-core is pretty important, right? Where does > that get mentioned? The fact that TEST_CTL is per-core is NOT mentioned in the Instruction Set Extensions or SDM. (By the way, ISE and SDM don't mention other important details, e.g. the fact that operand is fetched to cache before split lock is checked. Without the fact, it's hard to explain that only split lock generates bus lock in chapter 8.1.4 in SDM vol3.) I was told that TEST_CTL is per-core by the split lock hardware designer. And I do find that the MSR is per-core on the currently only processor that has split lock implementation. As you can see handling per-core TEST_CTL needs consideration of locking (in patch2). But the code is supposed to work even if TEST_CTL is per-thread (or even per-socket) in future. Maybe I can add "Current TEST_CTL implementation is per-core. The patches are supposed to work even when TEST_CTL is per-thread (or even per- socket) in future as well."? Thanks. -Fenghua