From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-ej1-f46.google.com (mail-ej1-f46.google.com [209.85.218.46]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 8210547A0B8 for ; Tue, 25 Aug 2026 15:55:31 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=pass smtp.client-ip=209.85.218.46 ARC-Seal:i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1787673333; cv=pass; b=XAhsvIIFQUCmY/SwKbwWontK7jgbVJjs2ajwa3XUodNXTILHa5abzsv/0gDcFEH8d/ngZw8vr+zkiS5HbVP240y5PkkBJBAXWYQqkdnFO25crreD7YaND36FQIrlpc/4sY0aaNl1RJhfEIDh4dIe+1JT633H2fiLZaec9j4HQKE= ARC-Message-Signature:i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1787673333; c=relaxed/simple; bh=lZYaNZxGUeZtEwcQ9OqEG/mF74IaJpelEmtq22X5r0Q=; h=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject: To:Cc:Content-Type; b=aFTw0lCwHvXmBCaiIi7I8oOn9aaHk8wRW5C2qOQGWgXs4DhgIOw0MIwhraClClv48KD3C1hs5m5JmTgOnhRn4XCQtCJssJFESjyAls3gY95B21AcNeMAeZjf3HwDk0WxYz77GmJJd7UBKMYdiBTRsQsQiavp7uaEjRTlb8xh8Ds= ARC-Authentication-Results:i=2; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com; spf=pass smtp.mailfrom=google.com; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b=hzLE/a0e; arc=pass smtp.client-ip=209.85.218.46 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=google.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="hzLE/a0e" Received: by mail-ej1-f46.google.com with SMTP id a640c23a62f3a-c20ce3c118aso198574066b.0 for ; Tue, 25 Aug 2026 08:55:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1787673330; cv=none; d=google.com; s=arc-20260327; b=rZFMb5S8Hrq6lm18MQrML4O6dGJ+kg1GDjRsLtNRA7kxgdqoZYI+JTbFklZe5oaph3 OMIvWJ6a30Hd2N33XIsg0Nz9xhBudbFnLFyWkBEN39h2vEiKwT3O49iF5PDyqa/LVxjF TTAgQpV+mg65IbquFLs9ZREChPdjt4PWQNBinAc8npxJfiNBIl1Vd0xJ807TIxDO1LGt GoqVC36ki5BJGrmeY+RhxTpOYX36wuzWp7nI4sTkt8TzVWpou1oLOknFrtqbtTMpNsGf X2Oy88sW94vSfepBjrLGlgdvUUjyYWznBio6xUV4hkhIFoB7nxBLXzCJMdOV6huHe1dt yfmw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20260327; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=WVg4RBOOkdPHq9qUxxfmmgqRr5tn34gYzk95c9wuG68=; fh=g1XfpblXowrftArKmIoM1YXiC6HyBZceTBlt5taPT5Q=; b=qXZ60m/rf45s7buxjjb8eEH1AFx4GQh36Qh2cp0pmtos4Q3VvJ1oWHv4SkGx+lULop 9EkN4QySLSs9kHRQ17PUjBlMY8soBEuJt9ukakpE+JXOxbpDGfolsiHFWw3R9SwFTLq3 q4Lhjp/gZINhFE5rlyprfBw/g1EvC4m8uFiYZPgaDahK9gwm4oq1nIg+VGZwvyV3C5rF Be+eOikiLEp5oIXdhdlQH21SY7pJO4kqq0cvwmmz4f18DNZOAAmf8J3NF4zKS7Mha7+I hOnRksur8iLhCLC9SYl/QeiNIX8Rvl+G0Wpyyis9DeTD+fjkJrba6kKgJppI+LDuyCf+ cr5g==; darn=vger.kernel.org ARC-Authentication-Results: i=1; mx.google.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20251104; t=1787673330; x=1788278130; darn=vger.kernel.org; h=content-transfer-encoding:content-type:cc:to:subject:message-id :date:from:in-reply-to:references:mime-version:from:to:cc:subject :date:message-id:reply-to:content-type; bh=WVg4RBOOkdPHq9qUxxfmmgqRr5tn34gYzk95c9wuG68=; b=hzLE/a0ee5i/6y21wlWSUAAFc9/P8Q1T5P5pRBrP1VYfaIQwG8Vh7grVd5WzpQFjxl Q4SohkTA241eKiJVR1BGxjKYupLjYGrkLUh2pGCbkFC0YHoioj8zSuf1zw+dgsbuSEpH EsYKdsautPhptZYQPsC9TjgKPiPiUiX+SfPGsxEVbKWYZ+E6Ug6x5dKKinOHNW91sO7D dGqqGyT+bCitLcwgIUb9PFRBF94Z6NRbtTHpzNWwUjxqbhfz/BVgJHCb73Uvr+DVxfRt wQDedHF51CEV+Nuc+IFZGvUlNK9v6elAXeXcZh5LRr9juAmkT3wMSdyEmh1O6zln6ga8 2plg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1787673330; x=1788278130; h=content-transfer-encoding:content-type:cc:to:subject:message-id :date:from:in-reply-to:references:mime-version:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to :content-type; bh=WVg4RBOOkdPHq9qUxxfmmgqRr5tn34gYzk95c9wuG68=; b=c37ioh7p+Aiya9FvrdRykU977RdtJrEV3vWDNqTL9fxxVg9Lzio3475vqnenaDY9Pk flhqg5xgvh+l7DqPX6+KudTUg2DeD6uG7K9Mx0FW/JJnazv63gLsReg+m2xgcALFCLpm 2DPBo/quK8uS4526o9oIVdLEmZhsCP5hjL+x82fbErkxjdQDDMbFpWTufHk2yA8qY9tt XoDXTu2QawaNBERcGaOhgtSw6gbR0/Dpe+9npMows/aQksBXxwHmvKlVk+Ox38Dd3zh+ Jlg2/9reup1d9093XFNUmJXdxnY5WdfJb0jTqa+fuvGouZk9t9i69HJArXbQW/8OW2xF VOdQ== X-Forwarded-Encrypted: i=1; AHgh+RqZDn/np1+MWwqA0j+pIO6vIjS0Gi0qm0jNra27N82JzIBZ0bkSvnEYa1Kinalqzatf0PjhmVi5oBKv4vQ=@vger.kernel.org X-Gm-Message-State: AFuF++lC0Gk7/KYHDKXztV/SFrGQj88qV/qSmiilH2tuk9CupJ2zxD1e VGw3DDrBXh3j6Uqf+Tt8BK/jbyQNIxcQIkIJR3sMh2MhaSXR+/wOuXmheXy9Z8ANuxuz9rBOcpL 9Mgx0VrLcE2l6TzhGTRPsoXQngBwb4teWlig+qi9j X-Gm-Gg: AR+sD107lgxUf9vc+eyQw0gYGAGU30DOCz5t7g8MSbQ6WVIrM0HdOc+26wjD2RiK1UQ g9N4MIz5xQXWTGu9+h1csTa5FGwoGLDOvK1SaLZnBxTlTphQMJ9mFIIprwV/sxIgb4/UfI1JIBK Q8l5XJUTNN6CyEcsN52w0ZvmpHwqJEbsCUrzoU5w9kiulgcxY936f8I1LGtAfLpjX5YRkOAI/26 CgIje0S2I3l2vIspaLrmj4E7djS66d9DH3XTkOXuc7yrW3H6vlikwmyXnwtqd8qeEl2cGNfJxfW H2CbRKgtSeRWkjzhLWWmJNzmy7BadogeTCnQAxrNeN1wn6ccYTEdPjCqgnoQoBv03NKGKJ1vr+Z NvZghRIlsBrHzI4kNyRfFiaHTZYxTqCKlp+wlNe70wD+QK4GKl8zOGxPAIQhup/5jyqJSu5RoaI VGLspq5W9BYiPC X-Received: by 2002:a17:906:9f92:b0:c20:a243:9a52 with SMTP id a640c23a62f3a-c250a7c9f4cmr30664266b.0.1787673329133; Tue, 25 Aug 2026 08:55:29 -0700 (PDT) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 References: <20260825140159.70997-1-mamarang@amazon.com> In-Reply-To: From: James Houghton Date: Tue, 25 Aug 2026 08:54:52 -0700 X-Gm-Features: AcwNN1WofkpTv75R4dYNkH_7NnMFv_ScyRsu1IjpxLB_1Qn9qFOU3veM9Oi6GpI Message-ID: Subject: Re: [RFC] KVM: x86/mmu: Prefetch forward run of pages on TDP page faults To: Sean Christopherson Cc: Marco Marangoni , Paolo Bonzini , Thomas Gleixner , Ingo Molnar , Borislav Petkov , Dave Hansen , x86@kernel.org, "H. Peter Anvin" , kvm@vger.kernel.org, linux-kernel@vger.kernel.org, kernel-patches@amazon.com, mancio@amazon.co.uk, zoumboul@amazon.com Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Tue, Aug 25, 2026 at 8:00=E2=80=AFAM Sean Christopherson wrote: > > On Tue, Aug 25, 2026, Marco Marangoni wrote: > > It's worth mentioning that I also evaluated using the existing > > KVM_PRE_FAULT_MEMORY ioctl, but this doesn't work well for our use-case= , as > > it requires the vCPU to be paused. > > What about if/when KVM Userfault[*] comes along? I.e. pre-fault memory w= hen the > vCPU exits to userspace. My understanding is that Firecracker performs its userfaultfd operations in a separate process. KVM Userfault doesn't break this, it just means Firecracker would need a way to signal the other process when we get KVM_EXIT_USERFAULTs. Firecracker might be using async PF; using KVM Userfault basically disables async PF. > If KVM Userfault + KVM_PRE_FAULT_MEMORY is viable for Firecracker and pro= vides > the desired performance, I would strongly prefer that approach over KVM d= oing its > own prefetching. That way other architectures don't need to implement pr= efetching > as well (arm64 already supports KVM_PRE_FAULT_MEMORY, and RISC-V has patc= hes posted). I also really like this approach if it is workable for Firecracker. > I'm aiming to get back to that series "soon", this would simply be more m= otivation > to get KVM Userfault landed. Yay! > [*] https://lore.kernel.org/all/20250618042424.330664-1-jthoughton@google= .com >