Received: by 10.213.65.68 with SMTP id h4csp176944imn; Tue, 20 Mar 2018 00:05:45 -0700 (PDT) X-Google-Smtp-Source: AG47ELsAmCiQNljkC8a5NaPntbms8sdlSI8OKC1SuBQ/xZGFHaE60Tas9E6DnG+CKRTVSFi1KBrA X-Received: by 10.101.87.201 with SMTP id q9mr11455728pgr.215.1521529545347; Tue, 20 Mar 2018 00:05:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1521529545; cv=none; d=google.com; s=arc-20160816; b=iT59K8Bvh6r4b0UTMvnRUVV4LqtqWB6LAdEfMalCeg378lUZ/BEUakc6hcpFXZuhCp JboLL6PLoNSvrxkV6gnbYmocw4Hfk1snn8Vr9uKhgVbg58UtlhQtgyx3cRFR4W4MxI/9 9BW6wqKxOG+E8JlefDX5vSd721RB7meqrhZ/IZVfhMqb3glTl3yW8WneXu3PsJVZJe5g B4ufh1qZ5+ZjHoYhCa+0CzFcgNsqQAnF8Q6lwtyVnjntVWyyC0uzd/rYdpyha+71zWe+ Cs9EmaR3RHy1elx9drGryHV/eM8+uyfQ56C26b79JCFbf4iAI8wTCux2t4t2f5d09pD9 5d9Q== 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=NOFW6CQGcNobS3cBZujJ7yWEunqyZ1j+E5zJt8VQubw=; b=Vr+t3ZtTXiHi8bRkHth/jy2GLLR/b+5C1xPjQstpXWZD2g8v5ewAz+pf7ZlydXi/eF 8UTcaGX1klT9W7FjrfZgHqJCP2s+XXm66FPHKNSR2mOqMpam5pF6ovLZu3xod4P+5eP6 G0/CkUzqcHKAD8il1eD8QxV2ySUO+hi2VL1nLNkWuVBJjz0X1yRMFQPrPxbGSlSYNbxv 1E21zKqHYYfwSwLSaI/cHgR6H9qABOdmd6yFGDtB6fsAcp3n9n6Nn9G+nt72zF/6UhdS mNLtrcPKlwfvyMoh0p/BUiOzsa2JdgDU5UkLcQMLZFJcy/4wFiAuMTVUV/RSIP0B34do 4i9w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@codeaurora.org header.s=default header.b=hrZhb054; dkim=pass header.i=@codeaurora.org header.s=default header.b=IRwJ5jeK; 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 z5si838796pfz.382.2018.03.20.00.05.30; Tue, 20 Mar 2018 00:05:45 -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=hrZhb054; dkim=pass header.i=@codeaurora.org header.s=default header.b=IRwJ5jeK; 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 S1751391AbeCTHEg (ORCPT + 99 others); Tue, 20 Mar 2018 03:04:36 -0400 Received: from smtp.codeaurora.org ([198.145.29.96]:52272 "EHLO smtp.codeaurora.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750888AbeCTHEd (ORCPT ); Tue, 20 Mar 2018 03:04:33 -0400 Received: by smtp.codeaurora.org (Postfix, from userid 1000) id 4A45A60128; Tue, 20 Mar 2018 07:04:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1521529473; bh=95W09RXfxZ6XW/AVAtcc7eIDR/ROMEYJl4GW7XWK0Xw=; h=Subject:To:Cc:References:From:Date:In-Reply-To:From; b=hrZhb054SZzwk8cS9P+5tlIMlpr64XO6iAAbS0wTP4+3mj6GG/nrFzYrOrMxNaLTt Wdoscr1LIkz01PWFrheONeSAY5zOOW3bcLRNkUNNAaockPqLcYkXpGe1D047tK0pVR uV4YWPQRIH8ZFFyVQVfKft5xl6aPz8KnKL+aR49U= 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 A340060314; Tue, 20 Mar 2018 07:04:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1521529472; bh=95W09RXfxZ6XW/AVAtcc7eIDR/ROMEYJl4GW7XWK0Xw=; h=Subject:To:Cc:References:From:Date:In-Reply-To:From; b=IRwJ5jeK3tJz1jdIaeRLPbpn66otcfzETGKvUVrc3bJ2g1ZIz+jhJDmK00iXb8b8w Vg94nhPfn/1+sY2/drqGq650QCw/XazHCAAo1Gvx6M+ejdHSqdy/aHa/IuyT88AICK qAzTMxxPJ871Lv5DT5be9ocm5fvFbDaykWtOZ41A= DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org A340060314 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 v3 1/3] ioremap: Update pgtable free interfaces with addr To: "Kani, Toshi" , "mark.rutland@arm.com" , "catalin.marinas@arm.com" , "will.deacon@arm.com" Cc: "linux-kernel@vger.kernel.org" , "ard.biesheuvel@linaro.org" , "tglx@linutronix.de" , "takahiro.akashi@linaro.org" , "james.morse@arm.com" , "kristina.martsenko@arm.com" , "akpm@linux-foundation.org" , "gregkh@linuxfoundation.org" , "linux-arm-kernel@lists.infradead.org" , "marc.zyngier@arm.com" , "arnd@arndb.de" , "linux-arch@vger.kernel.org" References: <1521463256-19858-1-git-send-email-cpandya@codeaurora.org> <1521463256-19858-2-git-send-email-cpandya@codeaurora.org> <1521486096.2693.202.camel@hpe.com> From: Chintan Pandya Message-ID: <472bb600-9387-7fc7-3a2e-26579d785ce6@codeaurora.org> Date: Tue, 20 Mar 2018 12:34:20 +0530 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.6.0 MIME-Version: 1.0 In-Reply-To: <1521486096.2693.202.camel@hpe.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 3/20/2018 12:31 AM, Kani, Toshi wrote: > On Mon, 2018-03-19 at 18:10 +0530, Chintan Pandya wrote: >> This patch ("mm/vmalloc: Add interfaces to free unmapped >> page table") adds following 2 interfaces to free the page >> table in case we implement huge mapping. >> >> pud_free_pmd_page() and pmd_free_pte_page() >> >> Some architectures (like arm64) needs to do proper TLB >> maintanance after updating pagetable entry even in map. >> Why ? Read this, >> https://patchwork.kernel.org/patch/10134581/ >> >> Pass 'addr' in these interfaces so that proper TLB ops >> can be performed. >> >> Signed-off-by: Chintan Pandya > : >> diff --git a/arch/x86/mm/pgtable.c b/arch/x86/mm/pgtable.c >> index 34cda7e..20b0322 100644 >> --- a/arch/x86/mm/pgtable.c >> +++ b/arch/x86/mm/pgtable.c >> @@ -710,7 +710,7 @@ int pmd_clear_huge(pmd_t *pmd) >> * Context: The pud range has been unmaped and TLB purged. >> * Return: 1 if clearing the entry succeeded. 0 otherwise. >> */ >> -int pud_free_pmd_page(pud_t *pud) >> +int pud_free_pmd_page(pud_t *pud, unsigned long addr) > > Please update the function header as well. Same for pmd. > > + * @addr: Virtual address associated with pud. Noted. > > --- a/include/asm-generic/pgtable.h >> +++ b/include/asm-generic/pgtable.h >> @@ -983,8 +983,8 @@ static inline int p4d_clear_huge(p4d_t *p4d) >> int pmd_set_huge(pmd_t *pmd, phys_addr_t addr, pgprot_t prot); >> int pud_clear_huge(pud_t *pud); >> int pmd_clear_huge(pmd_t *pmd); >> -int pud_free_pmd_page(pud_t *pud); >> -int pmd_free_pte_page(pmd_t *pmd); >> +int pud_free_pmd_page(pud_t *pud, unsigned long addr); >> +int pmd_free_pte_page(pmd_t *pmd, unsigned long addr); >> #else /* !CONFIG_HAVE_ARCH_HUGE_VMAP */ >> static inline int p4d_set_huge(p4d_t *p4d, phys_addr_t addr, pgprot_t > prot) >> { >> @@ -1010,11 +1010,11 @@ static inline int pmd_clear_huge(pmd_t *pmd) >> { >> return 0; >> } >> -static inline int pud_free_pmd_page(pud_t *pud) >> +static inline int pud_free_pmd_page(pud_t *pud, unsigned long addr) >> { >> return 0; >> } >> -static inline int pmd_free_pte_page(pud_t *pmd) >> +static inline int pmd_free_pte_page(pud_t *pmd, unsigned long addr) > > Please base your patches on top of the mm tree or at least pick up > 8cab93de994f6 in the mm tree. Andrew fixed the typo; the 'pud_t' above > should have been 'pmd_t'. Right. Noted. > > Thanks, > -Toshi > 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