diff mbox

[v4,15/19] xen/arm: Introduce a helper to check local abort is enabled

Message ID 1491383361-22886-16-git-send-email-Wei.Chen@arm.com (mailing list archive)
State New, archived
Headers show

Commit Message

Wei Chen April 5, 2017, 9:09 a.m. UTC
In previous patch, we have umasked the Abort/SError bit for Xen
in most of its running time. So in some use-cases, we have to
check whether the abort is enabled in current context. For example,
while we want to synchronize SErrors, we have to confirm the abort
is enabled. Otherwise synchronize SErrors is pointless.

Signed-off-by: Wei Chen <Wei.Chen@arm.com>

---
v3->v4:
Use one local_abort_is_enabled for ARM32 and ARM64.
---
 xen/include/asm-arm/system.h | 7 +++++++
 1 file changed, 7 insertions(+)

Comments

Julien Grall April 5, 2017, 11:14 a.m. UTC | #1
Hi Wei,

On 05/04/17 10:09, Wei Chen wrote:
> In previous patch, we have umasked the Abort/SError bit for Xen
> in most of its running time. So in some use-cases, we have to
> check whether the abort is enabled in current context. For example,
> while we want to synchronize SErrors, we have to confirm the abort
> is enabled. Otherwise synchronize SErrors is pointless.
>
> Signed-off-by: Wei Chen <Wei.Chen@arm.com>

Reviewed-by: Julien Grall <julien.grall@arm.com>

Cheers,
diff mbox

Patch

diff --git a/xen/include/asm-arm/system.h b/xen/include/asm-arm/system.h
index 2eb96e8..b94e56f 100644
--- a/xen/include/asm-arm/system.h
+++ b/xen/include/asm-arm/system.h
@@ -51,6 +51,13 @@ 
 # error "unknown ARM variant"
 #endif
 
+static inline int local_abort_is_enabled(void)
+{
+    unsigned long flags;
+    local_save_flags(flags);
+    return !(flags & PSR_ABT_MASK);
+}
+
 #define arch_fetch_and_add(x, v) __sync_fetch_and_add(x, v)
 
 extern struct vcpu *__context_switch(struct vcpu *prev, struct vcpu *next);