From nobody Tue Feb 10 20:07:28 2026 Received: from mx0b-0031df01.pphosted.com (mx0b-0031df01.pphosted.com [205.220.180.131]) (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 502A118FDC8 for ; Thu, 2 Jan 2025 07:41:50 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=205.220.180.131 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1735803711; cv=none; b=lsA7hsPeTEk9vHP8FPuN0LpbIdf3Q/FLFJIdn4x96Gr3NpD9YR3T+qa6ORSjBwJcvNlfs2zrTjXJOhUaL3DzuREG7SDaCd6hVoAHfLLt5t+IFJncJ/tU3mswXs04Z1EDCgZbc1UJ9cY5IGXOgMy/E2hj2Q155pMoCIn5jjRMaBM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1735803711; c=relaxed/simple; bh=iQecXGdcUvr7w0pf3frFntVTsiJqrkfY11+tcQ06LZ4=; h=From:To:CC:Subject:Date:Message-ID:MIME-Version:Content-Type; b=JhIKXybKbvZ1JqZgQkrMm3DvrqkZfpRmGkdyfpG0NYL2YmSRs30b4WZz7Lr4bm77lfJXGpc1osdZAoT04nAU8Q2uqWP+SBlPitU3hrxRp1VAE8Z+qRiTkJEhe7uhs33DILQ+NmAow4tautJOnRB7XWxDzoRDqX6Uh7FHrNyMXMY= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=quicinc.com; spf=pass smtp.mailfrom=quicinc.com; dkim=pass (2048-bit key) header.d=quicinc.com header.i=@quicinc.com header.b=DO3jzXli; arc=none smtp.client-ip=205.220.180.131 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=quicinc.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=quicinc.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=quicinc.com header.i=@quicinc.com header.b="DO3jzXli" Received: from pps.filterd (m0279869.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 5020NAnD007852; Thu, 2 Jan 2025 07:41:08 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; h= cc:content-transfer-encoding:content-type:date:from:message-id :mime-version:subject:to; s=qcppdkim1; bh=EK54y8CHU5sNfi7hM3+XjO QepNeNKL+xAEwrzp2ynPQ=; b=DO3jzXliYb9ipc+HEeE9I3ElqmQmeQVWBEYO+q qehVoXrbkJTCOvn9gZHYc8hpZX0xpITUvHG1O0i4uKArO5pSkTpb40Q/zWCv4ixv 9MOaClHVFCTg7et7Zyy60rq0mi14YwNcc0aptXkIVCUJIxiRXvEalX8paXoLrEr8 DqZeTtVUUbw8tP4ai92rqISHHY9H7iipUDadvnPMUIo/4TeOoEbdfAtRdCRM5HS8 /xk4ZqcvRwj9VFMxcoNW+V4DDUUldddnZ6Qed94OZdC5qZ6qCKnupA5ro+RkQzEF /w/j5Jo3PXAgl+RmAmckoZqjxdT4TCCHW3HPPFwA///4bFJg== Received: from nalasppmta05.qualcomm.com (Global_NAT1.qualcomm.com [129.46.96.20]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 43wba18yc3-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 02 Jan 2025 07:41:07 +0000 (GMT) Received: from nalasex01a.na.qualcomm.com (nalasex01a.na.qualcomm.com [10.47.209.196]) by NALASPPMTA05.qualcomm.com (8.18.1.2/8.18.1.2) with ESMTPS id 5027f6J0012349 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 2 Jan 2025 07:41:06 GMT Received: from ap-kernel-sh01-lnx.qualcomm.com (10.80.80.8) by nalasex01a.na.qualcomm.com (10.47.209.196) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.9; Wed, 1 Jan 2025 23:41:02 -0800 From: Zhenhua Huang To: , CC: , , , , , , , , , , , , , Zhenhua Huang Subject: [PATCH v3] arm64: mm: Test for pmd_sect() in vmemmap_check_pmd() Date: Thu, 2 Jan 2025 15:40:47 +0800 Message-ID: <20250102074047.674156-1-quic_zhenhuah@quicinc.com> X-Mailer: git-send-email 2.25.1 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-ClientProxiedBy: nasanex01a.na.qualcomm.com (10.52.223.231) To nalasex01a.na.qualcomm.com (10.47.209.196) X-QCInternal: smtphost X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=5800 signatures=585085 X-Proofpoint-GUID: Lhnmhoqz3CUaDTaNRgp3XVbPTfOmZ51M X-Proofpoint-ORIG-GUID: Lhnmhoqz3CUaDTaNRgp3XVbPTfOmZ51M X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1039,Hydra:6.0.680,FMLib:17.12.60.29 definitions=2024-09-06_09,2024-09-06_01,2024-09-02_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 impostorscore=0 priorityscore=1501 mlxlogscore=475 malwarescore=0 bulkscore=0 suspectscore=0 clxscore=1015 spamscore=0 phishscore=0 mlxscore=0 lowpriorityscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2411120000 definitions=main-2501020064 Content-Type: text/plain; charset="utf-8" Commit 2045a3b8911b ("mm/sparse-vmemmap: generalise vmemmap_populate_hugepa= ges()") introduces the vmemmap_check_pmd() while does not verify if the entry is a section mapping, as is already done for Loongarch & X86. The update includes a check for pmd_sect(). Only if pmd_sect() returns true, further vmemmap population for the addr is skipped. Signed-off-by: Zhenhua Huang Reviewed-by: Anshuman Khandual --- Separate the patch out based on the discussion: https://lore.kernel.org/linux-arm-kernel/20241209094227.1529977-3-quic_zhen= huah@quicinc.com/T/#m41d49cd91b348ecfe2c37c4b3c0911180426934e =20 arch/arm64/mm/mmu.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/arch/arm64/mm/mmu.c b/arch/arm64/mm/mmu.c index 9afeb35673a3..50a22c63f450 100644 --- a/arch/arm64/mm/mmu.c +++ b/arch/arm64/mm/mmu.c @@ -1172,7 +1172,8 @@ int __meminit vmemmap_check_pmd(pmd_t *pmdp, int node, unsigned long addr, unsigned long next) { vmemmap_verify((pte_t *)pmdp, node, addr, next); - return 1; + + return pmd_sect(READ_ONCE(*pmdp)); } =20 int __meminit vmemmap_populate(unsigned long start, unsigned long end, int= node, --=20 2.25.1