All of lore.kernel.org
 help / color / mirror / Atom feed
From: Avi Kivity <avi@redhat.com>
To: Joerg Roedel <joro@8bytes.org>
Cc: Joerg Roedel <joerg.roedel@amd.com>,
	Marcelo Tosatti <mtosatti@redhat.com>,
	Zachary Amsden <zamsden@redhat.com>,
	kvm@vger.kernel.org
Subject: Re: [PATCH 6/6] KVM: X86: Implement userspace interface to set	virtual_tsc_khz
Date: Thu, 24 Mar 2011 12:44:59 +0200	[thread overview]
Message-ID: <4D8B20AB.6060101@redhat.com> (raw)
In-Reply-To: <20110324104106.GG18867@8bytes.org>

On 03/24/2011 12:41 PM, Joerg Roedel wrote:
> >>
> >>  +4.54 KVM_SET_TSC_KHZ
> >>  +
> >>  +Capability: KVM_CAP_TSC_CONTROL
> >>  +Architectures: x86
> >>  +Type: vm ioctl
> >>  +Parameters: __u32 (in)
> >>  +Returns: 0 on success, -1 on error
> >>  +
> >>  +Specifies the tsc frequency for the virtual machine. This IOCTL must be
> >>  +used before any vcpu is created. The unit of the frequency is KHz.
> >
> >  Should it not be a vcpu ioctl?
>
> The idea was that a vm ioctl will make sure that all vcpus in one vm
> have the same tsc frequency. With a vm ioctl we force this. So the tsc
> fequency is basically a vm capability which is mirrored into each vcpu
> data structure for performance reasons.
>

Yes - it doesn't make sense to have each vcpu run with a different tsc.  
But we do the same with cpuid, and since the tsc really is a per-cpu 
thing, then if it simplifies the code I think it's okay to make 
userspace call it per-cpu.

> >>  +
> >>  +		r = 0;
> >>  +		goto out;
> >>  +	}
> >>  +	case KVM_GET_TSC_KHZ: {
> >>  +		u32 vtsc_khz = kvm->arch.virtual_tsc_khz;
> >>  +
> >>  +		r = -EIO;
> >>  +		if (check_tsc_unstable())
> >>  +			goto out;
> >>  +
> >>  +		r = -EFAULT;
> >>  +		if (copy_to_user(argp,&vtsc_khz, sizeof(__u32)))
> >>  +			goto out;
> >
> >  And an ordinary return here.
>
> Okay, I'll change that. But I would prefer to keep this as a vm ioctl. A
> vcpu ioctl might be more flexible but I doubt anybody has a use-case for
> different tsc_khz values in one VM.

My motivation is simplification.

-- 
error compiling committee.c: too many arguments to function


  reply	other threads:[~2011-03-24 10:45 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-03-24  7:40 [PATCH 0/6][RESEND] TSC scaling support for KVM v2 Joerg Roedel
2011-03-24  7:40 ` [PATCH 1/6] KVM: SVM: Implement infrastructure for TSC_RATE_MSR Joerg Roedel
2011-03-24  9:51   ` Avi Kivity
2011-03-24  9:58     ` Joerg Roedel
2011-03-24  7:40 ` [PATCH 2/6] KVM: X86: Let kvm-clock report the right tsc frequency Joerg Roedel
2011-03-24  9:58   ` Avi Kivity
2011-03-24  7:40 ` [PATCH 3/6] KVM: X86: Make tsc_delta calculation a function of guest tsc Joerg Roedel
2011-03-24  7:40 ` [PATCH 4/6] KVM: SVM: Propagate requested TSC frequency on vcpu init Joerg Roedel
2011-03-24 10:04   ` Avi Kivity
2011-03-24 10:21     ` Joerg Roedel
2011-03-24 10:30       ` Avi Kivity
2011-03-24  7:40 ` [PATCH 5/6] KVM: X86: Delegate tsc-offset calculation to architecture code Joerg Roedel
2011-03-24  7:40 ` [PATCH 6/6] KVM: X86: Implement userspace interface to set virtual_tsc_khz Joerg Roedel
2011-03-24 10:14   ` Avi Kivity
2011-03-24 10:41     ` Joerg Roedel
2011-03-24 10:44       ` Avi Kivity [this message]
2011-03-24 10:47         ` Joerg Roedel
  -- strict thread matches above, loose matches on Subject: below --
2011-03-25  8:44 [PATCH 0/6] TSC scaling support for KVM v3 Joerg Roedel
2011-03-25  8:44 ` [PATCH 6/6] KVM: X86: Implement userspace interface to set virtual_tsc_khz Joerg Roedel
2011-03-15  9:36 [PATCH 0/6] TSC scaling support for KVM v2 Joerg Roedel
2011-03-15  9:36 ` [PATCH 6/6] KVM: X86: Implement userspace interface to set virtual_tsc_khz Joerg Roedel
2011-02-09 17:29 [PATCH 0/6] KVM support for TSC scaling Joerg Roedel
2011-02-09 17:29 ` [PATCH 6/6] KVM: X86: Implement userspace interface to set virtual_tsc_khz Joerg Roedel
2011-02-13 15:12   ` Avi Kivity
2011-02-21 17:17     ` Roedel, Joerg

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=4D8B20AB.6060101@redhat.com \
    --to=avi@redhat.com \
    --cc=joerg.roedel@amd.com \
    --cc=joro@8bytes.org \
    --cc=kvm@vger.kernel.org \
    --cc=mtosatti@redhat.com \
    --cc=zamsden@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 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.