bugGNU GRUB - Bugs: bug #42944, TFTP: "error: timeout reading...


You are not allowed to post comments on this tracker with your current authentication level.

bug #42944: TFTP: "error: timeout reading '/rhel60x64/vmlinuz'" on hyper-v Generation 2 VMs with UEFI and secure boot disabled

Submitted by:  Bogdan Atasiei <bodo3700>
Submitted on:  Fri 08 Aug 2014 12:09:24 PM UTC  
Category:  Network Severity:  Major
Priority:  5 - Normal Item Group:  None
Status:  Fixed Privacy:  Public
Assigned to:  None Originator Name: 
Open/Closed:  Closed Release: 
Release:  Git master Reproducibility:  Every Time
Planned Release:  None

( Jump to the original submission)

Wed 02 Dec 2015 12:43:15 PM UTC, comment #7: 

Believed to be fixed since a03c1034f6062e69075056c8f31b90e159ce5244; please reopen if needed.

Andrei Borzenkov <arvidjaar>
Project Member
Sat 28 Nov 2015 08:21:10 AM UTC, comment #6: 

Please retest with current master. It tries multiple methods for TSC calibration, including PM and EFI timers.

Andrei Borzenkov <arvidjaar>
Project Member
Tue 02 Dec 2014 07:55:50 AM UTC, comment #5: 

I just found people have already discussed the patches in Oct and Nov:


It seems the grub maintainer(s) doesn't/don't like UEFI timer since that is known buggy on some platforms.

It seems pmtimer works in UEFI platform too, but I didn't check UEFI spec if pmtimer is a must for UEFI platforms, and some people have concerns about non-acpi case.

So, what's the solution?
Looks there was no further response to Rigoberto's mail in the above first thread. :-(
And for the second thread: looks there was no further response too.

Dexuan Cui <decui>
Wed 26 Nov 2014 08:24:31 AM UTC, comment #4: 

Can Rigoberto's patch be accepted?

Can we "first try PIT, if PIT doesn't work, then we try SetTimer()"?

Dexuan Cui <decui>
Tue 04 Nov 2014 09:49:43 AM UTC, comment #3: 

RHEL7.1 RC build and Ubuntu 14.10 have the same issue, actually: e.g., https://bugzilla.redhat.com/show_bug.cgi?id=1160128

Dexuan Cui <decui>
Wed 08 Oct 2014 06:54:16 PM UTC, comment #2: 

I've attached a grub_hyperv_gen2.zip patch for the Hyper-V Generation 2 issue.  To apply the patch, unzip the file and, above the top "grub" directory, run the following command:

patch -p 1 < grub_hyperv_gen2.patch

This patch no longer uses the Programmable Interval Timer (PIT) when the server is in UEFI mode.  It instead uses the EFI SetTimer() routine.  We also checked with Microsoft and using the EFI SetTimer() routine was their recommendation as well.

Rigoberto Corujo <rcorujo>
Tue 07 Oct 2014 01:43:44 PM UTC, comment #1: 

I had sent email to -email is unavailable- on September 28th 2014 root causing the problem.  Below is a copy of the email:



When using the Hyper-V Generation 2 hypervisor and trying to PXE boot a VM guest, the GRUB2 time functions are not working, which causes the PXE menu to display for a fraction of a second, instead of the usual 10 seconds or so, then boot the default menu entry, and immediately report that it timed out while loading the kernel.  In other words, the time goes by superfast.  For example, you'll get the message:

error: time out opening `rhel60x64/vmlinuz'.

This is because the functions in "./grub-core/kern/i386/tsc.c" that are used to calculate time are not working.

I found this site, which seems to say that the devices that GRUB2 uses to calculate the time have been removed from Hyper-V Generation 2:

Hyper-V generation 2 virtual machines – part 1 - John Howard - Senior Program Manager in the Hyper-V team at Microsoft - Site Home - TechNet Blogs

Referring to changes made to Hyper-V Generation 2, it says:
Then we changed other devices such as removing the legacy i8042 keyboard controller (which has an interesting side effect I will talk about in a future part), PS/2 mouse, S3 Video, the Programmable Interrupt Controller (PIC), the Programmable Interrupt Timer (PIT), the Super I/O device on which floppy support relied. We actually went even further by removing the PCI bus as well. For good measure, we also removed the speaker and the numerical co-processor. We also revised ACPI.
I noticed that in "tsc.c", the grub_inb(GRUB_PIT_SPEAKER_PORT) call always returns 0xff on Hyper-V Generation 2.

static void
grub_pit_wait (grub_uint16_t tics)
  grub_outb (grub_inb (GRUB_PIT_SPEAKER_PORT)
             & ~ (GRUB_PIT_SPK_DATA | GRUB_PIT_SPK_TMR2),

Is this a known issue that is already being addressed?

Thank you,

Rigoberto Corujo

Rigoberto Corujo <rcorujo>
Fri 08 Aug 2014 12:09:24 PM UTC, original submission:  

When downloading large files like /rhel60x64/vmlinuz, grub2 just closes the connection at some point in the middle of the file transfer (some times sooner, some times later):
[Source File: /rhel60x64/vmlinuz]
Opcode: Error Code (5)
Error code: Not defined (0)
Error message: closed

This was found using grub2.02~beta2 (master) at commit 0901e7855f922e770cbfeb58262cb8fded518190

The attached file was captured while running grub2> configfile /default
NOTES for the capture:  - PXE, dhcp and tftp server  - hyper-v server - the new Generation 2 VM

How to reproduce:
Try to UEFI PXE boot a hyper-v Generation 2 VM

Note that the boot process work as expected for vmware VMs with EFI boot.

Please let me know if there is anything else I can provide for you to help with the investigation.

Bogdan Atasiei <bodo3700>


Attached Files
file #32245:  grub_hyperv_gen2.zip added by rcorujo (1KiB - application/x-zip-compressed - GRUB2 PXE boot patch for Hyper-V Generation 2)
file #31863:  capture2.pcapng added by bodo3700 (2MiB - application/x-pcapng)
file #31864:  default added by bodo3700 (541B - application/octet-stream)


Depends on the following items: None found

Items that depend on this one: None found


Carbon-Copy List
  • -email is unavailable- added by arvidjaar (Posted a comment)
  • -email is unavailable- added by decui (Posted a comment)
  • -email is unavailable- added by decui (RHEL7.1 RC build and Ubuntu 14.10 have the same issue, actually: e.g., https://bugzilla.redhat.com/show_bug.cgi?id=1160128 )
  • -email is unavailable- added by rcorujo (Posted a comment)
  • -email is unavailable- added by bodo3700 (Submitted the item)
  • -email is unavailable- added by bodo3700

    Do you think this task is very important?
    If so, you can add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.




    Follow 7 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2015-12-02 arvidjaar StatusNone => Fixed
        Open/ClosedOpen => Closed
    2014-11-04 decui Carbon-Copy- => Added decui
    2014-10-08 rcorujo Attached File- => Added grub_hyperv_gen2.zip, #32245
    2014-08-08 bodo3700 Attached File- => Added capture2.pcapng, #31863
        Attached File- => Added default, #31864
        Carbon-Copy- => Added -email is unavailable-

    Back to the top

    Powered by Savane 3.7