Received: by 2002:a05:6358:7058:b0:131:369:b2a3 with SMTP id 24csp9452991rwp; Thu, 20 Jul 2023 05:20:08 -0700 (PDT) X-Google-Smtp-Source: APBJJlFfp+PjzfrlxPMk1pCz8U+YinLvH08lisoLTt4yAy9OF9OnkR0cEaGDJBSCK9DHhwlB9y9d X-Received: by 2002:a17:906:7a04:b0:992:47d7:35d7 with SMTP id d4-20020a1709067a0400b0099247d735d7mr4634564ejo.14.1689855608332; Thu, 20 Jul 2023 05:20:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1689855608; cv=none; d=google.com; s=arc-20160816; b=fY7hYEhx262y+Qh7/pFYhPVaa/+ySCEVCqDe4PFa9AvYXElJ2Bvt8vBhDO+evWYXzP C72Kkk6exAAcNcmx8E0XRIlUIzAKJ8GB/dMpzylScfsc8As3iHpn4yGYnjdHAphjNWvi aNlx0sSM/OKdZ90FLw80IZPHS10ZYmrqBuiMI9vyK4ZE3u/eU2WEO0I1JIVye0f0wJBy uIVvO/21DtLvn+md9Yz3kakzStS+TBBMuUM94dnx2rx47Os6d24zFKEBwjQLdv03LddN awxhYSjLQ+urTxItEg50JjKoJ0nV2kKK4FpR+MB4rwJIqCU5wSBzYe8QewFkEFCCwfTY YdUg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=XSF6S+UOyj9oNfC0MJh489ttKCJmHxLthvR3b7uPlOk=; fh=/iGrNW+RblIWj1LrqUEdrz6IGW99Ktsuyq3EPKx0UEk=; b=OhqEAkmNa9asUrFrxzBUYFG23lt87D0GEqmijxyXxY83FIsGFoKMlcCZ9S4MZvohOc hUyQaAuD97yGlMkslGNFEL7SaJPPRAdU0LwQnXXWI9I2zetsceZiZ+dJCHko6LtLtvq9 dSf1qZLvy133IjG1k3haUQ8Q2Kd975PcIkOM47P8rB+tPCsZU1abSovOVe/RtUMB6tnU pRdsKwNQ2dhwF3U/UMyoWLmvf+OSNhRb+mFqCdlI40jlefKcJbYKIHsxpDNS+u+muDId KLlR7IW9s8au7651lvXwGz+VOnw7p1asAmh+vNIJrZvMIjhnzwhj6QU+HPcMB0HqKZiO QKpA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20221208 header.b=aQmt55SM; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id qx16-20020a170906fcd000b00997c7157a02si547450ejb.821.2023.07.20.05.19.43; Thu, 20 Jul 2023 05:20:08 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20221208 header.b=aQmt55SM; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230344AbjGTLrk (ORCPT + 99 others); Thu, 20 Jul 2023 07:47:40 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44820 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230292AbjGTLrh (ORCPT ); Thu, 20 Jul 2023 07:47:37 -0400 Received: from mail-pf1-x441.google.com (mail-pf1-x441.google.com [IPv6:2607:f8b0:4864:20::441]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 783FAE4C; Thu, 20 Jul 2023 04:47:36 -0700 (PDT) Received: by mail-pf1-x441.google.com with SMTP id d2e1a72fcca58-6862842a028so422414b3a.0; Thu, 20 Jul 2023 04:47:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1689853656; x=1690458456; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=XSF6S+UOyj9oNfC0MJh489ttKCJmHxLthvR3b7uPlOk=; b=aQmt55SMNkO7Bt5Ze+Zhr09RbdVTYlRZgISvQULiN8aQkyWghnSHznynuNoKz6gsn8 NFXsrzwUEXz8iNO6lTMVl+jVTsDosgM2irByooN1uSPKfEo1t4tXkUDGv6qQIgvzXGCo 9kTxXoT1+9wGu9GFzQEBcKPBYeZej0gCBI7d3a7z23jHMyvJ53v2OACETyRbYO+vIXkB dCw4Z1/+63CHbYVr77K0QDX8e9hiDCk0GEvgWHHsIimMrvxis5rsau4OXdJCQoNXW+JJ 542sH6Df4CLUSbh/H+DRRr5xAFvIVeCHkRlgNEpznK9KDHYPiXgOIheyyeCN6W5atKm9 IoCA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1689853656; x=1690458456; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=XSF6S+UOyj9oNfC0MJh489ttKCJmHxLthvR3b7uPlOk=; b=IWKwcEd77pWBlevyTSbxMOZZ04Lpy+AQ80Ez9BdX/Q1K4qx84mKSd/zFXjcd7zrWJD vnQfor4ilNm4K7Owtbljb+4fnLVLiQdH80qbjB4ip6CcBbVzb2Nlf4OBnvA7yfmjWJE7 G0n6NmX6maxGMumkaCqv5cRnkMbmMYd5PSClJhWhvk7cBjpJ3H4yR5iHNxyPc0fZiStX NnPd0ygGPOKgrFR/1lzsGOFNFSxMPtzkNbAzTOEw7nNxjTgPdncwZouCD6Fls86lmBoy WEcs497fGInRT5SoZeUfnNlozYlaUPft3Dxvs8AN6zRWBIBEavlieBFGmx1LAc80R8cR 9DtQ== X-Gm-Message-State: ABy/qLY6BYno3qK7JhCCUoWwGfLqkP62QvUHNwYJ43vdzTnpLgwdBrVr Gtk+gwzG2TCKXZX6Ki528TY= X-Received: by 2002:a05:6a20:4308:b0:122:ff52:7331 with SMTP id h8-20020a056a20430800b00122ff527331mr5455249pzk.52.1689853655870; Thu, 20 Jul 2023 04:47:35 -0700 (PDT) Received: from CLOUDLIANG-MB2.tencent.com ([103.7.29.32]) by smtp.gmail.com with ESMTPSA id u22-20020a170902a61600b001b2069072ccsm1164007plq.18.2023.07.20.04.47.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 20 Jul 2023 04:47:35 -0700 (PDT) From: Jinrong Liang X-Google-Original-From: Jinrong Liang To: Sean Christopherson Cc: Paolo Bonzini , Isaku Yamahata , Jim Mattson , Shuah Khan , Aaron Lewis , David Matlack , Vishal Annapurve , Wanpeng Li , Like Xu , Jinrong Liang , linux-kselftest@vger.kernel.org, kvm@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v5 1/6] KVM: selftests: Add x86 properties for Intel PMU in processor.h Date: Thu, 20 Jul 2023 19:47:09 +0800 Message-Id: <20230720114714.34079-2-cloudliang@tencent.com> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230720114714.34079-1-cloudliang@tencent.com> References: <20230720114714.34079-1-cloudliang@tencent.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham 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 From: Jinrong Liang Add x86 properties for Intel PMU so that tests don't have to manually retrieve the correct CPUID leaf+register, and so that the resulting code is self-documenting. Signed-off-by: Jinrong Liang --- tools/testing/selftests/kvm/include/x86_64/processor.h | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/tools/testing/selftests/kvm/include/x86_64/processor.h b/tools/testing/selftests/kvm/include/x86_64/processor.h index aa434c8f19c5..5cb7df74d0b1 100644 --- a/tools/testing/selftests/kvm/include/x86_64/processor.h +++ b/tools/testing/selftests/kvm/include/x86_64/processor.h @@ -239,7 +239,12 @@ struct kvm_x86_cpu_property { #define X86_PROPERTY_MAX_BASIC_LEAF KVM_X86_CPU_PROPERTY(0, 0, EAX, 0, 31) #define X86_PROPERTY_PMU_VERSION KVM_X86_CPU_PROPERTY(0xa, 0, EAX, 0, 7) #define X86_PROPERTY_PMU_NR_GP_COUNTERS KVM_X86_CPU_PROPERTY(0xa, 0, EAX, 8, 15) +#define X86_PROPERTY_PMU_GP_COUNTERS_BIT_WIDTH KVM_X86_CPU_PROPERTY(0xa, 0, EAX, 23, 16) #define X86_PROPERTY_PMU_EBX_BIT_VECTOR_LENGTH KVM_X86_CPU_PROPERTY(0xa, 0, EAX, 24, 31) +#define X86_PROPERTY_PMU_EVENTS_MASK KVM_X86_CPU_PROPERTY(0xa, 0, EBX, 0, 7) +#define X86_PROPERTY_PMU_FIXED_COUNTERS_BITMASK KVM_X86_CPU_PROPERTY(0xa, 0, ECX, 0, 31) +#define X86_PROPERTY_PMU_NR_FIXED_COUNTERS KVM_X86_CPU_PROPERTY(0xa, 0, EDX, 0, 4) +#define X86_PROPERTY_PMU_FIXED_COUNTERS_BIT_WIDTH KVM_X86_CPU_PROPERTY(0xa, 0, EDX, 0, 4) #define X86_PROPERTY_SUPPORTED_XCR0_LO KVM_X86_CPU_PROPERTY(0xd, 0, EAX, 0, 31) #define X86_PROPERTY_XSTATE_MAX_SIZE_XCR0 KVM_X86_CPU_PROPERTY(0xd, 0, EBX, 0, 31) -- 2.39.3