LoongArch: Align FPU register state to 32 bytes
PATCH 1/1 LoongArch: Align FPU register state to 32 bytes
Move fpr to the beginning of struct loongarch_fpu so it is naturally aligned to FPU_ALIGN (32 bytes), improving 256-bit SIMD (LASX) context switch performance.
--- arch/loongarch/include/asm/processor.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/loongarch/include/asm/processor.h +1 -1
@@ -80,10 +80,10 @@ BUILD_FPR_ACCESS(32) BUILD_FPR_ACCESS(64)struct loongarch_fpu { +union fpureg fpr[NUM_FPU_REGS ];uint64_t fcc;/* 8x8 */ uint32_t fcsr;uint32_t ftop; -union fpureg fpr[NUM_FPU_REGS ]; };struct loongarch_lbt {
Signature · 1 line
2.53.0
Applied, thanks.
Huacai
Quoted 29 lines · Lisa Robinson
Move fpr to the beginning of struct
loongarch_fpuso it is naturally aligned toFPU_ALIGN(32 bytes), improving 256-bit SIMD (LASX) context switch performance.Signed-off-by Lisa Robinson <[email protected]>--- arch/loongarch/include/asm/processor.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)arch/loongarch/include/asm/processor.h +1
-2@@ -80,10 +80,10 @@ BUILD_FPR_ACCESS(32) BUILD_FPR_ACCESS(64)struct loongarch_fpu { +union fpureg fpr[NUM_FPU_REGS ];uint64_t fcc;/* 8x8 */ uint32_t fcsr;uint32_t ftop; -union fpureg fpr[NUM_FPU_REGS ]; };struct loongarch_lbt { --2.53.0
Huacai Chen
maintainerQuoted 2 lines · Huacai Chen
Applied, thanks.
I'm sorry, I reverted this patch because it breaks the partial copy optimization in arch_dup_task_struct().
Huacai
Quoted 33 lines
Huacai
Quoted 29 lines · Lisa Robinson
Move fpr to the beginning of struct
loongarch_fpuso it is naturally aligned toFPU_ALIGN(32 bytes), improving 256-bit SIMD (LASX) context switch performance.Signed-off-by Lisa Robinson <[email protected]>--- arch/loongarch/include/asm/processor.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)arch/loongarch/include/asm/processor.h +1
-2@@ -80,10 +80,10 @@ BUILD_FPR_ACCESS(32) BUILD_FPR_ACCESS(64)struct loongarch_fpu { +union fpureg fpr[NUM_FPU_REGS ];uint64_t fcc;/* 8x8 */ uint32_t fcsr;uint32_t ftop; -union fpureg fpr[NUM_FPU_REGS ]; };struct loongarch_lbt { --2.53.0
Huacai Chen
maintainerQuoted 6 lines · Huacai Chen
Quoted 2 lines · Huacai Chen
Applied, thanks.
I'm sorry, I reverted this patch because it breaks the partial copy optimization in
arch_dup_task_struct().
Fixed as this:
https://github.com/chenhuacai/linux/commit/c1365bc97d609438809d5d44d338adfc09767d6f
Huacai
Quoted 36 lines
Huacai
Quoted 33 lines
Huacai
Quoted 29 lines · Lisa Robinson
Move fpr to the beginning of struct
loongarch_fpuso it is naturally aligned toFPU_ALIGN(32 bytes), improving 256-bit SIMD (LASX) context switch performance.Signed-off-by Lisa Robinson <[email protected]>--- arch/loongarch/include/asm/processor.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)arch/loongarch/include/asm/processor.h +1
-2@@ -80,10 +80,10 @@ BUILD_FPR_ACCESS(32) BUILD_FPR_ACCESS(64)struct loongarch_fpu { +union fpureg fpr[NUM_FPU_REGS ];uint64_t fcc;/* 8x8 */ uint32_t fcsr;uint32_t ftop; -union fpureg fpr[NUM_FPU_REGS ]; };struct loongarch_lbt { --2.53.0
Quoted 10 lines · Huacai Chen
Quoted 6 lines · Huacai Chen
Quoted 2 lines · Huacai Chen
Applied, thanks.
I'm sorry, I reverted this patch because it breaks the partial copy optimization in
arch_dup_task_struct().Fixed as this:
https://github.com/chenhuacai/linux/commit/c1365bc97d609438809d5d44d338adfc09767d6f
Thanks for catching and fixing this.
Lisa
Quoted 39 lines
Huacai
Quoted 36 lines
Huacai
Quoted 33 lines
Huacai
Quoted 29 lines · Lisa Robinson
Move fpr to the beginning of struct
loongarch_fpuso it is naturally aligned toFPU_ALIGN(32 bytes), improving 256-bit SIMD (LASX) context switch performance.Signed-off-by Lisa Robinson <[email protected]>--- arch/loongarch/include/asm/processor.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)arch/loongarch/include/asm/processor.h +1
-2@@ -80,10 +80,10 @@ BUILD_FPR_ACCESS(32) BUILD_FPR_ACCESS(64)struct loongarch_fpu { +union fpureg fpr[NUM_FPU_REGS ];uint64_t fcc;/* 8x8 */ uint32_t fcsr;uint32_t ftop; -union fpureg fpr[NUM_FPU_REGS ]; };struct loongarch_lbt { --2.53.0