From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from list by lists.gnu.org with archive (Exim 4.71) id 1XuSXp-0005dj-12 for mharc-grub-devel@gnu.org; Fri, 28 Nov 2014 15:53:37 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:58908) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XuSXc-0005GG-UI for grub-devel@gnu.org; Fri, 28 Nov 2014 15:53:33 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XuSXT-0004TC-Qo for grub-devel@gnu.org; Fri, 28 Nov 2014 15:53:24 -0500 Received: from mail-wi0-x235.google.com ([2a00:1450:400c:c05::235]:47213) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XuSXT-0004T7-KT for grub-devel@gnu.org; Fri, 28 Nov 2014 15:53:15 -0500 Received: by mail-wi0-f181.google.com with SMTP id r20so12260940wiv.14 for ; Fri, 28 Nov 2014 12:53:15 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=message-id:date:from:user-agent:mime-version:to:subject:references :in-reply-to:content-type; bh=N3lqcdD3AZ5OGx2i5lhGOux/ONVF3IyiHnXzI62k4aI=; b=Y0vEQshOicw38xtCo596j421N5fAlw1QBNJ0u2xw2LXfe/D5qqwIPQDu1uOsEa95fU g0XSoLeo8HLochsqdOaNcrx2xAQyQruTSpamfxjDWRya65oSQpCnEKAcouyZKIjZpH0t EhlNjPcBqsNxhrIUm6MzDBgdPEaHVORVlwIJzPGdx0x1G+zhdUYsqiQ3qt1BIgTIA9gg PL2js1Ga7l5XOOizCH9vHF4Bp6QAx4aTU+CauXPYb2xluvPNZtMIQSkw/2RNBmE+rv96 Wr5kKl8RJp+hkQfnGsR3tmlwEnNhO4q49NcSAGx/+E/xXySl8xQHb99hYZMLkJIi1lMB JpJw== X-Received: by 10.180.77.79 with SMTP id q15mr63266178wiw.8.1417207994985; Fri, 28 Nov 2014 12:53:14 -0800 (PST) Received: from [10.222.38.128] ([212.213.198.101]) by mx.google.com with ESMTPSA id nj9sm17202354wic.10.2014.11.28.12.53.13 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 28 Nov 2014 12:53:14 -0800 (PST) Message-ID: <5478CC2A.30505@gmail.com> Date: Fri, 28 Nov 2014 21:25:30 +0200 From: =?UTF-8?B?VmxhZGltaXIgJ8+GLWNvZGVyL3BoY29kZXInIFNlcmJpbmVua28=?= User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Icedove/31.2.0 MIME-Version: 1.0 To: The development of GNU GRUB Subject: Re: [PATCH] calibrate_tsc(): use the Stall() EFI boot service on GRUB_MACHINE_EFI References: <1416992361-4167-1-git-send-email-lersek@redhat.com> In-Reply-To: <1416992361-4167-1-git-send-email-lersek@redhat.com> Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="qw6PP1WBmfawT6wVjBXo07RvNROi1M20c" X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2a00:1450:400c:c05::235 X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list Reply-To: The development of GNU GRUB List-Id: The development of GNU GRUB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 28 Nov 2014 20:53:34 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --qw6PP1WBmfawT6wVjBXo07RvNROi1M20c Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 26.11.2014 10:59, Laszlo Ersek wrote: > HyperV Gen2 virtual machines have no PIT; guest code should rely on UEF= I > services instead. >=20 > RHBZ: https://bugzilla.redhat.com/show_bug.cgi?id=3D1150698 > RHBZ: https://bugzilla.redhat.com/show_bug.cgi?id=3D1160128 > Signed-off-by: Laszlo Ersek I don't like to be using any additional EFI function. I prefer to use pmtimer as I did in my other patch. Is pmtimer available on hyperv? > --- >=20 > Notes: > Please note that I'm not subscribed to the list. >=20 > grub-core/kern/i386/tsc.c | 20 ++++++++++++++++---- > 1 file changed, 16 insertions(+), 4 deletions(-) >=20 > diff --git a/grub-core/kern/i386/tsc.c b/grub-core/kern/i386/tsc.c > index 3a4cae6..e499648 100644 > --- a/grub-core/kern/i386/tsc.c > +++ b/grub-core/kern/i386/tsc.c > @@ -26,9 +26,14 @@ > #include > #include > #ifdef GRUB_MACHINE_XEN > -#include > +# include > #else > -#include > +# ifdef GRUB_MACHINE_EFI > +# include > +# include > +# else > +# include > +# endif > #endif > #include > =20 > @@ -72,8 +77,14 @@ grub_cpu_is_tsc_supported (void) > #ifndef GRUB_MACHINE_XEN > =20 > static void > -grub_pit_wait (grub_uint16_t tics) > +grub_stall (grub_uint16_t tics) > { > +# ifdef GRUB_MACHINE_EFI > + grub_uint64_t microseconds; > + > + microseconds =3D (grub_uint64_t)tics * 1000 * 1000 * 3 / 3579545; > + efi_call_1 (grub_efi_system_table->boot_services->stall, microsecond= s); > +# else > /* Disable timer2 gate and speaker. */ > grub_outb (grub_inb (GRUB_PIT_SPEAKER_PORT) > & ~ (GRUB_PIT_SPK_DATA | GRUB_PIT_SPK_TMR2), > @@ -97,6 +108,7 @@ grub_pit_wait (grub_uint16_t tics) > grub_outb (grub_inb (GRUB_PIT_SPEAKER_PORT) > & ~ (GRUB_PIT_SPK_DATA | GRUB_PIT_SPK_TMR2), > GRUB_PIT_SPEAKER_PORT); > +# endif > } > #endif > =20 > @@ -119,7 +131,7 @@ calibrate_tsc (void) > grub_uint64_t end_tsc; > =20 > tsc_boot_time =3D grub_get_tsc (); > - grub_pit_wait (0xffff); > + grub_stall (0xffff); > end_tsc =3D grub_get_tsc (); > =20 > grub_tsc_rate =3D grub_divmod64 ((55ULL << 32), end_tsc - tsc_boot_t= ime, 0); >=20 --qw6PP1WBmfawT6wVjBXo07RvNROi1M20c Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iF4EAREKAAYFAlR4zCoACgkQmBXlbbo5nOu4tgD9HerJt+CRnWHRIkE7cw7yRgjK nOQfIwo5+3+UOmFiinIA/1urmi5egjCeiSAELMuwiunkmR8ZQmNqByg5mw/cbUpx =l8+X -----END PGP SIGNATURE----- --qw6PP1WBmfawT6wVjBXo07RvNROi1M20c--