From patchwork Wed Dec 13 10:57:48 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Kirill A. Shutemov" X-Patchwork-Id: 121731 Delivered-To: patch@linaro.org Received: by 10.140.22.227 with SMTP id 90csp5313408qgn; Wed, 13 Dec 2017 02:59:06 -0800 (PST) X-Google-Smtp-Source: ACJfBovvgBG0XDY54qt/S4dQt2MncxoZ30H9nR3/ey9kMymWcuB/Q8/1TdKN41DSowjJwy0i5ApQ X-Received: by 10.84.171.129 with SMTP id l1mr5423910plb.438.1513162746801; Wed, 13 Dec 2017 02:59:06 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1513162746; cv=none; d=google.com; s=arc-20160816; b=ZofRrsL2RDWRMTnvs6z0nvQ65snb27uhyFyZzonHq6GJhUckoTisXuW1Y08w/AsECS bKN0g5rLYXUbDHXAd8mwmkg6hIP9RGuAdjfsL0uqHsQNZFYkd++jkehp9SsZ6V3k+6X0 P9A2XMkChmX4ZAuKt+BJWmw8JSY8GT9Y+J+kDG+NE91NjzNtdqs3jfi5h3ORxcBEwzFh YtVXcl4H1Xol8yjTp1o1emALUc3eOs1kSPonKTbxwVfn20ChtiZ4GGrxOZfuBzLLCNab zNqcWhFW4V8UvJXwTXbNMXPy/uPl5Hvaqsd2eXDuLWfge5bt1RzN1JxemoHg7t2H1WZj p4Ww== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:arc-authentication-results; bh=HTaLtNebGdiKv19eDIPd7vbisXxh/tHvgZv/6CPlFtU=; b=xhlks+XZuUMQNt8K6lBjyAK5WqrsU00+zEx3H8A4UdFWPZlhjYhBtN1rKJotZp0xid OcxkXE1aePhfu6EBql7ottDx27yY3Uua3aZE3GVH8H6IUPtXYXsDFMKzqZb/igOoejW4 5nRzQqkLgSG6mfHNs+XeHwHe/RcikHwt39UGatOVkxXZ7OAVhYpqpJx6QCeSMvZqwHX9 BxsDtbCAJCDJl5/5G/36T/h1vG7BxQEbmtQa8nxViDZgxDWSdHk60uilsfbGoxUlH0vA phiH7tnW3Xij9L32z0Wh9QhEchgZSOZCRb+f5wjERuWOAEDPKS40V1Fy7LTRLtur/5xC jpYg== 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 s20si1088836pgn.363.2017.12.13.02.59.06; Wed, 13 Dec 2017 02:59:06 -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 S1752873AbdLMK7D (ORCPT + 10 others); Wed, 13 Dec 2017 05:59:03 -0500 Received: from mga05.intel.com ([192.55.52.43]:1708 "EHLO mga05.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752728AbdLMK6j (ORCPT ); Wed, 13 Dec 2017 05:58:39 -0500 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga002.jf.intel.com ([10.7.209.21]) by fmsmga105.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 13 Dec 2017 02:58:38 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.45,397,1508828400"; d="scan'208";a="17860575" Received: from black.fi.intel.com ([10.237.72.28]) by orsmga002.jf.intel.com with ESMTP; 13 Dec 2017 02:58:36 -0800 Received: by black.fi.intel.com (Postfix, from userid 1000) id 284885A7; Wed, 13 Dec 2017 12:58:05 +0200 (EET) From: "Kirill A. Shutemov" To: Andrew Morton Cc: Vlastimil Babka , Andrea Arcangeli , Michal Hocko , linux-arch@vger.kernel.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org, Catalin Marinas , "Kirill A . Shutemov" Subject: [PATCHv4 04/12] arm64: Provide pmdp_establish() helper Date: Wed, 13 Dec 2017 13:57:48 +0300 Message-Id: <20171213105756.69879-5-kirill.shutemov@linux.intel.com> X-Mailer: git-send-email 2.15.0 In-Reply-To: <20171213105756.69879-1-kirill.shutemov@linux.intel.com> References: <20171213105756.69879-1-kirill.shutemov@linux.intel.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Catalin Marinas We need an atomic way to setup pmd page table entry, avoiding races with CPU setting dirty/accessed bits. This is required to implement pmdp_invalidate() that doesn't lose these bits. Signed-off-by: Catalin Marinas Signed-off-by: Kirill A. Shutemov --- arch/arm64/include/asm/pgtable.h | 7 +++++++ 1 file changed, 7 insertions(+) -- 2.15.0 diff --git a/arch/arm64/include/asm/pgtable.h b/arch/arm64/include/asm/pgtable.h index 149d05fb9421..116d610a2620 100644 --- a/arch/arm64/include/asm/pgtable.h +++ b/arch/arm64/include/asm/pgtable.h @@ -676,6 +676,13 @@ static inline void pmdp_set_wrprotect(struct mm_struct *mm, { ptep_set_wrprotect(mm, address, (pte_t *)pmdp); } + +#define pmdp_establish pmdp_establish +static inline pmd_t pmdp_establish(struct vm_area_struct *vma, + unsigned long address, pmd_t *pmdp, pmd_t pmd) +{ + return __pmd(xchg_relaxed(&pmd_val(*pmdp), pmd_val(pmd))); +} #endif extern pgd_t swapper_pg_dir[PTRS_PER_PGD];