* [PATCH] KVM: x86: Clear flags field on return from KVM_GET_CLOCK
@ 2009-11-02 15:41 Jan Kiszka
2009-11-03 10:55 ` Glauber Costa
2009-11-03 11:49 ` [PATCH] KVM: x86: Fix KVM_GET_CLOCK Jan Kiszka
0 siblings, 2 replies; 4+ messages in thread
From: Jan Kiszka @ 2009-11-02 15:41 UTC (permalink / raw)
To: Avi Kivity, Marcelo Tosatti; +Cc: kvm, Glauber Costa
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(-)
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;
}
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] KVM: x86: Clear flags field on return from KVM_GET_CLOCK
2009-11-02 15:41 [PATCH] KVM: x86: Clear flags field on return from KVM_GET_CLOCK Jan Kiszka
@ 2009-11-03 10:55 ` Glauber Costa
2009-11-03 11:49 ` [PATCH] KVM: x86: Fix KVM_GET_CLOCK Jan Kiszka
1 sibling, 0 replies; 4+ messages in thread
From: Glauber Costa @ 2009-11-03 10:55 UTC (permalink / raw)
To: Jan Kiszka; +Cc: Avi Kivity, Marcelo Tosatti, kvm
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>
^ permalink raw reply [flat|nested] 4+ messages in thread
* [PATCH] KVM: x86: Fix KVM_GET_CLOCK
2009-11-02 15:41 [PATCH] KVM: x86: Clear flags field on return from KVM_GET_CLOCK Jan Kiszka
2009-11-03 10:55 ` Glauber Costa
@ 2009-11-03 11:49 ` Jan Kiszka
2009-11-03 13:15 ` Marcelo Tosatti
1 sibling, 1 reply; 4+ messages in thread
From: Jan Kiszka @ 2009-11-03 11:49 UTC (permalink / raw)
To: Avi Kivity, Marcelo Tosatti; +Cc: kvm, Glauber Costa
The flags field of kvm_clock_data is supposed to indicate the
availability of additional fields one day. There are none yet, so clear
it. Moreover, drop the bogus check of this field and return 0 on
success.
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
---
Note: This replaces "Clear flags field on return from KVM_GET_CLOCK".
arch/x86/kvm/x86.c | 8 +++-----
1 files changed, 3 insertions(+), 5 deletions(-)
diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c
index 1f68798..7344405 100644
--- a/arch/x86/kvm/x86.c
+++ b/arch/x86/kvm/x86.c
@@ -2577,14 +2577,12 @@ 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;
+ r = -EFAULT;
if (copy_to_user(argp, &user_ns, sizeof(user_ns)))
- r = -EFAULT;
-
- r = -EINVAL;
- if (user_ns.flags)
goto out;
-
+ r = 0;
break;
}
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] KVM: x86: Fix KVM_GET_CLOCK
2009-11-03 11:49 ` [PATCH] KVM: x86: Fix KVM_GET_CLOCK Jan Kiszka
@ 2009-11-03 13:15 ` Marcelo Tosatti
0 siblings, 0 replies; 4+ messages in thread
From: Marcelo Tosatti @ 2009-11-03 13:15 UTC (permalink / raw)
To: Jan Kiszka; +Cc: Avi Kivity, kvm, Glauber Costa
On Tue, Nov 03, 2009 at 12:49:05PM +0100, Jan Kiszka wrote:
> The flags field of kvm_clock_data is supposed to indicate the
> availability of additional fields one day. There are none yet, so clear
> it. Moreover, drop the bogus check of this field and return 0 on
> success.
>
> Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
> ---
>
> Note: This replaces "Clear flags field on return from KVM_GET_CLOCK".
>
> arch/x86/kvm/x86.c | 8 +++-----
> 1 files changed, 3 insertions(+), 5 deletions(-)
Applied, thanks.
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2009-11-03 13:16 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-11-02 15:41 [PATCH] KVM: x86: Clear flags field on return from KVM_GET_CLOCK Jan Kiszka
2009-11-03 10:55 ` Glauber Costa
2009-11-03 11:49 ` [PATCH] KVM: x86: Fix KVM_GET_CLOCK Jan Kiszka
2009-11-03 13:15 ` Marcelo Tosatti
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.