]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
kvm: x86: don't print warning messages for unimplemented msrs
authorBandan Das <bsd@redhat.com>
Tue, 15 Nov 2016 06:36:18 +0000 (01:36 -0500)
committerAaron Young <Aaron.Young@oracle.com>
Fri, 17 Nov 2017 20:25:01 +0000 (12:25 -0800)
Change unimplemented msrs messages to use pr_debug.
If CONFIG_DYNAMIC_DEBUG is set, then these messages can be
enabled at run time or else -DDEBUG can be used at compile
time to enable them. These messages will still be printed if
ignore_msrs=1.

Signed-off-by: Bandan Das <bsd@redhat.com>
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Radim Krčmář <rkrcmar@redhat.com>
(cherry picked from commit ae0f5499511e5b1723792c848e44d661d0d4e22f)

Orabug: 26933160

Signed-off-by: Aaron Young <Aaron.Young@oracle.com>
Reviewed-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Conflicts:
arch/x86/kvm/mmu.c
arch/x86/kvm/x86.c
include/linux/kvm_host.h

NOTE: Conflicts were due to unrelated or missing changes which prevented
the auto-merge. They were things such as slight tweaks to the vcpu_unimpl()
function output strings/parameters to include extra info and
leading "0x" strings before hex output. Things like that.

arch/x86/kvm/mmu.c
arch/x86/kvm/x86.c
include/linux/kvm_host.h

index fbf95c74b896df4f7b65db6d92a07f42487b4c7a..900a272c32f615010b156b65dc5862a4874d669a 100644 (file)
@@ -4704,7 +4704,7 @@ void kvm_mmu_invalidate_mmio_sptes(struct kvm *kvm)
         * zap all shadow pages.
         */
        if (unlikely(kvm_current_mmio_generation(kvm) == 0)) {
-               printk_ratelimited(KERN_DEBUG "kvm: zapping shadow pages for mmio generation wraparound\n");
+               kvm_debug_ratelimited("kvm: zapping shadow pages for mmio generation wraparound\n");
                kvm_mmu_invalidate_zap_all_pages(kvm);
        }
 }
index a54c18367581e4f22113133c0b3048abd277eb7e..390ba3df4b285b724f3d6bf9ad6df07c0c54d548 100644 (file)
@@ -2361,8 +2361,8 @@ int kvm_set_msr_common(struct kvm_vcpu *vcpu, struct msr_data *msr_info)
                if (kvm_pmu_msr(vcpu, msr))
                        return kvm_pmu_set_msr(vcpu, msr_info);
                if (!ignore_msrs) {
-                       vcpu_unimpl(vcpu, "unhandled wrmsr: 0x%x data %llx\n",
-                                   msr, data);
+                       vcpu_debug_ratelimited(vcpu, "unhandled wrmsr: 0x%x data 0x%llx\n",
+                                              msr, data);
                        return 1;
                } else {
                        vcpu_unimpl(vcpu, "ignored wrmsr: 0x%x data %llx\n",
@@ -2678,7 +2678,8 @@ int kvm_get_msr_common(struct kvm_vcpu *vcpu, u32 msr, u64 *pdata)
                if (kvm_pmu_msr(vcpu, msr))
                        return kvm_pmu_get_msr(vcpu, msr, pdata);
                if (!ignore_msrs) {
-                       vcpu_unimpl(vcpu, "unhandled rdmsr: 0x%x\n", msr);
+                       vcpu_debug_ratelimited(vcpu, "unhandled rdmsr: 0x%x\n",
+                                              msr);
                        return 1;
                } else {
                        vcpu_unimpl(vcpu, "ignored rdmsr: 0x%x\n", msr);
index d4e9e88a4f333108be6bb43737012ad335659b14..50716e8a0d1cecf21c4ce7ef8907b1d754050b33 100644 (file)
@@ -403,6 +403,9 @@ struct kvm {
        pr_info("kvm [%i]: " fmt, task_pid_nr(current), ## __VA_ARGS__)
 #define kvm_debug(fmt, ...) \
        pr_debug("kvm [%i]: " fmt, task_pid_nr(current), ## __VA_ARGS__)
+#define kvm_debug_ratelimited(fmt, ...) \
+       pr_debug_ratelimited("kvm [%i]: " fmt, task_pid_nr(current), \
+                            ## __VA_ARGS__)
 #define kvm_pr_unimpl(fmt, ...) \
        pr_err_ratelimited("kvm [%i]: " fmt, \
                           task_tgid_nr(current), ## __VA_ARGS__)
@@ -410,6 +413,9 @@ struct kvm {
 /* The guest did something we don't support. */
 #define vcpu_unimpl(vcpu, fmt, ...)                                    \
        kvm_pr_unimpl("vcpu%i " fmt, (vcpu)->vcpu_id, ## __VA_ARGS__)
+#define vcpu_debug_ratelimited(vcpu, fmt, ...)                         \
+       kvm_debug_ratelimited("vcpu%i " fmt, (vcpu)->vcpu_id,           \
+                             ## __VA_ARGS__)
 
 static inline struct kvm_vcpu *kvm_get_vcpu(struct kvm *kvm, int i)
 {