From patchwork Thu Nov 3 02:27:39 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Huang Shijie X-Patchwork-Id: 9410075 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id B5B2260721 for ; Thu, 3 Nov 2016 02:30:18 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A70AB2A497 for ; Thu, 3 Nov 2016 02:30:18 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 9A6DF2A6F1; Thu, 3 Nov 2016 02:30:18 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.1 required=2.0 tests=BAD_ENC_HEADER,BAYES_00, DKIM_SIGNED, RCVD_IN_DNSWL_MED, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 354772A497 for ; Thu, 3 Nov 2016 02:30:18 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.85_2 #1 (Red Hat Linux)) id 1c27ll-0001RR-Nx; Thu, 03 Nov 2016 02:28:45 +0000 Received: from mail-db5eur01on0056.outbound.protection.outlook.com ([104.47.2.56] helo=EUR01-DB5-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.85_2 #1 (Red Hat Linux)) id 1c27lR-0001O7-Fk for linux-arm-kernel@lists.infradead.org; Thu, 03 Nov 2016 02:28:27 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com; s=selector1-arm-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=KYRFzz/AcFZhdmQEmggvGme/x57v3sSvanMQCowp00Y=; b=p4Pnkh691KmBwK0nYlx8eT2yV70z9e8MjIFxP+MTEfQqmKZgqUluCv/fIctPPCjWvPXzEw16RVkA0fMGYl3SjvZL9LDR+Jbe+rWdSaBY4ngAvQCha2dG36CkFUX7oAV7wBpa0A2X2ejEhgAo+dOKXX9q3Pqj21S06h7VRGkhKn0= Received: from VI1PR0801CA0058.eurprd08.prod.outlook.com (10.168.60.154) by DB6PR0802MB2566.eurprd08.prod.outlook.com (10.172.252.7) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA_P384) id 15.1.693.12; Thu, 3 Nov 2016 02:28:02 +0000 Received: from DB3FFO11FD050.protection.gbl (2a01:111:f400:7e04::118) by VI1PR0801CA0058.outlook.office365.com (2603:10a6:800:4d::26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.609.9 via Frontend Transport; Thu, 3 Nov 2016 02:28:02 +0000 Authentication-Results: spf=pass (sender IP is 217.140.96.140) smtp.mailfrom=arm.com; vger.kernel.org; dkim=none (message not signed) header.d=none;vger.kernel.org; dmarc=bestguesspass action=none header.from=arm.com; Received-SPF: Pass (protection.outlook.com: domain of arm.com designates 217.140.96.140 as permitted sender) receiver=protection.outlook.com; client-ip=217.140.96.140; helo=nebula.arm.com; Received: from nebula.arm.com (217.140.96.140) by DB3FFO11FD050.mail.protection.outlook.com (10.47.217.81) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA_P384) id 15.1.693.6 via Frontend Transport; Thu, 3 Nov 2016 02:28:01 +0000 X-IncomingTopHeaderMarker: OriginalChecksum:; UpperCasedChecksum:; SizeAsReceived:935; Count:13 Received: from sha-win-210.shanghai.arm.com (10.1.2.79) by mail.arm.com (10.1.106.66) with Microsoft SMTP Server id 14.3.294.0; Thu, 3 Nov 2016 02:27:56 +0000 From: Huang Shijie To: Subject: [PATCH 2/2] arm64: hugetlb: fix the wrong address for several functions Date: Thu, 3 Nov 2016 10:27:39 +0800 Message-ID: <1478140059-13829-3-git-send-email-shijie.huang@arm.com> X-Mailer: git-send-email 2.5.5 In-Reply-To: <1478140059-13829-1-git-send-email-shijie.huang@arm.com> References: <1478140059-13829-1-git-send-email-shijie.huang@arm.com> MIME-Version: 1.0 X-IncomingHeaderCount: 13 X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-HT: Tenant X-Forefront-Antispam-Report: CIP:217.140.96.140; IPV:CAL; SCL:-1; CTRY:GB; EFV:NLI; SFV:NSPM; SFS:(10009020)(6009001)(7916002)(2980300002)(438002)(199003)(189002)(47776003)(356003)(87936001)(626004)(586003)(48376002)(5660300001)(106466001)(50466002)(229853001)(2351001)(246002)(305945005)(7846002)(11100500001)(50986999)(5003940100001)(8676002)(76176999)(189998001)(6666003)(19580395003)(19580405001)(4326007)(104016004)(33646002)(6636002)(2906002)(26826002)(36756003)(2950100002)(110136003)(8936002)(77096005)(86362001)(92566002)(50226002); DIR:OUT; SFP:1101; SCL:1; SRVR:DB6PR0802MB2566; H:nebula.arm.com; FPR:; SPF:Pass; PTR:fw-tnat.cambridge.arm.com; A:1; MX:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; DB3FFO11FD050; 1:PvEAKa5qGCsH20fxvc+CTawtu70/mJPvVWtDjHtsR03209579hZWLzYjeZAcghi1NoCsdtdI8G+BoNIEXEC0lV+sTR+Dd8JVwDs9y51t53fuu+nls02SCbHbKeSHEbf6TQBx6UWjGz7MNJ7pjQjb1lgBmHXMV87z7xAuP1Mv4DJojRU0lKgsMgURdwIilKfdDpaUd1josYA/GtWeK8RkUt/iP9+LEEAzprtMEeZQtcGmoqbErEN17LTKRbxehmjhDpsm3YxOmBGT+ZjErN7WKUKq86Y/dMt/C2JBgt74ADtyjRW3GvaGCAhviqE3K1ROtL1HgTEbMXwYNlEWKhVTCcLlmH7ogX7RR6bkR42tdYXTWasNAJe/CfMroWRsawwz5NZpX0NIW7yp0Ii/o5jBB7Fl6EMJT1t+RRIfEzd/dQ+nbkrRlMOh5qbtP1dmkN44s1lC+bHN4c7KZ/4yT/ebmfF+Y+fXE7xVQ5XgyVYd6p4P5FOe2ljIQ6UgC4PT4IGrXrbTHtcdevMAuK1VSWlUd6YHeJhGXRCT2zCaibeZKwZHvS6kuH/F//jwHRYUK5PhL8d6zK5BsykjQVPH9V9vngl8hu02KX1mozk9JG03qS2lyI3wvDbDMzko4qKuvpGs X-MS-Office365-Filtering-Correlation-Id: 0ca88c31-075b-43a4-0394-08d4039108db X-Microsoft-Exchange-Diagnostics: 1; DB6PR0802MB2566; 2:SKYHP58MHKhYcJ0jfeKhAYq+p6LKAdyvcD1/rSkHpn6iyCp+vmq25ic2sqzM3PRPCB1WP3Aw0ySAYbAgLpDynzgJH0e1fm1fp5krvD36c+yt7KfEiuI99T/2S1CpKAFnes/+0tqBSkGEOJc2Vxg4MaKYw321XZlX0yfkvEi0/4l9/qsJEExnJJv9Z1s8xlkEUdt/JctxDZG/4lbrTbwTUA==; 3:uqdG4Yas8nSyXl2Ie+44ckNy3FOpk+r8guqpN+EkkKBcz4dGYQGVWsXAQ8TOCqnBKfHxK9vU0W72LP5t9CMeoPvo+kW1gwBxgt9+iQPb5KZ9G52QkUDGKAaKu4HlMHrJeuNVwNG87lvWTkfTASsnMlIG4VSlhSeVQkrt5qlyxVyQ4KcX19oqLx3s1iKUXaSCdCFOp1Nji3wq+GF6Xl+3tThTuiYznK/thR0PcNFRwFzEAzeI1zFRT5fblKxm5sV7vATLW+R300cnX1O94OJGcRniyAF59JZOIBcZizlDUuY= X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(8251501002); SRVR:DB6PR0802MB2566; X-Microsoft-Exchange-Diagnostics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MXcWbLLBE4nBBwticE2XD8TWrZM2MqH0gcOV9CFgvOqwpaipvrKMktGZosa+aQWJoXQge/XuTTFufpzXnds84M7hJ8ItqavRwvFwXj3T/f18VhmVFAZdeDZheSSovOczVzfF2q2NyX5aAhD/nZULfsfHANf8K1Co1RYZaW1LHg1jHo88JtxrhqByiHDKAAZ0Dbj1xKp46FO85VkVouz3IKadpbZs7ieF0k7aqfTpl9Yyzsi2vV7tdaaClZK6D7/qtruepcOU7plgyw82fFPwEukCosM919kHyA/D+tGTUFNi4Ur9OXwP32y/yL0Ra/eRk5UCRtYmOAcaTm/Ol6vIiOJ7P/KjysYslZTKnnAu+vrr0puS7idFIqWWwz02BKiWq523rL01U9uD1rC/lajcRPv8QQc4mewAC152LjBIIg9JXFafNPl69jvd3BDVUVlwZqXbo3x2/VPKETBnB/zdNUMnOeEHq+RPnAJUh+DNM0yUG8zc3XRp1HwPAAnx5D/vpXdgDjHsixvSHSkRdnGyBg= X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(180628864354917); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040176)(601004)(2401047)(13020025)(5005006)(8121501046)(13023025)(13024025)(13013025)(10201501046)(3002001)(6055026); SRVR:DB6PR0802MB2566; BCL:0; PCL:0; RULEID:; SRVR:DB6PR0802MB2566; X-Forefront-PRVS: 011579F31F X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; DB6PR0802MB2566; 23:YG52iLW6e2jBoow6BQ537hYWrqN5AZU/0ZTR2rV?= =?us-ascii?Q?OlPMNYWYWg667u8WLZrWB5o4Hf+t9LUc/U0FCovHCH2zx1/GblLwIAOYkUVn?= =?us-ascii?Q?0OylNzS4VPXsn+O8cPNtQjnE2a+F65QHE+lTH9w6vPpR/vIGvND+bFbTVVC/?= =?us-ascii?Q?j2Jx6WpsPAADRb5qbm6AdCelKdb1Gr452WYHA7T7yQKnXYEyNs4nTj/urrJI?= =?us-ascii?Q?bHp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ddR6iy293sGkKCM= X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 03 Nov 2016 02:28:01.7298 (UTC) X-MS-Exchange-CrossTenant-Id: f34e5979-57d9-4aaa-ad4d-b122a662184d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=f34e5979-57d9-4aaa-ad4d-b122a662184d; Ip=[217.140.96.140]; Helo=[nebula.arm.com] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB6PR0802MB2566 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20161102_192825_914464_BD418721 X-CRM114-Status: GOOD ( 10.55 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: dwoods@mellanox.com, steve.capper@arm.com, will.deacon@arm.com, linux-kernel@vger.kernel.org, kaly.xin@arm.com, Huang Shijie , akpm@linux-foundation.org, nd@arm.com, linux-arm-kernel@lists.infradead.org Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP The libhugetlbfs meets several failures since the following functions do not use the correct address: huge_ptep_get_and_clear() huge_ptep_set_access_flags() huge_ptep_set_wrprotect() huge_ptep_clear_flush() This patch fixes the wrong address for them. Acked-by: Steve Capper Signed-off-by: Huang Shijie --- arch/arm64/mm/hugetlbpage.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/arch/arm64/mm/hugetlbpage.c b/arch/arm64/mm/hugetlbpage.c index 4811ef1..0e9401b 100644 --- a/arch/arm64/mm/hugetlbpage.c +++ b/arch/arm64/mm/hugetlbpage.c @@ -208,7 +208,7 @@ pte_t huge_ptep_get_and_clear(struct mm_struct *mm, ncontig = find_num_contig(mm, addr, cpte, *cpte, &pgsize); /* save the 1st pte to return */ pte = ptep_get_and_clear(mm, addr, cpte); - for (i = 1; i < ncontig; ++i) { + for (i = 1, addr += pgsize; i < ncontig; ++i, addr += pgsize) { /* * If HW_AFDBM is enabled, then the HW could * turn on the dirty bit for any of the page @@ -246,7 +246,7 @@ int huge_ptep_set_access_flags(struct vm_area_struct *vma, pfn = pte_pfn(*cpte); ncontig = find_num_contig(vma->vm_mm, addr, cpte, *cpte, &pgsize); - for (i = 0; i < ncontig; ++i, ++cpte) { + for (i = 0; i < ncontig; ++i, ++cpte, addr += pgsize) { changed = ptep_set_access_flags(vma, addr, cpte, pfn_pte(pfn, hugeprot), @@ -269,7 +269,7 @@ void huge_ptep_set_wrprotect(struct mm_struct *mm, cpte = huge_pte_offset(mm, addr); ncontig = find_num_contig(mm, addr, cpte, *cpte, &pgsize); - for (i = 0; i < ncontig; ++i, ++cpte) + for (i = 0; i < ncontig; ++i, ++cpte, addr += pgsize) ptep_set_wrprotect(mm, addr, cpte); } else { ptep_set_wrprotect(mm, addr, ptep); @@ -287,7 +287,7 @@ void huge_ptep_clear_flush(struct vm_area_struct *vma, cpte = huge_pte_offset(vma->vm_mm, addr); ncontig = find_num_contig(vma->vm_mm, addr, cpte, *cpte, &pgsize); - for (i = 0; i < ncontig; ++i, ++cpte) + for (i = 0; i < ncontig; ++i, ++cpte, addr += pgsize) ptep_clear_flush(vma, addr, cpte); } else { ptep_clear_flush(vma, addr, ptep);