Received: by 2002:a6b:500f:0:0:0:0:0 with SMTP id e15csp5189499iob; Mon, 9 May 2022 10:30:17 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzYkCXXtmNAGue2GfmDF4i1TFg+8bfKHrx+Xc9GSmMuxZbHyWy+WCxyfg95z/F6jwf0v9jR X-Received: by 2002:a05:6870:eca6:b0:ed:5b3a:4645 with SMTP id eo38-20020a056870eca600b000ed5b3a4645mr11140452oab.133.1652117417504; Mon, 09 May 2022 10:30:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1652117417; cv=none; d=google.com; s=arc-20160816; b=bpptoP0Dtltl+YtmU5bEqvLB0vJBstPMcoXe7OBjgm9sekoA/SDC4ncl7tqFK5fNH1 Rt/4ESj4fYMUYz0JxTytaQPUIuARzM7fI7fGPIn3dvCJhX0VhhNH8fzPSbTA7dkiGuio chsdSdY/SpznrIgiC3rRJUI3Ok1Ro7e/rttTtzXftYkNxdQu3X3qWgZPozPHEqkcdOL7 66PoPBwgHBPx+S291EyoBI2yqeMUMhCkFTXmfU9uoFiKflvc9qkhepMjKyPyazcB9HPb TAWncSRPAMxNAonV5B2cI8GtnC/wiOmP5hVLDYA5IXMrOUVBR6C/iMHReBNmHH//Rz/X VHZg== 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=V1LS1QEiQOXk1nD6e3KIIjZzOsEIXZHmrzx+BN61lQA=; b=L0TMV/91F0AuSE+Lf6kgpgpEqzP8xMegKhX9MIGqadGxNfejyNvWofgk6PxPP1EO4c 5NmOaTDpo5JX0iJwGaS70f/9goT4351RRtF6GrLxd7L/oGCGrY0M19e2D1UtcYvaVhZ3 dvCayxZ4QlQBYnSupZazes0NBZjPv8BU8EVcyRrdda8yao/bW3R6KvOMWS1sQ50JwHJy oERpoXaacwi8a2Xep5NKV7ieFWmMGEwAHCl5FUzLPMFNm+UZVE6TBjSM0IjBRWJn1qo3 2BT6chH3FsoKF/ft9YhNxINzkx6R7qbjkqsiULXZAZDUXN3Eyv9wmaT2XwEbH5Kc9bKU Kmig== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@alien8.de header.s=dkim header.b="SziSu/Et"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 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 lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id 2-20020a056870124200b000dfa9b5480fsi10240876oao.114.2022.05.09.10.30.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 09 May 2022 10:30:17 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@alien8.de header.s=dkim header.b="SziSu/Et"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=alien8.de Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 69C5327A885; Mon, 9 May 2022 10:24:20 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239582AbiEIR17 (ORCPT + 99 others); Mon, 9 May 2022 13:27:59 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38516 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233396AbiEIR16 (ORCPT ); Mon, 9 May 2022 13:27:58 -0400 Received: from mail.skyhub.de (mail.skyhub.de [5.9.137.197]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F0BFC277358; Mon, 9 May 2022 10:24:03 -0700 (PDT) Received: from zn.tnic (p5de8eeb4.dip0.t-ipconnect.de [93.232.238.180]) (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 1156D1EC03AD; Mon, 9 May 2022 19:23:58 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=alien8.de; s=dkim; t=1652117038; 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=V1LS1QEiQOXk1nD6e3KIIjZzOsEIXZHmrzx+BN61lQA=; b=SziSu/EtPEM5gpBQSwowNcxKDpdeyMTKKBMlEZSkxGwEUEjpbd6FS4Ew4OlpuuprwWpq02 lRb7j+63DqIDqAaGIdxDrx2N5L0W2ODNvwEH0YNqFQsm4ZD01iZOO0OQjFGBfoRNBSC3en lCgfmD4XZOyke3R6Fi/l/0FfY+2d4Mo= Date: Mon, 9 May 2022 19:24:00 +0200 From: Borislav Petkov To: Sandipan Das Cc: linux-tip-commits@vger.kernel.org, Vasant Hegde , Sandipan Das , "Peter Zijlstra (Intel)" , x86@kernel.org, linux-kernel@vger.kernel.org Subject: Re: [tip: perf/core] kvm: x86/cpuid: Fix CPUID leaf 0xA Message-ID: References: <165126412838.4207.9648561218200979307.tip-bot2@tip-bot2> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <165126412838.4207.9648561218200979307.tip-bot2@tip-bot2> X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no 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 Fri, Apr 29, 2022 at 08:28:48PM -0000, tip-bot2 for Sandipan Das wrote: > The following commit has been merged into the perf/core branch of tip: > > Commit-ID: fafd15ab6dc1fdfff66908e6d9231b124e1875cf > Gitweb: https://git.kernel.org/tip/fafd15ab6dc1fdfff66908e6d9231b124e1875cf > Author: Sandipan Das > AuthorDate: Thu, 21 Apr 2022 11:16:59 +05:30 > Committer: Peter Zijlstra > CommitterDate: Fri, 29 Apr 2022 11:06:27 +02:00 > > kvm: x86/cpuid: Fix CPUID leaf 0xA > > On some x86 processors, CPUID leaf 0xA provides information > on Architectural Performance Monitoring features. It > advertises a PMU version which Qemu uses to determine the > availability of additional MSRs to manage the PMCs. > > Upon receiving a KVM_GET_SUPPORTED_CPUID ioctl request for > the same, the kernel constructs return values based on the > x86_pmu_capability irrespective of the vendor. > > This leaf and the additional MSRs are not supported on AMD > processors. If PerfMonV2 is detected, the PMU version is > set to 2 and guest startup breaks because of an attempt to > access a non-existent MSR. Return zeros to avoid this. > > Fixes: a6c06ed1a60a ("KVM: Expose the architectural performance monitoring CPUID leaf") > Reported-by: Vasant Hegde > Signed-off-by: Sandipan Das > Signed-off-by: Peter Zijlstra (Intel) > Link: https://lkml.kernel.org/r/54bc7fe4cadf6bdef823bab1fba43d4891d2e1a9.1650515382.git.sandipan.das@amd.com > --- > arch/x86/kvm/cpuid.c | 6 ++++++ > 1 file changed, 6 insertions(+) > > diff --git a/arch/x86/kvm/cpuid.c b/arch/x86/kvm/cpuid.c > index b24ca7f..ae1d963 100644 > --- a/arch/x86/kvm/cpuid.c > +++ b/arch/x86/kvm/cpuid.c > @@ -887,6 +887,12 @@ static inline int __do_cpuid_func(struct kvm_cpuid_array *array, u32 function) > union cpuid10_eax eax; > union cpuid10_edx edx; > > + if (boot_cpu_data.x86_vendor == X86_VENDOR_AMD || > + boot_cpu_data.x86_vendor == X86_VENDOR_HYGON) { > + entry->eax = entry->ebx = entry->ecx = entry->edx = 0; > + break; > + } > + This is all fine and dandy but this patch in tip conflicts with the very similar patch of yours: 5a1bde46f98b ("kvm: x86/cpuid: Only provide CPUID leaf 0xA if host has architectural PMU") which is already upstream. So which is it? Should we zap this version in tip instead? -- Regards/Gruss, Boris. https://people.kernel.org/tglx/notes-about-netiquette