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 3B0848BFF for ; Tue, 25 Jul 2023 14:00:44 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id B8EDAC433C7; Tue, 25 Jul 2023 14:00:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1690293644; bh=a5y2oEWB0ubM+SnxTGmkE/ppS3cO6wgWAV731t5d8ag=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=rn9/9NFf+AFUJyf8pOtS+eVNm8FvQ5/XUHuLNgNI8o02KUzAmjMhz9J5geGwvpx9o AOBjd8jEmuffIJxaRu9z/vSunTmFkmmy8BKDW0PjYdXSRSwvGxFsNC+XeuR84kITnT yHTFuZ04VWn8umMfg/Pg29uBYFESOco3DyHx1REt80mRR094ELW7V93GGNEuxWo0zO X3KWlycAugwsq6pxHAn4vnERPYe26c/VCNGpZcyFQ7p5tbMj6cikOrWBDesqVL7woS /riSD79e6sb6AfnR+Q3RK3QoPAs7198Q4kIA0YIsrQ2OZuAdNJZrOfQc4IG/USMeXN eLecPZQ6LM/Hg== Received: from sofa.misterjones.org ([185.219.108.64] helo=goblin-girl.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 1qOIag-00Gimy-7d; Tue, 25 Jul 2023 15:00:42 +0100 Date: Tue, 25 Jul 2023 15:00:41 +0100 Message-ID: <86lef4t7jq.wl-maz@kernel.org> From: Marc Zyngier To: Fuad Tabba Cc: kvmarm@lists.linux.dev, oliver.upton@linux.dev, catalin.marinas@arm.com, james.morse@arm.com, suzuki.poulose@arm.com, yuzenghui@huawei.com, will@kernel.org Subject: Re: [PATCH v3 0/7] Fix setting SVE and SME traps in (h)VHE In-Reply-To: <20230724123829.2929609-1-tabba@google.com> References: <20230724123829.2929609-1-tabba@google.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 (aarch64-unknown-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: 185.219.108.64 X-SA-Exim-Rcpt-To: tabba@google.com, kvmarm@lists.linux.dev, oliver.upton@linux.dev, catalin.marinas@arm.com, james.morse@arm.com, suzuki.poulose@arm.com, yuzenghui@huawei.com, will@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 Mon, 24 Jul 2023 13:38:21 +0100, Fuad Tabba wrote: > > Hi, > > Changes from V2: > - Rebased onto Linux 6.5-rc3 > - s/__check_e2h/__check_hvhe/g (Oliver) > - Fixed bug in calculating CPACR_EL1 reset value for hVHE in > trapping SVE > > Changes from V1: > - Expanded the cover letter to clarify the reasoning behind being > consistent in writing to the architectural trap register based on > the KVM mode (Marc) > - Factored out the code for checking E2H into a macro (Oliver) > - Factored out the code that selects which register to write to > into a function (Oliver) > > The (re)setting and disabling of SVE/SME trap handling (mostly) > done for the hVHE work [*] misses a couple of cases. > > This patch series ensures that these traps are disabled on setup > and reset. Moreover, it makes the code consistent in using > CPACR_EL1 or CPTR_EL2, depending on the mode. > > CPACR_EL1 aliases to CPTR_EL2 when HCR_EL2.E2H == 1, but by being > consistent we don't need to issue a synchronisation when > alternating between one or the other accessor. Moreover, when > running hVHE under NV, we don't trap unnecessarily on accessing > CPTR_EL2, while CPACR_EL1 can be used directly without any trap. > > Based on Linux 6.5-rc3. Reviewed-by: Marc Zyngier M. -- Without deviation from the norm, progress is not possible.