Received: by 2002:a05:7412:251c:b0:e2:908c:2ebd with SMTP id w28csp2223540rda; Tue, 24 Oct 2023 17:01:50 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGEK0UBx4qvJeHgatJpzSMO01+PqEDC0l7Ntb3m9j7aL+3BnXpSwnbd4ileRdKBpMQ8lgOa X-Received: by 2002:a17:903:2289:b0:1ca:86db:1d2f with SMTP id b9-20020a170903228900b001ca86db1d2fmr17155261plh.43.1698192109689; Tue, 24 Oct 2023 17:01:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698192109; cv=none; d=google.com; s=arc-20160816; b=WcoMIyrffwakqyEvyUHYK9HTIfde+0Zw0/xW0YdZD4eA0yqo/LebJL0a9YkIByBB7a D9JA0guFXFYHZio8Em1stOXZ5bw3RRDOjvI9QMWFEuuFnX/8rfjiSHJYUypOSLYHP3px V9EjXujH1JIWXCvHEB9DBYwQG1jrs4yftNs4cgEMiCdPtwRrj4vPzmQ7Brbau9V1j740 crR7DNXK6kkJwciQUUv45deARVsU2TrCr/ss3q8BcguO5/IvER2P/W52l3ppWDi+4eKj 4js4N7P8zjs1KFNPrPMjTXVz7quo+MMNLW58FlINw324ah+OeczCgyjTUmCCeQOgOAsG t2AA== 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=gulJryeOiAII7rRti1FgpAMjLmQKWyqOB8guMGZkbTk=; fh=1rmFBT0xf8+KFdKw6g0SBss308Z+5ue8jjpdMPSO6bk=; b=XGmznQTV/1ON3DM5jDQHvLTT5KmgqXhv5Tso29IjtdbSOZPJFQERTHtnUTjlac3/2e m3SkULu7Ve7jN3uCV66yz9ckbrqLhFUk7giFSxKJoz23ByCKW1uz8mBgV8IXdRAqfkoS n0/OD6KBEY2G5aKLVtZgHCoOmIFjgoqYHX4awVK0ooL62FKXnMf8UCqMmnTYjbp2jZR/ 7sHN4b3x8SlM2IhXaED1dsYRp2NhF2XHHfQQmAI7uEuYcCxXpkHDc3Cenqfm3ksqlAjW 4LMUV7zPFYSVLvvVwT+GSe1YBgzCYjR2p7QjUERLTLLFO1+4O6wfTMjeuj3jJq4cgmIJ VlTA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b=LOm2g80f; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.dev Return-Path: Received: from fry.vger.email (fry.vger.email. [2620:137:e000::3:8]) by mx.google.com with ESMTPS id y1-20020a170902700100b001c6182d9fdasi8759828plk.326.2023.10.24.17.01.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 24 Oct 2023 17:01:49 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 as permitted sender) client-ip=2620:137:e000::3:8; Authentication-Results: mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b=LOm2g80f; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.dev Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by fry.vger.email (Postfix) with ESMTP id EE601802122B; Tue, 24 Oct 2023 17:01:46 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at fry.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344712AbjJYABd (ORCPT + 99 others); Tue, 24 Oct 2023 20:01:33 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56976 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1344663AbjJYABa (ORCPT ); Tue, 24 Oct 2023 20:01:30 -0400 Received: from out-197.mta1.migadu.com (out-197.mta1.migadu.com [95.215.58.197]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D641910D0 for ; Tue, 24 Oct 2023 17:01:27 -0700 (PDT) X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1698192085; 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=gulJryeOiAII7rRti1FgpAMjLmQKWyqOB8guMGZkbTk=; b=LOm2g80fdK+Zk5MnmgUOQet8LgbtP/tQYKA6OMIXPTBEC7vrNUPmgB628GHUI7I8ZaII4i IVDHYLJXyoM8876962oTh9j+WU1EHNo9f+EOR5vArflelhg6qZzgZ6T5Ntt8db+kZ9N0zf gLQ6XHnz90rwmGJ9eyd1uB2fX6JeIWA= From: Oliver Upton To: Raghavendra Rao Ananta , Marc Zyngier Cc: Oliver Upton , Zenghui Yu , Jing Zhang , kvm@vger.kernel.org, Reiji Watanabe , Shaoqin Huang , linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Suzuki K Poulose , kvmarm@lists.linux.dev, James Morse , Colton Lewis , Paolo Bonzini , Alexandru Elisei Subject: Re: [PATCH v8 00/13] KVM: arm64: PMU: Allow userspace to limit the number of PMCs on vCPU Date: Wed, 25 Oct 2023 00:01:12 +0000 Message-ID: <169819197647.2014901.5722928932912558103.b4-ty@linux.dev> In-Reply-To: <20231020214053.2144305-1-rananta@google.com> References: <20231020214053.2144305-1-rananta@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit X-Migadu-Flow: FLOW_OUT X-Spam-Status: No, score=-0.8 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on fry.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 (fry.vger.email [0.0.0.0]); Tue, 24 Oct 2023 17:01:47 -0700 (PDT) On Fri, 20 Oct 2023 21:40:40 +0000, Raghavendra Rao Ananta wrote: > The goal of this series is to allow userspace to limit the number > of PMU event counters on the vCPU. We need this to support migration > across systems that implement different numbers of counters. > > The number of PMU event counters is indicated in PMCR_EL0.N. > For a vCPU with PMUv3 configured, its value will be the same as > the current PE by default. Userspace can set PMCR_EL0.N for the > vCPU to any value even with the current KVM using KVM_SET_ONE_REG. > However, it is practically unsupported, as KVM resets PMCR_EL0.N > to the host value on vCPU reset and some KVM code uses the host > value to identify (un)implemented event counters on the vCPU. > > [...] I've applied this with Marc + I's fixes. I'm happy to toss any fixes on top of this series if folks spot issues. [01/13] KVM: arm64: PMU: Introduce helpers to set the guest's PMU https://git.kernel.org/kvmarm/kvmarm/c/1616ca6f3c10 [02/13] KVM: arm64: PMU: Set the default PMU for the guest before vCPU reset https://git.kernel.org/kvmarm/kvmarm/c/427733579744 [03/13] KVM: arm64: PMU: Add a helper to read a vCPU's PMCR_EL0 https://git.kernel.org/kvmarm/kvmarm/c/57fc267f1b5c [04/13] KVM: arm64: PMU: Set PMCR_EL0.N for vCPU based on the associated PMU https://git.kernel.org/kvmarm/kvmarm/c/4d20debf9ca1 [05/13] KVM: arm64: Add {get,set}_user for PM{C,I}NTEN{SET,CLR}, PMOVS{SET,CLR} https://git.kernel.org/kvmarm/kvmarm/c/a45f41d754e0 [06/13] KVM: arm64: Sanitize PM{C,I}NTEN{SET,CLR}, PMOVS{SET,CLR} before first run https://git.kernel.org/kvmarm/kvmarm/c/27131b199f9f [07/13] KVM: arm64: PMU: Allow userspace to limit PMCR_EL0.N for the guest https://git.kernel.org/kvmarm/kvmarm/c/ea9ca904d24f [08/13] tools: Import arm_pmuv3.h https://git.kernel.org/kvmarm/kvmarm/c/9f4b3273dfbe [09/13] KVM: selftests: aarch64: Introduce vpmu_counter_access test https://git.kernel.org/kvmarm/kvmarm/c/8d0aebe1ca2b [10/13] KVM: selftests: aarch64: vPMU register test for implemented counters https://git.kernel.org/kvmarm/kvmarm/c/ada1ae68262d [11/13] KVM: selftests: aarch64: vPMU register test for unimplemented counters https://git.kernel.org/kvmarm/kvmarm/c/e1cc87206348 [12/13] KVM: selftests: aarch64: vPMU test for validating user accesses https://git.kernel.org/kvmarm/kvmarm/c/62708be351fe -- Best, Oliver