From mboxrd@z Thu Jan 1 00:00:00 1970 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 1DE0CE77197 for ; Tue, 7 Jan 2025 09:32:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Type:MIME-Version: References:In-Reply-To:Subject:Cc:To:From:Message-ID:Date:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=87+vEX+dmzF/m4jjsN8MEZUQoJzV6o6UGqgf8MAoEYc=; b=a2HA/uZVILMr7QOMUysMQ+j2W7 e2lOFEwBE2teH3KVE3n1+Kd79Kcdibgw6lodzaZZwtU48YalYPnMp90acXoUasFGV9MZawzO/5WC9 RV/MzyU8GmuKb9PiNS9UlBl21AeIoS+SQHuXaygScf0JG3Bpuexwnl7dk69AMHVqCjkTsOPiuMxCw 4j9AvqyKqHcEHDMBbuuvvEdxo0wRF5r/Sotb0sZJVJy7mU+D/g0Amit/GgdVteBmcK7RO0r1iJ9I3 cCG6z7ZgpGYFThtg9xOAgUBS223A3Fzjv8ZcGVwFnWMY7DyJ4g12QbKkqDodQLBmMdDueF1CQUlMy CzZGga1A==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1tV5ww-000000048LN-1Fv6; Tue, 07 Jan 2025 09:32:34 +0000 Received: from dfw.source.kernel.org ([139.178.84.217]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1tV5vk-0000000486q-0TVS for linux-arm-kernel@lists.infradead.org; Tue, 07 Jan 2025 09:31:21 +0000 Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by dfw.source.kernel.org (Postfix) with ESMTP id 014E35C5A93; Tue, 7 Jan 2025 09:30:38 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id CA7FFC4CED6; Tue, 7 Jan 2025 09:31:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1736242278; bh=CaBk+HCXzISi/V9QHHnknAncziV1cfTksEsUBzRp8f8=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=oQ1DpMznhDrsNvG7OIpD/lr+j5Xlj3Lre6BrRA55fospF5lHvkGC8gfOPKZCebhoC 4bx7BZ4IqFjHo3srg0hGWK95zua4eHioDeZw4QyyUejGglBZLg2SFMP4DJZgGQLMqC jkMHxPTYfwqnlOD8rPA1Tiy9DM9xiSinnI7y+6JqCjkN34+0AiFNxowbqTxx5gM8dU jxW/fbYz/xh4LCTAD1nsdHEKztkZbDp6/lq9PID7oENrIlQi0ILJs8ZFgOu8eZYTcl TQXH2FWtzl+38ZgpOZcAMxHmu4M2prSF//Ps9QDN1/1PPzlvCO3tFklUFZLSO2FG7q CGfIsB0lX4yEA== Received: from sofa.misterjones.org ([185.219.108.64] helo=goblin-girl.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 1tV5vg-009iYS-ES; Tue, 07 Jan 2025 09:31:16 +0000 Date: Tue, 07 Jan 2025 09:31:16 +0000 Message-ID: <86zfk3nf6j.wl-maz@kernel.org> From: Marc Zyngier To: Vincent Donnefort Cc: oliver.upton@linux.dev, kvmarm@lists.linux.dev, kernel-team@android.com, linux-arm-kernel@lists.infradead.org, Suzuki K Poulose , Joey Gouly , Zenghui Yu Subject: Re: [PATCH] KVM: arm64: Fix nVHE stacktrace VA bits mask In-Reply-To: <20250106183213.4094616-1-vdonnefort@google.com> References: <20250106183213.4094616-1-vdonnefort@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/29.4 (aarch64-unknown-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: 185.219.108.64 X-SA-Exim-Rcpt-To: vdonnefort@google.com, oliver.upton@linux.dev, kvmarm@lists.linux.dev, kernel-team@android.com, linux-arm-kernel@lists.infradead.org, suzuki.poulose@arm.com, joey.gouly@arm.com, zenghui.yu@linux.dev X-SA-Exim-Mail-From: maz@kernel.org X-SA-Exim-Scanned: No (on disco-boy.misterjones.org); SAEximRunCond expanded to false X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20250107_013120_203355_BF3EACAC X-CRM114-Status: GOOD ( 15.85 ) 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 Vincent, Please add all the KVM/arm64 reviewers in the future (I added them this time). On Mon, 06 Jan 2025 18:32:13 +0000, Vincent Donnefort wrote: > > The hypervisor VA space size depends on both the ID map's > (IDMAP_VA_BITS) and the kernel stage-1 (VA_BITS). When VA_BITS is > smaller than IDMAP_VA_BITS (i.e. 39-bit), the stacktrace can contain > addresses bigger than the current VA_BITS mask. > > As the hyp_va_bits value needs to be used outside of the init code now, > use a global variable, shared by all the kvm users in mmu.c, arm.c and > now stacktrace.c. I tend to dislike this approach for at least three reasons: - it makes it hard to follow *when* hyp_va_bits is made valid, while passing the value as a parameter is self explanatory. Specially given how convoluted the nVHE/pKVM init is these days. - it prevents the eventual use of *multiple* VA bit values (one for TTBR0, one for TTBR1) once the grand plan for hVHE is completed (right after full NV support is merged! ;-) - it makes the change larger than it should be, specially for something that should be backported. So I'd rather you keep the general shape of the code as it, and simply publish this 'hyp_va_bits' for the purpose of the backtrace code. Thanks, M. -- Without deviation from the norm, progress is not possible.