From: Anshuman Khandual <anshuman.khandual@arm.com>
To: linux-mm@kvack.org, linux-arm-kernel@lists.infradead.org
Cc: Anshuman Khandual <anshuman.khandual@arm.com>,
Catalin Marinas <catalin.marinas@arm.com>,
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: [PATCH V3 2/2] arm64/mm: Change offset base address in [pud|pmd]_free_[pmd|pte]_page()
Date: Thu, 9 May 2019 10:16:17 +0530 [thread overview]
Message-ID: <1557377177-20695-3-git-send-email-anshuman.khandual@arm.com> (raw)
In-Reply-To: <1557377177-20695-1-git-send-email-anshuman.khandual@arm.com>
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 {
--
2.20.1
next prev parent reply other threads:[~2019-05-09 4:47 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 ` Anshuman Khandual [this message]
2019-06-03 15:36 ` [PATCH V3 2/2] arm64/mm: Change offset base address in [pud|pmd]_free_[pmd|pte]_page() Catalin Marinas
2019-06-06 8:08 ` Anshuman Khandual
2019-06-04 14:24 ` Catalin Marinas
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=1557377177-20695-3-git-send-email-anshuman.khandual@arm.com \
--to=anshuman.khandual@arm.com \
--cc=catalin.marinas@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).