x86/paravirt: add debugging for missing operations
Rather than just jumping to 0 when there's a missing operation, raise a BUG. Signed-off-by: Jeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com> Cc: xen-devel <xen-devel@lists.xensource.com> Cc: Stephen Tweedie <sct@redhat.com> Cc: Eduardo Habkost <ehabkost@redhat.com> Cc: Mark McLoughlin <markmc@redhat.com> Signed-off-by: Ingo Molnar <mingo@elte.hu>
This commit is contained in:
committed by
Ingo Molnar
parent
d8d5900ef8
commit
97349135fe
@@ -435,6 +435,13 @@ config PARAVIRT_CLOCK
|
|||||||
|
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
config PARAVIRT_DEBUG
|
||||||
|
bool "paravirt-ops debugging"
|
||||||
|
depends on PARAVIRT && DEBUG_KERNEL
|
||||||
|
help
|
||||||
|
Enable to debug paravirt_ops internals. Specifically, BUG if
|
||||||
|
a paravirt_op is missing when it is called.
|
||||||
|
|
||||||
config MEMTEST
|
config MEMTEST
|
||||||
bool "Memtest"
|
bool "Memtest"
|
||||||
depends on X86_64
|
depends on X86_64
|
||||||
|
@@ -459,10 +459,17 @@ int paravirt_disable_iospace(void);
|
|||||||
#define VEXTRA_CLOBBERS , "rax", "r8", "r9", "r10", "r11"
|
#define VEXTRA_CLOBBERS , "rax", "r8", "r9", "r10", "r11"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifdef CONFIG_PARAVIRT_DEBUG
|
||||||
|
#define PVOP_TEST_NULL(op) BUG_ON(op == NULL)
|
||||||
|
#else
|
||||||
|
#define PVOP_TEST_NULL(op) ((void)op)
|
||||||
|
#endif
|
||||||
|
|
||||||
#define __PVOP_CALL(rettype, op, pre, post, ...) \
|
#define __PVOP_CALL(rettype, op, pre, post, ...) \
|
||||||
({ \
|
({ \
|
||||||
rettype __ret; \
|
rettype __ret; \
|
||||||
PVOP_CALL_ARGS; \
|
PVOP_CALL_ARGS; \
|
||||||
|
PVOP_TEST_NULL(op); \
|
||||||
/* This is 32-bit specific, but is okay in 64-bit */ \
|
/* This is 32-bit specific, but is okay in 64-bit */ \
|
||||||
/* since this condition will never hold */ \
|
/* since this condition will never hold */ \
|
||||||
if (sizeof(rettype) > sizeof(unsigned long)) { \
|
if (sizeof(rettype) > sizeof(unsigned long)) { \
|
||||||
@@ -491,6 +498,7 @@ int paravirt_disable_iospace(void);
|
|||||||
#define __PVOP_VCALL(op, pre, post, ...) \
|
#define __PVOP_VCALL(op, pre, post, ...) \
|
||||||
({ \
|
({ \
|
||||||
PVOP_VCALL_ARGS; \
|
PVOP_VCALL_ARGS; \
|
||||||
|
PVOP_TEST_NULL(op); \
|
||||||
asm volatile(pre \
|
asm volatile(pre \
|
||||||
paravirt_alt(PARAVIRT_CALL) \
|
paravirt_alt(PARAVIRT_CALL) \
|
||||||
post \
|
post \
|
||||||
|
Reference in New Issue
Block a user