From: Catalin Marinas <catalin.marinas@arm.com>
To: Anshuman Khandual <anshuman.khandual@arm.com>
Cc: linux-mm@kvack.org, linux-arm-kernel@lists.infradead.org,
Will Deacon <will.deacon@arm.com>,
Mark Rutland <mark.rutland@arm.com>,
James Morse <james.morse@arm.com>,
Robin Murphy <robin.murphy@arm.com>
Subject: Re: [PATCH V3 2/2] arm64/mm: Change offset base address in [pud|pmd]_free_[pmd|pte]_page()
Date: Tue, 4 Jun 2019 15:24:06 +0100 [thread overview]
Message-ID: <20190604142405.GI6610@arrakis.emea.arm.com> (raw)
In-Reply-To: <1557377177-20695-3-git-send-email-anshuman.khandual@arm.com>
On Thu, May 09, 2019 at 10:16:17AM +0530, Anshuman Khandual wrote:
> Pgtable page address can be fetched with [pmd|pte]_offset_[kernel] if input
> address is PMD_SIZE or PTE_SIZE aligned. Input address is now guaranteed to
> be aligned, hence fetched pgtable page address is always correct. But using
> 0UL as offset base address has been a standard practice across platforms.
> It also makes more sense as it isolates pgtable page address computation
> from input virtual address alignment. This does not change functionality.
>
> Signed-off-by: Anshuman Khandual <anshuman.khandual@arm.com>
> Cc: Catalin Marinas <catalin.marinas@arm.com>
> Cc: Will Deacon <will.deacon@arm.com>
> Cc: Mark Rutland <mark.rutland@arm.com>
> Cc: James Morse <james.morse@arm.com>
> Cc: Robin Murphy <robin.murphy@arm.com>
> ---
> arch/arm64/mm/mmu.c | 6 +++---
> 1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/arch/arm64/mm/mmu.c b/arch/arm64/mm/mmu.c
> index e97f018ff740..71bcb783aace 100644
> --- a/arch/arm64/mm/mmu.c
> +++ b/arch/arm64/mm/mmu.c
> @@ -1005,7 +1005,7 @@ int pmd_free_pte_page(pmd_t *pmdp, unsigned long addr)
> return 1;
> }
>
> - table = pte_offset_kernel(pmdp, addr);
> + table = pte_offset_kernel(pmdp, 0UL);
> pmd_clear(pmdp);
> __flush_tlb_kernel_pgtable(addr);
> pte_free_kernel(NULL, table);
> @@ -1026,8 +1026,8 @@ int pud_free_pmd_page(pud_t *pudp, unsigned long addr)
> return 1;
> }
>
> - table = pmd_offset(pudp, addr);
> - pmdp = table;
> + table = pmd_offset(pudp, 0UL);
> + pmdp = pmd_offset(pudp, addr);
> next = addr;
> end = addr + PUD_SIZE;
> do {
I have the same comment as last time:
https://lore.kernel.org/linux-arm-kernel/20190430161759.GI29799@arrakis.emea.arm.com/
I don't see why pmdp needs to be different from table. We get the
pointer to a pmd page and we want to iterate over it to free the pte
entries it contains. You can add a VM_WARN on addr alignment as in the
previous version of the patch but pmdp is just an iterator over table.
--
Catalin
next prev parent reply other threads:[~2019-06-04 14:24 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-05-09 4:46 [PATCH V3 0/2] mm/ioremap: Check virtual address alignment Anshuman Khandual
2019-05-09 4:46 ` [PATCH V3 1/2] mm/ioremap: Check virtual address alignment while creating huge mappings Anshuman Khandual
2019-05-13 22:26 ` Kani, Toshi
2019-05-14 5:55 ` Anshuman Khandual
2019-05-15 2:35 ` [PATCH V4] " Anshuman Khandual
2019-05-15 9:46 ` Will Deacon
2019-05-15 10:10 ` Anshuman Khandual
2019-05-16 18:38 ` Kani, Toshi
2019-06-06 13:51 ` Catalin Marinas
2019-05-09 4:46 ` [PATCH V3 2/2] arm64/mm: Change offset base address in [pud|pmd]_free_[pmd|pte]_page() Anshuman Khandual
2019-06-03 15:36 ` Catalin Marinas
2019-06-06 8:08 ` Anshuman Khandual
2019-06-04 14:24 ` Catalin Marinas [this message]
2019-06-06 4:44 ` Anshuman Khandual
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=20190604142405.GI6610@arrakis.emea.arm.com \
--to=catalin.marinas@arm.com \
--cc=anshuman.khandual@arm.com \
--cc=james.morse@arm.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-mm@kvack.org \
--cc=mark.rutland@arm.com \
--cc=robin.murphy@arm.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).