summaryrefslogtreecommitdiffhomepage
path: root/pkg/sentry
diff options
context:
space:
mode:
authorBin Lu <bin.lu@arm.com>2019-11-26 15:59:51 +0800
committerBin Lu <bin.lu@arm.com>2019-11-26 16:00:00 +0800
commit3f0e91b00450f926d8378ebd518b557c1f273712 (patch)
tree212ff50d760846f342bbb480cd5253dc62d9b759 /pkg/sentry
parentb72e1b3c0873ea29d031db42e39ca053923eecff (diff)
passed the kvm test case of "TestApplicationFault" on Arm64 platform
For test case "TestApplicationFault", Memory-fault in guest user level will be trapped in el0_da. And in el0_da, we use mmio_exit to leave the KVM guest. Signed-off-by: Bin Lu <bin.lu@arm.com>
Diffstat (limited to 'pkg/sentry')
-rw-r--r--pkg/sentry/platform/ring0/entry_arm64.s11
1 files changed, 11 insertions, 0 deletions
diff --git a/pkg/sentry/platform/ring0/entry_arm64.s b/pkg/sentry/platform/ring0/entry_arm64.s
index 29c475882..7b7420785 100644
--- a/pkg/sentry/platform/ring0/entry_arm64.s
+++ b/pkg/sentry/platform/ring0/entry_arm64.s
@@ -444,6 +444,17 @@ el0_svc:
B ·Halt(SB)
el0_da:
+ WORD $0xd538d092 //MRS TPIDR_EL1, R18
+ WORD $0xd538601a //MRS FAR_EL1, R26
+
+ MOVD R26, CPU_FAULT_ADDR(RSV_REG)
+
+ MOVD $1, R3
+ MOVD R3, CPU_ERROR_TYPE(RSV_REG) // Set error type to user.
+
+ MOVD $PageFault, R3
+ MOVD R3, CPU_VECTOR_CODE(RSV_REG)
+
B ·Halt(SB)
el0_ia: