From: "Aneesh Kumar K.V" <aneesh.kumar@linux•ibm.com>
To: npiggin@gmail•com, benh@kernel•crashing.org, paulus@samba•org,
mpe@ellerman•id.au
Cc: "Aneesh Kumar K.V" <aneesh.kumar@linux•ibm.com>,
linuxppc-dev@lists•ozlabs.org
Subject: [PATCH v2 4/5] powerpc/mm: Drop the unnecessary region check
Date: Sun, 17 Mar 2019 21:18:26 +0530 [thread overview]
Message-ID: <20190317154827.9188-5-aneesh.kumar@linux.ibm.com> (raw)
In-Reply-To: <20190317154827.9188-1-aneesh.kumar@linux.ibm.com>
All the regions are now mapped with top nibble 0xc. Hence the region id
check is not needed for virt_addr_valid()
Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux•ibm.com>
---
arch/powerpc/include/asm/page.h | 12 ------------
1 file changed, 12 deletions(-)
diff --git a/arch/powerpc/include/asm/page.h b/arch/powerpc/include/asm/page.h
index 918228f2205b..748f5db2e2b7 100644
--- a/arch/powerpc/include/asm/page.h
+++ b/arch/powerpc/include/asm/page.h
@@ -132,19 +132,7 @@ static inline bool pfn_valid(unsigned long pfn)
#define virt_to_page(kaddr) pfn_to_page(virt_to_pfn(kaddr))
#define pfn_to_kaddr(pfn) __va((pfn) << PAGE_SHIFT)
-#ifdef CONFIG_PPC_BOOK3S_64
-/*
- * On hash the vmalloc and other regions alias to the kernel region when passed
- * through __pa(), which virt_to_pfn() uses. That means virt_addr_valid() can
- * return true for some vmalloc addresses, which is incorrect. So explicitly
- * check that the address is in the kernel region.
- */
-/* may be can drop get_region_id */
-#define virt_addr_valid(kaddr) (get_region_id((unsigned long)kaddr) == KERNEL_REGION_ID && \
- pfn_valid(virt_to_pfn(kaddr)))
-#else
#define virt_addr_valid(kaddr) pfn_valid(virt_to_pfn(kaddr))
-#endif
/*
* On Book-E parts we need __va to parse the device tree and we can't
--
2.20.1
next prev parent reply other threads:[~2019-03-17 15:57 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-03-17 15:48 [PATCH v2 0/5] Update hash MMU kernel mapping to be in sync with radix Aneesh Kumar K.V
2019-03-17 15:48 ` [PATCH v2 1/5] powerpc/mm/hash64: Add a variable to track the end of IO mapping Aneesh Kumar K.V
2019-03-17 15:48 ` [PATCH v2 2/5] powerpc/mm/hash64: Map all the kernel regions in the same 0xc range Aneesh Kumar K.V
2019-03-17 15:48 ` [PATCH v2 3/5] powerpc/mm: Validate address values against different region limits Aneesh Kumar K.V
2019-03-17 15:48 ` Aneesh Kumar K.V [this message]
2019-03-17 15:48 ` [PATCH v2 5/5] powerpc/mm/hash: Simplify the region id calculation Aneesh Kumar K.V
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=20190317154827.9188-5-aneesh.kumar@linux.ibm.com \
--to=aneesh.kumar@linux$(echo .)ibm.com \
--cc=benh@kernel$(echo .)crashing.org \
--cc=linuxppc-dev@lists$(echo .)ozlabs.org \
--cc=mpe@ellerman$(echo .)id.au \
--cc=npiggin@gmail$(echo .)com \
--cc=paulus@samba$(echo .)org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
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