diff options
-rw-r--r-- | arch/x86/Kconfig | 7 | ||||
-rw-r--r-- | include/asm-x86/paravirt.h | 8 |
2 files changed, 15 insertions, 0 deletions
diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig index 9441e46cb49b..67e5275f03c8 100644 --- a/arch/x86/Kconfig +++ b/arch/x86/Kconfig | |||
@@ -435,6 +435,13 @@ config PARAVIRT_CLOCK | |||
435 | 435 | ||
436 | endif | 436 | endif |
437 | 437 | ||
438 | config PARAVIRT_DEBUG | ||
439 | bool "paravirt-ops debugging" | ||
440 | depends on PARAVIRT && DEBUG_KERNEL | ||
441 | help | ||
442 | Enable to debug paravirt_ops internals. Specifically, BUG if | ||
443 | a paravirt_op is missing when it is called. | ||
444 | |||
438 | config MEMTEST | 445 | config MEMTEST |
439 | bool "Memtest" | 446 | bool "Memtest" |
440 | depends on X86_64 | 447 | depends on X86_64 |
diff --git a/include/asm-x86/paravirt.h b/include/asm-x86/paravirt.h index 5467e2cff4bc..198293bed46f 100644 --- a/include/asm-x86/paravirt.h +++ b/include/asm-x86/paravirt.h | |||
@@ -459,10 +459,17 @@ int paravirt_disable_iospace(void); | |||
459 | #define VEXTRA_CLOBBERS , "rax", "r8", "r9", "r10", "r11" | 459 | #define VEXTRA_CLOBBERS , "rax", "r8", "r9", "r10", "r11" |
460 | #endif | 460 | #endif |
461 | 461 | ||
462 | #ifdef CONFIG_PARAVIRT_DEBUG | ||
463 | #define PVOP_TEST_NULL(op) BUG_ON(op == NULL) | ||
464 | #else | ||
465 | #define PVOP_TEST_NULL(op) ((void)op) | ||
466 | #endif | ||
467 | |||
462 | #define __PVOP_CALL(rettype, op, pre, post, ...) \ | 468 | #define __PVOP_CALL(rettype, op, pre, post, ...) \ |
463 | ({ \ | 469 | ({ \ |
464 | rettype __ret; \ | 470 | rettype __ret; \ |
465 | PVOP_CALL_ARGS; \ | 471 | PVOP_CALL_ARGS; \ |
472 | PVOP_TEST_NULL(op); \ | ||
466 | /* This is 32-bit specific, but is okay in 64-bit */ \ | 473 | /* This is 32-bit specific, but is okay in 64-bit */ \ |
467 | /* since this condition will never hold */ \ | 474 | /* since this condition will never hold */ \ |
468 | if (sizeof(rettype) > sizeof(unsigned long)) { \ | 475 | if (sizeof(rettype) > sizeof(unsigned long)) { \ |
@@ -491,6 +498,7 @@ int paravirt_disable_iospace(void); | |||
491 | #define __PVOP_VCALL(op, pre, post, ...) \ | 498 | #define __PVOP_VCALL(op, pre, post, ...) \ |
492 | ({ \ | 499 | ({ \ |
493 | PVOP_VCALL_ARGS; \ | 500 | PVOP_VCALL_ARGS; \ |
501 | PVOP_TEST_NULL(op); \ | ||
494 | asm volatile(pre \ | 502 | asm volatile(pre \ |
495 | paravirt_alt(PARAVIRT_CALL) \ | 503 | paravirt_alt(PARAVIRT_CALL) \ |
496 | post \ | 504 | post \ |