Received: by 2002:a05:6a10:af89:0:0:0:0 with SMTP id iu9csp3517606pxb; Mon, 24 Jan 2022 11:13:20 -0800 (PST) X-Google-Smtp-Source: ABdhPJzGM6OX5k6BmqptB3RKKmdt4wwbNnJXv7zkqJFY24FwbG/PTMkYJNG2Twvk8CRhI0y66ENg X-Received: by 2002:a17:90a:5d8d:: with SMTP id t13mr3315245pji.47.1643051600541; Mon, 24 Jan 2022 11:13:20 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1643051600; cv=none; d=google.com; s=arc-20160816; b=pbujHGCRQUMcN7u6QShX5E2zhzM6eNYxSKdD8VVHMzzmDuNs4ZVEf0nD9Us/EUsN5G br8nwY4WkFAkM2NJ7Jd2/kcDxtFkfm6rJjx6X34OmAnkZbjjV112jVox/S9vEm69dtGI 6R2oOb9d0EN5GS8MMHxSztZNF+R5nQtoa8ZTwooVLfp59iUJoitmoE0m9YvmNUeuM91L A2qdrS5lKibqrowRmqi/ntbjpCpiTnm+6yjJ0Un/ms4Ucjqe1xQPPMppMJ43eyMWMh6P tMuxVTkwPgfKLYdrDUscnvbO9kg4TN62GjIK69WuudQkMLbuxRxq+XVRHgvMk55j06o7 5AoQ== 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=usUI3XRHp3JiGsl+VkmrMKazICb5yORxOcpWOnXHZrk=; b=hwGXov/iW//6zclv6pww3w7Ipx3OfwpCwnotHFtBLgkhPTTvVnnqWf9IkLUXmSC18i ZZTq3ssbBsOcw5y5KqVIVpEQwi7CWnRZejnYnOHdaCNyDfbRKdcqWpBGvc0hH032BF0Q jR23lGDaghNQGlbR1vOx5BDjQQbgSwlwwfsV7FpciBjsngR8sXRSLfS2ecWDRIQ49v7Y vm8w2i0w0687mlQovqaXXrZ32Z47PRZ6I2Yap7JW/Hnq8RmOSa+8PHK4wXHc/1Z3qaZm bK4tMPX57S0vnC1KHAbg4TLs3XFXHlW0joRfCceeGoFeI5jTMAAmoZYqnHBa4ifcue1V wtag== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=desiato.20200630 header.b=MlClG8g2; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id j11si13448840plh.260.2022.01.24.11.13.07; Mon, 24 Jan 2022 11:13:20 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@infradead.org header.s=desiato.20200630 header.b=MlClG8g2; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239400AbiAXMWM (ORCPT + 99 others); Mon, 24 Jan 2022 07:22:12 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34964 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233181AbiAXMWK (ORCPT ); Mon, 24 Jan 2022 07:22:10 -0500 Received: from desiato.infradead.org (desiato.infradead.org [IPv6:2001:8b0:10b:1:d65d:64ff:fe57:4e05]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 69B2DC06173B; Mon, 24 Jan 2022 04:22:10 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=desiato.20200630; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=usUI3XRHp3JiGsl+VkmrMKazICb5yORxOcpWOnXHZrk=; b=MlClG8g2lp50xwDbbI11yIYH45 xbj9Jkem1145+AfyoUqS+iiKazgKF40qCbIWrZLqrslyRKUT5jUn/0ndcwJRxjYcdmwa+BQh+8Sn4 qbcqA806RlsKHAGWzs1ygY/puCt1TXLp/4UTjBC7sypJg0yCKwWrluoZc1FY6a5yCZylv2clqXqWX BA75wFe4lksdmOL/5wlZU/0pPDP8G4JV0oVeC5wZEF6nPh1m9x1FKVTvqxx5VavxsySJpUBDUcSsJ PuGS0+aDT8AMe1f5A/GOs7Rpsojgpd6t0ppV016Y93fgZGGaOfh/zZlLxZ1U/EPzGqi8OWHjTylG0 /7CAG3lg==; Received: from j217100.upc-j.chello.nl ([24.132.217.100] helo=noisy.programming.kicks-ass.net) by desiato.infradead.org with esmtpsa (Exim 4.94.2 #2 (Red Hat Linux)) id 1nByM5-0039Tl-Ns; Mon, 24 Jan 2022 12:21:53 +0000 Received: from hirez.programming.kicks-ass.net (hirez.programming.kicks-ass.net [192.168.1.225]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (Client did not present a certificate) by noisy.programming.kicks-ass.net (Postfix) with ESMTPS id 3DBC5300BA2; Mon, 24 Jan 2022 13:21:52 +0100 (CET) Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id E3D66201A6CC2; Mon, 24 Jan 2022 13:21:51 +0100 (CET) Date: Mon, 24 Jan 2022 13:21:51 +0100 From: Peter Zijlstra To: Kyle Huey Cc: linux-kernel@vger.kernel.org, Kan Liang , linux-perf-users@vger.kernel.org, "H. Peter Anvin" , x86@kernel.org, Dave Hansen , Borislav Petkov , Thomas Gleixner , Namhyung Kim , Jiri Olsa , Alexander Shishkin , Mark Rutland , Arnaldo Carvalho de Melo , Ingo Molnar , Robert O'Callahan , Keno Fischer Subject: Re: [PATCH] x86/perf: Default freeze_on_smi on for Comet Lake and later. Message-ID: References: <20220122072644.92292-1-khuey@kylehuey.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220122072644.92292-1-khuey@kylehuey.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Jan 21, 2022 at 11:26:44PM -0800, Kyle Huey wrote: > Beginning in Comet Lake, Intel extended the concept of privilege rings to > SMM.[0] A side effect of this is that events caused by execution of code > in SMM are now visible to performance counters with IA32_PERFEVTSELx.USR > set. > > rr[1] depends on exact counts of performance events for the user space > tracee, so this change in behavior is fatal for us. It is, however, easily > corrected by setting IA32_DEBUGCTL.FREEZE_WHILE_SMM to 1 (visible in sysfs > as /sys/devices/cpu/freeze_on_smi). While we can and will tell our users to > set freeze_on_smi manually when appropriate, because observing events in > SMM is rarely useful to anyone, we propose to change the default value of > this switch. > > In this patch I have assumed that all non-Atom Intel microarchitectures > starting with Comet Lake behave like this but it would be good for someone > at Intel to verify that. > Kan, can you look at that? > [0] See the Intel white paper "Trustworthy SMM on the Intel vPro Platform" > at https://bugzilla.kernel.org/attachment.cgi?id=300300, particularly the > end of page 5. > > [1] https://rr-project.org/ > > Signed-off-by: Kyle Huey Patch seems sensible enough; I'll go queue it up unless Kan comes back with anything troublesome.