Merge pull request #4535 from lubinszARM:pr_kvm_exec_binary_1
PiperOrigin-RevId: 338321125
This commit is contained in:
commit
1b2097f84e
|
@ -235,8 +235,9 @@ func (c *vCPU) SwitchToUser(switchOpts ring0.SwitchOpts, info *arch.SignalInfo)
|
||||||
return c.fault(int32(syscall.SIGSEGV), info)
|
return c.fault(int32(syscall.SIGSEGV), info)
|
||||||
case ring0.Vector(bounce): // ring0.VirtualizationException
|
case ring0.Vector(bounce): // ring0.VirtualizationException
|
||||||
return usermem.NoAccess, platform.ErrContextInterrupt
|
return usermem.NoAccess, platform.ErrContextInterrupt
|
||||||
case ring0.El0Sync_undef,
|
case ring0.El0Sync_undef:
|
||||||
ring0.El1Sync_undef:
|
return c.fault(int32(syscall.SIGILL), info)
|
||||||
|
case ring0.El1Sync_undef:
|
||||||
*info = arch.SignalInfo{
|
*info = arch.SignalInfo{
|
||||||
Signo: int32(syscall.SIGILL),
|
Signo: int32(syscall.SIGILL),
|
||||||
Code: 1, // ILL_ILLOPC (illegal opcode).
|
Code: 1, // ILL_ILLOPC (illegal opcode).
|
||||||
|
|
|
@ -366,6 +366,19 @@
|
||||||
MOVD R4, CPU_REGISTERS+PTRACE_SP(RSV_REG); \
|
MOVD R4, CPU_REGISTERS+PTRACE_SP(RSV_REG); \
|
||||||
LOAD_KERNEL_STACK(RSV_REG); // Load the temporary stack.
|
LOAD_KERNEL_STACK(RSV_REG); // Load the temporary stack.
|
||||||
|
|
||||||
|
// EXCEPTION_WITH_ERROR is a common exception handler function.
|
||||||
|
#define EXCEPTION_WITH_ERROR(user, vector) \
|
||||||
|
WORD $0xd538d092; \ //MRS TPIDR_EL1, R18
|
||||||
|
WORD $0xd538601a; \ //MRS FAR_EL1, R26
|
||||||
|
MOVD R26, CPU_FAULT_ADDR(RSV_REG); \
|
||||||
|
MOVD $user, R3; \
|
||||||
|
MOVD R3, CPU_ERROR_TYPE(RSV_REG); \ // Set error type to user.
|
||||||
|
MOVD $vector, R3; \
|
||||||
|
MOVD R3, CPU_VECTOR_CODE(RSV_REG); \
|
||||||
|
MRS ESR_EL1, R3; \
|
||||||
|
MOVD R3, CPU_ERROR_CODE(RSV_REG); \
|
||||||
|
B ·kernelExitToEl1(SB);
|
||||||
|
|
||||||
// storeAppASID writes the application's asid value.
|
// storeAppASID writes the application's asid value.
|
||||||
TEXT ·storeAppASID(SB),NOSPLIT,$0-8
|
TEXT ·storeAppASID(SB),NOSPLIT,$0-8
|
||||||
MOVD asid+0(FP), R1
|
MOVD asid+0(FP), R1
|
||||||
|
@ -659,21 +672,7 @@ el0_svc:
|
||||||
|
|
||||||
el0_da:
|
el0_da:
|
||||||
el0_ia:
|
el0_ia:
|
||||||
WORD $0xd538d092 //MRS TPIDR_EL1, R18
|
EXCEPTION_WITH_ERROR(1, PageFault)
|
||||||
WORD $0xd538601a //MRS FAR_EL1, R26
|
|
||||||
|
|
||||||
MOVD R26, CPU_FAULT_ADDR(RSV_REG)
|
|
||||||
|
|
||||||
MOVD $1, R3
|
|
||||||
MOVD R3, CPU_ERROR_TYPE(RSV_REG) // Set error type to user.
|
|
||||||
|
|
||||||
MOVD $PageFault, R3
|
|
||||||
MOVD R3, CPU_VECTOR_CODE(RSV_REG)
|
|
||||||
|
|
||||||
MRS ESR_EL1, R3
|
|
||||||
MOVD R3, CPU_ERROR_CODE(RSV_REG)
|
|
||||||
|
|
||||||
B ·kernelExitToEl1(SB)
|
|
||||||
|
|
||||||
el0_fpsimd_acc:
|
el0_fpsimd_acc:
|
||||||
B ·Shutdown(SB)
|
B ·Shutdown(SB)
|
||||||
|
@ -688,10 +687,7 @@ el0_sp_pc:
|
||||||
B ·Shutdown(SB)
|
B ·Shutdown(SB)
|
||||||
|
|
||||||
el0_undef:
|
el0_undef:
|
||||||
MOVD $El0Sync_undef, R3
|
EXCEPTION_WITH_ERROR(1, El0Sync_undef)
|
||||||
MOVD R3, CPU_VECTOR_CODE(RSV_REG)
|
|
||||||
|
|
||||||
B ·kernelExitToEl1(SB)
|
|
||||||
|
|
||||||
el0_dbg:
|
el0_dbg:
|
||||||
B ·Shutdown(SB)
|
B ·Shutdown(SB)
|
||||||
|
|
Loading…
Reference in New Issue