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 B8EFFCA0FFD for ; Fri, 30 Aug 2024 15:01:26 +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=dPnlNZOhwTsIRXv4Sk0iQXS77RKjE75tPIgCb+gSFDA=; b=MF6eQZq9rnsYpAGkyKmUSBVdmY XMBa6lzQ8o+xBF6a8Ch8Cmx0TcXXmFfdnyQlmhyMVB7uQVWuh3SHHXNiE964PbNljcwlv/guGEhUh QQNCMOg9176Pre/at6oamwBVfDdlD6J4NOeOMYIRQxljWwkvg8ZfvXeq8lSP8eeN7aMyEaMjdq0nM EUwBUgyVEJ14howmTT/URF/3IpKFAYgNCRIYQDVECBOD+3kHWR2g1N2Rg6lv5A3CqULrgPRa6o/Mp 1kclIapoYeL33BdSu5qz/TQaXsmaWM9xqgfQZiToCZwc9LzLlC6+hNvkzLC/d78s+YPv1F7lgE32G VPrnQrwA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sk37i-00000006huK-1xtn; Fri, 30 Aug 2024 15:01:14 +0000 Received: from sin.source.kernel.org ([145.40.73.55]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sk36n-00000006hcM-3Ov2 for linux-arm-kernel@lists.infradead.org; Fri, 30 Aug 2024 15:00:19 +0000 Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by sin.source.kernel.org (Postfix) with ESMTP id 08568CE0C71; Fri, 30 Aug 2024 15:00:15 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 21632C4CEC2; Fri, 30 Aug 2024 15:00:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1725030014; bh=zYYhOpuAWGQ1E161NyOM5PDEx7oo0DseUsRtf8Sym0c=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=hRCrPg0SJXiRzxNKoVv0C8bC9cQr5gScOiTfEY3s42ywZGdr/A8VefV3/eWkbGXDE Eo8o7UGJcvbFBmF7UUdCNxCbAaKS+krgu9tAXmmImPucoj4IylH47hGrtSqS8iR7Vj uQ83Q8sSsCVJg7Ce1NQfu6iUVCPDyXEsA0t6F+GA5M3CiqVeI8XTucuJiwCOiyLscQ p1WT5tYJyC9SIZPeebyrM5oaOED9LjQYaTETyI62YIRReRgic4g7+tCw/1YQu9eGdc upmYCVW5rjxUjeHuo0kr1mPUiM9qAWYIZxwhbjyP0wk/3nAELL0v0Pre3HmnWRazZS kKnlvh9d3imjQ== 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 1sk36h-008H1t-SN; Fri, 30 Aug 2024 16:00:11 +0100 Date: Fri, 30 Aug 2024 16:00:11 +0100 Message-ID: <8634mmvyx0.wl-maz@kernel.org> From: Marc Zyngier To: Sebastian Ene Cc: akpm@linux-foundation.org, alexghiti@rivosinc.com, ankita@nvidia.com, ardb@kernel.org, catalin.marinas@arm.com, christophe.leroy@csgroup.eu, james.morse@arm.com, vdonnefort@google.com, mark.rutland@arm.com, oliver.upton@linux.dev, rananta@google.com, ryan.roberts@arm.com, shahuang@redhat.com, suzuki.poulose@arm.com, will@kernel.org, yuzenghui@huawei.com, kvmarm@lists.linux.dev, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, kernel-team@android.com Subject: Re: [PATCH v9 0/5] arm64: ptdump: View the second stage page-tables In-Reply-To: <864j72vzmw.wl-maz@kernel.org> References: <20240827084549.45731-1-sebastianene@google.com> <864j72vzmw.wl-maz@kernel.org> 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: sebastianene@google.com, akpm@linux-foundation.org, alexghiti@rivosinc.com, ankita@nvidia.com, ardb@kernel.org, catalin.marinas@arm.com, christophe.leroy@csgroup.eu, james.morse@arm.com, vdonnefort@google.com, mark.rutland@arm.com, oliver.upton@linux.dev, rananta@google.com, ryan.roberts@arm.com, shahuang@redhat.com, suzuki.poulose@arm.com, will@kernel.org, yuzenghui@huawei.com, kvmarm@lists.linux.dev, linux-arm-kernel@lists.infradead.org, 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-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240830_080018_233342_C4BCC394 X-CRM114-Status: GOOD ( 20.02 ) 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 On Fri, 30 Aug 2024 15:44:39 +0100, Marc Zyngier wrote: > > Hi Seb, [...] > I've been giving this a go on my test systems with 16k pages, and it > doesn't really work as advertised: > > root@babette:/sys/kernel/debug/kvm# cat 2573-13/stage2_* > 2 > ---[ Guest IPA ]--- > 0x0000000000000000-0x0000000008000000 128M > 0x0000000008000000-0x00000000090a0000 17024K 3 > 0x00000000090a0000-0x00000000090a4000 16K 3 R W X AF > 0x00000000090a4000-0x000000000a000000 15728K 3 > > Only 16kB mapped? This is a full Linux guest running the Debian > installer, and just the kernel is about 20MB (the VM has 4GB of RAM, > and is using QEMU as the VMM) > > So clearly something isn't playing as expected. Also, this '128M' > without a level being displayed makes me wonder. It is probably the > QEMU flash, but then the rest of the addresses don't make much sense > (RAM on QEMU is at 1GB, not at 128MB. > > On another system with kvmtool, I get something similar: > > root@duodenum:/home/maz# cat /sys/kernel/debug/kvm/*/stage2_* > 2 > ---[ Guest IPA ]--- > 0x0000000000000000-0x0000000001020000 16512K 3 > 0x0000000001020000-0x0000000001024000 16K 3 R W X AF > 0x0000000001024000-0x0000000002000000 16240K 3 > > and kvmtool places the RAM at 2GB. Clearly not what we're seeing here. > > Could you please verify this? For the record, on a 4kB host, I get much more plausible results: root@big-leg-emma:/home/maz# cat /sys/kernel/debug/kvm/632-12/stage2_* 3 ---[ Guest IPA ]--- 0x0000000000000000-0x0000000000200000 2M 2 R AF BLK 0x0000000000200000-0x0000000040000000 1022M 2 0x0000000040000000-0x0000000040200000 2M 2 R W X AF BLK 0x0000000040200000-0x0000000044000000 62M 2 0x0000000044000000-0x0000000044200000 2M 2 R W X AF BLK 0x0000000044200000-0x0000000047600000 52M 2 0x0000000047600000-0x0000000047800000 2M 2 R W AF BLK 0x0000000047800000-0x0000000047e00000 6M 2 R W X AF BLK 0x0000000047e00000-0x0000000048000000 2M 2 R W AF BLK 0x0000000048000000-0x00000000b9c00000 1820M 2 0x00000000b9c00000-0x00000000b9e00000 2M 2 R W X AF BLK 0x00000000b9e00000-0x00000000bb800000 26M 2 0x00000000bb800000-0x00000000bba00000 2M 2 R W X AF BLK 0x00000000bba00000-0x00000000bbe00000 4M 2 R W AF BLK 0x00000000bbe00000-0x00000000bc200000 4M 2 R W X AF BLK 0x00000000bc200000-0x00000000bc800000 6M 2 R W AF BLK 0x00000000bc800000-0x00000000be400000 28M 2 0x00000000be400000-0x00000000bf800000 20M 2 R W X AF BLK 0x00000000bf800000-0x00000000bfe00000 6M 2 R W AF BLK 0x00000000bfe00000-0x00000000c0000000 2M 2 R W X AF BLK So 16kB is the one that needs investigating, and I strongly suspect that 64kB is in the same boat... Thanks, M. (signing off for the day) -- Without deviation from the norm, progress is not possible.