Message ID | 20200901141539.1757549-4-npiggin@gmail.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Series | Use asm-generic for mmu_context no-op functions | expand |
On 9/1/20 7:15 AM, Nicholas Piggin wrote: > Cc: Vineet Gupta <vgupta@synopsys.com> > Cc: linux-snps-arc@lists.infradead.org > Signed-off-by: Nicholas Piggin <npiggin@gmail.com> Acked-by: Vineet Gupta <vgupta@synopsys.com> #arch/arc Thx, -Vineet > --- > > Please ack or nack if you object to this being mered via > Arnd's tree. > > arch/arc/include/asm/mmu_context.h | 17 +++++++++-------- > 1 file changed, 9 insertions(+), 8 deletions(-) > > diff --git a/arch/arc/include/asm/mmu_context.h b/arch/arc/include/asm/mmu_context.h > index 3a5e6a5b9ed6..df164066e172 100644 > --- a/arch/arc/include/asm/mmu_context.h > +++ b/arch/arc/include/asm/mmu_context.h > @@ -102,6 +102,7 @@ static inline void get_new_mmu_context(struct mm_struct *mm) > * Initialize the context related info for a new mm_struct > * instance. > */ > +#define init_new_context init_new_context > static inline int > init_new_context(struct task_struct *tsk, struct mm_struct *mm) > { > @@ -113,6 +114,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) > { > unsigned long flags; > @@ -153,13 +155,13 @@ static inline void switch_mm(struct mm_struct *prev, struct mm_struct *next, > } > > /* > - * Called at the time of execve() to get a new ASID > - * Note the subtlety here: get_new_mmu_context() behaves differently here > - * vs. in switch_mm(). Here it always returns a new ASID, because mm has > - * an unallocated "initial" value, while in latter, it moves to a new ASID, > - * only if it was unallocated > + * activate_mm defaults (in asm-generic) to switch_mm and is called at the > + * time of execve() to get a new ASID Note the subtlety here: > + * get_new_mmu_context() behaves differently here vs. in switch_mm(). Here > + * it always returns a new ASID, because mm has an unallocated "initial" > + * value, while in latter, it moves to a new ASID, only if it was > + * unallocated > */ > -#define activate_mm(prev, next) switch_mm(prev, next, NULL) > > /* it seemed that deactivate_mm( ) is a reasonable place to do book-keeping > * for retiring-mm. However destroy_context( ) still needs to do that because > @@ -168,8 +170,7 @@ static inline void switch_mm(struct mm_struct *prev, struct mm_struct *next, > * there is a good chance that task gets sched-out/in, making it's ASID valid > * again (this teased me for a whole day). > */ > -#define deactivate_mm(tsk, mm) do { } while (0) > > -#define enter_lazy_tlb(mm, tsk) > +#include <asm-generic/mmu_context.h> > > #endif /* __ASM_ARC_MMU_CONTEXT_H */ >
diff --git a/arch/arc/include/asm/mmu_context.h b/arch/arc/include/asm/mmu_context.h index 3a5e6a5b9ed6..df164066e172 100644 --- a/arch/arc/include/asm/mmu_context.h +++ b/arch/arc/include/asm/mmu_context.h @@ -102,6 +102,7 @@ static inline void get_new_mmu_context(struct mm_struct *mm) * Initialize the context related info for a new mm_struct * instance. */ +#define init_new_context init_new_context static inline int init_new_context(struct task_struct *tsk, struct mm_struct *mm) { @@ -113,6 +114,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) { unsigned long flags; @@ -153,13 +155,13 @@ static inline void switch_mm(struct mm_struct *prev, struct mm_struct *next, } /* - * Called at the time of execve() to get a new ASID - * Note the subtlety here: get_new_mmu_context() behaves differently here - * vs. in switch_mm(). Here it always returns a new ASID, because mm has - * an unallocated "initial" value, while in latter, it moves to a new ASID, - * only if it was unallocated + * activate_mm defaults (in asm-generic) to switch_mm and is called at the + * time of execve() to get a new ASID Note the subtlety here: + * get_new_mmu_context() behaves differently here vs. in switch_mm(). Here + * it always returns a new ASID, because mm has an unallocated "initial" + * value, while in latter, it moves to a new ASID, only if it was + * unallocated */ -#define activate_mm(prev, next) switch_mm(prev, next, NULL) /* it seemed that deactivate_mm( ) is a reasonable place to do book-keeping * for retiring-mm. However destroy_context( ) still needs to do that because @@ -168,8 +170,7 @@ static inline void switch_mm(struct mm_struct *prev, struct mm_struct *next, * there is a good chance that task gets sched-out/in, making it's ASID valid * again (this teased me for a whole day). */ -#define deactivate_mm(tsk, mm) do { } while (0) -#define enter_lazy_tlb(mm, tsk) +#include <asm-generic/mmu_context.h> #endif /* __ASM_ARC_MMU_CONTEXT_H */
Cc: Vineet Gupta <vgupta@synopsys.com> Cc: linux-snps-arc@lists.infradead.org Signed-off-by: Nicholas Piggin <npiggin@gmail.com> --- Please ack or nack if you object to this being mered via Arnd's tree. arch/arc/include/asm/mmu_context.h | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-)