From patchwork Thu May 19 13:41:49 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Will Deacon X-Patchwork-Id: 12855193 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 5C66CC433F5 for ; Thu, 19 May 2022 14:40:49 +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:References:In-Reply-To: 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: List-Owner; bh=GpfHr1tJKWeJ1BoCk/kY589U1PUh4EIt7APJRDtIt0M=; b=gwFIw+7rXSnMht NlsYwpX4TxhMn+xRZChptsm4RTAZTcqr2L2Fr/BpDlhzMVfkgIFvZDSWBHhJIo/jilpDBwhf567Wc t+hkz31cfC+gfOawL+hG7LgBWRZxPUEBt0sXeN37eucvZfSDz4JbFNdQTQNW5+55+RDoCxkb0RGLL 50rUiAYHTTtApzd83D3m56znySwfoZfUrlFAbsjlhw3p0/LMyZJpAPPH9pTVikA2o3Z9sL0fvzrdh Fnbhkhjh5CIqEKx/WAqCMKPwACeRz/Jsps4Da874B2tcOJ29rnuUMmBgLDmmO5CNNUkqG1LMybjvw WI3zMcJG4AO9MMRofKqQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nrhJS-007Vcb-89; Thu, 19 May 2022 14:39:38 +0000 Received: from dfw.source.kernel.org ([139.178.84.217]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1nrgUq-0077FF-3y for linux-arm-kernel@lists.infradead.org; Thu, 19 May 2022 13:47:23 +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 dfw.source.kernel.org (Postfix) with ESMTPS id 4CF8A6179E; Thu, 19 May 2022 13:47:19 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 46A3EC34115; Thu, 19 May 2022 13:47:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1652968038; bh=x58MGQPrXq++wFZZLs9GZeS60czDjmBGDjMArfLgdBY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=kNi1MDEcq6MHfeD5+z9H+oi70NhpxB1dAjxmkTdJHTbMkL768KFgylxF5f4LYwikm Vx3IYJu0S+oZaxicKuh0l7l8O9I1hyTbzC6j7U0EfghOYordOpklg9SNs67Nv+5okE LKrSl4R41+AcxKwdtmF7NP9LW1zaG9B4E4SZ8yqMHQeaIdG29THXyHHzHIGHyG3VWW qWcOqKQCU1ZEfvKrwlTf8Le+NEgdzKaQfMenYq9aSRvEyD0IZ18K4Y6amlDSR82C9V pVGOmksJsYRek9MPei5djqy0zZ9PT6sKN1TriZS1N7PXewlmU8vLaF9yWerjZ3lfI9 uteJsptaycOeQ== From: Will Deacon To: kvmarm@lists.cs.columbia.edu Cc: Will Deacon , Ard Biesheuvel , Sean Christopherson , Alexandru Elisei , Andy Lutomirski , Catalin Marinas , James Morse , Chao Peng , Quentin Perret , Suzuki K Poulose , Michael Roth , Mark Rutland , Fuad Tabba , Oliver Upton , Marc Zyngier , kernel-team@android.com, kvm@vger.kernel.org, linux-arm-kernel@lists.infradead.org Subject: [PATCH 74/89] KVM: arm64: Move pstate reset values to kvm_arm.h Date: Thu, 19 May 2022 14:41:49 +0100 Message-Id: <20220519134204.5379-75-will@kernel.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20220519134204.5379-1-will@kernel.org> References: <20220519134204.5379-1-will@kernel.org> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220519_064720_301026_9A487C49 X-CRM114-Status: GOOD ( 13.46 ) 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 From: Fuad Tabba Move the macro defines of the pstate reset values to a shared header to be used by hyp in protected mode. No functional change intended. Signed-off-by: Fuad Tabba --- arch/arm64/include/asm/kvm_arm.h | 9 +++++++++ arch/arm64/kvm/reset.c | 9 --------- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/arch/arm64/include/asm/kvm_arm.h b/arch/arm64/include/asm/kvm_arm.h index 98b60fa86853..056cda220bff 100644 --- a/arch/arm64/include/asm/kvm_arm.h +++ b/arch/arm64/include/asm/kvm_arm.h @@ -359,4 +359,13 @@ #define CPACR_EL1_DEFAULT (CPACR_EL1_FPEN_EL0EN | CPACR_EL1_FPEN_EL1EN |\ CPACR_EL1_ZEN_EL1EN) +/* + * ARMv8 Reset Values + */ +#define VCPU_RESET_PSTATE_EL1 (PSR_MODE_EL1h | PSR_A_BIT | PSR_I_BIT | \ + PSR_F_BIT | PSR_D_BIT) + +#define VCPU_RESET_PSTATE_SVC (PSR_AA32_MODE_SVC | PSR_AA32_A_BIT | \ + PSR_AA32_I_BIT | PSR_AA32_F_BIT) + #endif /* __ARM64_KVM_ARM_H__ */ diff --git a/arch/arm64/kvm/reset.c b/arch/arm64/kvm/reset.c index cc25f540962b..6bc979aece3c 100644 --- a/arch/arm64/kvm/reset.c +++ b/arch/arm64/kvm/reset.c @@ -32,15 +32,6 @@ /* Maximum phys_shift supported for any VM on this host */ static u32 kvm_ipa_limit; -/* - * ARMv8 Reset Values - */ -#define VCPU_RESET_PSTATE_EL1 (PSR_MODE_EL1h | PSR_A_BIT | PSR_I_BIT | \ - PSR_F_BIT | PSR_D_BIT) - -#define VCPU_RESET_PSTATE_SVC (PSR_AA32_MODE_SVC | PSR_AA32_A_BIT | \ - PSR_AA32_I_BIT | PSR_AA32_F_BIT) - unsigned int kvm_sve_max_vl; int kvm_arm_init_sve(void)