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 DE173139578; Sat, 5 Oct 2024 13:19:00 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728134341; cv=none; b=S4E75WwYGN03HwCSobWjmq865yA+14mVRU/XG3LUi/cluNGHM5ZN+3uzmh+f09IIoYiXAor9noXaykOyJcxJaJpKQPcGxmIwAoc2rPKl/jyxLugbp7cPT593DxUFtDxTAPJsqwD+ngmwTZbN+kqc7quGZt/sTL25+DDOAfMwWgc= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728134341; c=relaxed/simple; bh=LUOE69YR/KfFB2xjqDNC6Kcee5QGBsgi01+huJ+n4Gw=; h=Date:Message-ID:From:To:Cc:Subject:In-Reply-To:References: MIME-Version:Content-Type; b=dKfJHd0i/YWgEz2pK6nQF8FZuS4vGZVQpHidXQClFteR3AlkHFeiku791GlgGOeblSpZE8JXHHzPBFcKGV1FfGIl5QNyETs0qjswe/2C4p+kXeLQ3LkyQsJwvIi0DpuYQQZBPxMI4IwwAc0UHK4KY6zyG+lZuZoO6ci6xHxGRq4= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=Dm90r9I5; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="Dm90r9I5" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 4F349C4CEC2; Sat, 5 Oct 2024 13:19:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1728134340; bh=LUOE69YR/KfFB2xjqDNC6Kcee5QGBsgi01+huJ+n4Gw=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=Dm90r9I54UDByy0pHmuhgwbeNeM7YF14ZpeCTGboS/m+6kRJPmaDVVdEKDBsjVauD aMOg3To1mbfHDxKAxxBectmIgIzQ008qMxtKoVe8UChbg94DbJuHFuBYddF33YpLxM vOVK49r901W1pn+n9WY+aZ/WfPR2ecnc+99K5B3ljmMWZ/LgRnBXXsuSNiSc+oiF0G 1+NKH73aJketkgHaN1Z+rdjdQy7SGtKfVCeLxvtLs9zPYWc+O3ivS2oZ9+/MLd7b7X QrsKPMzsv82uiS5H5MrHJZ1w+HAoVsyfyr0Nhs+34yFxV0YUGzR+N15RKz9/Wm5tXz lu1iuDPnlHtyQ== Received: from sofa.misterjones.org ([185.219.108.64] 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 1sx4gU-000bkS-AH; Sat, 05 Oct 2024 14:18:58 +0100 Date: Sat, 05 Oct 2024 14:18:57 +0100 Message-ID: <87frpavgam.wl-maz@kernel.org> From: Marc Zyngier To: Mark Brown Cc: Catalin Marinas , Will Deacon , Oliver Upton , Joey Gouly , Suzuki K Poulose , Shuah Khan , linux-arm-kernel@lists.infradead.org, linux-doc@vger.kernel.org, kvmarm@lists.linux.dev, linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v14 3/5] KVM: arm64: Manage GCS access and registers for guests In-Reply-To: References: <20241005-arm64-gcs-v14-0-59060cd6092b@kernel.org> <20241005-arm64-gcs-v14-3-59060cd6092b@kernel.org> <87iku6vl4z.wl-maz@kernel.org> 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/29.4 (x86_64-pc-linux-gnu) MULE/6.0 (HANACHIRUSATO) Precedence: bulk X-Mailing-List: linux-doc@vger.kernel.org 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: 185.219.108.64 X-SA-Exim-Rcpt-To: broonie@kernel.org, catalin.marinas@arm.com, will@kernel.org, oliver.upton@linux.dev, joey.gouly@arm.com, suzuki.poulose@arm.com, shuah@kernel.org, linux-arm-kernel@lists.infradead.org, linux-doc@vger.kernel.org, kvmarm@lists.linux.dev, linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org X-SA-Exim-Mail-From: maz@kernel.org X-SA-Exim-Scanned: No (on disco-boy.misterjones.org); SAEximRunCond expanded to false On Sat, 05 Oct 2024 14:08:39 +0100, Mark Brown wrote: > > On Sat, Oct 05, 2024 at 12:34:20PM +0100, Marc Zyngier wrote: > > Mark Brown wrote: > > > > + if (!kvm_has_gcs(kvm)) { > > > + kvm->arch.fgu[HFGxTR_GROUP] |= (HFGxTR_EL2_nGCS_EL0 | > > > + HFGxTR_EL2_nGCS_EL1); > > > + kvm->arch.fgu[HFGITR_GROUP] |= (HFGITR_EL2_nGCSEPP | > > > + HFGITR_EL2_nGCSSTR_EL1 | > > > + HFGITR_EL2_nGCSPUSHM_EL1); > > > Where is the handling of traps resulting of HFGITR_EL2.nGCSSTR_EL1? > > These will trap with an EC of 0x2d which isn't known so I was expecting > this to get handled in the same way as for example a return of false > from kvm_hyp_handle_fpsimd() for SVE when unsupported, or for the > simiarly unknown SME EC, currently. I gather from your comment that > you're instead expecting to see an explicit exit handler for this EC > that just injects the UNDEF directly? Not just inject an UNDEF directly, but also track whether this needs to be forwarded when the guest's HFGITR_EL2.nGCSSTR_EL1 is 0 while not being not RES0. Basically following what the pseudocode describes. M. -- Without deviation from the norm, progress is not possible.