All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] LoongArch: use EXCCODE_INT_START instead of hard coded value
@ 2023-02-24  3:30 Enze Li
  2023-03-13  2:55 ` Enze Li
  0 siblings, 1 reply; 5+ messages in thread
From: Enze Li @ 2023-02-24  3:30 UTC (permalink / raw)
  To: chenhuacai, kernel; +Cc: loongarch, enze.li

The for loop in per_cpu_trap_init function use a hard coded length while
setting default exception handler.  Use the proper define instead of
hard coded value.

Signed-off-by: Enze Li <lienze@kylinos.cn>
---
 arch/loongarch/kernel/traps.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/loongarch/kernel/traps.c b/arch/loongarch/kernel/traps.c
index de8ebe20b666..7d5784eccf19 100644
--- a/arch/loongarch/kernel/traps.c
+++ b/arch/loongarch/kernel/traps.c
@@ -755,7 +755,7 @@ void per_cpu_trap_init(int cpu)
 
 	/* Initialise exception handlers */
 	if (cpu == 0)
-		for (i = 0; i < 64; i++)
+		for (i = 0; i < EXCCODE_INT_START; i++)
 			set_handler(i * VECSIZE, handle_reserved, VECSIZE);
 
 	tlb_init(cpu);

base-commit: 804f6d04b1adae9602edbd6410c0ba3a556964fe
-- 
2.39.2


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

* Re: [PATCH] LoongArch: use EXCCODE_INT_START instead of hard coded value
  2023-02-24  3:30 [PATCH] LoongArch: use EXCCODE_INT_START instead of hard coded value Enze Li
@ 2023-03-13  2:55 ` Enze Li
  2023-03-13  7:52   ` Huacai Chen
  0 siblings, 1 reply; 5+ messages in thread
From: Enze Li @ 2023-03-13  2:55 UTC (permalink / raw)
  To: chenhuacai, kernel; +Cc: loongarch, enze.li

Hi Huacai,

Kindly PING for this tiny patch. :)

Thanks,
Enze

On Fri, 2023-02-24 at 11:30 +0800, Enze Li wrote:
> The for loop in per_cpu_trap_init function use a hard coded length
> while
> setting default exception handler.  Use the proper define instead of
> hard coded value.
> 
> Signed-off-by: Enze Li <lienze@kylinos.cn>
> ---
>  arch/loongarch/kernel/traps.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/arch/loongarch/kernel/traps.c
> b/arch/loongarch/kernel/traps.c
> index de8ebe20b666..7d5784eccf19 100644
> --- a/arch/loongarch/kernel/traps.c
> +++ b/arch/loongarch/kernel/traps.c
> @@ -755,7 +755,7 @@ void per_cpu_trap_init(int cpu)
>  
>  	/* Initialise exception handlers */
>  	if (cpu == 0)
> -		for (i = 0; i < 64; i++)
> +		for (i = 0; i < EXCCODE_INT_START; i++)
>  			set_handler(i * VECSIZE, handle_reserved,
> VECSIZE);
>  
>  	tlb_init(cpu);
> 
> base-commit: 804f6d04b1adae9602edbd6410c0ba3a556964fe


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

* Re: [PATCH] LoongArch: use EXCCODE_INT_START instead of hard coded value
  2023-03-13  2:55 ` Enze Li
@ 2023-03-13  7:52   ` Huacai Chen
  2023-03-13  9:18     ` Enze Li
  0 siblings, 1 reply; 5+ messages in thread
From: Huacai Chen @ 2023-03-13  7:52 UTC (permalink / raw)
  To: Enze Li; +Cc: kernel, loongarch, enze.li

Though EXCCODE_INT_START is 64, its meaning is not suitable in this case.

Huacai

On Mon, Mar 13, 2023 at 12:42 PM Enze Li <lienze@kylinos.cn> wrote:
>
> Hi Huacai,
>
> Kindly PING for this tiny patch. :)
>
> Thanks,
> Enze
>
> On Fri, 2023-02-24 at 11:30 +0800, Enze Li wrote:
> > The for loop in per_cpu_trap_init function use a hard coded length
> > while
> > setting default exception handler.  Use the proper define instead of
> > hard coded value.
> >
> > Signed-off-by: Enze Li <lienze@kylinos.cn>
> > ---
> >  arch/loongarch/kernel/traps.c | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/arch/loongarch/kernel/traps.c
> > b/arch/loongarch/kernel/traps.c
> > index de8ebe20b666..7d5784eccf19 100644
> > --- a/arch/loongarch/kernel/traps.c
> > +++ b/arch/loongarch/kernel/traps.c
> > @@ -755,7 +755,7 @@ void per_cpu_trap_init(int cpu)
> >
> >       /* Initialise exception handlers */
> >       if (cpu == 0)
> > -             for (i = 0; i < 64; i++)
> > +             for (i = 0; i < EXCCODE_INT_START; i++)
> >                       set_handler(i * VECSIZE, handle_reserved,
> > VECSIZE);
> >
> >       tlb_init(cpu);
> >
> > base-commit: 804f6d04b1adae9602edbd6410c0ba3a556964fe
>

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

