Received: by 2002:a05:6602:2086:0:0:0:0 with SMTP id a6csp4834351ioa; Wed, 27 Apr 2022 12:08:43 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy7RZxQRCu5V/NNZsynLzgQl0p03G+EHFOmT6fl0f6anWzZOwR1jZhNKtVgjBXtLEyZrmRD X-Received: by 2002:a05:6402:400b:b0:425:f59a:c221 with SMTP id d11-20020a056402400b00b00425f59ac221mr14115138eda.307.1651086522858; Wed, 27 Apr 2022 12:08:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1651086522; cv=none; d=google.com; s=arc-20160816; b=oW33EQErkGHadAOLuuvPtZQaZ5XYQJpQsnh7tTCCFKUFtiMrrT1rKW+qKbltXtkR42 cXVtylum7kYd2clBwtCGABe5qDRgwgzGve1d3C/b1hlRyZa516Gtka8ymnuXbMiL/YbQ ZNnY9Qy9SrIVQqfBgSpvfwUnVw9vbVNRza8eYdA58nq2/GfGhPv6aDTLgBclLOKLFxBQ jfA8Cgp8zr/0n6Q9SuuCko+9CCodEr+LBGgs5weI7rTHVYox1BC45XlyCf75QG9nTj87 7JEBXk3MV4YNoIH+aAKHFZIjT7iM+A02WvFDeM1Whqm4lNSp3HxedhzTXuHscbY5DVXa gb7g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:to:cc:from:subject:mime-version:message-id:date :dkim-signature; bh=cjRVYKae2NiccbEodN7hWWhpE8I2abxiXPIpZLMEvCU=; b=1A80n6mLY8Fv63qD3QaDRL/6zDNAW6sii+c1ceU6fTifAM283y87Ag5qJFxj3erC+o ReoiABWybA8lX3g2QLONljWq74oZrl/EuH9ZX3qENiDO4BmylmoH0LCYoXfbxECeVryu 2ipNbvzajGBeAtyTrs/fPpTdGqylXbspwo73shYJJAya4sAW+V72MF25l/gn4lmG0Qzk 92UYyI7gc6TIwep50aKFRB1dsFMEXZ5OEIT4UhPUNWvWg9o0ObvPTnep3LOd1/VwF+hq cPE25P5PZOPtqJD0Wm3IQXry6IOrHfxMAO8zKy1FubBfe1Ub5FVDR6vsINGiOJY8/sV4 g0GQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=QYrapOUY; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id v9-20020a056402174900b0041d78a7223esi2149782edx.597.2022.04.27.12.08.18; Wed, 27 Apr 2022 12:08:42 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=QYrapOUY; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229843AbiD0TBk (ORCPT + 99 others); Wed, 27 Apr 2022 15:01:40 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44760 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231716AbiD0TBX (ORCPT ); Wed, 27 Apr 2022 15:01:23 -0400 Received: from mail-yw1-x114a.google.com (mail-yw1-x114a.google.com [IPv6:2607:f8b0:4864:20::114a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F24459AE77 for ; Wed, 27 Apr 2022 11:47:23 -0700 (PDT) Received: by mail-yw1-x114a.google.com with SMTP id 00721157ae682-2f825f8c944so24256817b3.15 for ; Wed, 27 Apr 2022 11:47:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=date:message-id:mime-version:subject:from:cc; bh=cjRVYKae2NiccbEodN7hWWhpE8I2abxiXPIpZLMEvCU=; b=QYrapOUYASQ9wPScJ0plESi+FWuJgR3FWaISnPDEs6022eaR3vV/BPqwUR64TdyM+l Wok4jTZejpYCOeFYt2K4Q7995CZTXK6AfZT5+erp8eD13WZ1cOtbQF+ub5TmTdkfE10f ejzEp4XbKTmkExH/AsNZ6U2v3rpV393XABjlNHOZgfwoYRebwFUnQxrYBDPQR2R4RNl4 7t9/68MkDJ/aZnHETqiwGR5Bq9aBcXVcIsMrkulvfgWJcVmPBdhyw9bnLzgDP78TQV1v j4+qZqHSOufl+3FNjWGD4rCP+FnNVxfgvqFg2GfS3GKX3eJ2UXeBNW6EL8bVS2ETLPsR XiAQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:message-id:mime-version:subject:from:cc; bh=cjRVYKae2NiccbEodN7hWWhpE8I2abxiXPIpZLMEvCU=; b=Enp0pys6tGQnd8xUOv/WwJRs70VP/sIq6boFQxHKZ9cSYuvbRpNzeIhVzWqTQg96sj bGWrDB2jX98xw9lLUqyYnXJ0OSAbT+V3abEZFKaIeTk7NavBuubhFNvTeDChrK7lgE6z l7LraM7dYuC7oVF2I+hC6sLEr/931EOnzg0HXs696SYnXSMG4MJU3e7iczwaB5iLuGJ0 wqu+w/QVroYoYD+KVY1y+Si2Z9m0T/PD9LPMgu/3kFyNpmkyz/LHjnc4vWN2udJMYBU9 Y963doR4ggSNxhAWi7qh1MkIYKQkUZW7Kg3pbjBCthSfXAEzy+W4ecx2ctUoFsHxYp8A H6QA== X-Gm-Message-State: AOAM5337QUgd6g59CZj+qnMHCg1zrswDI9YnaITErFMga+Klgz43wT5I LafMe4vfD5yN0hrnDnMuA6rWJ4Y9+Pu94EZcFg== X-Received: from kaleshsingh.mtv.corp.google.com ([2620:15c:211:200:16ec:6da0:8cc5:5f24]) (user=kaleshsingh job=sendgmr) by 2002:a25:a148:0:b0:641:d14b:ddd3 with SMTP id z66-20020a25a148000000b00641d14bddd3mr28186851ybh.402.1651085243194; Wed, 27 Apr 2022 11:47:23 -0700 (PDT) Date: Wed, 27 Apr 2022 11:46:55 -0700 Message-Id: <20220427184716.1949239-1-kaleshsingh@google.com> Mime-Version: 1.0 X-Mailer: git-send-email 2.36.0.rc2.479.g8af0fa9b8e-goog Subject: [PATCH 0/4] KVM nVHE Hypervisor stack unwinder From: Kalesh Singh Cc: mark.rutland@arm.com, will@kernel.org, maz@kernel.org, qperret@google.com, tabba@google.com, surenb@google.com, kernel-team@android.com, Kalesh Singh , James Morse , Alexandru Elisei , Suzuki K Poulose , Catalin Marinas , Mark Brown , Masami Hiramatsu , Peter Collingbourne , Alexei Starovoitov , "Madhavan T. Venkataraman" , Andrew Jones , Keir Fraser , Zenghui Yu , Kefeng Wang , linux-arm-kernel@lists.infradead.org, kvmarm@lists.cs.columbia.edu, linux-kernel@vger.kernel.org Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-8.6 required=5.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MISSING_HEADERS, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,USER_IN_DEF_DKIM_WL autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net To: unlisted-recipients:; (no To-header on input) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi all, This series is based on arm64 for-next/core and is also dependent on the series at [1]. A previous version of hypervisor stack unwinding was included in the series at [2]. This new version of the unwinder splits the unwinding and dumping of the stack between the hypervisor and host: - The hyperviosr 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. [1] https://lore.kernel.org/r/20220420214317.3303360-1-kaleshsingh@google.com/ [2] https://lore.kernel.org/r/20220314200148.2695206-1-kaleshsingh@google.com/ Thanks, Kalesh Kalesh Singh (4): 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.rc2.479.g8af0fa9b8e-goog