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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 0ADA3C77B73 for ; Sat, 3 Jun 2023 08:39:21 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236625AbjFCIjT (ORCPT ); Sat, 3 Jun 2023 04:39:19 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34176 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229654AbjFCIjR (ORCPT ); Sat, 3 Jun 2023 04:39:17 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6F31F180 for ; Sat, 3 Jun 2023 01:39:16 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id E4A6960ACD for ; Sat, 3 Jun 2023 08:39:15 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 3C829C433D2; Sat, 3 Jun 2023 08:39:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1685781555; bh=5oyiVDfccpGv2hmK2deVVQ8wi3z4MiLKb2Ddfn8bqjo=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=uylY5JgTaGj66a0uUJEklgf8Ch5Vii+rG5gQRprkqtks3BQJaBDV2srGVMHb+sh6F kxqk6onpH0svDDxJ0PyD2fxtFbOdZJBySccFcwM0Dk0Ie0ooU3m3XeHz0WDJlvk8eT ZMSOVSXeBmuHCooHb5DhnHjgpbbWFDLToIknAGTYFKLybItJaaxcowAZmhfGmRKG4s GhWrNlC7sBHoJxx13V4xUeWPNsJtufS4Mwp3VarhI4j4SRqAcx9rfcRF519Hifghba yLKHzGgPsesA/R398L4ElZ0OWHTRV7KR/FSz5t2MTzhMyCdkzpLoCNoRsC5Bgi7rT+ /F7idz3u8X7Fg== Received: from [37.166.197.171] (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 1q5Mn3-002WrG-2M; Sat, 03 Jun 2023 09:39:13 +0100 Date: Sat, 03 Jun 2023 09:39:11 +0100 Message-ID: <87wn0lndn4.wl-maz@kernel.org> From: Marc Zyngier To: Kristina Martsenko Cc: linux-arm-kernel@lists.infradead.org, kvmarm@lists.linux.dev, Catalin Marinas , Will Deacon , Oliver Upton , James Morse , Suzuki K Poulose , Zenghui Yu , Mark Rutland , Mark Brown , Luis Machado , Vladimir Murzin , linux-kernel@vger.kernel.org Subject: Re: [PATCH v2 01/11] KVM: arm64: initialize HCRX_EL2 In-Reply-To: <20230509142235.3284028-2-kristina.martsenko@arm.com> References: <20230509142235.3284028-1-kristina.martsenko@arm.com> <20230509142235.3284028-2-kristina.martsenko@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) MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") Content-Type: text/plain; charset=US-ASCII X-SA-Exim-Connect-IP: 37.166.197.171 X-SA-Exim-Rcpt-To: kristina.martsenko@arm.com, linux-arm-kernel@lists.infradead.org, kvmarm@lists.linux.dev, catalin.marinas@arm.com, will@kernel.org, oliver.upton@linux.dev, james.morse@arm.com, suzuki.poulose@arm.com, yuzenghui@huawei.com, mark.rutland@arm.com, broonie@kernel.org, luis.machado@arm.com, vladimir.murzin@arm.com, 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 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 09 May 2023 15:22:25 +0100, Kristina Martsenko wrote: > > ARMv8.7/9.2 adds a new hypervisor configuration register HCRX_EL2. > Initialize the register to a safe value (all fields 0), to be robust > against firmware that has not initialized it. This is also needed to > ensure that the register is reinitialized after a kexec by a future > kernel. > > In addition, move SMPME setup over to the new flags, as it would > otherwise get overridden. It is safe to set the bit even if SME is not > (uniformly) supported, as it will write to a RES0 bit (having no > effect), and SME will be disabled by the cpufeature framework. > (Similar to how e.g. the API bit is handled in HCR_HOST_NVHE_FLAGS.) > > Signed-off-by: Kristina Martsenko Acked-by: Marc Zyngier M. -- Without deviation from the norm, progress is not possible.