From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pl1-f198.google.com (mail-pl1-f198.google.com [209.85.214.198]) (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 90EE6329E6C for ; Tue, 25 Aug 2026 15:00:36 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.198 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1787670042; cv=none; b=ulRlKzAhtpbMtzWo4iJO9V5vr9Nb1gHyNTkoiCdTGGFuT2Te8wyEYolSxwZOt/P+WO7ySSrcvRzl2VeOlvmk+mlYHk/5mTQRZhcSzLmPGwyAof2rBFmwjIymV5xSCrbzMGFPS+fW7ash3bYXcyVCEqI8mExts6sh1uamFHL5t4U= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1787670042; c=relaxed/simple; bh=lzu39/n3vWLMuX5lyqgMNOhmbNQ+sxv9ZSnyjU7pBLs=; h=Date:In-Reply-To:Mime-Version:References:Message-ID:Subject:From: To:Cc:Content-Type; b=EKktS6hbJu+jkrMJz+QebiOF1BqMWRH+fR31YpooDYx6KJVlqU8tA/9RosWMaAFZHV19cHTOXN9OSLG4uGhVTaMoBucvClvjApb86fZA0NftLNX35N2ycjcVr/RD8mMQDeg1SXAh0vD6qdFGMEnJMNSICc3Bgc98tM7HVlmBz7I= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com; spf=pass smtp.mailfrom=flex--seanjc.bounces.google.com; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b=mQ1Li8W1; arc=none smtp.client-ip=209.85.214.198 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=flex--seanjc.bounces.google.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="mQ1Li8W1" Received: by mail-pl1-f198.google.com with SMTP id d9443c01a7336-2d6fb956002so4846155ad.1 for ; Tue, 25 Aug 2026 08:00:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20251104; t=1787670031; x=1788274831; darn=vger.kernel.org; h=content-type:cc:to:from:subject:message-id:references:mime-version :in-reply-to:date:from:to:cc:subject:date:message-id:reply-to :content-type; bh=mmHT9WykXDCYDuHjAwkcEmxAcNUgfeeau0x6gYkHaWQ=; b=mQ1Li8W1HPUru6SSXhHmg+nGNZqBuU+RTp9KbxZjgvYwS2TfT0eflPdW1jZ5wR9zdA YAQvb48Dc0x7EHahO/vY9frXVsuyNFWJV1O0C6TCxHy5UMW1BlanDcEtnq+oulbs/C0i CZ1/kBrCmdtk1AcSzfoJP1NG8PYcHc/9bM28YzNNNCB/oaf/aDHKbl60G8JKKj0SFYOP I+LOR6wRtwG9MsH/kl0eCzKf5jeWItymGAlZWXtgPnD6Vbo+vVn8cMDV/UmAhVJkxsx1 U2pKmua0707KDFMUpoaKyT9yxYFskc/XgWVffEzFw16dWyyVQ91A4zxVg5eGsC468MU7 TpnA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1787670031; x=1788274831; h=content-type:cc:to:from:subject:message-id:references:mime-version :in-reply-to:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to:content-type; bh=mmHT9WykXDCYDuHjAwkcEmxAcNUgfeeau0x6gYkHaWQ=; b=PA58cxQhXHf3K2lSSGmsgusII3iN/r7BOJQ8P3AP4EsQ6+LM4MOCC8Yk0ypMoGDxvT Gl/y1kRSuebYLbbKnYKk03UxqzPSL57qTlVoHHU05dMPDAYsn76IW0rZ2wXC0otjS2A8 +KKrD8dnqI3aq4sqVl/VNJ/isBZwGifiK9pIrmINGMAr9kNyp2tRRlYFITgmPNWbIR8Y TT2NYZDnekQZ+9iVJ6DptQ2q0y16FNdmjp0shup+qb98auqHrot25cBuCtmcOWZnAcpb vWVFO3Er/X+JHdMhk4jhP+xioMPnzXNWqaQfSQa91q8njxzeGfEDHlg86bOZUxYelN6v kuAw== X-Forwarded-Encrypted: i=1; AHgh+RqKUz384XzjS6hapcorOQl/78ef8xstxurzHxDuSIuxdi7tpqdXqxWhh8POX2gZ0R6u3IILnC7xlyUlPLw=@vger.kernel.org X-Gm-Message-State: AFuF++lVsearDhcB2A4KwoTtV1k1ZJy5vYX6k9D6lq/VtM6AUlMecLX4 B4/bREJ0Y4Vmk3T24yHaLOeGrDbD2Z11wdMnHkbvugvscQGG90t44byNrMBFgmvGBKAjKHPhm5r OqrWrIA== X-Received: from plrf23.prod.google.com ([2002:a17:902:ab97:b0:2ca:b907:d842]) (user=seanjc job=prod-delivery.src-stubby-dispatcher) by 2002:a17:903:1108:b0:2cf:a108:7605 with SMTP id d9443c01a7336-2d670cc180fmr463312705ad.11.1787670030208; Tue, 25 Aug 2026 08:00:30 -0700 (PDT) Date: Tue, 25 Aug 2026 08:00:29 -0700 In-Reply-To: <20260825140159.70997-1-mamarang@amazon.com> 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> Message-ID: Subject: Re: [RFC] KVM: x86/mmu: Prefetch forward run of pages on TDP page faults From: Sean Christopherson To: Marco Marangoni Cc: 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="us-ascii" 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 when the vCPU exits to userspace. If KVM Userfault + KVM_PRE_FAULT_MEMORY is viable for Firecracker and provides the desired performance, I would strongly prefer that approach over KVM doing its own prefetching. That way other architectures don't need to implement prefetching as well (arm64 already supports KVM_PRE_FAULT_MEMORY, and RISC-V has patches posted). I'm aiming to get back to that series "soon", this would simply be more motivation to get KVM Userfault landed. [*] https://lore.kernel.org/all/20250618042424.330664-1-jthoughton@google.com