Received: by 10.213.65.68 with SMTP id h4csp279511imn; Mon, 26 Mar 2018 21:41:37 -0700 (PDT) X-Google-Smtp-Source: AG47ELu1202W3++cCtTMdnHr3tuL1LZrFA+k+864NIwqWK6HplcPpeXcJvccfjQUkFVYhsAePBv6 X-Received: by 2002:a17:902:7401:: with SMTP id g1-v6mr43972076pll.4.1522125697649; Mon, 26 Mar 2018 21:41:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1522125697; cv=none; d=google.com; s=arc-20160816; b=g3gRUo9NH8SIcqnqhJqAz2q1bBw61byfgqKZnoTf8GG+QRnTOmn0ynXnOQ0wdAQOQx oY4LcgbLI1J7rw+iR1N+DOXzwgFTv+YOBaGshDtQk5cvbjR3KNYmg+d+NqdlKdCozCvC NJc7Htkq6MWlLAkvhJ2hWGJ5gPJv8NEtJrK4VE/eNRHs60x7gbD/0eqYdx9qyZGCokEI 9EieZdV2b4irjEI/1bS6cy7LJbmuAykSPJBtUb+jPA5QYeEKbJGxv41xL1z+4d+lcECe oCdveJwAXzhLYbQFz6VRr3XAuebiGK1vOMn3S8QcH0kyFYPPg+Xxb5dmIsO8Ul8kiNb5 LjNA== 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=8ukCtcfUwFUfeHrPkGoUVB+Pkd3M/265nwtm8Z9eTpE=; b=RjI5B1KdRvEZmxglvbzRwbQ6bNtR1j2wUkuKzJcM2Xk6b8wsfzTjhTlXCaM3qgZkSM eZ4O2qQ66TucTKobvwGtRGKRHVn84Yz/Vp8T3l+BznZhw37XzG7GMwyUP9B2y5s9YpvG J+S0hEkpvk/zo0uhh7ydYFI+4BHzqN6PhrNIbIIIKcd+WMiuShmRZK5U4MeMYzjRG1cY iSo8ZrnybOxmHAGaqP/5DCafwP+BY3gaPZghn5S2UEe33oDCopvoBMxGPnykqCNipKdE WoCKPJP5VHt691i1NVGAFyY6KU+kC4ZdebENwTBEUEVsCH0WJiZeXs7YmO80sTgMpsCV GGiA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@codeaurora.org header.s=default header.b=SwlF84w2; dkim=pass header.i=@codeaurora.org header.s=default header.b=miMv6e8h; 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 19si281282pfi.285.2018.03.26.21.41.23; Mon, 26 Mar 2018 21:41:37 -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=SwlF84w2; dkim=pass header.i=@codeaurora.org header.s=default header.b=miMv6e8h; 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 S1751078AbeC0EiQ (ORCPT + 99 others); Tue, 27 Mar 2018 00:38:16 -0400 Received: from smtp.codeaurora.org ([198.145.29.96]:57886 "EHLO smtp.codeaurora.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750914AbeC0EiO (ORCPT ); Tue, 27 Mar 2018 00:38:14 -0400 Received: by smtp.codeaurora.org (Postfix, from userid 1000) id 508A260BFA; Tue, 27 Mar 2018 04:38:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1522125494; bh=QCSKi9rM3CT61GrJ9Tnj9iv7nuPxJ9kLLdneekd3c8Q=; h=Subject:To:Cc:References:From:Date:In-Reply-To:From; b=SwlF84w2ByFwC6owgVxYDgU659hxE/XPApWN4CojTOeoPxumO/oyQko9vyagaUwXP THEZC1Rdttv+HNsspc/ILww8t5zLlf1D2iu5EYdgH3znj5uw17h8rIi5/oY2gLnCJr gW+bv56iC0yRLz+ykcaowgx3Z/L+LfEPwoXf1cts= 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 [192.168.2.11] (unknown [183.83.202.249]) (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 DE5FA6070A; Tue, 27 Mar 2018 04:38:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1522125493; bh=QCSKi9rM3CT61GrJ9Tnj9iv7nuPxJ9kLLdneekd3c8Q=; h=Subject:To:Cc:References:From:Date:In-Reply-To:From; b=miMv6e8hwb8ktlIqj2ZujdPpwp7l9PiCS5uryPX9o3ckbe7H61gCdVSLhuwc8NZsr 04qgR09WAC0W9+MT6m3XJLKrK4SuP4gEsg2kDltC4Zy2nC2ZfbXvr5/vsFlpI2lNPf PjiP52WtzCSTsAOAVdGsBHbmqE8+wkUYLlE7410U= DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org DE5FA6070A 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 v4 2/3] arm64: Implement page table free interfaces To: Mark Rutland Cc: catalin.marinas@arm.com, will.deacon@arm.com, arnd@arndb.de, ard.biesheuvel@linaro.org, marc.zyngier@arm.com, james.morse@arm.com, kristina.martsenko@arm.com, takahiro.akashi@linaro.org, gregkh@linuxfoundation.org, tglx@linutronix.de, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-arch@vger.kernel.org, akpm@linux-foundation.org, toshi.kani@hpe.com References: <1521546314-31753-1-git-send-email-cpandya@codeaurora.org> <1521546314-31753-3-git-send-email-cpandya@codeaurora.org> <20180326095541.izogc4iak6d7nerm@lakrids.cambridge.arm.com> From: Chintan Pandya Message-ID: Date: Tue, 27 Mar 2018 10:08:02 +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: <20180326095541.izogc4iak6d7nerm@lakrids.cambridge.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 3/26/2018 3:25 PM, Mark Rutland wrote: > On Tue, Mar 20, 2018 at 05:15:13PM +0530, Chintan Pandya wrote: >> +static int __pmd_free_pte_page(pmd_t *pmd, unsigned long addr, bool tlb_inv) >> +{ >> + pmd_t *table; >> + >> + if (pmd_val(*pmd)) { >> + table = __va(pmd_val(*pmd)); >> + pmd_clear(pmd); >> + /* >> + * FIXME: __flush_tlb_pgtable(&init_mm, addr) is >> + * ideal candidate here, which exactly >> + * flushes intermediate pgtables. But, >> + * this is broken (evident from tests). >> + * So, use safe TLB op unless that is fixed. >> + */ >> + if (tlb_inv) >> + flush_tlb_kernel_range(addr, addr + PMD_SIZE); > > I don't think that __flush_tlb_pgtable() is broken. It's only valid to > call it for user page tables, since it doesn't affect all ASIDs. > > We can add a simlar helper for kernel mappings, which affects all ASIDs, > e.g. > Okay. I will test it and update v5. > static inline void __flush_tlb_kernel_pgtable(unsigned long addr) > { > addr >>= 12; > __tlbi(vaae1is, addr); > dsb(ish); > } > > Thanks, > Mark. > 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