Received: by 2002:a05:6a10:c604:0:0:0:0 with SMTP id y4csp86396pxt; Wed, 4 Aug 2021 06:32:27 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx+jIbcRKKeM5aIz4zOPrWZ99835qOCSvqcOjQkRwC6mvgh6NvpHbFTCw9d+B2TTt0kdjn4 X-Received: by 2002:a05:6602:1790:: with SMTP id y16mr442890iox.12.1628083947573; Wed, 04 Aug 2021 06:32:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1628083947; cv=none; d=google.com; s=arc-20160816; b=WQ5/EnhmmJiI+QUcx7GZZBhuhnUeWUoYpEd6hmM2kfrsExol2XIBiyuonyqeTk/QSP ub0PRvA1xOd//XLpurgZ0W6QXygxIiteDvSkCQxsTyu7vf5tAxz0hiwzVWqw3aXZGKku aQr2Z/z82OprpCLlOrLMfp2OxCKN9/M7RJnCDO9JIjymU7HvtuaizjG+HgT5CJJ6sZNh Eec4X36DOuIy7npJFSr8xa51M95quHpfYLdiOZoUcmmWbaiAB+J1+tXQAgRFZSuzWVdJ nfUYJuhl+r4pLMaBb8Tsa8JAaXpQqdvwoUKLxlnx26jYhXg7qqFKl7jNUR5M2bqL0fjK d3AA== 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=Nkb/72Yala+eTU54cegs5bW6fYqKpGJitAnXLiCjS1E=; b=mESDJQSLEIwXPJIIBzy1afVhaNIwsKyjJ/UYWnTHwksSlzD4gL7P2GCbSlWJLqL/7G ihT7cCQto5wlrHshGN+CaDhIGyaCequ6ruYZ5VoK+BF2dutHu8zYeHJItIFs3c5tK8al A6gZkA3Bz4IjsKS5fN0wJ65A41t4aR2rdXob591m42/JzDtjOJIrLMG2mUp8KQTDzt+q evS7X9+1f3E/7BjV5/U3UHipqa5fwHs8llNHbGAh5PHPJU/QQFFV9fMRuU50+2tgqPMM m7KOlH0e/h7qxmwaXgsEgMzRBA+h6L+Da9PS5yBLIDV5lh7ErkD+B+7i9somSf8wd/aA t40w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b="C1/IsNAK"; 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 t5si2557482ile.92.2021.08.04.06.32.13; Wed, 04 Aug 2021 06:32:27 -0700 (PDT) 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=casper.20170209 header.b="C1/IsNAK"; 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 S237941AbhHDNEB (ORCPT + 99 others); Wed, 4 Aug 2021 09:04:01 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34980 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237040AbhHDND7 (ORCPT ); Wed, 4 Aug 2021 09:03:59 -0400 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2EA04C0613D5; Wed, 4 Aug 2021 06:03:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; 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=Nkb/72Yala+eTU54cegs5bW6fYqKpGJitAnXLiCjS1E=; b=C1/IsNAKPp/DB65EqmxyI4aBBT M7p7NiRZnGd9uXsgKe1CSlz08nIJeVgsxB0+cJc08sSjlHfApTWm/LSKPLup0K9oxIoOcYyao7GbB 85w1Db3cM+aTydWkrVQcJoTdN+Zh/4aZf6UEddcs/tMZFCfC4FfC5JcaOuh03Y5Huah7CJQQNRw4L MffjRLZj5cginhSHRkJSBPl8KDVOQ5xDf4LGe7BH7M6lUtWc+aMT+dxPgrlnYGEeJkSo63MLT1k+C UXEsTPep0KFCXWV4alpJFh3wHpGgmcliFTsk5CnSKlmIm4J7QmWiwzMMA331mEfHx9sAzwgZX9k9V a0bH7gfw==; Received: from j217100.upc-j.chello.nl ([24.132.217.100] helo=worktop.programming.kicks-ass.net) by casper.infradead.org with esmtpsa (Exim 4.94.2 #2 (Red Hat Linux)) id 1mBGXc-005rRv-Pe; Wed, 04 Aug 2021 13:02:40 +0000 Received: by worktop.programming.kicks-ass.net (Postfix, from userid 1000) id DF6F89862B0; Wed, 4 Aug 2021 15:02:34 +0200 (CEST) Date: Wed, 4 Aug 2021 15:02:34 +0200 From: Peter Zijlstra To: Liam Merwick Cc: Like Xu , Joerg Roedel , Ingo Molnar , Arnaldo Carvalho de Melo , Mark Rutland , Alexander Shishkin , Jiri Olsa , Namhyung Kim , Thomas Gleixner , Borislav Petkov , x86@kernel.org, "H . Peter Anvin" , linux-perf-users@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v2] perf/x86/amd: Don't touch the AMD64_EVENTSEL_HOSTONLY bit inside the guest Message-ID: <20210804130234.GE8057@worktop.programming.kicks-ass.net> References: <20210802070850.35295-1-likexu@tencent.com> <20210804112854.lmizhfddz3qgli7t@oracle.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210804112854.lmizhfddz3qgli7t@oracle.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Aug 04, 2021 at 12:28:54PM +0100, Liam Merwick wrote: > On (08/02/21 15:08), Like Xu wrote: > > From: Like Xu > > > > If we use "perf record" in an AMD Milan guest, dmesg reports a #GP > > warning from an unchecked MSR access error on MSR_F15H_PERF_CTLx: > > > > [] unchecked MSR access error: WRMSR to 0xc0010200 (tried to write > > 0x0000020000110076) at rIP: 0xffffffff8106ddb4 (native_write_msr+0x4/0x20) > > [] Call Trace: > > [] amd_pmu_disable_event+0x22/0x90 > > [] x86_pmu_stop+0x4c/0xa0 > > [] x86_pmu_del+0x3a/0x140 > > > > The AMD64_EVENTSEL_HOSTONLY bit is defined and used on the host, > > while the guest perf driver should avoid such use. > > > > Fixes: 1018faa6cf23 ("perf/x86/kvm: Fix Host-Only/Guest-Only counting with SVM disabled") > > Signed-off-by: Like Xu > > Tested-by: Kim Phillips > > Reviewed-by: Liam Merwick > Tested-by: Liam Merwick > [ Patch applied to a 5.4 branch ] > > Should it also include > > Cc: stable@vger.kernel.org An accurate Fixes tag is usually sufficient to trigger the stable robots. Anyway, thanks!