Received: by 2002:a05:7412:3290:b0:fa:6e18:a558 with SMTP id ev16csp514434rdb; Fri, 26 Jan 2024 02:36:05 -0800 (PST) X-Google-Smtp-Source: AGHT+IE6esP+fFvNttoyRdh7dw/KUgm/qL5KkC4ufqdGcOMb1EXKVmehhi7CHnhgSJZcZgRbzuXf X-Received: by 2002:a05:6214:76d:b0:681:6d0e:83bb with SMTP id f13-20020a056214076d00b006816d0e83bbmr1079222qvz.129.1706265365125; Fri, 26 Jan 2024 02:36:05 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706265365; cv=pass; d=google.com; s=arc-20160816; b=gS50vl4CpVGOq9/Tu+lsP9MlSbhB3tbqHr7h4XTVv+/xoG7fuMwFGAhAOOCy0BsWPm 9DKtOV++G/p2tGsoDBni+SWuKNHFgTXS2T1+Qwov8oEY+K1GTDNrnHgWmlErUc5UMXeh HCqflJ2Nyzcj2XmOLVYwsBSUL4Itf4YP2VIWfoWNXnPweKhJ6GBXud65/gIMQMJwnE34 jfEPlUQZwdoHZB8M4N6sE013cPVoBOgx7Y74TePPNcW0moSTiLBihvTvzAr54h3O11th NtVvTY+KB2tRa7zhEu0EPnhIrvkowsN8e7vT4B/9dH3LuVDNZCd28hd9N00nVw26YNmy H4ng== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:date:message-id:dkim-signature; bh=5kQbVh0hcRgV8UMq6Vb5QM4EaBqOcOHGfTaVO2KwzEY=; fh=Om+qQ/9oh4im/783S43Ry2LTImPtZKsCIwuHgzXKIUo=; b=pwqOq0HQxSiEXXz4XSuUftJkHnYUQDaPycSbAdpEBUF9w+D9o6WkdiYbWGzHiLm3Te wykcKrp3HryljGC29EM1355BQLK6uQRFdo+Zjmu82UfoVguhcFiBbIfc142VAhK/R+lJ HNZtuisqjvskz7mpc8FU7VkYA7NLaxP2AqpXVkEjM/U0ajqw4V7JlcDGRdCu6ruvDWOZ ObYFEo21fKyCfosWm4kL/m/YfJEuKbYmGUPU6Z/A2N/dwgjJMwsCa45vJMDJyGtaT0Jl DWLG5dnIOwNN0Mc3QLEPgGs2ilA+9qczWaqpyT7MsFPuYQfhL2abSVuQLEaYSKHSV2E3 Mmqg== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=SL11JcaK; arc=pass (i=1 spf=pass spfdomain=redhat.com dkim=pass dkdomain=redhat.com dmarc=pass fromdomain=redhat.com); spf=pass (google.com: domain of linux-kernel+bounces-39996-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-39996-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id bj31-20020a05620a191f00b007830f6d1588si1113539qkb.4.2024.01.26.02.36.04 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 26 Jan 2024 02:36:05 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-39996-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=SL11JcaK; arc=pass (i=1 spf=pass spfdomain=redhat.com dkim=pass dkdomain=redhat.com dmarc=pass fromdomain=redhat.com); spf=pass (google.com: domain of linux-kernel+bounces-39996-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-39996-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id EADFA1C2C638 for ; Fri, 26 Jan 2024 10:33:30 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 8179913FE4; Fri, 26 Jan 2024 10:25:26 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="SL11JcaK" Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 280E612B9B for ; Fri, 26 Jan 2024 10:25:23 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.129.124 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706264725; cv=none; b=qFCaplvrvkyQqu54z3W2UPss9kqPBz/uGT01VBdpwjKNJHk+/DipLzoWHvZgjxEGQD+3T7EToManwSFR77KR4yAaFKjTvPZqFTmlE+pOAgOmxi/a5TzwdB8le5q+j/8u3Spy0PYCZ5kcgLlGeQkroB1AVelhXSc38llPSgd+5yo= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706264725; c=relaxed/simple; bh=S70PRABftOqa8emToRq/SOEAjS3k4Nc2hS3M0xK6WDo=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=Gq2GFG/jzl2oOMEJVHcSGZtqsJ7/5GSsbxBve0xFOu74UYHld0jG6gZdXEryzoawwtpWhLH21+EhCP5Z/d6HrpxHckpwILTmRuRORV81u6x2+wjVbih1jFPuZnnYy/b5wCPr8gIrrMqr+GlydJAWxgVvIfdC8Lo27mj/cAYSn/I= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com; spf=pass smtp.mailfrom=redhat.com; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b=SL11JcaK; arc=none smtp.client-ip=170.10.129.124 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1706264723; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=5kQbVh0hcRgV8UMq6Vb5QM4EaBqOcOHGfTaVO2KwzEY=; b=SL11JcaKI12fOXuI6xNz1451GqTi98yeiPQGzHuW190lRICXQZplsGZHBODI88PNwjH+I6 7zqScm8G31gWtPhxaLGUaZHotAWNdEOYp7/XHWQu3/D7Vr6RsSMsnFo0l+ter+NbPROQL2 860LByL5WjFXtB6Whgje4DsvDalvkWo= Received: from mail-qv1-f72.google.com (mail-qv1-f72.google.com [209.85.219.72]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-347-n6kDWOWYOSOS_ljS5n98DQ-1; Fri, 26 Jan 2024 05:25:20 -0500 X-MC-Unique: n6kDWOWYOSOS_ljS5n98DQ-1 Received: by mail-qv1-f72.google.com with SMTP id 6a1803df08f44-68694f9e037so4071676d6.2 for ; Fri, 26 Jan 2024 02:25:20 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1706264719; x=1706869519; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=5kQbVh0hcRgV8UMq6Vb5QM4EaBqOcOHGfTaVO2KwzEY=; b=rKnhvGA8JBBGo+jPvpr6ogVmyP3rD2fOtztADSVcnP/gJ+CyBNMl6fkft0ymb8164w wXD3lOrQ9+FPT6st24tpOsw7YoRyNUIstQaBNgZqzQ6svT2hRt237UomxTKmTt9Mlq1i XMxgF73KGfpgn5O2RFu6fIjfIH6KlGTgms2yLlxoAzRKbRJ1BfinqALd8V3SpYXFOM89 O1A8lQjuAj8P89CobNy80SGKlMUQNxIZIjOCG0moISIxdI8m+QWIO1dakJsEzocBYHKe ZIZVpjdnddYaSIT9l5N+Dwp8Yh4ODzFuquIAI8u7R61Y4U41/spuTsiuQDq0nxetJ+uw PFbQ== X-Gm-Message-State: AOJu0Yyk7mctGxbliP//D01/RS791/cm3wTaBVGA0gZiySG5nddMGzb/ Dz3lJvGSA8Lvkg5TtRj9BTAXvESyMac4I++2u89L3L7PhZIoRSRoR0mbKWLWPIqghI1HZhACWy0 EMWoFGaiTeelVElQsb6Sw9xtOKVkZhfJw9YpoZklXPPeJvlCaJ5XfLQtp6WN1XQ== X-Received: by 2002:ad4:5d6e:0:b0:686:acaa:a4b6 with SMTP id fn14-20020ad45d6e000000b00686acaaa4b6mr1400871qvb.79.1706264719641; Fri, 26 Jan 2024 02:25:19 -0800 (PST) X-Received: by 2002:ad4:5d6e:0:b0:686:acaa:a4b6 with SMTP id fn14-20020ad45d6e000000b00686acaaa4b6mr1400856qvb.79.1706264719347; Fri, 26 Jan 2024 02:25:19 -0800 (PST) Received: from ?IPV6:2a01:e0a:59e:9d80:527b:9dff:feef:3874? ([2a01:e0a:59e:9d80:527b:9dff:feef:3874]) by smtp.gmail.com with ESMTPSA id h4-20020a0cd804000000b006869dae6edbsm398728qvj.77.2024.01.26.02.25.16 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 26 Jan 2024 02:25:18 -0800 (PST) Message-ID: <51ca8edc-81e6-4c6d-9c72-80fe59919868@redhat.com> Date: Fri, 26 Jan 2024 11:25:15 +0100 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v3 0/5] KVM: selftests: aarch64: Introduce pmu_event_filter_test Content-Language: en-US To: Shaoqin Huang , Oliver Upton , Marc Zyngier , kvmarm@lists.linux.dev Cc: 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 References: <20240116060129.55473-1-shahuang@redhat.com> From: Eric Auger In-Reply-To: <20240116060129.55473-1-shahuang@redhat.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Hi Shaoqin, On 1/16/24 07:01, Shaoqin Huang wrote: > 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/aarch64/vpmu.c and include/aarch64/vpmu.h, which can be used by > pmu_event_filter_test. Then fix a bug related to the [enable|disable]_counter, > and at last, implement the test itself. which branch does it apply on? I fail to apply on top on main. Or can you provide a branch? Eric > > Changelog: > ---------- > v2->v3: > - Check the pmceid in guest code instead of pmu event count since different > hardware may have different event count result, check pmceid makes it stable > on different platform. [Eric] > - Some typo fixed and commit message improved. > > v1->v2: > - Improve the commit message. [Eric] > - Fix the bug in [enable|disable]_counter. [Raghavendra & Marc] > - Add the check if kvm has attr KVM_ARM_VCPU_PMU_V3_FILTER. > - Add if host pmu support the test event throught pmceid0. > - Split the test_invalid_filter() to another patch. [Eric] > > v1: https://lore.kernel.org/all/20231123063750.2176250-1-shahuang@redhat.com/ > v2: https://lore.kernel.org/all/20231129072712.2667337-1-shahuang@redhat.com/ > > Shaoqin Huang (5): > KVM: selftests: aarch64: Make the [create|destroy]_vpmu_vm() public > KVM: selftests: aarch64: Move pmu helper functions into vpmu.h > KVM: selftests: aarch64: Fix the buggy [enable|disable]_counter > KVM: selftests: aarch64: Introduce pmu_event_filter_test > KVM: selftests: aarch64: Add invalid filter test in > pmu_event_filter_test > > tools/testing/selftests/kvm/Makefile | 2 + > .../kvm/aarch64/pmu_event_filter_test.c | 255 ++++++++++++++++++ > .../kvm/aarch64/vpmu_counter_access.c | 218 ++------------- > .../selftests/kvm/include/aarch64/vpmu.h | 135 ++++++++++ > .../testing/selftests/kvm/lib/aarch64/vpmu.c | 74 +++++ > 5 files changed, 490 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 >