Merge pull request #3448 from lubinszARM:pr_tls_tests

PiperOrigin-RevId: 324127810
This commit is contained in:
gVisor bot
2020-07-30 18:44:17 -07:00
2 changed files with 14 additions and 4 deletions
@@ -56,5 +56,9 @@ func CheckTestRegs(regs *arch.Registers, full bool) (err error) {
err = addRegisterMismatch(err, fmt.Sprintf("R%d", i), regs.Regs[i], need)
}
}
// Check tls.
if need := ^uint64(11); regs.TPIDR_EL0 != need {
err = addRegisterMismatch(err, "tpdir_el0", regs.TPIDR_EL0, need)
}
return
}
@@ -52,6 +52,8 @@ start:
TEXT ·FloatingPointWorks(SB),NOSPLIT,$0-8
NO_LOCAL_POINTERS
// gc will touch fpsimd, so we should test it.
// such as in <runtime.deductSweepCredit>.
FMOVD $(9.9), F0
MOVD $SYS_GETPID, R8 // getpid
SVC
@@ -102,11 +104,15 @@ isNaN:
TEXT ·TwiddleRegsSyscall(SB),NOSPLIT,$0
TWIDDLE_REGS()
MSR R10, TPIDR_EL0
// Trapped in el0_svc.
SVC
RET // never reached
TEXT ·TwiddleRegsFault(SB),NOSPLIT,$0
TWIDDLE_REGS()
// Branch to Register branches unconditionally to an address in <Rn>.
JMP (R4) // <=> br x4, must fault
RET // never reached
TWIDDLE_REGS()
MSR R10, TPIDR_EL0
// Trapped in el0_ia.
// Branch to Register branches unconditionally to an address in <Rn>.
JMP (R6) // <=> br x6, must fault
RET // never reached