From: Wei Chen <Wei.Chen@arm.com>
To: xen-devel@lists.xen.org
Cc: sstabellini@kernel.org, wei.chen@arm.com, steve.capper@arm.com,
Kaly.Xin@arm.com, julien.grall@arm.com, nd@arm.com
Subject: [PATCH v2 15/19] xen/arm: Unmask the Abort/SError bit in the exception entries
Date: Thu, 30 Mar 2017 17:13:25 +0800 [thread overview]
Message-ID: <1490865209-18283-16-git-send-email-Wei.Chen@arm.com> (raw)
In-Reply-To: <1490865209-18283-1-git-send-email-Wei.Chen@arm.com>
Currently, we masked the Abort/SError bit in Xen exception entries.
So Xen could not capture any Abort/SError while it's running.
Now, Xen has the ability to handle the Abort/SError, we should unmask
the Abort/SError bit by default to let Xen capture Abort/SError while
it's running.
But in order to avoid receiving nested asynchronous abort, we don't
unmask Abort/SError bit in hyp_error and trap_data_abort.
Signed-off-by: Wei Chen <Wei.Chen@arm.com>
Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
---
xen/arch/arm/arm32/entry.S | 15 ++++++++++++++-
xen/arch/arm/arm64/entry.S | 13 ++++++++-----
2 files changed, 22 insertions(+), 6 deletions(-)
diff --git a/xen/arch/arm/arm32/entry.S b/xen/arch/arm/arm32/entry.S
index 105cae8..592e4a8 100644
--- a/xen/arch/arm/arm32/entry.S
+++ b/xen/arch/arm/arm32/entry.S
@@ -116,6 +116,7 @@ skip_check:
trap_##trap: \
SAVE_ALL; \
cpsie i; /* local_irq_enable */ \
+ cpsie a; /* asynchronous abort enable */ \
adr lr, return_from_trap; \
mov r0, sp; \
mov r11, sp; \
@@ -126,6 +127,18 @@ trap_##trap: \
ALIGN; \
trap_##trap: \
SAVE_ALL; \
+ cpsie a; /* asynchronous abort enable */ \
+ adr lr, return_from_trap; \
+ mov r0, sp; \
+ mov r11, sp; \
+ bic sp, #7; /* Align the stack pointer (noop on guest trap) */ \
+ b do_trap_##trap
+
+#define DEFINE_TRAP_ENTRY_NOABORT(trap) \
+ ALIGN; \
+trap_##trap: \
+ SAVE_ALL; \
+ cpsie i; /* local_irq_enable */ \
adr lr, return_from_trap; \
mov r0, sp; \
mov r11, sp; \
@@ -146,10 +159,10 @@ GLOBAL(hyp_traps_vector)
DEFINE_TRAP_ENTRY(undefined_instruction)
DEFINE_TRAP_ENTRY(supervisor_call)
DEFINE_TRAP_ENTRY(prefetch_abort)
-DEFINE_TRAP_ENTRY(data_abort)
DEFINE_TRAP_ENTRY(hypervisor)
DEFINE_TRAP_ENTRY_NOIRQ(irq)
DEFINE_TRAP_ENTRY_NOIRQ(fiq)
+DEFINE_TRAP_ENTRY_NOABORT(data_abort)
return_from_trap:
mov sp, r11
diff --git a/xen/arch/arm/arm64/entry.S b/xen/arch/arm/arm64/entry.S
index 8d5a890..0401a41 100644
--- a/xen/arch/arm/arm64/entry.S
+++ b/xen/arch/arm/arm64/entry.S
@@ -187,13 +187,14 @@ hyp_error:
/* Traps taken in Current EL with SP_ELx */
hyp_sync:
entry hyp=1
- msr daifclr, #2
+ msr daifclr, #6
mov x0, sp
bl do_trap_hypervisor
exit hyp=1
hyp_irq:
entry hyp=1
+ msr daifclr, #4
mov x0, sp
bl do_trap_irq
exit hyp=1
@@ -208,7 +209,7 @@ guest_sync:
ALTERNATIVE("bl check_pending_vserror; cbnz x0, 1f",
"nop; nop",
SKIP_CHECK_PENDING_VSERROR)
- msr daifclr, #2
+ msr daifclr, #6
mov x0, sp
bl do_trap_hypervisor
1:
@@ -224,6 +225,7 @@ guest_irq:
ALTERNATIVE("bl check_pending_vserror; cbnz x0, 1f",
"nop; nop",
SKIP_CHECK_PENDING_VSERROR)
+ msr daifclr, #4
mov x0, sp
bl do_trap_irq
1:
@@ -235,7 +237,7 @@ guest_fiq_invalid:
guest_error:
entry hyp=0, compat=0
- msr daifclr, #2
+ msr daifclr, #6
mov x0, sp
bl do_trap_guest_serror
exit hyp=0, compat=0
@@ -250,7 +252,7 @@ guest_sync_compat:
ALTERNATIVE("bl check_pending_vserror; cbnz x0, 1f",
"nop; nop",
SKIP_CHECK_PENDING_VSERROR)
- msr daifclr, #2
+ msr daifclr, #6
mov x0, sp
bl do_trap_hypervisor
1:
@@ -266,6 +268,7 @@ guest_irq_compat:
ALTERNATIVE("bl check_pending_vserror; cbnz x0, 1f",
"nop; nop",
SKIP_CHECK_PENDING_VSERROR)
+ msr daifclr, #4
mov x0, sp
bl do_trap_irq
1:
@@ -277,7 +280,7 @@ guest_fiq_invalid_compat:
guest_error_compat:
entry hyp=0, compat=1
- msr daifclr, #2
+ msr daifclr, #6
mov x0, sp
bl do_trap_guest_serror
exit hyp=0, compat=1
--
2.7.4
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel
next prev parent reply other threads:[~2017-03-30 9:13 UTC|newest]
Thread overview: 57+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-03-30 9:13 [PATCH v2 00/19] Provide a command line option to choose how to handle SErrors Wei Chen
2017-03-30 9:13 ` [PATCH v2 01/19] xen/arm: Save ESR_EL2 to avoid using mismatched value in syndrome check Wei Chen
2017-03-30 13:31 ` Julien Grall
2017-03-31 3:26 ` Wei Chen
2017-03-30 9:13 ` [PATCH v2 02/19] xen/arm: Remove vwfi while setting HCR_EL2 in init_traps Wei Chen
2017-03-30 17:05 ` Julien Grall
2017-03-30 22:29 ` Stefano Stabellini
2017-03-31 5:58 ` Wei Chen
2017-03-31 8:34 ` Julien Grall
2017-03-30 9:13 ` [PATCH v2 03/19] xen/arm: Move parse_vwfi from trap.c to domain.c Wei Chen
2017-03-30 9:13 ` [PATCH v2 04/19] xen/arm: Restore HCR_EL2 register Wei Chen
2017-03-30 17:07 ` Julien Grall
2017-03-30 22:03 ` Stefano Stabellini
2017-03-31 2:10 ` Wei Chen
2017-03-31 8:39 ` Julien Grall
2017-03-31 8:59 ` Wei Chen
2017-03-30 9:13 ` [PATCH v2 05/19] xen/arm: Avoid setting/clearing HCR_RW at every context switch Wei Chen
2017-03-30 17:12 ` Julien Grall
2017-03-30 21:21 ` Stefano Stabellini
2017-03-30 9:13 ` [PATCH v2 06/19] xen/arm: Save HCR_EL2 when a guest took the SError Wei Chen
2017-03-30 9:13 ` [PATCH v2 07/19] xen/arm: Introduce a virtual abort injection helper Wei Chen
2017-03-30 17:20 ` Julien Grall
2017-03-30 21:24 ` Stefano Stabellini
2017-03-31 5:25 ` Wei Chen
2017-03-30 9:13 ` [PATCH v2 08/19] xen/arm: Introduce a command line parameter for SErrors/Aborts Wei Chen
2017-03-30 17:39 ` Julien Grall
2017-03-31 5:28 ` Wei Chen
2017-03-30 9:13 ` [PATCH v2 09/19] xen/arm: Introduce a initcall to update cpu_hwcaps by serror_op Wei Chen
2017-03-30 17:51 ` Julien Grall
2017-03-30 18:02 ` Julien Grall
2017-03-30 21:28 ` Stefano Stabellini
2017-03-31 8:50 ` Julien Grall
2017-03-30 9:13 ` [PATCH v2 10/19] xen/arm64: Use alternative to skip the check of pending serrors Wei Chen
2017-03-30 9:13 ` [PATCH v2 11/19] xen/arm32: " Wei Chen
2017-03-30 18:06 ` Julien Grall
2017-03-30 21:29 ` Stefano Stabellini
2017-03-31 5:33 ` Wei Chen
2017-03-30 9:13 ` [PATCH v2 12/19] xen/arm: Move macro VABORT_GEN_BY_GUEST to common header Wei Chen
2017-03-30 21:36 ` Stefano Stabellini
2017-03-31 5:35 ` Wei Chen
2017-03-30 9:13 ` [PATCH v2 13/19] xen/arm: Introduce new helpers to handle guest/hyp SErrors Wei Chen
2017-03-30 9:13 ` [PATCH v2 14/19] xen/arm: Replace do_trap_guest_serror with new helpers Wei Chen
2017-03-30 9:13 ` Wei Chen [this message]
2017-03-30 9:13 ` [PATCH v2 16/19] xen/arm: Introduce a helper to synchronize SError Wei Chen
2017-03-30 18:28 ` Julien Grall
2017-03-30 18:32 ` Julien Grall
2017-03-30 18:37 ` Julien Grall
2017-03-31 5:51 ` Wei Chen
2017-03-31 10:55 ` Wei Chen
2017-03-31 11:06 ` Julien Grall
2017-03-31 11:09 ` Wei Chen
2017-03-30 9:13 ` [PATCH v2 17/19] xen/arm: Isolate the SError between the context switch of 2 vCPUs Wei Chen
2017-03-30 21:49 ` Stefano Stabellini
2017-03-30 22:00 ` Julien Grall
2017-03-31 5:52 ` Wei Chen
2017-03-30 9:13 ` [PATCH v2 18/19] xen/arm: Prevent slipping hypervisor SError to guest Wei Chen
2017-03-30 9:13 ` [PATCH v2 19/19] xen/arm: Handle guest external abort as guest SError Wei Chen
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1490865209-18283-16-git-send-email-Wei.Chen@arm.com \
--to=wei.chen@arm.com \
--cc=Kaly.Xin@arm.com \
--cc=julien.grall@arm.com \
--cc=nd@arm.com \
--cc=sstabellini@kernel.org \
--cc=steve.capper@arm.com \
--cc=xen-devel@lists.xen.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.