Received: by 10.192.165.148 with SMTP id m20csp1680870imm; Sat, 28 Apr 2018 03:12:05 -0700 (PDT) X-Google-Smtp-Source: AB8JxZr58hqlMPT5Tcuc9IcYTSTCpeVVBmp8CyGaM3vlElAEvJVOdaNvU+1eOBNaIHBCNJR/n7BO X-Received: by 10.98.245.139 with SMTP id b11mr5295358pfm.113.1524910325260; Sat, 28 Apr 2018 03:12:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1524910325; cv=none; d=google.com; s=arc-20160816; b=Nx5dzYjW2zvOiqwFCFLtItbHq+Z1W3ZLgIU3h0sVv5eDnp2F+TzmjYv5D8kIKctOOr 8J+qw3Fhj0PVU/toLb+0WG5PgcwmCnwuyVLuZe8mutctCFyLAmKORDEmvdh39t3qd1MD 9/bDWSv6Sw3B7iH1NHKeWpKU/LqI/UGE/oT2kW7o2UuqGbeO+MKsBboZVUApp6Y++ubm uhVnysQKGAs6IhiDvwYkwIyB3+jLXZg5y0Bn71msJqw2i2dcROn8KkQd3FGlCeyDyZO8 C6QsqDJ1WY3xMEXqpLj9l1tDa/mF8An38OaYQ9l5bpVcPNh0JQAX7PDsqS8C4tqK8D4d nNQg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :references:in-reply-to:mime-version:dkim-signature :arc-authentication-results; bh=1rs0TpvlTfjFEYmxsD8kn8Mdo3seSXoqV698uD/c8o0=; b=ePSs6/IDgM0lHWQSYl5Jnl4PX+Ue2QKq+HYdrllNwzTjR0e/hR/tQZf+ePFEjkD83R mq58z3J+JS933FHP2Css8f8q36CWO6TZWku7fqpBlNoRzHEsANgDqN8BpOBlKNr6gHiG LEoQ3bz/8QDqNStg3TpeQC4qZEgsWW2s6et0dDGMMRedkK5RAwj4yabZf0LmpIWFZm4Z WyOswIs/RiKE5Do9azqqXOKz0sA/NR0Xmm9GKerfO5iEYoJPNsdq/ks4esmlzxwv3008 qh5k94mRddjsKdUBFSrHT187UuEmC8BWQhqQnjZLgifZCuYXt0kZ2y/bPiR579HayfPv ZiJg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b=pM9auY5Z; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id t7-v6si2943756pgo.686.2018.04.28.03.11.38; Sat, 28 Apr 2018 03:12:05 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b=pM9auY5Z; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1759791AbeD1KJv (ORCPT + 99 others); Sat, 28 Apr 2018 06:09:51 -0400 Received: from mail-qt0-f194.google.com ([209.85.216.194]:35589 "EHLO mail-qt0-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1759622AbeD1KJt (ORCPT ); Sat, 28 Apr 2018 06:09:49 -0400 Received: by mail-qt0-f194.google.com with SMTP id s2-v6so5522388qti.2; Sat, 28 Apr 2018 03:09:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=1rs0TpvlTfjFEYmxsD8kn8Mdo3seSXoqV698uD/c8o0=; b=pM9auY5ZFgtQtv/JMPcsXojFCacG2KD20nLvef7LsCRCFkExexIZ6I4kGzSlrLsawH Bv4+KMveLyHopKZv/psu9gKj1UpLklmDjH1EOATltnq8Pc8gafb+/oL+o8qapea6oZDk UQkxwiz7Wq3vIbfsfvebOscBnkprjPj0k/mOGoXTR2qGY7MZjmb/VaURo0hfoktT2j4t OvjZIHljG8tD1LX+dJbn49bf4oyk61e+rq327Wjm9EFQLhHmMH0Nr4Am4s3YDAAfctBj Rb887YyC2BSIg7PMmvOTODzUGZsExuvP+UG9ye6VRPy5gl3zfCN9zTrmN/1E/WO0fsan yP3g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=1rs0TpvlTfjFEYmxsD8kn8Mdo3seSXoqV698uD/c8o0=; b=cEQ5nm7K51pLrRydWb1ue7dKhfliHOIslYW7T8llDxn8JubtmZHZnDgNpOffWEO1uG tDZeqaPQ9cbTum1zLw/9KDd8uItfcl5qKyZmHIRe+hCivaTf6SVNQlJZUwhbH0BatIcH 1JeejRqhVMDhFVkDEuxz3XNpFA5hwBoiqN0wViNSC1CCo0kec76+wxIe4uokAaJrznbk nC4FBAOi7vh3rRGCJzXzyt5OBNUddFhoQO/JBrgk2Fcgl/u0BdrMqUvJCXG7zReXkOoE K1fpgBw1gsoXP526b/Hkgip11yDc/+dEMIg1l4iUWgmivzaaTnuHgV01XNoIz9+nHuHr Y+2A== X-Gm-Message-State: ALQs6tDY+bEKwweFNrwEwz9pyinjxTtj9NAkmcTfyjAK7Nx2sLcuFNzj cAWgwiJd2ubcS3CfZY0jbndwriWZ+IpwqdhbpOs= X-Received: by 2002:ac8:546:: with SMTP id c6-v6mr5238939qth.163.1524910188498; Sat, 28 Apr 2018 03:09:48 -0700 (PDT) MIME-Version: 1.0 Received: by 10.12.185.3 with HTTP; Sat, 28 Apr 2018 03:09:47 -0700 (PDT) In-Reply-To: References: <20180427201435.3194219-1-arnd@arndb.de> From: Arnd Bergmann Date: Sat, 28 Apr 2018 12:09:47 +0200 X-Google-Sender-Auth: oKrrtNboOhCE0RdeYHA0IhDB3dk Message-ID: Subject: Re: [PATCH] [v3] x86: Convert x86_platform_ops to timespec64 To: Joao Martins Cc: Thomas Gleixner , y2038 Mailman List , Ingo Molnar , "H. Peter Anvin" , "the arch/x86 maintainers" , Jan Kiszka , Paolo Bonzini , =?UTF-8?B?UmFkaW0gS3LEjW3DocWZ?= , Boris Ostrovsky , Juergen Gross , "Rafael J. Wysocki" , Andy Shevchenko , Borislav Petkov , Andy Lutomirski , John Stultz , Linux Kernel Mailing List , jailhouse-dev@googlegroups.com, kvm@vger.kernel.org, xen-devel Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, Apr 28, 2018 at 12:21 AM, Joao Martins 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