Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp5253630imm; Wed, 12 Sep 2018 03:27:39 -0700 (PDT) X-Google-Smtp-Source: ANB0VdYiYgRaxO4yZhg6RMn7qJ8JULFglgdSHmeyKOXIq0Yc4Ic+ggC66k+LazQKrejEg/9bAQeO X-Received: by 2002:a63:455d:: with SMTP id u29-v6mr1415358pgk.342.1536748059663; Wed, 12 Sep 2018 03:27:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1536748059; cv=none; d=google.com; s=arc-20160816; b=lPkarCyQBZJngJIIIfLmqB5xvEb9J5EqzLNIbFOgL6UWLvDAZl8LcOlXqoqAhG6HvE 0XFTbRMikSTR+lsVClqLPG6IN3vKosW711KC5hkigmOde7ZYaIBkwUBQ/E40yq2voiR7 UfuI39uicFPjgynNJ2ovhS9w+HZ9gLCh2XJKQU5CaXmETV9xuBGuK8AycKLVJ3+zhOit qBcSAOAPMpHC7BHrkk2NSX8U/e7j14kq75hnDc7nZdMHYT0N2VpaUXZS42WaIntyUBuq q0qZaSIe52Kq0A0gkw8jmQry5gJ0IbFYIHeeuYYNLuMU7hqvRHfexBD+KO7Qwuhjgb+C wO2Q== 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 l13-v6si672484pgr.291.2018.09.12.03.27.24; Wed, 12 Sep 2018 03:27:39 -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 S1727811AbeILP3z (ORCPT + 99 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