From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pf1-f202.google.com (mail-pf1-f202.google.com [209.85.210.202]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id D88372FB99A for ; Mon, 29 Dec 2025 23:57:23 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.202 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1767052645; cv=none; b=MLQKxQs5xywMyVZ6uWDT5MK6E9h+7Pt5tulZZFSUsbH38hEGwM/bSJmbchyIL9qop8zg0Fz4HCAN4E77adZgISBFoekheaPN0Sxm4mHzhm9BpLzXCkevfpi8VJk3OV8aJiRSVa9HoQt3ajXiK+kft97phHqWEsbM1u6iIURJmos= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1767052645; c=relaxed/simple; bh=XsdXtJjKqE4UQSylmLBTu+OUvPU6Hv2It+NLCukC3Fw=; h=Date:In-Reply-To:Mime-Version:References:Message-ID:Subject:From: To:Cc:Content-Type; b=MZFfq92WTOKF+0G5t5o34IjObqBMePqLoisyF0W6apIPSqFimUSmsC3RHtqJ7sIz3yZPDPzOUrlgeaGhlT1mRABX5evj7/ed6k7M4utR+bDic3poYO/o4/mok8a2M9Qoajh6aq3OJ0RwP6DvQW6fU0HmFSesu64G/DRBdcFvKz8= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com; spf=pass smtp.mailfrom=flex--seanjc.bounces.google.com; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b=iMGPdjGA; arc=none smtp.client-ip=209.85.210.202 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=flex--seanjc.bounces.google.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="iMGPdjGA" Received: by mail-pf1-f202.google.com with SMTP id d2e1a72fcca58-7b9090d9f2eso17965649b3a.0 for ; Mon, 29 Dec 2025 15:57:23 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1767052643; x=1767657443; darn=vger.kernel.org; h=content-transfer-encoding:cc:to:from:subject:message-id:references :mime-version:in-reply-to:date:from:to:cc:subject:date:message-id :reply-to; bh=vaCAmCD1pI2PB4kVDvq818qZSC88KaBTxMeyOFyVIUw=; b=iMGPdjGA1NQR/+V2pygPXYkbZKCeSUCbyCWckcMe8i7VNxbWAVUa0DKCkg38TNo7tk Ru3i/cn1OQoxpa0xQ49TLxtBOHnHNRREO8NvQ7HjzeGoi6v6RZQpaeEmqZxE5e64nBSZ YrSRWR2ntXcP7mf4h6b4eg4oqrVHgP9uArjOrSnD1WL8EdUgSSHTs6a2moDAC/wQAFu3 tMQXq7WnbGyu6mfiweCpH/5RmONrO0vVfezaB8e/MjA1I4WpUhzgm6sB0hytO8LJA7kw WHumsubJ1Io4LeLO1UDQ9auzlmIEu5kqdyuMefPSzpFaLA7o/aiGPUsxtXtFpQF5GWxZ vGZQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1767052643; x=1767657443; h=content-transfer-encoding:cc:to:from:subject:message-id:references :mime-version:in-reply-to:date:x-gm-message-state:from:to:cc:subject :date:message-id:reply-to; bh=vaCAmCD1pI2PB4kVDvq818qZSC88KaBTxMeyOFyVIUw=; b=CMgSR6CTJQxwn7P5n2M3fRVjBc1VRstBf9gelXo3ZEmr/k7aOdd2vc9qQKqIYqwc47 Mf3+vQVlg6IfFGBZ966aZ8sdZNNfsU4S9RDyJ2/O7CNUEtspFdfnJWergADPGUCkyVRF IoI82+HkHyo8ILHJnY+VrOIaFvtP90OpT6rdCExhCP2oHfz0uv4tYVAyaBgSo4ut5S0+ 4J4QQShpnPFCt5VRzBqxnDqIwru6khX2mkUa6YjA2sNI7wQTJrvLNFSOtbFFiuvqJ4Er bJJ1DAcAkTdL/V55O8mpk4Q6XTIgihPNU5p51LijLiP+7v99ggBDoj5XdWZY4zJQJEYg RHHw== X-Forwarded-Encrypted: i=1; AJvYcCWUV+mLssAj8aVFbg12NNxXnwZBDGsG5FXPbM3ZKXt/H1GqSR0IJTShh/b/MahDIobCZjQKm+qHamyL8xc=@vger.kernel.org X-Gm-Message-State: AOJu0YxJbHMAVucrGHzYQ1ignpv+mCx6azy4S9GTXK9qemNfFtq81v1m WLp3Qu2Kbm8xAxElJAqyRZwIDgaBK+HsBxL3RB7MKzGtEk71FrqzFX8wWcQQmWd657sIT7cyMwO uWypvPw== X-Google-Smtp-Source: AGHT+IGWSzvMBdAgSpc1cQ4FNAzud2F9vkcmbgsGWHl/uECW+mXFCBlsNw6jhBxprH27ZWhYhxw4eDFyKfA= X-Received: from pjhk89.prod.google.com ([2002:a17:90a:4ce2:b0:34c:1d76:2fe9]) (user=seanjc job=prod-delivery.src-stubby-dispatcher) by 2002:a05:6a20:9185:b0:343:af1:9a57 with SMTP id adf61e73a8af0-376aa8e98d6mr28981483637.56.1767052643109; Mon, 29 Dec 2025 15:57:23 -0800 (PST) Date: Mon, 29 Dec 2025 15:57:21 -0800 In-Reply-To: <43d1cde6-2277-4f3c-8e7d-59e6edb2228a@linux.intel.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 References: <20251206001720.468579-1-seanjc@google.com> <20251206001720.468579-16-seanjc@google.com> <43d1cde6-2277-4f3c-8e7d-59e6edb2228a@linux.intel.com> Message-ID: Subject: Re: [PATCH v6 15/44] KVM: x86/pmu: Snapshot host (i.e. perf's) reported PMU capabilities From: Sean Christopherson To: Dapeng Mi Cc: Marc Zyngier , Oliver Upton , Tianrui Zhao , Bibo Mao , Huacai Chen , Anup Patel , Paul Walmsley , Palmer Dabbelt , Albert Ou , Xin Li , "H. Peter Anvin" , Andy Lutomirski , Peter Zijlstra , Ingo Molnar , Arnaldo Carvalho de Melo , Namhyung Kim , Paolo Bonzini , linux-arm-kernel@lists.infradead.org, kvmarm@lists.linux.dev, kvm@vger.kernel.org, loongarch@lists.linux.dev, kvm-riscv@lists.infradead.org, linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org, linux-perf-users@vger.kernel.org, Mingwei Zhang , Xudong Hao , Sandipan Das , Xiong Zhang , Manali Shukla , Jim Mattson Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable On Thu, Dec 25, 2025, Dapeng Mi wrote: >=20 > On 12/6/2025 8:16 AM, Sean Christopherson wrote: > > Take a snapshot of the unadulterated PMU capabilities provided by perf = so > > that KVM can compare guest vPMU capabilities against hardware capabilit= ies > > when determining whether or not to intercept PMU MSRs (and RDPMC). > > > > Reviewed-by: Sandipan Das > > Tested-by: Xudong Hao > > Signed-off-by: Sean Christopherson > > --- > > arch/x86/kvm/pmu.c | 2 ++ > > 1 file changed, 2 insertions(+) > > > > diff --git a/arch/x86/kvm/pmu.c b/arch/x86/kvm/pmu.c > > index 487ad19a236e..7c219305b61d 100644 > > --- a/arch/x86/kvm/pmu.c > > +++ b/arch/x86/kvm/pmu.c > > @@ -108,6 +108,8 @@ void kvm_init_pmu_capability(const struct kvm_pmu_o= ps *pmu_ops) > > bool is_intel =3D boot_cpu_data.x86_vendor =3D=3D X86_VENDOR_INTEL; > > int min_nr_gp_ctrs =3D pmu_ops->MIN_NR_GP_COUNTERS; > > =20 > > + perf_get_x86_pmu_capability(&kvm_host_pmu); > > + > > /* > > * Hybrid PMUs don't play nice with virtualization without careful > > * configuration by userspace, and KVM's APIs for reporting supported >=20 > Hi Sean, >=20 > It looks a merging error here. We don't need this patch. Gah, right you are. I overlooked it because it didn't conflict on a rebase= , and I once again forgot to test on a hybrid PMU, grr. Thanks! > The original patch "51f34b1 ("KVM: x86/pmu: Snapshot host (i.e. perf's) > reported PMU capabilities")" had been merged into upstream and subsequent= ly > we submitted a new patch "034417c1439a ("KVM: x86/pmu: Don't try to get > perf capabilities for hybrid CPUs")" to fix the warning introduced from > previous patch=C2=A0 "51f34b1 ("KVM: x86/pmu: Snapshot host (i.e. perf's) > reported PMU capabilities")". Thanks. >=20 > -Dapeng Mi >=20 >=20