From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pg1-f202.google.com (mail-pg1-f202.google.com [209.85.215.202]) (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 9EEC436B05E for ; Fri, 26 Jun 2026 19:11:35 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.215.202 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1782501096; cv=none; b=V2CWBMxxNJK4os/zs11rMI6KEz9j8T+G4tf15AqA1SGQGWg9o22Q4ZstmJCMCdrcWP1KklRZLjfCji6f3Muk1bg89NFXHNtX/XvwAAy3KEFmKYiFJXD+iLFoL2aSTjwqr1Xyii7KjbnF/7YF3L3UVQrrr7665ej7e030KvpjUj0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1782501096; c=relaxed/simple; bh=SYyGX7CRd59z7RJKo/wpZWXgbmtBMjXEDxJ0dGqicvA=; h=Date:In-Reply-To:Mime-Version:References:Message-ID:Subject:From: To:Cc:Content-Type; b=dKrtOTZ8+4Lh3JEsEQkSeYi47FdMScgswN3PiJpVvP5WP1LzmDasQ3wvNaXHQLvctPukvgqaweRJ5Efjg1QPOewuQxAMwi7NTSeZ8etMSBeU0SwGZ/dE+VyMhrB0KrH3YHIGWWyc6uPECEW05xlsxJmlRZ+nrMgFbcJ6tcITDgk= 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=fzJ9zf3e; arc=none smtp.client-ip=209.85.215.202 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="fzJ9zf3e" Received: by mail-pg1-f202.google.com with SMTP id 41be03b00d2f7-c891ed872ddso738307a12.2 for ; Fri, 26 Jun 2026 12:11:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20251104; t=1782501095; x=1783105895; darn=vger.kernel.org; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:from:to:cc:subject:date:message-id:reply-to; bh=2knDCK7pRXDoPdThYLEfyiz4oOOQn0caXBXu1bE1oGI=; b=fzJ9zf3eFbhRTnyxIjJgEEg2ykXbV/J3iV8a1rgYlkqK+TT3LxQgvaPqd8nTgRjBDc ZELZL4aSzTGxlV0AOjDYiqtFHd4TzGLJEkOljVgqW5r6GUX/ajvZJomlyRH8CYDQY/d8 zIqpt5CTRTBs1gfIBw0lAPGnjmMMkH9R7LcYDR3gQqFUHR/FuEkfzfdhhqiM7UbyLNGG Q8fTg5tyUAAc6NZY/ceg5OYpzpYXPb8OA3yestJZwyCn1xk9ZTccaWhvwOzzeGvkk9bE LxqzbDOuzw4IURnAVgtmc/7FEOm/61s0cLqanR4IsQ0oIqA5eb85gM7HDC4Pe6go3Btq 6VGg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1782501095; x=1783105895; h=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; bh=2knDCK7pRXDoPdThYLEfyiz4oOOQn0caXBXu1bE1oGI=; b=c7TesgaSncFm62X8ZKIreUb6IIy1jQAXaVN+v4WmwLCsq772IpBav5iR7gHiT21dS2 r+usemF7izXDswlCuVy5lEMmoxgBM1+N6gTumCuvci/k9a5n0OzG4noVBQle/hFV2MeM 7Hjt6yJlUfb2F09xIUGkHLglZJASOOVLo6EnaHH759fiA0SsnWn+eB68iouVMkgqFhD1 KpbAImRomv+g1vu7b8mVJzHO/D+utgGwgyqDDQMUqn5S8bICs2jjCy1S+NsGlhT9su/N gjL+YBBV6e3ikxhBgMC0dALhLKaz7HE0warSSrljx7ODdsy+3C/2WQIxDOtNQNcOI7DS zlmw== X-Gm-Message-State: AOJu0Yx9dYM26OzvFgjkXy42d3Xi1speNHBS6TX1v3W1iqCCQIcrPR02 V7eEQYCktl83GHqlgQGYfi+1iqaKBeJNjPI+SVjGT8/OWTV3c8paBlBziFkqoq7Gx8+KhmEGIi+ lRxaqiA== X-Received: from pfbit24.prod.google.com ([2002:a05:6a00:4598:b0:845:cb91:3911]) (user=seanjc job=prod-delivery.src-stubby-dispatcher) by 2002:a05:6a00:84e:b0:845:b5c1:cf62 with SMTP id d2e1a72fcca58-845d261fcd6mr1209650b3a.43.1782501094810; Fri, 26 Jun 2026 12:11:34 -0700 (PDT) Date: Fri, 26 Jun 2026 12:11:34 -0700 In-Reply-To: Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 References: <20260626112606.1778248-9-pbonzini@redhat.com> Message-ID: Subject: Re: [PATCH 5.15.y 8/8] KVM: x86/mmu: Ensure hugepage is in by slot before checking max mapping level From: Sean Christopherson To: Sasha Levin Cc: linux-kernel@vger.kernel.org, kvm@vger.kernel.org, stable@vger.kernel.org, David Matlack , James Houghton , Alexander Bulekov , Fred Griffoul , Alexander Graf , David Woodhouse , Filippo Sironi , Ivan Orlov , Paolo Bonzini Content-Type: text/plain; charset="us-ascii" On Fri, Jun 26, 2026, Sasha Levin wrote: > > - if (sp->role.direct && !kvm_is_reserved_pfn(pfn) && > > + if (sp->role.direct && is_gfn_in_memslot(slot, sp->gfn) && > > This drops the !kvm_is_reserved_pfn(pfn) guard instead of adding > is_gfn_in_memslot() alongside it. I think upstream could drop it only because > a8ac499bb6ab ("KVM: x86/mmu: Don't require refcounted "struct page" to create > huge SPTEs") rewrote host_pfn_mapping_level() to stop touching the struct page > but that commit isn't in 5.15. Does it make sense? Agreed, the kvm_is_reserved_pfn() should be kept for 5.15.