From f6802ba976a431847ff41479da163bb8710d8e7b Mon Sep 17 00:00:00 2001 From: Jeremy Fitzhardinge Date: Wed, 25 Jun 2008 00:19:14 -0400 Subject: [PATCH] --- yaml --- r: 99948 b: refs/heads/master c: 97349135fea7f0ba8464534433df3bfd1dc0e9a6 h: refs/heads/master v: v3 --- [refs] | 2 +- trunk/arch/x86/Kconfig | 7 +++++++ trunk/include/asm-x86/paravirt.h | 8 ++++++++ 3 files changed, 16 insertions(+), 1 deletion(-) diff --git a/[refs] b/[refs] index 63cb67fd4ab1..9d2c13bd645f 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: d8d5900ef8afc562088f8470feeaf17c4747790f +refs/heads/master: 97349135fea7f0ba8464534433df3bfd1dc0e9a6 diff --git a/trunk/arch/x86/Kconfig b/trunk/arch/x86/Kconfig index 9441e46cb49b..67e5275f03c8 100644 --- a/trunk/arch/x86/Kconfig +++ b/trunk/arch/x86/Kconfig @@ -435,6 +435,13 @@ config PARAVIRT_CLOCK 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 bool "Memtest" depends on X86_64 diff --git a/trunk/include/asm-x86/paravirt.h b/trunk/include/asm-x86/paravirt.h index 5467e2cff4bc..198293bed46f 100644 --- a/trunk/include/asm-x86/paravirt.h +++ b/trunk/include/asm-x86/paravirt.h @@ -459,10 +459,17 @@ int paravirt_disable_iospace(void); #define VEXTRA_CLOBBERS , "rax", "r8", "r9", "r10", "r11" #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, ...) \ ({ \ rettype __ret; \ PVOP_CALL_ARGS; \ + PVOP_TEST_NULL(op); \ /* This is 32-bit specific, but is okay in 64-bit */ \ /* since this condition will never hold */ \ if (sizeof(rettype) > sizeof(unsigned long)) { \ @@ -491,6 +498,7 @@ int paravirt_disable_iospace(void); #define __PVOP_VCALL(op, pre, post, ...) \ ({ \ PVOP_VCALL_ARGS; \ + PVOP_TEST_NULL(op); \ asm volatile(pre \ paravirt_alt(PARAVIRT_CALL) \ post \