Linux OpenRISC platform development
 help / color / mirror / Atom feed
* [OpenRISC] [PATCH 14/24] openrisc: use asm-generic/mmu_context.h for no-op implementations
       [not found] <20200728033405.78469-1-npiggin@gmail.com>
@ 2020-07-28  3:35 ` Nicholas Piggin
  2020-07-29 11:45   ` Stafford Horne
  0 siblings, 1 reply; 3+ messages in thread
From: Nicholas Piggin @ 2020-07-28  3:35 UTC (permalink / raw)
  To: openrisc

Cc: Jonas Bonn <jonas@southpole.se>
Cc: Stefan Kristiansson <stefan.kristiansson@saunalahti.fi>
Cc: Stafford Horne <shorne@gmail.com>
Cc: openrisc at lists.librecores.org
Signed-off-by: Nicholas Piggin <npiggin@gmail.com>
---
 arch/openrisc/include/asm/mmu_context.h | 8 +++-----
 arch/openrisc/mm/tlb.c                  | 2 ++
 2 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/arch/openrisc/include/asm/mmu_context.h b/arch/openrisc/include/asm/mmu_context.h
index ced577542e29..a6702384c77d 100644
--- a/arch/openrisc/include/asm/mmu_context.h
+++ b/arch/openrisc/include/asm/mmu_context.h
@@ -17,13 +17,13 @@
 
 #include <asm-generic/mm_hooks.h>
 
+#define init_new_context init_new_context
 extern int init_new_context(struct task_struct *tsk, struct mm_struct *mm);
+#define destroy_context destroy_context
 extern void destroy_context(struct mm_struct *mm);
 extern void switch_mm(struct mm_struct *prev, struct mm_struct *next,
 		      struct task_struct *tsk);
 
-#define deactivate_mm(tsk, mm)	do { } while (0)
-
 #define activate_mm(prev, next) switch_mm((prev), (next), NULL)
 
 /* current active pgd - this is similar to other processors pgd
@@ -32,8 +32,6 @@ extern void switch_mm(struct mm_struct *prev, struct mm_struct *next,
 
 extern volatile pgd_t *current_pgd[]; /* defined in arch/openrisc/mm/fault.c */
 
-static inline void enter_lazy_tlb(struct mm_struct *mm, struct task_struct *tsk)
-{
-}
+#include <asm-generic/mmu_context.h>
 
 #endif
