Received: by 2002:a05:7412:419a:b0:f3:1519:9f41 with SMTP id i26csp143584rdh; Wed, 22 Nov 2023 22:38:27 -0800 (PST) X-Google-Smtp-Source: AGHT+IGJWn9egZT+mDOsVk4nLVpvNE9eqRrNge7TkrEWTtyNkpvZG8Td9xj68wsRdeNfe4E2+vzV X-Received: by 2002:a17:902:dacd:b0:1ce:6630:1585 with SMTP id q13-20020a170902dacd00b001ce66301585mr2841506plx.23.1700721506803; Wed, 22 Nov 2023 22:38:26 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1700721506; cv=none; d=google.com; s=arc-20160816; b=TbHGi7E+em+rOMxZud+XVqarM4TevUJFAqL69Z6fJy0JXpQbY5ec8r5KG1NA5EKYWA +99LqAFW0UWcB0TXeS3t/KBaJ+UFuExume2xTH8D4NMUB60VNdvxdmMfGKN1zcNS+BEh LviXjNQt/Nrik0CL4ySkE/YckOB/VdXSXI32/RNjteQgtJWo2FESD7zyUXlg9tmZa6UA QjFui3ac9OsefCMvWBYXWIVmmYDmq34ww3B8F/5n22j4Zd3VXz32jICnmoCDbZNDjVPM 4QVjIRPlfdcz0gIFdJBd/CGM7rAaCqcvOkMFdsGy3lOla3U33IP2gjKazSrWrpSBPtd5 qIHw== 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=nWktWqMM4G/wXCLhrelXgnsFw3mwZMTHYGnEyrCPhDA=; fh=ulYPTBhRZAb64T+hdAwoqnfmpxVBhl0dZ/ez7YwwX6w=; b=yJJzsZ7xcIOYXnHFUIbHlaEM3tS18dtRE7a041hjY/rMn7FhBF7zzTaDgLXCzW0lSO M202shjR5pyDTFJMeZi0ekM44P7KdYBlTdmMO9E79CjG+gUOQAghRlslJR5PTCimdm8t 6O8Gk2/B3LFNvxohC7GNEwTVcTTo+BCdsG6m4Oq8l0FBs8N5Eh4cNSgP1KrsCTqvqtHD OVuL/mp0IGykCdhObqkKPFe13heW7bpgNimH58nKGPLw3bBCoTaRb8imF4tXxpqaXvy9 EYARKaA1VtrT+x/ozBO2GwDT7g9ZhQNipz2PxoUjTCBNVwtiCLV35T1VAfj6eIkbNMvt FGLQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b="byMW/K3C"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from groat.vger.email (groat.vger.email. [2620:137:e000::3:5]) by mx.google.com with ESMTPS id v6-20020a170902b7c600b001bdf6eb05f2si529331plz.227.2023.11.22.22.38.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 22 Nov 2023 22:38:26 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 as permitted sender) client-ip=2620:137:e000::3:5; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b="byMW/K3C"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by groat.vger.email (Postfix) with ESMTP id 7E03D8080EE3; Wed, 22 Nov 2023 22:38:22 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at groat.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344802AbjKWGiI (ORCPT + 99 others); Thu, 23 Nov 2023 01:38:08 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46966 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1344787AbjKWGiH (ORCPT ); Thu, 23 Nov 2023 01:38:07 -0500 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 866B9C1 for ; Wed, 22 Nov 2023 22:38:13 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1700721492; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=nWktWqMM4G/wXCLhrelXgnsFw3mwZMTHYGnEyrCPhDA=; b=byMW/K3CkXfF8xlEWXZiDU2uQmONnn6ZYD97CIhhoVRv14eeJDm3FY6lh3emAHhqXAn2Dq yB4mR9MykNHVpOzL5dtwsO23VCMafLm+CeEvcjxYmbZYlzghrClCrauiGdpnrLetvgdXZG DrDNd6xOynJMIe6hHQsVsuzyOdfBUwE= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-358-AC3FAiN5OAO27fE9bMEl8A-1; Thu, 23 Nov 2023 01:38:06 -0500 X-MC-Unique: AC3FAiN5OAO27fE9bMEl8A-1 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.rdu2.redhat.com [10.11.54.7]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 3B813899EC2; Thu, 23 Nov 2023 06:38:06 +0000 (UTC) Received: from virt-mtcollins-01.lab.eng.rdu2.redhat.com (virt-mtcollins-01.lab.eng.rdu2.redhat.com [10.8.1.196]) by smtp.corp.redhat.com (Postfix) with ESMTP id F04E21C060AE; Thu, 23 Nov 2023 06:38:05 +0000 (UTC) From: Shaoqin Huang To: Oliver Upton , Marc Zyngier , kvmarm@lists.linux.dev Cc: Shaoqin Huang , James Morse , kvm@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org, Paolo Bonzini , Shuah Khan , Suzuki K Poulose , Zenghui Yu Subject: [PATCH v1 0/3] KVM: selftests: aarch64: Introduce pmu_event_filter_test Date: Thu, 23 Nov 2023 01:37:42 -0500 Message-Id: <20231123063750.2176250-1-shahuang@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.7 X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on groat.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (groat.vger.email [0.0.0.0]); Wed, 22 Nov 2023 22:38:22 -0800 (PST) The test is inspired by the pmu_event_filter_test which implemented by x86. On the arm64 platform, there is the same ability to set the pmu_event_filter through the KVM_ARM_VCPU_PMU_V3_FILTER attribute. So add the test for arm64. The series first move some pmu common code from vpmu_counter_access to lib/ which can be used by pmu_event_filter_test. Then implements the test itself. Shaoqin Huang (3): KVM: selftests: aarch64: Make the [create|destroy]_vpmu_vm() can be reused KVM: selftests: aarch64: Move the pmu helper function into lib/ KVM: selftests: aarch64: Introduce pmu_event_filter_test tools/testing/selftests/kvm/Makefile | 2 + .../kvm/aarch64/pmu_event_filter_test.c | 227 ++++++++++++++++++ .../kvm/aarch64/vpmu_counter_access.c | 218 ++--------------- .../selftests/kvm/include/aarch64/vpmu.h | 139 +++++++++++ .../testing/selftests/kvm/lib/aarch64/vpmu.c | 74 ++++++ 5 files changed, 466 insertions(+), 194 deletions(-) create mode 100644 tools/testing/selftests/kvm/aarch64/pmu_event_filter_test.c create mode 100644 tools/testing/selftests/kvm/include/aarch64/vpmu.h create mode 100644 tools/testing/selftests/kvm/lib/aarch64/vpmu.c -- 2.40.1