From patchwork Tue Sep 22 20:49:02 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Brazdil X-Patchwork-Id: 11793091 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 0907459D for ; Tue, 22 Sep 2020 20:51:37 +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 C067E235FD for ; Tue, 22 Sep 2020 20:51:36 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="RTMBLrYI"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=google.com header.i=@google.com header.b="b4hrojdQ" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org C067E235FD 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+patchwork-linux-arm=patchwork.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:MIME-Version:References:In-Reply-To:Message-Id:Date: Subject:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=cnD2NWHl4Lk8FTnVckI0mS2ArpbGc6OdEw2KEeSWXZk=; b=RTMBLrYIb8zEij+0SLasUp00x 7MNj+GceriJoUaBVxc/+68v2Y5bjB/ocOMTGEIHXKe+atqoQ0+ALzEP3Pw7fLMUs9tVsNZ6ao/OGZ ck6wcwuqHVJWvIPU0HTp77TfB2X6HKpmR3ybrKraSm0itUHKrB44iaKzCypMEPXVMZzSoOyr4otwv pYbhYnRTJzBhoWEuQueSoQ/4xwmyZ5AtBbDgA9m/+VdyagJH/Ww97OO0MEfU+KuqVvqgQFy9QRQev m6qyiGI7l38n4/grk2P7bYa68qsTClJydx89s6fJmt/Su/GyOHjGFaIscvyAXCWbGE1BhUtbuYY4J JXb2ksKWA==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kKpEK-0005w3-RQ; Tue, 22 Sep 2020 20:49:41 +0000 Received: from mail-wr1-x442.google.com ([2a00:1450:4864:20::442]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kKpDy-0005p3-5E for linux-arm-kernel@lists.infradead.org; Tue, 22 Sep 2020 20:49:19 +0000 Received: by mail-wr1-x442.google.com with SMTP id j2so18575252wrx.7 for ; Tue, 22 Sep 2020 13:49:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=cgWGlE2IBAlgCGkRWqoEQwRpT6/N3qd1Q+BRhcwZDZc=; b=b4hrojdQte8QWeYLCiPSNSABZw4R7mloaUzWFqKdtEwXnDHSrp6nbwKdmyu8HK98o6 vPD8drmTTIg5ifxhTwMCmoHLD7hzPwIlFTDYOQk6cF6TVWmxz9jpMH1T0jYa60fQs9OS bH08OtNrvCR3ATTNf1AQQBBfgX6GWOqg9o0+CkUbVV5U+OAqayr9kzVgamtFvpCoLWeU fmZZe4HhaYMMFGDD6wFT4bv5KFDYUOymBK3OTeXXRCvb3VnUvf2dMCpAYEVOJsKM4L+G 4aYOyaVxESzEoNF2pZBGWBsUFCdN1xyc2AHOYj+OmDmIzGaJQLBX8gDaXmFvUy2BMWvD m12w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=cgWGlE2IBAlgCGkRWqoEQwRpT6/N3qd1Q+BRhcwZDZc=; b=tV7APVuYWQtVxqFTSEbc7sM5HYN3VjIeQDtYQz4Bh9eEDAyAF5HNAaxf0jdqJXZlwZ 7+j7g8fS6R/2MJJECvvITpjqxTp8/Pbfy93iYDd9Vdjgy7oNa17QvP3kYIDoru7/vA97 8ePxshmyIqpfeCx/JZj8bu07hmbVBYJ4LLqZ+HT1G0arxbE4gP5EPwrUeISbQpDu/Yig 89O835EBxYe+8TkQIFjcaM90LZWLuB5e5YAkWVHq2jUbwopkJRaZho/SdJoOlmpv2SlR mdymXNZI0tquTU5iNE5HsXDco84yTe5jV9HqH5bJvsbJZx7hcP5mry1eOTIH0658U43F 33Ag== X-Gm-Message-State: AOAM532DGXBa0mQbs2jEVI+5NcguHK/GyHp3iM2e7bbWiOLzexVenL47 +MVxauZaUHnT3FI9bbNnDVLGeQ== X-Google-Smtp-Source: ABdhPJwQOkTmORTiH0kGK9fq+pg0w2lWJEG8QjDiGw0F0wP+anozS8vVGWhXnKQJuGWHRjKKKiXLmw== X-Received: by 2002:adf:dbc3:: with SMTP id e3mr7415703wrj.1.1600807756554; Tue, 22 Sep 2020 13:49:16 -0700 (PDT) Received: from localhost ([2a01:4b00:8523:2d03:1105:630f:e990:272f]) by smtp.gmail.com with ESMTPSA id 92sm29084887wra.19.2020.09.22.13.49.15 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 22 Sep 2020 13:49:15 -0700 (PDT) From: David Brazdil To: kvmarm@lists.cs.columbia.edu Subject: [PATCH v4 02/10] kvm: arm64: Move nVHE hyp namespace macros to hyp_image.h Date: Tue, 22 Sep 2020 21:49:02 +0100 Message-Id: <20200922204910.7265-3-dbrazdil@google.com> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20200922204910.7265-1-dbrazdil@google.com> References: <20200922204910.7265-1-dbrazdil@google.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200922_164918_259617_94A30C37 X-CRM114-Status: GOOD ( 17.47 ) X-Spam-Score: -15.7 (---------------) X-Spam-Report: SpamAssassin version 3.4.4 on merlin.infradead.org summary: Content analysis details: (-15.7 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2a00:1450:4864:20:0:0:0:442 listed in] [list.dnswl.org] -7.5 USER_IN_DEF_SPF_WL From: address is in the default SPF white-list -7.5 USER_IN_DEF_DKIM_WL From: address is in the default DKIM white-list -0.0 SPF_PASS SPF: sender matches SPF record 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.5 ENV_AND_HDR_SPF_MATCH Env and Hdr From used in default SPF WL Match -0.0 DKIMWL_WL_MED DKIMwl.org - Medium trust sender 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: kernel-team@android.com, Suzuki K Poulose , Catalin Marinas , linux-kernel@vger.kernel.org, James Morse , linux-arm-kernel@lists.infradead.org, Marc Zyngier , Tejun Heo , Dennis Zhou , Christoph Lameter , David Brazdil , Will Deacon , Julien Thierry Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org Minor cleanup to move all macros related to prefixing nVHE hyp section and symbol names into one place: hyp_image.h. Acked-by: Will Deacon Signed-off-by: David Brazdil --- arch/arm64/include/asm/hyp_image.h | 12 ++++++++++++ arch/arm64/include/asm/kvm_asm.h | 8 +------- arch/arm64/kernel/image-vars.h | 2 -- arch/arm64/kernel/vmlinux.lds.S | 1 + 4 files changed, 14 insertions(+), 9 deletions(-) diff --git a/arch/arm64/include/asm/hyp_image.h b/arch/arm64/include/asm/hyp_image.h index 2e38fcda02fc..daa1a1da539e 100644 --- a/arch/arm64/include/asm/hyp_image.h +++ b/arch/arm64/include/asm/hyp_image.h @@ -7,6 +7,12 @@ #ifndef __ARM64_HYP_IMAGE_H__ #define __ARM64_HYP_IMAGE_H__ +/* + * KVM nVHE code has its own symbol namespace prefixed with __kvm_nvhe_, + * to separate it from the kernel proper. + */ +#define kvm_nvhe_sym(sym) __kvm_nvhe_##sym + #ifdef LINKER_SCRIPT /* @@ -19,6 +25,12 @@ #define HYP_SECTION(NAME) \ HYP_SECTION_NAME(NAME) : { *(NAME NAME##.*) } +/* + * Defines a linker script alias of a kernel-proper symbol referenced by + * KVM nVHE hyp code. + */ +#define KVM_NVHE_ALIAS(sym) kvm_nvhe_sym(sym) = sym; + #endif /* LINKER_SCRIPT */ #endif /* __ARM64_HYP_IMAGE_H__ */ diff --git a/arch/arm64/include/asm/kvm_asm.h b/arch/arm64/include/asm/kvm_asm.h index 6f98fbd0ac81..c085032e2e3e 100644 --- a/arch/arm64/include/asm/kvm_asm.h +++ b/arch/arm64/include/asm/kvm_asm.h @@ -7,6 +7,7 @@ #ifndef __ARM_KVM_ASM_H__ #define __ARM_KVM_ASM_H__ +#include #include #define VCPU_WORKAROUND_2_FLAG_SHIFT 0 @@ -42,13 +43,6 @@ #include -/* - * Translate name of a symbol defined in nVHE hyp to the name seen - * by kernel proper. All nVHE symbols are prefixed by the build system - * to avoid clashes with the VHE variants. - */ -#define kvm_nvhe_sym(sym) __kvm_nvhe_##sym - #define DECLARE_KVM_VHE_SYM(sym) extern char sym[] #define DECLARE_KVM_NVHE_SYM(sym) extern char kvm_nvhe_sym(sym)[] diff --git a/arch/arm64/kernel/image-vars.h b/arch/arm64/kernel/image-vars.h index 8982b68289b7..76da2ad1010c 100644 --- a/arch/arm64/kernel/image-vars.h +++ b/arch/arm64/kernel/image-vars.h @@ -61,8 +61,6 @@ __efistub__ctype = _ctype; * memory mappings. */ -#define KVM_NVHE_ALIAS(sym) __kvm_nvhe_##sym = sym; - /* Alternative callbacks for init-time patching of nVHE hyp code. */ KVM_NVHE_ALIAS(arm64_enable_wa2_handling); KVM_NVHE_ALIAS(kvm_patch_vector_branch); diff --git a/arch/arm64/kernel/vmlinux.lds.S b/arch/arm64/kernel/vmlinux.lds.S index 7cba7623fcec..fbb13f38d0c5 100644 --- a/arch/arm64/kernel/vmlinux.lds.S +++ b/arch/arm64/kernel/vmlinux.lds.S @@ -9,6 +9,7 @@ #include #include +#include #include #include #include