2023-06-08 02:35:18

by Qi Hu

[permalink] [raw]
Subject: [PATCH v2] LoongArch: Fix function write_fcsr

Function "write_fcsr" uses wrong asm dest. Fix it!

Reported-by: Miao HAO <[email protected]>
Signed-off-by: Qi Hu <[email protected]>
---
arch/loongarch/include/asm/loongarch.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/loongarch/include/asm/loongarch.h b/arch/loongarch/include/asm/loongarch.h
index b3323ab5b78d..35e8a52fea11 100644
--- a/arch/loongarch/include/asm/loongarch.h
+++ b/arch/loongarch/include/asm/loongarch.h
@@ -1496,7 +1496,7 @@ __BUILD_CSR_OP(tlbidx)
#define write_fcsr(dest, val) \
do { \
__asm__ __volatile__( \
- " movgr2fcsr %0, "__stringify(dest)" \n" \
+ " movgr2fcsr "__stringify(dest)", %0 \n" \
: : "r" (val)); \
} while (0)

--
2.40.1



2023-06-09 02:24:30

by Huacai Chen

[permalink] [raw]
Subject: Re: [PATCH v2] LoongArch: Fix function write_fcsr

Queued, thanks.

Huacai

On Thu, Jun 8, 2023 at 10:27 AM Qi Hu <[email protected]> wrote:
>
> Function "write_fcsr" uses wrong asm dest. Fix it!
>
> Reported-by: Miao HAO <[email protected]>
> Signed-off-by: Qi Hu <[email protected]>
> ---
> arch/loongarch/include/asm/loongarch.h | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/arch/loongarch/include/asm/loongarch.h b/arch/loongarch/include/asm/loongarch.h
> index b3323ab5b78d..35e8a52fea11 100644
> --- a/arch/loongarch/include/asm/loongarch.h
> +++ b/arch/loongarch/include/asm/loongarch.h
> @@ -1496,7 +1496,7 @@ __BUILD_CSR_OP(tlbidx)
> #define write_fcsr(dest, val) \
> do { \
> __asm__ __volatile__( \
> - " movgr2fcsr %0, "__stringify(dest)" \n" \
> + " movgr2fcsr "__stringify(dest)", %0 \n" \
> : : "r" (val)); \
> } while (0)
>
> --
> 2.40.1
>