From patchwork Wed Mar 10 17:57:26 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Quentin Perret X-Patchwork-Id: 12128893 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=-17.0 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,USER_AGENT_GIT 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 4FC11C433DB for ; Wed, 10 Mar 2021 18:01:33 +0000 (UTC) Received: from desiato.infradead.org (desiato.infradead.org [90.155.92.199]) (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 B40C164F3A for ; Wed, 10 Mar 2021 18:01:32 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org B40C164F3A 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=desiato.20200630; h=Sender:Content-Transfer-Encoding :Content-Type:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:Cc:To:From:Subject:References:Mime-Version: Message-Id:In-Reply-To:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=3jVJdLiLaLp4Jp7M2IClawu5QXL14UNUlP8IUw0dbLE=; b=eR3b75iJN6H8g3 RM68/huhYtEEdislCNlQCO5ylykPlRMNnSZ/0td2lob2mJ8fi7S4kb2FWk7qfROLtoMYK7iz+DEJd J9wOKFu2+ImuAFzRi4MFxigHyj8x0F6ca1RxVY7XVUAST7hyNoZb9sb4HWolVOM7dfA8CUTXYnj7r rLW2zrOztDfBrQa2l5UdqGtmmPA0CCPZKi0f90T+yp0DgGgA+rUj0az0hPk6bLCatRJbwkk7rCHgv CpEKxhxNGaPEj3HQFaqyeWj+Gd/qk1/qZqjmCaagKgCzQGweOoymHiz9n89AAyUUY7xguuF9MLpW8 0LkKJmL8Bf713Ru+TKUg==; Received: from localhost ([::1] helo=desiato.infradead.org) by desiato.infradead.org with esmtp (Exim 4.94 #2 (Red Hat Linux)) id 1lK37m-007P3D-HC; Wed, 10 Mar 2021 17:59:58 +0000 Received: from mail-wr1-x449.google.com ([2a00:1450:4864:20::449]) by desiato.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lK366-007OBp-PU for linux-arm-kernel@lists.infradead.org; Wed, 10 Mar 2021 17:58:16 +0000 Received: by mail-wr1-x449.google.com with SMTP id l10so8322721wry.16 for ; Wed, 10 Mar 2021 09:58:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=date:in-reply-to:message-id:mime-version:references:subject:from:to :cc; bh=T621CrLzDVvHMT7g1JI2svAdR9qKxB9zRXJEq9CxOEU=; b=Hbvsvxu6NLISPbrvhiFxE7FXEqAU0Mv8t9SPVam60nUlEefn0BFRgckh6OphPN/n34 mMAxbCfp63tyHccY0qa/f3Jpc86iiuTI1qKtqv9p3GgGY0jIRmo2YehbRMB+bwHX+rkd FciY30zEjHtG42uGSiQAnecMzyOeKipqkx91RsUlvsIu/qkCtj/fVmS6EDgNmYhAdE64 CHNIzVWY6jaAli+IqjdG8DYNqiV3kcGDigjdAxVcu9mjVlx/FgYwRvHQ/HN8W8Ksp+tD UGCShyNHhI0MSaxMWGIBO2OuJLu9etYsd6zmBCTOBQlY6AXhHDojB8xnAR2EeHwTlARr WvoQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:in-reply-to:message-id:mime-version :references:subject:from:to:cc; bh=T621CrLzDVvHMT7g1JI2svAdR9qKxB9zRXJEq9CxOEU=; b=ochBsrpUFM17Q4ts5thDP6o6tpxKU/akPKQlbwBXIfEDn+0ZVuos9ZddJb7bpP38Gy Vhp2yXlQDvWeBeXK9jp8hAR9CfmL+TO5YG0h582qmmHuoij8B1zvWx5Lj2SZFeEesh9L PJ8gYK/P2alJiBaWXakq6dAWFvGJn4XFJXaElk8bmfTCxEpwxbzlAqTe6bEWM38Ddkh1 YDFtR18uz7BiLjFT5UkJsDlm3l3DiJLRaWwYrnOREixrDYdDHJ26waOC02lcBJZrWEhu miCkZEpy+UKiP7/yO5KdUP8D3WDjTVgJ5gdFudH/VJ55+1Jcqdld+y8yezisOaHz2yUx fnFg== X-Gm-Message-State: AOAM532aCHt6TXoa4xLZ0r57S/H5OFvExAFfcAisQpuDz8szbO26l8zk VYS7pEc8URN+g8O22ZSEgpjWt9zQIouN X-Google-Smtp-Source: ABdhPJxqfINpp6EENtOEj1k9D5Kyx0lGUnntW+YAdT5CBabTaE0ejM3PwJv5r9lDZwF+U+rCzWRzTGC22KfH X-Received: from r2d2-qp.c.googlers.com ([fda3:e722:ac3:10:28:9cb1:c0a8:1652]) (user=qperret job=sendgmr) by 2002:a1c:ed13:: with SMTP id l19mr4406714wmh.83.1615399093776; Wed, 10 Mar 2021 09:58:13 -0800 (PST) Date: Wed, 10 Mar 2021 17:57:26 +0000 In-Reply-To: <20210310175751.3320106-1-qperret@google.com> Message-Id: <20210310175751.3320106-10-qperret@google.com> Mime-Version: 1.0 References: <20210310175751.3320106-1-qperret@google.com> X-Mailer: git-send-email 2.30.1.766.gb4fecdf3b7-goog Subject: [PATCH v4 09/34] KVM: arm64: Allow using kvm_nvhe_sym() in hyp code From: Quentin Perret To: catalin.marinas@arm.com, will@kernel.org, maz@kernel.org, james.morse@arm.com, julien.thierry.kdev@gmail.com, suzuki.poulose@arm.com Cc: android-kvm@google.com, linux-kernel@vger.kernel.org, kernel-team@android.com, kvmarm@lists.cs.columbia.edu, linux-arm-kernel@lists.infradead.org, tabba@google.com, mark.rutland@arm.com, dbrazdil@google.com, mate.toth-pal@arm.com, seanjc@google.com, qperret@google.com, robh+dt@kernel.org, ardb@kernel.org X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210310_175814_925841_8D55687A X-CRM114-Status: GOOD ( 10.11 ) 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 In order to allow the usage of code shared by the host and the hyp in static inline library functions, allow the usage of kvm_nvhe_sym() at EL2 by defaulting to the raw symbol name. Acked-by: Will Deacon Signed-off-by: Quentin Perret --- arch/arm64/include/asm/hyp_image.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/arch/arm64/include/asm/hyp_image.h b/arch/arm64/include/asm/hyp_image.h index 78cd77990c9c..b4b3076a76fb 100644 --- a/arch/arm64/include/asm/hyp_image.h +++ b/arch/arm64/include/asm/hyp_image.h @@ -10,11 +10,15 @@ #define __HYP_CONCAT(a, b) a ## b #define HYP_CONCAT(a, b) __HYP_CONCAT(a, b) +#ifndef __KVM_NVHE_HYPERVISOR__ /* * 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 +#else +#define kvm_nvhe_sym(sym) sym +#endif #ifdef LINKER_SCRIPT