It would be nice to be able to modify mmu_context functions or add a
hook without updating all architectures, many of which will be no-ops.
The motivation for this series is a change to lazy mmu handling, but
this series stands on its own as a good cleanup whether or not we end
up making that change.
Arnd, is this something you could take through your asm-generic tree?
(assuming arch maintainers are okay with it)
Thanks,
Nick
Since v1:
- Added acks and feedback from various people.
- Fixed a nommu build error caught by ktp.
- Dropped unicore32.
Nicholas Piggin (23):
asm-generic: add generic MMU versions of mmu context functions
alpha: use asm-generic/mmu_context.h for no-op implementations
arc: use asm-generic/mmu_context.h for no-op implementations
arm: use asm-generic/mmu_context.h for no-op implementations
arm64: use asm-generic/mmu_context.h for no-op implementations
csky: use asm-generic/mmu_context.h for no-op implementations
hexagon: use asm-generic/mmu_context.h for no-op implementations
ia64: use asm-generic/mmu_context.h for no-op implementations
m68k: use asm-generic/mmu_context.h for no-op implementations
microblaze: use asm-generic/mmu_context.h for no-op implementations
mips: use asm-generic/mmu_context.h for no-op implementations
nds32: use asm-generic/mmu_context.h for no-op implementations
nios2: use asm-generic/mmu_context.h for no-op implementations
openrisc: use asm-generic/mmu_context.h for no-op implementations
parisc: use asm-generic/mmu_context.h for no-op implementations
powerpc: use asm-generic/mmu_context.h for no-op implementations
riscv: use asm-generic/mmu_context.h for no-op implementations
s390: use asm-generic/mmu_context.h for no-op implementations
sh: use asm-generic/mmu_context.h for no-op implementations
sparc: use asm-generic/mmu_context.h for no-op implementations
um: use asm-generic/mmu_context.h for no-op implementations
x86: use asm-generic/mmu_context.h for no-op implementations
xtensa: use asm-generic/mmu_context.h for no-op implementations
arch/alpha/include/asm/mmu_context.h | 12 ++---
arch/arc/include/asm/mmu_context.h | 17 +++---
arch/arm/include/asm/mmu_context.h | 26 ++-------
arch/arm64/include/asm/mmu_context.h | 9 ++--
arch/csky/include/asm/mmu_context.h | 8 ++-
arch/hexagon/include/asm/mmu_context.h | 33 ++----------
arch/ia64/include/asm/mmu_context.h | 17 ++----
arch/m68k/include/asm/mmu_context.h | 47 +++-------------
arch/microblaze/include/asm/mmu_context.h | 2 +-
arch/microblaze/include/asm/mmu_context_mm.h | 8 +--
arch/microblaze/include/asm/processor.h | 3 --
arch/mips/include/asm/mmu_context.h | 11 ++--
arch/nds32/include/asm/mmu_context.h | 10 +---
arch/nios2/include/asm/mmu_context.h | 21 ++------
arch/openrisc/include/asm/mmu_context.h | 8 ++-
arch/parisc/include/asm/mmu_context.h | 12 ++---
arch/powerpc/include/asm/mmu_context.h | 22 +++-----
arch/riscv/include/asm/mmu_context.h | 22 +-------
arch/s390/include/asm/mmu_context.h | 9 ++--
arch/sh/include/asm/mmu_context.h | 7 ++-
arch/sh/include/asm/mmu_context_32.h | 9 ----
arch/sparc/include/asm/mmu_context_32.h | 10 ++--
arch/sparc/include/asm/mmu_context_64.h | 10 ++--
arch/um/include/asm/mmu_context.h | 12 ++---
arch/x86/include/asm/mmu_context.h | 6 +++
arch/xtensa/include/asm/mmu_context.h | 11 ++--
arch/xtensa/include/asm/nommu_context.h | 26 +--------
include/asm-generic/mmu_context.h | 57 +++++++++++++++-----
include/asm-generic/nommu_context.h | 19 +++++++
29 files changed, 166 insertions(+), 298 deletions(-)
create mode 100644 include/asm-generic/nommu_context.h
--
2.23.0
Cc: Richard Henderson <[email protected]>
Cc: Ivan Kokshaysky <[email protected]>
Cc: Matt Turner <[email protected]>
Cc: [email protected]
Signed-off-by: Nicholas Piggin <[email protected]>
---
arch/alpha/include/asm/mmu_context.h | 12 ++++--------
1 file changed, 4 insertions(+), 8 deletions(-)
diff --git a/arch/alpha/include/asm/mmu_context.h b/arch/alpha/include/asm/mmu_context.h
index 6d7d9bc1b4b8..4eea7c616992 100644
--- a/arch/alpha/include/asm/mmu_context.h
+++ b/arch/alpha/include/asm/mmu_context.h
@@ -214,8 +214,6 @@ ev4_activate_mm(struct mm_struct *prev_mm, struct mm_struct *next_mm)
tbiap();
}
-#define deactivate_mm(tsk,mm) do { } while (0)
-
#ifdef CONFIG_ALPHA_GENERIC
# define switch_mm(a,b,c) alpha_mv.mv_switch_mm((a),(b),(c))
# define activate_mm(x,y) alpha_mv.mv_activate_mm((x),(y))
@@ -229,6 +227,7 @@ ev4_activate_mm(struct mm_struct *prev_mm, struct mm_struct *next_mm)
# endif
#endif
+#define init_new_context init_new_context
static inline int
init_new_context(struct task_struct *tsk, struct mm_struct *mm)
{
@@ -242,12 +241,7 @@ init_new_context(struct task_struct *tsk, struct mm_struct *mm)
return 0;
}
-extern inline void
-destroy_context(struct mm_struct *mm)
-{
- /* Nothing to do. */
-}
-
+#define enter_lazy_tlb enter_lazy_tlb
static inline void
enter_lazy_tlb(struct mm_struct *mm, struct task_struct *tsk)
{
@@ -255,6 +249,8 @@ enter_lazy_tlb(struct mm_struct *mm, struct task_struct *tsk)
= ((unsigned long)mm->pgd - IDENT_ADDR) >> PAGE_SHIFT;
}
+#include <asm-generic/mmu_context.h>
+
#ifdef __MMU_EXTERN_INLINE
#undef __EXTERN_INLINE
#undef __MMU_EXTERN_INLINE
--
2.23.0
Cc: Heiko Carstens <[email protected]>
Cc: Vasily Gorbik <[email protected]>
Cc: Christian Borntraeger <[email protected]>
Cc: [email protected]
Signed-off-by: Nicholas Piggin <[email protected]>
---
arch/s390/include/asm/mmu_context.h | 9 ++++-----
1 file changed, 4 insertions(+), 5 deletions(-)
diff --git a/arch/s390/include/asm/mmu_context.h b/arch/s390/include/asm/mmu_context.h
index c9f3d8a52756..66f9cf0a07e3 100644
--- a/arch/s390/include/asm/mmu_context.h
+++ b/arch/s390/include/asm/mmu_context.h
@@ -15,6 +15,7 @@
#include <asm/ctl_reg.h>
#include <asm-generic/mm_hooks.h>
+#define init_new_context init_new_context
static inline int init_new_context(struct task_struct *tsk,
struct mm_struct *mm)
{
@@ -69,8 +70,6 @@ static inline int init_new_context(struct task_struct *tsk,
return 0;
}
-#define destroy_context(mm) do { } while (0)
-
static inline void set_user_asce(struct mm_struct *mm)
{
S390_lowcore.user_asce = mm->context.asce;
@@ -125,9 +124,7 @@ static inline void finish_arch_post_lock_switch(void)
set_fs(current->thread.mm_segment);
}
-#define enter_lazy_tlb(mm,tsk) do { } while (0)
-#define deactivate_mm(tsk,mm) do { } while (0)
-
+#define activate_mm activate_mm
static inline void activate_mm(struct mm_struct *prev,
struct mm_struct *next)
{
@@ -136,4 +133,6 @@ static inline void activate_mm(struct mm_struct *prev,
set_user_asce(next);
}
+#include <asm-generic/mmu_context.h>
+
#endif /* __S390_MMU_CONTEXT_H */
--
2.23.0
Cc: "James E.J. Bottomley" <[email protected]>
Cc: Helge Deller <[email protected]>
Cc: [email protected]
Signed-off-by: Nicholas Piggin <[email protected]>
---
arch/parisc/include/asm/mmu_context.h | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/arch/parisc/include/asm/mmu_context.h b/arch/parisc/include/asm/mmu_context.h
index cb5f2f730421..46f8c22c5977 100644
--- a/arch/parisc/include/asm/mmu_context.h
+++ b/arch/parisc/include/asm/mmu_context.h
@@ -7,16 +7,13 @@
#include <linux/atomic.h>
#include <asm-generic/mm_hooks.h>
-static inline void enter_lazy_tlb(struct mm_struct *mm, struct task_struct *tsk)
-{
-}
-
/* on PA-RISC, we actually have enough contexts to justify an allocator
* for them. prumpf */
extern unsigned long alloc_sid(void);
extern void free_sid(unsigned long);
+#define init_new_context init_new_context
static inline int
init_new_context(struct task_struct *tsk, struct mm_struct *mm)
{
@@ -26,6 +23,7 @@ init_new_context(struct task_struct *tsk, struct mm_struct *mm)
return 0;
}
+#define destroy_context destroy_context
static inline void
destroy_context(struct mm_struct *mm)
{
@@ -71,8 +69,7 @@ static inline void switch_mm(struct mm_struct *prev,
}
#define switch_mm_irqs_off switch_mm_irqs_off
-#define deactivate_mm(tsk,mm) do { } while (0)
-
+#define activate_mm activate_mm
static inline void activate_mm(struct mm_struct *prev, struct mm_struct *next)
{
/*
@@ -90,4 +87,7 @@ static inline void activate_mm(struct mm_struct *prev, struct mm_struct *next)
switch_mm(prev,next,current);
}
+
+#include <asm-generic/mmu_context.h>
+
#endif
--
2.23.0
Cc: Michal Simek <[email protected]>
Signed-off-by: Nicholas Piggin <[email protected]>
---
arch/microblaze/include/asm/mmu_context_mm.h | 8 ++++----
arch/microblaze/include/asm/processor.h | 3 ---
2 files changed, 4 insertions(+), 7 deletions(-)
diff --git a/arch/microblaze/include/asm/mmu_context_mm.h b/arch/microblaze/include/asm/mmu_context_mm.h
index a1c7dd48454c..c2c77f708455 100644
--- a/arch/microblaze/include/asm/mmu_context_mm.h
+++ b/arch/microblaze/include/asm/mmu_context_mm.h
@@ -33,10 +33,6 @@
to represent all kernel pages as shared among all contexts.
*/
-static inline void enter_lazy_tlb(struct mm_struct *mm, struct task_struct *tsk)
-{
-}
-
# define NO_CONTEXT 256
# define LAST_CONTEXT 255
# define FIRST_CONTEXT 1
@@ -105,6 +101,7 @@ static inline void get_mmu_context(struct mm_struct *mm)
/*
* We're finished using the context for an address space.
*/
+#define destroy_context destroy_context
static inline void destroy_context(struct mm_struct *mm)
{
if (mm->context != NO_CONTEXT) {
@@ -126,6 +123,7 @@ static inline void switch_mm(struct mm_struct *prev, struct mm_struct *next,
* After we have set current->mm to a new value, this activates
* the context for the new mm so we see the new mappings.
*/
+#define activate_mm activate_mm
static inline void activate_mm(struct mm_struct *active_mm,
struct mm_struct *mm)
{
@@ -136,5 +134,7 @@ static inline void activate_mm(struct mm_struct *active_mm,
extern void mmu_context_init(void);
+#include <asm-generic/mmu_context.h>
+
# endif /* __KERNEL__ */
#endif /* _ASM_MICROBLAZE_MMU_CONTEXT_H */
diff --git a/arch/microblaze/include/asm/processor.h b/arch/microblaze/include/asm/processor.h
index 1ff5a82b76b6..616211871a6e 100644
--- a/arch/microblaze/include/asm/processor.h
+++ b/arch/microblaze/include/asm/processor.h
@@ -122,9 +122,6 @@ unsigned long get_wchan(struct task_struct *p);
# define KSTK_EIP(task) (task_pc(task))
# define KSTK_ESP(task) (task_sp(task))
-/* FIXME */
-# define deactivate_mm(tsk, mm) do { } while (0)
-
# define STACK_TOP TASK_SIZE
# define STACK_TOP_MAX STACK_TOP
--
2.23.0
On Wed, Aug 26, 2020 at 4:53 PM Nicholas Piggin <[email protected]> wrote:
>
> It would be nice to be able to modify mmu_context functions or add a
> hook without updating all architectures, many of which will be no-ops.
>
> The motivation for this series is a change to lazy mmu handling, but
> this series stands on its own as a good cleanup whether or not we end
> up making that change.
>
> Arnd, is this something you could take through your asm-generic tree?
> (assuming arch maintainers are okay with it)
Yes, I can definitely take this. The patches all look good to me, so
feel free to add "Acked-by: Arnd Bergmann <[email protected]" if you
like (not really needed if I merge them later though) and send me a
pull request once you feel you have collected enough Ack from others.
Arnd
On 26.08.20 16:52, Nicholas Piggin wrote:
> Cc: "James E.J. Bottomley" <[email protected]>
> Cc: Helge Deller <[email protected]>
> Cc: [email protected]
> Signed-off-by: Nicholas Piggin <[email protected]>
Acked-by: Helge Deller <[email protected]>
> ---
> arch/parisc/include/asm/mmu_context.h | 12 ++++++------
> 1 file changed, 6 insertions(+), 6 deletions(-)
>
> diff --git a/arch/parisc/include/asm/mmu_context.h b/arch/parisc/include/asm/mmu_context.h
> index cb5f2f730421..46f8c22c5977 100644
> --- a/arch/parisc/include/asm/mmu_context.h
> +++ b/arch/parisc/include/asm/mmu_context.h
> @@ -7,16 +7,13 @@
> #include <linux/atomic.h>
> #include <asm-generic/mm_hooks.h>
>
> -static inline void enter_lazy_tlb(struct mm_struct *mm, struct task_struct *tsk)
> -{
> -}
> -
> /* on PA-RISC, we actually have enough contexts to justify an allocator
> * for them. prumpf */
>
> extern unsigned long alloc_sid(void);
> extern void free_sid(unsigned long);
>
> +#define init_new_context init_new_context
> static inline int
> init_new_context(struct task_struct *tsk, struct mm_struct *mm)
> {
> @@ -26,6 +23,7 @@ init_new_context(struct task_struct *tsk, struct mm_struct *mm)
> return 0;
> }
>
> +#define destroy_context destroy_context
> static inline void
> destroy_context(struct mm_struct *mm)
> {
> @@ -71,8 +69,7 @@ static inline void switch_mm(struct mm_struct *prev,
> }
> #define switch_mm_irqs_off switch_mm_irqs_off
>
> -#define deactivate_mm(tsk,mm) do { } while (0)
> -
> +#define activate_mm activate_mm
> static inline void activate_mm(struct mm_struct *prev, struct mm_struct *next)
> {
> /*
> @@ -90,4 +87,7 @@ static inline void activate_mm(struct mm_struct *prev, struct mm_struct *next)
>
> switch_mm(prev,next,current);
> }
> +
> +#include <asm-generic/mmu_context.h>
> +
> #endif
>
On Thu, Aug 27, 2020 at 12:52:26AM +1000, Nicholas Piggin wrote:
> It would be nice to be able to modify mmu_context functions or add a
> hook without updating all architectures, many of which will be no-ops.
>
> The motivation for this series is a change to lazy mmu handling, but
> this series stands on its own as a good cleanup whether or not we end
> up making that change.
I really like this series, I just have some small comments in reply to
patch 1, otherwise feel free to add
Acked-by: Mike Rapoport <[email protected]>
> Arnd, is this something you could take through your asm-generic tree?
> (assuming arch maintainers are okay with it)
>
> Thanks,
> Nick
>
> Since v1:
> - Added acks and feedback from various people.
> - Fixed a nommu build error caught by ktp.
> - Dropped unicore32.
>
> Nicholas Piggin (23):
> asm-generic: add generic MMU versions of mmu context functions
> alpha: use asm-generic/mmu_context.h for no-op implementations
> arc: use asm-generic/mmu_context.h for no-op implementations
> arm: use asm-generic/mmu_context.h for no-op implementations
> arm64: use asm-generic/mmu_context.h for no-op implementations
> csky: use asm-generic/mmu_context.h for no-op implementations
> hexagon: use asm-generic/mmu_context.h for no-op implementations
> ia64: use asm-generic/mmu_context.h for no-op implementations
> m68k: use asm-generic/mmu_context.h for no-op implementations
> microblaze: use asm-generic/mmu_context.h for no-op implementations
> mips: use asm-generic/mmu_context.h for no-op implementations
> nds32: use asm-generic/mmu_context.h for no-op implementations
> nios2: use asm-generic/mmu_context.h for no-op implementations
> openrisc: use asm-generic/mmu_context.h for no-op implementations
> parisc: use asm-generic/mmu_context.h for no-op implementations
> powerpc: use asm-generic/mmu_context.h for no-op implementations
> riscv: use asm-generic/mmu_context.h for no-op implementations
> s390: use asm-generic/mmu_context.h for no-op implementations
> sh: use asm-generic/mmu_context.h for no-op implementations
> sparc: use asm-generic/mmu_context.h for no-op implementations
> um: use asm-generic/mmu_context.h for no-op implementations
> x86: use asm-generic/mmu_context.h for no-op implementations
> xtensa: use asm-generic/mmu_context.h for no-op implementations
>
> arch/alpha/include/asm/mmu_context.h | 12 ++---
> arch/arc/include/asm/mmu_context.h | 17 +++---
> arch/arm/include/asm/mmu_context.h | 26 ++-------
> arch/arm64/include/asm/mmu_context.h | 9 ++--
> arch/csky/include/asm/mmu_context.h | 8 ++-
> arch/hexagon/include/asm/mmu_context.h | 33 ++----------
> arch/ia64/include/asm/mmu_context.h | 17 ++----
> arch/m68k/include/asm/mmu_context.h | 47 +++-------------
> arch/microblaze/include/asm/mmu_context.h | 2 +-
> arch/microblaze/include/asm/mmu_context_mm.h | 8 +--
> arch/microblaze/include/asm/processor.h | 3 --
> arch/mips/include/asm/mmu_context.h | 11 ++--
> arch/nds32/include/asm/mmu_context.h | 10 +---
> arch/nios2/include/asm/mmu_context.h | 21 ++------
> arch/openrisc/include/asm/mmu_context.h | 8 ++-
> arch/parisc/include/asm/mmu_context.h | 12 ++---
> arch/powerpc/include/asm/mmu_context.h | 22 +++-----
> arch/riscv/include/asm/mmu_context.h | 22 +-------
> arch/s390/include/asm/mmu_context.h | 9 ++--
> arch/sh/include/asm/mmu_context.h | 7 ++-
> arch/sh/include/asm/mmu_context_32.h | 9 ----
> arch/sparc/include/asm/mmu_context_32.h | 10 ++--
> arch/sparc/include/asm/mmu_context_64.h | 10 ++--
> arch/um/include/asm/mmu_context.h | 12 ++---
> arch/x86/include/asm/mmu_context.h | 6 +++
> arch/xtensa/include/asm/mmu_context.h | 11 ++--
> arch/xtensa/include/asm/nommu_context.h | 26 +--------
> include/asm-generic/mmu_context.h | 57 +++++++++++++++-----
> include/asm-generic/nommu_context.h | 19 +++++++
> 29 files changed, 166 insertions(+), 298 deletions(-)
> create mode 100644 include/asm-generic/nommu_context.h
>
> --
> 2.23.0
>
>
--
Sincerely yours,
Mike.
On 26. 08. 20 16:52, Nicholas Piggin wrote:
> Cc: Michal Simek <[email protected]>
> Signed-off-by: Nicholas Piggin <[email protected]>
> ---
> arch/microblaze/include/asm/mmu_context_mm.h | 8 ++++----
> arch/microblaze/include/asm/processor.h | 3 ---
> 2 files changed, 4 insertions(+), 7 deletions(-)
>
> diff --git a/arch/microblaze/include/asm/mmu_context_mm.h b/arch/microblaze/include/asm/mmu_context_mm.h
> index a1c7dd48454c..c2c77f708455 100644
> --- a/arch/microblaze/include/asm/mmu_context_mm.h
> +++ b/arch/microblaze/include/asm/mmu_context_mm.h
> @@ -33,10 +33,6 @@
> to represent all kernel pages as shared among all contexts.
> */
>
> -static inline void enter_lazy_tlb(struct mm_struct *mm, struct task_struct *tsk)
> -{
> -}
> -
> # define NO_CONTEXT 256
> # define LAST_CONTEXT 255
> # define FIRST_CONTEXT 1
> @@ -105,6 +101,7 @@ static inline void get_mmu_context(struct mm_struct *mm)
> /*
> * We're finished using the context for an address space.
> */
> +#define destroy_context destroy_context
> static inline void destroy_context(struct mm_struct *mm)
> {
> if (mm->context != NO_CONTEXT) {
> @@ -126,6 +123,7 @@ static inline void switch_mm(struct mm_struct *prev, struct mm_struct *next,
> * After we have set current->mm to a new value, this activates
> * the context for the new mm so we see the new mappings.
> */
> +#define activate_mm activate_mm
> static inline void activate_mm(struct mm_struct *active_mm,
> struct mm_struct *mm)
> {
> @@ -136,5 +134,7 @@ static inline void activate_mm(struct mm_struct *active_mm,
>
> extern void mmu_context_init(void);
>
> +#include <asm-generic/mmu_context.h>
> +
> # endif /* __KERNEL__ */
> #endif /* _ASM_MICROBLAZE_MMU_CONTEXT_H */
> diff --git a/arch/microblaze/include/asm/processor.h b/arch/microblaze/include/asm/processor.h
> index 1ff5a82b76b6..616211871a6e 100644
> --- a/arch/microblaze/include/asm/processor.h
> +++ b/arch/microblaze/include/asm/processor.h
> @@ -122,9 +122,6 @@ unsigned long get_wchan(struct task_struct *p);
> # define KSTK_EIP(task) (task_pc(task))
> # define KSTK_ESP(task) (task_sp(task))
>
> -/* FIXME */
> -# define deactivate_mm(tsk, mm) do { } while (0)
> -
> # define STACK_TOP TASK_SIZE
> # define STACK_TOP_MAX STACK_TOP
>
>
I am fine with the patch but I pretty much don't like that commit
message is empty and there is only subject.
With fixing that you can add my:
Acked-by: Michal Simek <[email protected]>
Thanks,
Michal
--
Michal Simek, Ing. (M.Eng), OpenPGP -> KeyID: FE3D1F91
w: http://www.monstr.eu p: +42-0-721842854
Maintainer of Linux kernel - Xilinx Microblaze
Maintainer of Linux kernel - Xilinx Zynq ARM and ZynqMP ARM64 SoCs
U-Boot custodian - Xilinx Microblaze/Zynq/ZynqMP/Versal SoCs
Excerpts from Mike Rapoport's message of August 30, 2020 8:18 pm:
> On Thu, Aug 27, 2020 at 12:52:26AM +1000, Nicholas Piggin wrote:
>> It would be nice to be able to modify mmu_context functions or add a
>> hook without updating all architectures, many of which will be no-ops.
>>
>> The motivation for this series is a change to lazy mmu handling, but
>> this series stands on its own as a good cleanup whether or not we end
>> up making that change.
>
> I really like this series, I just have some small comments in reply to
> patch 1, otherwise feel free to add
>
> Acked-by: Mike Rapoport <[email protected]>
I can't see your comments in reply to patch 1.
Thanks,
Nick
Excerpts from Michal Simek's message of September 1, 2020 12:15 am:
>
>
> On 26. 08. 20 16:52, Nicholas Piggin wrote:
>> Cc: Michal Simek <[email protected]>
>> Signed-off-by: Nicholas Piggin <[email protected]>
>> ---
>> arch/microblaze/include/asm/mmu_context_mm.h | 8 ++++----
>> arch/microblaze/include/asm/processor.h | 3 ---
>> 2 files changed, 4 insertions(+), 7 deletions(-)
>>
>> diff --git a/arch/microblaze/include/asm/mmu_context_mm.h b/arch/microblaze/include/asm/mmu_context_mm.h
>> index a1c7dd48454c..c2c77f708455 100644
>> --- a/arch/microblaze/include/asm/mmu_context_mm.h
>> +++ b/arch/microblaze/include/asm/mmu_context_mm.h
>> @@ -33,10 +33,6 @@
>> to represent all kernel pages as shared among all contexts.
>> */
>>
>> -static inline void enter_lazy_tlb(struct mm_struct *mm, struct task_struct *tsk)
>> -{
>> -}
>> -
>> # define NO_CONTEXT 256
>> # define LAST_CONTEXT 255
>> # define FIRST_CONTEXT 1
>> @@ -105,6 +101,7 @@ static inline void get_mmu_context(struct mm_struct *mm)
>> /*
>> * We're finished using the context for an address space.
>> */
>> +#define destroy_context destroy_context
>> static inline void destroy_context(struct mm_struct *mm)
>> {
>> if (mm->context != NO_CONTEXT) {
>> @@ -126,6 +123,7 @@ static inline void switch_mm(struct mm_struct *prev, struct mm_struct *next,
>> * After we have set current->mm to a new value, this activates
>> * the context for the new mm so we see the new mappings.
>> */
>> +#define activate_mm activate_mm
>> static inline void activate_mm(struct mm_struct *active_mm,
>> struct mm_struct *mm)
>> {
>> @@ -136,5 +134,7 @@ static inline void activate_mm(struct mm_struct *active_mm,
>>
>> extern void mmu_context_init(void);
>>
>> +#include <asm-generic/mmu_context.h>
>> +
>> # endif /* __KERNEL__ */
>> #endif /* _ASM_MICROBLAZE_MMU_CONTEXT_H */
>> diff --git a/arch/microblaze/include/asm/processor.h b/arch/microblaze/include/asm/processor.h
>> index 1ff5a82b76b6..616211871a6e 100644
>> --- a/arch/microblaze/include/asm/processor.h
>> +++ b/arch/microblaze/include/asm/processor.h
>> @@ -122,9 +122,6 @@ unsigned long get_wchan(struct task_struct *p);
>> # define KSTK_EIP(task) (task_pc(task))
>> # define KSTK_ESP(task) (task_sp(task))
>>
>> -/* FIXME */
>> -# define deactivate_mm(tsk, mm) do { } while (0)
>> -
>> # define STACK_TOP TASK_SIZE
>> # define STACK_TOP_MAX STACK_TOP
>>
>>
>
> I am fine with the patch but I pretty much don't like that commit
> message is empty and there is only subject.
> With fixing that you can add my:
> Acked-by: Michal Simek <[email protected]>
Thanks for the review, will do. Any suggestion for a useful commit message?
Thanks,
Nick
On 01. 09. 20 8:15, Nicholas Piggin wrote:
> Excerpts from Michal Simek's message of September 1, 2020 12:15 am:
>>
>>
>> On 26. 08. 20 16:52, Nicholas Piggin wrote:
>>> Cc: Michal Simek <[email protected]>
>>> Signed-off-by: Nicholas Piggin <[email protected]>
>>> ---
>>> arch/microblaze/include/asm/mmu_context_mm.h | 8 ++++----
>>> arch/microblaze/include/asm/processor.h | 3 ---
>>> 2 files changed, 4 insertions(+), 7 deletions(-)
>>>
>>> diff --git a/arch/microblaze/include/asm/mmu_context_mm.h b/arch/microblaze/include/asm/mmu_context_mm.h
>>> index a1c7dd48454c..c2c77f708455 100644
>>> --- a/arch/microblaze/include/asm/mmu_context_mm.h
>>> +++ b/arch/microblaze/include/asm/mmu_context_mm.h
>>> @@ -33,10 +33,6 @@
>>> to represent all kernel pages as shared among all contexts.
>>> */
>>>
>>> -static inline void enter_lazy_tlb(struct mm_struct *mm, struct task_struct *tsk)
>>> -{
>>> -}
>>> -
>>> # define NO_CONTEXT 256
>>> # define LAST_CONTEXT 255
>>> # define FIRST_CONTEXT 1
>>> @@ -105,6 +101,7 @@ static inline void get_mmu_context(struct mm_struct *mm)
>>> /*
>>> * We're finished using the context for an address space.
>>> */
>>> +#define destroy_context destroy_context
>>> static inline void destroy_context(struct mm_struct *mm)
>>> {
>>> if (mm->context != NO_CONTEXT) {
>>> @@ -126,6 +123,7 @@ static inline void switch_mm(struct mm_struct *prev, struct mm_struct *next,
>>> * After we have set current->mm to a new value, this activates
>>> * the context for the new mm so we see the new mappings.
>>> */
>>> +#define activate_mm activate_mm
>>> static inline void activate_mm(struct mm_struct *active_mm,
>>> struct mm_struct *mm)
>>> {
>>> @@ -136,5 +134,7 @@ static inline void activate_mm(struct mm_struct *active_mm,
>>>
>>> extern void mmu_context_init(void);
>>>
>>> +#include <asm-generic/mmu_context.h>
>>> +
>>> # endif /* __KERNEL__ */
>>> #endif /* _ASM_MICROBLAZE_MMU_CONTEXT_H */
>>> diff --git a/arch/microblaze/include/asm/processor.h b/arch/microblaze/include/asm/processor.h
>>> index 1ff5a82b76b6..616211871a6e 100644
>>> --- a/arch/microblaze/include/asm/processor.h
>>> +++ b/arch/microblaze/include/asm/processor.h
>>> @@ -122,9 +122,6 @@ unsigned long get_wchan(struct task_struct *p);
>>> # define KSTK_EIP(task) (task_pc(task))
>>> # define KSTK_ESP(task) (task_sp(task))
>>>
>>> -/* FIXME */
>>> -# define deactivate_mm(tsk, mm) do { } while (0)
>>> -
>>> # define STACK_TOP TASK_SIZE
>>> # define STACK_TOP_MAX STACK_TOP
>>>
>>>
>>
>> I am fine with the patch but I pretty much don't like that commit
>> message is empty and there is only subject.
>> With fixing that you can add my:
>> Acked-by: Michal Simek <[email protected]>
>
> Thanks for the review, will do. Any suggestion for a useful commit message?
What about?
Wire asm-generic/mmu_context.h to provide generic empty hooks for arch
code simplification.
Thanks,
Michal
On Tue, Sep 01, 2020 at 04:17:00PM +1000, Nicholas Piggin wrote:
> Excerpts from Mike Rapoport's message of August 30, 2020 8:18 pm:
> > On Thu, Aug 27, 2020 at 12:52:26AM +1000, Nicholas Piggin wrote:
> >> It would be nice to be able to modify mmu_context functions or add a
> >> hook without updating all architectures, many of which will be no-ops.
> >>
> >> The motivation for this series is a change to lazy mmu handling, but
> >> this series stands on its own as a good cleanup whether or not we end
> >> up making that change.
> >
> > I really like this series, I just have some small comments in reply to
> > patch 1, otherwise feel free to add
> >
> > Acked-by: Mike Rapoport <[email protected]>
>
> I can't see your comments in reply to patch 1.
Hmm, apparently I forgot to hit "Send"...
> Thanks,
> Nick
>
--
Sincerely yours,
Mike.
Excerpts from Michal Simek's message of September 1, 2020 4:41 pm:
>
>
> On 01. 09. 20 8:15, Nicholas Piggin wrote:
>> Excerpts from Michal Simek's message of September 1, 2020 12:15 am:
>>>
>>>
>>> On 26. 08. 20 16:52, Nicholas Piggin wrote:
>>>> Cc: Michal Simek <[email protected]>
>>>> Signed-off-by: Nicholas Piggin <[email protected]>
>>>> ---
>>>> arch/microblaze/include/asm/mmu_context_mm.h | 8 ++++----
>>>> arch/microblaze/include/asm/processor.h | 3 ---
>>>> 2 files changed, 4 insertions(+), 7 deletions(-)
>>>>
>>>> diff --git a/arch/microblaze/include/asm/mmu_context_mm.h b/arch/microblaze/include/asm/mmu_context_mm.h
>>>> index a1c7dd48454c..c2c77f708455 100644
>>>> --- a/arch/microblaze/include/asm/mmu_context_mm.h
>>>> +++ b/arch/microblaze/include/asm/mmu_context_mm.h
>>>> @@ -33,10 +33,6 @@
>>>> to represent all kernel pages as shared among all contexts.
>>>> */
>>>>
>>>> -static inline void enter_lazy_tlb(struct mm_struct *mm, struct task_struct *tsk)
>>>> -{
>>>> -}
>>>> -
>>>> # define NO_CONTEXT 256
>>>> # define LAST_CONTEXT 255
>>>> # define FIRST_CONTEXT 1
>>>> @@ -105,6 +101,7 @@ static inline void get_mmu_context(struct mm_struct *mm)
>>>> /*
>>>> * We're finished using the context for an address space.
>>>> */
>>>> +#define destroy_context destroy_context
>>>> static inline void destroy_context(struct mm_struct *mm)
>>>> {
>>>> if (mm->context != NO_CONTEXT) {
>>>> @@ -126,6 +123,7 @@ static inline void switch_mm(struct mm_struct *prev, struct mm_struct *next,
>>>> * After we have set current->mm to a new value, this activates
>>>> * the context for the new mm so we see the new mappings.
>>>> */
>>>> +#define activate_mm activate_mm
>>>> static inline void activate_mm(struct mm_struct *active_mm,
>>>> struct mm_struct *mm)
>>>> {
>>>> @@ -136,5 +134,7 @@ static inline void activate_mm(struct mm_struct *active_mm,
>>>>
>>>> extern void mmu_context_init(void);
>>>>
>>>> +#include <asm-generic/mmu_context.h>
>>>> +
>>>> # endif /* __KERNEL__ */
>>>> #endif /* _ASM_MICROBLAZE_MMU_CONTEXT_H */
>>>> diff --git a/arch/microblaze/include/asm/processor.h b/arch/microblaze/include/asm/processor.h
>>>> index 1ff5a82b76b6..616211871a6e 100644
>>>> --- a/arch/microblaze/include/asm/processor.h
>>>> +++ b/arch/microblaze/include/asm/processor.h
>>>> @@ -122,9 +122,6 @@ unsigned long get_wchan(struct task_struct *p);
>>>> # define KSTK_EIP(task) (task_pc(task))
>>>> # define KSTK_ESP(task) (task_sp(task))
>>>>
>>>> -/* FIXME */
>>>> -# define deactivate_mm(tsk, mm) do { } while (0)
>>>> -
>>>> # define STACK_TOP TASK_SIZE
>>>> # define STACK_TOP_MAX STACK_TOP
>>>>
>>>>
>>>
>>> I am fine with the patch but I pretty much don't like that commit
>>> message is empty and there is only subject.
>>> With fixing that you can add my:
>>> Acked-by: Michal Simek <[email protected]>
>>
>> Thanks for the review, will do. Any suggestion for a useful commit message?
>
> What about?
> Wire asm-generic/mmu_context.h to provide generic empty hooks for arch
> code simplification.
Sure I'll add it.
Thanks,
Nick