From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id AD1672D061B; Mon, 9 Mar 2026 15:19:12 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773069552; cv=none; b=d0V7xcSYvAOcTfS/gzBET6lHrycmhWcW198k7TI0DeyMJih8MY0ixHnsKjbUKiDWReVv5usungBnRLaR7aMjukkX+/EUNmWrRQ4XttHsPkK5rFLDHhDlZj9OBBU0VDnzaXCuD434RMj2Jb/5HDAbu08b5KM1Y7IHWBvIF30ncbQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773069552; c=relaxed/simple; bh=U/h2huN/IK33EUYYoVbeCNOLTX65WGNBH1yEJmt4qPQ=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=D6Zmv6eZrICPzjztTXz31NO5tiQdgHrnCzpug5r61IdogSyh1cP7yPky7ye5kzk3HCDP74x6sYkn94vW5NSn4aYlQRuIx+aCKM75v4OlR5TuzIIJRfoPUctX1Fuuh2E/JeNTvBnnTBRlgqDtQBRk4BHwpResc/718U1c834aELw= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=l1HYB2V0; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="l1HYB2V0" Received: by smtp.kernel.org (Postfix) with ESMTPSA id A9A9EC2BC86; Mon, 9 Mar 2026 15:19:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1773069552; bh=U/h2huN/IK33EUYYoVbeCNOLTX65WGNBH1yEJmt4qPQ=; h=From:To:Cc:Subject:Date:From; b=l1HYB2V04oJ/S42Zu9JUsjv5Owzl7dWIJVg9XjlpPgIAXwhiZ81EH5q+dmoG8nVzW xKsIZQ0B9wi04tzX/z93YqUCHDJyEHEwxG4VlhASvbttYe7KGDuSCXkCLxBOhnpJY5 nYGMxzAJSQYtcmc82vcKd8/t+YmFKoNv+3huhkBL7y2Psz1c6sncJwBqMSLrJbdDxw d7KraB89RTyGWDDFgnObhpEIBcPuRjdrpSHqBWlf3lqg1I4xb5kZ1dXqVEVCaClf/y YCZDuxk4gPWFoBjI5H/fFusUYLrVRRL0VEiQCJ5LAMe9ThZsh5l2H8AzQ83CNCDS+d gQvEe4ITMwnGQ== From: "David Hildenbrand (Arm)" To: linux-kernel@vger.kernel.org Cc: linux-mm@kvack.org, linuxppc-dev@lists.ozlabs.org, kvm@vger.kernel.org, "David Hildenbrand (Arm)" , Andrew Morton , Madhavan Srinivasan , Nicholas Piggin , Michael Ellerman , "Christophe Leroy (CS GROUP)" , Muchun Song , Oscar Salvador , Lorenzo Stoakes , "Liam R. Howlett" , Vlastimil Babka , Mike Rapoport , Suren Baghdasaryan , Michal Hocko , Jann Horn , Pedro Falcato , Paolo Bonzini , Dan Williams Subject: [PATCH v2 0/4] mm: move vma_(kernel|mmu)_pagesize() out of hugetlb.c Date: Mon, 9 Mar 2026 16:18:57 +0100 Message-ID: <20260309151901.123947-1-david@kernel.org> X-Mailer: git-send-email 2.43.0 Precedence: bulk X-Mailing-List: kvm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Looking into vma_(kernel|mmu)_pagesize(), I realized that there is one scenario where DAX would not do the right thing when the kernel is not compiled with hugetlb support. Without hugetlb support, vma_(kernel|mmu)_pagesize() will always return PAGE_SIZE instead of using the ->pagesize() result provided by dax-device code. Fix that by moving vma_kernel_pagesize() to core MM code, where it belongs. I don't think this is stable material, but am not 100% sure. Also, move vma_mmu_pagesize() while at it. Remove the unnecessary hugetlb.h inclusion from KVM code. Cross-compiled heavily. v1 -> v2: * Fixup VMA test in patch #2 * Actually CC all people listed below on all patches. Cc: Andrew Morton Cc: Madhavan Srinivasan Cc: Nicholas Piggin Cc: Michael Ellerman Cc: "Christophe Leroy (CS GROUP)" Cc: Muchun Song Cc: Oscar Salvador Cc: Lorenzo Stoakes Cc: "Liam R. Howlett" Cc: Vlastimil Babka Cc: Mike Rapoport Cc: Suren Baghdasaryan Cc: Michal Hocko Cc: Jann Horn Cc: Pedro Falcato Cc: Paolo Bonzini Cc: Dan Williams David Hildenbrand (Arm) (4): mm: move vma_kernel_pagesize() from hugetlb to mm.h mm: move vma_mmu_pagesize() from hugetlb to vma.c KVM: remove hugetlb.h inclusion KVM: PPC: remove hugetlb.h inclusion arch/powerpc/kvm/book3s_hv.c | 1 - include/linux/hugetlb.h | 14 -------------- include/linux/mm.h | 22 ++++++++++++++++++++++ mm/hugetlb.c | 28 ---------------------------- mm/vma.c | 21 +++++++++++++++++++++ tools/testing/vma/include/custom.h | 5 +++++ virt/kvm/kvm_main.c | 1 - 7 files changed, 48 insertions(+), 44 deletions(-) base-commit: f75825cdfc4c5477cffcfd2cafa4e5ce5aa67f13 -- 2.43.0