Received: by 2002:a05:6a10:1a4d:0:0:0:0 with SMTP id nk13csp6514684pxb; Tue, 15 Feb 2022 04:15:06 -0800 (PST) X-Google-Smtp-Source: ABdhPJxmYuVLYGC3tAaXVPKLmgxpZwDvHEBQiIqRFl6mDjpBwT1pGAyFwC7Mi+B3B1ULLTThPVTG X-Received: by 2002:a17:90b:17ca:b0:1b9:90f5:3c9c with SMTP id me10-20020a17090b17ca00b001b990f53c9cmr3981302pjb.233.1644927306006; Tue, 15 Feb 2022 04:15:06 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1644927306; cv=none; d=google.com; s=arc-20160816; b=PhFy0kizxdikZ5FCli4AseibbVBgJ3RlNcVv2tPSjp84a0+MVdpeyx1bif6mtl62oO HqJC2xM2YA9zIzmmXFQjNyqXI0IeIpsNaYLNyMsOx2NzlgYHYCoxDLi1JXkuFua3cBMX ldWX8XRR2F7dHs6CcjlegGrqCnLgJGEdG6aEhXNe4Q0omIewQzhV+aw+JH9nhgyNMkhR pypAaV7OIym0HYm8u4UJijmEhDY8KyBAJVWJSVaQWzELtwcAWZu9IEZlDRrvLGZHbS+l GV5D2dueVgu/4Hi3UXGNY6NBgV7ybhHNfJKFuRAKjSbGE6+i+7a99Ea8/Y0rUs7cmvqQ 8qKw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=YMEDspMueOD9ny1l4hFIylPEZFOXYFx2U0095V28zwk=; b=MSdEDTJea2FeqdJIIM0WMAj95VfYG1kQgE0ghh1AJ9tPNCzRfo4mmXXRbloDME2OAv zpz7i8a8Pyng3ymrqfMHTmGL+c7sH//W3V/W6QSwBxATo4u41A/G5xvWz1qvKjT8BNL+ 46j/CiOQvbCFoGHaXrrqOrp8KNxZVoQsCWPsPTcibtr3zom60yPjoFuJHbd3sfQDFpTg Bh4C/F+zvhpXaChOc310izfToEmwP3MmoG3kGniT3TDoDcqsk0L2iHZsSFKcuND3z9c9 UV6i4Hg4+NxXqLXM0xsGDrjBF2abaKZnJKE+kI5pCPZ5Yb4CV8ukNY/FFx5YdAPRNF4Z v7zg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@alien8.de header.s=dkim header.b=P5Vdaizq; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=alien8.de Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id q8si17278976plx.478.2022.02.15.04.14.52; Tue, 15 Feb 2022 04:15:05 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@alien8.de header.s=dkim header.b=P5Vdaizq; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=alien8.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236451AbiBOKYR (ORCPT + 99 others); Tue, 15 Feb 2022 05:24:17 -0500 Received: from mxb-00190b01.gslb.pphosted.com ([23.128.96.19]:40526 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234641AbiBOKYQ (ORCPT ); Tue, 15 Feb 2022 05:24:16 -0500 Received: from mail.skyhub.de (mail.skyhub.de [5.9.137.197]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A905022B3E for ; Tue, 15 Feb 2022 02:24:04 -0800 (PST) Received: from zn.tnic (dslb-088-067-221-104.088.067.pools.vodafone-ip.de [88.67.221.104]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.skyhub.de (SuperMail on ZX Spectrum 128k) with ESMTPSA id 1F98B1EC053C; Tue, 15 Feb 2022 11:23:59 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=alien8.de; s=dkim; t=1644920639; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:in-reply-to:in-reply-to: references:references; bh=YMEDspMueOD9ny1l4hFIylPEZFOXYFx2U0095V28zwk=; b=P5VdaizqzMiRFWOmyV4HlFBxmzoca+iGR2xKTrDbb3xERvDfbywq8DlOoPUgBkLrA3vZQo 9PmoGaHkWXGKFUkoukVszGXGu8kM3R3mmOXDf50vn9KU/CYcGSJgjSR6LB9YqBgEP8hfwi Y24GQTXajM+Awd7RPS/4WbQ8IWrcKJY= Date: Tue, 15 Feb 2022 11:24:01 +0100 From: Borislav Petkov To: Pawan Gupta Cc: Thomas Gleixner , Ingo Molnar , Dave Hansen , x86@kernel.org, "H. Peter Anvin" , Andi Kleen , Tony Luck , linux-kernel@vger.kernel.org, antonio.gomez.iglesias@linux.intel.com, neelima.krishnan@intel.com, stable@vger.kernel.org Subject: Re: [PATCH] x86/tsx: Use MSR_TSX_CTRL to clear CPUID bits Message-ID: References: <5bd785a1d6ea0b572250add0c6617b4504bc24d1.1644440311.git.pawan.kumar.gupta@linux.intel.com> <20220214224121.ilhu23cfjdyhvahk@guptapa-mobl1.amr.corp.intel.com> <20220215002014.mb7g4y3hfefmyozx@guptapa-mobl1.amr.corp.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20220215002014.mb7g4y3hfefmyozx@guptapa-mobl1.amr.corp.intel.com> X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Feb 14, 2022 at 04:20:14PM -0800, Pawan Gupta wrote: > ... we are calling tsx_clear_cpuid() unconditionally. I know, that's why I asked... > > If those CPUs which support only disabling TSX through MSR_IA32_TSX_CTRL > > but don't have MSR_TSX_FORCE_ABORT - if those CPUs set > > X86_FEATURE_RTM_ALWAYS_ABORT too, then this should work. ... this^^. IOW, what are you fixing here exactly? Let's look at the two callsites of tsx_clear_cpuid(): 1. tsx_init: that will do something on X86_FEATURE_RTM_ALWAYS_ABORT CPUs. 2. init_intel: that will get called when tsx_ctrl_state == TSX_CTRL_RTM_ALWAYS_ABORT But TSX_CTRL_RTM_ALWAYS_ABORT gets set only when X86_FEATURE_RTM_ALWAYS_ABORT is set. I.e., the first case, in tsx_init(). So, IIUC, you wanna fix the case where CPUs which set X86_FEATURE_RTM_ALWAYS_ABORT but *don't* have MSR_TSX_FORCE_ABORT, those CPUs should still disable TSX through MSR_IA32_TSX_CTRL. Correct? -- Regards/Gruss, Boris. https://people.kernel.org/tglx/notes-about-netiquette