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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 0B7B0CF8878 for ; Sat, 5 Oct 2024 13:20:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Type:MIME-Version: References:In-Reply-To:Subject:Cc:To:From:Message-ID:Date:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=qQJvCgrhqSyhISushVpu/9RShgItJqOY1nVy5PZHjTg=; b=CgiT6IN1A1OKU4LpyZx0yqzWsd jfCM+X46x3VjXJHzLxhaZ4sQftsKWjSkUiMUiPQ/tkSfupY3YwQDBwims/2e0GtgWxFIkViUvED/7 pHLTwZM5fiU41fpHVq2blbqlDpmzJV5MEmkqjdqw4VL36qHU/GSnT5U2EPxMMVCORyqDaX+O4RtUN kQ5Clcix3otgiANYcSjJMefSVfNQpAhVApLpUsrJDUxRO3/irIZep9aPthJvDOMqu0fdG0aWogY3D Ny0KFvdqS3Rd8eS5eq81OMz3PYL74/CBq35ae5aztdqxVAt+rLUX2KhJBacGpp82m27HM5wUtm6g1 N+XYa8CQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1sx4hp-0000000FOdx-3noQ; Sat, 05 Oct 2024 13:20:21 +0000 Received: from dfw.source.kernel.org ([2604:1380:4641:c500::1]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1sx4gY-0000000FOVR-1Tuu for linux-arm-kernel@lists.infradead.org; Sat, 05 Oct 2024 13:19:03 +0000 Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by dfw.source.kernel.org (Postfix) with ESMTP id 74A165C56B5; Sat, 5 Oct 2024 13:18:56 +0000 (UTC) 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) 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 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20241005_061902_458790_8B03879A X-CRM114-Status: GOOD ( 19.36 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org 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.