diff options
author | Bin Lu <bin.lu@arm.com> | 2020-05-18 03:20:18 -0400 |
---|---|---|
committer | Bin Lu <bin.lu@arm.com> | 2020-06-09 05:01:03 -0400 |
commit | 5ad1025d2dde4af9cad2e2d46e4b1c5a26f55409 (patch) | |
tree | f7f604e411fa6b409c7cd43651769367650c6991 /pkg/sentry | |
parent | 420b791a3d6e0e6e2fc30c6f8be013bce7ca6549 (diff) |
initialize an empty fp state area for sentry on Arm64
We need to initialize an empty fp state area for the sentry.
Signed-off-by: Bin Lu <bin.lu@arm.com>
Diffstat (limited to 'pkg/sentry')
-rw-r--r-- | pkg/sentry/arch/arch_aarch64.go | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/pkg/sentry/arch/arch_aarch64.go b/pkg/sentry/arch/arch_aarch64.go index 343f81f59..daba8b172 100644 --- a/pkg/sentry/arch/arch_aarch64.go +++ b/pkg/sentry/arch/arch_aarch64.go @@ -17,7 +17,6 @@ package arch import ( - "encoding/binary" "fmt" "io" @@ -49,9 +48,14 @@ const ARMTrapFlag = uint64(1) << 21 type aarch64FPState []byte // initAarch64FPState sets up initial state. +// +// Related code in Linux kernel: fpsimd_flush_thread(). +// FPCR = FPCR_RM_RN (0x0 << 22). +// +// Currently, aarch64FPState is only a space of 0x210 length for fpstate. +// The fp head is useless in sentry/ptrace/kvm. +// func initAarch64FPState(data aarch64FPState) { - binary.LittleEndian.PutUint32(data, fpsimdMagic) - binary.LittleEndian.PutUint32(data[4:], fpsimdContextSize) } func newAarch64FPStateSlice() []byte { |