Received: by 2002:ad5:4acb:0:0:0:0:0 with SMTP id n11csp4709801imw; Tue, 19 Jul 2022 11:41:05 -0700 (PDT) X-Google-Smtp-Source: AGRyM1vkUgXHxuE4gutKaG1ss2w7ruaNJ0eQAIaIkC59cOBF+44DGlB5SIBIH0uQRJqGIikSEfz0 X-Received: by 2002:a05:6402:1348:b0:43b:a1de:deef with SMTP id y8-20020a056402134800b0043ba1dedeefmr3660613edw.120.1658256065771; Tue, 19 Jul 2022 11:41:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1658256065; cv=none; d=google.com; s=arc-20160816; b=aF7CGSPJqi+YtG7fdQYsPfgj855pyj6PwC4Um5HeyGXPVemIue/Sx5fhS6EsUfc6iL SUllWbdPTdNzPLTZe0MoK3TPd2UjYMtMHQLGy2r5vmuwEU6o/KKX36PPi/aIlyldfCGi 6z9CU/9nHW6UWe88IXddMBAIPEd6PrS0l0uXTtqSBef8LGPP6YO6QMwafx/KFg00RqMC 9lfxMuNWJpzSS6Bg20GSl6Zb67FQVMH4y8jFu8PS6zmgvsMNY7YfGmp4mgwYkBZjRqLl dq4cwAPh493UvYYknwVEDsN8ETMv3x32J3YhCtgOGl6vP9LnLWwXBTfztDm7FYxRHi/U NybA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=NQRCSR2WG8er1FhdGOfttemdCe3XEsMa8dXWlWjyNw8=; b=WzmupvxCtlCraHgmQKaw8XN86K4txTXaFX2lcXzOEybtex+gwWj1yGq/tMzXefq9O9 NuhbL0Sxj6xXhsSHJKEQUXrciKuP6RlLyauYIIkTHTciA46v0XoSQ6lcdkDPd6FBW2Ok 1ukY4DOjAHaQNuGHu3Rk0CwsJbom8mx5kq70UVY9apYGY96ZOyvTCz0j5k0G69Mz767E w3lqgjjs6Wf6TC0DnQbHe2xlSsUi1MZ/5zhQ44DTrY66H/cRUMVSgRe9RnNT9YDEtuk9 VemvNnZA+t7uo+j1RtlQv7PdP6mJngdU6a38A+r1BZkHZd6AQxZQYfEaDedmjyr9ledN wlaQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=Dev7X87C; 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 hy11-20020a1709068a6b00b0072b4b305963si18354019ejc.936.2022.07.19.11.40.40; Tue, 19 Jul 2022 11:41:05 -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=Dev7X87C; 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 S240096AbiGSSXb (ORCPT + 99 others); Tue, 19 Jul 2022 14:23:31 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53582 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232167AbiGSSX3 (ORCPT ); Tue, 19 Jul 2022 14:23:29 -0400 Received: from mail-wm1-x329.google.com (mail-wm1-x329.google.com [IPv6:2a00:1450:4864:20::329]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 95DD65C962 for ; Tue, 19 Jul 2022 11:23:28 -0700 (PDT) Received: by mail-wm1-x329.google.com with SMTP id a11so3334772wmq.3 for ; Tue, 19 Jul 2022 11:23:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=NQRCSR2WG8er1FhdGOfttemdCe3XEsMa8dXWlWjyNw8=; b=Dev7X87CB5SrU1paX0aLZ1+Gcz3wYUyDgf/zZsSA+oLuRySUD7tRDvnFp9di/5e4vX sKqRbC371IPytuLFhWEqjWgmzGFGwA4yw6VGH1Nod0pyDgOLFE7F/P7FECTNwT5oiTV7 Sd5cwBi0uhQ0KbLzBm1rbHDI3KKPw9HXCKIIu06+MxM0cE7KVMDeolPT4ZPjPHjE/DYD qB8WBoteOxI+Eg8BbfsSaxyg1aPAZjnHl88qURuXDtzwgXIyzzS3KQLWmtWIf5QaYa5W ZGlyfciWywxwsYPW1iA7dvcLLFDZZe2Q4CV9MTwIC73lzWaoxtGbou4nMfOV2cMUH6W/ 4S3A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=NQRCSR2WG8er1FhdGOfttemdCe3XEsMa8dXWlWjyNw8=; b=5Dm83XjWdRgdybYfbsB29+xZbNzkAYcxPFGZskxZ1hAEiheTx9dDGLhczHbIpUFitr Yp+1ImNV/gwD45oUbViPOdGAwyGOStXLCUHSEnXO8gdeU+ba6DyRfkQT/yQ0ICqYKOh4 /cQJ+paGV9/VKS6nHlbYbN2ieNRwpsw54lbkeciJLDzzGPq7F4WW4dK1acEqY7jXJlVr cs6ttSxWPNY2MSfd35kQpydaT2g3I8ECGRBfxUHc/9QmJl3BK0Fgj+nNJewZRoColh8i yqPhbDEEBapVRltQ2cuVJrWXywEQq0E8bwHIEz0uC6f4uUAcSuKlZcjvtc8r0HzAEnbD DpmA== X-Gm-Message-State: AJIora/NJReqcBh9vsKU6QXCOA98wVgflGxZT6nUA25Lp5grOkOgX6Ll WqElxvm9udImvedYy2JCoC2EFd/0OfclgxIya+ifAw== X-Received: by 2002:a05:600c:3554:b0:3a3:1d70:9101 with SMTP id i20-20020a05600c355400b003a31d709101mr501679wmq.61.1658255006954; Tue, 19 Jul 2022 11:23:26 -0700 (PDT) MIME-Version: 1.0 References: <20220715061027.1612149-1-kaleshsingh@google.com> <20220715061027.1612149-9-kaleshsingh@google.com> <87cze252q7.wl-maz@kernel.org> <87ilntz8yh.wl-maz@kernel.org> In-Reply-To: <87ilntz8yh.wl-maz@kernel.org> From: Kalesh Singh Date: Tue, 19 Jul 2022 11:23:16 -0700 Message-ID: Subject: Re: [PATCH v4 08/18] KVM: arm64: Add PROTECTED_NVHE_STACKTRACE Kconfig To: Marc Zyngier , Greg KH Cc: Mark Rutland , Mark Brown , "Madhavan T. Venkataraman" , Will Deacon , Quentin Perret , Fuad Tabba , James Morse , Alexandru Elisei , Suzuki K Poulose , Catalin Marinas , andreyknvl@gmail.com, vincenzo.frascino@arm.com, Masami Hiramatsu , Alexei Starovoitov , Kefeng Wang , Marco Elver , Keir Fraser , Zenghui Yu , Ard Biesheuvel , Oliver Upton , "moderated list:ARM64 PORT (AARCH64 ARCHITECTURE)" , kvmarm , LKML , "Cc: Android Kernel" Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-17.6 required=5.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, ENV_AND_HDR_SPF_MATCH,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS, USER_IN_DEF_DKIM_WL,USER_IN_DEF_SPF_WL autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Jul 19, 2022 at 3:35 AM Marc Zyngier wrote: > > On Mon, 18 Jul 2022 18:03:30 +0100, > Kalesh Singh wrote: > > > > On Sun, Jul 17, 2022 at 11:56 PM Marc Zyngier wrote: > > > > > > [- Drew and android-mm, as both addresses bounce] > > > > > > On Fri, 15 Jul 2022 07:10:17 +0100, > > > Kalesh Singh wrote: > > > > > > > > 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 > > > > --- > > > > arch/arm64/kvm/Kconfig | 15 +++++++++++++++ > > > > 1 file changed, 15 insertions(+) > > > > > > > > diff --git a/arch/arm64/kvm/Kconfig b/arch/arm64/kvm/Kconfig > > > > index 8a5fbbf084df..1edab6f8a3b8 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 KVM > > > > + 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. > > > > + > > > > > > Can we make this depend on NVHE_EL2_DEBUG instead? I'd like to keep > > > the disclosing of EL2 information in protected mode a strict debug > > > feature. > > > > Hi Marc, > > > > An earlier version was similar to what you propose. The unwinding > > depended on NVHE_EL2_DEBUG and all unwinding was done from EL1 with > > host stage 2 being disabled. The reason the design was changed is > > because Android expressed the need for pKVM hyp stacktraces in > > production environments. [1] > > I think that's an Android-specific requirement that doesn't apply to > upstream. If Android wants to enable this in production (and > potentially leak details of the hypervisor address space), that's > Android's business, and they can carry a patch for that. Upstream > shouldn't have to cater for such a thing. Hi Marc, For android it's important to be able to debug issues from the field. But I agree no need to subject upstream to the same requirements. I'll guard this with the NVHE_EL2_DEBUG config in the next version. Thanks, Kalesh > > Thanks, > > M. > > -- > Without deviation from the norm, progress is not possible.