From patchwork Tue Feb 24 23:40:21 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Feng Kan X-Patchwork-Id: 5875951 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id CA4099F36A for ; Tue, 24 Feb 2015 23:42:45 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 03DA72024D for ; Tue, 24 Feb 2015 23:42:45 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 141EB2024F for ; Tue, 24 Feb 2015 23:42:44 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1YQP5S-0007vm-6r; Tue, 24 Feb 2015 23:40:22 +0000 Received: from exprod5og118.obsmtp.com ([64.18.0.160] helo=mail-pd0-f181.google.com) by bombadil.infradead.org with smtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1YQP5O-0006kh-Bp for linux-arm-kernel@lists.infradead.org; Tue, 24 Feb 2015 23:40:18 +0000 Received: from mail-pd0-f181.google.com ([209.85.192.181]) (using TLSv1) by exprod5ob118.postini.com ([64.18.4.12]) with SMTP ID DSNKVO0Ly6F+zXx2YGSoJdq2yt+3dLA5+eLJ@postini.com; Tue, 24 Feb 2015 15:40:18 PST Received: by pdbfl12 with SMTP id fl12so423565pdb.2 for ; Tue, 24 Feb 2015 15:39:55 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=14as0VLIqcfmrtrbCBBmT3nKTJpsIMdq5H/CTYwVMtw=; b=aACcYci+Jb9tkvF3/4FSEBEF7Uz5gKyn3b6O1dMNaIK8QN7/WU+f6f7wOGjl4YXQQg rHe9XxBw4Wa/wTW0eQvI1zQuvdnz49ZXl3zRC8m5lmMlhKHZRa1flQiPTSEaZ8h9luq2 UZd14UuEuDour3astTIG2ygfgUD9Hq8XrImZqrHfSrPpcGVU60vy6ph4t5kgBc1h3rvw 3sW4sfrytaDkqo8xd4eLhWoaTev9s0QjIGjD/Jx+ueb/N1aiRjPPzYvBRnDJCHX6ACcs xBxAB988OuDfLXOWClh6nDiGNCy8GBm22k5aED72zo4oNlUPGr+/sBqwTHsxPInpnfe6 OqMw== X-Gm-Message-State: ALoCoQn3IYufo7nJO7EDZOZREQYrR1o//6iAtfcJbmWwijbBWdh7RRIkFKitMvFDkRmElp3WxAm/+1342+uKe2LgZ8dndF5lSCne3qguTITSf3rFddWKvYMyH/hRLDw8CXPobA9PcObJFKFWUqmvLrkLYbRZ/Ixa9GCwHCjFxkl04QBcYVIAvxs= X-Received: by 10.68.201.168 with SMTP id kb8mr340420pbc.89.1424821194982; Tue, 24 Feb 2015 15:39:54 -0800 (PST) X-Received: by 10.68.201.168 with SMTP id kb8mr340406pbc.89.1424821194851; Tue, 24 Feb 2015 15:39:54 -0800 (PST) Received: from fkan-lpt.amcc.com (67-207-112-226.static.wiline.com. [67.207.112.226]) by mx.google.com with ESMTPSA id se2sm24986776pac.38.2015.02.24.15.39.53 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 24 Feb 2015 15:39:54 -0800 (PST) From: Feng Kan To: patches@apm.com, linux-arm-kernel@lists.infradead.org Subject: [PATCH] arm64: enable PTE type bit in the mask for pte_modify Date: Tue, 24 Feb 2015 15:40:21 -0800 Message-Id: <1424821221-16396-1-git-send-email-fkan@apm.com> X-Mailer: git-send-email 1.9.1 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20150224_154018_451953_5267D414 X-CRM114-Status: GOOD ( 12.19 ) X-Spam-Score: -2.3 (--) Cc: Feng Kan X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Caught during Trinity testing. The pte_modify does not allow modification for PTE type bit. This cause the test to hang the system. It is found that the PTE can't transit from an inaccessible page (b00) to a valid page (b11) because the mask does not allow it. This happens when a big block of mmaped memory is set the PROT_NONE, then the a small piece is broken off and set to PROT_WRITE | PROT_READ cause a huge page split. Signed-off-by: Feng Kan --- arch/arm64/include/asm/pgtable.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/arm64/include/asm/pgtable.h b/arch/arm64/include/asm/pgtable.h index a26a574..8255b52 100644 --- a/arch/arm64/include/asm/pgtable.h +++ b/arch/arm64/include/asm/pgtable.h @@ -462,7 +462,7 @@ static inline pud_t *pud_offset(pgd_t *pgd, unsigned long addr) static inline pte_t pte_modify(pte_t pte, pgprot_t newprot) { const pteval_t mask = PTE_USER | PTE_PXN | PTE_UXN | PTE_RDONLY | - PTE_PROT_NONE | PTE_VALID | PTE_WRITE; + PTE_PROT_NONE | PTE_WRITE | PTE_TYPE_MASK; pte_val(pte) = (pte_val(pte) & ~mask) | (pgprot_val(newprot) & mask); return pte; }