Received: by 2002:ab2:6991:0:b0:1f7:f6c3:9cb1 with SMTP id v17csp646939lqo; Wed, 8 May 2024 10:18:58 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUhgMN8RL6fE3a/hlG7Y5DV/X+UAMwdsjw3t0/N46qYAX26cPMYtbt3H9Bu7LvpziR77uo6ms/rFaBsiK7gCxeIwkp8N47n/G8wZd7hiA== X-Google-Smtp-Source: AGHT+IHpUY8kCC2wocu92k8Ty8lSlZul6xZrp1a3flY3NkC2xi1u5oT+b9WoKNnnBGWyhiCeFT1G X-Received: by 2002:a17:90b:4b86:b0:2a7:329c:7976 with SMTP id 98e67ed59e1d1-2b65fa1ec53mr376380a91.8.1715188738095; Wed, 08 May 2024 10:18:58 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1715188738; cv=pass; d=google.com; s=arc-20160816; b=P7Pdu5WcKB8Cj7QtoaNO7bzk7pGNd9k/3OR3HGn8RhEtnYVtR2c9EcN/XC/zOpU0RU fUyn7N+3hXS7fPlV4yUaxao31cHXI0uGuOLJEG8bf9fOtWGKwYkIV5MVwyVWQnOB//gr uFBS119GYXSGQQxa/JKpWFkEiHWoj6mGEsyIHD0MVfdsxZjGJYmFPHv9campzZdlmbwp yivnWYTZpb3oFS0nkpeDUDTIhi/uJ7ASbhsArpG/Ov8YN9/QjH9Z/bfPZ0Vj9BTn64/z fmuwku97O1OToOmZJkNOV6Lz7vZP6wMcLXrCA40RvGv7uhcPiKHJxUQ65m7a0zH4RGid e+MA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:dkim-signature:date; bh=BZ3larZmFR+bN7ztPWWRwB/fEtXJTQLP/bM1SI4qrog=; fh=dC6bgcv1LZxbrPgO2LLLE9/fKqigeIojCZwwV9paWH4=; b=F4kpK9juuIorIZE2G2RRC7JoDEvHbijJh67AZvEcy0i5642j0s9TuqUu9TJZ0On801 7jiacs4FnI2cZn2emnZRxwIOCKtYFt+rsGpDfplID2QK0+wp/hNUWqm9RhYBnXPbM8N2 J48FDTrRBpQhVWvbJMm6j9XIj6Z/uAAytVeTNTIpBhmjY+23BRkpdRckgZMKi96XVGAg 8B9qQNpSJLJWXMRjc5WyEmULTg5qj2AedttX+HlysrQ3hOke4cEGrXvrC1AWBDL3VCrl lPVslxwxRsmcyvkywl5b0k9u2h8S+xEe35NTrHoHcFhvpZC516j8IsjOYlPYWxOu+6rH yadA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b=NwDJPz8e; arc=pass (i=1 spf=pass spfdomain=linux.dev dkim=pass dkdomain=linux.dev dmarc=pass fromdomain=linux.dev); spf=pass (google.com: domain of linux-kernel+bounces-173613-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-173613-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.dev Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id 98e67ed59e1d1-2b628a5d46dsi1818433a91.63.2024.05.08.10.18.57 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 08 May 2024 10:18:58 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-173613-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b=NwDJPz8e; arc=pass (i=1 spf=pass spfdomain=linux.dev dkim=pass dkdomain=linux.dev dmarc=pass fromdomain=linux.dev); spf=pass (google.com: domain of linux-kernel+bounces-173613-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-173613-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.dev 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 sv.mirrors.kernel.org (Postfix) with ESMTPS id 5718B281289 for ; Wed, 8 May 2024 17:18:57 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 4F8D059165; Wed, 8 May 2024 17:18:52 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b="NwDJPz8e" Received: from out-181.mta1.migadu.com (out-181.mta1.migadu.com [95.215.58.181]) (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 BDAC914A8C for ; Wed, 8 May 2024 17:18:49 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=95.215.58.181 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715188731; cv=none; b=DdYS+8JCHNGK8GZ0IDNCHZvDF9HkxOQkehYWWmS7i/rkYYOPicApxTxCFaU9vDewUuxq1bL+MKR9OpTB4c2uBgVXVbGXz+IHhLFuOUeer0U7JEcbJJHU7I6hWR5/bm3QORtjB2UVqZR2tIjzan35WJzXx0aSoM3a6bmajrYM8Vo= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715188731; c=relaxed/simple; bh=OWpnNJ8rKooM+3S2sS4vhuD1egQMYUMnJc2NoPV4lBI=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=JHH/Gu8BFZmjKdqg/wAhaTj8u9yht4RSe0mon3OgnsSynazGvt8l3+/dQkqeY0sxAD+7mMtuhHBe1DEZDJOM+Qi7xbLY842ksYNpO5/apkoKCj15cHd9YVlr8vYE04gMO5aYvj6TH6LajejEkLmvtkkdQ4HsheZLmiDIdMB10Qo= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev; spf=pass smtp.mailfrom=linux.dev; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b=NwDJPz8e; arc=none smtp.client-ip=95.215.58.181 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.dev Date: Wed, 8 May 2024 12:18:43 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1715188727; 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=BZ3larZmFR+bN7ztPWWRwB/fEtXJTQLP/bM1SI4qrog=; b=NwDJPz8ekvICd3m5pf6iNYs5hxpRkt3eaSBLs1IpNNmQS42Udd+l+0C49g/GiWe7SSb7dI htEdA2rASUwPs+3HHkF+ag4xw1h+CKZVsRW/RmOhkx0WYFfBtua/ecjURjrexVXMD6yyXX L5V3LDOObgWF3yWn+TYc+kC8nGgVa2w= X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: Oliver Upton To: Sebastian Ott Cc: linux-arm-kernel@lists.infradead.org, kvmarm@lists.linux.dev, linux-kernel@vger.kernel.org, Marc Zyngier , James Morse , Suzuki K Poulose , Catalin Marinas , Will Deacon Subject: Re: [PATCH v2 4/6] KVM: arm64: add emulation for CTR_EL0 register Message-ID: References: <20240426104950.7382-1-sebott@redhat.com> <20240426104950.7382-5-sebott@redhat.com> <29e7b97b-7a61-9b64-2c57-5a5d0e5f190e@redhat.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <29e7b97b-7a61-9b64-2c57-5a5d0e5f190e@redhat.com> X-Migadu-Flow: FLOW_OUT On Wed, May 08, 2024 at 05:17:25PM +0200, Sebastian Ott wrote: > Hej Oliver, > > On Wed, 1 May 2024, Oliver Upton wrote: > > > +static u64 reset_ctr(struct kvm_vcpu *vcpu, const struct sys_reg_desc *rd) > > > +{ > > > + vcpu->kvm->arch.ctr_el0 = read_sanitised_ftr_reg(SYS_CTR_EL0); > > > + return vcpu->kvm->arch.ctr_el0; > > > +} > > > + > > > > We definitely do not want this value to change across a vCPU reset, it > > should be handled like the other ID registers where they only get reset > > once for the VM lifetime. > > Hm, maybe I'm misreading the code here but I don't think this is true > for existing regs e.g. CLIDR_EL1 or the stuff defined via ID_WRITABLE(). This works for the feature ID registers we maintain per-VM, but not for the feature ID registers local to a vCPU. Sent some fixes out for this but forgot to Cc you on it, apologies. https://lore.kernel.org/kvmarm/20240502233529.1958459-1-oliver.upton@linux.dev/ -- Thanks, Oliver