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 X-Spam-Level: X-Spam-Status: No, score=-13.9 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_ADSP_CUSTOM_MED,DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 97AF1C433E0 for ; Mon, 18 Jan 2021 13:16:40 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 5797022B49 for ; Mon, 18 Jan 2021 13:16:40 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 5797022B49 Authentication-Results: mail.kernel.org; dmarc=fail (p=reject dis=none) header.from=google.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References:Message-ID: Subject: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=J5k+gc6+fCkGJ1cLiMvwojSdN5O7YucTzyx63Iulzlw=; b=mGU7hTP8Cid5b0X3K3ZPQ8mFD rcqrE72IuEIxyJ6Oob6I9atkT5hp/hEbYFlYyruqCrSedvXPnHQo1E54IVzOIbfJnbBUc/Nmq9p2L tTAM8arE7YslyYS7oife3M4fAzKSNTcV0hYVJbWttgOKL9HcxT/cGlioTT1dkYRk6ua/bKjJCUfBv 1hh0svgY3aOaB8HFKUv372DHeAGXp47ROcgBsS+9Yff1UoUOfbS99OYl12POEDADluernrlHDh83b e7rO0Uuo0/v5NZQtC7JyXIan6T2GN0NV/Rxm5qq5WQ/MMUt6AOTTxzKucVEino+GUQDak8mUHJPnZ dzY4Cfymw==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1l1UN5-0006Tj-ED; Mon, 18 Jan 2021 13:15:03 +0000 Received: from mail-wr1-x431.google.com ([2a00:1450:4864:20::431]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1l1UN3-0006Ry-Cg for linux-arm-kernel@lists.infradead.org; Mon, 18 Jan 2021 13:15:02 +0000 Received: by mail-wr1-x431.google.com with SMTP id y17so16415141wrr.10 for ; Mon, 18 Jan 2021 05:15:00 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=/8+eCjMadN4hEryRCq5t61h0Kw3XOPXiND7TB0YLFkM=; b=POEfM+et/dcTeVjJtAwq/2yXoy6V3wf7ul3s27ev5mHWELYMXtXCj7/gO6jo59jZVn cs5u23n+N+VtOZrULvMG1Q/dEXmAM6xLLHcc3B0s/Zay9YGRESfIMny06wivrXUKnB+X Fw/lmIJxeH1zTm5V+bkKESe2/3nYIfaBPfGjnqLUpQn2Co6f2TdJsPp6pGDzB69pPXXV WsI0Vis835YnO0tVbq9uo/yoKVMoOs2CI93pguLm3mYL1BvBYfpknR7l0LVn21222UHK ir8LfXPL4tlSTHEDH3+YxSGGb4KDBD29ojK6NhRpvKS/wKUTx8xqiM5fMY6IW2AP7VNB uisQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=/8+eCjMadN4hEryRCq5t61h0Kw3XOPXiND7TB0YLFkM=; b=ruBhMh/BI3oNJuguSxTovgEvxdm/ZNP1TYxkHAaOBFut7g3Trc33zy5/S1j6wX0lTb OBg3Y4v28HXr4oqh9PIjbQHIC74GPZX7ltvc+NDoTykQEe0b+N9uRSZDByj5K1yXG0sw OxywbhA+V3ZUesyw+Q9+kj0PuCs5l2oKMynRkZnYTAryelYM9BZcbiQdQeQSHEqDLDWP wZPvMYPeg3iRI09HAY2DUY7T3ywcX2q80fwUGxZryfaeghkqWUmp9S5C56kd1dl5cKVX R4nUXtMILIrqX3locFpMu3JlEp6OVw5EGIIg+sfZX1sldRUjYGjvHlNh/vbKufYhXuel jgXw== X-Gm-Message-State: AOAM533h4CBm+2+Yb50doq1izUD+Im/qMc9UOD2+BIIli+z7/p+nVXqu 0lbv7FdyE9soApw7fT91+rVoJg== X-Google-Smtp-Source: ABdhPJzmPlfcSrGqBJwt+ReFSFMEuRuGZv6bGgz8c75Q6bbIP50Hu5TPT8/BskwWGDST3jm1ca0mEA== X-Received: by 2002:adf:ae01:: with SMTP id x1mr25557426wrc.381.1610975699419; Mon, 18 Jan 2021 05:14:59 -0800 (PST) Received: from google.com ([2a01:4b00:8523:2d03:3d4d:985d:87b7:4d55]) by smtp.gmail.com with ESMTPSA id h23sm4761819wmi.26.2021.01.18.05.14.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 18 Jan 2021 05:14:58 -0800 (PST) Date: Mon, 18 Jan 2021 13:14:57 +0000 From: David Brazdil To: Marc Zyngier Subject: Re: [PATCH v4 14/21] arm64: Honor VHE being disabled from the command-line Message-ID: <20210118131457.47ppbilsaq7cdtft@google.com> References: <20210118094533.2874082-1-maz@kernel.org> <20210118094533.2874082-15-maz@kernel.org> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20210118094533.2874082-15-maz@kernel.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210118_081501_475700_E02F952D X-CRM114-Status: GOOD ( 17.54 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Mark Rutland , Jing Zhang , kernel-team@android.com, Srinivas Ramana , Suzuki K Poulose , Catalin Marinas , Alexandru Elisei , linux-kernel@vger.kernel.org, Ard Biesheuvel , James Morse , Julien Thierry , Ajay Patil , Prasad Sodagudi , Will Deacon , kvmarm@lists.cs.columbia.edu, linux-arm-kernel@lists.infradead.org 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 Mon, Jan 18, 2021 at 09:45:26AM +0000, Marc Zyngier wrote: > Finally we can check whether VHE is disabled on the command line, > and not enable it if that's the user's wish. > > Signed-off-by: Marc Zyngier Acked-by: David Brazdil > --- > arch/arm64/kernel/hyp-stub.S | 17 ++++++++++++++--- > 1 file changed, 14 insertions(+), 3 deletions(-) > > diff --git a/arch/arm64/kernel/hyp-stub.S b/arch/arm64/kernel/hyp-stub.S > index 59820f9b8522..bbab2148a2a2 100644 > --- a/arch/arm64/kernel/hyp-stub.S > +++ b/arch/arm64/kernel/hyp-stub.S > @@ -77,13 +77,24 @@ SYM_CODE_END(el1_sync) > SYM_CODE_START_LOCAL(mutate_to_vhe) > // Sanity check: MMU *must* be off > mrs x0, sctlr_el2 > - tbnz x0, #0, 1f > + tbnz x0, #0, 2f > > // Needs to be VHE capable, obviously > mrs x0, id_aa64mmfr1_el1 > ubfx x0, x0, #ID_AA64MMFR1_VHE_SHIFT, #4 > - cbz x0, 1f > + cbz x0, 2f > > + // Check whether VHE is disabled from the command line > + adr_l x1, id_aa64mmfr1_val > + ldr x0, [x1] > + adr_l x1, id_aa64mmfr1_mask > + ldr x1, [x1] super nit: There's a ldr_l macro > + ubfx x0, x0, #ID_AA64MMFR1_VHE_SHIFT, #4 > + ubfx x1, x1, #ID_AA64MMFR1_VHE_SHIFT, #4 > + cbz x1, 1f > + and x0, x0, x1 > + cbz x0, 2f > +1: > // Engage the VHE magic! > mov_q x0, HCR_HOST_VHE_FLAGS > msr hcr_el2, x0 > @@ -152,7 +163,7 @@ skip_spe: > orr x0, x0, x1 > msr spsr_el1, x0 > > -1: eret > +2: eret > SYM_CODE_END(mutate_to_vhe) > > .macro invalid_vector label > -- > 2.29.2 > _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel