x86: Assert !in_atomic() before exiting to guest context.

Signed-off-by: Keir Fraser <keir@xen.org>
This commit is contained in:
Keir Fraser committed 2013-01-14 13:55:45 +00:00
1 parent b07423c7ce
commit 143c33f1bc
6 files changed
+18

No files matched your search

+1
View File
@@ -42,6 +42,7 @@
ENTRY(svm_asm_do_resume)
call svm_intr_assist
call_with_regs(nsvm_vcpu_switch)
ASSERT_NOT_IN_ATOMIC
get_current(bx)
CLGI
+1
View File
@@ -98,6 +98,7 @@ vmx_asm_vmexit_handler:
vmx_asm_do_vmentry:
call vmx_intr_assist
call nvmx_switch_guest
ASSERT_NOT_IN_ATOMIC
get_current(bx)
cli
+1
View File
@@ -92,6 +92,7 @@ compat_skip_clobber:
/* %rbx: struct vcpu */
ENTRY(compat_test_all_events)
ASSERT_NOT_IN_ATOMIC
cli # tests must not race interrupts
/*compat_test_softirqs:*/
movl VCPU_processor(%rbx),%eax
+1
View File
@@ -190,6 +190,7 @@ skip_clobber:
/* %rbx: struct vcpu */
test_all_events:
ASSERT_NOT_IN_ATOMIC
cli # tests must not race interrupts
/*test_softirqs:*/
movl VCPU_processor(%rbx),%eax
+6
View File
@@ -30,3 +30,9 @@ bool_t in_atomic(void)
{
return preempt_count() || in_irq() || !local_irq_is_enabled();
}
/* asm helper */
void bug_if_in_atomic(void)
{
BUG_ON(in_atomic());
}
+8
View File
@@ -59,6 +59,14 @@ void ret_from_intr(void);
GET_STACK_BASE(reg); \
__GET_CURRENT(reg)
#ifndef NDEBUG
#define ASSERT_NOT_IN_ATOMIC \
sti; /* sometimes called with interrupts disabled: safe to enable */ \
call bug_if_in_atomic
#else
#define ASSERT_NOT_IN_ATOMIC
#endif
#endif
#endif /* __X86_ASM_DEFNS_H__ */
Reference in new issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.