diff --git a/arch/openrisc/mm/tlb.c b/arch/openrisc/mm/tlb.c
index 4b680aed8f5f..821aab4cf3be 100644
--- a/arch/openrisc/mm/tlb.c
+++ b/arch/openrisc/mm/tlb.c
@@ -159,6 +159,7 @@ void switch_mm(struct mm_struct *prev, struct mm_struct *next,
  * instance.
  */
 
+#define init_new_context init_new_context
 int init_new_context(struct task_struct *tsk, struct mm_struct *mm)
 {
 	mm->context = NO_CONTEXT;
@@ -170,6 +171,7 @@ int init_new_context(struct task_struct *tsk, struct mm_struct *mm)
  * drops it.
  */
 
+#define destroy_context destroy_context
 void destroy_context(struct mm_struct *mm)
 {
 	flush_tlb_mm(mm);
-- 
2.23.0


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [OpenRISC] [PATCH 14/24] openrisc: use asm-generic/mmu_context.h for no-op implementations
  2020-07-28  3:35 ` [OpenRISC] [PATCH 14/24] openrisc: use asm-generic/mmu_context.h for no-op implementations Nicholas Piggin
@ 2020-07-29 11:45   ` Stafford Horne
  2020-08-26 14:33     ` Nicholas Piggin
  0 siblings, 1 reply; 3+ messages in thread
From: Stafford Horne @ 2020-07-29 11:45 UTC (permalink / raw)
  To: openrisc

On Tue, Jul 28, 2020 at 01:33:55PM +1000, Nicholas Piggin wrote:
> Cc: Jonas Bonn <jonas@southpole.se>
> Cc: Stefan Kristiansson <stefan.kristiansson@saunalahti.fi>
> Cc: Stafford Horne <shorne@gmail.com>
> Cc: openrisc at lists.librecores.org
> Signed-off-by: Nicholas Piggin <npiggin@gmail.com>
> ---
>  arch/openrisc/include/asm/mmu_context.h | 8 +++-----
>  arch/openrisc/mm/tlb.c                  | 2 ++
>  2 files changed, 5 insertions(+), 5 deletions(-)
> 
> diff --git a/arch/openrisc/include/asm/mmu_context.h b/arch/openrisc/include/asm/mmu_context.h
> index ced577542e29..a6702384c77d 100644
> --- a/arch/openrisc/include/asm/mmu_context.h
> +++ b/arch/openrisc/include/asm/mmu_context.h
> @@ -17,13 +17,13 @@
>  
>  #include <asm-generic/mm_hooks.h>
>  
> +#define init_new_context init_new_context
>  extern int init_new_context(struct task_struct *tsk, struct mm_struct *mm);
> +#define destroy_context destroy_context
>  extern void destroy_context(struct mm_struct *mm);
>  extern void switch_mm(struct mm_struct *prev, struct mm_struct *next,
>  		      struct task_struct *tsk);
>  
> -#define deactivate_mm(tsk, mm)	do { } while (0)
> -
>  #define activate_mm(prev, next) switch_mm((prev), (next), NULL)
>  
>  /* current active pgd - this is similar to other processors pgd
> @@ -32,8 +32,6 @@ extern void switch_mm(struct mm_struct *prev, struct mm_struct *next,
>  
>  extern volatile pgd_t *current_pgd[]; /* defined in arch/openrisc/mm/fault.c */
>  
> -static inline void enter_lazy_tlb(struct mm_struct *mm, struct task_struct *tsk)
> -{
> -}
> +#include <asm-generic/mmu_context.h>

This looks ok.

>  #endif
> diff --git a/arch/openrisc/mm/tlb.c b/arch/openrisc/mm/tlb.c
> index 4b680aed8f5f..821aab4cf3be 100644
> --- a/arch/openrisc/mm/tlb.c
> +++ b/arch/openrisc/mm/tlb.c
> @@ -159,6 +159,7 @@ void switch_mm(struct mm_struct *prev, struct mm_struct *next,
>   * instance.
>   */
>  
> +#define init_new_context init_new_context
>  int init_new_context(struct task_struct *tsk, struct mm_struct *mm)
>  {
>  	mm->context = NO_CONTEXT;
> @@ -170,6 +171,7 @@ int init_new_context(struct task_struct *tsk, struct mm_struct *mm)
>   * drops it.
>   */
>  
> +#define destroy_context destroy_context
>  void destroy_context(struct mm_struct *mm)
>  {
>  	flush_tlb_mm(mm);

I don't think we need the #define's in the .c file.  Do we?

-Stafford

> -- 
> 2.23.0
> 

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [OpenRISC] [PATCH 14/24] openrisc: use asm-generic/mmu_context.h for no-op implementations
  2020-07-29 11:45   ` Stafford Horne
@ 2020-08-26 14:33     ` Nicholas Piggin
  0 siblings, 0 replies; 3+ messages in thread
From: Nicholas Piggin @ 2020-08-26 14:33 UTC (permalink / raw)
  To: openrisc

Excerpts from Stafford Horne's message of July 29, 2020 9:45 pm:
> On Tue, Jul 28, 2020 at 01:33:55PM +1000, Nicholas Piggin wrote:
>> Cc: Jonas Bonn <jonas@southpole.se>
>> Cc: Stefan Kristiansson <stefan.kristiansson@saunalahti.fi>
>> Cc: Stafford Horne <shorne@gmail.com>
>> Cc: openrisc at lists.librecores.org
>> Signed-off-by: Nicholas Piggin <npiggin@gmail.com>
>> ---
>>  arch/openrisc/include/asm/mmu_context.h | 8 +++-----
>>  arch/openrisc/mm/tlb.c                  | 2 ++
>>  2 files changed, 5 insertions(+), 5 deletions(-)
>> 
>> diff --git a/arch/openrisc/include/asm/mmu_context.h b/arch/openrisc/include/asm/mmu_context.h
>> index ced577542e29..a6702384c77d 100644
>> --- a/arch/openrisc/include/asm/mmu_context.h
>> +++ b/arch/openrisc/include/asm/mmu_context.h
>> @@ -17,13 +17,13 @@
>>  
>>  #include <asm-generic/mm_hooks.h>
>>  
>> +#define init_new_context init_new_context
>>  extern int init_new_context(struct task_struct *tsk, struct mm_struct *mm);
>> +#define destroy_context destroy_context
>>  extern void destroy_context(struct mm_struct *mm);
>>  extern void switch_mm(struct mm_struct *prev, struct mm_struct *next,
>>  		      struct task_struct *tsk);
>>  
>> -#define deactivate_mm(tsk, mm)	do { } while (0)
>> -
>>  #define activate_mm(prev, next) switch_mm((prev), (next), NULL)
>>  
>>  /* current active pgd - this is similar to other processors pgd
>> @@ -32,8 +32,6 @@ extern void switch_mm(struct mm_struct *prev, struct mm_struct *next,
>>  
>>  extern volatile pgd_t *current_pgd[]; /* defined in arch/openrisc/mm/fault.c */
>>  
>> -static inline void enter_lazy_tlb(struct mm_struct *mm, struct task_struct *tsk)
>> -{
>> -}
>> +#include <asm-generic/mmu_context.h>
> 
> This looks ok.
> 
>>  #endif
>> diff --git a/arch/openrisc/mm/tlb.c b/arch/openrisc/mm/tlb.c
>> index 4b680aed8f5f..821aab4cf3be 100644
>> --- a/arch/openrisc/mm/tlb.c
>> +++ b/arch/openrisc/mm/tlb.c
>> @@ -159,6 +159,7 @@ void switch_mm(struct mm_struct *prev, struct mm_struct *next,
>>   * instance.
>>   */
>>  
>> +#define init_new_context init_new_context
>>  int init_new_context(struct task_struct *tsk, struct mm_struct *mm)
>>  {
>>  	mm->context = NO_CONTEXT;
>> @@ -170,6 +171,7 @@ int init_new_context(struct task_struct *tsk, struct mm_struct *mm)
>>   * drops it.
>>   */
>>  
>> +#define destroy_context destroy_context
>>  void destroy_context(struct mm_struct *mm)
>>  {
>>  	flush_tlb_mm(mm);
> 
> I don't think we need the #define's in the .c file.  Do we?

You're right, I fixed that and the same issue in another arch.

Thanks,
Nick

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2020-08-26 14:33 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <20200728033405.78469-1-npiggin@gmail.com>
2020-07-28  3:35 ` [OpenRISC] [PATCH 14/24] openrisc: use asm-generic/mmu_context.h for no-op implementations Nicholas Piggin
2020-07-29 11:45   ` Stafford Horne
2020-08-26 14:33     ` Nicholas Piggin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox