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 2/2] xen/arm32: Use alternative to skip the check of pending serrors
Date: Thu, 16 Mar 2017 17:53:39 +0800 [thread overview]
Message-ID: <1489658019-22486-3-git-send-email-Wei.Chen@arm.com> (raw)
In-Reply-To: <1489658019-22486-1-git-send-email-Wei.Chen@arm.com>
We have provided an option to administrator to determine how to
handle the SErrors. In order to skip the check of pending SError,
in conventional way, we have to read the option every time before
we try to check the pending SError. This will add overhead to check
the option at every trap.
The ARM32 supports the alternative patching feature. We can use an
ALTERNATIVE to avoid checking option at every trap. We added a new
cpufeature named "SKIP_CHECK_PENDING_VSERROR". This feature will be
enabled when the option is not diverse.
Signed-off-by: Wei Chen <Wei.Chen@arm.com>
---
xen/arch/arm/arm32/entry.S | 27 +++++++++------------------
1 file changed, 9 insertions(+), 18 deletions(-)
diff --git a/xen/arch/arm/arm32/entry.S b/xen/arch/arm/arm32/entry.S
index 79929ca..105cae8 100644
--- a/xen/arch/arm/arm32/entry.S
+++ b/xen/arch/arm/arm32/entry.S
@@ -1,6 +1,6 @@
#include <asm/asm_defns.h>
#include <asm/regs.h>
-#include <asm/cpufeature.h>
+#include <asm/alternative.h>
#include <public/xen.h>
#define SAVE_ONE_BANKED(reg) mrs r11, reg; str r11, [sp, #UREGS_##reg]
@@ -12,21 +12,6 @@
#define RESTORE_BANKED(mode) \
RESTORE_ONE_BANKED(SP_##mode) ; RESTORE_ONE_BANKED(LR_##mode) ; RESTORE_ONE_BANKED(SPSR_##mode)
-/*
- * If the SKIP_CHECK_PENDING_VSERROR has been set in the cpu feature,
- * the checking of pending SErrors will be skipped.
- *
- * As it is a temporary solution, we are assuming that
- * SKIP_CHECK_PENDING_VSERROR will always be in the first word for
- * cpu_hwcaps. This would have to be dropped as soon as ARM32 gain
- * support of alternative.
- */
-#define SKIP_VSERROR_CHECK \
- ldr r1, =cpu_hwcaps; \
- ldr r1, [r1]; \
- tst r1, #SKIP_CHECK_PENDING_VSERROR; \
- moveq pc, lr
-
#define SAVE_ALL \
sub sp, #(UREGS_SP_usr - UREGS_sp); /* SP, LR, SPSR, PC */ \
push {r0-r12}; /* Save R0-R12 */ \
@@ -61,8 +46,13 @@ save_guest_regs:
SAVE_ONE_BANKED(R8_fiq); SAVE_ONE_BANKED(R9_fiq); SAVE_ONE_BANKED(R10_fiq)
SAVE_ONE_BANKED(R11_fiq); SAVE_ONE_BANKED(R12_fiq);
- SKIP_VSERROR_CHECK
-
+ /*
+ * If the SKIP_CHECK_PENDING_VSERROR has been set in the cpu feature,
+ * the checking of pending SErrors will be skipped.
+ */
+ ALTERNATIVE("nop",
+ "b skip_check",
+ SKIP_CHECK_PENDING_VSERROR)
/*
* Start to check pending virtual abort in the gap of Guest -> HYP
* world switch.
@@ -118,6 +108,7 @@ abort_guest_exit_end:
*/
bne return_from_trap
+skip_check:
mov pc, lr
#define DEFINE_TRAP_ENTRY(trap) \
--
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-16 9:53 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-03-16 9:53 [PATCH 0/2] xen/arm32: Use alternative to skip the check of pending serrors Wei Chen
2017-03-16 9:53 ` [PATCH 1/2] xen/arm32: Introduce alternative runtime patching Wei Chen
2017-03-16 15:12 ` Julien Grall
2017-03-17 6:35 ` Wei Chen
2017-03-24 10:48 ` Julien Grall
2017-03-27 9:22 ` Wei Chen
2017-03-17 14:34 ` Konrad Rzeszutek Wilk
2017-03-20 6:45 ` Wei Chen
2017-03-21 13:31 ` Konrad Rzeszutek Wilk
2017-03-16 9:53 ` Wei Chen [this message]
2017-03-16 14:01 ` [PATCH 2/2] xen/arm32: Use alternative to skip the check of pending serrors Julien Grall
2017-03-17 5:50 ` Wei Chen
2017-03-16 15:15 ` [PATCH 0/2] " Julien Grall
2017-03-20 22:08 ` Stefano Stabellini
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=1489658019-22486-3-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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).