public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
From: Jan Kiszka <jan.kiszka@siemens.com>
To: Avi Kivity <avi@redhat.com>, Marcelo Tosatti <mtosatti@redhat.com>
Cc: kvm <kvm@vger.kernel.org>, Glauber Costa <glommer@redhat.com>
Subject: [PATCH] KVM: x86: Fix KVM_GET_CLOCK
Date: Tue, 03 Nov 2009 12:49:05 +0100	[thread overview]
Message-ID: <4AF018B1.5080801@siemens.com> (raw)
In-Reply-To: <4AEEFDC2.4010808@siemens.com>

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;
 	}
 

  parent reply	other threads:[~2009-11-03 11:49 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 [this message]
2009-11-03 13:15   ` [PATCH] KVM: x86: Fix KVM_GET_CLOCK Marcelo Tosatti

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4AF018B1.5080801@siemens.com \
    --to=jan.kiszka@siemens.com \
    --cc=avi@redhat.com \
    --cc=glommer@redhat.com \
    --cc=kvm@vger.kernel.org \
    --cc=mtosatti@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox