From: Wei Chen Date: Wed, 5 Apr 2017 09:09:17 +0000 (+0800) Subject: xen/arm: Introduce a helper to check local abort is enabled X-Git-Tag: archive/raspbian/4.11.1-1+rpi1~1^2~66^2~2335 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=1656edde42d556d2457fb5a452c8e81a01328c0b;p=xen.git xen/arm: Introduce a helper to check local abort is enabled 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 Reviewed-by: Julien Grall --- diff --git a/xen/include/asm-arm/system.h b/xen/include/asm-arm/system.h index 2eb96e8769..b94e56fe26 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);