From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1445DFA3740 for ; Thu, 27 Oct 2022 22:11:08 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234995AbiJ0WLE (ORCPT ); Thu, 27 Oct 2022 18:11:04 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45188 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234987AbiJ0WK6 (ORCPT ); Thu, 27 Oct 2022 18:10:58 -0400 Received: from mail-pj1-x1035.google.com (mail-pj1-x1035.google.com [IPv6:2607:f8b0:4864:20::1035]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 69D687FE44 for ; Thu, 27 Oct 2022 15:10:57 -0700 (PDT) Received: by mail-pj1-x1035.google.com with SMTP id pb15so2972362pjb.5 for ; Thu, 27 Oct 2022 15:10:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=IuI/0R1bIjVwvXYcHUmZYJwiqSkXr+1DnaKw/4nNBZ8=; b=ki1vR77HN/48VQ7yc9llOe8dR5wRA68cnzWGiray5OJKUfHBdQG8ek2EfWGwA51R+/ vkFdpPZZiqUf9PVZzvcqYxfxcIXipANSTVRKvxK/QEiql5I5UwCjdel+x1+dxcgIfeYX Ha98ig6wy3SD40k4xaVnHhI9KHahGwjLbbymzzcuuMv7lLJtpSllwre+TBMNY9rIz2MU avQeYuxLwFRvNWYz39tkcvY282z4jgWTSM+oG8ZzBTDxIS4PMUwXgM5r5i1z+S+z9hix BOig3+ucIq9J6ZUB8h0OM/4vU7nB7tglDDn5xQNzSP27z0jdCtA1g9fiuSUU9n5AlG3n TGdA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=IuI/0R1bIjVwvXYcHUmZYJwiqSkXr+1DnaKw/4nNBZ8=; b=4yxyBIdxH86tz2Sw1gkhNRlU8Rt/3jqUS8NutMx2iVgsem+g7XLWSSHFELSs+Xj1Sc J9lFSE/cFySVzNUyweExMQ1lJdDuJEkBm6msogSlX0qz0O5cBdtH1gHpzg9gJck/QyCk 7mWUBiH167M6YAX/XTrXY7Ps/ScZMAduLT3iRPGjLlxkWLAM2d+3DC/2a/lc6QP4YfGX yLqcXS0Yw/Za2tKV4yqj6rBRc4n8DEh9KcyHOhxHjKriZ9EIrR6BTubcZDx4L1dTMrm7 +5XIdt4lgygmdol52TdrSo1So+JQtp9R3xTbLJWGpdfS1m884zr/KRKYdxGf9AtjxEQQ FBDA== X-Gm-Message-State: ACrzQf01YR4sVrb3eR7FNYqEvwHeRMNC9L+NCLzCOusCg/AiIGQVFWSd 64K4LvuGfUoAZlm4u293WnFrbIuoLcaKYA== X-Google-Smtp-Source: AMsMyM67DBoVfZi0zoK5oEmAzA+jA/XatPVggiwWgW+3C+wlRDnWKYaWV7kcQF8Sox2umPHzQNV3yQ== X-Received: by 2002:a17:902:8bc9:b0:186:e151:6b29 with SMTP id r9-20020a1709028bc900b00186e1516b29mr9635273plo.8.1666908656874; Thu, 27 Oct 2022 15:10:56 -0700 (PDT) Received: from google.com (7.104.168.34.bc.googleusercontent.com. [34.168.104.7]) by smtp.gmail.com with ESMTPSA id w64-20020a626243000000b00553d573222fsm1598594pfb.199.2022.10.27.15.10.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 27 Oct 2022 15:10:56 -0700 (PDT) Date: Thu, 27 Oct 2022 22:10:53 +0000 From: Sean Christopherson To: Like Xu Cc: Paolo Bonzini , Jim Mattson , kvm@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v2 1/3] KVM: x86/pmu: Make part of the Intel v2 PMU MSRs handling x86 generic Message-ID: References: <20220919093453.71737-1-likexu@tencent.com> <20220919093453.71737-2-likexu@tencent.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220919093453.71737-2-likexu@tencent.com> Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org On Mon, Sep 19, 2022, Like Xu wrote: > From: Like Xu > > The AMD PerfMonV2 defines three registers similar to part of the > Intel v2 PMU registers, including the GLOBAL_CTRL, GLOBAL_STATUS > and GLOBAL_OVF_CTRL MSRs. For better code reuse, this specific > part of the handling can be extracted to make it generic for X86. > > The new non-prefix pmc_is_enabled() works well as legacy AMD vPMU > version is indexeqd as 1. Note that the specific *_is_valid_msr will > continue to be used to avoid cross-vendor msr access. Please state what the patch is doing and why. The above provides a small part of the "why", and alludes to the "what", but never actually states what is being done.