add arm64 support
- add arm64 dependent codes with GICv3 and SVE support - fix bugs based on architecture separation requests
This commit is contained in:
101
executer/user/arch/x86_64/arch-eclair.c
Normal file
101
executer/user/arch/x86_64/arch-eclair.c
Normal file
@@ -0,0 +1,101 @@
|
||||
/* arch-eclair.c COPYRIGHT FUJITSU LIMITED 2016 */
|
||||
#include <eclair.h>
|
||||
#include <stdio.h>
|
||||
#include <arch-eclair.h>
|
||||
|
||||
int print_kregs(char *rbp, size_t rbp_size, const struct arch_kregs *kregs)
|
||||
{
|
||||
int i, ret, total = 0;
|
||||
uintptr_t ihk_mc_switch_context = -1;
|
||||
const uint64_t *regs_1[] = {&kregs->rsi, &kregs->rdi, &kregs->rbp,
|
||||
&kregs->rsp};
|
||||
const uint64_t *regs_2[] = {&kregs->r12, &kregs->r13, &kregs->r14,
|
||||
&kregs->r15};
|
||||
|
||||
ihk_mc_switch_context = lookup_symbol("ihk_mc_switch_context");
|
||||
if (0) printf("ihk_mc_switch_context: %lx\n", ihk_mc_switch_context);
|
||||
|
||||
ret = snprintf(rbp, rbp_size, "xxxxxxxxxxxxxxxx"); /* rax */
|
||||
if (ret < 0) {
|
||||
return ret;
|
||||
}
|
||||
rbp += ret;
|
||||
total += ret;
|
||||
rbp_size -= ret;
|
||||
|
||||
ret += print_bin(rbp, rbp_size, (void *)&kregs->rbx, sizeof(uint64_t)); /* rbx */
|
||||
if (ret < 0) {
|
||||
return ret;
|
||||
}
|
||||
rbp += ret;
|
||||
total += ret;
|
||||
rbp_size -= ret;
|
||||
|
||||
for (i = 0; i < 2; i++){ /* rcx, rdx */
|
||||
ret = snprintf(rbp, rbp_size, "xxxxxxxxxxxxxxxx");
|
||||
if (ret < 0) {
|
||||
return ret;
|
||||
}
|
||||
rbp += ret;
|
||||
total += ret;
|
||||
rbp_size -= ret;
|
||||
}
|
||||
|
||||
for (i = 0; i < sizeof(regs_1)/sizeof(regs_1[0]); i++) { /* rsi, rdi, rbp, rsp */
|
||||
ret = print_bin(rbp, rbp_size, (void *)regs_1[i], sizeof(regs_1[0]));
|
||||
if (ret < 0) {
|
||||
return ret;
|
||||
}
|
||||
rbp += ret;
|
||||
total += ret;
|
||||
rbp_size -= ret;
|
||||
}
|
||||
|
||||
for (i = 0; i < 4; i++) { /* r8-x11 */
|
||||
ret = snprintf(rbp, rbp_size, "xxxxxxxxxxxxxxxx");
|
||||
if (ret < 0) {
|
||||
return ret;
|
||||
}
|
||||
rbp += ret;
|
||||
total += ret;
|
||||
rbp_size -= ret;
|
||||
}
|
||||
|
||||
for (i = 0; i < sizeof(regs_2)/sizeof(regs_2[0]); i++) { /* r12-r15 */
|
||||
ret = print_bin(rbp, rbp_size, (void *)regs_2[i], sizeof(regs_2[0]));
|
||||
if (ret < 0) {
|
||||
return ret;
|
||||
}
|
||||
rbp += ret;
|
||||
total += ret;
|
||||
rbp_size -= ret;
|
||||
}
|
||||
|
||||
ret += print_bin(rbp, rbp_size, (void *)&ihk_mc_switch_context, sizeof(uint64_t)); /* rip */
|
||||
if (ret < 0) {
|
||||
return ret;
|
||||
}
|
||||
rbp += ret;
|
||||
total += ret;
|
||||
rbp_size -= ret;
|
||||
|
||||
ret += print_bin(rbp, rbp_size, (void *)&kregs->rflags, sizeof(uint32_t)); /* rflags */
|
||||
if (ret < 0) {
|
||||
return ret;
|
||||
}
|
||||
rbp += ret;
|
||||
total += ret;
|
||||
rbp_size -= ret;
|
||||
|
||||
for (i = 0; i < 6; i++) { /* cs, ss, ds, es, fs, gs */
|
||||
ret = snprintf(rbp, rbp_size, "xxxxxxxx");
|
||||
if (ret < 0) {
|
||||
return ret;
|
||||
}
|
||||
rbp += ret;
|
||||
total += ret;
|
||||
rbp_size -= ret;
|
||||
}
|
||||
|
||||
return total;
|
||||
}
|
||||
@@ -1,6 +1,10 @@
|
||||
#ifndef ARCH_ARGS_H
|
||||
#define ARCH_ARGS_H
|
||||
|
||||
#ifdef POSTK_DEBUG_ARCH_DEP_77 /* arch depend hide */
|
||||
#include <asm/prctl.h>
|
||||
#endif /* !POSTK_DEBUG_ARCH_DEP_77 */
|
||||
|
||||
typedef struct user_regs_struct syscall_args;
|
||||
|
||||
static inline int
|
||||
|
||||
24
executer/user/arch/x86_64/include/arch-eclair.h
Normal file
24
executer/user/arch/x86_64/include/arch-eclair.h
Normal file
@@ -0,0 +1,24 @@
|
||||
/* arch-eclair.h COPYRIGHT FUJITSU LIMITED 2016 */
|
||||
#ifndef HEADER_USER_X86_ECLAIR_H
|
||||
#define HEADER_USER_X86_ECLAIR_H
|
||||
|
||||
#define MAP_KERNEL 0xFFFFFFFF80000000
|
||||
#define MAP_ST 0xFFFF800000000000
|
||||
|
||||
#define ARCH_CLV_SPAN "x86_cpu_local_variables_span"
|
||||
|
||||
#define ARCH "i386:x86-64"
|
||||
|
||||
#define ARCH_REGS 21
|
||||
|
||||
#define PANIC_REGS_OFFSET 240
|
||||
|
||||
#define MAP_KERNEL_TEXT "0xffffffff80001000"
|
||||
|
||||
struct arch_kregs {
|
||||
uintptr_t rsp, rbp, rbx, rsi;
|
||||
uintptr_t rdi, r12, r13, r14;
|
||||
uintptr_t r15, rflags, rsp0;
|
||||
};
|
||||
|
||||
#endif /* HEADER_USER_x86_ECLAIR_H */
|
||||
Reference in New Issue
Block a user