Merge ~paelzer/grub/+git/ubuntu:fix-1941719-qemu-dependency into ~ubuntu-core-dev/grub/+git/ubuntu:master

Proposed by Christian Ehrhardt 
Status: Needs review
Proposed branch: ~paelzer/grub/+git/ubuntu:fix-1941719-qemu-dependency
Merge into: ~ubuntu-core-dev/grub/+git/ubuntu:master
Diff against target: 30 lines (+9/-2)
2 files modified
debian/changelog (+7/-0)
debian/control (+2/-2)
Reviewer Review Type Date Requested Status
Ubuntu Core Development Team Pending
Review via email: mp+407722@code.launchpad.net
To post a comment you must log in.

Unmerged commits

d04205b... by Colin Watson

Make grub-firmware-qemu Recommend/Enhance qemu-system-x86, not qemu

Closes: #966243
LP: #1941719

c4624ed... by Jean-Baptiste Lallement

releasing package grub2 version 2.04-1ubuntu38

b104229... by Jean-Baptiste Lallement

merge patched-ubuntu into ubuntu

763bb3f... by Peter Jones

Make pmtimer tsc calibration not take 51 seconds to fail.

On my laptop running at 2.4GHz, if I run a VM where tsc calibration
using pmtimer will fail presuming a broken pmtimer, it takes ~51 seconds
to do so (as measured with the stopwatch on my phone), with a tsc delta
of 0x1cd1c85300, or around 125 billion cycles.

If instead of trying to wait for 5-200ms to show up on the pmtimer, we try
to wait for 5-200us, it decides it's broken in ~0x2626aa0 TSCs, aka ~2.4
million cycles, or more or less instantly.

Additionally, this reading the pmtimer was returning 0xffffffff anyway,
and that's obviously an invalid return. I've added a check for that and
0 so we don't bother waiting for the test if what we're seeing is dead
pins with no response at all.

If "debug" is includes "pmtimer", you will see one of the following
three outcomes. If pmtimer gives all 0 or all 1 bits, you will see:

kern/i386/tsc_pmtimer.c:77: pmtimer: 0xffffff bad_reads: 1
kern/i386/tsc_pmtimer.c:77: pmtimer: 0xffffff bad_reads: 2
kern/i386/tsc_pmtimer.c:77: pmtimer: 0xffffff bad_reads: 3
kern/i386/tsc_pmtimer.c:77: pmtimer: 0xffffff bad_reads: 4
kern/i386/tsc_pmtimer.c:77: pmtimer: 0xffffff bad_reads: 5
kern/i386/tsc_pmtimer.c:77: pmtimer: 0xffffff bad_reads: 6
kern/i386/tsc_pmtimer.c:77: pmtimer: 0xffffff bad_reads: 7
kern/i386/tsc_pmtimer.c:77: pmtimer: 0xffffff bad_reads: 8
kern/i386/tsc_pmtimer.c:77: pmtimer: 0xffffff bad_reads: 9
kern/i386/tsc_pmtimer.c:77: pmtimer: 0xffffff bad_reads: 10
kern/i386/tsc_pmtimer.c:78: timer is broken; giving up.

This outcome was tested using qemu+kvm with UEFI (OVMF) firmware and
these options: -machine pc-q35-2.10 -cpu Broadwell-noTSX

If pmtimer gives any other bit patterns but is not actually marching
forward fast enough to use for clock calibration, you will see:

kern/i386/tsc_pmtimer.c:121: pmtimer delta is 0x0 (1904 iterations)
kern/i386/tsc_pmtimer.c:124: tsc delta is implausible: 0x2626aa0

This outcome was tested using grub compiled with GRUB_PMTIMER_IGNORE_BAD_READS
defined (so as not to trip the bad read test) using qemu+kvm with UEFI
(OVMF) firmware, and these options: -machine pc-q35-2.10 -cpu Broadwell-noTSX

If pmtimer actually works, you'll see something like:

kern/i386/tsc_pmtimer.c:121: pmtimer delta is 0x0 (1904 iterations)
kern/i386/tsc_pmtimer.c:124: tsc delta is implausible: 0x2626aa0

This outcome was tested using qemu+kvm with UEFI (OVMF) firmware, and
these options: -machine pc-i440fx-2.4 -cpu Broadwell-noTSX

I've also tested this outcome on a real Intel Xeon E3-1275v3 on an Intel
Server Board S1200V3RPS using the SDV.RP.B8 "Release" build here:
https://firmware.intel.com/sites/default/files/UEFIDevKit_S1200RP_vB8.zip

Signed-off-by: Peter Jones <email address hidden>
(cherry picked from commit cf0448d61e00acb548f8f22d57ba6e4f3b37f394)

