From patchwork Fri Feb 9 10:37:19 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joey Gouly X-Patchwork-Id: 13551034 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 BB1DAC4828F for ; Fri, 9 Feb 2024 10:37:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-Id:Date:Subject:Cc :To:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=ZRwSRwB+G3PGCKh5SBCIpAwUO4NUV/KFXdXgRNw11XU=; b=Ye6Q0USwNFe6Td 0hbhbMarotkciacu+6IX5nGkt+u6PHcXXsX5jI2y0676IW21XHXY9MMAZCK0KLihnVz6X19qEcatU D2YC0BQYQAvhqjVkFV6H6Ac9Fv0YyJWE2hDMdGWcd62b8nkMRZtkKH5jMDRFEOaBG9xOpax3y3xCU W781ywjhcQ1ZJBMvAyy8oHez09R7j27S6mXQrkyQbZB0xGmxiKNJi71y8yMus1pEgxF9xS/gNQv5s 9juyYvwa+zSxTUTeoqvxp12vkn+fhwtblvBULjNJa+YuemquvBZcdlFIS1GUMJZa+orEV0bWrrvP1 h3RqF1R2FZpBvevirdEQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1rYOGG-0000000Gjo2-2sLE; Fri, 09 Feb 2024 10:37:36 +0000 Received: from foss.arm.com ([217.140.110.172]) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1rYOGD-0000000Gjmy-2REd for linux-arm-kernel@lists.infradead.org; Fri, 09 Feb 2024 10:37:34 +0000 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 83C20DA7; Fri, 9 Feb 2024 02:38:11 -0800 (PST) Received: from e124191.cambridge.arm.com (e124191.cambridge.arm.com [10.1.197.45]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id F15A23F5A1; Fri, 9 Feb 2024 02:37:27 -0800 (PST) From: Joey Gouly To: kvmarm@lists.linux.dev Cc: broonie@kernel.org, joey.gouly@arm.com, maz@kernel.org, oliver.upton@linux.dev, linux-arm-kernel@lists.infradead.org, Catalin Marinas , Will Deacon , James Morse , Suzuki K Poulose , Zenghui Yu Subject: [PATCH v1] KVM: arm64: print Hyp mode Date: Fri, 9 Feb 2024 10:37:19 +0000 Message-Id: <20240209103719.3813599-1-joey.gouly@arm.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240209_023733_698402_9618CD8E X-CRM114-Status: UNSURE ( 9.43 ) X-CRM114-Notice: Please train this message. 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 Print which of the hyp modes is being used (hVHE, nVHE). Signed-off-by: Joey Gouly Cc: Marc Zyngier Cc: Oliver Upton Cc: Mark Brown Reviewed-by: Mark Brown --- From what I could tell there isn't a way to tell which of the two modes was actually booted in, and this could be useful for looking at log outputs. arch/arm64/kvm/arm.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/arch/arm64/kvm/arm.c b/arch/arm64/kvm/arm.c index a25265aca432..090dbc954157 100644 --- a/arch/arm64/kvm/arm.c +++ b/arch/arm64/kvm/arm.c @@ -2591,7 +2591,8 @@ static __init int kvm_arm_init(void) } else if (in_hyp_mode) { kvm_info("VHE mode initialized successfully\n"); } else { - kvm_info("Hyp mode initialized successfully\n"); + char mode = cpus_have_final_cap(ARM64_KVM_HVHE) ? 'h' : 'n'; + kvm_info("Hyp mode (%cVHE) initialized successfully\n", mode); } /*