* [PATCH v2 09/23] m68k: use asm-generic/mmu_context.h for no-op implementations
[not found] <20200826145249.745432-1-npiggin@gmail.com>
@ 2020-08-26 14:52 ` Nicholas Piggin
2020-08-27 9:33 ` Geert Uytterhoeven
0 siblings, 1 reply; 5+ messages in thread
From: Nicholas Piggin @ 2020-08-26 14:52 UTC (permalink / raw)
To: linux-arch
Cc: Nicholas Piggin, linux-kernel, linux-mm, Arnd Bergmann,
Geert Uytterhoeven, linux-m68k
Cc: Geert Uytterhoeven <geert@linux-m68k.org>
Cc: linux-m68k@lists.linux-m68k.org
Signed-off-by: Nicholas Piggin <npiggin@gmail.com>
---
arch/m68k/include/asm/mmu_context.h | 47 +++++------------------------
1 file changed, 8 insertions(+), 39 deletions(-)
diff --git a/arch/m68k/include/asm/mmu_context.h b/arch/m68k/include/asm/mmu_context.h
index 993fd7e37069..012e92204c1b 100644
--- a/arch/m68k/include/asm/mmu_context.h
+++ b/arch/m68k/include/asm/mmu_context.h
@@ -5,10 +5,6 @@
#include <asm-generic/mm_hooks.h>
#include <linux/mm_types.h>
-static inline void enter_lazy_tlb(struct mm_struct *mm, struct task_struct *tsk)
-{
-}
-
#ifdef CONFIG_MMU
#if defined(CONFIG_COLDFIRE)
@@ -58,6 +54,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) {
@@ -79,19 +76,6 @@ static inline void switch_mm(struct mm_struct *prev, struct mm_struct *next,
set_context(tsk->mm->context, next->pgd);
}
-/*
- * After we have set current->mm to a new value, this activates
- * the context for the new mm so we see the new mappings.
- */
-static inline void activate_mm(struct mm_struct *active_mm,
- struct mm_struct *mm)
-{
- get_mmu_context(mm);
- set_context(mm->context, mm->pgd);
-}
-
-#define deactivate_mm(tsk, mm) do { } while (0)
-
#define prepare_arch_switch(next) load_ksp_mmu(next)
static inline void load_ksp_mmu(struct task_struct *task)
@@ -176,6 +160,7 @@ extern unsigned long get_free_context(struct mm_struct *mm);
extern void clear_context(unsigned long context);
/* set the context for a new task to unmapped */
+#define init_new_context init_new_context
static inline int init_new_context(struct task_struct *tsk,
struct mm_struct *mm)
{
@@ -210,8 +195,7 @@ static inline void switch_mm(struct mm_struct *prev, struct mm_struct *next,
activate_context(tsk->mm);
}
-#define deactivate_mm(tsk, mm) do { } while (0)
-
+#define activate_mm activate_mm
static inline void activate_mm(struct mm_struct *prev_mm,
struct mm_struct *next_mm)
{
@@ -224,6 +208,7 @@ static inline void activate_mm(struct mm_struct *prev_mm,
#include <asm/page.h>
#include <asm/cacheflush.h>
+#define init_new_context init_new_context
static inline int init_new_context(struct task_struct *tsk,
struct mm_struct *mm)
{
@@ -231,8 +216,6 @@ static inline int init_new_context(struct task_struct *tsk,
return 0;
}
-#define destroy_context(mm) do { } while(0)
-
static inline void switch_mm_0230(struct mm_struct *mm)
{
unsigned long crp[2] = {
@@ -300,8 +283,7 @@ static inline void switch_mm(struct mm_struct *prev, struct mm_struct *next, str
}
}
-#define deactivate_mm(tsk,mm) do { } while (0)
-
+#define activate_mm activate_mm
static inline void activate_mm(struct mm_struct *prev_mm,
struct mm_struct *next_mm)
{
@@ -315,24 +297,11 @@ static inline void activate_mm(struct mm_struct *prev_mm,
#endif
-#else /* !CONFIG_MMU */
+#include <asm-generic/mmu_context.h>
-static inline int init_new_context(struct task_struct *tsk, struct mm_struct *mm)
-{
- return 0;
-}
-
-
-static inline void switch_mm(struct mm_struct *prev, struct mm_struct *next, struct task_struct *tsk)
-{
-}
-
-#define destroy_context(mm) do { } while (0)
-#define deactivate_mm(tsk,mm) do { } while (0)
+#else /* !CONFIG_MMU */
-static inline void activate_mm(struct mm_struct *prev_mm, struct mm_struct *next_mm)
-{
-}
+#include <asm-generic/nommu_context.h>
#endif /* CONFIG_MMU */
#endif /* __M68K_MMU_CONTEXT_H */
--
2.23.0
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH v2 09/23] m68k: use asm-generic/mmu_context.h for no-op implementations
2020-08-26 14:52 ` [PATCH v2 09/23] m68k: use asm-generic/mmu_context.h for no-op implementations Nicholas Piggin
@ 2020-08-27 9:33 ` Geert Uytterhoeven
2020-09-01 6:23 ` Nicholas Piggin
0 siblings, 1 reply; 5+ messages in thread
From: Geert Uytterhoeven @ 2020-08-27 9:33 UTC (permalink / raw)
To: Nicholas Piggin
Cc: Linux-Arch, Linux Kernel Mailing List, Linux MM, Arnd Bergmann,
linux-m68k
On Wed, Aug 26, 2020 at 4:53 PM Nicholas Piggin <npiggin@gmail.com> wrote:
> Cc: Geert Uytterhoeven <geert@linux-m68k.org>
> Cc: linux-m68k@lists.linux-m68k.org
> Signed-off-by: Nicholas Piggin <npiggin@gmail.com>
With the below fixed:
Acked-by: Geert Uytterhoeven <geert@linux-m68k.org>
> --- a/arch/m68k/include/asm/mmu_context.h
> +++ b/arch/m68k/include/asm/mmu_context.h
> @@ -79,19 +76,6 @@ static inline void switch_mm(struct mm_struct *prev, struct mm_struct *next,
> set_context(tsk->mm->context, next->pgd);
> }
>
> -/*
> - * After we have set current->mm to a new value, this activates
> - * the context for the new mm so we see the new mappings.
> - */
> -static inline void activate_mm(struct mm_struct *active_mm,
> - struct mm_struct *mm)
> -{
> - get_mmu_context(mm);
> - set_context(mm->context, mm->pgd);
> -}
Assumed switch_mm() in [PATCH v2 01/23] is revived with the above body.
Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org
In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH v2 09/23] m68k: use asm-generic/mmu_context.h for no-op implementations
2020-08-27 9:33 ` Geert Uytterhoeven
@ 2020-09-01 6:23 ` Nicholas Piggin
2020-09-01 7:03 ` Geert Uytterhoeven
0 siblings, 1 reply; 5+ messages in thread
From: Nicholas Piggin @ 2020-09-01 6:23 UTC (permalink / raw)
To: Geert Uytterhoeven
Cc: Arnd Bergmann, Linux-Arch, Linux Kernel Mailing List, linux-m68k,
Linux MM
Excerpts from Geert Uytterhoeven's message of August 27, 2020 7:33 pm:
> On Wed, Aug 26, 2020 at 4:53 PM Nicholas Piggin <npiggin@gmail.com> wrote:
>> Cc: Geert Uytterhoeven <geert@linux-m68k.org>
>> Cc: linux-m68k@lists.linux-m68k.org
>> Signed-off-by: Nicholas Piggin <npiggin@gmail.com>
>
> With the below fixed:
> Acked-by: Geert Uytterhoeven <geert@linux-m68k.org>
>
>> --- a/arch/m68k/include/asm/mmu_context.h
>> +++ b/arch/m68k/include/asm/mmu_context.h
>> @@ -79,19 +76,6 @@ static inline void switch_mm(struct mm_struct *prev, struct mm_struct *next,
>> set_context(tsk->mm->context, next->pgd);
>> }
>>
>> -/*
>> - * After we have set current->mm to a new value, this activates
>> - * the context for the new mm so we see the new mappings.
>> - */
>> -static inline void activate_mm(struct mm_struct *active_mm,
>> - struct mm_struct *mm)
>> -{
>> - get_mmu_context(mm);
>> - set_context(mm->context, mm->pgd);
>> -}
>
> Assumed switch_mm() in [PATCH v2 01/23] is revived with the above body.
I'm not sure what you mean here. We can remove this because it's a copy
of switch_mm above, and that's what the new header defaults to if you
don't provide an active_mm.
Patch 1 should not have changed that, it should only affect the nommu
architectures (and actually didn't touch m68k because it was not using
the asm-generic/mmu_context.h header).
Thanks,
Nick
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH v2 09/23] m68k: use asm-generic/mmu_context.h for no-op implementations
2020-09-01 6:23 ` Nicholas Piggin
@ 2020-09-01 7:03 ` Geert Uytterhoeven
2020-09-01 7:50 ` Nicholas Piggin
0 siblings, 1 reply; 5+ messages in thread
From: Geert Uytterhoeven @ 2020-09-01 7:03 UTC (permalink / raw)
To: Nicholas Piggin
Cc: Arnd Bergmann, Linux-Arch, Linux Kernel Mailing List, linux-m68k,
Linux MM
Hi Nick,
On Tue, Sep 1, 2020 at 8:23 AM Nicholas Piggin <npiggin@gmail.com> wrote:
> Excerpts from Geert Uytterhoeven's message of August 27, 2020 7:33 pm:
> > On Wed, Aug 26, 2020 at 4:53 PM Nicholas Piggin <npiggin@gmail.com> wrote:
> >> Cc: Geert Uytterhoeven <geert@linux-m68k.org>
> >> Cc: linux-m68k@lists.linux-m68k.org
> >> Signed-off-by: Nicholas Piggin <npiggin@gmail.com>
> >
> > With the below fixed:
> > Acked-by: Geert Uytterhoeven <geert@linux-m68k.org>
> >
> >> --- a/arch/m68k/include/asm/mmu_context.h
> >> +++ b/arch/m68k/include/asm/mmu_context.h
> >> @@ -79,19 +76,6 @@ static inline void switch_mm(struct mm_struct *prev, struct mm_struct *next,
> >> set_context(tsk->mm->context, next->pgd);
> >> }
> >>
> >> -/*
> >> - * After we have set current->mm to a new value, this activates
> >> - * the context for the new mm so we see the new mappings.
> >> - */
> >> -static inline void activate_mm(struct mm_struct *active_mm,
> >> - struct mm_struct *mm)
> >> -{
> >> - get_mmu_context(mm);
> >> - set_context(mm->context, mm->pgd);
> >> -}
> >
> > Assumed switch_mm() in [PATCH v2 01/23] is revived with the above body.
>
> I'm not sure what you mean here. We can remove this because it's a copy
> of switch_mm above, and that's what the new header defaults to if you
> don't provide an active_mm.
IC. I thought it started relying on <asm-generic/mmu_context.h> for this,
where you removed switch_mm().
Seems I missed the definition above.
> Patch 1 should not have changed that, it should only affect the nommu
> architectures (and actually didn't touch m68k because it was not using
> the asm-generic/mmu_context.h header).
OK. Sorry for the noise.
Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org
In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH v2 09/23] m68k: use asm-generic/mmu_context.h for no-op implementations
2020-09-01 7:03 ` Geert Uytterhoeven
@ 2020-09-01 7:50 ` Nicholas Piggin
0 siblings, 0 replies; 5+ messages in thread
From: Nicholas Piggin @ 2020-09-01 7:50 UTC (permalink / raw)
To: Geert Uytterhoeven
Cc: Arnd Bergmann, Linux-Arch, Linux Kernel Mailing List, linux-m68k,
Linux MM
Excerpts from Geert Uytterhoeven's message of September 1, 2020 5:03 pm:
> Hi Nick,
>
> On Tue, Sep 1, 2020 at 8:23 AM Nicholas Piggin <npiggin@gmail.com> wrote:
>> Excerpts from Geert Uytterhoeven's message of August 27, 2020 7:33 pm:
>> > On Wed, Aug 26, 2020 at 4:53 PM Nicholas Piggin <npiggin@gmail.com> wrote:
>> >> Cc: Geert Uytterhoeven <geert@linux-m68k.org>
>> >> Cc: linux-m68k@lists.linux-m68k.org
>> >> Signed-off-by: Nicholas Piggin <npiggin@gmail.com>
>> >
>> > With the below fixed:
>> > Acked-by: Geert Uytterhoeven <geert@linux-m68k.org>
>> >
>> >> --- a/arch/m68k/include/asm/mmu_context.h
>> >> +++ b/arch/m68k/include/asm/mmu_context.h
>> >> @@ -79,19 +76,6 @@ static inline void switch_mm(struct mm_struct *prev, struct mm_struct *next,
>> >> set_context(tsk->mm->context, next->pgd);
>> >> }
>> >>
>> >> -/*
>> >> - * After we have set current->mm to a new value, this activates
>> >> - * the context for the new mm so we see the new mappings.
>> >> - */
>> >> -static inline void activate_mm(struct mm_struct *active_mm,
>> >> - struct mm_struct *mm)
>> >> -{
>> >> - get_mmu_context(mm);
>> >> - set_context(mm->context, mm->pgd);
>> >> -}
>> >
>> > Assumed switch_mm() in [PATCH v2 01/23] is revived with the above body.
>>
>> I'm not sure what you mean here. We can remove this because it's a copy
>> of switch_mm above, and that's what the new header defaults to if you
>> don't provide an active_mm.
>
> IC. I thought it started relying on <asm-generic/mmu_context.h> for this,
> where you removed switch_mm().
>
> Seems I missed the definition above.
It's supposed to all build incrementally, I'll try to make sure it's
right...
>
>> Patch 1 should not have changed that, it should only affect the nommu
>> architectures (and actually didn't touch m68k because it was not using
>> the asm-generic/mmu_context.h header).
>
> OK. Sorry for the noise.
No problem thanks for looking at it.
Thanks,
Nick
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2020-09-01 7:50 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
[not found] <20200826145249.745432-1-npiggin@gmail.com>
2020-08-26 14:52 ` [PATCH v2 09/23] m68k: use asm-generic/mmu_context.h for no-op implementations Nicholas Piggin
2020-08-27 9:33 ` Geert Uytterhoeven
2020-09-01 6:23 ` Nicholas Piggin
2020-09-01 7:03 ` Geert Uytterhoeven
2020-09-01 7:50 ` Nicholas Piggin
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).