From: Florian Fainelli <f.fainelli@gmail.com>
To: linux-mips@vger.kernel.org
Cc: fancer.lancer@gmail.com, gerg@kernel.org,
Florian Fainelli <f.fainelli@gmail.com>,
Thomas Bogendoerfer <tsbogend@alpha.franken.de>,
linux-kernel@vger.kernel.org (open list)
Subject: [RFC] MIPS: Enable ARCH_HAS_DEBUG_VIRTUAL for 64-bit
Date: Thu, 7 Jul 2022 15:04:27 -0700 [thread overview]
Message-ID: <20220707220428.1731083-1-f.fainelli@gmail.com> (raw)
Update __debug_virt_addr_valid() to check for a virtual address'
validity below CKSSEG and remove the !64BIT dependency on
ARCH_HAS_DEBUG_VIRTUAL to make DEBUG_VIRTUAL selectable.
Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
---
This requires the previous patch to be applied for this to work cleanly.
arch/mips/Kconfig | 2 +-
arch/mips/mm/physaddr.c | 4 ++++
2 files changed, 5 insertions(+), 1 deletion(-)
diff --git a/arch/mips/Kconfig b/arch/mips/Kconfig
index db09d45d59ec..ddb6bde8fa1f 100644
--- a/arch/mips/Kconfig
+++ b/arch/mips/Kconfig
@@ -5,7 +5,7 @@ config MIPS
select ARCH_32BIT_OFF_T if !64BIT
select ARCH_BINFMT_ELF_STATE if MIPS_FP_SUPPORT
select ARCH_HAS_CURRENT_STACK_POINTER if !CC_IS_CLANG || CLANG_VERSION >= 140000
- select ARCH_HAS_DEBUG_VIRTUAL if !64BIT
+ select ARCH_HAS_DEBUG_VIRTUAL
select ARCH_HAS_FORTIFY_SOURCE
select ARCH_HAS_KCOV
select ARCH_HAS_NON_OVERLAPPING_ADDRESS_SPACE if !EVA
diff --git a/arch/mips/mm/physaddr.c b/arch/mips/mm/physaddr.c
index a82f8f57a652..3076238943d3 100644
--- a/arch/mips/mm/physaddr.c
+++ b/arch/mips/mm/physaddr.c
@@ -31,7 +31,11 @@ static inline bool __debug_virt_addr_valid(unsigned long x)
if (x == MAX_DMA_ADDRESS)
return true;
+#ifdef CONFIG_64BIT
+ return KSEGX(x) < CKSSEG;
+#else
return KSEGX(x) < KSEG2;
+#endif
}
phys_addr_t __virt_to_phys(volatile const void *x)
--
2.25.1
next reply other threads:[~2022-07-07 22:04 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-07-07 22:04 Florian Fainelli [this message]
2022-07-11 8:39 ` [RFC] MIPS: Enable ARCH_HAS_DEBUG_VIRTUAL for 64-bit Thomas Bogendoerfer
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=20220707220428.1731083-1-f.fainelli@gmail.com \
--to=f.fainelli@gmail.com \
--cc=fancer.lancer@gmail.com \
--cc=gerg@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mips@vger.kernel.org \
--cc=tsbogend@alpha.franken.de \
/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).