summaryrefslogtreecommitdiffhomepage
path: root/pkg/sentry
diff options
context:
space:
mode:
authorRobin Luk <lubin.lu@antgroup.com>2021-01-14 16:50:52 +0800
committerRobin Luk <lubin.lu@antgroup.com>2021-02-03 11:50:35 +0000
commit25130d6183d399fc3bfa93385aeba6819437ea6c (patch)
tree68a871d8f85f6de7cc1cb6c77ab8c4fe819d8971 /pkg/sentry
parent5106e66fddba47e4edefd6a0dbb406421d8ef4de (diff)
arm64: clean code
In order to improve the performance and stability, I reorg 2 modules slightly. arch: no red zone on Arm64. ring0: use stp instead of movd, and set RSV_REG_APP=R19. Signed-off-by: Robin Luk <lubin.lu@antgroup.com>
Diffstat (limited to 'pkg/sentry')
-rw-r--r--pkg/sentry/arch/signal_arm64.go9
1 files changed, 4 insertions, 5 deletions
diff --git a/pkg/sentry/arch/signal_arm64.go b/pkg/sentry/arch/signal_arm64.go
index 7fde5d34e..71596130d 100644
--- a/pkg/sentry/arch/signal_arm64.go
+++ b/pkg/sentry/arch/signal_arm64.go
@@ -36,7 +36,6 @@ type SignalContext64 struct {
Pstate uint64
_pad [8]byte // __attribute__((__aligned__(16)))
Fpsimd64 FpsimdContext // size = 528
- Reserved [3568]uint8
}
// +marshal
@@ -86,10 +85,6 @@ func (c *context64) NewSignalStack() NativeSignalStack {
func (c *context64) SignalSetup(st *Stack, act *SignalAct, info *SignalInfo, alt *SignalStack, sigset linux.SignalSet) error {
sp := st.Bottom
- if !(alt.IsEnabled() && sp == alt.Top()) {
- sp -= 128
- }
-
// Construct the UContext64 now since we need its size.
uc := &UContext64{
Flags: 0,
@@ -102,6 +97,10 @@ func (c *context64) SignalSetup(st *Stack, act *SignalAct, info *SignalInfo, alt
},
Sigset: sigset,
}
+ if linux.Signal(info.Signo) == linux.SIGSEGV || linux.Signal(info.Signo) == linux.SIGBUS {
+ uc.MContext.FaultAddr = info.Addr()
+ }
+
ucSize := uc.SizeBytes()
// frameSize = ucSize + sizeof(siginfo).