[PATCH v3 14/22] KVM: x86: Annotate -EFAULTs from kvm_pv_clock_pairing()

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

 



Implement KVM_CAP_MEMORY_FAULT_INFO for efaults generated by
kvm_pv_clock_pairing().

Signed-off-by: Anish Moorthy <amoorthy@xxxxxxxxxx>
---
 arch/x86/kvm/x86.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c
index 0925678e741de..3e9deab31e1c8 100644
--- a/arch/x86/kvm/x86.c
+++ b/arch/x86/kvm/x86.c
@@ -9589,8 +9589,10 @@ static int kvm_pv_clock_pairing(struct kvm_vcpu *vcpu, gpa_t paddr,
 
 	ret = 0;
 	if (kvm_write_guest(vcpu->kvm, paddr, &clock_pairing,
-			    sizeof(struct kvm_clock_pairing)))
+						sizeof(struct kvm_clock_pairing))) {
+		kvm_populate_efault_info(vcpu, paddr, sizeof(struct kvm_clock_pairing));
 		ret = -KVM_EFAULT;
+	}
 
 	return ret;
 }
-- 
2.40.0.577.gac1e443424-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