summaryrefslogtreecommitdiffstats
path: root/drivers/kvm/kvm.h
diff options
context:
space:
mode:
authorRusty Russell <rusty@rustcorp.com.au>2007-08-01 10:48:02 +1000
committerAvi Kivity <avi@qumranet.com>2007-10-13 10:18:22 +0200
commitf02424785ab83bab8283ad33044284f749c08db8 (patch)
tree020d73469f801e33012702c58233e776381d3008 /drivers/kvm/kvm.h
parent33830b4f5bdf2bc21d0c10d38beffdce8edcded7 (diff)
downloadop-kernel-dev-f02424785ab83bab8283ad33044284f749c08db8.zip
op-kernel-dev-f02424785ab83bab8283ad33044284f749c08db8.tar.gz
KVM: Add and use pr_unimpl for standard formatting of unimplemented features
All guest-invokable printks should be ratelimited to prevent malicious guests from flooding logs. This is a start. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au> Signed-off-by: Avi Kivity <avi@qumranet.com>
Diffstat (limited to 'drivers/kvm/kvm.h')
-rw-r--r--drivers/kvm/kvm.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/drivers/kvm/kvm.h b/drivers/kvm/kvm.h
index cfda3ab..6d25826 100644
--- a/drivers/kvm/kvm.h
+++ b/drivers/kvm/kvm.h
@@ -474,6 +474,14 @@ struct kvm_arch_ops {
extern struct kvm_arch_ops *kvm_arch_ops;
+/* The guest did something we don't support. */
+#define pr_unimpl(vcpu, fmt, ...) \
+ do { \
+ if (printk_ratelimit()) \
+ printk(KERN_ERR "kvm: %i: cpu%i " fmt, \
+ current->tgid, (vcpu)->vcpu_id , ## __VA_ARGS__); \
+ } while(0)
+
#define kvm_printf(kvm, fmt ...) printk(KERN_DEBUG fmt)
#define vcpu_printf(vcpu, fmt...) kvm_printf(vcpu->kvm, fmt)
OpenPOWER on IntegriCloud