* [PATCH v1 0/6] linux-user/loongarch64: Add LSX/LASX sigcontext
@ 2023-10-10 3:36 Song Gao
2023-10-10 3:36 ` [PATCH v1 1/6] target/loongarch: Add env->extctx_flags for user-mode setup extcontext Song Gao
` (6 more replies)
0 siblings, 7 replies; 18+ messages in thread
From: Song Gao @ 2023-10-10 3:36 UTC (permalink / raw)
To: qemu-devel
Cc: richard.henderson, philmd, laurent, maobibo, yangxiaojuan,
laurent
Hi, All.
This series adds save/restore sigcontext.
We use extctx_flags to choces which sigcontext need save/restore.
The extctx_flags default value is EXTCTX_FLAGS_FPU, we need
save/restore fpu context.
After a LSX/LASX instruction is execed, extctx_flags value change to
EXTCTX_FLAGS_LSX/LASX, we always need save/restore lsx/lasx context.
The test_signal.c is a simple test.
The default vreg len is 64. After execed a LSX instruction, the vreg len is
128, and then we exec a FPU instruction, the vreg len is also 128. After
execed a LASX instruction, the vreg len is 256, and then we exec a FPU
instruction, the vreg len is also 256.
test_signal.c:
#include <unistd.h>
#include <stdio.h>
#include <stdlib.h>
#include <errno.h>
#include <signal.h>
#include <asm/ucontext.h>
#include <setjmp.h>
#include <stdint.h>
#include <string.h>
static sigjmp_buf jmpbuf;
struct _ctx_layout {
struct sctx_info *addr;
unsigned int size;
};
struct extctx_layout {
unsigned long size;
unsigned int flags;
struct _ctx_layout fpu;
struct _ctx_layout lsx;
struct _ctx_layout lasx;
struct _ctx_layout end;
};
static int parse_extcontext(struct sigcontext *sc, struct extctx_layout *extctx)
{
uint32_t magic, size;
struct sctx_info *info = (struct sctx_info *)&sc->sc_extcontext;
while(1) {
magic = (uint32_t)info->magic;
size = (uint32_t)info->size;
printf("magic is %lx\n", magic);
printf("size is %lx\n", size);
switch (magic) {
case 0: /* END*/
return 0;
case FPU_CTX_MAGIC:
if (size < (sizeof(struct sctx_info) +
sizeof(struct fpu_context))) {
return -1;
}
extctx->fpu.addr = info;
break;
case LSX_CTX_MAGIC:
if (size < (sizeof(struct sctx_info) +
sizeof(struct lsx_context))) {
return -1;
}
extctx->lsx.addr = info;
break;
case LASX_CTX_MAGIC:
if (size < (sizeof(struct sctx_info) +
sizeof(struct lasx_context))) {
return -1;
}
extctx->lasx.addr = info;
break;
default:
return -1;
}
info = (struct sctx_info *)((char *)info +size);
}
return 0;
}
static int n = 0;
static void do_signal(int sig, siginfo_t *info, void *ucontext)
{
int i;
struct ucontext *uc = (struct ucontext *)ucontext;
struct extctx_layout extctx;
memset(&extctx, 0, sizeof(struct extctx_layout));
printf("pc : %016lx\n", uc->uc_mcontext.sc_pc);
parse_extcontext(&uc->uc_mcontext, &extctx);
if (n < 5) {
printf("extctx.lasx.addr is %lx\n", extctx.lasx.addr);
printf("extctx.lsx.addr is %lx\n", extctx.lsx.addr);
printf("extctx.fpu.addr is %lx\n", extctx.fpu.addr);
if (extctx.lasx.addr) {
struct sctx_info *info = extctx.lasx.addr;
struct lasx_context *lasx_ctx = (struct lasx_context *)((char *)info +
sizeof(struct sctx_info));
printf("vl : %016lx\n", 256);
} else if (extctx.lsx.addr) {
struct sctx_info *info = extctx.lsx.addr;
struct lsx_context *lsx_ctx = (struct lsx_context *)((char *)info +
sizeof(struct sctx_info));
printf("vl : %016lx\n", 128);
} else if (extctx.fpu.addr) {
struct sctx_info *info = extctx.fpu.addr;
struct fpu_context *fpu_ctx = (struct fpu_context *)((char *)info +
sizeof(struct sctx_info));
printf("vl : %016lx\n", 64);
}
}
n++;
printf("n is -------------- %d\n", n);
if (n == 1) {
// vaddwev.w.hu $vr27, $vr22, $vr29
asm volatile(".word 0x702ef6db");
printf("After execed LSX instructons vaddwev.w.hu\n");
}
if (n == 2) {
// 0101395e fadd.d $fs6, $ft2, $ft6
asm volatile(".word 0x0101395e");
printf("After execed FPU instructions fadd\n");
}
if (n == 3) {
// xvextrins.d $xr13, $xr15, 0x59
asm volatile(".word 0x778165ed");
printf("After execed LASX instructions xvextrins.d\n");
}
if (n == 4) {
// 0101395e fadd.d $fs6, $ft2, $ft6
asm volatile(".word 0x0101395e");
printf("After execed FPU instructions fadd\n");
}
if (n == 5) {
exit(0);
}
siglongjmp(jmpbuf, 1);
}
static int setup_signal(int sig, void (*fn) (int, siginfo_t *, void *))
{
struct sigaction my_act;
int ret;
my_act.sa_sigaction = fn;
my_act.sa_flags = SA_SIGINFO;
sigemptyset(&my_act.sa_mask);
ret = sigaction(sig, &my_act, NULL);
if (ret != 0) {
printf("FAIL: signal %d\n", sig);
return SIG_ERR;
}
}
int main()
{
setup_signal(SIGSEGV, do_signal);
sigsetjmp(jmpbuf, 1);
int result = 0;
void *addr = 0x00012;
result = *(int *)addr;
return 0;
}
On 3A5000 machine:
[root@archlinux LASX]# ./test_signal
pc : 0000000120000b44
magic is 46505501
size is 120
magic is 0
size is 0
extctx.lasx.addr is 0
extctx.lsx.addr is 0
extctx.fpu.addr is 7ffffbdd2120
vl : 0000000000000040
n is -------------- 1
After execed LSX instructons vaddwev.w.hu
pc : 0000000120000b44
magic is 53580001
size is 220
magic is 0
size is 0
extctx.lasx.addr is 0
extctx.lsx.addr is 7ffffbdd2020
extctx.fpu.addr is 0
vl : 0000000000000080
n is -------------- 2
After execed FPU instructions fadd
pc : 0000000120000b44
magic is 53580001
size is 220
magic is 0
size is 0
extctx.lasx.addr is 0
extctx.lsx.addr is 7ffffbdd2020
extctx.fpu.addr is 0
vl : 0000000000000080
n is -------------- 3
After execed LASX instructions xvextrins.d
pc : 0000000120000b44
magic is 41535801
size is 430
magic is 0
size is 0
extctx.lasx.addr is 7ffffbdd1e10
extctx.lsx.addr is 0
extctx.fpu.addr is 0
vl : 0000000000000100
n is -------------- 4
After execed FPU instructions fadd
pc : 0000000120000b44
magic is 41535801
size is 430
magic is 0
size is 0
extctx.lasx.addr is 7ffffbdd1e10
extctx.lsx.addr is 0
extctx.fpu.addr is 0
vl : 0000000000000100
n is -------------- 5
QEMU user-mode on X86:
root@loongson-KVM:~/work/code/qemu# ./build/qemu-loongarch64 test_signal
pc : 0000000120000b44
magic is 46505501
size is 120
magic is 0
size is 0
extctx.lasx.addr is 0
extctx.lsx.addr is 0
extctx.fpu.addr is 7fd92279f110
vl : 0000000000000040
n is -------------- 1
After exec LSX instructons vaddwev.w.hu
pc : 0000000120000b44
magic is 53580001
size is 220
magic is 0
size is 0
extctx.lasx.addr is 0
extctx.lsx.addr is 7fd92279f010
extctx.fpu.addr is 0
vl : 0000000000000080
n is -------------- 2
After execed FPU instructions fadd
pc : 0000000120000b44
magic is 53580001
size is 220
magic is 0
size is 0
extctx.lasx.addr is 0
extctx.lsx.addr is 7fd92279f010
extctx.fpu.addr is 0
vl : 0000000000000080
n is -------------- 3
After execed LASX instructions xvextrins.d
pc : 0000000120000b44
magic is 41535801
size is 430
magic is 0
size is 0
extctx.lasx.addr is 7fd92279ee00
extctx.lsx.addr is 0
extctx.fpu.addr is 0
vl : 0000000000000100
n is -------------- 4
After execed FPU instructions fadd
pc : 0000000120000b44
magic is 41535801
size is 430
magic is 0
size is 0
extctx.lasx.addr is 7fd92279ee00
extctx.lsx.addr is 0
extctx.fpu.addr is 0
vl : 0000000000000100
n is -------------- 5
Please review, thanks.
Song Gao (6):
target/loongarch: Add env->extctx_flags for user-mode setup extcontext
target/loongarch: Add set_vec_extctx to set LSX/LASX instructions
extctx_flags
linux-user/loongarch64: Fix setup_extcontext alloc wrong fpu_context
size
linux-user/loongarch64: setup_sigframe() set 'end' context size 0
linux-user/loongarch64: Add LSX sigcontext save/restore
linux-user/loongarch64: Add LASX sigcontext save/restore
linux-user/loongarch64/signal.c | 168 +++++++++++++++++---
target/loongarch/cpu.c | 2 +
target/loongarch/cpu.h | 2 +
target/loongarch/insn_trans/trans_vec.c.inc | 12 ++
target/loongarch/internals.h | 4 +
target/loongarch/translate.c | 3 +
target/loongarch/translate.h | 1 +
7 files changed, 170 insertions(+), 22 deletions(-)
--
2.25.1
^ permalink raw reply [flat|nested] 18+ messages in thread
* [PATCH v1 1/6] target/loongarch: Add env->extctx_flags for user-mode setup extcontext
2023-10-10 3:36 [PATCH v1 0/6] linux-user/loongarch64: Add LSX/LASX sigcontext Song Gao
@ 2023-10-10 3:36 ` Song Gao
2023-10-10 3:36 ` [PATCH v1 2/6] target/loongarch: Add set_vec_extctx to set LSX/LASX instructions extctx_flags Song Gao
` (5 subsequent siblings)
6 siblings, 0 replies; 18+ messages in thread
From: Song Gao @ 2023-10-10 3:36 UTC (permalink / raw)
To: qemu-devel
Cc: richard.henderson, philmd, laurent, maobibo, yangxiaojuan,
laurent
extctx_flags only for user-mode, and the default value is
EXTCTX_FLAGS_FPU, We only need save/restore fpu context,
After a LSX or LASX instruction is execed, the value change to
EXTCTX_FLAGS_LSX/LASX, and we need save/restore lsx/lasx
context. So if the binary no LSX/LASX instruction We only need
save/restore fpu context.
Signed-off-by: Song Gao <gaosong@loongson.cn>
---
target/loongarch/cpu.c | 2 ++
target/loongarch/cpu.h | 2 ++
target/loongarch/internals.h | 2 ++
target/loongarch/translate.c | 3 +++
target/loongarch/translate.h | 1 +
5 files changed, 10 insertions(+)
diff --git a/target/loongarch/cpu.c b/target/loongarch/cpu.c
index 2bea7ca5d5..32dd1b624b 100644
--- a/target/loongarch/cpu.c
+++ b/target/loongarch/cpu.c
@@ -546,6 +546,8 @@ static void loongarch_cpu_reset_hold(Object *obj)
memset(env->tlb, 0, sizeof(env->tlb));
#endif
+ env->extctx_flags = EXTCTX_FLAGS_FPU;
+
restore_fp_status(env);
cs->exception_index = -1;
}
diff --git a/target/loongarch/cpu.h b/target/loongarch/cpu.h
index 40e70a8119..7a94963e5f 100644
--- a/target/loongarch/cpu.h
+++ b/target/loongarch/cpu.h
@@ -295,6 +295,8 @@ typedef struct CPUArchState {
uint64_t lladdr; /* LL virtual address compared against SC */
uint64_t llval;
+ uint64_t extctx_flags; /* Use for user-mode setup extcontext */
+
/* LoongArch CSRs */
uint64_t CSR_CRMD;
uint64_t CSR_PRMD;
diff --git a/target/loongarch/internals.h b/target/loongarch/internals.h
index c492863cc5..01d98ac2fc 100644
--- a/target/loongarch/internals.h
+++ b/target/loongarch/internals.h
@@ -21,6 +21,8 @@
/* Global bit for huge page */
#define LOONGARCH_HGLOBAL_SHIFT 12
+#define EXTCTX_FLAGS_FPU 0b01
+
void loongarch_translate_init(void);
void loongarch_cpu_dump_state(CPUState *cpu, FILE *f, int flags);
diff --git a/target/loongarch/translate.c b/target/loongarch/translate.c
index 21f4db6fbd..9b82295542 100644
--- a/target/loongarch/translate.c
+++ b/target/loongarch/translate.c
@@ -147,6 +147,8 @@ static void loongarch_tr_init_disas_context(DisasContextBase *dcbase,
ctx->cpucfg1 = env->cpucfg[1];
ctx->cpucfg2 = env->cpucfg[2];
+
+ ctx->extctx_flags = env->extctx_flags;
}
static void loongarch_tr_tb_start(DisasContextBase *dcbase, CPUState *cs)
@@ -294,6 +296,7 @@ static void loongarch_tr_translate_insn(DisasContextBase *dcbase, CPUState *cs)
generate_exception(ctx, EXCCODE_INE);
}
+ env->extctx_flags |= ctx->extctx_flags;
ctx->base.pc_next += 4;
if (ctx->va32) {
diff --git a/target/loongarch/translate.h b/target/loongarch/translate.h
index 195f53573a..3bf1a1df86 100644
--- a/target/loongarch/translate.h
+++ b/target/loongarch/translate.h
@@ -40,6 +40,7 @@ typedef enum {
typedef struct DisasContext {
DisasContextBase base;
target_ulong page_start;
+ uint64_t extctx_flags;
uint32_t opcode;
uint16_t mem_idx;
uint16_t plv;
--
2.25.1
^ permalink raw reply related [flat|nested] 18+ messages in thread
* [PATCH v1 2/6] target/loongarch: Add set_vec_extctx to set LSX/LASX instructions extctx_flags
2023-10-10 3:36 [PATCH v1 0/6] linux-user/loongarch64: Add LSX/LASX sigcontext Song Gao
2023-10-10 3:36 ` [PATCH v1 1/6] target/loongarch: Add env->extctx_flags for user-mode setup extcontext Song Gao
@ 2023-10-10 3:36 ` Song Gao
2023-10-28 21:40 ` Richard Henderson
2023-10-10 3:36 ` [PATCH v1 3/6] linux-user/loongarch64: Fix setup_extcontext alloc wrong fpu_context size Song Gao
` (4 subsequent siblings)
6 siblings, 1 reply; 18+ messages in thread
From: Song Gao @ 2023-10-10 3:36 UTC (permalink / raw)
To: qemu-devel
Cc: richard.henderson, philmd, laurent, maobibo, yangxiaojuan,
laurent
Signed-off-by: Song Gao <gaosong@loongson.cn>
---
target/loongarch/insn_trans/trans_vec.c.inc | 12 ++++++++++++
target/loongarch/internals.h | 2 ++
2 files changed, 14 insertions(+)
diff --git a/target/loongarch/insn_trans/trans_vec.c.inc b/target/loongarch/insn_trans/trans_vec.c.inc
index 98f856bb29..aef16ef44a 100644
--- a/target/loongarch/insn_trans/trans_vec.c.inc
+++ b/target/loongarch/insn_trans/trans_vec.c.inc
@@ -23,8 +23,20 @@ static bool check_vec(DisasContext *ctx, uint32_t oprsz)
#else
+static void set_vec_extctx(DisasContext *ctx, uint32_t oprsz)
+{
+ if (oprsz == 16) {
+ ctx->extctx_flags |= EXTCTX_FLAGS_LSX;
+ }
+
+ if (oprsz == 32) {
+ ctx->extctx_flags |= EXTCTX_FLAGS_LASX;
+ }
+}
+
static bool check_vec(DisasContext *ctx, uint32_t oprsz)
{
+ set_vec_extctx(ctx, oprsz);
return true;
}
diff --git a/target/loongarch/internals.h b/target/loongarch/internals.h
index 01d98ac2fc..2efba9b859 100644
--- a/target/loongarch/internals.h
+++ b/target/loongarch/internals.h
@@ -22,6 +22,8 @@
#define LOONGARCH_HGLOBAL_SHIFT 12
#define EXTCTX_FLAGS_FPU 0b01
+#define EXTCTX_FLAGS_LSX 0b10
+#define EXTCTX_FLAGS_LASX 0b100
void loongarch_translate_init(void);
--
2.25.1
^ permalink raw reply related [flat|nested] 18+ messages in thread
* [PATCH v1 3/6] linux-user/loongarch64: Fix setup_extcontext alloc wrong fpu_context size
2023-10-10 3:36 [PATCH v1 0/6] linux-user/loongarch64: Add LSX/LASX sigcontext Song Gao
2023-10-10 3:36 ` [PATCH v1 1/6] target/loongarch: Add env->extctx_flags for user-mode setup extcontext Song Gao
2023-10-10 3:36 ` [PATCH v1 2/6] target/loongarch: Add set_vec_extctx to set LSX/LASX instructions extctx_flags Song Gao
@ 2023-10-10 3:36 ` Song Gao
2023-10-28 21:18 ` Richard Henderson
2023-10-10 3:36 ` [PATCH v1 4/6] linux-user/loongarch64: setup_sigframe() set 'end' context size 0 Song Gao
` (3 subsequent siblings)
6 siblings, 1 reply; 18+ messages in thread
From: Song Gao @ 2023-10-10 3:36 UTC (permalink / raw)
To: qemu-devel
Cc: richard.henderson, philmd, laurent, maobibo, yangxiaojuan,
laurent
See:
https://github.com/torvalds/linux/blob/master/arch/loongarch/kernel/signal.c
The alloc size is sizeof(struct target_fpu_context).
Signed-off-by: Song Gao <gaosong@loongson.cn>
---
linux-user/loongarch64/signal.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/linux-user/loongarch64/signal.c b/linux-user/loongarch64/signal.c
index 39572c1190..d97aa7db7f 100644
--- a/linux-user/loongarch64/signal.c
+++ b/linux-user/loongarch64/signal.c
@@ -100,7 +100,7 @@ static abi_ptr setup_extcontext(struct extctx_layout *extctx, abi_ptr sp)
/* For qemu, there is no lazy fp context switch, so fp always present. */
extctx->flags = SC_USED_FP;
sp = extframe_alloc(extctx, &extctx->fpu,
- sizeof(struct target_rt_sigframe), FPU_CTX_ALIGN, sp);
+ sizeof(struct target_fpu_context), FPU_CTX_ALIGN, sp);
return sp;
}
--
2.25.1
^ permalink raw reply related [flat|nested] 18+ messages in thread
* [PATCH v1 4/6] linux-user/loongarch64: setup_sigframe() set 'end' context size 0
2023-10-10 3:36 [PATCH v1 0/6] linux-user/loongarch64: Add LSX/LASX sigcontext Song Gao
` (2 preceding siblings ...)
2023-10-10 3:36 ` [PATCH v1 3/6] linux-user/loongarch64: Fix setup_extcontext alloc wrong fpu_context size Song Gao
@ 2023-10-10 3:36 ` Song Gao
2023-10-28 21:20 ` Richard Henderson
2023-10-10 3:37 ` [PATCH v1 5/6] linux-user/loongarch64: Add LSX sigcontext save/restore Song Gao
` (2 subsequent siblings)
6 siblings, 1 reply; 18+ messages in thread
From: Song Gao @ 2023-10-10 3:36 UTC (permalink / raw)
To: qemu-devel
Cc: richard.henderson, philmd, laurent, maobibo, yangxiaojuan,
laurent
See:
https://github.com/torvalds/linux/blob/master/arch/loongarch/kernel/signal.c
The kernel setup_sigcontext() set end context size 0.
Signed-off-by: Song Gao <gaosong@loongson.cn>
---
linux-user/loongarch64/signal.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/linux-user/loongarch64/signal.c b/linux-user/loongarch64/signal.c
index d97aa7db7f..277e9f5757 100644
--- a/linux-user/loongarch64/signal.c
+++ b/linux-user/loongarch64/signal.c
@@ -139,7 +139,7 @@ static void setup_sigframe(CPULoongArchState *env,
*/
info = extctx->end.haddr;
__put_user(0, &info->magic);
- __put_user(extctx->end.size, &info->size);
+ __put_user(0, &info->size);
}
static bool parse_extcontext(struct extctx_layout *extctx, abi_ptr frame)
--
2.25.1
^ permalink raw reply related [flat|nested] 18+ messages in thread
* [PATCH v1 5/6] linux-user/loongarch64: Add LSX sigcontext save/restore
2023-10-10 3:36 [PATCH v1 0/6] linux-user/loongarch64: Add LSX/LASX sigcontext Song Gao
` (3 preceding siblings ...)
2023-10-10 3:36 ` [PATCH v1 4/6] linux-user/loongarch64: setup_sigframe() set 'end' context size 0 Song Gao
@ 2023-10-10 3:37 ` Song Gao
2023-10-28 21:35 ` Richard Henderson
2023-10-10 3:37 ` [PATCH v1 6/6] linux-user/loongarch64: Add LASX " Song Gao
2023-10-23 2:47 ` [PATCH v1 0/6] linux-user/loongarch64: Add LSX/LASX sigcontext gaosong
6 siblings, 1 reply; 18+ messages in thread
From: Song Gao @ 2023-10-10 3:37 UTC (permalink / raw)
To: qemu-devel
Cc: richard.henderson, philmd, laurent, maobibo, yangxiaojuan,
laurent
Signed-off-by: Song Gao <gaosong@loongson.cn>
---
linux-user/loongarch64/signal.c | 107 ++++++++++++++++++++++++++------
1 file changed, 87 insertions(+), 20 deletions(-)
diff --git a/linux-user/loongarch64/signal.c b/linux-user/loongarch64/signal.c
index 277e9f5757..4b09e50a5f 100644
--- a/linux-user/loongarch64/signal.c
+++ b/linux-user/loongarch64/signal.c
@@ -33,6 +33,14 @@ struct target_fpu_context {
uint32_t fcsr;
} QEMU_ALIGNED(FPU_CTX_ALIGN);
+#define LSX_CTX_MAGIC 0x53580001
+#define LSX_CTX_ALIGN 16
+struct target_lsx_context {
+ uint64_t regs[2 * 32];
+ uint64_t fcc;
+ uint32_t fcsr;
+} QEMU_ALIGNED(LSX_CTX_ALIGN);
+
#define CONTEXT_INFO_ALIGN 16
struct target_sctx_info {
uint32_t magic;
@@ -66,9 +74,10 @@ struct ctx_layout {
};
struct extctx_layout {
- unsigned int size;
+ unsigned long size;
unsigned int flags;
struct ctx_layout fpu;
+ struct ctx_layout lsx;
struct ctx_layout end;
};
@@ -90,7 +99,8 @@ static abi_ptr extframe_alloc(struct extctx_layout *extctx,
return sp;
}
-static abi_ptr setup_extcontext(struct extctx_layout *extctx, abi_ptr sp)
+static abi_ptr setup_extcontext(CPULoongArchState *env,
+ struct extctx_layout *extctx, abi_ptr sp)
{
memset(extctx, 0, sizeof(struct extctx_layout));
@@ -99,8 +109,15 @@ static abi_ptr setup_extcontext(struct extctx_layout *extctx, abi_ptr sp)
/* For qemu, there is no lazy fp context switch, so fp always present. */
extctx->flags = SC_USED_FP;
- sp = extframe_alloc(extctx, &extctx->fpu,
+
+ if (env->extctx_flags & EXTCTX_FLAGS_LSX) {
+ sp = extframe_alloc(extctx, &extctx->lsx,
+ sizeof(struct target_lsx_context), LSX_CTX_ALIGN, sp);
+
+ } else if (env->extctx_flags & EXTCTX_FLAGS_FPU) {
+ sp = extframe_alloc(extctx, &extctx->fpu,
sizeof(struct target_fpu_context), FPU_CTX_ALIGN, sp);
+ }
return sp;
}
@@ -110,7 +127,6 @@ static void setup_sigframe(CPULoongArchState *env,
struct extctx_layout *extctx)
{
struct target_sctx_info *info;
- struct target_fpu_context *fpu_ctx;
int i;
__put_user(extctx->flags, &sc->sc_flags);
@@ -121,18 +137,39 @@ static void setup_sigframe(CPULoongArchState *env,
}
/*
- * Set fpu context
+ * Set extension context
*/
- info = extctx->fpu.haddr;
- __put_user(FPU_CTX_MAGIC, &info->magic);
- __put_user(extctx->fpu.size, &info->size);
- fpu_ctx = (struct target_fpu_context *)(info + 1);
- for (i = 0; i < 32; ++i) {
- __put_user(env->fpr[i].vreg.D(0), &fpu_ctx->regs[i]);
+ if (env->extctx_flags & EXTCTX_FLAGS_LSX) {
+ struct target_lsx_context *lsx_ctx;
+ info = extctx->lsx.haddr;
+
+ __put_user(LSX_CTX_MAGIC, &info->magic);
+ __put_user(extctx->lsx.size, &info->size);
+
+ lsx_ctx = (struct target_lsx_context *)(info + 1);
+
+ for (i = 0; i < 32; ++i) {
+ __put_user(env->fpr[i].vreg.UD(0), &lsx_ctx->regs[2 * i]);
+ __put_user(env->fpr[i].vreg.UD(1), &lsx_ctx->regs[2 * i + 1]);
+ }
+ __put_user(read_fcc(env), &lsx_ctx->fcc);
+ __put_user(env->fcsr0, &lsx_ctx->fcsr);
+ } else if (env->extctx_flags & EXTCTX_FLAGS_FPU) {
+ struct target_fpu_context *fpu_ctx;
+ info = extctx->fpu.haddr;
+
+ __put_user(FPU_CTX_MAGIC, &info->magic);
+ __put_user(extctx->fpu.size, &info->size);
+
+ fpu_ctx = (struct target_fpu_context *)(info + 1);
+
+ for (i = 0; i < 32; ++i) {
+ __put_user(env->fpr[i].vreg.UD(0), &fpu_ctx->regs[i]);
+ }
+ __put_user(read_fcc(env), &fpu_ctx->fcc);
+ __put_user(env->fcsr0, &fpu_ctx->fcsr);
}
- __put_user(read_fcc(env), &fpu_ctx->fcc);
- __put_user(env->fcsr0, &fpu_ctx->fcsr);
/*
* Set end context
@@ -169,6 +206,15 @@ static bool parse_extcontext(struct extctx_layout *extctx, abi_ptr frame)
extctx->fpu.size = size;
extctx->size += size;
break;
+ case LSX_CTX_MAGIC:
+ if (size < (sizeof(struct target_sctx_info) +
+ sizeof(struct target_lsx_context))) {
+ return false;
+ }
+ extctx->lsx.gaddr = frame;
+ extctx->lsx.size = size;
+ extctx->size += size;
+ break;
default:
return false;
}
@@ -182,19 +228,31 @@ static void restore_sigframe(CPULoongArchState *env,
struct extctx_layout *extctx)
{
int i;
+ uint64_t fcc;
__get_user(env->pc, &sc->sc_pc);
for (i = 1; i < 32; ++i) {
__get_user(env->gpr[i], &sc->sc_regs[i]);
}
- if (extctx->fpu.haddr) {
+ if (extctx->lsx.haddr) {
+ struct target_lsx_context *lsx_ctx =
+ extctx->lsx.haddr + sizeof(struct target_sctx_info);
+
+ for (i = 0; i < 32; ++i) {
+ __get_user(env->fpr[i].vreg.UD(0), &lsx_ctx->regs[2 * i]);
+ __get_user(env->fpr[i].vreg.UD(1), &lsx_ctx->regs[2 * i + 1]);
+ }
+ __get_user(fcc, &lsx_ctx->fcc);
+ write_fcc(env, fcc);
+ __get_user(env->fcsr0, &lsx_ctx->fcsr);
+ restore_fp_status(env);
+ } else if (extctx->fpu.haddr) {
struct target_fpu_context *fpu_ctx =
extctx->fpu.haddr + sizeof(struct target_sctx_info);
- uint64_t fcc;
for (i = 0; i < 32; ++i) {
- __get_user(env->fpr[i].vreg.D(0), &fpu_ctx->regs[i]);
+ __get_user(env->fpr[i].vreg.UD(0), &fpu_ctx->regs[i]);
}
__get_user(fcc, &fpu_ctx->fcc);
write_fcc(env, fcc);
@@ -214,7 +272,7 @@ static abi_ptr get_sigframe(struct target_sigaction *ka,
sp = target_sigsp(get_sp_from_cpustate(env), ka);
sp = ROUND_DOWN(sp, 16);
- sp = setup_extcontext(extctx, sp);
+ sp = setup_extcontext(env, extctx, sp);
sp -= sizeof(struct target_rt_sigframe);
assert(QEMU_IS_ALIGNED(sp, 16));
@@ -240,8 +298,14 @@ void setup_rt_frame(int sig, struct target_sigaction *ka,
force_sigsegv(sig);
return;
}
- extctx.fpu.haddr = (void *)frame + (extctx.fpu.gaddr - frame_addr);
- extctx.end.haddr = (void *)frame + (extctx.end.gaddr - frame_addr);
+
+ if (env->extctx_flags & EXTCTX_FLAGS_LSX) {
+ extctx.lsx.haddr = (void *)frame + (extctx.lsx.gaddr - frame_addr);
+ extctx.end.haddr = (void *)frame + (extctx.end.gaddr - frame_addr);
+ } else if (env->extctx_flags & EXTCTX_FLAGS_FPU) {
+ extctx.fpu.haddr = (void *)frame + (extctx.fpu.gaddr - frame_addr);
+ extctx.end.haddr = (void *)frame + (extctx.end.gaddr - frame_addr);
+ }
tswap_siginfo(&frame->rs_info, info);
@@ -284,7 +348,10 @@ long do_rt_sigreturn(CPULoongArchState *env)
if (!frame) {
goto badframe;
}
- if (extctx.fpu.gaddr) {
+
+ if (extctx.lsx.gaddr) {
+ extctx.lsx.haddr = (void *)frame + (extctx.lsx.gaddr - frame_addr);
+ } else if (extctx.fpu.gaddr) {
extctx.fpu.haddr = (void *)frame + (extctx.fpu.gaddr - frame_addr);
}
--
2.25.1
^ permalink raw reply related [flat|nested] 18+ messages in thread
* [PATCH v1 6/6] linux-user/loongarch64: Add LASX sigcontext save/restore
2023-10-10 3:36 [PATCH v1 0/6] linux-user/loongarch64: Add LSX/LASX sigcontext Song Gao
` (4 preceding siblings ...)
2023-10-10 3:37 ` [PATCH v1 5/6] linux-user/loongarch64: Add LSX sigcontext save/restore Song Gao
@ 2023-10-10 3:37 ` Song Gao
2023-10-23 2:47 ` [PATCH v1 0/6] linux-user/loongarch64: Add LSX/LASX sigcontext gaosong
6 siblings, 0 replies; 18+ messages in thread
From: Song Gao @ 2023-10-10 3:37 UTC (permalink / raw)
To: qemu-devel
Cc: richard.henderson, philmd, laurent, maobibo, yangxiaojuan,
laurent
Signed-off-by: Song Gao <gaosong@loongson.cn>
---
linux-user/loongarch64/signal.c | 67 ++++++++++++++++++++++++++++++---
1 file changed, 62 insertions(+), 5 deletions(-)
diff --git a/linux-user/loongarch64/signal.c b/linux-user/loongarch64/signal.c
index 4b09e50a5f..e5b7688a2e 100644
--- a/linux-user/loongarch64/signal.c
+++ b/linux-user/loongarch64/signal.c
@@ -41,6 +41,14 @@ struct target_lsx_context {
uint32_t fcsr;
} QEMU_ALIGNED(LSX_CTX_ALIGN);
+#define LASX_CTX_MAGIC 0x41535801
+#define LASX_CTX_ALIGN 32
+struct target_lasx_context {
+ uint64_t regs[4 * 32];
+ uint64_t fcc;
+ uint32_t fcsr;
+} QEMU_ALIGNED(LASX_CTX_ALIGN);
+
#define CONTEXT_INFO_ALIGN 16
struct target_sctx_info {
uint32_t magic;
@@ -78,6 +86,7 @@ struct extctx_layout {
unsigned int flags;
struct ctx_layout fpu;
struct ctx_layout lsx;
+ struct ctx_layout lasx;
struct ctx_layout end;
};
@@ -110,7 +119,10 @@ static abi_ptr setup_extcontext(CPULoongArchState *env,
/* For qemu, there is no lazy fp context switch, so fp always present. */
extctx->flags = SC_USED_FP;
- if (env->extctx_flags & EXTCTX_FLAGS_LSX) {
+ if (env->extctx_flags & EXTCTX_FLAGS_LASX) {
+ sp = extframe_alloc(extctx, &extctx->lasx,
+ sizeof(struct target_lasx_context), LASX_CTX_ALIGN, sp);
+ } else if (env->extctx_flags & EXTCTX_FLAGS_LSX) {
sp = extframe_alloc(extctx, &extctx->lsx,
sizeof(struct target_lsx_context), LSX_CTX_ALIGN, sp);
@@ -140,7 +152,24 @@ static void setup_sigframe(CPULoongArchState *env,
* Set extension context
*/
- if (env->extctx_flags & EXTCTX_FLAGS_LSX) {
+ if (env->extctx_flags & EXTCTX_FLAGS_LASX) {
+ struct target_lasx_context *lasx_ctx;
+ info = extctx->lasx.haddr;
+
+ __put_user(LASX_CTX_MAGIC, &info->magic);
+ __put_user(extctx->lasx.size, &info->size);
+
+ lasx_ctx = (struct target_lasx_context *)(info + 1);
+
+ for (i = 0; i < 32; ++i) {
+ __put_user(env->fpr[i].vreg.UD(0), &lasx_ctx->regs[4 * i]);
+ __put_user(env->fpr[i].vreg.UD(1), &lasx_ctx->regs[4 * i + 1]);
+ __put_user(env->fpr[i].vreg.UD(2), &lasx_ctx->regs[4 * i + 2]);
+ __put_user(env->fpr[i].vreg.UD(3), &lasx_ctx->regs[4 * i + 3]);
+ }
+ __put_user(read_fcc(env), &lasx_ctx->fcc);
+ __put_user(env->fcsr0, &lasx_ctx->fcsr);
+ } else if (env->extctx_flags & EXTCTX_FLAGS_LSX) {
struct target_lsx_context *lsx_ctx;
info = extctx->lsx.haddr;
@@ -215,6 +244,15 @@ static bool parse_extcontext(struct extctx_layout *extctx, abi_ptr frame)
extctx->lsx.size = size;
extctx->size += size;
break;
+ case LASX_CTX_MAGIC:
+ if (size < (sizeof(struct target_sctx_info) +
+ sizeof(struct target_lasx_context))) {
+ return false;
+ }
+ extctx->lasx.gaddr = frame;
+ extctx->lasx.size = size;
+ extctx->size += size;
+ break;
default:
return false;
}
@@ -235,7 +273,21 @@ static void restore_sigframe(CPULoongArchState *env,
__get_user(env->gpr[i], &sc->sc_regs[i]);
}
- if (extctx->lsx.haddr) {
+ if (extctx->lasx.haddr) {
+ struct target_lasx_context *lasx_ctx =
+ extctx->lasx.haddr + sizeof(struct target_sctx_info);
+
+ for (i = 0; i < 32; ++i) {
+ __get_user(env->fpr[i].vreg.UD(0), &lasx_ctx->regs[4 * i]);
+ __get_user(env->fpr[i].vreg.UD(1), &lasx_ctx->regs[4 * i + 1]);
+ __get_user(env->fpr[i].vreg.UD(2), &lasx_ctx->regs[4 * i + 2]);
+ __get_user(env->fpr[i].vreg.UD(3), &lasx_ctx->regs[4 * i + 3]);
+ }
+ __get_user(fcc, &lasx_ctx->fcc);
+ write_fcc(env, fcc);
+ __get_user(env->fcsr0, &lasx_ctx->fcsr);
+ restore_fp_status(env);
+ } else if (extctx->lsx.haddr) {
struct target_lsx_context *lsx_ctx =
extctx->lsx.haddr + sizeof(struct target_sctx_info);
@@ -299,7 +351,10 @@ void setup_rt_frame(int sig, struct target_sigaction *ka,
return;
}
- if (env->extctx_flags & EXTCTX_FLAGS_LSX) {
+ if (env->extctx_flags & EXTCTX_FLAGS_LASX) {
+ extctx.lasx.haddr = (void *)frame + (extctx.lasx.gaddr - frame_addr);
+ extctx.end.haddr = (void *)frame + (extctx.end.gaddr - frame_addr);
+ } else if (env->extctx_flags & EXTCTX_FLAGS_LSX) {
extctx.lsx.haddr = (void *)frame + (extctx.lsx.gaddr - frame_addr);
extctx.end.haddr = (void *)frame + (extctx.end.gaddr - frame_addr);
} else if (env->extctx_flags & EXTCTX_FLAGS_FPU) {
@@ -349,7 +404,9 @@ long do_rt_sigreturn(CPULoongArchState *env)
goto badframe;
}
- if (extctx.lsx.gaddr) {
+ if (extctx.lasx.gaddr) {
+ extctx.lasx.haddr = (void *)frame + (extctx.lasx.gaddr - frame_addr);
+ } else if (extctx.lsx.gaddr) {
extctx.lsx.haddr = (void *)frame + (extctx.lsx.gaddr - frame_addr);
} else if (extctx.fpu.gaddr) {
extctx.fpu.haddr = (void *)frame + (extctx.fpu.gaddr - frame_addr);
--
2.25.1
^ permalink raw reply related [flat|nested] 18+ messages in thread
* Re: [PATCH v1 0/6] linux-user/loongarch64: Add LSX/LASX sigcontext
2023-10-10 3:36 [PATCH v1 0/6] linux-user/loongarch64: Add LSX/LASX sigcontext Song Gao
` (5 preceding siblings ...)
2023-10-10 3:37 ` [PATCH v1 6/6] linux-user/loongarch64: Add LASX " Song Gao
@ 2023-10-23 2:47 ` gaosong
6 siblings, 0 replies; 18+ messages in thread
From: gaosong @ 2023-10-23 2:47 UTC (permalink / raw)
To: qemu-devel
Cc: richard.henderson, philmd, maobibo, laurent, deller,
Alex Bennée
Ping !
在 2023/10/10 上午11:36, Song Gao 写道:
> Hi, All.
>
> This series adds save/restore sigcontext.
>
> We use extctx_flags to choces which sigcontext need save/restore.
>
> The extctx_flags default value is EXTCTX_FLAGS_FPU, we need
> save/restore fpu context.
>
> After a LSX/LASX instruction is execed, extctx_flags value change to
> EXTCTX_FLAGS_LSX/LASX, we always need save/restore lsx/lasx context.
>
>
> The test_signal.c is a simple test.
>
> The default vreg len is 64. After execed a LSX instruction, the vreg len is
> 128, and then we exec a FPU instruction, the vreg len is also 128. After
> execed a LASX instruction, the vreg len is 256, and then we exec a FPU
> instruction, the vreg len is also 256.
>
> test_signal.c:
>
> #include <unistd.h>
> #include <stdio.h>
> #include <stdlib.h>
> #include <errno.h>
> #include <signal.h>
> #include <asm/ucontext.h>
> #include <setjmp.h>
> #include <stdint.h>
> #include <string.h>
>
> static sigjmp_buf jmpbuf;
>
> struct _ctx_layout {
> struct sctx_info *addr;
> unsigned int size;
> };
>
> struct extctx_layout {
> unsigned long size;
> unsigned int flags;
> struct _ctx_layout fpu;
> struct _ctx_layout lsx;
> struct _ctx_layout lasx;
> struct _ctx_layout end;
> };
> static int parse_extcontext(struct sigcontext *sc, struct extctx_layout *extctx)
> {
> uint32_t magic, size;
> struct sctx_info *info = (struct sctx_info *)&sc->sc_extcontext;
>
> while(1) {
> magic = (uint32_t)info->magic;
> size = (uint32_t)info->size;
>
> printf("magic is %lx\n", magic);
> printf("size is %lx\n", size);
> switch (magic) {
> case 0: /* END*/
> return 0;
> case FPU_CTX_MAGIC:
> if (size < (sizeof(struct sctx_info) +
> sizeof(struct fpu_context))) {
> return -1;
> }
> extctx->fpu.addr = info;
> break;
> case LSX_CTX_MAGIC:
> if (size < (sizeof(struct sctx_info) +
> sizeof(struct lsx_context))) {
> return -1;
> }
> extctx->lsx.addr = info;
> break;
> case LASX_CTX_MAGIC:
> if (size < (sizeof(struct sctx_info) +
> sizeof(struct lasx_context))) {
> return -1;
> }
> extctx->lasx.addr = info;
> break;
> default:
> return -1;
> }
> info = (struct sctx_info *)((char *)info +size);
> }
> return 0;
> }
>
> static int n = 0;
>
> static void do_signal(int sig, siginfo_t *info, void *ucontext)
> {
> int i;
> struct ucontext *uc = (struct ucontext *)ucontext;
> struct extctx_layout extctx;
>
> memset(&extctx, 0, sizeof(struct extctx_layout));
>
> printf("pc : %016lx\n", uc->uc_mcontext.sc_pc);
>
> parse_extcontext(&uc->uc_mcontext, &extctx);
>
> if (n < 5) {
> printf("extctx.lasx.addr is %lx\n", extctx.lasx.addr);
> printf("extctx.lsx.addr is %lx\n", extctx.lsx.addr);
> printf("extctx.fpu.addr is %lx\n", extctx.fpu.addr);
>
> if (extctx.lasx.addr) {
> struct sctx_info *info = extctx.lasx.addr;
> struct lasx_context *lasx_ctx = (struct lasx_context *)((char *)info +
> sizeof(struct sctx_info));
> printf("vl : %016lx\n", 256);
> } else if (extctx.lsx.addr) {
> struct sctx_info *info = extctx.lsx.addr;
> struct lsx_context *lsx_ctx = (struct lsx_context *)((char *)info +
> sizeof(struct sctx_info));
> printf("vl : %016lx\n", 128);
> } else if (extctx.fpu.addr) {
> struct sctx_info *info = extctx.fpu.addr;
> struct fpu_context *fpu_ctx = (struct fpu_context *)((char *)info +
> sizeof(struct sctx_info));
> printf("vl : %016lx\n", 64);
> }
> }
> n++;
>
> printf("n is -------------- %d\n", n);
> if (n == 1) {
> // vaddwev.w.hu $vr27, $vr22, $vr29
> asm volatile(".word 0x702ef6db");
> printf("After execed LSX instructons vaddwev.w.hu\n");
> }
>
> if (n == 2) {
> // 0101395e fadd.d $fs6, $ft2, $ft6
> asm volatile(".word 0x0101395e");
> printf("After execed FPU instructions fadd\n");
> }
>
> if (n == 3) {
> // xvextrins.d $xr13, $xr15, 0x59
> asm volatile(".word 0x778165ed");
> printf("After execed LASX instructions xvextrins.d\n");
> }
>
> if (n == 4) {
> // 0101395e fadd.d $fs6, $ft2, $ft6
> asm volatile(".word 0x0101395e");
> printf("After execed FPU instructions fadd\n");
> }
>
> if (n == 5) {
> exit(0);
> }
>
> siglongjmp(jmpbuf, 1);
> }
>
> static int setup_signal(int sig, void (*fn) (int, siginfo_t *, void *))
> {
> struct sigaction my_act;
> int ret;
>
> my_act.sa_sigaction = fn;
> my_act.sa_flags = SA_SIGINFO;
> sigemptyset(&my_act.sa_mask);
>
> ret = sigaction(sig, &my_act, NULL);
> if (ret != 0) {
> printf("FAIL: signal %d\n", sig);
> return SIG_ERR;
> }
> }
>
> int main()
> {
> setup_signal(SIGSEGV, do_signal);
>
> sigsetjmp(jmpbuf, 1);
>
> int result = 0;
> void *addr = 0x00012;
> result = *(int *)addr;
>
> return 0;
> }
>
>
> On 3A5000 machine:
>
> [root@archlinux LASX]# ./test_signal
> pc : 0000000120000b44
> magic is 46505501
> size is 120
> magic is 0
> size is 0
> extctx.lasx.addr is 0
> extctx.lsx.addr is 0
> extctx.fpu.addr is 7ffffbdd2120
> vl : 0000000000000040
> n is -------------- 1
> After execed LSX instructons vaddwev.w.hu
> pc : 0000000120000b44
> magic is 53580001
> size is 220
> magic is 0
> size is 0
> extctx.lasx.addr is 0
> extctx.lsx.addr is 7ffffbdd2020
> extctx.fpu.addr is 0
> vl : 0000000000000080
> n is -------------- 2
> After execed FPU instructions fadd
> pc : 0000000120000b44
> magic is 53580001
> size is 220
> magic is 0
> size is 0
> extctx.lasx.addr is 0
> extctx.lsx.addr is 7ffffbdd2020
> extctx.fpu.addr is 0
> vl : 0000000000000080
> n is -------------- 3
> After execed LASX instructions xvextrins.d
> pc : 0000000120000b44
> magic is 41535801
> size is 430
> magic is 0
> size is 0
> extctx.lasx.addr is 7ffffbdd1e10
> extctx.lsx.addr is 0
> extctx.fpu.addr is 0
> vl : 0000000000000100
> n is -------------- 4
> After execed FPU instructions fadd
> pc : 0000000120000b44
> magic is 41535801
> size is 430
> magic is 0
> size is 0
> extctx.lasx.addr is 7ffffbdd1e10
> extctx.lsx.addr is 0
> extctx.fpu.addr is 0
> vl : 0000000000000100
> n is -------------- 5
>
> QEMU user-mode on X86:
>
> root@loongson-KVM:~/work/code/qemu# ./build/qemu-loongarch64 test_signal
> pc : 0000000120000b44
> magic is 46505501
> size is 120
> magic is 0
> size is 0
> extctx.lasx.addr is 0
> extctx.lsx.addr is 0
> extctx.fpu.addr is 7fd92279f110
> vl : 0000000000000040
> n is -------------- 1
> After exec LSX instructons vaddwev.w.hu
> pc : 0000000120000b44
> magic is 53580001
> size is 220
> magic is 0
> size is 0
> extctx.lasx.addr is 0
> extctx.lsx.addr is 7fd92279f010
> extctx.fpu.addr is 0
> vl : 0000000000000080
> n is -------------- 2
> After execed FPU instructions fadd
> pc : 0000000120000b44
> magic is 53580001
> size is 220
> magic is 0
> size is 0
> extctx.lasx.addr is 0
> extctx.lsx.addr is 7fd92279f010
> extctx.fpu.addr is 0
> vl : 0000000000000080
> n is -------------- 3
> After execed LASX instructions xvextrins.d
> pc : 0000000120000b44
> magic is 41535801
> size is 430
> magic is 0
> size is 0
> extctx.lasx.addr is 7fd92279ee00
> extctx.lsx.addr is 0
> extctx.fpu.addr is 0
> vl : 0000000000000100
> n is -------------- 4
> After execed FPU instructions fadd
> pc : 0000000120000b44
> magic is 41535801
> size is 430
> magic is 0
> size is 0
> extctx.lasx.addr is 7fd92279ee00
> extctx.lsx.addr is 0
> extctx.fpu.addr is 0
> vl : 0000000000000100
> n is -------------- 5
>
>
> Please review, thanks.
>
> Song Gao (6):
> target/loongarch: Add env->extctx_flags for user-mode setup extcontext
> target/loongarch: Add set_vec_extctx to set LSX/LASX instructions
> extctx_flags
> linux-user/loongarch64: Fix setup_extcontext alloc wrong fpu_context
> size
> linux-user/loongarch64: setup_sigframe() set 'end' context size 0
> linux-user/loongarch64: Add LSX sigcontext save/restore
> linux-user/loongarch64: Add LASX sigcontext save/restore
>
> linux-user/loongarch64/signal.c | 168 +++++++++++++++++---
> target/loongarch/cpu.c | 2 +
> target/loongarch/cpu.h | 2 +
> target/loongarch/insn_trans/trans_vec.c.inc | 12 ++
> target/loongarch/internals.h | 4 +
> target/loongarch/translate.c | 3 +
> target/loongarch/translate.h | 1 +
> 7 files changed, 170 insertions(+), 22 deletions(-)
>
^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: [PATCH v1 3/6] linux-user/loongarch64: Fix setup_extcontext alloc wrong fpu_context size
2023-10-10 3:36 ` [PATCH v1 3/6] linux-user/loongarch64: Fix setup_extcontext alloc wrong fpu_context size Song Gao
@ 2023-10-28 21:18 ` Richard Henderson
0 siblings, 0 replies; 18+ messages in thread
From: Richard Henderson @ 2023-10-28 21:18 UTC (permalink / raw)
To: Song Gao, qemu-devel; +Cc: philmd, laurent, maobibo, yangxiaojuan, laurent
On 10/9/23 20:36, Song Gao wrote:
> See:
> https://github.com/torvalds/linux/blob/master/arch/loongarch/kernel/signal.c
>
> The alloc size is sizeof(struct target_fpu_context).
>
> Signed-off-by: Song Gao <gaosong@loongson.cn>
> ---
> linux-user/loongarch64/signal.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
r~
^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: [PATCH v1 4/6] linux-user/loongarch64: setup_sigframe() set 'end' context size 0
2023-10-10 3:36 ` [PATCH v1 4/6] linux-user/loongarch64: setup_sigframe() set 'end' context size 0 Song Gao
@ 2023-10-28 21:20 ` Richard Henderson
0 siblings, 0 replies; 18+ messages in thread
From: Richard Henderson @ 2023-10-28 21:20 UTC (permalink / raw)
To: Song Gao, qemu-devel; +Cc: philmd, laurent, maobibo, yangxiaojuan, laurent
On 10/9/23 20:36, Song Gao wrote:
> See:
> https://github.com/torvalds/linux/blob/master/arch/loongarch/kernel/signal.c
>
> The kernel setup_sigcontext() set end context size 0.
>
> Signed-off-by: Song Gao <gaosong@loongson.cn>
> ---
> linux-user/loongarch64/signal.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
r~
^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: [PATCH v1 5/6] linux-user/loongarch64: Add LSX sigcontext save/restore
2023-10-10 3:37 ` [PATCH v1 5/6] linux-user/loongarch64: Add LSX sigcontext save/restore Song Gao
@ 2023-10-28 21:35 ` Richard Henderson
2023-10-30 3:28 ` gaosong
0 siblings, 1 reply; 18+ messages in thread
From: Richard Henderson @ 2023-10-28 21:35 UTC (permalink / raw)
To: Song Gao, qemu-devel; +Cc: philmd, laurent, maobibo, yangxiaojuan, laurent
On 10/9/23 20:37, Song Gao wrote:
> Signed-off-by: Song Gao <gaosong@loongson.cn>
> ---
> linux-user/loongarch64/signal.c | 107 ++++++++++++++++++++++++++------
> 1 file changed, 87 insertions(+), 20 deletions(-)
>
> diff --git a/linux-user/loongarch64/signal.c b/linux-user/loongarch64/signal.c
> index 277e9f5757..4b09e50a5f 100644
> --- a/linux-user/loongarch64/signal.c
> +++ b/linux-user/loongarch64/signal.c
> @@ -33,6 +33,14 @@ struct target_fpu_context {
> uint32_t fcsr;
> } QEMU_ALIGNED(FPU_CTX_ALIGN);
>
> +#define LSX_CTX_MAGIC 0x53580001
> +#define LSX_CTX_ALIGN 16
> +struct target_lsx_context {
> + uint64_t regs[2 * 32];
> + uint64_t fcc;
> + uint32_t fcsr;
> +} QEMU_ALIGNED(LSX_CTX_ALIGN);
It probably doesn't matter here because fo the alignment, but all types within target
structures should be using abi_{ullong,uint} etc.
> @@ -99,8 +109,15 @@ static abi_ptr setup_extcontext(struct extctx_layout *extctx, abi_ptr sp)
>
> /* For qemu, there is no lazy fp context switch, so fp always present. */
> extctx->flags = SC_USED_FP;
> - sp = extframe_alloc(extctx, &extctx->fpu,
> +
> + if (env->extctx_flags & EXTCTX_FLAGS_LSX) {
> + sp = extframe_alloc(extctx, &extctx->lsx,
> + sizeof(struct target_lsx_context), LSX_CTX_ALIGN, sp);
> +
> + } else if (env->extctx_flags & EXTCTX_FLAGS_FPU) {
> + sp = extframe_alloc(extctx, &extctx->fpu,
> sizeof(struct target_fpu_context), FPU_CTX_ALIGN, sp);
> + }
I think this is overly complicated. (1) The fpu is always present, and (2) you don't need
a special flag on env, you can check the same CSR bits as for system mode.
I'll note that while this layout matches the kernel, it is an unfortunate set of data
structures. Any program has to look for all of {FPU,LSX,LASX}_CTX_MAGIC in order to find
the basic fp registers.
r~
^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: [PATCH v1 2/6] target/loongarch: Add set_vec_extctx to set LSX/LASX instructions extctx_flags
2023-10-10 3:36 ` [PATCH v1 2/6] target/loongarch: Add set_vec_extctx to set LSX/LASX instructions extctx_flags Song Gao
@ 2023-10-28 21:40 ` Richard Henderson
2023-10-30 3:28 ` gaosong
0 siblings, 1 reply; 18+ messages in thread
From: Richard Henderson @ 2023-10-28 21:40 UTC (permalink / raw)
To: Song Gao, qemu-devel; +Cc: philmd, laurent, maobibo, yangxiaojuan, laurent
On 10/9/23 20:36, Song Gao wrote:
> Signed-off-by: Song Gao <gaosong@loongson.cn>
> ---
> target/loongarch/insn_trans/trans_vec.c.inc | 12 ++++++++++++
> target/loongarch/internals.h | 2 ++
> 2 files changed, 14 insertions(+)
>
> diff --git a/target/loongarch/insn_trans/trans_vec.c.inc b/target/loongarch/insn_trans/trans_vec.c.inc
> index 98f856bb29..aef16ef44a 100644
> --- a/target/loongarch/insn_trans/trans_vec.c.inc
> +++ b/target/loongarch/insn_trans/trans_vec.c.inc
> @@ -23,8 +23,20 @@ static bool check_vec(DisasContext *ctx, uint32_t oprsz)
>
> #else
>
> +static void set_vec_extctx(DisasContext *ctx, uint32_t oprsz)
> +{
> + if (oprsz == 16) {
> + ctx->extctx_flags |= EXTCTX_FLAGS_LSX;
> + }
> +
> + if (oprsz == 32) {
> + ctx->extctx_flags |= EXTCTX_FLAGS_LASX;
> + }
> +}
> +
> static bool check_vec(DisasContext *ctx, uint32_t oprsz)
> {
> + set_vec_extctx(ctx, oprsz);
> return true;
> }
This doesn't do anything. Nothing copies the changed value back to env.
Anyway, I think this is the wrong way to go about it.
If you want to track what the program is using, you should do it exactly like the real
kernel: disable the execution unit, have the program trap, and the enable the execution
unit when the trap occurs. At this point, CSR_EUEN enable bits contain exactly which
units have been used by the program.
r~
^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: [PATCH v1 5/6] linux-user/loongarch64: Add LSX sigcontext save/restore
2023-10-28 21:35 ` Richard Henderson
@ 2023-10-30 3:28 ` gaosong
0 siblings, 0 replies; 18+ messages in thread
From: gaosong @ 2023-10-30 3:28 UTC (permalink / raw)
To: Richard Henderson, qemu-devel
Cc: philmd, laurent, maobibo, yangxiaojuan, laurent
在 2023/10/29 上午5:35, Richard Henderson 写道:
> On 10/9/23 20:37, Song Gao wrote:
>> Signed-off-by: Song Gao <gaosong@loongson.cn>
>> ---
>> linux-user/loongarch64/signal.c | 107 ++++++++++++++++++++++++++------
>> 1 file changed, 87 insertions(+), 20 deletions(-)
>>
>> diff --git a/linux-user/loongarch64/signal.c
>> b/linux-user/loongarch64/signal.c
>> index 277e9f5757..4b09e50a5f 100644
>> --- a/linux-user/loongarch64/signal.c
>> +++ b/linux-user/loongarch64/signal.c
>> @@ -33,6 +33,14 @@ struct target_fpu_context {
>> uint32_t fcsr;
>> } QEMU_ALIGNED(FPU_CTX_ALIGN);
>> +#define LSX_CTX_MAGIC 0x53580001
>> +#define LSX_CTX_ALIGN 16
>> +struct target_lsx_context {
>> + uint64_t regs[2 * 32];
>> + uint64_t fcc;
>> + uint32_t fcsr;
>> +} QEMU_ALIGNED(LSX_CTX_ALIGN);
>
> It probably doesn't matter here because fo the alignment, but all
> types within target structures should be using abi_{ullong,uint} etc.
>
>
Ok,
>> @@ -99,8 +109,15 @@ static abi_ptr setup_extcontext(struct
>> extctx_layout *extctx, abi_ptr sp)
>> /* For qemu, there is no lazy fp context switch, so fp always
>> present. */
>> extctx->flags = SC_USED_FP;
>> - sp = extframe_alloc(extctx, &extctx->fpu,
>> +
>> + if (env->extctx_flags & EXTCTX_FLAGS_LSX) {
>> + sp = extframe_alloc(extctx, &extctx->lsx,
>> + sizeof(struct target_lsx_context),
>> LSX_CTX_ALIGN, sp);
>> +
>> + } else if (env->extctx_flags & EXTCTX_FLAGS_FPU) {
>> + sp = extframe_alloc(extctx, &extctx->fpu,
>> sizeof(struct target_fpu_context),
>> FPU_CTX_ALIGN, sp);
>> + }
>
> I think this is overly complicated. (1) The fpu is always present,
> and (2) you don't need a special flag on env, you can check the same
> CSR bits as for system mode.
>
I think extctx_flags is incorrectly named, fp_alive_flags or
vec_alive_flags would be more appropriate.
The flags function like the kernel's 'thread_lsx_context_live',
'thread_lasx_context_live' functions, checking if the LSX/LASX
instructions are used.
If we don't use the LSX/LASX instructions, we don't need to use
lsx_context/lasx_context even though the LSX/LASX enable bit is set.
and EXTCTX_FLAGS_FPU is not required.
Thanks.
Song Gao
> I'll note that while this layout matches the kernel, it is an
> unfortunate set of data structures. Any program has to look for all
> of {FPU,LSX,LASX}_CTX_MAGIC in order to find the basic fp registers.
>
>
> r~
^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: [PATCH v1 2/6] target/loongarch: Add set_vec_extctx to set LSX/LASX instructions extctx_flags
2023-10-28 21:40 ` Richard Henderson
@ 2023-10-30 3:28 ` gaosong
2023-10-30 15:30 ` Richard Henderson
0 siblings, 1 reply; 18+ messages in thread
From: gaosong @ 2023-10-30 3:28 UTC (permalink / raw)
To: Richard Henderson, qemu-devel
Cc: philmd, laurent, maobibo, yangxiaojuan, laurent
在 2023/10/29 上午5:40, Richard Henderson 写道:
> On 10/9/23 20:36, Song Gao wrote:
>> Signed-off-by: Song Gao <gaosong@loongson.cn>
>> ---
>> target/loongarch/insn_trans/trans_vec.c.inc | 12 ++++++++++++
>> target/loongarch/internals.h | 2 ++
>> 2 files changed, 14 insertions(+)
>>
>> diff --git a/target/loongarch/insn_trans/trans_vec.c.inc
>> b/target/loongarch/insn_trans/trans_vec.c.inc
>> index 98f856bb29..aef16ef44a 100644
>> --- a/target/loongarch/insn_trans/trans_vec.c.inc
>> +++ b/target/loongarch/insn_trans/trans_vec.c.inc
>> @@ -23,8 +23,20 @@ static bool check_vec(DisasContext *ctx, uint32_t
>> oprsz)
>> #else
>> +static void set_vec_extctx(DisasContext *ctx, uint32_t oprsz)
>> +{
>> + if (oprsz == 16) {
>> + ctx->extctx_flags |= EXTCTX_FLAGS_LSX;
>> + }
>> +
>> + if (oprsz == 32) {
>> + ctx->extctx_flags |= EXTCTX_FLAGS_LASX;
>> + }
>> +}
>> +
>> static bool check_vec(DisasContext *ctx, uint32_t oprsz)
>> {
>> + set_vec_extctx(ctx, oprsz);
>> return true;
>> }
>
> This doesn't do anything. Nothing copies the changed value back to env.
> Anyway, I think this is the wrong way to go about it.
>
Oh, It is on patch1.
@@ -294,6 +296,7 @@ static void
loongarch_tr_translate_insn(DisasContextBase *dcbase, CPUState *cs)
generate_exception(ctx, EXCCODE_INE);
}
+ env->extctx_flags |= ctx->extctx_flags;
ctx->base.pc_next += 4;
Thanks.
Song Gao
> If you want to track what the program is using, you should do it
> exactly like the real kernel: disable the execution unit, have the
> program trap, and the enable the execution unit when the trap occurs.
> At this point, CSR_EUEN enable bits contain exactly which units have
> been used by the program.
>
>
> r~
^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: [PATCH v1 2/6] target/loongarch: Add set_vec_extctx to set LSX/LASX instructions extctx_flags
2023-10-30 3:28 ` gaosong
@ 2023-10-30 15:30 ` Richard Henderson
2023-10-31 6:16 ` gaosong
0 siblings, 1 reply; 18+ messages in thread
From: Richard Henderson @ 2023-10-30 15:30 UTC (permalink / raw)
To: gaosong, qemu-devel; +Cc: philmd, laurent, maobibo, yangxiaojuan, laurent
On 10/29/23 20:28, gaosong wrote:
> 在 2023/10/29 上午5:40, Richard Henderson 写道:
>> On 10/9/23 20:36, Song Gao wrote:
>>> Signed-off-by: Song Gao <gaosong@loongson.cn>
>>> ---
>>> target/loongarch/insn_trans/trans_vec.c.inc | 12 ++++++++++++
>>> target/loongarch/internals.h | 2 ++
>>> 2 files changed, 14 insertions(+)
>>>
>>> diff --git a/target/loongarch/insn_trans/trans_vec.c.inc
>>> b/target/loongarch/insn_trans/trans_vec.c.inc
>>> index 98f856bb29..aef16ef44a 100644
>>> --- a/target/loongarch/insn_trans/trans_vec.c.inc
>>> +++ b/target/loongarch/insn_trans/trans_vec.c.inc
>>> @@ -23,8 +23,20 @@ static bool check_vec(DisasContext *ctx, uint32_t oprsz)
>>> #else
>>> +static void set_vec_extctx(DisasContext *ctx, uint32_t oprsz)
>>> +{
>>> + if (oprsz == 16) {
>>> + ctx->extctx_flags |= EXTCTX_FLAGS_LSX;
>>> + }
>>> +
>>> + if (oprsz == 32) {
>>> + ctx->extctx_flags |= EXTCTX_FLAGS_LASX;
>>> + }
>>> +}
>>> +
>>> static bool check_vec(DisasContext *ctx, uint32_t oprsz)
>>> {
>>> + set_vec_extctx(ctx, oprsz);
>>> return true;
>>> }
>>
>> This doesn't do anything. Nothing copies the changed value back to env.
>> Anyway, I think this is the wrong way to go about it.
>>
> Oh, It is on patch1.
>
> @@ -294,6 +296,7 @@ static void loongarch_tr_translate_insn(DisasContextBase *dcbase,
> CPUState *cs)
> generate_exception(ctx, EXCCODE_INE);
> }
>
> + env->extctx_flags |= ctx->extctx_flags;
Ah, well, this is also incorrect.
This copy only happens at translation time, not at execution time.
Anyway, I think my previous suggestion is better:
>> If you want to track what the program is using, you should do it exactly like the real
>> kernel: disable the execution unit, have the program trap, and the enable the execution
>> unit when the trap occurs. At this point, CSR_EUEN enable bits contain exactly which
>> units have been used by the program.
r~
^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: [PATCH v1 2/6] target/loongarch: Add set_vec_extctx to set LSX/LASX instructions extctx_flags
2023-10-30 15:30 ` Richard Henderson
@ 2023-10-31 6:16 ` gaosong
2023-10-31 14:50 ` Richard Henderson
0 siblings, 1 reply; 18+ messages in thread
From: gaosong @ 2023-10-31 6:16 UTC (permalink / raw)
To: Richard Henderson, qemu-devel
Cc: philmd, laurent, maobibo, yangxiaojuan, laurent
在 2023/10/30 下午11:30, Richard Henderson 写道:
> On 10/29/23 20:28, gaosong wrote:
>> 在 2023/10/29 上午5:40, Richard Henderson 写道:
>>> On 10/9/23 20:36, Song Gao wrote:
>>>> Signed-off-by: Song Gao <gaosong@loongson.cn>
>>>> ---
>>>> target/loongarch/insn_trans/trans_vec.c.inc | 12 ++++++++++++
>>>> target/loongarch/internals.h | 2 ++
>>>> 2 files changed, 14 insertions(+)
>>>>
>>>> diff --git a/target/loongarch/insn_trans/trans_vec.c.inc
>>>> b/target/loongarch/insn_trans/trans_vec.c.inc
>>>> index 98f856bb29..aef16ef44a 100644
>>>> --- a/target/loongarch/insn_trans/trans_vec.c.inc
>>>> +++ b/target/loongarch/insn_trans/trans_vec.c.inc
>>>> @@ -23,8 +23,20 @@ static bool check_vec(DisasContext *ctx,
>>>> uint32_t oprsz)
>>>> #else
>>>> +static void set_vec_extctx(DisasContext *ctx, uint32_t oprsz)
>>>> +{
>>>> + if (oprsz == 16) {
>>>> + ctx->extctx_flags |= EXTCTX_FLAGS_LSX;
>>>> + }
>>>> +
>>>> + if (oprsz == 32) {
>>>> + ctx->extctx_flags |= EXTCTX_FLAGS_LASX;
>>>> + }
>>>> +}
>>>> +
>>>> static bool check_vec(DisasContext *ctx, uint32_t oprsz)
>>>> {
>>>> + set_vec_extctx(ctx, oprsz);
>>>> return true;
>>>> }
>>>
>>> This doesn't do anything. Nothing copies the changed value back to
>>> env.
>>> Anyway, I think this is the wrong way to go about it.
>>>
>> Oh, It is on patch1.
>>
>> @@ -294,6 +296,7 @@ static void
>> loongarch_tr_translate_insn(DisasContextBase *dcbase, CPUState *cs)
>> generate_exception(ctx, EXCCODE_INE);
>> }
>>
>> + env->extctx_flags |= ctx->extctx_flags;
>
> Ah, well, this is also incorrect.
>
> This copy only happens at translation time, not at execution time.
>
> Anyway, I think my previous suggestion is better:
>
Oh, Could you show more details? I think I didn't get you point.
>>> If you want to track what the program is using, you should do it
>>> exactly like the real kernel: disable the execution unit, have the
>>> program trap, and the enable the execution unit when the trap
>>> occurs. At this point, CSR_EUEN enable bits contain exactly which
>>> units have been used by the program.
>
we always enabled LSX/LASX exception, This is mean that we always use
target_lasx_context.
Thanks.
Song Gao
>
> r~
^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: [PATCH v1 2/6] target/loongarch: Add set_vec_extctx to set LSX/LASX instructions extctx_flags
2023-10-31 6:16 ` gaosong
@ 2023-10-31 14:50 ` Richard Henderson
2023-11-01 1:49 ` gaosong
0 siblings, 1 reply; 18+ messages in thread
From: Richard Henderson @ 2023-10-31 14:50 UTC (permalink / raw)
To: gaosong, qemu-devel; +Cc: philmd, laurent, maobibo, yangxiaojuan, laurent
[-- Attachment #1: Type: text/plain, Size: 472 bytes --]
On 10/30/23 23:16, gaosong wrote:
>> Anyway, I think my previous suggestion is better:
>>
> Oh, Could you show more details? I think I didn't get you point.
>
>>>> If you want to track what the program is using, you should do it exactly like the real
>>>> kernel: disable the execution unit, have the program trap, and the enable the
>>>> execution unit when the trap occurs. At this point, CSR_EUEN enable bits contain
Untested, but something like this.
r~
[-- Attachment #2: 0001-linux-user-loongarch64-Use-traps-to-track-LSX-LASX-u.patch --]
[-- Type: text/x-patch, Size: 2226 bytes --]
From 2a5b55a33bc6133cd318856b95b844162779beaf Mon Sep 17 00:00:00 2001
From: Richard Henderson <richard.henderson@linaro.org>
Date: Tue, 31 Oct 2023 07:46:54 -0700
Subject: [PATCH] linux-user/loongarch64: Use traps to track LSX/LASX usage
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
---
linux-user/loongarch64/cpu_loop.c | 13 +++++++++++++
target/loongarch/insn_trans/trans_vec.c.inc | 11 -----------
2 files changed, 13 insertions(+), 11 deletions(-)
diff --git a/linux-user/loongarch64/cpu_loop.c b/linux-user/loongarch64/cpu_loop.c
index 894fdd111a..73d7b6796a 100644
--- a/linux-user/loongarch64/cpu_loop.c
+++ b/linux-user/loongarch64/cpu_loop.c
@@ -72,6 +72,19 @@ void cpu_loop(CPULoongArchState *env)
case EXCCODE_BCE:
force_sig_fault(TARGET_SIGSYS, TARGET_SI_KERNEL, env->pc);
break;
+
+ /*
+ * Begin with LSX and LASX disabled, then enable on the first trap.
+ * In this way we can tell if the unit is in use. This is used to
+ * choose the layout of any signal frame.
+ */
+ case EXCCODE_SXD:
+ env->CSR_EUEN |= R_CSR_EUEN_SXE_MASK;
+ break;
+ case EXCCODE_ASXD:
+ env->CSR_EUEN |= R_CSR_EUEN_ASXE_MASK;
+ break;
+
case EXCP_ATOMIC:
cpu_exec_step_atomic(cs);
break;
diff --git a/target/loongarch/insn_trans/trans_vec.c.inc b/target/loongarch/insn_trans/trans_vec.c.inc
index 98f856bb29..92b1d22e28 100644
--- a/target/loongarch/insn_trans/trans_vec.c.inc
+++ b/target/loongarch/insn_trans/trans_vec.c.inc
@@ -4,8 +4,6 @@
* Copyright (c) 2022-2023 Loongson Technology Corporation Limited
*/
-#ifndef CONFIG_USER_ONLY
-
static bool check_vec(DisasContext *ctx, uint32_t oprsz)
{
if ((oprsz == 16) && ((ctx->base.tb->flags & HW_FLAGS_EUEN_SXE) == 0)) {
@@ -21,15 +19,6 @@ static bool check_vec(DisasContext *ctx, uint32_t oprsz)
return true;
}
-#else
-
-static bool check_vec(DisasContext *ctx, uint32_t oprsz)
-{
- return true;
-}
-
-#endif
-
static bool gen_vvvv_ptr_vl(DisasContext *ctx, arg_vvvv *a, uint32_t oprsz,
gen_helper_gvec_4_ptr *fn)
{
--
2.34.1
^ permalink raw reply related [flat|nested] 18+ messages in thread
* Re: [PATCH v1 2/6] target/loongarch: Add set_vec_extctx to set LSX/LASX instructions extctx_flags
2023-10-31 14:50 ` Richard Henderson
@ 2023-11-01 1:49 ` gaosong
0 siblings, 0 replies; 18+ messages in thread
From: gaosong @ 2023-11-01 1:49 UTC (permalink / raw)
To: Richard Henderson, qemu-devel
Cc: philmd, laurent, maobibo, yangxiaojuan, laurent
在 2023/10/31 下午10:50, Richard Henderson 写道:
> On 10/30/23 23:16, gaosong wrote:
>>> Anyway, I think my previous suggestion is better:
>>>
>> Oh, Could you show more details? I think I didn't get you point.
>>
>>>>> If you want to track what the program is using, you should do it
>>>>> exactly like the real kernel: disable the execution unit, have the
>>>>> program trap, and the enable the execution unit when the trap
>>>>> occurs. At this point, CSR_EUEN enable bits contain
>
> Untested, but something like this.
>
>
Got it . Thank you very much.
Thanks.
Song Gao
> r~
>
^ permalink raw reply [flat|nested] 18+ messages in thread
end of thread, other threads:[~2023-11-01 1:50 UTC | newest]
Thread overview: 18+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-10-10 3:36 [PATCH v1 0/6] linux-user/loongarch64: Add LSX/LASX sigcontext Song Gao
2023-10-10 3:36 ` [PATCH v1 1/6] target/loongarch: Add env->extctx_flags for user-mode setup extcontext Song Gao
2023-10-10 3:36 ` [PATCH v1 2/6] target/loongarch: Add set_vec_extctx to set LSX/LASX instructions extctx_flags Song Gao
2023-10-28 21:40 ` Richard Henderson
2023-10-30 3:28 ` gaosong
2023-10-30 15:30 ` Richard Henderson
2023-10-31 6:16 ` gaosong
2023-10-31 14:50 ` Richard Henderson
2023-11-01 1:49 ` gaosong
2023-10-10 3:36 ` [PATCH v1 3/6] linux-user/loongarch64: Fix setup_extcontext alloc wrong fpu_context size Song Gao
2023-10-28 21:18 ` Richard Henderson
2023-10-10 3:36 ` [PATCH v1 4/6] linux-user/loongarch64: setup_sigframe() set 'end' context size 0 Song Gao
2023-10-28 21:20 ` Richard Henderson
2023-10-10 3:37 ` [PATCH v1 5/6] linux-user/loongarch64: Add LSX sigcontext save/restore Song Gao
2023-10-28 21:35 ` Richard Henderson
2023-10-30 3:28 ` gaosong
2023-10-10 3:37 ` [PATCH v1 6/6] linux-user/loongarch64: Add LASX " Song Gao
2023-10-23 2:47 ` [PATCH v1 0/6] linux-user/loongarch64: Add LSX/LASX sigcontext gaosong
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).