Received: by 10.213.65.68 with SMTP id h4csp1201230imn; Mon, 26 Mar 2018 02:56:55 -0700 (PDT) X-Google-Smtp-Source: AIpwx48whhqN7Gwk3e4WA/LYp9a7EMFSBMev3o8qNwS7yq/g9/nnkfzVwCFrcNagXxOIw9VH86Vr X-Received: by 10.98.165.19 with SMTP id v19mr3173277pfm.51.1522058214999; Mon, 26 Mar 2018 02:56:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1522058214; cv=none; d=google.com; s=arc-20160816; b=zCcpIl2fb5E9z1kb16LWeAUNgnEOM9uLHw+yEzWrDqSdh/YsAgdHENxmssCxFugkFZ li5WUxwE839FhAHnPccJiOuQK9hobzTS8XdbBRkPE138OABBFLOgt6wQJf8+FTR36+Wo ZQ/R3ErjqOUDYiKTiYRiShbzWJJS7JRS1b6iTGp+t0UOasVcpRQ5N5JtoGbavo6VeRIo 7pLwLPjWat7bN5nAZk0B/SnCHCruENzQiDwk50treTE34rp19YRZsTn1kPUtP85oLbWB HuGCaSyu0aehCRKKlww3ksGNxR07dbqNqku/CM0UYh2ncfxNNvHqrcCGo3TKcf2Mxk26 amgg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:arc-authentication-results; bh=C0y9YrmK16tOBuS3nnZg9hdGXq6kUltKpYDhtMkifI8=; b=yAMNMU2F23vutkmYowm/7tIDfL3C8OzU4v6dPgcPdCtOiUde9oI6H5zLAKiMIMLz/S zdB7IpD0nBP3tRiPnj3Tg8My3bQgLOcqOYBRgmD9etqBsF1DpH/8svK4Hvr17LEDdQo4 LkQoF9z3imNYRaBFnGtBL1ejOPYVlp8b8fceOydTHEQ+bf6nYUTh/L54gV4SnDq7rUyA PnEUzI2B2Hd6nQbTAIEqk6horwGgAvW7luwqVkqYp0lFrkLoYioXA0zZ9sStc5wob65k Lef1iTb5cFIKAA544vPVU8V9Li1fr/FG5VJQREFr+TPzouJUjz9IEhXU9+bCgq3nOKM/ ToAA== 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 a6-v6si14028164pln.632.2018.03.26.02.56.40; Mon, 26 Mar 2018 02:56:54 -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; 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 S1751134AbeCZJzs (ORCPT + 99 others); Mon, 26 Mar 2018 05:55:48 -0400 Received: from foss.arm.com ([217.140.101.70]:38942 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750972AbeCZJzq (ORCPT ); Mon, 26 Mar 2018 05:55:46 -0400 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 A4DA51435; Mon, 26 Mar 2018 02:55:46 -0700 (PDT) Received: from lakrids.cambridge.arm.com (usa-sjc-imap-foss1.foss.arm.com [10.72.51.249]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 063A43F592; Mon, 26 Mar 2018 02:55:43 -0700 (PDT) Date: Mon, 26 Mar 2018 10:55:41 +0100 From: Mark Rutland To: Chintan Pandya 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 Subject: Re: [PATCH v4 2/3] arm64: Implement page table free interfaces Message-ID: <20180326095541.izogc4iak6d7nerm@lakrids.cambridge.arm.com> References: <1521546314-31753-1-git-send-email-cpandya@codeaurora.org> <1521546314-31753-3-git-send-email-cpandya@codeaurora.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1521546314-31753-3-git-send-email-cpandya@codeaurora.org> User-Agent: NeoMutt/20170113 (1.7.2) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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. static inline void __flush_tlb_kernel_pgtable(unsigned long addr) { addr >>= 12; __tlbi(vaae1is, addr); dsb(ish); } Thanks, Mark.