From patchwork Tue Mar 2 14:59:39 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Quentin Perret X-Patchwork-Id: 12113609 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=-16.8 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 7A3CFC433E0 for ; Wed, 3 Mar 2021 14:06:37 +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 6224C64E68 for ; Wed, 3 Mar 2021 14:06:36 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 6224C64E68 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=etQne4KnnL5sZP pNM23RoVjAe3Wf6cQYq/zaLgwBty5248Ji9H5T6IMr+LhgwqzRSwZzYpsUjMzPlJ52HmJInAGyGNr Id853wY3H9ikNeh8gk/U5jYj1DNmKZ8yCTXiv8KiMBEtjVXpE354zWX91qDsPbjxOQC14KtE4LpTc cLa1P/sBbfn8qPhw8F/nlNocGM1DuSiBKlAe+pPC4LO10aVMObC3DSfugvVJCu/qcSOPt6P/s3ZAs n7R+12pmP+4g222UAly2Nf+LvJB5164L+q5iAe7GTmYdxJR+DFWkpeO94WHGEsgevztJIK9LGz4s9 shx4h1jewr3dwRGv2zFA==; Received: from localhost ([::1] helo=desiato.infradead.org) by desiato.infradead.org with esmtp (Exim 4.94 #2 (Red Hat Linux)) id 1lHS67-0052Pw-Oj; Wed, 03 Mar 2021 14:03:31 +0000 Received: from casper.infradead.org ([2001:8b0:10b:1236::1]) by desiato.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lHS3U-0051pr-3M for linux-arm-kernel@desiato.infradead.org; Wed, 03 Mar 2021 14:00:48 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=Content-Type:Cc:To:From:Subject: References:Mime-Version:Message-Id:In-Reply-To:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=T621CrLzDVvHMT7g1JI2svAdR9qKxB9zRXJEq9CxOEU=; b=QVS1MBbUtoxFkzjjiSxGob5KoS xvucIrVQZKDhmSif/CFIgSIiNsci2e7rPzdrbKyxegjVqYWyhwuuadQYLpWGqRp7umjxWyC3xn40m G9Ad/ahV/ThXrsU9GK9v2VIgUAP/Q6YtRQGTZAjREgsSMF6eyvEw6bjkG+Ag18EkqlnaCj2ff50Dw 6pseH2geUb8TGnX44bClW1rcAQSfcNayz1RDDal3H7DE6EVGop8nYE4P9E3vcd2YX3tBYNzWyQJ9p +uuARxWsqKEtQ54GuePdtfcoHOxDT/H/mV+iK/uOTyAfke9BBkPgqqLvrTP8uVtNYpZ/kR0DOpIR/ T0+rTBlA==; Received: from mail-qt1-x84a.google.com ([2607:f8b0:4864:20::84a]) by casper.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lH6Wt-00HJF9-Tp for linux-arm-kernel@lists.infradead.org; Tue, 02 Mar 2021 15:01:50 +0000 Received: by mail-qt1-x84a.google.com with SMTP id 4so9875353qtc.13 for ; Tue, 02 Mar 2021 07:01:30 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=sender:date:in-reply-to:message-id:mime-version:references:subject :from:to:cc; bh=T621CrLzDVvHMT7g1JI2svAdR9qKxB9zRXJEq9CxOEU=; b=JhVB1bpGiYn1jRzMxn5C86Cv84iFwqhC6iR5apn3eWaYAhiRMUSeUiA/loGNHC6UEZ WXJ7G+oIo0kRVVksB+BCF8QFW7BhegDukCh8s7n3swxcqA2kN9JLclL0IFaqfGiqGYZw wMwnC0Nm6lKe/+9njbqaVCvnF2gW6ls0LuTrHRUJwjGtQbiS/ziLG8McYhBEndabj5u4 lXqBAEzmTjgHHDB+UnlVBrk5jiudORfTBxu2CTEnE8ITDIwRVAd2UVMEl4YPH6u1i4cw 18SIyImxlr2wYX1yNBmi2YQPDuGfAGwYpUaQcVzbN2FuvEq9+DGEN/acYO9wm5gY3URn WgMg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:date:in-reply-to:message-id:mime-version :references:subject:from:to:cc; bh=T621CrLzDVvHMT7g1JI2svAdR9qKxB9zRXJEq9CxOEU=; b=Cvo8XSsacwK6M6kRuRUANGzKTNrnki+0XXGUOY8nMFi+dV46/v7kaZ+cIqcPFMr96i Zec7FKLvkAV2XsKTjs7nAxFKiXXPiuT5cC9lbWF12/LroC+tgQIxvuoU/jict5F+9UeI fgBeGUk++No0ohylfOnCisFEkXtg+0E9klSiyWADc8cl6MOL9xsNH2dWrJIr5Wjgixqa coinElLpudcGagzK9k9CN69U8Q3dWd6aacoIqyPq31Va0Wd2C/IMgZgoBpjCxU0CRDTY uFHB72TmbfhcXkjE6UbAVZBMOX5cphGbTL+DzS69gHkMHOL6OE2yvRk9hILSrJ8Bt7/D 7LNw== X-Gm-Message-State: AOAM533AtuSJcvsrGfo7JnArW7xU+ax22pvqEPgSxfcbgg4sVrXdiMWe xO4nHyjsNWRQ0Hd08AU27rt8j5xOnIG6 X-Google-Smtp-Source: ABdhPJz1Cnzac8s5SYaMmUMvh8VTsVMc6vRSeZjJ+2CAkCroHCAupXgtoMWTtWwTuJftkM7mvaKD3quAWmDb X-Received: from r2d2-qp.c.googlers.com ([fda3:e722:ac3:cc00:28:9cb1:c0a8:1652]) (user=qperret job=sendgmr) by 2002:a0c:b7a7:: with SMTP id l39mr3898578qve.56.1614697226584; Tue, 02 Mar 2021 07:00:26 -0800 (PST) Date: Tue, 2 Mar 2021 14:59:39 +0000 In-Reply-To: <20210302150002.3685113-1-qperret@google.com> Message-Id: <20210302150002.3685113-10-qperret@google.com> Mime-Version: 1.0 References: <20210302150002.3685113-1-qperret@google.com> X-Mailer: git-send-email 2.30.1.766.gb4fecdf3b7-goog Subject: [PATCH v3 09/32] 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 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210302_150150_464908_D112D248 X-CRM114-Status: UNSURE ( 9.87 ) 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