aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorJeremy Fitzhardinge <jeremy@xensource.com>2007-10-16 14:51:31 -0400
committerJeremy Fitzhardinge <jeremy@goop.org>2007-10-16 14:51:31 -0400
commita122d6230e8d8ac7cffdf0bc9cc4b256b928fe49 (patch)
treed3228ebee5746bb3d7268ae34f039d7a7c4c51cf /arch
parente3d2697669abbe26c08dc9b95e2a71c634d096ed (diff)
xen: add some debug output for failed multicalls
Multicalls are expected to never fail, and the normal response to a failed multicall is very terse. In the interests of better debuggability, add some more verbose output. It may be worth turning this off once it all seems more tested. Signed-off-by: Jeremy Fitzhardinge <jeremy@xensource.com>
Diffstat (limited to 'arch')
-rw-r--r--arch/x86/xen/multicalls.c25
1 files changed, 25 insertions, 0 deletions
diff --git a/arch/x86/xen/multicalls.c b/arch/x86/xen/multicalls.c
index ce9c4b41f02d..5e6f36f6d876 100644
--- a/arch/x86/xen/multicalls.c
+++ b/arch/x86/xen/multicalls.c
@@ -26,11 +26,16 @@
26 26
27#include "multicalls.h" 27#include "multicalls.h"
28 28
29#define MC_DEBUG 1
30
29#define MC_BATCH 32 31#define MC_BATCH 32
30#define MC_ARGS (MC_BATCH * 16 / sizeof(u64)) 32#define MC_ARGS (MC_BATCH * 16 / sizeof(u64))
31 33
32struct mc_buffer { 34struct mc_buffer {
33 struct multicall_entry entries[MC_BATCH]; 35 struct multicall_entry entries[MC_BATCH];
36#if MC_DEBUG
37 struct multicall_entry debug[MC_BATCH];
38#endif
34 u64 args[MC_ARGS]; 39 u64 args[MC_ARGS];
35 struct callback { 40 struct callback {
36 void (*fn)(void *); 41 void (*fn)(void *);
@@ -56,11 +61,31 @@ void xen_mc_flush(void)
56 local_irq_save(flags); 61 local_irq_save(flags);
57 62
58 if (b->mcidx) { 63 if (b->mcidx) {
64#if MC_DEBUG
65 memcpy(b->debug, b->entries,
66 b->mcidx * sizeof(struct multicall_entry));
67#endif
68
59 if (HYPERVISOR_multicall(b->entries, b->mcidx) != 0) 69 if (HYPERVISOR_multicall(b->entries, b->mcidx) != 0)
60 BUG(); 70 BUG();
61 for (i = 0; i < b->mcidx; i++) 71 for (i = 0; i < b->mcidx; i++)
62 if (b->entries[i].result < 0) 72 if (b->entries[i].result < 0)
63 ret++; 73 ret++;
74
75#if MC_DEBUG
76 if (ret) {
77 printk(KERN_ERR "%d multicall(s) failed: cpu %d\n",
78 ret, smp_processor_id());
79 for(i = 0; i < b->mcidx; i++) {
80 printk(" call %2d/%d: op=%lu arg=[%lx] result=%ld\n",
81 i+1, b->mcidx,
82 b->debug[i].op,
83 b->debug[i].args[0],
84 b->entries[i].result);
85 }
86 }
87#endif
88
64 b->mcidx = 0; 89 b->mcidx = 0;
65 b->argidx = 0; 90 b->argidx = 0;
66 } else 91 } else