Received: by 2002:ad5:4acb:0:0:0:0:0 with SMTP id n11csp3048875imw; Mon, 18 Jul 2022 00:38:29 -0700 (PDT) X-Google-Smtp-Source: AGRyM1sVVMJpQ74GRDGyVgG5FGLlAXcETN+Ja+4MNRVt8u4d9AtClZgw4OPMjPsB0vBVGlrtxIh7 X-Received: by 2002:a17:906:84f0:b0:72b:5cf4:465d with SMTP id zp16-20020a17090684f000b0072b5cf4465dmr25184352ejb.705.1658129908816; Mon, 18 Jul 2022 00:38:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1658129908; cv=none; d=google.com; s=arc-20160816; b=WO88aAUZroo9KcmAiYNmXC4ptus48N/OvB4kVrRvwMqgn9+fsNJkLkMLSqhrzQTOSy DPVkCz87TKt15O1RBkNq5yzFLz4S9/pakwJheUindqBt6eJMU3CQslCushoXsDab9D4/ a7Y0uRZaOH2xif4X2b5lpMeWr54up1d00j6WJ4zSuS/ImQ7sJv9+ch2ssXOhoA1k95oz L9X9rXS/mb1OAFxCAqPDqgHerONFY7Ukv4bHUJ2zuO97POfTY8KBY6QgAvQ+tk8RqOIz IUzz2mOHtrhcWODpGX8Q43M4t+Y6UKvqVX9erfsd3v15nmdIX1bLHQ1lqEoiZGHvUWha emAA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:user-agent:references:in-reply-to :subject:cc:to:from:message-id:date:dkim-signature; bh=g4S8noj5HtG3qs5ms1BhNMXF3EJqdSjKmfMAJJElSRY=; b=c+6UzUX43sLosiz+1VHUeurcvEjBdHkUoCvK0yQ7UXkq3J8ztxDu6EUV1hiaDb9qgY FL70EY2SrMp+oJyeC6/9MAHdP9vZ+5lMl7ypZQNmA5hD9isFX73iNC0BEbP/VKlL3qPz w7lK/mOcR7WJAA/snWaeMLMi/AxXeQGY+0tqqZ2oORKRIcR9mg0tSIByjF7Ln5tRNXgF 17aPVXa5Pjg8acZezHr/z4GotBPQ8CKugXzLPsZIUiBTe6u0PrhJo/YO7STFH1TrEJVd cfvLze9KTQtBklN1u8fMdGKwNaut4fNkyR4kRuPRhY40KOJWoNVjnQMIbsWMrcj3mzug 6SlQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=O1PfYO0H; 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=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id b10-20020a056402350a00b0043ac617804esi18043129edd.31.2022.07.18.00.38.04; Mon, 18 Jul 2022 00:38:28 -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=@kernel.org header.s=k20201202 header.b=O1PfYO0H; 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=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233853AbiGRHbI (ORCPT + 99 others); Mon, 18 Jul 2022 03:31:08 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55972 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233791AbiGRHbG (ORCPT ); Mon, 18 Jul 2022 03:31:06 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2E08112635 for ; Mon, 18 Jul 2022 00:31:06 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id B7BBB6136F for ; Mon, 18 Jul 2022 07:31:05 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 0C115C341C0; Mon, 18 Jul 2022 07:31:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1658129465; bh=DyGORClHzu6C8JR5WaLhDs42Jqg9N7GmhXlXTrbaLhE=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=O1PfYO0HlJ1CpXoE8mak09OaqWh7UJ8uDiPmTck+0ZbZW07RDdC4/lpL/rBgNBwwm dfsVfNm57IxV/NdtRLQioQFtM2DQqpsTrY4nYuxcj1WcKVXdBOW5Iz3UfX5TkCm8I4 RD7BWAi/Y48LFHuoZLjd3NkFPdee1KuO0XYHUiKMpGbGg50eGBdZT/ETl0keuKiRAl Xuf5gINglPvszBBLRaxIiIWVlkB6KeNYSwz9YfELWUcz3rOwwbUIFSIAlmjZBU1yg7 SSa+3g2Ya8eI7MYJ4yo8z1Ipd8OqogqdnOLGMJZubbDW+jW3T2ufPgYx7Vzjgrt6MJ Jyg7jzY/UA0pw== Received: from 82-132-227-210.dab.02.net ([82.132.227.210] helo=wait-a-minute.misterjones.org) by disco-boy.misterjones.org with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.95) (envelope-from ) id 1oDLDa-0088Zv-EP; Mon, 18 Jul 2022 08:31:03 +0100 Date: Mon, 18 Jul 2022 08:30:51 +0100 Message-ID: <877d4a513o.wl-maz@kernel.org> From: Marc Zyngier To: Kalesh Singh Cc: mark.rutland@arm.com, broonie@kernel.org, madvenka@linux.microsoft.com, will@kernel.org, qperret@google.com, tabba@google.com, james.morse@arm.com, alexandru.elisei@arm.com, suzuki.poulose@arm.com, catalin.marinas@arm.com, andreyknvl@gmail.com, russell.king@oracle.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, kernel-team@android.com Subject: Re: [PATCH v4 11/18] KVM: arm64: Stub implementation of non-protected nVHE HYP stack unwinder In-Reply-To: <20220715061027.1612149-12-kaleshsingh@google.com> References: <20220715061027.1612149-1-kaleshsingh@google.com> <20220715061027.1612149-12-kaleshsingh@google.com> User-Agent: Wanderlust/2.15.9 (Almost Unreal) SEMI-EPG/1.14.7 (Harue) FLIM-LB/1.14.9 (=?UTF-8?B?R29qxY0=?=) APEL-LB/10.8 EasyPG/1.0.0 Emacs/27.1 (x86_64-pc-linux-gnu) MULE/6.0 (HANACHIRUSATO) MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") Content-Type: text/plain; charset=US-ASCII X-SA-Exim-Connect-IP: 82.132.227.210 X-SA-Exim-Rcpt-To: kaleshsingh@google.com, mark.rutland@arm.com, broonie@kernel.org, madvenka@linux.microsoft.com, will@kernel.org, qperret@google.com, tabba@google.com, james.morse@arm.com, alexandru.elisei@arm.com, suzuki.poulose@arm.com, catalin.marinas@arm.com, andreyknvl@gmail.com, russell.king@oracle.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, kernel-team@android.com X-SA-Exim-Mail-From: maz@kernel.org X-SA-Exim-Scanned: No (on disco-boy.misterjones.org); SAEximRunCond expanded to false X-Spam-Status: No, score=-7.7 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS 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 Fri, 15 Jul 2022 07:10:20 +0100, Kalesh Singh wrote: > > Add stub implementations of non-protected nVHE stack unwinder, for > building. These are implemented later in this series. > > Signed-off-by: Kalesh Singh > --- > arch/arm64/include/asm/stacktrace/nvhe.h | 22 ++++++++++++++++++++++ > 1 file changed, 22 insertions(+) > > diff --git a/arch/arm64/include/asm/stacktrace/nvhe.h b/arch/arm64/include/asm/stacktrace/nvhe.h > index 1eac4e57f2ae..36cf7858ddd8 100644 > --- a/arch/arm64/include/asm/stacktrace/nvhe.h > +++ b/arch/arm64/include/asm/stacktrace/nvhe.h > @@ -8,6 +8,12 @@ > * the HYP memory. The stack is unwinded in EL2 and dumped to a shared > * buffer where the host can read and print the stacktrace. > * > + * 2) Non-protected nVHE mode - the host can directly access the > + * HYP stack pages and unwind the HYP stack in EL1. This saves having > + * to allocate shared buffers for the host to read the unwinded > + * stacktrace. > + * > + * > * Copyright (C) 2022 Google LLC > */ > #ifndef __ASM_STACKTRACE_NVHE_H > @@ -53,5 +59,21 @@ static int notrace unwind_next(struct unwind_state *state) > NOKPROBE_SYMBOL(unwind_next); > #endif /* CONFIG_PROTECTED_NVHE_STACKTRACE */ > > +/* > + * Non-protected nVHE HYP stack unwinder > + */ > +#else /* !__KVM_NVHE_HYPERVISOR__ */ I don't get this path. This either represents the VHE hypervisor or the kernel proper. Which one is it? > +static inline bool on_overflow_stack(unsigned long sp, unsigned long size, > + struct stack_info *info) > +{ > + return false; > +} > + > +static int notrace unwind_next(struct unwind_state *state) > +{ > + return 0; > +} > +NOKPROBE_SYMBOL(unwind_next); > + > #endif /* __KVM_NVHE_HYPERVISOR__ */ > #endif /* __ASM_STACKTRACE_NVHE_H */ Thanks, M. -- Without deviation from the norm, progress is not possible.