All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jeremy Fitzhardinge <jeremy@goop.org>
To: Gerd Hoffmann <kraxel@redhat.com>
Cc: kvm-devel@lists.sourceforge.net, virtualization@lists.osdl.org
Subject: Re: [PATCH 1/4] Add helper functions for paravirtual clocksources.
Date: Tue, 27 May 2008 14:23:26 +0100	[thread overview]
Message-ID: <483C0B4E.9050909@goop.org> (raw)
In-Reply-To: <483C0A65.2090208@redhat.com>

[-- Attachment #1: Type: text/plain, Size: 503 bytes --]

Gerd Hoffmann wrote:
> Gerd Hoffmann wrote:
>   
>>> And having defined a common structure, we may as well use it in the
>>> hypervisor-specific code/headers so there's no strange casting going on.
>>>       
>> Hmm, what is the state of include/xen/interface/?  It is a straight copy
>> of the xen public header files, right?  Is it really ok to modify them?
>>  We have to do that to make the cast actually go away ...
>>     
>
> ping ...
>   

Hm?  I sent a reply, didn't I?  Attached again.

    J

[-- Attachment #2: Attached Message --]
[-- Type: message/rfc822, Size: 6375 bytes --]

From: Jeremy Fitzhardinge <jeremy@goop.org>
To: Gerd Hoffmann <kraxel@redhat.com>
Cc: kvm-devel@lists.sourceforge.net, virtualization@lists.osdl.org
Subject: Re: [PATCH 1/4] Add helper functions for paravirtual clocksources.
Date: Thu, 22 May 2008 10:55:42 +0100
Message-ID: <4835431E.5080004@goop.org>

Gerd Hoffmann wrote:
> Jeremy Fitzhardinge wrote:
>
>   
>>> +static unsigned pvclock_get_time_values(struct pvclock_shadow_time *dst,
>>> +                    struct kvm_vcpu_time_info *src)
>>>   
>>>       
>> I think the kvm_* types should be renamed.  xen_* would make some sense
>> since the ABI originated with Xen, but something generic would be OK
>> too.  The important thing to get across is that the structure defines a
>> guest<->host ABI which happens to be shared by Xen and KVM, and it isn't
>> an in-kernel API like the rest of paravirt_ops.
>>     
>
> Fine with me, but see below.
>
>   
>> And having defined a common structure, we may as well use it in the
>> hypervisor-specific code/headers so there's no strange casting going on.
>>     
>
> Hmm, what is the state of include/xen/interface/?  It is a straight copy
> of the xen public header files, right?  Is it really ok to modify them?
>   

Yeah, sure.  They were copied once, but they can now drift without 
consequence.  Xen defines an ABI, so it doesn't matter how the source 
spells the names of the structures.

>>> +/*
>>> + * This is our read_clock function. The host puts an tsc timestamp
>>> each time
>>> + * it updates a new time. Without the tsc adjustment, we can have a
>>> situation
>>> + * in which a vcpu starts to run earlier (smaller system_time), but
>>> probes
>>> + * time later (compared to another vcpu), leading to backwards time
>>> + */
>>>   
>>>       
>> This comment is confusing.  Are you explaining why the tsc is read
>> within the loop?  I think it can be clarified.
>>     
>
> This was just copyed over from somewhere else (kvmclock I think).
>   

OK, but it still needs to be clarified.

>>> +++ b/include/asm-x86/pvclock.h
>>> @@ -0,0 +1,6 @@
>>> +#include <linux/clocksource.h>
>>> +#include <asm/kvm_para.h>
>>> +cycle_t pvclock_clocksource_read(struct kvm_vcpu_time_info *src);
>>> +void pvclock_read_wallclock(struct kvm_wall_clock *wall,
>>> +                struct kvm_vcpu_time_info *vcpu,
>>> +                struct timespec *ts);
>>>   
>>>       
>> No #ifdef guards?
>>     
>
> Oh yes, I should better add some ...

Also, the patches themselves need some changelogs.  Even though they're 
mostly just code motion, it would be good if the changelog for the 
common pvclock code had a description of the basics of operation.

Also, one implicit part of the ABI which should be explicitly documented 
is that the interface expects that the host updates the per-vcpu time 
structures on the same physical CPU that the guest runs, and that's why 
we can avoid explicit cross-cpu ordering barriers.

    J
_______________________________________________
Virtualization mailing list
Virtualization@lists.linux-foundation.org
https://lists.linux-foundation.org/mailman/listinfo/virtualization

[-- Attachment #3: Type: text/plain, Size: 184 bytes --]

_______________________________________________
Virtualization mailing list
Virtualization@lists.linux-foundation.org
https://lists.linux-foundation.org/mailman/listinfo/virtualization

  reply	other threads:[~2008-05-27 13:23 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-05-16  8:01 [PATCH 0/4] paravirt clock source patches, #3 Gerd Hoffmann
2008-05-16  8:01 ` [PATCH 1/4] Add helper functions for paravirtual clocksources Gerd Hoffmann
2008-05-21 22:46   ` Jeremy Fitzhardinge
2008-05-22  9:32     ` Gerd Hoffmann
2008-05-22  9:55       ` Jeremy Fitzhardinge
2008-05-27 13:19       ` Gerd Hoffmann
2008-05-27 13:23         ` Jeremy Fitzhardinge [this message]
2008-05-27 13:52           ` Gerd Hoffmann
2008-05-16  8:01 ` [PATCH 2/4] Make xen use the generic paravirt clocksource code Gerd Hoffmann
2008-05-16  8:01 ` [PATCH 3/4] kvm/host: fix paravirt clocksource to be compatible with xen Gerd Hoffmann
2008-05-16  8:01 ` [PATCH 4/4] kvm/guest: fix paravirt clocksource to be compartible " Gerd Hoffmann
2008-05-21 15:22 ` [kvm-devel] [PATCH 0/4] paravirt clock source patches, #3 Avi Kivity
  -- strict thread matches above, loose matches on Subject: below --
2008-05-08 11:48 [PATCH 0/4] paravirt clock series Gerd Hoffmann
2008-05-08 11:48 ` [PATCH 1/4] Add helper functions for paravirtual clocksources Gerd Hoffmann
2008-04-24  8:37 [PATCH 0/4] paravirt clock patches Gerd Hoffmann
2008-04-24  8:37 ` [PATCH 1/4] Add helper functions for paravirtual clocksources Gerd Hoffmann
2008-04-24 13:11   ` Glauber Costa
2008-04-28  8:54     ` Gerd Hoffmann

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=483C0B4E.9050909@goop.org \
    --to=jeremy@goop.org \
    --cc=kraxel@redhat.com \
    --cc=kvm-devel@lists.sourceforge.net \
    --cc=virtualization@lists.osdl.org \
    /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.