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 0647F7B for ; Wed, 26 Oct 2022 16:13:49 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 96181C433C1; Wed, 26 Oct 2022 16:13:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1666800829; bh=x93/khaXlRCatsMEANaWEYCDaeWhu6dOCqRcsw0BP0k=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=NxNYL84TSE6CRV+29ZKI13W4RPTD6O07Rjzy+Yraw7y2VpX4xRx8AXVoxLp0bHOEW oqbtDXvAMDCnZQvgi1zOZ5443xDMxH2bsXXtx7BWJ4KBpINzM4299bud0vLMlslfdA brMBcvGkpN0xx+1e3Jq2JXwYN+6Lu0CJ7shVdJUmCXWGUMMrQTCuUpnfHJL0iUzdSy U46yTEPMAJ2WzCN/cc9oYTjDT34MUdUJ7/8/FiOXykakaR8a23indRKagM8+RI0R2u lykJC0KNQrXaUQBmqWoVAadvdHS71P1bcngZCPRNf50jhJXBly70nls4J2JyoZbc9f lxXaJMmFiZ6gg== 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 1onj2J-001n35-9x; Wed, 26 Oct 2022 17:13:47 +0100 Date: Wed, 26 Oct 2022 17:13:46 +0100 Message-ID: <86ilk6ef5x.wl-maz@kernel.org> From: Marc Zyngier To: Mark Brown , Peter Maydell Cc: Vincent Donnefort , kvmarm@lists.linux.dev, catalin.marinas@arm.com, will@kernel.org Subject: Re: Hang with nVHE mode and SME In-Reply-To: References: 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/27.1 (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: broonie@kernel.org, peter.maydell@linaro.org, vdonnefort@google.com, kvmarm@lists.linux.dev, catalin.marinas@arm.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 + Peter On Wed, 26 Oct 2022 16:07:21 +0100, Mark Brown wrote: > > On Wed, Oct 26, 2022 at 03:29:44PM +0100, Vincent Donnefort wrote: > > > static void __activate_traps(struct kvm_vcpu *vcpu) > > { > > ... > > if (cpus_have_final_cap(ARM64_SME)) { > > // HANG ! > > You're not entirely specific on where the hang is - I assume you mean > the second SME block and that it's hanging on the first sysreg read in > there: > > if (cpus_have_final_cap(ARM64_SME)) { > u64 val; > > val = read_sysreg_s(SYS_HFGRTR_EL2); > > rather than on the if statement? A brief grep around the qemu source > suggests that this register and fine grained traps in general are not > implemented which is invalid with SME since this is required for SME in > nVHE. SME is a v9.2 feature, and v9.2 includes all the requirements of > v8.7. FEAT_FGT has been mandatory since v8.6 (where it was added). It is very unfortunate that the SME spec doesn't call out this explicitly, while it is calling out the dependency on FEAT_HCX (OK, one is mandatory and the other isn't). > I did originally have a check in there for either/both this or FEAT_HCX > but it got taken out during review due to the architecturual > requirement. So the question is whether we work around this in the kernel (not enabling either KVM or SME if FEAT_FGT is not present), or leave it as is with the hope that QEMU gets updated. I'm inclined to do the latter. Thoughts anyone? Thanks, M. -- Without deviation from the norm, progress is not possible.