|
|
Log in / Subscribe / Register

KVM nVHE Hypervisor stack unwinder

From:  Kalesh Singh <kaleshsingh-AT-google.com>
To:  unlisted-recipients:; (no To-header on input)
Subject:  [PATCH v2 0/5] KVM nVHE Hypervisor stack unwinder
Date:  Mon, 02 May 2022 12:12:00 -0700
Message-ID:  <20220502191222.4192768-1-kaleshsingh@google.com>
Cc:  mark.rutland-AT-arm.com, broonie-AT-kernel.org, will-AT-kernel.org, maz-AT-kernel.org, qperret-AT-google.com, tabba-AT-google.com, surenb-AT-google.com, kernel-team-AT-android.com, Kalesh Singh <kaleshsingh-AT-google.com>, James Morse <james.morse-AT-arm.com>, Alexandru Elisei <alexandru.elisei-AT-arm.com>, Suzuki K Poulose <suzuki.poulose-AT-arm.com>, Catalin Marinas <catalin.marinas-AT-arm.com>, Masami Hiramatsu <mhiramat-AT-kernel.org>, Alexei Starovoitov <ast-AT-kernel.org>, Peter Collingbourne <pcc-AT-google.com>, "Madhavan T. Venkataraman" <madvenka-AT-linux.microsoft.com>, Andrew Jones <drjones-AT-redhat.com>, Zenghui Yu <yuzenghui-AT-huawei.com>, Keir Fraser <keirf-AT-google.com>, Kefeng Wang <wangkefeng.wang-AT-huawei.com>, linux-arm-kernel-AT-lists.infradead.org, kvmarm-AT-lists.cs.columbia.edu, linux-kernel-AT-vger.kernel.org
Archive-link:  Article

Hi all,

This v2 of the nVHE hypervisor stack unwinder. The previous version was
posted at:
v1: https://lore.kernel.org/lkml/20220427184716.1949239-1-kal...

The series is based on arm64 for-next/core and is also dependent on
kvm-arm64/hyp-stack-guard [1].

The main changes in this version is splitting some patches into more
incremental changes, per Mark Brown

The relevant parts of the previous cover letter are copied below for
convenience.

[1] https://git.kernel.org/pub/scm/linux/kernel/git/maz/arm-p...

Thanks,
Kalesh

-------

This new version of the unwinder splits the unwinding and dumping
of the stack between the hypervisor and host:
  - The hypervisor unwinds its stack and dumps the address entries
    into a page shared with the host.
  - The host then symnolizes and prints the hyp stacktrace from
    the shared page.

The new approach doesn't depend on CONFIG_NVHE_EL2_DEBUG,
and allows dumping hyp stacktraces in prodcution environments
(!CONFIG_NVHE_EL2_DEBUG).

arm64/kernel/stacktrace.c is compiled twice: stacktrace.o for the
host kernel and stacktrace.nvhe.o for the hypervisor. This allows
reusing most of the host unwinding logic in the nVHE hypervisor.


Kalesh Singh (5):
  KVM: arm64: Factor out common stack unwinding logic
  KVM: arm64: Compile stacktrace.nvhe.o
  KVM: arm64: Add hypervisor overflow stack
  KVM: arm64: Allocate shared stacktrace pages
  KVM: arm64: Unwind and dump nVHE hypervisor stacktrace

 arch/arm64/include/asm/kvm_asm.h    |   1 +
 arch/arm64/include/asm/stacktrace.h |  58 +++++++++--
 arch/arm64/kernel/stacktrace.c      | 151 +++++++++++++++++++++++-----
 arch/arm64/kvm/arm.c                |  34 +++++++
 arch/arm64/kvm/handle_exit.c        |   4 +
 arch/arm64/kvm/hyp/nvhe/Makefile    |   3 +-
 arch/arm64/kvm/hyp/nvhe/host.S      |   9 +-
 arch/arm64/kvm/hyp/nvhe/setup.c     |  11 ++
 arch/arm64/kvm/hyp/nvhe/switch.c    |   4 +
 9 files changed, 231 insertions(+), 44 deletions(-)

-- 
2.36.0.464.gb9c8b46e94-goog



Copyright © 2022, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds