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 mm01.cs.columbia.edu (mm01.cs.columbia.edu [128.59.11.253]) by smtp.lore.kernel.org (Postfix) with ESMTP id 0D0A7ECAAD5 for ; Sat, 10 Sep 2022 09:09:29 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by mm01.cs.columbia.edu (Postfix) with ESMTP id 6F6EC4BF89; Sat, 10 Sep 2022 05:09:29 -0400 (EDT) X-Virus-Scanned: at lists.cs.columbia.edu Authentication-Results: mm01.cs.columbia.edu (amavisd-new); dkim=softfail (fail, message has been altered) header.i=@kernel.org Received: from mm01.cs.columbia.edu ([127.0.0.1]) by localhost (mm01.cs.columbia.edu [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id wcQK3qKNprhL; Sat, 10 Sep 2022 05:09:28 -0400 (EDT) Received: from mm01.cs.columbia.edu (localhost [127.0.0.1]) by mm01.cs.columbia.edu (Postfix) with ESMTP id 451474BF94; Sat, 10 Sep 2022 05:09:28 -0400 (EDT) Received: from localhost (localhost [127.0.0.1]) by mm01.cs.columbia.edu (Postfix) with ESMTP id 7DEDB4BF8A for ; Sat, 10 Sep 2022 05:09:27 -0400 (EDT) X-Virus-Scanned: at lists.cs.columbia.edu Received: from mm01.cs.columbia.edu ([127.0.0.1]) by localhost (mm01.cs.columbia.edu [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 6KHEg9Q5X40A for ; Sat, 10 Sep 2022 05:09:26 -0400 (EDT) Received: from sin.source.kernel.org (sin.source.kernel.org [145.40.73.55]) by mm01.cs.columbia.edu (Postfix) with ESMTPS id E21A94BF89 for ; Sat, 10 Sep 2022 05:09:25 -0400 (EDT) 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 sin.source.kernel.org (Postfix) with ESMTPS id 98046CE08D0; Sat, 10 Sep 2022 09:09:22 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id D2596C433C1; Sat, 10 Sep 2022 09:09:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1662800960; bh=RBTEOuGRLzNZfi5Rv1YAEAy4+shLaNRM/hNJR+C8rVc=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=MSVfrspXN74VRKeCbl/TKK3UBdgCUkDzyvp05cX+CrkWoT1JZwfv0Yxoww6x9lcTf 2ZebxrmfFmK5l4yDemqiOtdRH30Gjbx2bmj1NCCBzY/NBP1AURPMAVGL6+ZxE6Vk/a u2MB/j+PHPMu4tGRr+y/2DXBE13HsVobL5uW3yOilcMaO+T+n0wFUzYbO6SZJaFD/X +I4MB9FSg5DQOl91Hq0xv68StTNgkuUb1rK/Z++xqy7O5HIT2xiLm3c+frRup5gjTJ KbYwXaYNgTwePuU06t29YO+kbplCQz9MFB/rvHfKCqzp5T5p2zfFnymTDV+TeI3jDO 0sARXOMFDsndg== Received: from sofa.misterjones.org ([185.219.108.64] 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 1oWwUI-009Nkm-Ir; Sat, 10 Sep 2022 10:09:18 +0100 Date: Sat, 10 Sep 2022 10:09:31 +0100 Message-ID: <878rmrr3xw.wl-maz@kernel.org> From: Marc Zyngier To: Elliot Berman Subject: Re: [PATCH v2] KVM: arm64: Only set KVM_MODE_PROTECTED if is_hyp_mode_available() In-Reply-To: <05057e2a-1a85-69ba-ffcd-584d4090467a@quicinc.com> References: <20220909144552.3000716-1-quic_eberman@quicinc.com> <05057e2a-1a85-69ba-ffcd-584d4090467a@quicinc.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/27.1 (x86_64-pc-linux-gnu) MULE/6.0 (HANACHIRUSATO) MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") X-SA-Exim-Connect-IP: 185.219.108.64 X-SA-Exim-Rcpt-To: quic_eberman@quicinc.com, catalin.marinas@arm.com, will@kernel.org, james.morse@arm.com, alexandru.elisei@arm.com, suzuki.poulose@arm.com, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, kvmarm@lists.cs.columbia.edu X-SA-Exim-Mail-From: maz@kernel.org X-SA-Exim-Scanned: No (on disco-boy.misterjones.org); SAEximRunCond expanded to false Cc: Catalin Marinas , linux-kernel@vger.kernel.org, Will Deacon , kvmarm@lists.cs.columbia.edu, linux-arm-kernel@lists.infradead.org X-BeenThere: kvmarm@lists.cs.columbia.edu X-Mailman-Version: 2.1.14 Precedence: list List-Id: Where KVM/ARM decisions are made List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: kvmarm-bounces@lists.cs.columbia.edu Sender: kvmarm-bounces@lists.cs.columbia.edu On Fri, 09 Sep 2022 18:55:18 +0100, Elliot Berman wrote: > > > > On 9/9/2022 10:28 AM, Catalin Marinas wrote: > > 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. > > > > Does it make sense to print warning for kvm-arm.mode=nvhe as well? In general, specifying a kvm-arm.mode when no hypervisor mode is available should be reported as a warning. Thanks, M. -- Without deviation from the norm, progress is not possible. _______________________________________________ kvmarm mailing list kvmarm@lists.cs.columbia.edu https://lists.cs.columbia.edu/mailman/listinfo/kvmarm