commit grub2 for openSUSE:Factory
From 2e62352bc28bd5d3efafc1b5cbe211ff9e9987fd Mon Sep 17 00:00:00 2001 From: Vladimir Serbinenko
Date: Tue, 20 Jan 2015 21:07:08 +0100 Subject: [PATCH] * grub-core/kern/i386/tsc.c (calibrate_tsc): Ensure
Hello community, here is the log from the commit of package grub2 for openSUSE:Factory checked in at 2016-01-28 17:18:40 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/grub2 (Old) and /work/SRC/openSUSE:Factory/.grub2.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Package is "grub2" Changes: -------- --- /work/SRC/openSUSE:Factory/grub2/grub2.changes 2016-01-15 10:38:51.000000000 +0100 +++ /work/SRC/openSUSE:Factory/.grub2.new/grub2.changes 2016-01-28 17:18:45.000000000 +0100 @@ -2 +2,12 @@ -Wed Mon 28 16:53:54 UTC 2015 - arvidjaar@gmail.com +Wed Jan 20 11:44:27 UTC 2016 - mchang@suse.com + +- Backport upstream patches for HyperV gen2 TSC timer calbration without + RTC (bsc#904647) + * added 0001-grub-core-kern-i386-tsc.c-calibrate_tsc-Ensure-that.patch + * added 0002-i386-tsc-Fix-unused-function-warning-on-xen.patch + * added 0003-acpi-do-not-skip-BIOS-scan-if-EBDA-length-is-zero.patch + * added 0004-tsc-Use-alternative-delay-sources-whenever-appropria.patch + * added 0005-i386-fix-TSC-calibration-using-PIT.patch + +------------------------------------------------------------------- +Wed Dec 28 16:53:54 UTC 2015 - arvidjaar@gmail.com New: ---- 0001-grub-core-kern-i386-tsc.c-calibrate_tsc-Ensure-that.patch 0002-i386-tsc-Fix-unused-function-warning-on-xen.patch 0003-acpi-do-not-skip-BIOS-scan-if-EBDA-length-is-zero.patch 0004-tsc-Use-alternative-delay-sources-whenever-appropria.patch 0005-i386-fix-TSC-calibration-using-PIT.patch ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ grub2.spec ++++++ --- /var/tmp/diff_new_pack.rcY3Xn/_old 2016-01-28 17:18:47.000000000 +0100 +++ /var/tmp/diff_new_pack.rcY3Xn/_new 2016-01-28 17:18:47.000000000 +0100 @@ -1,7 +1,7 @@ # # spec file for package grub2 # -# Copyright (c) 2015 SUSE LINUX GmbH, Nuernberg, Germany. +# Copyright (c) 2016 SUSE LINUX GmbH, Nuernberg, Germany. # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -263,6 +263,12 @@ Patch264: 0005-grub-fstest-fix-descriptor-leak.patch # Upstream patch to fix patch 0001-unix-password-Fix-file-descriptor-leak.patch Patch265: 0001-unix-do-not-close-stdin-in-grub_passwd_get.patch +# Backport upstream patches for HyperV gen2 TSC timer calbration without RTC (bsc#904647) +Patch270: 0001-grub-core-kern-i386-tsc.c-calibrate_tsc-Ensure-that.patch +Patch271: 0002-i386-tsc-Fix-unused-function-warning-on-xen.patch +Patch272: 0003-acpi-do-not-skip-BIOS-scan-if-EBDA-length-is-zero.patch +Patch273: 0004-tsc-Use-alternative-delay-sources-whenever-appropria.patch +Patch274: 0005-i386-fix-TSC-calibration-using-PIT.patch Requires: gettext-runtime %if 0%{?suse_version} >= 1140 @@ -535,6 +541,11 @@ %patch263 -p1 %patch264 -p1 %patch265 -p1 +%patch270 -p1 +%patch271 -p1 +%patch272 -p1 +%patch273 -p1 +%patch274 -p1 # Generate po/LINGUAS for message catalogs ... ./linguas.sh ++++++ 0001-grub-core-kern-i386-tsc.c-calibrate_tsc-Ensure-that.patch ++++++ that no division by 0 occurs. --- ChangeLog | 5 +++++ grub-core/kern/i386/tsc.c | 6 +++++- 2 files changed, 10 insertions(+), 1 deletion(-) Index: grub-2.02~beta2/grub-core/kern/i386/tsc.c =================================================================== --- grub-2.02~beta2.orig/grub-core/kern/i386/tsc.c +++ grub-2.02~beta2/grub-core/kern/i386/tsc.c @@ -122,7 +122,11 @@ calibrate_tsc (void) grub_pit_wait (0xffff); end_tsc = grub_get_tsc (); - grub_tsc_rate = grub_divmod64 ((55ULL << 32), end_tsc - tsc_boot_time, 0); + grub_tsc_rate = 0; + if (end_tsc > tsc_boot_time) + grub_tsc_rate = grub_divmod64 ((55ULL << 32), end_tsc - tsc_boot_time, 0); + if (grub_tsc_rate == 0) + grub_tsc_rate = 5368;/* 800 MHz */ } #endif ++++++ 0002-i386-tsc-Fix-unused-function-warning-on-xen.patch ++++++
From 50ebc8f5f35a322b3736c03e16de7108932126b0 Mon Sep 17 00:00:00 2001 From: Vladimir Serbinenko
Date: Sun, 22 Feb 2015 13:12:44 +0100 Subject: [PATCH] i386/tsc: Fix unused function warning on xen.
--- grub-core/kern/i386/tsc.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) Index: grub-2.02~beta2/grub-core/kern/i386/tsc.c =================================================================== --- grub-2.02~beta2.orig/grub-core/kern/i386/tsc.c +++ grub-2.02~beta2/grub-core/kern/i386/tsc.c @@ -57,6 +57,8 @@ grub_get_tsc (void) return (((grub_uint64_t) hi) << 32) | lo; } +#ifndef GRUB_MACHINE_XEN + static __inline int grub_cpu_is_tsc_supported (void) { @@ -69,8 +71,6 @@ grub_cpu_is_tsc_supported (void) return (d & (1 << 4)) != 0; } -#ifndef GRUB_MACHINE_XEN - static void grub_pit_wait (grub_uint16_t tics) { ++++++ 0003-acpi-do-not-skip-BIOS-scan-if-EBDA-length-is-zero.patch ++++++
From 07258815e96aab2c72593d0129d17051cbf68d27 Mon Sep 17 00:00:00 2001 From: Andrei Borzenkov
Date: Fri, 8 May 2015 06:15:16 +0300 Subject: [PATCH] acpi: do not skip BIOS scan if EBDA length is zero
EBDA layout is not standardized so we cannot assume first two bytes are length. Neither is it required by ACPI standard. HP 8710W is known to contain zeroes here. Closes: 45002 --- grub-core/commands/acpi.c | 4 ++++ grub-core/commands/i386/pc/acpi.c | 10 ++++++---- 2 files changed, 10 insertions(+), 4 deletions(-) Index: grub-2.02~beta2/grub-core/commands/acpi.c =================================================================== --- grub-2.02~beta2.orig/grub-core/commands/acpi.c +++ grub-2.02~beta2/grub-core/commands/acpi.c @@ -179,8 +179,10 @@ grub_acpi_create_ebda (void) struct grub_acpi_rsdp_v20 *v2; ebda = (grub_uint8_t *) (grub_addr_t) ((*((grub_uint16_t *)0x40e)) << 4); + grub_dprintf ("acpi", "EBDA @%p\n", ebda); if (ebda) ebda_kb_len = *(grub_uint16_t *) ebda; + grub_dprintf ("acpi", "EBDA length 0x%x\n", ebda_kb_len); if (ebda_kb_len > 16) ebda_kb_len = 0; ctx.ebda_len = (ebda_kb_len + 1) << 10; @@ -494,6 +496,8 @@ grub_cmd_acpi (struct grub_extcmd_contex if (! rsdp) rsdp = grub_machine_acpi_get_rsdpv1 (); + grub_dprintf ("acpi", "RSDP @%p\n", rsdp); + if (rsdp) { grub_uint32_t *entry_ptr; Index: grub-2.02~beta2/grub-core/commands/i386/pc/acpi.c =================================================================== --- grub-2.02~beta2.orig/grub-core/commands/i386/pc/acpi.c +++ grub-2.02~beta2/grub-core/commands/i386/pc/acpi.c @@ -29,14 +29,15 @@ grub_machine_acpi_get_rsdpv1 (void) grub_dprintf ("acpi", "Looking for RSDP. Scanning EBDA\n"); ebda = (grub_uint8_t *) ((* ((grub_uint16_t *) 0x40e)) << 4); ebda_len = * (grub_uint16_t *) ebda; - if (! ebda_len) - return 0; + if (! ebda_len) /* FIXME do we really need this check? */ + goto scan_bios; for (ptr = ebda; ptr < ebda + 0x400; ptr += 16) if (grub_memcmp (ptr, GRUB_RSDP_SIGNATURE, GRUB_RSDP_SIGNATURE_SIZE) == 0 && grub_byte_checksum (ptr, sizeof (struct grub_acpi_rsdp_v10)) == 0 && ((struct grub_acpi_rsdp_v10 *) ptr)->revision == 0) return (struct grub_acpi_rsdp_v10 *) ptr; +scan_bios: grub_dprintf ("acpi", "Looking for RSDP. Scanning BIOS\n"); for (ptr = (grub_uint8_t *) 0xe0000; ptr < (grub_uint8_t *) 0x100000; ptr += 16) @@ -56,8 +57,8 @@ grub_machine_acpi_get_rsdpv2 (void) grub_dprintf ("acpi", "Looking for RSDP. Scanning EBDA\n"); ebda = (grub_uint8_t *) ((* ((grub_uint16_t *) 0x40e)) << 4); ebda_len = * (grub_uint16_t *) ebda; - if (! ebda_len) - return 0; + if (! ebda_len) /* FIXME do we really need this check? */ + goto scan_bios; for (ptr = ebda; ptr < ebda + 0x400; ptr += 16) if (grub_memcmp (ptr, GRUB_RSDP_SIGNATURE, GRUB_RSDP_SIGNATURE_SIZE) == 0 && grub_byte_checksum (ptr, sizeof (struct grub_acpi_rsdp_v10)) == 0 @@ -67,6 +68,7 @@ grub_machine_acpi_get_rsdpv2 (void) == 0) return (struct grub_acpi_rsdp_v20 *) ptr; +scan_bios: grub_dprintf ("acpi", "Looking for RSDP. Scanning BIOS\n"); for (ptr = (grub_uint8_t *) 0xe0000; ptr < (grub_uint8_t *) 0x100000; ptr += 16) ++++++ 0004-tsc-Use-alternative-delay-sources-whenever-appropria.patch ++++++ ++++ 1104 lines (skipped) ++++++ 0005-i386-fix-TSC-calibration-using-PIT.patch ++++++
From a03c1034f6062e69075056c8f31b90e159ce5244 Mon Sep 17 00:00:00 2001 From: Michael Chang
Date: Tue, 1 Dec 2015 18:49:38 +0300 Subject: [PATCH] i386: fix TSC calibration using PIT
Condition was accidentally reversed, so PIT calibration always failed
when PIT was present and always succeeded when PIT was missing, but in
the latter case resulted in absurdly fast clock.
Reported and tested by Vitaly Kuznetsov
participants (1)
-
root@hilbert.suse.de