public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
From: Alexander Graf <agraf@suse.de>
To: Paolo Bonzini <pbonzini@redhat.com>,
	Christian Borntraeger <borntraeger@de.ibm.com>,
	"Jason J. Herne" <jjherne@linux.vnet.ibm.com>,
	kvm@vger.kernel.org, cornelia.huck@de.ibm.com, aik@ozlabs.ru
Subject: Re: [PATCH 1/1] kvm-s390: Provide guest TOD Clock Get/Set Controls
Date: Wed, 05 Nov 2014 15:32:23 +0100	[thread overview]
Message-ID: <545A34F7.7050400@suse.de> (raw)
In-Reply-To: <545A2209.9010603@redhat.com>



On 05.11.14 14:11, Paolo Bonzini wrote:
> 
> 
> On 05/11/2014 13:28, Christian Borntraeger wrote:
>> Am 05.11.2014 11:07, schrieb Alexander Graf:
>>>
>>>
>>> On 27.10.14 16:44, Jason J. Herne wrote:
>>>> From: "Jason J. Herne" <jjherne@linux.vnet.ibm.com>
>>>>
>>>> Enable KVM_SET_CLOCK and KVM_GET_CLOCK ioctls on s390 for
>>>> managing guest Time Of Day clock value.
>>>>
>>>> Signed-off-by: Jason J. Herne <jjherne@linux.vnet.ibm.com> 
>>>> Reviewed-by: David Hildenbrand <dahi@linux.vnet.ibm.com>
>>>
>>> I like it.
>>>
>>> Reviewed-by: Alexander Graf <agraf@suse.de>
>>
>> Paolo, are you ok with that patch as well? If yes I will send it with
>> the next bunch of s390 patches.
>>
>> PS: I remember that you were considering some different take on the
>> interface: IIRC you suggest to have the same format in
>> kvm_clock_data->clock as x86, and that we might want to use a flag
>> and a new field in the padding area that then contains the TOD value.
>> Now looking again at Documentation/virtual/kvm/api.txt I actually
>> prefer Jasons implementation since the api does not mention the
>> value/format/offset. It seems to be ns since boot, correct?
>>
>> So if any changes, I would prefer a small change to the
>> documentation, that makes the meaning of clock explicit per
>> architecture?
> 
> After a quick refresh on IRC, I remembered our previous discussion.
> 
> I was a bit worried that the interface did not let us pass the extra
> byte for the stcke instruction's overflow counter.  The question then is
> whether to:
> 
> 1) keep an x86-consistent interface for KVM_GET/SET_CLOCK, and put the
> whole 16 byte stcke output in the padding
> 
> 2) put the 8-byte stck value (stcke bytes 1-8) in the value, and the
> overflow counter (stcke byte 0) in the padding (with the presence
> governed by a flag).  As you explained, bytes 9-13 are computed by the
> CPU and we do not care anyway of accuracy beyond 0.25 ns, while bytes
> 14-15 are accessed separately via ONEREG.
> 
> 3) use ONEREG instead of KVM_GET/SET_CLOCK.  You can decide whether to
> use a 72 (or 96) bit value, or two separate 8+64 values.
> 
> 1 or 3 seem the cleanest.  On the other hand s390 doesn't have a use for
> a bootbased counter, which makes 1 much less interesting/useful than I
> imagined.
> 
> PPC uses a combination of KVM_GET_SREGS and KVM_GET/SET_ONEREG for the
> closest equivalent (TBL/TBU), not KVM_GET/SET_CLOCK.  MIPS is also
> ONEREG-based.  This makes me lean towards 3.
> 
> Of course 2 has code written, but it should be a small change to use
> ONEREG instead.  What do you think?

How far does the existing nanosecond number get us until we hit the
64bit limit? And by the time we hit it, wouldn't we hit it on x86 as well?


Alex

  reply	other threads:[~2014-11-05 14:32 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-10-27 15:44 [PATCH 0/1] kvm-s390: Provide guest TOD Clock Get/Set Controls Jason J. Herne
2014-10-27 15:44 ` [PATCH 1/1] " Jason J. Herne
2014-11-05 10:07   ` Alexander Graf
2014-11-05 12:28     ` Christian Borntraeger
2014-11-05 13:11       ` Paolo Bonzini
2014-11-05 14:32         ` Alexander Graf [this message]
2014-11-05 14:54           ` Paolo Bonzini
2014-11-05 16:48         ` Christian Borntraeger
2014-11-05 17:37           ` Alexander Graf
2014-11-05 17:56             ` Christian Borntraeger
2014-11-05 19:45               ` Paolo Bonzini
2014-11-06  8:43                 ` Christian Borntraeger
2014-11-06  8:46                   ` Christian Borntraeger
2014-11-06  9:57                   ` Paolo Bonzini

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=545A34F7.7050400@suse.de \
    --to=agraf@suse.de \
    --cc=aik@ozlabs.ru \
    --cc=borntraeger@de.ibm.com \
    --cc=cornelia.huck@de.ibm.com \
    --cc=jjherne@linux.vnet.ibm.com \
    --cc=kvm@vger.kernel.org \
    --cc=pbonzini@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