forked from ~ljy/RK356X_SDK_RELEASE

hc
2024-05-10 748e4f3d702def1a4bff191e0cf93b6a05340f01
kernel/arch/x86/xen/multicalls.c
....@@ -69,6 +69,11 @@
6969
7070 trace_xen_mc_flush(b->mcidx, b->argidx, b->cbidx);
7171
72
+#if MC_DEBUG
73
+ memcpy(b->debug, b->entries,
74
+ b->mcidx * sizeof(struct multicall_entry));
75
+#endif
76
+
7277 switch (b->mcidx) {
7378 case 0:
7479 /* no-op */
....@@ -87,32 +92,34 @@
8792 break;
8893
8994 default:
90
-#if MC_DEBUG
91
- memcpy(b->debug, b->entries,
92
- b->mcidx * sizeof(struct multicall_entry));
93
-#endif
94
-
9595 if (HYPERVISOR_multicall(b->entries, b->mcidx) != 0)
9696 BUG();
9797 for (i = 0; i < b->mcidx; i++)
9898 if (b->entries[i].result < 0)
9999 ret++;
100
+ }
100101
102
+ if (WARN_ON(ret)) {
103
+ pr_err("%d of %d multicall(s) failed: cpu %d\n",
104
+ ret, b->mcidx, smp_processor_id());
105
+ for (i = 0; i < b->mcidx; i++) {
106
+ if (b->entries[i].result < 0) {
101107 #if MC_DEBUG
102
- if (ret) {
103
- printk(KERN_ERR "%d multicall(s) failed: cpu %d\n",
104
- ret, smp_processor_id());
105
- dump_stack();
106
- for (i = 0; i < b->mcidx; i++) {
107
- printk(KERN_DEBUG " call %2d/%d: op=%lu arg=[%lx] result=%ld\t%pF\n",
108
- i+1, b->mcidx,
108
+ pr_err(" call %2d: op=%lu arg=[%lx] result=%ld\t%pS\n",
109
+ i + 1,
109110 b->debug[i].op,
110111 b->debug[i].args[0],
111112 b->entries[i].result,
112113 b->caller[i]);
114
+#else
115
+ pr_err(" call %2d: op=%lu arg=[%lx] result=%ld\n",
116
+ i + 1,
117
+ b->entries[i].op,
118
+ b->entries[i].args[0],
119
+ b->entries[i].result);
120
+#endif
113121 }
114122 }
115
-#endif
116123 }
117124
118125 b->mcidx = 0;
....@@ -126,8 +133,6 @@
126133 b->cbidx = 0;
127134
128135 local_irq_restore(flags);
129
-
130
- WARN_ON(ret);
131136 }
132137
133138 struct multicall_space __xen_mc_entry(size_t args)