From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=217.140.110.172 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796227544; b=R+YVjoJvek8eWZEPBLksSMESriZIpeRigz1nzyjVUVe24/XR4PyDCPHcrNRGj5pxVuUw dwB+FZbegoTNOy5/brhol0Vl6sQNwqGZ4gX1/1snvjb/ID9yizhoIqrcQUL0xkVRPZrVM OM0JHmpI3TVB+cWI5EOpLKqkyplKv3qSXkwBFZB26BxIeS831cUhkW0SGhejGLyicn4Wl XgqumKjKMoetJxAVdy3dcq6ZYVCLRrgXkneiBHpKF5+Wa7NHtNsJU8IFL/XPM10o2vFMI UjLdGkIYXDP/iraL8BOR9t8a4NZEZxYrP1MJFYb0ovvWBJkwQTTmdfXf/WNoQCyWJGg== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796227544; h=DMARC-Filter:Received:Received:DKIM-Signature:From:To:Cc:Subject: Date:Message-ID:X-Mailer:In-Reply-To:References:MIME-Version: Content-Type:Content-Disposition:Content-Transfer-Encoding; bh=KeXnqDPG5xJr3oM3GuaLkQ5AYgWr9+qydXklOZHCwrY=; b=SwsySgTh73XuZNSXJpCSgMjTkZUTGr0rws1WSigWv0qMdHQDCf4YrTgU5YU9gCIOpdp3 STSAGH3XFkukDB8fJnK5A7CUJEBAA+EcwEkzSnyOofa5cBI1mZtBnP8jwC9OvtMOkcOjv bpU2BrdFeRsav1zeyPMj0/RyeXNP0sW887I1g7w2HqoflnVM3yxt9qpIZu3qFTD7+uIa4 +kiLW+JgOMxR4mQL1YN1LzWc7qz6EzFay0VIShr5cXm/exSfQwI4cx/l6HAkhIJEO+XYe RW6LE2mt5sNlZ+Eqb62R9ODKXks0uOHY5EUhBAvz5NxbBB42UobTxHN3pepC2jIxOtw== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=arm.com; spf=pass smtp.mailfrom=arm.com; dkim=pass header.d=arm.com header.i=@arm.com header.a=rsa-sha256 header.s=foss header.b="Q/Mxk+tc"; arc=none smtp.remote-ip=217.140.110.172 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 6B86C606A31A for ; Wed, 2 Dec 2026 16:05:43 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 6B86C606A31A Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=arm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=arm.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=arm.com header.i=@arm.com header.a=rsa-sha256 header.s=foss header.b=Q/Mxk+tc Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 82BCA1570; Wed, 2 Dec 2026 08:05:39 -0800 (PST) Received: from LeoBrasDK.cambridge.arm.com (LeoBrasDK.cambridge.arm.com [10.2.212.21]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 5FF283F86F; Wed, 2 Dec 2026 08:05:39 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=arm.com; s=foss; t=1796227542; bh=V+NDSZOnE3dGfJ6LM7Rosb2C2Eer9zHkas3WtNIkHT0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Q/Mxk+tcGW3lLHSD7zIuoIqkZEysBRoU6BJ46DD+7vzRn0O4fl/sW00oKzmMK+9DP sh/7+eyZ2wvHeBI74QVE1qzdIilr7I2iz0rFuYruLmVlh2avQXwVlgljCP2ayp3UTB YG1iNm6IKCDF7tweEuXupQkMJHtetLScSTdF8C0U= From: Leonardo Bras To: Usama Arif Cc: Leonardo Bras , ljs@kernel.org, maz@kernel.org, oupton@kernel.org, fuad.tabba@linux.dev, joey.gouly@arm.com, seiden@linux.ibm.com, suzuki.poulose@arm.com, yuzenghui@huawei.com, catalin.marinas@arm.com, will@kernel.org, mark.rutland@arm.com, kvmarm@lists.linux.dev, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, riel@surriel.com, shakeel.butt@linux.dev, kernel-team@meta.com, rkeilty@meta.com, atish.patra@linux.dev, dgreid@meta.com Subject: Re: [PATCH v2] KVM: arm64: Size the stage-2 memcache from kvm_mmu_cache_min_pages() Date: Wed, 2 Dec 2026 16:05:33 +0000 Message-ID: X-Mailer: git-send-email 2.56.1 In-Reply-To: <20261202155915.2539852-1-usama.arif@linux.dev> References: <20261202155915.2539852-1-usama.arif@linux.dev> X-Mailing-List: kvmarm@lists.linux.dev List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: 8bit On Wed, Dec 02, 2026 at 07:59:06AM -0800, Usama Arif wrote: > On Tue, 1 Dec 2026 18:19:42 +0000 Leonardo Bras wrote: > > > On Tue, Dec 01, 2026 at 12:46:22PM +0000, Leonardo Bras wrote: > > > On Mon, Nov 30, 2026 at 08:05:32PM +0000, Usama Arif wrote: > > [...] > > > > >> I tried your MULTIPLIER * min_pages version under QEMU with > > > > >> kvm-arm.mode=nested: 4K pages, an IPA limit of 52 bits, and a 40-bit > > > > >> IPA VM whose L1 runs an L2. In all six runs, across two tests, L2's > > > > >> first fault that needs a refill hits that WARN_ON_ONCE() and KVM_RUN > > > > >> fails with EIO. > > > > > > > > > > Out of curiosity, is it fully KVM, or are you using QEMU to emulate a > > > > > 4k-pagesize host? > > > > > > > > > > > > QEMU emulates the host. I don't have hardware with FEAT_NV2, so L0 is a > > > > 4K kernel booted with kvm-arm.mode=nested in qemu-system-aarch64 with > > > > TCG (-cpu max, virtualization=on). Only the NV tests ran that way, > > > > the numbers above are from the Grace host. > > > > > > > > > > Ah, I see your point. > > > The issue is that QEMU TCG is not really great for gathering performance > > > numbers :( > > > > > > I can try running the tests for you in a NV2-enabled machine, if that's ok > > > :) > > > > > > > Humm, but again, why do you need NV2? That path is tested on both > > user_mem_abort and gmem_abort, it could easily be tested by replacing the > > host kernel. > > > > Do you have any limitation replacing the host kernel? > > > > (Replying here instead of the previous email for this part of the thread.) > > Ah no limitation, and all the numbers are from a patched host kernel on > the Grace host. Only the NV tests ran under TCG, and they only check > for warnings. None of the performance numbers are from TCG. > > It's the same code, but only with NV does the vCPU's memcache also > feed shadow stage-2s, which can be deeper than the VM's own stage-2. > That's why a multiple of the VM's kvm_mmu_cache_min_pages() hits the > WARN_ON_ONCE() with NV. IMO performance numbers are needed > from NV for this, but if they are, could you help as I dont have > hardware for it. > Ah, I get it now. I think as long as your non-NV perf numbers are from real HW, it should be fine. But sure, I can test it if it's relevant to anyone. Thanks! Leo