Received: by 2002:a05:7412:251c:b0:e2:908c:2ebd with SMTP id w28csp2080357rda; Tue, 24 Oct 2023 11:37:55 -0700 (PDT) X-Google-Smtp-Source: AGHT+IET9N+c7c7tzvNFErE2PF+3SfBS2OXhHGCsMh4nMdUnnCDiY19ncnuDeUSQdk1FG17Lr2iB X-Received: by 2002:a17:903:1cf:b0:1ca:e9f8:2af8 with SMTP id e15-20020a17090301cf00b001cae9f82af8mr6641047plh.13.1698172674873; Tue, 24 Oct 2023 11:37:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698172674; cv=none; d=google.com; s=arc-20160816; b=zPhJg2QmqMei5QYUuNE2DOU3QLsl2in1dZJf9nWtGMxM+WiUDCie/2q+n7brPMp6e1 xSYjNOqxoEoNaHlii056LeNI9WrD4RWcb2h6Nvcf9xTuS84MhNImLG8RdqbT2eIk2uV1 kfE4d169rIsVnKEl/GPGTqn63fb6I6vLsLixJd7XDGrlV0alse8z3OPs2t1dAxZ18/Nr EelK785dUMwP2J/rTkxF2j8VuFZYpuzLjBp7mmuZx2T6QwPclnwgjDJjmmbHZJJVf9ry ejmteQbu3npjVSwL0zgHvwdWF2PEoiOIwq96Y/2FjKtk1mHCbqdB5zMCbXdimj6e/9pu Ttzw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:dkim-signature:date; bh=MhJ7hpYNLv+MdX49dQXGYnhsXLwtvTKjEUlM/EEP2AE=; fh=4I6BNv7iobpZrRcbueKA7r9RD02xPQmynyU/PeDFguM=; b=WjnEa13YAr3+QhnJjQIueqalfK7HVSqJpizJktBRkogcooO8XlQ1NYegtkHPcyoy9T M9FecHVDwJSc+prHvgWbA5W/D4sTnXuxYdlaMCUmgOayPBUiMPLyvuZivUC4Y/U9+/2I H5g3xicTOWBn15rO2zpvqWkkCW9QjWsNtp/U+ieH4IpHi+b0IK+LQUBP0aHn1+t7E4Ex t0PfWTfmj50X/Xr1+UjbZn1j0sWaqSJaUkA7t8D/3gkoqX/rFci440xHJGC1+6hIkyC5 yF2L/7iYRxFF2pCwd7C1EM1iJzadfJDfDI8AmZ907F0gXxXIZESHHOF5vJRRhvGFoKQ8 nVzQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b=HmTAi3vX; 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=linux.dev Return-Path: Received: from groat.vger.email (groat.vger.email. [2620:137:e000::3:5]) by mx.google.com with ESMTPS id j8-20020a170903024800b001c752da513asi8640679plh.405.2023.10.24.11.37.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 24 Oct 2023 11:37:54 -0700 (PDT) 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=@linux.dev header.s=key1 header.b=HmTAi3vX; 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=linux.dev Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by groat.vger.email (Postfix) with ESMTP id B3DF780A8BB9; Tue, 24 Oct 2023 11:37:51 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at groat.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344118AbjJXSho (ORCPT + 99 others); Tue, 24 Oct 2023 14:37:44 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39054 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234909AbjJXShm (ORCPT ); Tue, 24 Oct 2023 14:37:42 -0400 Received: from out-206.mta0.migadu.com (out-206.mta0.migadu.com [IPv6:2001:41d0:1004:224b::ce]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 06CC9171E for ; Tue, 24 Oct 2023 11:37:23 -0700 (PDT) Date: Tue, 24 Oct 2023 18:37:17 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1698172642; 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: in-reply-to:in-reply-to:references:references; bh=MhJ7hpYNLv+MdX49dQXGYnhsXLwtvTKjEUlM/EEP2AE=; b=HmTAi3vX6+c6qUUSeCE5bUS/PW6Yb7yhrXKc58eaEv/9GVTUSXOuF6uNnysiKo0GoNPB4+ wllIwNj9PbBKFHyTluy6Qg5zJaD4norqGkRmo9F0H9VtpK+aClTT4P2Q9V6v2Z+mlImQVr JneDsDassGEe43ScK3hMSWUrpVNfKZE= X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: Oliver Upton To: Raghavendra Rao Ananta Cc: Marc Zyngier , Alexandru Elisei , James Morse , Suzuki K Poulose , Paolo Bonzini , Zenghui Yu , Shaoqin Huang , Jing Zhang , Reiji Watanabe , Colton Lewis , linux-arm-kernel@lists.infradead.org, kvmarm@lists.linux.dev, linux-kernel@vger.kernel.org, kvm@vger.kernel.org Subject: Re: [PATCH v8 07/13] KVM: arm64: PMU: Allow userspace to limit PMCR_EL0.N for the guest Message-ID: References: <20231020214053.2144305-1-rananta@google.com> <20231020214053.2144305-8-rananta@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20231020214053.2144305-8-rananta@google.com> 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 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]); Tue, 24 Oct 2023 11:37:52 -0700 (PDT) On Fri, Oct 20, 2023 at 09:40:47PM +0000, Raghavendra Rao Ananta wrote: [...] > + /* > + * Make PMCR immutable once the VM has started running, but > + * do not return an error to meet the existing expectations. > + */ > + if (kvm_vm_has_ran_once(vcpu->kvm)) { > + mutex_unlock(&kvm->arch.config_lock); > + return 0; > + } Marc pointed out offline that PMCR_EL0 needs to be mutable at runtime as well. I'll admit, the architecture isn't very helpful as it is both used for identification _and_ configuration. What I had in mind a few revisions ago when I gave the suggestion was to ignore writes to _just_ the PMCR_EL0.N field after the VM has started. -- Thanks, Oliver