Skip to content

Commit 7a3907c

Browse files
specialpointcentralyetist
authored andcommitted
LoongArch: Add LBT extensions support
Loongson Binary Translation (LBT) is used to accelerate binary translation, which contains 4 sketch (scratch) registers (scr0 to scr3), x86/ARM eflags (eflags) and x87 fpu stack pointer (ftop). This patch support kernel to save/restore these registers, handle the LBT exception and maintain sigcontext. Signed-off-by: Qi Hu <huqi@loongson.cn>
1 parent 07d0ddf commit 7a3907c

19 files changed

Lines changed: 913 additions & 10 deletions

arch/loongarch/Kconfig

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -545,6 +545,15 @@ config CPU_HAS_LASX
545545

546546
If unsure, say Y.
547547

548+
config CPU_HAS_LBT
549+
bool "Support for Loongson Binary Translation"
550+
help
551+
Loongson Binary Translation (LBT) introduces 4 sketch registers (SCR0 to SCR3),
552+
x86/ARM eflags (eflags) and x87 fpu stack pointer (ftop).
553+
When this option is enabled, the kernel will support allocation and switching
554+
LBT related registers.
555+
If you want to use this feature or Loongson Architecture Translator (LAT), say Y.
556+
548557
config CPU_HAS_PREFETCH
549558
bool
550559
default y

arch/loongarch/include/asm/asm-prototypes.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
#include <linux/uaccess.h>
33
#include <asm/checksum.h>
44
#include <asm/fpu.h>
5+
#include <asm/lbt.h>
56
#include <asm/mmu_context.h>
67
#include <asm/page.h>
78
#include <asm/ftrace.h>

0 commit comments

Comments
 (0)