Received: by 2002:ad5:4acb:0:0:0:0:0 with SMTP id n11csp3554000imw; Mon, 18 Jul 2022 10:06:59 -0700 (PDT) X-Google-Smtp-Source: AGRyM1swnJKH3HPvjbUO65bjfC7hyIeZCbmg2GvpIJ7D1lvk8yWXvP5QKFIifbBAnh9GtROUYIDo X-Received: by 2002:a17:907:2cee:b0:72b:3b63:200 with SMTP id hz14-20020a1709072cee00b0072b3b630200mr27160460ejc.678.1658164019588; Mon, 18 Jul 2022 10:06:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1658164019; cv=none; d=google.com; s=arc-20160816; b=OP1VGp4E1mmO6D45Y0RkN8cEwx7OHwgXtM08sYknDHScZGHc6f+AvPgz1KcPEJDZww PMNaWlQRJz4lJKhYCQK2sBu3YA2LlZ5VjMeYhOsPf0HwMXyAB4bQwpa4DuXi4BXw5vFx nkA8XooRmuSYe95VO9NHQiWPg+xSulMSsqvj1WiXeAhRYoQrTX9FQ3rjuWx+UOygSu0O eMNAkWV+tilQbVIz3NFwh0GwWrJrj3wIVkqiRq51OzvgD67GiMTVIwrbXj723x+G3TaB 0htrarJL0ZPHFu0zkPXirgrDaM7GKQgPRcEzAQrLbxUhkQzts3PXv/daTfdKqGlfGChS dAPA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:message-id:user-agent :references:in-reply-to:subject:cc:to:from:date:mime-version :dkim-signature; bh=ntnDYi3JBVeQLEOMyhxCsxz3H1AP+fOAhuIaaYpW9j8=; b=Y8eoY2sFf11t8qurGkgIJ9mz/Sgya1SgN8Jbxh5nhDd0/MbZCMz9Xu9XuwmhmFIUx5 xk+2opOK4oIS1qGdA+xakWfeJQjti1ZFv/X5kbgRSGs1KpKtblyg2rCPgmJkErsijozU GDan2OS2VexcG2x95sVkydf4OFOhcNrlwmeyHALVIs1OL/ucT0VBi57lsAb2RTW/Gakw TLMFSlFq9IGvkDH/CtA8uxxIa3j2fZ8Ss8pq1ZoFE2ruzgECh9QaRp4b4Rm9cZYnrsPh 76lqz5lzjXQ5i56C0EIU42SPPEyildTqk58FB6MRGFlW0Q9rG7fRgxRCZtvXmn+Y980S i2eg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=JPyT0Ryn; 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 hr21-20020a1709073f9500b0072f46330088si1722545ejc.555.2022.07.18.10.06.33; Mon, 18 Jul 2022 10:06:59 -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=JPyT0Ryn; 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 S234804AbiGRQ5e (ORCPT + 99 others); Mon, 18 Jul 2022 12:57:34 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51436 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234759AbiGRQ5c (ORCPT ); Mon, 18 Jul 2022 12:57:32 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D8D502BB22 for ; Mon, 18 Jul 2022 09:57:30 -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 ams.source.kernel.org (Postfix) with ESMTPS id 81F4DB8167A for ; Mon, 18 Jul 2022 16:57:29 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 113E5C341C0; Mon, 18 Jul 2022 16:57:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1658163448; bh=AnJdj+qPEyjwaxmU5ymhWx17b9DtWL91rx0lNbaEJnI=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=JPyT0RynILtx2EUQmdMhPkGtYND7f66t4sOqBJzNqUnh932Y3l7aKdSRg8BSsRirV nLRrxRu4tZDl0flU0dmGh6/UhxNZUDmjVokIfXd+i77V1d6PEIaTEXtPfFmUInIYdO dC8wS4PXMqXygxngpliHXhhxIYEtQpLRkk3afxVmt70C4+Cx1+KW6NaYIe1gOr7FOV ifDY8Ge37q2QM/Y6/hToXlMykwUdZqimI5LDnQTpXgRfhH8VHEtfYFFYF5jl9b+XAp 0OibGdOE+30id4Th0KL0jbwwoQCvYfxFoUxZk0h+HAy5MwwtW9jhmT5AND3VdWszsO a9O2fTIZS1LKQ== Received: from disco-boy.misterjones.org ([51.254.78.96] helo=www.loen.fr) by disco-boy.misterjones.org with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.95) (envelope-from ) id 1oDU3h-008GnX-MJ; Mon, 18 Jul 2022 17:57:25 +0100 MIME-Version: 1.0 Date: Mon, 18 Jul 2022 17:57:25 +0100 From: Marc Zyngier To: Kalesh Singh 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, russell.king@oracle.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" Subject: Re: [PATCH v4 11/18] KVM: arm64: Stub implementation of non-protected nVHE HYP stack unwinder In-Reply-To: References: <20220715061027.1612149-1-kaleshsingh@google.com> <20220715061027.1612149-12-kaleshsingh@google.com> <877d4a513o.wl-maz@kernel.org> User-Agent: Roundcube Webmail/1.4.13 Message-ID: <54b1c642097af7d290174072bd6e856c@kernel.org> X-Sender: maz@kernel.org Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit X-SA-Exim-Connect-IP: 51.254.78.96 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.8 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 2022-07-18 17:51, Kalesh Singh wrote: > On Mon, Jul 18, 2022 at 12:31 AM Marc Zyngier wrote: >> >> 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? > > Hi Marc. This is run from kernel proper context. And it's the > unwinding for conventional nVHE (non-protected). The unwinding is done > from the host kernel in EL1. This really deserves a comment here, as the one you currently have is a bit misleading (and you probably want to move it below the #else). Thanks, M. -- Jazz is not dead. It just smells funny...