From owner-svn-src-all@freebsd.org Mon May 2 18:46:34 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0C4D5B2A347; Mon, 2 May 2016 18:46:34 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: from mail-pa0-x241.google.com (mail-pa0-x241.google.com [IPv6:2607:f8b0:400e:c03::241]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D31071087; Mon, 2 May 2016 18:46:33 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: by mail-pa0-x241.google.com with SMTP id yl2so18287396pac.1; Mon, 02 May 2016 11:46:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=VklaM4WboOUkC1hkAbScdVVJgfDhxF2Djl9smkT6I+o=; b=q0/Jy82wRlKn9j+0LAdxpkYtOdfN3XFYBvx9iX7Xrm7ailgt5qfZ2p5jlceQBViEOM ON5Fu0YkV3omHmhTIUbijb9q0IM5abpiKEGUkVeq1Ql/8iezzJ6nyi3G+zjNN5Y2v9Cp +WHojOXn11a7ELWKJuEMiEdBQJ71Z2yolW4XEHIb2I25VsJVr2z/Qp1LNCZkPuMe/oZK wzXP4OhODxacLOUYlv2NFhnHW3N5ZCRQCtVGusxVgLbnCqZ7bIwpxmEOxnxBn7hzyjJ0 1408S/k09Ffnyb2biElKgxhkkmDHwubNljH0nUk4ndhDXPFpECPHxZkyJtrJ86dDIjMY 8OVg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=VklaM4WboOUkC1hkAbScdVVJgfDhxF2Djl9smkT6I+o=; b=HCev2rlztZefrvlK1CudKeEqtNmFXLXcBWzTjlylnqQGpuTC4VcwyiIUyLMTIO2Diu g8lqIehfXcoji0WXONQp+jLsM8UE+MhIcA/gb2pwjmdIalNen7ezaAUY6b8wgIS/cFW9 H8XYjVACMj4cZ22KoJmXZGLGDEoWflIOi10tZZA5L24yQkLtWPxDf610mlbMXYP5/kP5 7oc4rTLkh7QBeVlXTc7VXVUMvkTPMk/DPNYuDXTge1lfAhrotNkmFVOEie89dS2ZxMR3 n+SI3StWt2QZ8vzcyr3Vv1Naj2gNvPYNNe6d/pAaBKOS538r8NhCVbTDWwawU99TBJaB j/jg== X-Gm-Message-State: AOPr4FU44+BpJdaO7KgYHdlrorD6XBO69EJr/kSI/Md0cdbURhzLylSVJRR2M+kA7j02IA== X-Received: by 10.66.14.198 with SMTP id r6mr4916791pac.48.1462214793477; Mon, 02 May 2016 11:46:33 -0700 (PDT) Received: from [192.168.100.129] ([199.231.240.59]) by smtp.gmail.com with ESMTPSA id q26sm47168369pfi.57.2016.05.02.11.46.31 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 02 May 2016 11:46:32 -0700 (PDT) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 8.2 \(2104\)) Subject: Re: svn commit: r298929 - head/sys/dev/xen/timer From: "Ngie Cooper (yaneurabeya)" In-Reply-To: <201605021615.u42GFSeR052375@repo.freebsd.org> Date: Mon, 2 May 2016 11:46:31 -0700 Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Transfer-Encoding: quoted-printable Message-Id: <337D6745-6821-4035-B1CB-F22C6A96E568@gmail.com> References: <201605021615.u42GFSeR052375@repo.freebsd.org> To: =?utf-8?Q?Roger_Pau_Monn=C3=A9?= X-Mailer: Apple Mail (2.2104) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 02 May 2016 18:46:34 -0000 > On May 2, 2016, at 09:15, Roger Pau Monn=C3=A9 = wrote: >=20 > Author: royger > Date: Mon May 2 16:15:28 2016 > New Revision: 298929 > URL: https://svnweb.freebsd.org/changeset/base/298929 >=20 > Log: > xen/time: allow Dom0 to set the host time >=20 > Dom0 should be able to set the host time. This is implemented by = first > writing to the RTC (as would be done on bare metal), and then using = the > XENPF_settime64 hypercall in order to force Xen to update the = wallclock > shared page of all domains. >=20 > Sponsored by: Citrix Systems R&D >=20 > Modified: > head/sys/dev/xen/timer/timer.c >=20 > Modified: head/sys/dev/xen/timer/timer.c > = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D > --- head/sys/dev/xen/timer/timer.c Mon May 2 16:14:55 2016 = (r298928) > +++ head/sys/dev/xen/timer/timer.c Mon May 2 16:15:28 2016 = (r298929) > @@ -53,6 +53,7 @@ __FBSDID("$FreeBSD$"); > #include > #include > #include > +#include >=20 > #include > #include > @@ -63,6 +64,8 @@ __FBSDID("$FreeBSD$"); >=20 > #include >=20 > +#include > + > #include "clock_if.h" >=20 > static devclass_t xentimer_devclass; > @@ -211,11 +214,32 @@ xen_fetch_uptime(struct timespec *ts) > static int > xentimer_settime(device_t dev __unused, struct timespec *ts) > { > + struct xen_platform_op settime; > + int ret; > + > /* > * Don't return EINVAL here; just silently fail if the domain = isn't > * privileged enough to set the TOD. > */ > - return (0); > + if (!xen_initial_domain()) > + return (0); > + > + /* Set the native RTC. */ > + atrtc_set(ts); > + > + settime.cmd =3D XENPF_settime64; > + settime.u.settime64.mbz =3D 0; > + settime.u.settime64.secs =3D ts->tv_sec; > + settime.u.settime64.nsecs =3D ts->tv_nsec; > + settime.u.settime64.system_time =3D > + xen_fetch_vcpu_time(DPCPU_GET(vcpu_info)); > + > + ret =3D HYPERVISOR_platform_op(&settime); > + ret =3D ret !=3D 0 ? xen_translate_error(ret) : 0; > + if (ret !=3D 0 && bootverbose) > + device_printf(dev, "failed to set Xen PV clock: %d\n", = ret); > + > + return (ret); > } This broke the build on i386 with clang: = https://jenkins.freebsd.org/job/FreeBSD_HEAD_i386/3028/=