From mboxrd@z Thu Jan 1 00:00:00 1970 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=-21.3 required=3.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT, USER_IN_DEF_DKIM_WL autolearn=unavailable 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 CBE91C433E6 for ; Wed, 3 Feb 2021 14:20:35 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 605B764F4D for ; Wed, 3 Feb 2021 14:20:35 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232184AbhBCOUV (ORCPT ); Wed, 3 Feb 2021 09:20:21 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53120 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232490AbhBCOUQ (ORCPT ); Wed, 3 Feb 2021 09:20:16 -0500 Received: from mail-wm1-x349.google.com (mail-wm1-x349.google.com [IPv6:2a00:1450:4864:20::349]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1D7DCC061573 for ; Wed, 3 Feb 2021 06:19:36 -0800 (PST) Received: by mail-wm1-x349.google.com with SMTP id j204so3329647wmj.4 for ; Wed, 03 Feb 2021 06:19:36 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=sender:date:message-id:mime-version:subject:from:to:cc; bh=2YqmStJHtmDLb9ca8pHnXTtS9p5W2yatBMAuEkk2twc=; b=swt8i8oh/CahxjCm1i2LWz1PAhEJPYcgCpXP0sqxpm2LUsKOEQR/Tv0qTZc/ayZXro fM/xy/OMrvadN/XfZfFqE9II1fKG4oA2GlksIBodsSYBYT2mQdY2QmCpAWh+A33rzzL5 GBiuyPnm5s8VHkJgbxLVNkw+yIUI3Zicnnyitub/KQvWRFCUrkmL+zNaLx2zGrWCUXaC VxvambATQYjvSZI9oXIdrBvrKIuvZMvY2pdDM60IB/BE1kKNHUXBK29B6uGPOMVY+nc5 fvb5tienhYATycUO0iLqHIzDap95urS27UIbmZIvUgzX0u7Xs21ZzMPJLuQDzcL3a4Gs 0Hwg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:date:message-id:mime-version:subject:from :to:cc; bh=2YqmStJHtmDLb9ca8pHnXTtS9p5W2yatBMAuEkk2twc=; b=Vnx77+bV20ifM/7FRmpangUTP5w2qfsxJ4GU86S50MidDS3CFXM924Do9kRup0UjZP iom5KaaXHSA+kDxrSJru5ORjmj2u/tZM3jqhyS/xFr62oxa7CBE4qgP9eFT/Jf9wcudX K5S7d4yyEXU7cZUqU4tNu9jxd6d3opVHpxk7kD8iWud6etxuDyTVKO5HK/RPAkJ6GIux 8WNiVSOH86I7dRB8s9k1hbmVmYLXnp/xPkYglfc7iUNaTOyjzL9NpHuxEUxBsNXNEHKC 3IXdJD6NyveQ+0n/TIThEy1A+qLH13G0p7WmBzn9qddPQRzMLVmDH50DyURiy+NKmso3 LwAA== X-Gm-Message-State: AOAM533/p/iGRaGttAcF14hLVIn3sCvj/izngHcvULHXzrfafpYMx09I dWn6Pa2QayZug6iyedx4P7QYsodslgfI X-Google-Smtp-Source: ABdhPJzQ47fLWpATF9oviOBeGLZ6a+5wZlOoYomkHouoJDdnNHFlCRVtBHfc0HOJyC8UgG5y/ze+CK1Gxa5x Sender: "qperret via sendgmr" X-Received: from r2d2-qp.c.googlers.com ([fda3:e722:ac3:cc00:28:9cb1:c0a8:1652]) (user=qperret job=sendgmr) by 2002:a1c:4303:: with SMTP id q3mr3048441wma.3.1612361974461; Wed, 03 Feb 2021 06:19:34 -0800 (PST) Date: Wed, 3 Feb 2021 14:19:29 +0000 Message-Id: <20210203141931.615898-1-qperret@google.com> Mime-Version: 1.0 X-Mailer: git-send-email 2.30.0.365.g02bc693789-goog Subject: [PATCH 0/2] KVM: arm64: Stub exports in nvhe code From: Quentin Perret To: arnd@arndb.de, maz@kernel.org, catalin.marinas@arm.com, will@kernel.org Cc: james.morse@arm.com, julien.thierry.kdev@gmail.com, suzuki.poulose@arm.com, ardb@kernel.org, linux-arch@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, kvmarm@lists.cs.columbia.edu, kernel-team@android.com, qperret@google.com Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi all, In the context of the currently ongoing work to remove the host kernel from the TCB under KVM/arm64, I have been trying to wrap the host kernel with a stage 2 page-table -- see [1]. Using this infrastructure, I attempted to unmap the .hyp. sections from the host stage 2 as it really shouldn't need to access them. But by doing so, I realized quickly the module loader was getting very confused by the usage of EXPORT_SYMBOL() macros in library functions that have been pulled into the EL2 object, and that we end up linking modules against the EL2 copy of e.g. memset. And so, this series essentially tries to fix this. - Patch 01 changes asm-generic/export.h to ensure we respect __DISABLE_EXPORTS even for asm exports; - and patch 02 makes use of it for all of the nVHE EL2 code. This was tested on aml-s905x-cc, which now successfully loads kernel modules with .hyp.text unmapped from the host. Thanks, Quentin [1] https://lore.kernel.org/kvmarm/20210108121524.656872-1-qperret@google.com/ Quentin Perret (2): asm-generic: export: Stub EXPORT_SYMBOL with __DISABLE_EXPORTS KVM: arm64: Stub EXPORT_SYMBOL for nVHE EL2 code arch/arm64/kvm/hyp/nvhe/Makefile | 4 ++-- include/asm-generic/export.h | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) -- 2.30.0.365.g02bc693789-goog