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 4B565CCA470 for ; Wed, 8 Oct 2025 10:47:08 +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=MiTIWwfeeAXlVChs3G//n84uxIKj2mEqXmosLmGZOGI=; b=LaYUC2nJrZb1sNzGTISQgiDJUY kGP6s249aLiursMq468zJaX4R3QYj5zTT5Geuu0y9UygN09pAJkbCHtoWzCTow6DnZVVCHbXoTOwZ lwS9LY23Xx02L95ldDbZNFTUy39dJlpwBjHzSxT2mNETuYmMi6cqkUt3xq2Tw3OLzWFA/MjrkblR/ gZ0ikhKdTb3ARWwBhgwN7wMV3vyayo9jqMZtO9bl80f5wCvB6PQxGgKf+AwDNHryumQaqWZfHBbjl u8gBu+OQv5BEK5frRT9re3wSuS8NqMQUGCI5teORDCve/WDmhAhaqEdLqLFq4tGhvUBY6xiPkiQTz yLWEJ56g==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98.2 #2 (Red Hat Linux)) id 1v6RhE-00000003fag-3RaY; Wed, 08 Oct 2025 10:47:00 +0000 Received: from tor.source.kernel.org ([172.105.4.254]) by bombadil.infradead.org with esmtps (Exim 4.98.2 #2 (Red Hat Linux)) id 1v6RhD-00000003faX-2hiR for linux-arm-kernel@lists.infradead.org; Wed, 08 Oct 2025 10:46:59 +0000 Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by tor.source.kernel.org (Postfix) with ESMTP id C59F361F4C; Wed, 8 Oct 2025 10:46:58 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 76FFCC4CEF4; Wed, 8 Oct 2025 10:46:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1759920418; bh=0Zfd3JxG/MTE4sDHQ96evynt+Sey4zJnf0P/n9lbvOU=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=XG8n+htWjrOEkpSmgMN4IruinvuWQMwSD8FNAFO/gGncG9Rtz+UsPsWbvupvfUFal aF3pVD5rIjq8/qA0z4lH8qW/rfFxonQajk4nGiKcN1R5wYLACiqvqyJ6gUWnX6vRCg +csuqh4gLbPBpjtaEcUCYGfVrkP5ftsoIJfchdoOF8qJRBut5sDu7lT7fKduZBF2vD lC2+5rvGuSCGxHJlNsXUbRvNCA0WjThiPim3QDvmp1oXEQK09X6CV5VNN6rBfP9vE6 OvBP9tOdFxpi63q45YmLS2Z2SAJ3QVIyjRokKcWYDwiEDL0gwFLuGWwi5IwMDsyS5I +SLu5GeSAxfNg== 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.98.2) (envelope-from ) id 1v6RhA-0000000CKEh-0xjF; Wed, 08 Oct 2025 10:46:56 +0000 Date: Wed, 08 Oct 2025 11:46:55 +0100 Message-ID: <861pndzn4w.wl-maz@kernel.org> From: Marc Zyngier To: Mukesh Ojha , Oliver Upton Cc: joey.gouly@arm.com, suzuki.poulose@arm.com, yuzenghui@huawei.com, catalin.marinas@arm.com, will@kernel.org, alexandru.elisei@arm.com, linux-arm-kernel@lists.infradead.org, kvmarm@lists.linux.dev, linux-kernel@vger.kernel.org Subject: Re: [PATCH] KVM: arm64: Check cpu_has_spe() before initializing PMSCR_EL1 in VHE In-Reply-To: References: <20251007182356.2813920-1-mukesh.ojha@oss.qualcomm.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/30.1 (aarch64-unknown-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: mukesh.ojha@oss.qualcomm.com, oliver.upton@linux.dev, joey.gouly@arm.com, suzuki.poulose@arm.com, yuzenghui@huawei.com, catalin.marinas@arm.com, will@kernel.org, alexandru.elisei@arm.com, linux-arm-kernel@lists.infradead.org, kvmarm@lists.linux.dev, 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-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 Tue, 07 Oct 2025 19:31:45 +0100, Oliver Upton wrote: > > Hi Mukesh, > > I find it a bit odd to refer to cpu_has_spe() in the shortlog, which > doesn't exist prior to this patch. > > On Tue, Oct 07, 2025 at 11:53:56PM +0530, Mukesh Ojha wrote: > > commit efad60e46057 ("KVM: arm64: Initialize PMSCR_EL1 when in VHE") > > initializes PMSCR_EL1 to 0 which is making the boot up stuck when KVM > > runs in VHE mode and reverting the change is fixing the issue. > > > > [ 2.967447] RPC: Registered tcp NFSv4.1 backchannel transport module. > > [ 2.974061] PCI: CLS 0 bytes, default 64 > > [ 2.978171] Unpacking initramfs... > > [ 2.982889] kvm [1]: nv: 568 coarse grained trap handlers > > [ 2.988573] kvm [1]: IPA Size Limit: 40 bits > > > > Lets guard the change with cpu_has_spe() check so that it only affects > > the cpu which has SPE feature supported. > > This could benefit from being spelled out a bit more. In both cases we > check for the presence of FEAT_SPE, however I believe the issue you > observe is EL3 hasn't delegated ownership of the Profiling Buffer to > Non-secure nor does it reinject an UNDEF in response to the sysreg trap. > > I agree that the change is correct but the rationale needs to be clear. To me, this smells a lot more like some sort of papering over a firmware bug. Why isn't SPE available the first place? M. -- Without deviation from the norm, progress is not possible.