From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 D9E29266B8 for ; Thu, 12 Oct 2023 15:33:30 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="NnslaW/J" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 47B74C433C8; Thu, 12 Oct 2023 15:33:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1697124810; bh=CwPhnvWDnEUB2iMIpyueJqopC6r4NltRgZimGQqlmpo=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=NnslaW/Jd/KRdVuwnn8qm9tC6AFgcxoSAQI2y2v82MBuQv3EGWVX/iqqOX9dYJswH NOt+xKjbiCNubMwcFqN0TRyuu5xdjlH9aoufJMxtJXKy54pj0semAuKfFCfxQ6ELaV B5B8RSWM2nlB5tDOyr7dbAPqwRNTf6OkFgyRI1e9bC03Bd5YX/o7dYFDS5QpKtZMWs ytwOiOwyPE7sPuDE7Os1iscZrD/fweJdYGb9cIg/ttztIt6dNMbI6yf1n8CCZZmYPp 6tixvja0rhHbrRSg58x1i7YjDnaUXTFKJHW4Gc39RuHGMeIzUQEVHmXocUKOMWqDBP a8Iv8J2Kl/DFA== Received: from [104.132.0.108] (helo=wait-a-minute.misterjones.org) by disco-boy.misterjones.org with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.95) (envelope-from ) id 1qqxgl-003a1O-Kf; Thu, 12 Oct 2023 16:33:27 +0100 Date: Thu, 12 Oct 2023 16:33:25 +0100 Message-ID: <87zg0nlut6.wl-maz@kernel.org> From: Marc Zyngier To: Joey Gouly Cc: linux-arm-kernel@lists.infradead.org, oliver.upton@linux.dev, kvmarm@lists.linux.dev, Suzuki K Poulose , James Morse , Zenghui Yu Subject: Re: [PATCH v1 1/2] KVM: arm64: add nPIR{E0}_EL1 to HFG traps In-Reply-To: <20231012123459.2820835-2-joey.gouly@arm.com> References: <20231012123459.2820835-1-joey.gouly@arm.com> <20231012123459.2820835-2-joey.gouly@arm.com> User-Agent: Wanderlust/2.15.9 (Almost Unreal) SEMI-EPG/1.14.7 (Harue) FLIM-LB/1.14.9 (=?UTF-8?B?R29qxY0=?=) APEL-LB/10.8 EasyPG/1.0.0 Emacs/28.2 (x86_64-pc-linux-gnu) MULE/6.0 (HANACHIRUSATO) Precedence: bulk X-Mailing-List: kvmarm@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") Content-Type: text/plain; charset=US-ASCII X-SA-Exim-Connect-IP: 104.132.0.108 X-SA-Exim-Rcpt-To: joey.gouly@arm.com, linux-arm-kernel@lists.infradead.org, oliver.upton@linux.dev, kvmarm@lists.linux.dev, suzuki.poulose@arm.com, james.morse@arm.com, yuzenghui@huawei.com X-SA-Exim-Mail-From: maz@kernel.org X-SA-Exim-Scanned: No (on disco-boy.misterjones.org); SAEximRunCond expanded to false Hi Joey, Please Cc all the reviewers, not only Oliver and me. On Thu, 12 Oct 2023 13:34:58 +0100, Joey Gouly wrote: > > nPIR_EL1 and nPIREO_EL1 are part of the 'reverse polarity' set of bits, set > them so that we disable the traps for a guest. It would have been helpful to indicate where these bits were defined, as they are not published in the ARM ARM. For the record, they live in the XML files available at [1]. If we're adding these, we also need to add the FGT emulation for nested, which doesn't describe these bits: diff --git a/arch/arm64/kvm/emulate-nested.c b/arch/arm64/kvm/emulate-nested.c index 34075185af8e..f564e9b075d5 100644 --- a/arch/arm64/kvm/emulate-nested.c +++ b/arch/arm64/kvm/emulate-nested.c @@ -977,6 +977,8 @@ enum fg_filter_id { static const struct encoding_to_trap_config encoding_to_fgt[] __initconst = { /* HFGRTR_EL2, HFGWTR_EL2 */ + SR_FGT(SYS_PIR_EL1, HFGxTR, nPIR_EL1, 0), + SR_FGT(SYS_PIRE0_EL1, HFGxTR, nPIRE0_EL1, 0), SR_FGT(SYS_TPIDR2_EL0, HFGxTR, nTPIDR2_EL0, 0), SR_FGT(SYS_SMPRI_EL1, HFGxTR, nSMPRI_EL1, 0), SR_FGT(SYS_ACCDATA_EL1, HFGxTR, nACCDATA_EL1, 0), I'll amend the commit message locally and fold this in. M. [1] https://developer.arm.com/downloads/-/exploration-tools -- Without deviation from the norm, progress is not possible.