* [PATCH] pte_special()/pte_mkspecial() support added.
@ 2019-06-18 21:25 Dmitry Korotin
2019-07-22 21:22 ` Paul Burton
0 siblings, 1 reply; 2+ messages in thread
From: Dmitry Korotin @ 2019-06-18 21:25 UTC (permalink / raw)
To: Paul Burton; +Cc: linux-mips, Dmitry Korotin
pte_special()/pte_mkspecial() support added.
Signed-off-by: Dmitry Korotin <dkorotin@wavecomp.com>
---
arch/mips/Kconfig | 1 +
arch/mips/include/asm/pgtable-bits.h | 5 +++++
arch/mips/include/asm/pgtable.h | 13 +++++++++++--
3 files changed, 17 insertions(+), 2 deletions(-)
diff --git a/arch/mips/Kconfig b/arch/mips/Kconfig
index 70d3200..0a46995 100644
--- a/arch/mips/Kconfig
+++ b/arch/mips/Kconfig
@@ -80,6 +80,7 @@ config MIPS
select RTC_LIB
select SYSCTL_EXCEPTION_TRACE
select VIRT_TO_BUS
+ select ARCH_HAS_PTE_SPECIAL
menu "Machine selection"
diff --git a/arch/mips/include/asm/pgtable-bits.h b/arch/mips/include/asm/pgtable-bits.h
index f88a48c..e0158af 100644
--- a/arch/mips/include/asm/pgtable-bits.h
+++ b/arch/mips/include/asm/pgtable-bits.h
@@ -52,6 +52,7 @@ enum pgtable_bits {
_PAGE_WRITE_SHIFT,
_PAGE_ACCESSED_SHIFT,
_PAGE_MODIFIED_SHIFT,
+ _PAGE_SPECIAL_SHIFT,
};
/*
@@ -78,6 +79,7 @@ enum pgtable_bits {
_PAGE_WRITE_SHIFT,
_PAGE_ACCESSED_SHIFT,
_PAGE_MODIFIED_SHIFT,
+ _PAGE_SPECIAL_SHIFT,
};
#elif defined(CONFIG_CPU_R3000) || defined(CONFIG_CPU_TX39XX)
@@ -90,6 +92,7 @@ enum pgtable_bits {
_PAGE_WRITE_SHIFT,
_PAGE_ACCESSED_SHIFT,
_PAGE_MODIFIED_SHIFT,
+ _PAGE_SPECIAL_SHIFT,
/* Used by TLB hardware (placed in EntryLo) */
_PAGE_GLOBAL_SHIFT = 8,
@@ -113,6 +116,7 @@ enum pgtable_bits {
#if defined(CONFIG_64BIT) && defined(CONFIG_MIPS_HUGE_TLB_SUPPORT)
_PAGE_HUGE_SHIFT,
#endif
+ _PAGE_SPECIAL_SHIFT,
/* Used by TLB hardware (placed in EntryLo*) */
#if defined(CONFIG_CPU_HAS_RIXI)
@@ -135,6 +139,7 @@ enum pgtable_bits {
#if defined(CONFIG_64BIT) && defined(CONFIG_MIPS_HUGE_TLB_SUPPORT)
# define _PAGE_HUGE (1 << _PAGE_HUGE_SHIFT)
#endif
+#define _PAGE_SPECIAL (1 << _PAGE_SPECIAL_SHIFT)
/* Used by TLB hardware (placed in EntryLo*) */
#if defined(CONFIG_XPA)
diff --git a/arch/mips/include/asm/pgtable.h b/arch/mips/include/asm/pgtable.h
index 4ccb465..ab66844 100644
--- a/arch/mips/include/asm/pgtable.h
+++ b/arch/mips/include/asm/pgtable.h
@@ -393,8 +393,17 @@ static inline pte_t pte_mkhuge(pte_t pte)
}
#endif /* CONFIG_MIPS_HUGE_TLB_SUPPORT */
#endif
-static inline int pte_special(pte_t pte) { return 0; }
-static inline pte_t pte_mkspecial(pte_t pte) { return pte; }
+
+static inline int pte_special(pte_t pte)
+{
+ return pte_val(pte) & _PAGE_SPECIAL;
+}
+
+static inline pte_t pte_mkspecial(pte_t pte)
+{
+ pte_val(pte) |= _PAGE_SPECIAL;
+ return pte;
+}
/*
* Macro to make mark a page protection value as "uncacheable". Note
--
1.7.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] pte_special()/pte_mkspecial() support added.
2019-06-18 21:25 [PATCH] pte_special()/pte_mkspecial() support added Dmitry Korotin
@ 2019-07-22 21:22 ` Paul Burton
0 siblings, 0 replies; 2+ messages in thread
From: Paul Burton @ 2019-07-22 21:22 UTC (permalink / raw)
To: Dmitry Korotin; +Cc: Paul Burton, linux-mips, Dmitry Korotin, linux-mips
Hello,
Dmitry Korotin wrote:
> pte_special()/pte_mkspecial() support added.
>
> Signed-off-by: Dmitry Korotin <dkorotin@wavecomp.com>
Applied to mips-next.
Thanks,
Paul
[ This message was auto-generated; if you believe anything is incorrect
then please email paul.burton@mips.com to report it. ]
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2019-07-22 21:22 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-06-18 21:25 [PATCH] pte_special()/pte_mkspecial() support added Dmitry Korotin
2019-07-22 21:22 ` Paul Burton
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).