From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=91.218.175.41 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796227167; b=1nGLkI1KLq/XBBzjkFsDXZHUCT5yb+nwvWjDe69tsQh18db031vlGoxDm7vYKMRXT3pI YqWdSRjEYNvVzYYETIhyrb09vjDEvtexxA/5IFqmpr0comIsD4tKNk3pnmLwkpNavjiFx aTWVeXAvLlOfsYrOwVP64phsyBlKoiwPFaCk3+VA5Dqy9zUuLRbu1+bJhqTNLOl1Eetj2 jl+Bvdp9mt2gfOlW/aIYI8DU/MmrQvZClsFWec9+fQQOTxdYZPuX7LdC5AbqTMT6Sz+QA EVmFqJ3euRt0FfbZuDXoKfvpYcw8KIcbd0dCv5ylYTihQr+Pen6wG2Qtt9IAyx9KDEw== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796227167; h=DMARC-Filter:X-Envelope-To:DKIM-Signature:X-Envelope-To:Received: X-Mizu-Trace-ID:X-Migadu-Flow:From:To:Cc:Subject:Date:Message-ID: X-Mailer:In-Reply-To:References:MIME-Version: Content-Transfer-Encoding; bh=oIgxacwAGmtWTYCR9qxVcJEMJzcgdvkT+1PEdBZSKaM=; b=MJdxQBY9To+P4zOE+ojPbr9dbuPyqhNcIDttwqyQFLKVpK3TxCvbZRkGUGETUUazjz+/ OYVLlw7sLmsCWo8+mq7YqkSBKETucugHTW322sVo93hwoWRTZjDW6Kks3g0OxCOdRumBo QyUbEWfCa5rq33Rj6tUkFDOltWCxU1YYN43vaYYLDO/belNNhxYclLEMLv2OgVMhdY5Pa 0flh/btOvbpZ+OZPOEcCui88l08srtVlqGf+3ZeLSkXhKcO2KlUtAjAEMVnWart5HCrg4 eJkkFDgtPXs5GFOTFX04VvtYMdB7Owo7EE4+5rIySxCpwlEz65vEVWGes7B5EUknQDA== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=linux.dev; spf=pass smtp.mailfrom=linux.dev; dkim=pass header.d=linux.dev header.i=@linux.dev header.a=rsa-sha256 header.s=key1 header.b=bYDp2hRm; arc=none smtp.remote-ip=91.218.175.41 Received: from mta0.migadu.com (out-41.mta0.migadu.com [91.218.175.41]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 42857606A31A for ; Wed, 2 Dec 2026 15:59:25 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 42857606A31A Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.dev Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key, unprotected) header.d=linux.dev header.i=@linux.dev header.a=rsa-sha256 header.s=key1 header.b=bYDp2hRm X-Envelope-To: linux-kernel@vger.kernel.org DKIM-Signature: a=rsa-sha256; bh=80T1LCzR+368Evq5YDbRZzkgPYo+JwYzZyhqN/OzyEg=; c=simple/simple; d=linux.dev; h=from:to:subject:date:message-id:mime-version:content-type; s=key1; t=1796227164; v=1; x=1796831964; b=bYDp2hRm7wcKJk1BIuH+JIT/qt4yxTx96Wilek+Jn4M9YbbDZ4jdUCcKq0klpzmHM8KjpSTn lhtrS7clGDalNKhYlf2jNkSOCret3h+kKH7EEyG80Vx2XOroehFIENYHapMW9sWt3G4KZObmst6 UcTYlGvB+nuCVMjpaZmJFe6o= X-Envelope-To: linux-kernel@vger.kernel.org Received: by mta11.migadu.com with ESMTPS id beed2d20b870ac93; Wed, 02 Dec 2026 15:59:24 +0000 X-Mizu-Trace-ID: beed2d20b870ac93 X-Migadu-Flow: FLOW_OUT From: Usama Arif To: Leonardo Bras Cc: Usama Arif , 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 07:59:06 -0800 Message-ID: <20261202155915.2539852-1-usama.arif@linux.dev> X-Mailer: git-send-email 2.53.1 In-Reply-To: References: X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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. Thanks! Usama > Thanks! > Leo >