From patchwork Fri Sep 11 15:43:47 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Julien Grall X-Patchwork-Id: 7162401 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 5E9A29F314 for ; Fri, 11 Sep 2015 15:49:20 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 91B00207C7 for ; Fri, 11 Sep 2015 15:49:19 +0000 (UTC) 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.kernel.org (Postfix) with ESMTPS id 8C3B1207C6 for ; Fri, 11 Sep 2015 15:49:18 +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 1ZaQVw-0005t4-R1; Fri, 11 Sep 2015 15:45:24 +0000 Received: from smtp.citrix.com ([66.165.176.89]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1ZaQVt-0004ep-Ly for linux-arm-kernel@lists.infradead.org; Fri, 11 Sep 2015 15:45:22 +0000 X-IronPort-AV: E=Sophos;i="5.17,511,1437436800"; d="scan'208";a="299474326" Message-ID: <55F2F6B3.2080108@citrix.com> Date: Fri, 11 Sep 2015 16:43:47 +0100 From: Julien Grall User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Icedove/31.8.0 MIME-Version: 1.0 To: Will Deacon Subject: Re: [PATCH] arm64: Add support for hardware updates of the access and dirty pte bits References: <1436545468-1549-1-git-send-email-catalin.marinas@arm.com> <55F06A87.3000204@citrix.com> <20150910100753.GE12294@localhost> <55F19785.4090106@citrix.com> <20150910153812.GG22439@arm.com> In-Reply-To: <20150910153812.GG22439@arm.com> X-DLP: MIA2 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20150911_084522_005853_68BDAD1A X-CRM114-Status: UNSURE ( 9.87 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -6.9 (------) 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: Marc Zyngier , Catalin Marinas , "linux-arm-kernel@lists.infradead.org" , Stefano Stabellini 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 Hi Will, On 10/09/15 16:38, Will Deacon wrote: > Weird. That doesn't leave a lot of code. Two other things you could try > are: > > (1) Put PTE_WRITE back to bit 57 This change doesn't help. > (2) Remove the pte_hw_dirty check/set in pte_modify This one too, if I only drop the check pte_hw_dirty in pte_modify. But if I disable completely pte_hw_dirty (i.e always return 0 [1]), I'm able to use without any issue the userspace. Which means that the problem seems to come from the defition of pte_dirty: #define pte_dirty(pte) (pte_sw_dirty(pte) || pte_hw_dirty(pte)) Regards, [1] diff --git a/arch/arm64/include/asm/pgtable.h b/arch/arm64/include/asm/pgtable.h index 6900b2d9..804ec87 100644 --- a/arch/arm64/include/asm/pgtable.h +++ b/arch/arm64/include/asm/pgtable.h @@ -145,7 +145,8 @@ extern struct page *empty_zero_page; #define pte_write(pte) (!!(pte_val(pte) & PTE_WRITE)) #define pte_exec(pte) (!(pte_val(pte) & PTE_UXN)) -#ifdef CONFIG_ARM64_HW_AFDBM +//#ifdef CONFIG_ARM64_HW_AFDBM +#if 0 #define pte_hw_dirty(pte) (!(pte_val(pte) & PTE_RDONLY)) #else #define pte_hw_dirty(pte) (0)