Received: by 2002:ac0:946b:0:0:0:0:0 with SMTP id j40csp928268imj; Fri, 15 Feb 2019 09:06:46 -0800 (PST) X-Google-Smtp-Source: AHgI3IaMGo6ggS1OKz1c4bHjFjZN6Qjkyl+AN6PlMkeZHZvBbRx8rls9aBZ0M4CD3/xRir0SIZqm X-Received: by 2002:a17:902:a612:: with SMTP id u18mr11045513plq.145.1550250406471; Fri, 15 Feb 2019 09:06:46 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1550250406; cv=none; d=google.com; s=arc-20160816; b=Uucoo4imarq58nOiIQqskY6RAJKoxVrwIySsv4YQLbHDmEa1RW2i60Y2Zhwj/zyPbS GLz09ecAoCFq0j/2hBvjaGAc14CsDauvj15SQPBzJ13nnmC0+7RXrFTxsTUJPuwZvYU8 Mtfr0L2rh3Mzq+onkHzlNUuIu/lJIugLmZ900z0N9TS7vs94KuPQdd0NLhl2PYs5wJME DwNBTHyYvL4l6lZmaoeqjEhEN1u/b4yJNA7x37L6D7Mx8pqtiy6OvcUQj9Fbjc0V2Clm ZlHdhuiOQtgdgsKGw64TLzBZWFM/4MpG/K4+xFjFqW8RBqiYXOaVVj9AKJqfv62YFRWj jXVw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=3FSyeGjDNZIADKBQFr5V22ox8XwqOpOZQRYVkJgSrP0=; b=PXpg78HMZabjhuHHUUuF7ni+ZAA4L5uESuRogWO6Lmj/NVX7cIfeD+P4JAe66xmjbc g8s6rwWsWbCrQRLu6mtenApGXwHoJyGTKKzxYDs0EvzUi6uO58iS1sKWCwk5gn4h2H+p w+n4EXpK6euaxE+EZbYzzgm0DeTmujE8yIuMK84ebDnqiX0dd+e7EKC5DBwmEBa0TK1l wBmxUzVowpTloI/TxK/QjrZLNa1tJ9DyIRN6JMOCDzOZBQdnNjJuSQeTjTj4NCetd0wx 2a0/8ch/VqrnI2f8VA0hSjUzoEMMscV1ac0maW34hW5pnyE5yd4Gb1VU1rT/h7IoTuxR jKBg== 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 t27si5648017pga.3.2019.02.15.09.06.29; Fri, 15 Feb 2019 09:06:46 -0800 (PST) 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 S1730283AbfBORDK (ORCPT + 99 others); Fri, 15 Feb 2019 12:03:10 -0500 Received: from usa-sjc-mx-foss1.foss.arm.com ([217.140.101.70]:35628 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726192AbfBORDJ (ORCPT ); Fri, 15 Feb 2019 12:03:09 -0500 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 0AE541596; Fri, 15 Feb 2019 09:03:09 -0800 (PST) Received: from e112269-lin.arm.com (e112269-lin.cambridge.arm.com [10.1.196.69]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 172FC3F557; Fri, 15 Feb 2019 09:03:05 -0800 (PST) From: Steven Price To: linux-mm@kvack.org Cc: Steven Price , Andy Lutomirski , Ard Biesheuvel , Arnd Bergmann , Borislav Petkov , Catalin Marinas , Dave Hansen , Ingo Molnar , James Morse , =?UTF-8?q?J=C3=A9r=C3=B4me=20Glisse?= , Peter Zijlstra , Thomas Gleixner , Will Deacon , x86@kernel.org, "H. Peter Anvin" , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH 01/13] arm64: mm: Add p?d_large() definitions Date: Fri, 15 Feb 2019 17:02:22 +0000 Message-Id: <20190215170235.23360-2-steven.price@arm.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190215170235.23360-1-steven.price@arm.com> References: <20190215170235.23360-1-steven.price@arm.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: James Morse Exposing the pud/pgd levels of the page tables to walk_page_range() means we may come across the exotic large mappings that come with large areas of contiguous memory (such as the kernel's linear map). Expose p?d_large() from each architecture to detect these large mappings. arm64 already has these macros defined, but with a different name. p?d_large() is used by s390, sparc and x86. Only arm/arm64 use p?d_sect(). Add a macro to allow both names. By not providing a pgd_large(), we get the generic version that always returns 0. Signed-off-by: James Morse Signed-off-by: Steven Price --- arch/arm64/include/asm/pgtable.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/arch/arm64/include/asm/pgtable.h b/arch/arm64/include/asm/pgtable.h index de70c1eabf33..09d308921625 100644 --- a/arch/arm64/include/asm/pgtable.h +++ b/arch/arm64/include/asm/pgtable.h @@ -428,6 +428,7 @@ extern pgprot_t phys_mem_access_prot(struct file *file, unsigned long pfn, PMD_TYPE_TABLE) #define pmd_sect(pmd) ((pmd_val(pmd) & PMD_TYPE_MASK) == \ PMD_TYPE_SECT) +#define pmd_large(x) pmd_sect(x) #if defined(CONFIG_ARM64_64K_PAGES) || CONFIG_PGTABLE_LEVELS < 3 #define pud_sect(pud) (0) @@ -435,6 +436,7 @@ extern pgprot_t phys_mem_access_prot(struct file *file, unsigned long pfn, #else #define pud_sect(pud) ((pud_val(pud) & PUD_TYPE_MASK) == \ PUD_TYPE_SECT) +#define pud_large(x) pud_sect(x) #define pud_table(pud) ((pud_val(pud) & PUD_TYPE_MASK) == \ PUD_TYPE_TABLE) #endif -- 2.20.1