From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pj1-f74.google.com (mail-pj1-f74.google.com [209.85.216.74]) (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 4FAFE36604E for ; Thu, 23 Apr 2026 15:03:50 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.216.74 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1776956631; cv=none; b=jGgL84J4DSLW13wnjjgFBykP6xGm74KKCly7iIb6b6OddGgg4zmDGrs3cxVaIGNuxkjYXVt22KMrFhHVQVCIL7BvGzrOxbdlFt0D4XpAl/5eSEOm7/NGROnA97/fhq3QNcaheIsxn12sA+KNCdK+Mt77ufSvBR7KO50w2hI8lAo= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1776956631; c=relaxed/simple; bh=Qq+a1DlHnsbnGt0qwZoOkE6eAMMyZT69FHNC3qdZqpA=; h=Date:In-Reply-To:Mime-Version:References:Message-ID:Subject:From: To:Cc:Content-Type; b=hx+mUdtcVF/j4ET0Wk3UdcNiwHUpSU1vpksoj+agGw12fD32R5IJANIShie1KGQ6tBmepb3Rp4PDOxvqH08Uru28G5lpajPfmf/LvDOMD1QUn8jop8AcL0OnwiKSXENV5Jlzyv18KjlrRiStiGassUXxoReGAVGZVD7eofA6lMY= 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=YuZZs/B1; arc=none smtp.client-ip=209.85.216.74 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="YuZZs/B1" Received: by mail-pj1-f74.google.com with SMTP id 98e67ed59e1d1-358e95e81aeso6941659a91.0 for ; Thu, 23 Apr 2026 08:03:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20251104; t=1776956630; x=1777561430; darn=vger.kernel.org; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:reply-to:from:to:cc:subject:date:message-id:reply-to; bh=Aj9Le9dSw7rMaT45LUpduHxRBjTdQmy+Rvmt2ooyxYY=; b=YuZZs/B1kl28xdh7IROcrI5qPNfRCKiTanK5eSe71mgY1tRaw/DSUsM3TB9d3zT3Sp XXs3+xBoh1PCXxEloBAdeRDMGQB2yEKrUnRud0fiSaTp7w6cVWuflGrxkfrLE6yA4CM5 rVKlJar0pPbT/NWdWx8sw+QCltfSLnTmg+YdDFytzqWhTmjXxz2oVLWojk5hXvNYUTZ0 CBf14XpJ3rnfphIC5iW6+E9+3Ymv7NPWr91F7LJKLqYgcsoCVP9x/oVQ8dphQnp22AbC /5qPP9sNobAqbUrOkKvNMKYIythBGA8gyAQdZ47DTB+u6H1vmJLf3bhHQmp/NoViRrv6 IAWg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1776956630; x=1777561430; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:reply-to:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=Aj9Le9dSw7rMaT45LUpduHxRBjTdQmy+Rvmt2ooyxYY=; b=VII8ckCPbsJ++4nhjjHWIlX0lcQs9oWO2n+RvxMJgPPC8NWGeEpVd/GJuGZp1SlNAe 9sy/mcTBlsOPOUeWz9G4kXFbmdRwkjJHOjjmwwc+/FETnuXga+dk4fAFfMrR91p/b0Co FpIlF7WmRffFoznhsZTJyeTutJKxFy1mwUUovRxkNuuR92Y5f+RgLoihsQknPNexCojB 5AaoqDHCiOsGJFRTDzmRfqKuNWHqeUyuecOQjyCSZ1LcyEWfqZ6jUjLNhggtRYI0MSib Dp+9XB1tR4VYXrx/+vxfBuq5A/r8Le6dzf5/v/5YxgEkWxK5p7WKRLaW/5+5sdLA2TxZ ioVA== X-Forwarded-Encrypted: i=1; AFNElJ86ig6mJRzG8uTqPMcGtxQFJlzK0NBkwH1YpksiGnoJHPNVGCeVMN4d8kIy62oxBOxo9fU=@vger.kernel.org X-Gm-Message-State: AOJu0YyLl7r6KKlw2Z4it8lODI9yHKpo0ODYjfuf9mb+1b3oVImyPIwj 96VBlcZbXlI1iY8DKcF35jECDTE2Q6bFNzpJSLwFXtu055VbQjA3UXB3AcUKrSTvQXjuh1LPaEm xig5naw== X-Received: from pfbho17.prod.google.com ([2002:a05:6a00:8811:b0:82f:7833:9aa9]) (user=seanjc job=prod-delivery.src-stubby-dispatcher) by 2002:a05:6a21:9996:b0:39b:bee4:2952 with SMTP id adf61e73a8af0-3a08d908020mr32339418637.45.1776956629325; Thu, 23 Apr 2026 08:03:49 -0700 (PDT) Reply-To: Sean Christopherson Date: Thu, 23 Apr 2026 08:03:39 -0700 In-Reply-To: <20260423150340.463896-1-seanjc@google.com> Precedence: bulk X-Mailing-List: kvm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 References: <20260423150340.463896-1-seanjc@google.com> X-Mailer: git-send-email 2.54.0.545.g6539524ca2-goog Message-ID: <20260423150340.463896-4-seanjc@google.com> Subject: [PATCH v2 3/4] perf/x86/intel: Make @data a mandatory param for intel_guest_get_msrs() From: Sean Christopherson To: Peter Zijlstra , Ingo Molnar , Arnaldo Carvalho de Melo , Namhyung Kim , Thomas Gleixner , Borislav Petkov , Dave Hansen , x86@kernel.org, Sean Christopherson , Paolo Bonzini Cc: linux-perf-users@vger.kernel.org, linux-kernel@vger.kernel.org, kvm@vger.kernel.org, Jim Mattson , Mingwei Zhang , Stephane Eranian , Dapeng Mi Content-Type: text/plain; charset="UTF-8" Drop "support" for passing a NULL @data/@kvm_pmu param when getting guest MSRs. KVM, the only in-tree user, unconditionally passes a non-NULL pointer, and carrying code that suggests @data may be NULL is confusing, e.g. incorrectly implies that there are scenarios where KVM doesn't pass a PMU context. Fixes: 8183a538cd95 ("KVM: x86/pmu: Add IA32_DS_AREA MSR emulation to support guest DS") Cc: Jim Mattson Cc: Mingwei Zhang Cc: Stephane Eranian Reviewed-by: Jim Mattson Signed-off-by: Sean Christopherson --- arch/x86/events/intel/core.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/arch/x86/events/intel/core.c b/arch/x86/events/intel/core.c index 407fd392fd46..7403ca721b6a 100644 --- a/arch/x86/events/intel/core.c +++ b/arch/x86/events/intel/core.c @@ -5038,11 +5038,11 @@ static struct perf_guest_switch_msr *intel_guest_get_msrs(int *nr, void *data) } /* - * If the guest won't use PEBS or the CPU doesn't support PEBS in the - * guest, then there's nothing more to do as disabling PMCs via - * PERF_GLOBAL_CTRL is sufficient on CPUs with guest/host isolation. + * If the CPU doesn't support PEBS in the guest, then there's nothing + * more to do as disabling PMCs via PERF_GLOBAL_CTRL is sufficient on + * CPUs with guest/host isolation. */ - if (!kvm_pmu || !x86_pmu.pebs_ept) + if (!x86_pmu.pebs_ept) return arr; /* -- 2.54.0.545.g6539524ca2-goog