[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] xen: Modify domain_crash() to take a print string



Hi,

On 03/02/2022 13:38, Andrew Cooper wrote:
diff --git a/xen/include/xen/sched.h b/xen/include/xen/sched.h
index 37f78cc4c4c9..38b390d20371 100644
--- a/xen/include/xen/sched.h
+++ b/xen/include/xen/sched.h
@@ -736,10 +736,15 @@ void vcpu_end_shutdown_deferral(struct vcpu *v);
   * from any processor.
   */
  void __domain_crash(struct domain *d);
-#define domain_crash(d) do {                                              \
-    printk("domain_crash called from %s:%d\n", __FILE__, __LINE__);       \
-    __domain_crash(d);                                                    \
-} while (0)
+#define domain_crash(d, ...)                            \
+    do {                                                \
+        if ( count_args(__VA_ARGS__) == 0 )             \
+            printk("domain_crash called from %s:%d\n",  \
+                   __FILE__, __LINE__);                 \

I find a bit odd that here you are using a normal printk but...


+        else                                            \
+            printk(XENLOG_G_ERR __VA_ARGS__);           \

here it is XENLOG_G_ERR. In fact, isn't it ratelimited? If so, wouldn't it be better to only use XENLOG_ERR so they can always be seen? (A domain shouldn't be able to abuse it).

Cheers,

--
Julien Grall



 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.