* Re: [PATCH] LoongArch: use EXCCODE_INT_START instead of hard coded value
  2023-03-13  7:52   ` Huacai Chen
@ 2023-03-13  9:18     ` Enze Li
  2023-03-13 13:07       ` Huacai Chen
  0 siblings, 1 reply; 5+ messages in thread
From: Enze Li @ 2023-03-13  9:18 UTC (permalink / raw)
  To: Huacai Chen; +Cc: kernel, loongarch, enze.li

Hi Huacai,

Thanks for your review :)

On Mon, 2023-03-13 at 15:52 +0800, Huacai Chen wrote:
> Though EXCCODE_INT_START is 64, its meaning is not suitable in this
> case.

Humm...Yeah.  Sharing the same macro may make things difficult to
understand.

What about defining a new macro to indicate this?  Something like
EXCCODE_NOR_NUM or EXCCODE_EXC_NUM?

For a newcomer, thank you in advance for your patience.

Thanks,
Enze

> 
> Huacai
> 
> On Mon, Mar 13, 2023 at 12:42 PM Enze Li <lienze@kylinos.cn> wrote:
> > Hi Huacai,
> > 
> > Kindly PING for this tiny patch. :)
> > 
> > Thanks,
> > Enze
> > 
> > On Fri, 2023-02-24 at 11:30 +0800, Enze Li wrote:
> > > The for loop in per_cpu_trap_init function use a hard coded
> > > length
> > > while
> > > setting default exception handler.  Use the proper define instead
> > > of
> > > hard coded value.
> > > 
> > > Signed-off-by: Enze Li <lienze@kylinos.cn>
> > > ---
> > >  arch/loongarch/kernel/traps.c | 2 +-
> > >  1 file changed, 1 insertion(+), 1 deletion(-)
> > > 
> > > diff --git a/arch/loongarch/kernel/traps.c
> > > b/arch/loongarch/kernel/traps.c
> > > index de8ebe20b666..7d5784eccf19 100644
> > > --- a/arch/loongarch/kernel/traps.c
> > > +++ b/arch/loongarch/kernel/traps.c
> > > @@ -755,7 +755,7 @@ void per_cpu_trap_init(int cpu)
> > > 
> > >       /* Initialise exception handlers */
> > >       if (cpu == 0)
> > > -             for (i = 0; i < 64; i++)
> > > +             for (i = 0; i < EXCCODE_INT_START; i++)
> > >                       set_handler(i * VECSIZE, handle_reserved,
> > > VECSIZE);
> > > 
> > >       tlb_init(cpu);
> > > 
> > > base-commit: 804f6d04b1adae9602edbd6410c0ba3a556964fe


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

* Re: [PATCH] LoongArch: use EXCCODE_INT_START instead of hard coded value
  2023-03-13  9:18     ` Enze Li
@ 2023-03-13 13:07       ` Huacai Chen
  0 siblings, 0 replies; 5+ messages in thread
From: Huacai Chen @ 2023-03-13 13:07 UTC (permalink / raw)
  To: Enze Li; +Cc: kernel, loongarch, enze.li

On Mon, Mar 13, 2023 at 5:18 PM Enze Li <lienze@kylinos.cn> wrote:
>
> Hi Huacai,
>
> Thanks for your review :)
>
> On Mon, 2023-03-13 at 15:52 +0800, Huacai Chen wrote:
> > Though EXCCODE_INT_START is 64, its meaning is not suitable in this
> > case.
>
> Humm...Yeah.  Sharing the same macro may make things difficult to
> understand.
>
> What about defining a new macro to indicate this?  Something like
> EXCCODE_NOR_NUM or EXCCODE_EXC_NUM?
I prefer to keep it as original.


Huacai
>
> For a newcomer, thank you in advance for your patience.
>
> Thanks,
> Enze
>
> >
> > Huacai
> >
> > On Mon, Mar 13, 2023 at 12:42 PM Enze Li <lienze@kylinos.cn> wrote:
> > > Hi Huacai,
> > >
> > > Kindly PING for this tiny patch. :)
> > >
> > > Thanks,
> > > Enze
> > >
> > > On Fri, 2023-02-24 at 11:30 +0800, Enze Li wrote:
> > > > The for loop in per_cpu_trap_init function use a hard coded
> > > > length
> > > > while
> > > > setting default exception handler.  Use the proper define instead
> > > > of
> > > > hard coded value.
> > > >
> > > > Signed-off-by: Enze Li <lienze@kylinos.cn>
> > > > ---
> > > >  arch/loongarch/kernel/traps.c | 2 +-
> > > >  1 file changed, 1 insertion(+), 1 deletion(-)
> > > >
> > > > diff --git a/arch/loongarch/kernel/traps.c
> > > > b/arch/loongarch/kernel/traps.c
> > > > index de8ebe20b666..7d5784eccf19 100644
> > > > --- a/arch/loongarch/kernel/traps.c
> > > > +++ b/arch/loongarch/kernel/traps.c
> > > > @@ -755,7 +755,7 @@ void per_cpu_trap_init(int cpu)
> > > >
> > > >       /* Initialise exception handlers */
> > > >       if (cpu == 0)
> > > > -             for (i = 0; i < 64; i++)
> > > > +             for (i = 0; i < EXCCODE_INT_START; i++)
> > > >                       set_handler(i * VECSIZE, handle_reserved,
> > > > VECSIZE);
> > > >
> > > >       tlb_init(cpu);
> > > >
> > > > base-commit: 804f6d04b1adae9602edbd6410c0ba3a556964fe
>
>

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

end of thread, other threads:[~2023-03-13 13:07 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-02-24  3:30 [PATCH] LoongArch: use EXCCODE_INT_START instead of hard coded value Enze Li
2023-03-13  2:55 ` Enze Li
2023-03-13  7:52   ` Huacai Chen
2023-03-13  9:18     ` Enze Li
2023-03-13 13:07       ` Huacai Chen

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.