Received: by 2002:a05:6358:51dd:b0:131:369:b2a3 with SMTP id 29csp943218rwl; Thu, 10 Aug 2023 04:16:23 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHa4gfPJdBRhiSmq/JGvPplXQKkcEMy90DMc9kU7rzXSZsv4PTLlBDW5dKMjIjQgI4NUhoJ X-Received: by 2002:a17:902:e803:b0:1b8:8670:541 with SMTP id u3-20020a170902e80300b001b886700541mr2061295plg.25.1691666183045; Thu, 10 Aug 2023 04:16:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1691666183; cv=none; d=google.com; s=arc-20160816; b=LZrXxyj7wu667bqw0whiWbLGGOhXtk1/AuGWhoEF+OgLCrtAkv3ygVFExp7ty2zVhW 6y7DxnXrSQhEOtKU0r5Z3Hs6q3+6o8ait+DhECsBPQPb1eQmAkUXltNZkApSJgaSJJWe ej6R2aYtB7NKZ1RsREisCojO2DPazB+VUQfsk9zyAFrJvXpZZXN8I64sw9vV9inYi+rM 3gwd5DKV4eOl4gl8wT/AMHeIdFR52bLbDqNQieiRFNRYSkz/9/m9ZzYsM6IS3++qACKr Llvt6//7duRLjnoLcXgXxgADQht4cFUQ/Drg75Iqrk9eQ7zVXBOe1jj+rOT5n5yPVMeH ywCg== 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 :message-id:date:subject:cc:to:from:dkim-signature; bh=+H9VGuNWW1HuVdobl6UTPeoLWh92A5dHZajmlrne1vg=; fh=/iGrNW+RblIWj1LrqUEdrz6IGW99Ktsuyq3EPKx0UEk=; b=gb6Qy1EpExuAv0MFZKewAm/m+6PqwUDP0dGEDnfFgvQIkyCm9FDsSTLuF/ogMbaYBY 2MuSz367C3oXQxwRtnTy5C3lpPB1gojIOsB1kz9fuk9bRmuxbS6mEPR3uBDl73fkONR1 7Lnxar6QqDzeYSThcc0aJllevHRIn6DcNpPUDaJXFHoTg52xdo0dhoZLQlGb26wORJ+o t7dNt2RVhruVgbTv9WR2bL5d4hnnl37posOvo6iz2QEs+wAPQj5jgCOlXFCsRZQhulXv 7rVs/dYWwqMTd3h2kiyxX7rbAqBbg3YuHXsgFFy9yPnj9cB5fJMX2vwc42fFmyY9lJbM 3jjQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20221208 header.b=NNAYxA0N; 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 j8-20020a170903024800b001b89bd6fd59si1309971plh.215.2023.08.10.04.16.10; Thu, 10 Aug 2023 04:16:23 -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=NNAYxA0N; 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 S234212AbjHJJKD (ORCPT + 99 others); Thu, 10 Aug 2023 05:10:03 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38728 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229730AbjHJJKB (ORCPT ); Thu, 10 Aug 2023 05:10:01 -0400 Received: from mail-pj1-x1043.google.com (mail-pj1-x1043.google.com [IPv6:2607:f8b0:4864:20::1043]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6E45C2123; Thu, 10 Aug 2023 02:10:01 -0700 (PDT) Received: by mail-pj1-x1043.google.com with SMTP id 98e67ed59e1d1-26929bf95b6so387269a91.3; Thu, 10 Aug 2023 02:10:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1691658601; x=1692263401; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=+H9VGuNWW1HuVdobl6UTPeoLWh92A5dHZajmlrne1vg=; b=NNAYxA0NfcUSL8wZji8Ds3je3VtOoz8v0SGcp7urBtRCixdaJogdN6zIC1YJyT6U/H gSNKWLvgY0pB3EUMbY6lZ9nTvHZ1+CSpa/sOiql+HFy4uSMsokCzI1RzRiqMv5Tih9rO s7LFdb+sZq3xLcO5N+rag9RaAw1Uo2QWfdT/twghqUmVAvuFsfuI4N7sBx9d00ahOwK2 A8+r4KWrK/nxD6PCHZcqaZPjUfplnqbZurIsxfZQXeWyNoQfbTod6j6tT7I06q2xqfrN qM9JzQCW5JK7bl2uyGnjLGK5bV9P9BK7cC+ncIvdzDG8ruGi3CRCWOCordFm0DlDmN87 uigQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1691658601; x=1692263401; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=+H9VGuNWW1HuVdobl6UTPeoLWh92A5dHZajmlrne1vg=; b=V9PGQOk3kbgodzqsFWcPPQwppWHQgO1hFB7+V5oyZ69SLPqSOgiFQxJwErjRKMCD8b JQdE934UpTNBLud7UaJPocpAo8zcn0iTurBnuVoXn+Xh4WreU6pEFjirI84mopJGA32K Flx2zX9f/8idTCLfti/ANtb5kHV5utCx09bcGvm58BIM1NRdY2BDVo/wRmvKTAwYWCMa 8TTkixj7Nx9NWDB/mKNBViCEcfx5Y4ie2GdE+zE4vKWALUjafkr+aMjyA9nVDclyzx5k ifBfzKJK11rrSGhy7fXKHmG8kgjjquK6KMY6r3hOeh5UsZCEteC+mcQZi++DTzdTW/6h e//w== X-Gm-Message-State: AOJu0YzgQH6eIh86p1g8Vw8w/dkIu4uTLRnDIYmLjNaxPn0z4MFUgvZ4 o4IsHipWowpfHHrbFc5S+Z0= X-Received: by 2002:a17:90b:1b0b:b0:268:1b7f:257b with SMTP id nu11-20020a17090b1b0b00b002681b7f257bmr1276287pjb.24.1691658600789; Thu, 10 Aug 2023 02:10:00 -0700 (PDT) Received: from CLOUDLIANG-MB2.tencent.com ([103.7.29.32]) by smtp.gmail.com with ESMTPSA id pc16-20020a17090b3b9000b00263154aab24sm970704pjb.57.2023.08.10.02.09.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 10 Aug 2023 02:10:00 -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 v6 0/6] KVM: selftests: Improve PMU event filter settings and add test cases Date: Thu, 10 Aug 2023 17:09:39 +0800 Message-Id: <20230810090945.16053-1-cloudliang@tencent.com> X-Mailer: git-send-email 2.40.1 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 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 Hi, This patch series aims to improve the PMU event filter settings with a cleaner and more organized structure and adds several test cases related to PMU event filters. These changes help to ensure that KVM's PMU event filter functions as expected in all supported use cases. Any feedback or suggestions are greatly appreciated. Sincerely, Jinrong Liang Changes log: v6: - Rebased to 74c2185c5b74(tag: kvm-x86-next-2023.08.02); - Use TEST_ASSERT_EQ() instead of ASSERT_EQ(); - Fix a bug about x86 properties for Intel PMU in patch v5; v5: https://lore.kernel.org/kvm/20230720114714.34079-1-cloudliang@tencent.com/T/ Jinrong Liang (6): KVM: selftests: Add x86 properties for Intel PMU in processor.h KVM: selftests: Drop the return of remove_event() KVM: selftests: Introduce __kvm_pmu_event_filter to improved event filter settings KVM: selftests: Add test cases for unsupported PMU event filter input values KVM: selftests: Test if event filter meets expectations on fixed counters KVM: selftests: Test gp event filters don't affect fixed event filters .../selftests/kvm/include/x86_64/processor.h | 5 + .../kvm/x86_64/pmu_event_filter_test.c | 317 ++++++++++++------ 2 files changed, 228 insertions(+), 94 deletions(-) base-commit: 74c2185c5b74fd0ae91133ad5afe8684f6a02b91 -- 2.39.3