summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorgVisor bot <gvisor-bot@google.com>2021-07-20 19:16:17 -0700
committergVisor bot <gvisor-bot@google.com>2021-07-20 19:16:17 -0700
commit49d9ef49873dccf2adc414f0c2ea2c41a11b6941 (patch)
tree8b17942d0a818a43a3ecc0ce0d03d283ac689b8d
parent1ad382220048339cb1aeecef7d69b9ddffd9168c (diff)
parent49ada65f4c37a4384ce4f9dc0cf98317207d4472 (diff)
Merge pull request #6220 from laijs:disconnect-fp
PiperOrigin-RevId: 385919423
-rw-r--r--pkg/sentry/platform/kvm/bluepill_amd64.s8
1 files changed, 8 insertions, 0 deletions
diff --git a/pkg/sentry/platform/kvm/bluepill_amd64.s b/pkg/sentry/platform/kvm/bluepill_amd64.s
index 953024600..c2a1dca11 100644
--- a/pkg/sentry/platform/kvm/bluepill_amd64.s
+++ b/pkg/sentry/platform/kvm/bluepill_amd64.s
@@ -37,7 +37,15 @@ TEXT ·bluepill(SB),NOSPLIT,$0
begin:
MOVQ vcpu+0(FP), AX
LEAQ VCPU_CPU(AX), BX
+
+ // The gorountine stack will be changed in guest which renders
+ // the frame pointer outdated and misleads perf tools.
+ // Disconnect the frame-chain with the zeroed frame pointer
+ // when it is saved in the frame in bluepillHandler().
+ MOVQ BP, CX
+ MOVQ $0, BP
BYTE CLI;
+ MOVQ CX, BP
check_vcpu:
MOVQ ENTRY_CPU_SELF(GS), CX
CMPQ BX, CX