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 48C3CECAAD3 for ; Fri, 9 Sep 2022 17:29:43 +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:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=jUmOEEj8dsvnoyY0QBSok8nzdO7wNn9rmpdT7pzv3zw=; b=qJStoEulGoDAO2 2lkceQve2azzMtVzl4hF55Snp+aXeajQ/T68UgoJb6p8CxX2EOmSy4FBoJVbYGMcs1K8RsXXKA3o6 JuW2WKBy6haVcvh0AkNVQg/T19ylXhze4YOyvG30KGIekYWsa8xEzkt9Mjajjuqwgq455PGhVs4MS sZWOu2phCSsFYIdUKmdawCwsHPf6bgTF+2NfTKBe/NaBMvO4greFWaJEg9HqY2dnL3odAD07P8u+K 8CNzxuoWiiz19vK6LeKxu7m6eKjJTXBv4BKuQZX6GDPfx8CjqGQdJ6wo5p7AwpCD6km8a3Ci4epSv ZLV7LuD84MownQmacELw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1oWho6-000kGP-QN; Fri, 09 Sep 2022 17:28:46 +0000 Received: from ams.source.kernel.org ([2604:1380:4601:e00::1]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1oWho3-000kDQ-NJ for linux-arm-kernel@lists.infradead.org; Fri, 09 Sep 2022 17:28:45 +0000 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 ams.source.kernel.org (Postfix) with ESMTPS id 47939B82588; Fri, 9 Sep 2022 17:28:41 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 619F1C433D6; Fri, 9 Sep 2022 17:28:38 +0000 (UTC) Date: Fri, 9 Sep 2022 18:28:34 +0100 From: Catalin Marinas To: Elliot Berman Cc: Will Deacon , Marc Zyngier , James Morse , Alexandru Elisei , Suzuki K Poulose , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, kvmarm@lists.cs.columbia.edu Subject: Re: [PATCH v2] KVM: arm64: Only set KVM_MODE_PROTECTED if is_hyp_mode_available() Message-ID: References: <20220909144552.3000716-1-quic_eberman@quicinc.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20220909144552.3000716-1-quic_eberman@quicinc.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220909_102843_917723_6F449FD4 X-CRM114-Status: GOOD ( 19.14 ) 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: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Fri, Sep 09, 2022 at 07:45:52AM -0700, Elliot Berman wrote: > Do not switch kvm_mode to KVM_MODE_PROTECTED if hypervisor mode is not > available. This prevents "Protected KVM" cpu capability being reported > when Linux is booting in EL1 and would not have KVM enabled. > > Signed-off-by: Elliot Berman > --- > arch/arm64/kvm/arm.c | 4 +++- > 1 file changed, 3 insertions(+), 1 deletion(-) > > diff --git a/arch/arm64/kvm/arm.c b/arch/arm64/kvm/arm.c > index 8fe73ee5fa84..861f4b388879 100644 > --- a/arch/arm64/kvm/arm.c > +++ b/arch/arm64/kvm/arm.c > @@ -2272,7 +2272,9 @@ static int __init early_kvm_mode_cfg(char *arg) > return -EINVAL; > > if (strcmp(arg, "protected") == 0) { > - if (!is_kernel_in_hyp_mode()) > + if (!is_hyp_mode_available()) > + kvm_mode = KVM_MODE_DEFAULT; I think kvm_mode is already KVM_MODE_DEFAULT at this point. You may want to print a warning instead. -- Catalin _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel