All of lore.kernel.org
 help / color / mirror / Atom feed
From: Arnd Bergmann <arnd@arndb.de>
To: Joao Martins <joao.m.martins@oracle.com>
Cc: "Juergen Gross" <jgross@suse.com>,
	jailhouse-dev@googlegroups.com,
	"Rafael J. Wysocki" <rafael.j.wysocki@intel.com>,
	xen-devel <xen-devel@lists.xenproject.org>,
	kvm@vger.kernel.org, "Radim Krčmář" <rkrcmar@redhat.com>,
	"y2038 Mailman List" <y2038@lists.linaro.org>,
	"Jan Kiszka" <jan.kiszka@siemens.com>,
	"the arch/x86 maintainers" <x86@kernel.org>,
	"Linux Kernel Mailing List" <linux-kernel@vger.kernel.org>,
	"Ingo Molnar" <mingo@redhat.com>,
	"John Stultz" <john.stultz@linaro.org>,
	"Borislav Petkov" <bp@suse.de>,
	"Andy Lutomirski" <luto@kernel.org>,
	"H. Peter Anvin" <hpa@zytor.com>,
	"Paolo Bonzini" <pbonzini@redhat.com>,
	"Thomas Gleixner" <tglx@linutronix.de>,
	"Andy Shevchenko" <andriy.shevchenko@linux.intel.com>,
	"Boris Ostrovsky" <boris.ostrovsky@oracle.com>
Subject: Re: [PATCH] [v3] x86: Convert x86_platform_ops to timespec64
Date: Sat, 28 Apr 2018 12:09:47 +0200	[thread overview]
Message-ID: <CAK8P3a0T8RkPgHm6F+Y+RHBdi7v5ho1hQ8w+MwWFcOk5TbMaCw__43481.5125576735$1524910112$gmane$org@mail.gmail.com> (raw)
In-Reply-To: <b8d3167b-ee9f-f14d-e43e-73aa2719d6ae@oracle.com>

On Sat, Apr 28, 2018 at 12:21 AM, Joao Martins
<joao.m.martins@oracle.com> wrote:
> On 04/27/2018 09:13 PM, Arnd Bergmann wrote:
>> diff --git a/arch/x86/kernel/pvclock.c b/arch/x86/kernel/pvclock.c
>> index 761f6af6efa5..637982efecd8 100644
>> --- a/arch/x86/kernel/pvclock.c
>> +++ b/arch/x86/kernel/pvclock.c
>> @@ -123,28 +123,35 @@ u64 pvclock_clocksource_read(struct pvclock_vcpu_time_info *src)
>>
>>  void pvclock_read_wallclock(struct pvclock_wall_clock *wall_clock,
>>                           struct pvclock_vcpu_time_info *vcpu_time,
>> -                         struct timespec *ts)
>> +                         struct timespec64 *ts)
>>  {
>>       u32 version;
>>       u64 delta;
>> -     struct timespec now;
>> +     struct timespec64 now;
>>
>>       /* get wallclock at system boot */
>>       do {
>>               version = wall_clock->version;
>>               rmb();          /* fetch version before time */
>> +             /*
>> +              * Note: wall_clock->sec is a u32 value, so it can
>> +              * only store dates between 1970 and 2106. To allow
>> +              * times beyond that, we need to create a new hypercall
>> +              * interface with an extended pvclock_wall_clock structure
>> +              * like ARM has.
>> +              */
>>               now.tv_sec  = wall_clock->sec;
>
> IIUC the interface you're probably speaking about is common to both ARM and x86
> on Xen[*] (since Xen 4.6) i.e.
>
>         now.tv_sec  = ((uint64_t)s->wc_sec_hi << 32) | s->wc_sec;
>
> s representing struct shared_info like on ARM (there's a 32-bit hole where
> wc_sec_hi is placed on x86_64/ARM). Except on x86 32-bit guests wc_sec_hi is
> located elsewhere.
>
>         Joao
>
> [*]
> https://xenbits.xen.org/docs/4.6-testing/hypercall/x86_64/include,public,xen.h.html#incontents_startofday_shared

Ah, good. How portable is that? Will it do the right thing (i.e.
guarantee to have
zeroes on the upper half, or the epoch if supported) on all versions of both KVM
and Xen, or do we need an additional check in there?

I'd suggest leaving the implementation of that to a follow-up patch that you
can add once my patch is merged.

        Arnd

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

  parent reply	other threads:[~2018-04-28 10:09 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-04-27 20:13 [PATCH] [v3] x86: Convert x86_platform_ops to timespec64 Arnd Bergmann
2018-04-27 20:56 ` Radim Krčmář
2018-04-27 20:56 ` Radim Krčmář
2018-04-27 20:56   ` Radim Krčmář
2018-04-27 22:21 ` Joao Martins
2018-04-27 22:21 ` Joao Martins
2018-04-28 10:09   ` Arnd Bergmann
2018-05-02 16:44     ` Joao Martins
2018-05-02 16:44     ` Joao Martins
2018-04-28 10:09   ` Arnd Bergmann [this message]
2018-04-28  7:25 ` Jan Kiszka
2018-04-28  7:25 ` Jan Kiszka
2018-05-19 12:06 ` [tip:timers/2038] " tip-bot for Arnd Bergmann
  -- strict thread matches above, loose matches on Subject: below --
2018-04-27 20:13 [PATCH] [v3] " Arnd Bergmann

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='CAK8P3a0T8RkPgHm6F+Y+RHBdi7v5ho1hQ8w+MwWFcOk5TbMaCw__43481.5125576735$1524910112$gmane$org@mail.gmail.com' \
    --to=arnd@arndb.de \
    --cc=andriy.shevchenko@linux.intel.com \
    --cc=boris.ostrovsky@oracle.com \
    --cc=bp@suse.de \
    --cc=hpa@zytor.com \
    --cc=jailhouse-dev@googlegroups.com \
    --cc=jan.kiszka@siemens.com \
    --cc=jgross@suse.com \
    --cc=joao.m.martins@oracle.com \
    --cc=john.stultz@linaro.org \
    --cc=kvm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=luto@kernel.org \
    --cc=mingo@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=rafael.j.wysocki@intel.com \
    --cc=rkrcmar@redhat.com \
    --cc=tglx@linutronix.de \
    --cc=x86@kernel.org \
    --cc=xen-devel@lists.xenproject.org \
    --cc=y2038@lists.linaro.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.