All of lore.kernel.org
 help / color / mirror / Atom feed
From: Quentin Perret <qperret@google.com>
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
Subject: [PATCH 0/2] KVM: arm64: Stub exports in nvhe code
Date: Wed,  3 Feb 2021 14:19:29 +0000	[thread overview]
Message-ID: <20210203141931.615898-1-qperret@google.com> (raw)

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


WARNING: multiple messages have this Message-ID (diff)
From: Quentin Perret <qperret@google.com>
To: arnd@arndb.de, maz@kernel.org, catalin.marinas@arm.com, will@kernel.org
Cc: linux-arch@vger.kernel.org, linux-kernel@vger.kernel.org,
	kvmarm@lists.cs.columbia.edu,
	linux-arm-kernel@lists.infradead.org, kernel-team@android.com,
	ardb@kernel.org
Subject: [PATCH 0/2] KVM: arm64: Stub exports in nvhe code
Date: Wed,  3 Feb 2021 14:19:29 +0000	[thread overview]
Message-ID: <20210203141931.615898-1-qperret@google.com> (raw)

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

_______________________________________________
kvmarm mailing list
kvmarm@lists.cs.columbia.edu
https://lists.cs.columbia.edu/mailman/listinfo/kvmarm

WARNING: multiple messages have this Message-ID (diff)
From: Quentin Perret <qperret@google.com>
To: arnd@arndb.de, maz@kernel.org, catalin.marinas@arm.com, will@kernel.org
Cc: linux-arch@vger.kernel.org, suzuki.poulose@arm.com,
	qperret@google.com, linux-kernel@vger.kernel.org,
	kvmarm@lists.cs.columbia.edu, james.morse@arm.com,
	linux-arm-kernel@lists.infradead.org, kernel-team@android.com,
	ardb@kernel.org, julien.thierry.kdev@gmail.com
Subject: [PATCH 0/2] KVM: arm64: Stub exports in nvhe code
Date: Wed,  3 Feb 2021 14:19:29 +0000	[thread overview]
Message-ID: <20210203141931.615898-1-qperret@google.com> (raw)

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


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

             reply	other threads:[~2021-02-03 14:20 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-02-03 14:19 Quentin Perret [this message]
2021-02-03 14:19 ` [PATCH 0/2] KVM: arm64: Stub exports in nvhe code Quentin Perret
2021-02-03 14:19 ` Quentin Perret
2021-02-03 14:19 ` [PATCH 1/2] asm-generic: export: Stub EXPORT_SYMBOL with __DISABLE_EXPORTS Quentin Perret
2021-02-03 14:19   ` Quentin Perret
2021-02-03 14:19   ` Quentin Perret
2021-02-03 15:24   ` Will Deacon
2021-02-03 15:24     ` Will Deacon
2021-02-03 15:24     ` Will Deacon
2021-02-03 14:19 ` [PATCH 2/2] KVM: arm64: Stub EXPORT_SYMBOL for nVHE EL2 code Quentin Perret
2021-02-03 14:19   ` Quentin Perret
2021-02-03 14:19   ` Quentin Perret
2021-02-03 16:43 ` [PATCH 0/2] KVM: arm64: Stub exports in nvhe code Marc Zyngier
2021-02-03 16:43   ` Marc Zyngier
2021-02-03 16:43   ` Marc Zyngier

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210203141931.615898-1-qperret@google.com \
    --to=qperret@google.com \
    --cc=ardb@kernel.org \
    --cc=arnd@arndb.de \
    --cc=catalin.marinas@arm.com \
    --cc=james.morse@arm.com \
    --cc=julien.thierry.kdev@gmail.com \
    --cc=kernel-team@android.com \
    --cc=kvmarm@lists.cs.columbia.edu \
    --cc=linux-arch@vger.kernel.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=maz@kernel.org \
    --cc=suzuki.poulose@arm.com \
    --cc=will@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.