bbb3b5e
xen: arm: rate-limit logging from unimplemented PHYSDEVOP and HVMOP.
bbb3b5e
bbb3b5e
These are guest accessible and should therefore be rate-limited.
bbb3b5e
Moreover, include them only in debug builds.
bbb3b5e
bbb3b5e
This is XSA-146.
bbb3b5e
bbb3b5e
Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
bbb3b5e
Reviewed-by: Jan Beulich <jbeulich@suse.com>
bbb3b5e
bbb3b5e
diff --git a/xen/arch/arm/hvm.c b/xen/arch/arm/hvm.c
bbb3b5e
index 471c4cd..1de290f 100644
bbb3b5e
--- a/xen/arch/arm/hvm.c
bbb3b5e
+++ b/xen/arch/arm/hvm.c
bbb3b5e
@@ -57,7 +57,7 @@ long do_hvm_op(unsigned long op, XEN_GUEST_HANDLE_PARAM(void) arg)
bbb3b5e
 
bbb3b5e
     default:
bbb3b5e
     {
bbb3b5e
-        printk("%s: Bad HVM op %ld.\n", __func__, op);
bbb3b5e
+        gdprintk(XENLOG_DEBUG, "HVMOP op=%lu: not implemented\n", op);
bbb3b5e
         rc = -ENOSYS;
bbb3b5e
         break;
bbb3b5e
     }
bbb3b5e
diff --git a/xen/arch/arm/physdev.c b/xen/arch/arm/physdev.c
bbb3b5e
index 61b4a18..b1ba22e 100644
bbb3b5e
--- a/xen/arch/arm/physdev.c
bbb3b5e
+++ b/xen/arch/arm/physdev.c
bbb3b5e
@@ -8,12 +8,13 @@
bbb3b5e
 #include <xen/types.h>
bbb3b5e
 #include <xen/lib.h>
bbb3b5e
 #include <xen/errno.h>
bbb3b5e
+#include <xen/sched.h>
bbb3b5e
 #include <asm/hypercall.h>
bbb3b5e
 
bbb3b5e
 
bbb3b5e
 int do_physdev_op(int cmd, XEN_GUEST_HANDLE_PARAM(void) arg)
bbb3b5e
 {
bbb3b5e
-    printk("%s %d cmd=%d: not implemented yet\n", __func__, __LINE__, cmd);
bbb3b5e
+    gdprintk(XENLOG_DEBUG, "PHYSDEVOP cmd=%d: not implemented\n", cmd);
bbb3b5e
     return -ENOSYS;
bbb3b5e
 }
bbb3b5e