[PATCH] KVM: nVMX: Use SET_MSR_OR_WARN() to simplify failure logging

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

 



commit 458151f65b4d ("KVM: nVMX: Use kvm_set_msr to load
IA32_PERF_GLOBAL_CTRL on VM-Exit") introduced the SET_MSR_OR_WARN()
macro to WARN when kvm_set_msr() fails. Replace other occurences of this
pattern with the macro to remove the need of printing on failure.

Signed-off-by: Oliver Upton <oupton@xxxxxxxxxx>
---
 arch/x86/kvm/vmx/nested.c | 12 ++----------
 1 file changed, 2 insertions(+), 10 deletions(-)

diff --git a/arch/x86/kvm/vmx/nested.c b/arch/x86/kvm/vmx/nested.c
index 4aea7d304beb..f7dbaac7cb90 100644
--- a/arch/x86/kvm/vmx/nested.c
+++ b/arch/x86/kvm/vmx/nested.c
@@ -928,12 +928,8 @@ static u32 nested_vmx_load_msr(struct kvm_vcpu *vcpu, u64 gpa, u32 count)
 				__func__, i, e.index, e.reserved);
 			goto fail;
 		}
-		if (kvm_set_msr(vcpu, e.index, e.value)) {
-			pr_debug_ratelimited(
-				"%s cannot write MSR (%u, 0x%x, 0x%llx)\n",
-				__func__, i, e.index, e.value);
+		if (SET_MSR_OR_WARN(vcpu, e.index, e.value))
 			goto fail;
-		}
 	}
 	return 0;
 fail:
@@ -4175,12 +4171,8 @@ static void nested_vmx_restore_host_state(struct kvm_vcpu *vcpu)
 				goto vmabort;
 			}
 
-			if (kvm_set_msr(vcpu, h.index, h.value)) {
-				pr_debug_ratelimited(
-					"%s WRMSR failed (%u, 0x%x, 0x%llx)\n",
-					__func__, j, h.index, h.value);
+			if (SET_MSR_OR_WARN(vcpu, h.index, h.value))
 				goto vmabort;
-			}
 		}
 	}
 
-- 
2.24.0.432.g9d3f5f5b63-goog




[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux