Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp3620862imm; Mon, 4 Jun 2018 06:45:13 -0700 (PDT) X-Google-Smtp-Source: ADUXVKIn+JPMD9pPZSe/X1WASnJ/iuLKFjr9nImcB0KvYs3GNsHtTk2ANnx+bb+xdb6EBXcBUirQ X-Received: by 2002:a62:d97:: with SMTP id 23-v6mr13696477pfn.202.1528119913335; Mon, 04 Jun 2018 06:45:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1528119913; cv=none; d=google.com; s=arc-20160816; b=GPjCedNflLj/krLfKAolCnTZ8pV21JkR1EZ9uO6lUhBki3xMjGdWkDyS730IbOxv0J mGiv6qlhV7wtFgKMKsw+G9PwRr0A+3ivwv2DFkx+bWumtm4kDeio8mk1g+UvmRQjvfbu l/aGFzhIVG1W6ByDd7GUkNREORVZQ37aKQnIqrKva11Xf3FDNSGC4kvhmAFK8EcdXW1v fGQfq1GfOkGfNXBIdf8BfXvojiMybQbTzeUnnY8gO6WVJOzPKbPs1mgCAlsEyMfOo+1i InN26NX6n0uxqI546GqisPI+xxOwEza9b3cqCUaV9aFO3ShcMgr5oRMl5Nnmv29fG50d rh8w== 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 :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dmarc-filter :dkim-signature:dkim-signature:arc-authentication-results; bh=aXgr531nU0cxqu9zV5UbOOvO34xNeg51wbFKlQMwnCU=; b=BoDYvXHi/3LupQvG5lZUZQZT02yMGaGOonEYqMNhRbtJL/TNYPnw11aFp+OtlC3GOE tNaXwK8/iTzK3rm9CW9YWWLnMWs5NFCNQQdrzVbmACKftb5W3RE3Cspz1h9A3ZFnkJhg k+Mv8PByIOkfdVrTcyz5G7wBZDSJwwDWCu0fvsVROwf7GLa5b68h/+pf4xxSnFvPblzn ZxdZDs8p79SnKoPVzai3Vr17fzMJhVeZLmdUjgMUBFqk4iYpFy4602YGJEWuDFnuVcqU fH/FWsj/9uLYDnlhlUV9ftltgw3XZWNPZUDgD2FBfxNAzSZcxXXhxNo+lgO9/S0diZsb OJtQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@codeaurora.org header.s=default header.b=brHnMpEa; dkim=pass header.i=@codeaurora.org header.s=default header.b=KeTVqxW4; 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 a10-v6si8902155pfh.312.2018.06.04.06.44.58; Mon, 04 Jun 2018 06:45:13 -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; dkim=pass header.i=@codeaurora.org header.s=default header.b=brHnMpEa; dkim=pass header.i=@codeaurora.org header.s=default header.b=KeTVqxW4; 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 S1753307AbeFDNn6 (ORCPT + 99 others); Mon, 4 Jun 2018 09:43:58 -0400 Received: from smtp.codeaurora.org ([198.145.29.96]:51224 "EHLO smtp.codeaurora.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753291AbeFDNn5 (ORCPT ); Mon, 4 Jun 2018 09:43:57 -0400 Received: by smtp.codeaurora.org (Postfix, from userid 1000) id 8368C6084F; Mon, 4 Jun 2018 13:43:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1528119836; bh=yOqciKrX7sWHq8Mltfp7rN+EAPcdrh7sds6d8LbfLV0=; h=Subject:To:Cc:References:From:Date:In-Reply-To:From; b=brHnMpEaBGbcRh3kT0XA3hqimn7IzkSmWCBhv8Xm0YhY/XRMTozxGDrrbYVFBSb+6 RNpX9EZxllLD4x/YRkBuSY8j1eCQkGmRdvIXZgXrMZ5cKYM/uFtC22IYO9uKS+MbJG gJI9VZzwh+nn0rW58sEv37h4rPnEFf1s208MHTbI= X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on pdx-caf-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.8 required=2.0 tests=ALL_TRUSTED,BAYES_00, DKIM_SIGNED,T_DKIM_INVALID autolearn=no autolearn_force=no version=3.4.0 Received: from [10.204.79.109] (blr-c-bdr-fw-01_globalnat_allzones-outside.qualcomm.com [103.229.19.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: cpandya@smtp.codeaurora.org) by smtp.codeaurora.org (Postfix) with ESMTPSA id 79BA460591; Mon, 4 Jun 2018 13:43:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1528119834; bh=yOqciKrX7sWHq8Mltfp7rN+EAPcdrh7sds6d8LbfLV0=; h=Subject:To:Cc:References:From:Date:In-Reply-To:From; b=KeTVqxW4FTZ4NyqOckj66yOYoYhRpcQgMRoh6yKT9CEsO6n7hHo8i+CgLs2egj2lr wYNGUIIqz3U9lQLxK+NbqdW9T4QWgnffUtzM16TUo3VgUxsazcg6miSjj2XFvTC/kd 1onmNXSYFQENRanaRZKkWk1DXwLtpipfsC8EISR0= DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org 79BA460591 Authentication-Results: pdx-caf-mail.web.codeaurora.org; dmarc=none (p=none dis=none) header.from=codeaurora.org Authentication-Results: pdx-caf-mail.web.codeaurora.org; spf=none smtp.mailfrom=cpandya@codeaurora.org Subject: Re: [PATCH v12 3/5] arm64: pgtable: Add p*d_page_vaddr helper macros To: Will Deacon Cc: catalin.marinas@arm.com, mark.rutland@arm.com, akpm@linux-foundation.org, toshi.kani@hpe.com, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org References: <1527856758-27169-1-git-send-email-cpandya@codeaurora.org> <1527856758-27169-4-git-send-email-cpandya@codeaurora.org> <20180604121351.GJ9482@arm.com> From: Chintan Pandya Message-ID: <28cc339e-b184-5f15-eca3-cf54e9376e01@codeaurora.org> Date: Mon, 4 Jun 2018 19:13:48 +0530 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.8.0 MIME-Version: 1.0 In-Reply-To: <20180604121351.GJ9482@arm.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 6/4/2018 5:43 PM, Will Deacon wrote: > On Fri, Jun 01, 2018 at 06:09:16PM +0530, Chintan Pandya wrote: >> Add helper macros to give virtual references to page >> tables. These will be used while freeing dangling >> page tables. >> >> Signed-off-by: Chintan Pandya >> --- >> arch/arm64/include/asm/pgtable.h | 3 +++ >> 1 file changed, 3 insertions(+) >> >> diff --git a/arch/arm64/include/asm/pgtable.h b/arch/arm64/include/asm/pgtable.h >> index 7c4c8f3..ef4047f 100644 >> --- a/arch/arm64/include/asm/pgtable.h >> +++ b/arch/arm64/include/asm/pgtable.h >> @@ -580,6 +580,9 @@ static inline phys_addr_t pgd_page_paddr(pgd_t pgd) >> >> #endif /* CONFIG_PGTABLE_LEVELS > 3 */ >> >> +#define pmd_page_vaddr(pmd) __va(pmd_page_paddr(pmd)) >> +#define pud_page_vaddr(pud) __va(pud_page_paddr(pud)) > > Are these actually needed, or do pte_offset_kernel and pmd_offset do the > job already? > I introduced these macros for consistency across different arch. Looking at pte_offset_kernel, it seems to use READ_ONCE() which looks little costly for its intended use (in next patch) where we already have dereferenced value. Do you still suggest to remove this ? > Will > Chintan -- Qualcomm India Private Limited, on behalf of Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum, a Linux Foundation Collaborative Project