Patch-Name: rhboot-f34-make-pmtimer-tsc-calibration-fast.patch

6e8abdf... by Dimitri John Ledkov

UBUNTU: fixup unaligned access.

Use unaligned helpers, to get/set values within a
datastructure. Otherwise armhf build of grub-uboot platform fails due
to -Wcast-align errors.

Fixes: rhboot-f34-support-non-ethernet.patch

Patch-Name: ubuntu-fixup-rhboot-f34-support-non-ethernet-2.patch

f2e19fa... by Dimitri John Ledkov

UBUNTU: fixup ofnet initialization.

Signed-off-by: Dimitri John Ledkov <email address hidden>

Patch-Name: ubuntu-fixup-rhboot-f34-support-non-ethernet.patch

48d086b... by Andrzej Kacprowski <email address hidden>

Add support for non-Ethernet network cards

This patch replaces fixed 6-byte link layer address with
up to 32-byte variable sized address.
This allows supporting Infiniband and Omni-Path fabric
which use 20-byte address, but other network card types
can also take advantage of this change.
The network card driver is responsible for replacing L2
header provided by grub2 if needed.
This approach is compatible with UEFI network stack which
also allows up to 32-byte variable size link address.

The BOOTP/DHCP packet format is limited to 16 byte client
hardware address, if link address is more that 16-bytes
then chaddr field in BOOTP it will be set to 0 as per rfc4390.

Resolves: rhbz#1370642

Signed-off-by: Andrzej Kacprowski <email address hidden>
[msalter: Fix max string calculation in grub_net_hwaddr_to_str]
Signed-off-by: Mark Salter <email address hidden>
(cherry picked from commit 50f3f90fe7ef5a875ede559124280d226d40743b)

Patch-Name: rhboot-f34-support-non-ethernet.patch

6a0fdfb... by Josef Bacik <email address hidden>

tcp: add window scaling support

Sometimes we have to provision boxes across regions, such as California to
Sweden. The http server has a 10 minute timeout, so if we can't get our 250mb
image transferred fast enough our provisioning fails, which is not ideal. So
add tcp window scaling on open connections and set the window size to 1mb. With
this change we're able to get higher sustained transfers between regions and can
transfer our image in well below 10 minutes. Without this patch we'd time out
every time halfway through the transfer. Thanks,

Signed-off-by: Josef Bacik <email address hidden>
(cherry picked from commit 995d66fc218e3ddd852269753be0ebd71b72174f)

Patch-Name: rhboot-f34-tcp-add-window-scaling-support.patch

2420704... by Peter Jones

don't use int for efi status

(cherry picked from commit eee6d2db7e3a392b8fe134fa75a7e28c9ae8cda5)
Patch-Name: rhboot-f34-dont-use-int-for-efi-status.patch

42a49ae... by Peter Jones

Make "exit" take a return code.

This adds "exit" with a return code. With this patch, any "exit"
command /may/ include a return code, and on platforms that support
returning with an exit status, we will do so. By default we return the
same exit status we did before this patch.

Signed-off-by: Peter Jones <email address hidden>
(cherry picked from commit ccce3d69ae3eacc7bdc70217304586bd7e74fe1e)
Patch-Name: rhboot-f34-make-exit-take-a-return-code.patch

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/debian/changelog b/debian/changelog
2index 2294af4..2f2ee5e 100644
3--- a/debian/changelog
4+++ b/debian/changelog
5@@ -1,3 +1,10 @@
6+grub2 (2.04-1ubuntu39) UNRELEASED; urgency=medium
7+
8+ * Make grub-firmware-qemu Recommend/Enhance qemu-system-x86, not qemu
9+ (closes: 966243) (LP: #1941719).
10+
11+ -- Christian Ehrhardt <christian.ehrhardt@canonical.com> Thu, 26 Aug 2021 11:02:42 +0200
12+
13 grub2 (2.04-1ubuntu38) hirsute; urgency=medium
14
15 [ Jean-Baptiste Lallement ]
16diff --git a/debian/control b/debian/control
17index 9aafb52..68259f7 100644
18--- a/debian/control
19+++ b/debian/control
20@@ -583,8 +583,8 @@ Description: GRand Unified Bootloader, version 2 (Open Firmware version)
21 Package: grub-firmware-qemu
22 Architecture: any-i386 any-amd64
23 Depends: ${misc:Depends}
24-Recommends: qemu
25-Enhances: qemu
26+Recommends: qemu-system-x86
27+Enhances: qemu-system-x86
28 Multi-Arch: foreign
29 Description: GRUB firmware image for QEMU
30 This package contains a binary of GRUB that has been built for use as

Subscribers

People subscribed via source and target branches