Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp498961ybl; Wed, 29 Jan 2020 04:33:56 -0800 (PST) X-Google-Smtp-Source: APXvYqySK4H8L429BCHufjB2X8IZGUH4OGEvBZ2/wq32tzJs54L4HBmgQjEWAFOWQfvORIkUx72+ X-Received: by 2002:a54:448b:: with SMTP id v11mr6055529oiv.74.1580301236316; Wed, 29 Jan 2020 04:33:56 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1580301236; cv=none; d=google.com; s=arc-20160816; b=buGulX5tqw3dyyRbyVBI74vZC36qvm210WKFH7slv+parKyHnbX+3JtOhiE+XU2fjp 5Don7nih86kP0tpJxonxTLfXsg+eW7fdcaWEtH2/IJEkuE8q+VwSfOzmejskigXNH+pb ADiddCHBBN6Tkt872abF9I6kxro8jrRaSolYGpjcC3oPaZiN7xZbovi6AXlRhb3DhGyL 4emD2h7Ow5YyF7w8msQdY9ic5/qZTjlrp8xQdG2OxjDJD/HINECI6YfLDj+MBc1j7m3o r3H6NAvrWK+MjVADoi1QU03p8xATHEC/xCruppZo9VbxEVQlwK26qb4FVrz6cA4Dhnsj KAlw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:message-id:date:references :in-reply-to:subject:cc:to:from; bh=Zqx+2JRj2YiY6aLBNjMSmD7mbvUtcjZKdlmHf8qZVnw=; b=uvGs5oETj8gI79nS/8Zi2WjlV1hnEDg3munhAHtrxbNctcHtS977IbGVhYHjolwQDh VmLbr0YE3tMlUnhuU1vYSUFLsG61i+yd54I1x6oJckfIdQoC63K6uqLmXGdmBtlI4wx4 cwrdH+NNDzTZ5XJpi7YZt0XaWqrQVqo0LvfShshxy6To4t1Eq4FVLvwZej5WU9P8/aJ7 ad6t4pax35UZ202d1vrucFE26f0LobIdCFs8beZhoKMjdhN5XKNf0PFMd7+h5TS1VIxv tRuodOVITksXR47mj/8P6s4n9l5QFb0r3cbOnHc+sZ22NcKl61ZLz+wn9MypKf3UON5T p9Fw== 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 n14si937504otk.179.2020.01.29.04.33.43; Wed, 29 Jan 2020 04:33:56 -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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726385AbgA2Mbg (ORCPT + 99 others); Wed, 29 Jan 2020 07:31:36 -0500 Received: from Galois.linutronix.de ([193.142.43.55]:51279 "EHLO Galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726128AbgA2Mbg (ORCPT ); Wed, 29 Jan 2020 07:31:36 -0500 Received: from konstanz.wlan.tk-bodensee.net ([185.80.169.68] helo=nanos.tec.linutronix.de) by Galois.linutronix.de with esmtpsa (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1iwmVA-0000Vy-Pq; Wed, 29 Jan 2020 13:31:25 +0100 Received: by nanos.tec.linutronix.de (Postfix, from userid 1000) id 0F5FC105CFD; Wed, 29 Jan 2020 13:31:24 +0100 (CET) From: Thomas Gleixner To: "Luck\, Tony" Cc: Mark D Rustad , Arvind Sankar , "Christopherson\, Sean J" , Peter Zijlstra , Ingo Molnar , "Yu\, Fenghua" , Ingo Molnar , Borislav Petkov , H Peter Anvin , "Raj\, Ashok" , "Shankar\, Ravi V" , linux-kernel , x86 Subject: Re: [PATCH v17] x86/split_lock: Enable split lock detection by kernel In-Reply-To: <20200126200535.GB30377@agluck-desk2.amr.corp.intel.com> References: <4E95BFAA-A115-4159-AA4F-6AAB548C6E6C@gmail.com> <8CC9FBA7-D464-4E58-8912-3E14A751D243@gmail.com> <20200126200535.GB30377@agluck-desk2.amr.corp.intel.com> Date: Wed, 29 Jan 2020 13:31:24 +0100 Message-ID: <87d0b24f6r.fsf@nanos.tec.linutronix.de> MIME-Version: 1.0 Content-Type: text/plain 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 "Luck, Tony" writes: > +static bool __sld_msr_set(bool on) > +{ > + u64 test_ctrl_val; > + > + if (rdmsrl_safe(MSR_TEST_CTRL, &test_ctrl_val)) > + return false; > + > + if (on) > + test_ctrl_val |= MSR_TEST_CTRL_SPLIT_LOCK_DETECT; > + else > + test_ctrl_val &= ~MSR_TEST_CTRL_SPLIT_LOCK_DETECT; > + > + return !wrmsrl_safe(MSR_TEST_CTRL, test_ctrl_val); > +} > + > +static void split_lock_init(void) > +{ > + if (sld_state == sld_off) > + return; > + > + if (__sld_msr_set(true)) > + return; > + > + /* > + * If this is anything other than the boot-cpu, you've done > + * funny things and you get to keep whatever pieces. > + */ > + pr_warn("MSR fail -- disabled\n"); > + __sld_msr_set(sld_off); This one is pretty pointless. If the rdmsrl or the wrmsrl failed, then the next attempt is going to fail too. Aside of that sld_off would be not really the right argument value here. I just zap that line. Thanks, tglx