From patchwork Tue Jul 26 07:37:45 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Kalesh Singh X-Patchwork-Id: 12928988 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id DA49BC43334 for ; Tue, 26 Jul 2022 07:44:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; 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=rC/A/CSHxH1a6yHvKW8PsHTFqZ1nkfGRWwv2Hfgiovk=; b=T3vjt7TnidDMRgAHT30db3VaBK 2W0g45nMbYg1Pe4wE4TkcpfMm1ZhJ0AiC/sx8F2MCAGxXPgEYGLDHTKkE7CDJFGiCjG1TxOC4YyeZ G01XowqGXanpYm/ipKwzuNO32mphaFsO6baRMzS3NrMZzEZJ7H/Za3yF4m1Z+Rzop1c482nN8Y4+T LXlkAyfXmKmKqK5fzWlQC+hUO1kN8MqH76bPTOmvtboyEQM3QQDdxz1GBDHDpc4K294stvT49wROC bY7R1PemD3+3ihTgJ+UA2gEC/g1db9BiUjp71c6g1K3QRjX97zP1dFLu6aD6UE1dy7qGaE0rkBLs9 SbNgRDyw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1oGFDv-009Zhs-QM; Tue, 26 Jul 2022 07:43:25 +0000 Received: from mail-yb1-xb4a.google.com ([2607:f8b0:4864:20::b4a]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1oGF98-009Vi6-AF for linux-arm-kernel@lists.infradead.org; Tue, 26 Jul 2022 07:38:27 +0000 Received: by mail-yb1-xb4a.google.com with SMTP id b18-20020a25bb52000000b0067128e66131so4355954ybk.18 for ; Tue, 26 Jul 2022 00:38:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=date:in-reply-to:message-id:mime-version:references:subject:from:to :cc:content-transfer-encoding; bh=9z1geK001Lgo4aQzTlFwh7+mdMHid79qtYIr9n0hiZw=; b=akqv8KPpQa1VNcDlRwBAf0WpbIAk4vEtYIJMvicQmBFeAaugRk9kLN6l+vafdsELTk NtqHPyYUML5CJ4AjDiY3dTaY+cSkOpg128D4ZkUQUG9Fz38Uro8ofjsPN0WzDtIet4WQ SZYEv+uBqfLl3qepTZ0OG6h7bYpZ3eDokb5EaIFJXHoiXBj3RK1eGwGvMWUb7qW6iO7g nyY0uYsGfoAPSXbog85aTEium1GWJ1Xhh3lcJ8Yp8ebpVrv98qa30n06S4cvxkTePaJB VUVCyyYygnDOUIC/8x/7m9q/JVzqjGe8IUGeLpvtVWbUFSdClA40lQjVHGIkuc85K3fB gYVw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:in-reply-to:message-id:mime-version :references:subject:from:to:cc:content-transfer-encoding; bh=9z1geK001Lgo4aQzTlFwh7+mdMHid79qtYIr9n0hiZw=; b=HDHkx6QYOzPFHjRpNamkbnAfT549daCpMcWWagqReHLmQsoGLWEzvH0VKLa3ObNJYy 6rhdQIWV7PgiT6Hc2PcehSIxsX6kHrapmUFy5L4MgP0tt0CubKdSWkRezWjmTMzIdqab zx2MI1U80yoDrqQjLnEm6OeD0CZw4uyVUUA01uqql2MHQaLWOOd3eafAfG2P39XLIgdS HAkhMdDRYpbCnLUIT/h0Y2EBQpatijU71BHnFIUadWnyiiLErVzS1XJljhYML6mVU1p8 fSXFLt3vNbajJggsXyCokELOuWdsBYXMu43STohtTWK4TNFRfOkugi8TB1OmsLwdhE0d RBnw== X-Gm-Message-State: AJIora8zVlg89t8aFcxwY5072xH9tGRkwg/XVUzQa7W44sys4tUSkW0F udrXfBXUHyzgLHXUpL8CzsBaLTsSPXTOsh/tAw== X-Google-Smtp-Source: AGRyM1u5wMrg3Dj62VDc19qLELQ21pNgDjr7RG8JmDND2ovfsQwBtAh8lTkmGF1a/0WVMU+4RWrNFRXG8A0elKLu0w== X-Received: from kaleshsingh.mtv.corp.google.com ([2620:15c:211:200:4f77:3b64:736a:394e]) (user=kaleshsingh job=sendgmr) by 2002:a25:ccca:0:b0:66e:c109:a884 with SMTP id l193-20020a25ccca000000b0066ec109a884mr12597907ybf.161.1658821105018; Tue, 26 Jul 2022 00:38:25 -0700 (PDT) Date: Tue, 26 Jul 2022 00:37:45 -0700 In-Reply-To: <20220726073750.3219117-1-kaleshsingh@google.com> Message-Id: <20220726073750.3219117-13-kaleshsingh@google.com> Mime-Version: 1.0 References: <20220726073750.3219117-1-kaleshsingh@google.com> X-Mailer: git-send-email 2.37.1.359.gd136c6c3e2-goog Subject: [PATCH v6 12/17] KVM: arm64: Add PROTECTED_NVHE_STACKTRACE Kconfig From: Kalesh Singh To: maz@kernel.org, mark.rutland@arm.com, broonie@kernel.org, madvenka@linux.microsoft.com, tabba@google.com, oliver.upton@linux.dev Cc: will@kernel.org, qperret@google.com, kaleshsingh@google.com, james.morse@arm.com, alexandru.elisei@arm.com, suzuki.poulose@arm.com, catalin.marinas@arm.com, andreyknvl@gmail.com, vincenzo.frascino@arm.com, mhiramat@kernel.org, ast@kernel.org, wangkefeng.wang@huawei.com, elver@google.com, keirf@google.com, yuzenghui@huawei.com, ardb@kernel.org, oupton@google.com, linux-arm-kernel@lists.infradead.org, kvmarm@lists.cs.columbia.edu, linux-kernel@vger.kernel.org, android-mm@google.com, kernel-team@android.com X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220726_003826_391269_F996874B X-CRM114-Status: GOOD ( 10.50 ) 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 This can be used to disable stacktrace for the protected KVM nVHE hypervisor, in order to save on the associated memory usage. This option is disabled by default, since protected KVM is not widely used on platforms other than Android currently. Signed-off-by: Kalesh Singh Reviewed-by: Fuad Tabba Tested-by: Fuad Tabba --- Changes in v6: - Add Fuad’s Reviewed-by and Tested-by tags Changes in v5: - Make PROTECTED_NVHE_STACKTRACE depend on NVHE_EL2_DEBUG, per Marc arch/arm64/kvm/Kconfig | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/arch/arm64/kvm/Kconfig b/arch/arm64/kvm/Kconfig index 8a5fbbf084df..09c995869916 100644 --- a/arch/arm64/kvm/Kconfig +++ b/arch/arm64/kvm/Kconfig @@ -46,6 +46,21 @@ menuconfig KVM If unsure, say N. +config PROTECTED_NVHE_STACKTRACE + bool "Protected KVM hypervisor stacktraces" + depends on NVHE_EL2_DEBUG + default n + help + Say Y here to enable pKVM hypervisor stacktraces on hyp_panic() + + If you are not using protected nVHE (pKVM), say N. + + If using protected nVHE mode, but cannot afford the associated + memory cost (less than 0.75 page per CPU) of pKVM stacktraces, + say N. + + If unsure, say N. + config NVHE_EL2_DEBUG bool "Debug mode for non-VHE EL2 object" depends on KVM