diff options
author | Bin Lu <bin.lu@arm.com> | 2020-01-29 04:33:06 -0500 |
---|---|---|
committer | Bin Lu <bin.lu@arm.com> | 2020-02-20 07:46:30 -0500 |
commit | a369c88c0c4ece5239855000d28df045111c1be7 (patch) | |
tree | dc3715ab5bec6b970270aaf09b4be2a6dc1cc19f /pkg/sentry/arch/arch_arm64.go | |
parent | 4cb55a7a3b09c430fa2b7197fdc7b84b7e88a6ed (diff) |
Lazy-fpsimd support patch series#1: add Arm64-fpsimd support to arch module
This patch defines the structures and
adds the implementations for fpsimd initialization.
Signed-off-by: Bin Lu <bin.lu@arm.com>
Diffstat (limited to 'pkg/sentry/arch/arch_arm64.go')
-rw-r--r-- | pkg/sentry/arch/arch_arm64.go | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/pkg/sentry/arch/arch_arm64.go b/pkg/sentry/arch/arch_arm64.go index 94f1a808f..372b650b9 100644 --- a/pkg/sentry/arch/arch_arm64.go +++ b/pkg/sentry/arch/arch_arm64.go @@ -68,6 +68,7 @@ const ( // context64 represents an ARM64 context. type context64 struct { State + sigFPState []aarch64FPState // fpstate to be restored on sigreturn. } // Arch implements Context.Arch. @@ -75,10 +76,19 @@ func (c *context64) Arch() Arch { return ARM64 } +func (c *context64) copySigFPState() []aarch64FPState { + var sigfps []aarch64FPState + for _, s := range c.sigFPState { + sigfps = append(sigfps, s.fork()) + } + return sigfps +} + // Fork returns an exact copy of this context. func (c *context64) Fork() Context { return &context64{ - State: c.State.Fork(), + State: c.State.Fork(), + sigFPState: c.copySigFPState(), } } @@ -137,8 +147,8 @@ func (c *context64) SetTLS(value uintptr) bool { return false } -// SetRSEQInterruptedIP implements Context.SetRSEQInterruptedIP. -func (c *context64) SetRSEQInterruptedIP(value uintptr) { +// SetOldRSeqInterruptedIP implements Context.SetOldRSeqInterruptedIP. +func (c *context64) SetOldRSeqInterruptedIP(value uintptr) { c.Regs.Regs[3] = uint64(value) } |