From patchwork Wed Sep 12 10:26:09 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Will Deacon X-Patchwork-Id: 146549 Delivered-To: patch@linaro.org Received: by 2002:a2e:1648:0:0:0:0:0 with SMTP id 8-v6csp4647294ljw; Wed, 12 Sep 2018 03:26:30 -0700 (PDT) X-Google-Smtp-Source: ANB0Vdb7zcTLhOL+umJ3jq5/SlpTzRJ45As2DK9Q/1M5lgfkGzAahKUnwDAKgTLAxGmpXg7rTpYI X-Received: by 2002:a65:5a81:: with SMTP id c1-v6mr1443455pgt.120.1536747989986; Wed, 12 Sep 2018 03:26:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1536747989; cv=none; d=google.com; s=arc-20160816; b=oZLy3AW/E+C8148ajRVROzDxbPgCpCLkwtMLqiuVmGqXwRjRJH52xt+wuU7KKVYEOn Zut6FHVXLq0VEN3qkgAhHYH4050LbXLBndTIOSiU6BbaW/udWVUNMY/ZDUUmi3Onwmn1 ++X4X6RA83MY4lasr1Js6ld9FLoOK6IE1Y3zyuYEIa4yenytBaF0GdcQKLbMz4qdv2Pj SXMgnHbxvU6ds5tqUpByBU79h61jU5FQD2yrA3FTYsum5WOuxcP/eyDkDwuDYwrB+iw9 MVpw42pDrS+VmYTAdOPvOERaG0OS+Z0gC1RiigbQo3sD8CUMtYD+bUHj/xknXBh5fobz cCpw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from; bh=tnOs0cd/aIm6SaBUZEw/yn3MGRNvE+r/xHWLx9JChe0=; b=YXNporY/rBq7+Cy8rExAS/l61TfyBOy0CO4gvMcVR0kq8BSsNz2a/kb/3xW2jxeioi fSQNeFH8ZkdWk+x2RsmbZirpinrSBb1H8dX1wyramm84BomYqrox768kzIORJeLwA5Jj zutw5Tk8Ggpabol9gHFta/XOl1/VX+WUn3YYzgJ0kBtV6WBIpSqdF5YTp/7p9s2ZO4Ka wTkwsTrKiqHd7NB8HzQIE6CnQ7v2TdoxgNxwBoX37HWhtQWBocv2RsfRwF2gBtuGHw+k EmNCcjcgw0BzTULZuEH4Etb0ms2A9O1j0ufFANFI1QMFuM5/L40WqHYX0oEW4ALlDK2W M2bw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id p23-v6si662957pgl.394.2018.09.12.03.26.29; Wed, 12 Sep 2018 03:26:29 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727828AbeILP3z (ORCPT + 32 others); Wed, 12 Sep 2018 11:29:55 -0400 Received: from usa-sjc-mx-foss1.foss.arm.com ([217.140.101.70]:56952 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726792AbeILP3z (ORCPT ); Wed, 12 Sep 2018 11:29:55 -0400 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id D6E0C7A9; Wed, 12 Sep 2018 03:26:01 -0700 (PDT) Received: from edgewater-inn.cambridge.arm.com (usa-sjc-imap-foss1.foss.arm.com [10.72.51.249]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id A7EAD3F614; Wed, 12 Sep 2018 03:26:01 -0700 (PDT) Received: by edgewater-inn.cambridge.arm.com (Postfix, from userid 1000) id 7BA781AE3231; Wed, 12 Sep 2018 11:26:18 +0100 (BST) From: Will Deacon To: linux-kernel@vger.kernel.org, linux-mm@kvack.org Cc: cpandya@codeaurora.org, toshi.kani@hpe.com, tglx@linutronix.de, mhocko@suse.com, akpm@linux-foundation.org, Will Deacon Subject: [PATCH 0/5] Clean up huge vmap and ioremap code Date: Wed, 12 Sep 2018 11:26:09 +0100 Message-Id: <1536747974-25875-1-git-send-email-will.deacon@arm.com> X-Mailer: git-send-email 2.1.4 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi all, The recent introduction of break-before-make on the huge vmap path in b6bdb7517c3d ("mm/vmalloc: add interfaces to free unmapped page table") introduced a pair of arch functions for freeing a child level of page table before putting down a huge mapping at the parent level. Whilst this works well, the semantics of the pXd_free_pYd_table() function are slightly confusing, and this led to an over-eager VM_WARN_ON in the arm64 code that we fixed in -rc3 [1]. Linus suggested that the interface could be tidied up so that the pXd_present() checks are moved into the caller, so I've implemented that and generally cleaned up the ioremap code so that it's easier to follow. I also extended the break-before-make code to cover the huge p4d case, although this remains unused by any architectures. Feedback welcome. Cheers, Will [1] https://lkml.org/lkml/2018/9/7/898 --->8 Will Deacon (5): ioremap: Rework pXd_free_pYd_page() API arm64: mmu: Drop pXd_present() checks from pXd_free_pYd_table() x86: pgtable: Drop pXd_none() checks from pXd_free_pYd_table() lib/ioremap: Ensure phys_addr actually corresponds to a physical address lib/ioremap: Ensure break-before-make is used for huge p4d mappings arch/arm64/mm/mmu.c | 13 +++--- arch/x86/mm/pgtable.c | 14 +++--- include/asm-generic/pgtable.h | 5 ++ lib/ioremap.c | 103 +++++++++++++++++++++++++++++------------- 4 files changed, 91 insertions(+), 44 deletions(-) -- 2.1.4