From patchwork Wed Mar 6 15:50:13 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Steven Price X-Patchwork-Id: 10841329 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 0477D17E0 for ; Wed, 6 Mar 2019 15:50:55 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E3A272E72F for ; Wed, 6 Mar 2019 15:50:54 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E14172E72C; Wed, 6 Mar 2019 15:50:54 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4D48F2E72F for ; Wed, 6 Mar 2019 15:50:54 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 1DD138E0005; Wed, 6 Mar 2019 10:50:53 -0500 (EST) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id 163338E0002; Wed, 6 Mar 2019 10:50:53 -0500 (EST) X-Original-To: int-list-linux-mm@kvack.org X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 02A6C8E0005; Wed, 6 Mar 2019 10:50:52 -0500 (EST) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from mail-ed1-f70.google.com (mail-ed1-f70.google.com [209.85.208.70]) by kanga.kvack.org (Postfix) with ESMTP id A15F28E0002 for ; Wed, 6 Mar 2019 10:50:52 -0500 (EST) Received: by mail-ed1-f70.google.com with SMTP id f2so6455863edm.18 for ; Wed, 06 Mar 2019 07:50:52 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-original-authentication-results:x-gm-message-state:from:to:cc :subject:date:message-id:in-reply-to:references:mime-version :content-transfer-encoding; bh=3GzvBNszJ2F9qzyq8uNQC4ioxjUcI3EqpQkesdmXCx4=; b=bB851xJ1+m2w22NkSVyX5FgghjYTjVedZadvQ3/k8dJP89m0iZ94Gq2ID1QQvk3A/0 aCT2LTCpVoUsJe++CXPYTSz9uAa3Xi62tBh3z0JFsuLhsBHmvtAlH8OQjAGn3zyItfa8 pS5CTT1+0EIuy7SCE4x5sMCKkKfoSjxDRCBt+5pQW2mUc0TU+Zev/DLDcsfCXlJiFbUo pab+2Xd7QoEmEFsHHJacMUfpt4tHavfVVI7/KPcRjbdewvX9qAIoPTNu+nr5qL4roDVZ 0y11LLQxWWjxQUuNML0x8TLPgj48qi9iVsaFGUpo18g20126ia0wpG6Fep0iqyrTWlDm /0Rw== X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of steven.price@arm.com designates 217.140.101.70 as permitted sender) smtp.mailfrom=steven.price@arm.com X-Gm-Message-State: APjAAAWt+U6xfCXwWQWZWai4qOPLos0egefY1PCwyJxSG1LPvaE5ELJt dfqagKnuGTJEAj4ujC8Zpd1VU7vFXqQV/esmkvAqLyLtJBqdDvn8xwJYe9RWhAUGjWks2Pn0t1/ /62QGFF+mUqDx5HkeCBTaqxoP/ylLKA4m/y9l6G+lECk8CurbUtw7rnME/6DZG5qTsw== X-Received: by 2002:a17:906:4ad9:: with SMTP id u25mr4446041ejt.176.1551887451885; Wed, 06 Mar 2019 07:50:51 -0800 (PST) X-Google-Smtp-Source: APXvYqwMrt/S98k2uu5Pkn3ONiffGcOLV5uNWTtC580591jiYl2ufV9sa0boHE6SS1jSdy2uarer X-Received: by 2002:a17:906:4ad9:: with SMTP id u25mr4445968ejt.176.1551887450577; Wed, 06 Mar 2019 07:50:50 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1551887450; cv=none; d=google.com; s=arc-20160816; b=xu/5GkBeEacBk9l6fSwt4s6vWTDUa58PRW0KslCic6m2Q6WQFJQA1SKJVk/GTcAUuk Jrw6G4bAaKBHUQvvLPd+kmN6aTCLhPtd5aH7S4GKFLziNc2AsuJbOV/OKjuxr15qMonC M0zJMdPWmFvUynqNqWzMnEjWIeEV2AT7FnA7QPNsuY5uhwFIeDmbz36Kte7HV366dKR1 eOxvZHI27ZVGMN0EOMzStVDsix5CUAlBQEvnLhs4MEkGaIqQ81yQDi42gzZLbGtD78sX dI8csGB+Tasb2/BrdljHTEDoFPNNbvqO3uRwviwr96TEQofPh/Pm3FCdsBgh7yjmemYV AdCg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from; bh=3GzvBNszJ2F9qzyq8uNQC4ioxjUcI3EqpQkesdmXCx4=; b=jhaG1+7nNm5hJyc+6aad36+bVWUzfkBJGkiUhSt1N+abN9MCvECY1DxShmjOJcsC6l oD0rHz/iB5SiN7Vhqr5tR44/1dinQ1HiVtUjQiy3ziW34qL/YQPO9fOnZBT9kK7stNG2 kzU6p/TXUt8K2tgyuAI+tJaQ68S1aj9i59FISyh7+cFwrAoppCYQi6d95svswjvlBf7E ljJvZGONGaJLWoK3+F1YBTV97qoIebhF4Sp0iqxDt/979lNAlaVFFegUSeAEoIuqFXL8 nbBIKOPafkJpbPj7TWZUtyfqeeFR1F8uTotEjlMT2D/Vd0f1aUR26MIQHI+hdp/VKgzS gOZg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of steven.price@arm.com designates 217.140.101.70 as permitted sender) smtp.mailfrom=steven.price@arm.com Received: from foss.arm.com (foss.arm.com. [217.140.101.70]) by mx.google.com with ESMTP id p21si184204eda.281.2019.03.06.07.50.50 for ; Wed, 06 Mar 2019 07:50:50 -0800 (PST) Received-SPF: pass (google.com: domain of steven.price@arm.com designates 217.140.101.70 as permitted sender) client-ip=217.140.101.70; Authentication-Results: mx.google.com; spf=pass (google.com: domain of steven.price@arm.com designates 217.140.101.70 as permitted sender) smtp.mailfrom=steven.price@arm.com 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 8FBC91596; Wed, 6 Mar 2019 07:50:49 -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 0E1EB3F703; Wed, 6 Mar 2019 07:50:45 -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?b?SsOpcsO0bWUgR2xpc3Nl?= , Peter Zijlstra , Thomas Gleixner , Will Deacon , x86@kernel.org, "H. Peter Anvin" , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Mark Rutland , "Liang, Kan" , Vineet Gupta , linux-snps-arc@lists.infradead.org Subject: [PATCH v4 01/19] arc: mm: Add p?d_large() definitions Date: Wed, 6 Mar 2019 15:50:13 +0000 Message-Id: <20190306155031.4291-2-steven.price@arm.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190306155031.4291-1-steven.price@arm.com> References: <20190306155031.4291-1-steven.price@arm.com> MIME-Version: 1.0 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: X-Virus-Scanned: ClamAV using ClamSMTP walk_page_range() is going to be allowed to walk page tables other than those of user space. For this it needs to know when it has reached a 'leaf' entry in the page tables. This information will be provided by the p?d_large() functions/macros. For arc, we only have two levels, so only pmd_large() is needed. CC: Vineet Gupta CC: linux-snps-arc@lists.infradead.org Signed-off-by: Steven Price Acked-by: Vineet Gupta --- arch/arc/include/asm/pgtable.h | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/arc/include/asm/pgtable.h b/arch/arc/include/asm/pgtable.h index cf4be70d5892..0edd27bc7018 100644 --- a/arch/arc/include/asm/pgtable.h +++ b/arch/arc/include/asm/pgtable.h @@ -277,6 +277,7 @@ static inline void pmd_set(pmd_t *pmdp, pte_t *ptep) #define pmd_none(x) (!pmd_val(x)) #define pmd_bad(x) ((pmd_val(x) & ~PAGE_MASK)) #define pmd_present(x) (pmd_val(x)) +#define pmd_large(x) (pmd_val(pmd) & _PAGE_HW_SZ) #define pmd_clear(xp) do { pmd_val(*(xp)) = 0; } while (0) #define pte_page(pte) pfn_to_page(pte_pfn(pte))