Patchworkβ KVM: x86: Clear flags field on return from KVM_GET_CLOCK

login
register
about
Submitter Jan Kiszka
Date 2009-11-02 15:41:54
Message ID <4AEEFDC2.4010808@siemens.com>
Download mbox | patch
Permalink /patch/57045/
State New
Headers show

Comments

Jan Kiszka - 2009-11-02 15:41:54
This field is supposed to indicate the availability of additional fields
one day. There are none yet, so clear it - and drop the bogus check,
too.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
---

This alone fixes the savevm/loadvm issue around kvmclock reported today.

 arch/x86/kvm/x86.c |    5 +----
 1 files changed, 1 insertions(+), 4 deletions(-)

--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Glauber Costa - 2009-11-03 10:55:36
On Mon, Nov 02, 2009 at 04:41:54PM +0100, Jan Kiszka wrote:
> This field is supposed to indicate the availability of additional fields
> one day. There are none yet, so clear it - and drop the bogus check,
> too.
> 
> Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Makes sense.

Acked-by: Glauber Costa <glommer@redhat.com>


--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Patch

diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c
index 1f68798..dd229b6 100644
--- a/arch/x86/kvm/x86.c
+++ b/arch/x86/kvm/x86.c
@@ -2577,14 +2577,11 @@  long kvm_arch_vm_ioctl(struct file *filp,
 		ktime_get_ts(&now);
 		now_ns = timespec_to_ns(&now);
 		user_ns.clock = kvm->arch.kvmclock_offset + now_ns;
+		user_ns.flags = 0;
 
 		if (copy_to_user(argp, &user_ns, sizeof(user_ns)))
 			r =  -EFAULT;
 
-		r = -EINVAL;
-		if (user_ns.flags)
-			goto out;
-
 		break;
 	}