From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 72CC8C25B47 for ; Tue, 24 Oct 2023 18:37:46 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1343489AbjJXShp (ORCPT ); Tue, 24 Oct 2023 14:37:45 -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 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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