From patchwork Wed Jan 11 05:58:28 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Huang Shijie X-Patchwork-Id: 9509293 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 229E460231 for ; Wed, 11 Jan 2017 05:59:16 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 13FC42857B for ; Wed, 11 Jan 2017 05:59:16 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 084C8285D0; Wed, 11 Jan 2017 05:59:16 +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 AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 01DFB2857B for ; Wed, 11 Jan 2017 05:59:14 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux)) id 1cRBwH-0007D1-3P; Wed, 11 Jan 2017 05:59:13 +0000 Received: from mail-ve1eur01on0063.outbound.protection.outlook.com ([104.47.1.63] helo=EUR01-VE1-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1cRBwB-0007Bw-S8 for linux-arm-kernel@lists.infradead.org; Wed, 11 Jan 2017 05:59:10 +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=Rv4ksECDkerAxN/h1jMetyFCSbbVdlw/eLX12gOWNlw=; b=ANOEpOC7yUn6JJ0D190N/6MxcdL8RqzGjOnfBQDGWmB6o4EjspT/lywIBXv/1Lc+Igtm3p0e9dTt15c+ZnoM74dg7ymYKCuNWr1Jh46Lz9ik1w32ASX/fmCETQLw7opreimV5KMZi/OcN7w7IIvU7OI8cpOolJgGTeoIzSthakc= Received: from VI1PR0801CA0021.eurprd08.prod.outlook.com (10.167.193.159) by DB6PR0802MB2566.eurprd08.prod.outlook.com (10.172.252.7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.845.12; Wed, 11 Jan 2017 05:58:44 +0000 Received: from DB3FFO11FD023.protection.gbl (2a01:111:f400:7e04::144) by VI1PR0801CA0021.outlook.office365.com (2603:10a6:800:32::31) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.829.7 via Frontend Transport; Wed, 11 Jan 2017 05:58:43 +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 DB3FFO11FD023.mail.protection.outlook.com (10.47.217.54) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA_P384) id 15.1.803.8 via Frontend Transport; Wed, 11 Jan 2017 05:58:42 +0000 Received: from sha-win-210.shanghai.arm.com (10.1.2.79) by mail.arm.com (10.1.105.66) with Microsoft SMTP Server id 14.3.294.0; Wed, 11 Jan 2017 05:58:40 +0000 From: Huang Shijie To: Subject: [PATCH] arm64: hugetlb: fix the wrong return value for huge_ptep_set_access_flags Date: Wed, 11 Jan 2017 13:58:28 +0800 Message-ID: <1484114308-6068-1-git-send-email-shijie.huang@arm.com> X-Mailer: git-send-email 2.5.5 MIME-Version: 1.0 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)(39410400002)(39850400002)(39450400003)(39860400002)(39840400002)(2980300002)(438002)(189002)(199003)(40434004)(50226002)(5003940100001)(54906002)(246002)(305945005)(92566002)(4326007)(5660300001)(47776003)(5890100001)(356003)(626004)(2906002)(77096006)(575784001)(38730400001)(86362001)(104016004)(2351001)(8676002)(6636002)(36756003)(110136003)(106466001)(33646002)(6666003)(50466002)(48376002)(8746002)(8936002)(50986999)(189998001)(26826002)(14583001); DIR:OUT; SFP:1101; SCL:1; SRVR:DB6PR0802MB2566; H:nebula.arm.com; FPR:; SPF:Pass; PTR:fw-tnat.cambridge.arm.com; MX:1; A:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; DB3FFO11FD023; 1:dV+RoW1q1wMCzr8z5aCx46uEjbiuEYIGF+XSbt2ushOOjFcvb4Vb0dWV1cCrkpsRX2tK4tumzs41/kdR/i8wCq2OlE1Y5sEabedCLgCWr11f/NcA1fmnIHjaTZoJtB8nf7Nl0fCXL1aVInMeK0IpyttZrdt11Vf5DtewcGAIaya/WilP//R4fkMIn71T0XjxclQ+gQUXdq0Tl2Li/Wc34C8kfsH14zW16QE0AjWKYbLhjOoeb/aBElk0JNVRrYjyfE14cc5/j1CNgFDeV6d9sHCOHXpe3qYUvsySLhVGWgPiWUHzvmusmGDDovoyVRQaeyeJKJihMgRIMFWjzJTO0cl4ghyV7lKLV8XY0RJagIQJoRgSk44ebqsGc2gj3digTflyALE4k3lgbtpTs4mfbYDWmkYrN2bq0nDGJy4kqYnRf5UDDVhvqV1yZnQefdwLXVziH755EtU0F0vEu19d5ojxfAmL7rAe1zTYvevFaqS1yK7jJZwFH8roZS4e4fz1cCCtnRTAVhpSQ6H40nrH0yhN6zH/6PefRLa8HojCkUkZAiq5O4ee2vKeLq6dBSYDq/QnRUACsb0u3t3PPj3USg== X-MS-Office365-Filtering-Correlation-Id: 1146182f-e7fb-4554-580e-08d439e6e5dd X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(8251501002); SRVR:DB6PR0802MB2566; X-Microsoft-Exchange-Diagnostics: 1; DB6PR0802MB2566; 3:5mOMES8Mfa0/CU3+RVirc4QwbUDtzBlWdHhKFRv16m2xnfMtieKGg9y3AHKfOwIDArh/Xb5OSdUdCHHGHEvkI/yRM/+2eFPelxnKb80VmRhjpIziMmIFWcIG98F3sAgbXmUWhsuEokli8ZdU/n7hhIlA60mvQH3hNWn+pA3Jg8Xpzr8gRPf2+oJDJf5Ddo3qILT9e7kaPzOmbqoYW3bVYGW6hdHQlRE2QW2khh68MpGDuB3rFkkBBBeszq3vrWMjQKe5pn8nZVuuLZ4YYJFSTlgzWZj901+8yjv1yWTRkRx1oPOwSbAyJDUOmjxuDDJdDoFToj3hq5A83eEAC7s5TUe0m7UFITXvIHYGWOFahScwYvdF8crQFnorSYLTtRfSpiEakyBpcOTRc2tFhe3y1g==; 25:7ub2uoOJSrL4D9KUbF7GAwsiUbEb9Ih+TINzTe6u9fHMNKJqRSu6tNSourIdjgvFEhEdn9n1lAktIkLIHjP4aIRq2HAdzbkktBK20b+7kZrm4FdRWkw4kBywskoNO99FWFIwHw8J6oFbReihZlekUpebOOueIxBHCZdo4KarT7YWywOSlWFXMlv1JnxVW37GucYfa+gjNELcVBnXx2Y+Lz8cjImMnrcuOYIhBWj5jKOTV0KPc9pf4eMVNhWM5k7zyUzn7RGhOj9+g82nDv7gqgI+uAtCD8DI69PKyR4UTyjCOHC4Spxw6nGr0+C1aWhEmdNUQEfCjk/9IkvBykagvV7Zwxzc69v+UC+tl4WKSvAX9ywvF/8akFzx//i/WZGfBP4w/ZF/E2wAjErCFWhBKCRdudcPBii7tM7VEKGvjdtjiNw9CLHuAFLOkHSudijCsf09aL/DJ598SW1y8t7jWg== X-Microsoft-Exchange-Diagnostics: 1; DB6PR0802MB2566; 31:xwd9kTjl100PLtgXyHNgm+jywOWvinO/r7HDhJ80XRdJP0zI0n8fs7sjh69VMSPHy7fyihssy8fhi6EtXSzXIa4cFU7PZFhYDQyw658DUd8kW1hJc7Q/GL2eH12UpMUyuhWUshis4R6X9b4SePiPX3HPBxTl15H66yBcY2caF/pWO4GnfpBkbq6/tI0IA7OW+XJ7kmVpk2tENoqoklhyAy0ePrklqz/fsNIyv/jAEXbbTSzxzPoNjeht/eDL8RC9nrY0IiI9Qcu2NMjT/gUbyw==; 20:98QoP/woBS3sAEB/xHjvfpy9cHKSOF3WS8j/+AyI48q2QCQnh3Dz7pNuWMEphV9gfFUtveHu2CLIuva2dPWCgspO55R9dQWBbxHleqLMV95cKo/0eTPHQBv/WaReh03P/THAcKtD+usQfnPO0GKn1ZwOvZAWRlJwcqao1kJI4vfHZbpeSKoO65xmxl1pymoa1JkrdwKn5Lc+PqMckDFk7nl0gIbqGUbA8I8WSImPAKUy1VB126nWxPFkcZz4QIZgIp0SAqSCRjPPYhH+p8LwcajFQQRZaZUu9wyP62USQxOTYYWu/01udNBATRcG7tYhqVvFwBr6orRuGUM4dBvIAVL+wLRwYVlmB9V0of7rL91YmEMvYyDlK0YML8ZprT6BE+WIG+J8Y5aGlMo+HhTCXs7HVrPPZ4ZVipcr3UJ7s8bdHc/NP0ae517YDW89F+5vFFSaFBOquWjC5m7V9xzVU8w0ipACeU0TMYZ8O+UI+FPe+T3PgHnATcQh9ln6diqV X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(180628864354917)(9452136761055); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040375)(601004)(2401047)(13023025)(13013025)(13024025)(13020025)(5005006)(8121501046)(3002001)(10201501046)(6055026)(6041248)(20161123562025)(20161123555025)(20161123564025)(20161123560025)(6072148); SRVR:DB6PR0802MB2566; BCL:0; PCL:0; RULEID:; SRVR:DB6PR0802MB2566; X-Microsoft-Exchange-Diagnostics: 1; DB6PR0802MB2566; 4:VTs28NTyP1KVY2xOb1bW2JdThVWxFjBMKeWZdpQkIbN5mxoFStSpEywuBs9aBGYuz8JozO+3AZ3OCRer2GxeVkkKB3it1rsAyKi2omYOf6tOmv4AMK8bUxSqkXGbU/1gyxn7HuuwEmP+frHgk2ij/zLxgl1dajqr802Rimsk9y5pcLUuNlxoTetQ57OiuhzE6iM0a26JLQWmeastxwk7NQAK/YN6izNz0350wZQ1BSiT9zCnrLkoaPdYGMqTOn1t13A7DnN2VbHMZXS2VwkbvIYeXQSPozFaNxrYxfqDUgK68YyANqzojERv2pLls9JTY18x8ZhF/W2OmSyhPZAVoW0DG7ohyVc9YhFw+6rOSF7xCMgqAxQa5KW2VRK7EsVYk17bzKzdFslc5a3bKErISOcKP7kA6A2NqT9dlpri8M8Or2KbKQaAMQxhHZWNXBVSdRrNkOSu4vqteZDLqFId+xzH5yCN5J3pjeDMtrOMDyuqZsEZITFezMi3WMURyhQ3JWzoIVCa53Rfwbna2P1JDymAlenH0tIAUXit4UbizaZmxA2AGPhVgyKjSCsZzPBOXeLcMO1VQrJxKjfJkG+cyK64Hp7roblcgeopkZL3C1F/vBGrqlhLUOV5YD8Ubrxwl6MXro81f6jgjGx8H8hGFbT7FS/DtBq9ezcTW5s0eAHYW1ZmsVfdIijF+Czn1yQLs+QH/SfiiylLGJnoWQRUQwg2sw3hpvQCSrockjRupHw= X-Forefront-PRVS: 01842C458A X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; DB6PR0802MB2566; 23:migiB82WNv43JYOdsYqBcIo7iGyvVYwJDyaJRSH?= =?us-ascii?Q?AgcKd8O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: NSPM X-Microsoft-Exchange-Diagnostics: 1; DB6PR0802MB2566; 7:dHcyvH2OjDpqW/CSIqzy0Z+kXuxscQ9IHbR6ViVFfxkZFb0yQN4P6OyMnQADQaQHvlelpK4sVcWG/kl+rrooO+yfRX3I7s3wWBobnEZiRGGjnJCSTMXh6z/NGMs6GZfytoAV6L0OyHQCeHF4pKhsXR72Gha/PAhijwFfCmexlX2pB2sF6i8dvEChWYsGz3VEOQ0oXUzR3hlsRzfjk9nCyGX84f7w5LAXW+QrQFNrA0dsM1FDEwvc3FzMeeq7w7ghRFqYqW587ItL8jhXiMOOyRgVgCEzbbja1qRRbcyFB7Xfh8TX1WR8kMiSGgm9epNIi9loEjxQwvMbKLlmsd3bMpUajSY0Ij4QwvpvAKGY+N/+VASEYwyoLneuTuwRrhpQcnl1nG1GjXEUkDmxclbDVw92KfvzMqP3n+nK2YLtJ9IucgTMXBM/PN7n2dQ1YRBFwsm+bRLoQowHl6C7TJmk4w== X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 Jan 2017 05:58:42.5180 (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-20170110_215908_309982_1DF44FCF X-CRM114-Status: GOOD ( 10.11 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: steve.capper@arm.com, will.deacon@arm.com, stable@vger.kernel.org, kaly.xin@arm.com, Huang Shijie , 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 In current code, the @changed always returns the last one's status for the huge page with the contiguous bit set. This is really not what we want. Even one of the PTEs is changed, we should tell it to the caller. This patch fixes this issue. Fixes: 66b3923a1a0f ("arm64: hugetlb: add support for PTE contiguous bit") Cc: stable@vger.kernel.org Signed-off-by: Huang Shijie --- arch/arm64/mm/hugetlbpage.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- 2.5.5 IMPORTANT NOTICE: The contents of this email and any attachments are confidential and may also be privileged. If you are not the intended recipient, please notify the sender immediately and do not disclose the contents to any other person, use it for any purpose, or store or copy the information in any medium. Thank you. diff --git a/arch/arm64/mm/hugetlbpage.c b/arch/arm64/mm/hugetlbpage.c index 964b7549af5c..e25584d72396 100644 --- a/arch/arm64/mm/hugetlbpage.c +++ b/arch/arm64/mm/hugetlbpage.c @@ -239,7 +239,7 @@ int huge_ptep_set_access_flags(struct vm_area_struct *vma, ncontig = find_num_contig(vma->vm_mm, addr, cpte, *cpte, &pgsize); for (i = 0; i < ncontig; ++i, ++cpte, addr += pgsize) { - changed = ptep_set_access_flags(vma, addr, cpte, + changed |= ptep_set_access_flags(vma, addr, cpte, pfn_pte(pfn, hugeprot), dirty);