From patchwork Fri Mar 19 10:01:17 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Quentin Perret X-Patchwork-Id: 12150529 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 DF67CC433E0 for ; Fri, 19 Mar 2021 10:05:57 +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 C871064E1F for ; Fri, 19 Mar 2021 10:05:56 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org C871064E1F 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=pEUfeFM+LHFmqToT7BDbjoWx4af03JTbjl43jVwllm8=; b=LMTHYgTXqhqjvZ Jc/FCqK9ENqtMhRX1MbF8FOLd8uR6TKg88xjNm42Zg84Wmuzui4TAujeBONBWQB0b5eU8mgQ46ekr 5jPsSoIVz9QjVZHjC/3JO9ajbD3/csog/f0h2D1aa0fTeXqrPZNXFyGDafnjc75R/5wzKK6jFBefi mf7OEtKgUYNDYfxQZkImthO7jvkF8b1KYMVlr44Wtddd8kQkIymAamZCzkloN2312qiAxDMd3nZiM VLckG/0C/ddZsVykyZ/i7O/H1hpLlWbe1asFFXts9eW8UlXo17EhAErZw+Q3dfrKkg/5j89MWTOBN eyOudCzPscGbP61Tg3mA==; Received: from localhost ([::1] helo=desiato.infradead.org) by desiato.infradead.org with esmtp (Exim 4.94 #2 (Red Hat Linux)) id 1lNBzG-00714h-7F; Fri, 19 Mar 2021 10:04:10 +0000 Received: from mail-qk1-x74a.google.com ([2607:f8b0:4864:20::74a]) by desiato.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lNBxL-0070A9-3g for linux-arm-kernel@lists.infradead.org; Fri, 19 Mar 2021 10:02:13 +0000 Received: by mail-qk1-x74a.google.com with SMTP id k188so15496725qkb.5 for ; Fri, 19 Mar 2021 03:02:10 -0700 (PDT) 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=5gECdo6+gVpy2qvozqlXR6PUtKBMsle+/Zgc7UvkHv0=; b=mxpQrZ8gNL/t8iySLxtG3kNdKlZSs0r0Mt6WLEJ+xYt02Sibhx2GhBYgVmtffTsidV JMdP9JdMDQvQn8+P4mVyA3o13U8KZbMz1nkqS+pCDmdzWF4u4/9ktQT+iEYs87nNGRls C/nYwV3ipvNG6nAKct925qTm/Y23zArUpvX8B3xQnnXBOTiVsx+0F/XZxatVGtzSGzCP yj84Uv06GMNVkldApWkew2knEXWSn68Hr7Sm4QQnevZPzERlCj0IJ2Zi8KiUi6rBlRsk ylcl/Ea5Z6tGxsVJI1nTKWoUNA7YEZ8o4MQawN9jDuAZJHlvglRxfhEvADdRt+TjzDvq 1o7w== 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=5gECdo6+gVpy2qvozqlXR6PUtKBMsle+/Zgc7UvkHv0=; b=B090Cj5m5cWxj4eR1Baes4MOjtIdQUPNzXvYQVGzKy4KNXRFANAu6qG81MuI3aLjiU IbDhncwE3spe1r9H5fqB6bVw7VSDl+5iCkyv+n5cLzUkpAr0do+nQ+pbqUIcL0NlZH1I 0dCFI3YsQFDau8bxVlBk/0QCaA4ifkkA0kfmZtZoTOvhCl8ISNNp4ESA4y/Wrg5Zeto1 CpoLVvDe3GhpoZjHpSiJVi24JTMXCI5MTv7bjaMGaNcAA/Ta8cvOsfTxPrggbt5uEpI9 YAq6dc8d2Oni6nclzmmWynaFAWgVe/vYQdjD+kJWFhYBShO1IitZKj8udqZ1/Bbd4Mtv QtQw== X-Gm-Message-State: AOAM532PGIWDiJuY1OHoMl0GmWzDjbwQaMcB958QGNnokjArCnTdit0+ 5ITiweywUHiL35wcP+DzxrslhlNa7Qh8 X-Google-Smtp-Source: ABdhPJxdeOyw7F8LEDXqPaxD4/XKhLFDVdrSX3/+Wq2Z6NaQDQAjwvxv64KJelAZOfkMtqhUmxag8EYto+fC X-Received: from r2d2-qp.c.googlers.com ([fda3:e722:ac3:10:28:9cb1:c0a8:1652]) (user=qperret job=sendgmr) by 2002:a05:6214:88:: with SMTP id n8mr8623708qvr.22.1616148129286; Fri, 19 Mar 2021 03:02:09 -0700 (PDT) Date: Fri, 19 Mar 2021 10:01:17 +0000 In-Reply-To: <20210319100146.1149909-1-qperret@google.com> Message-Id: <20210319100146.1149909-10-qperret@google.com> Mime-Version: 1.0 References: <20210319100146.1149909-1-qperret@google.com> X-Mailer: git-send-email 2.31.0.rc2.261.g7f71774620-goog Subject: [PATCH v6 09/38] 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, seanjc@google.com, mate.toth-pal@arm.com, linux-kernel@vger.kernel.org, robh+dt@kernel.org, linux-arm-kernel@lists.infradead.org, kernel-team@android.com, kvmarm@lists.cs.columbia.edu, tabba@google.com, ardb@kernel.org, mark.rutland@arm.com, dbrazdil@google.com, qperret@google.com X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210319_100211_644186_12250428 X-CRM114-Status: UNSURE ( 9.55 ) X-CRM114-Notice: Please train this message. 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