Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp1723249pxj; Wed, 19 May 2021 12:21:15 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxpA1ZhL2TTjX4iFRlHHNIf9QcOB1wrPKs8MwKnzoMZOtmJm2g7FMFyB8IzWT4Qb2Omw50p X-Received: by 2002:a02:354c:: with SMTP id y12mr724800jae.144.1621452075762; Wed, 19 May 2021 12:21:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1621452075; cv=none; d=google.com; s=arc-20160816; b=hszbD5jniorYoMBnQ+bEKWk4pnxe6AlfvkjfH21M/KZ/kW/owR4Eb3FQEfGZZZQODk MDJp5WmIZUUpsAQ26cPD69bNrcdCFXqkMaNT3LJEoBOPeXXVKE0sYNs5eMkGS836wF7U +fIagOyK/k+DWn1+85t73bq37jGy4Qy0sErpMpAubJVH9Qbp5+ZNUeh7GIwfTSULE4FL fuN9G+FUlep2qsqBLfFdn1JZx6UnM7UeHYC9f5NZ3GAZ/VyCBcILeE9nNMhDUIILRV5t GpaQIHQZrpXSbEuD0/gZY/BFLO7elwQ5Ylsijt5GTznWds5dWmUA/A2BdNG23ygEFBQ7 ebNA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:robot-unsubscribe :robot-id:message-id:mime-version:references:in-reply-to:cc:subject :to:reply-to:sender:from:dkim-signature:dkim-signature:date; bh=CrBKEcQb2rwqfg9yK1W+KxlHz6+lnpZ+OHOEme6w4wk=; b=xVvZ/wQ5x51dqkr5Cs4+IRg4+7UrjzHMHSEvLXGRWys+1dpoosFe64eTenxGTJWO1q BnT3xefchVWue22XKjSJ4HhLCDvSjLoY3g4Z2rEGKyFlqBJOB1mUIWzcCmEfCvfXuh9M TQVrPe0hkXa+9Cnv3vNuFjFCKPpU1bsvoKPN/PRv+mD8ZGwuzlhts/ICXp4VyLo3zsDn AkbM3dFcgVulR25H3nDen9JiI9jNG5JHTYwfRJX6FZlATb/z3QhPDG4A9A53cHuWSyH3 1VQoxgIVUTEM94LnQflbbdaREf8ec9GU95MVOgLLAs9Hvb/eP+V81czO04cXYWKmuo55 lkew== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=q1lKjv3+; dkim=neutral (no key) header.i=@linutronix.de; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id h1si477992ilo.49.2021.05.19.12.21.01; Wed, 19 May 2021 12:21:15 -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=@linutronix.de header.s=2020 header.b=q1lKjv3+; dkim=neutral (no key) header.i=@linutronix.de; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S243518AbhESIEO (ORCPT + 99 others); Wed, 19 May 2021 04:04:14 -0400 Received: from Galois.linutronix.de ([193.142.43.55]:37324 "EHLO galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S242061AbhESIEM (ORCPT ); Wed, 19 May 2021 04:04:12 -0400 Date: Wed, 19 May 2021 08:02:52 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1621411372; h=from:from:sender:sender:reply-to: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:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=CrBKEcQb2rwqfg9yK1W+KxlHz6+lnpZ+OHOEme6w4wk=; b=q1lKjv3+l1KPV8tLU9L8Th1tvcXjYG4uECoTfvvpcRAOuog/gujwu1Swv32mR7MR8IfHo5 6Gje/NtWuryCtSOhPCEL5aMUxqj/wHrFFGwCMQ9LG8ItwUf+p5SJBj5pwy6woPNi5jGliK xFL7REVp9ClwWl8lXfllchRggUG6GOtNdC423r6KcIGdkInyatZPXMebkybZHmyvEbEgg8 9J1ns2ZjaVuzez/dkUczcFSRjGOkS0HVZCPvkQAvnKdwuswK9TiTCrfLicpSef3F9cSLFH 6KTbCH5InhOF7TidVoceN/QIeza1B1Z28Rb4e5BAnO0Nz0lZI+sStFhoO1qZEg== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1621411372; h=from:from:sender:sender:reply-to: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:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=CrBKEcQb2rwqfg9yK1W+KxlHz6+lnpZ+OHOEme6w4wk=; b=oSUNXPUMDqiLYyb7M/U2zKHuxDHdZq7J6XVUTHifVVbmqiVFV8rhNsyfHrGJNT30KZCmqi JWQMjxTiXsFXRKBw== From: "tip-bot2 for Like Xu" Sender: tip-bot2@linutronix.de Reply-to: linux-kernel@vger.kernel.org To: linux-tip-commits@vger.kernel.org Subject: [tip: perf/urgent] perf/x86: Avoid touching LBR_TOS MSR for Arch LBR Cc: Like Xu , "Peter Zijlstra (Intel)" , x86@kernel.org, linux-kernel@vger.kernel.org In-Reply-To: <20210430052247.3079672-1-like.xu@linux.intel.com> References: <20210430052247.3079672-1-like.xu@linux.intel.com> MIME-Version: 1.0 Message-ID: <162141137216.29796.11868187906649777826.tip-bot2@tip-bot2> Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The following commit has been merged into the perf/urgent branch of tip: Commit-ID: 3317c26a4b413b41364f2c4b83c778c6aba1576d Gitweb: https://git.kernel.org/tip/3317c26a4b413b41364f2c4b83c778c6aba1576d Author: Like Xu AuthorDate: Fri, 30 Apr 2021 13:22:46 +08:00 Committer: Peter Zijlstra CommitterDate: Tue, 18 May 2021 12:53:47 +02:00 perf/x86: Avoid touching LBR_TOS MSR for Arch LBR The Architecture LBR does not have MSR_LBR_TOS (0x000001c9). In a guest that should support Architecture LBR, check_msr() will be a non-related check for the architecture MSR 0x0 (IA32_P5_MC_ADDR) that is also not supported by KVM. The failure will cause x86_pmu.lbr_nr = 0, thereby preventing the initialization of the guest Arch LBR. Fix it by avoiding this extraneous check in intel_pmu_init() for Arch LBR. Fixes: 47125db27e47 ("perf/x86/intel/lbr: Support Architectural LBR") Signed-off-by: Like Xu [peterz: simpler still] Signed-off-by: Peter Zijlstra (Intel) Link: https://lkml.kernel.org/r/20210430052247.3079672-1-like.xu@linux.intel.com --- arch/x86/events/intel/core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/x86/events/intel/core.c b/arch/x86/events/intel/core.c index 2521d03..e288922 100644 --- a/arch/x86/events/intel/core.c +++ b/arch/x86/events/intel/core.c @@ -6253,7 +6253,7 @@ __init int intel_pmu_init(void) * Check all LBT MSR here. * Disable LBR access if any LBR MSRs can not be accessed. */ - if (x86_pmu.lbr_nr && !check_msr(x86_pmu.lbr_tos, 0x3UL)) + if (x86_pmu.lbr_tos && !check_msr(x86_pmu.lbr_tos, 0x3UL)) x86_pmu.lbr_nr = 0; for (i = 0; i < x86_pmu.lbr_nr; i++) { if (!(check_msr(x86_pmu.lbr_from + i, 0xffffUL) &&