From: Mark Rutland <mark.rutland@arm.com>
To: Chintan Pandya <cpandya@codeaurora.org>
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
Date: Mon, 26 Mar 2018 10:55:41 +0100 [thread overview]
Message-ID: <20180326095541.izogc4iak6d7nerm@lakrids.cambridge.arm.com> (raw)
In-Reply-To: <1521546314-31753-3-git-send-email-cpandya@codeaurora.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.
next prev parent reply other threads:[~2018-03-26 9:55 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-03-20 11:45 [PATCH v4 0/3] Fix issues with huge mapping in ioremap for ARM64 Chintan Pandya
2018-03-20 11:45 ` [PATCH v4 1/3] ioremap: Update pgtable free interfaces with addr Chintan Pandya
2018-03-20 22:58 ` Kani, Toshi
2018-03-20 11:45 ` [PATCH v4 2/3] arm64: Implement page table free interfaces Chintan Pandya
2018-03-26 9:55 ` Mark Rutland [this message]
2018-03-27 4:38 ` Chintan Pandya
2018-03-20 11:45 ` [PATCH v4 3/3] Revert "arm64: Enforce BBM for huge IO/VMAP mappings" Chintan Pandya
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20180326095541.izogc4iak6d7nerm@lakrids.cambridge.arm.com \
--to=mark.rutland@arm.com \
--cc=akpm@linux-foundation.org \
--cc=ard.biesheuvel@linaro.org \
--cc=arnd@arndb.de \
--cc=catalin.marinas@arm.com \
--cc=cpandya@codeaurora.org \
--cc=gregkh@linuxfoundation.org \
--cc=james.morse@arm.com \
--cc=kristina.martsenko@arm.com \
--cc=linux-arch@vger.kernel.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=marc.zyngier@arm.com \
--cc=takahiro.akashi@linaro.org \
--cc=tglx@linutronix.de \
--cc=toshi.kani@hpe.com \
--cc=will.deacon@arm.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).