Bug 240734 - Broken Hyper-V Generation V2
Summary: Broken Hyper-V Generation V2
Status: Closed FIXED
Alias: None
Product: Base System
Classification: Unclassified
Component: kern (show other bugs)
Version: CURRENT
Hardware: amd64 Any
: --- Affects Many People
Assignee: freebsd-virtualization (Nobody)
URL:
Keywords: regression
Depends on:
Blocks:
 
Reported: 2019-09-21 17:02 UTC by Michael
Modified: 2019-10-31 07:27 UTC (History)
2 users (show)

See Also:


Attachments
Start screen of upgraded system (67.79 KB, image/jpeg)
2019-09-21 17:02 UTC, Michael
no flags Details
Fatal trap (45.73 KB, image/png)
2019-10-28 12:48 UTC, Michael
no flags Details
EFI \ freebsd \ loader.efi (13.78 KB, image/png)
2019-10-28 13:20 UTC, Michael
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Michael 2019-09-21 17:02:00 UTC
Created attachment 207698 [details]
Start screen of upgraded system

The FreeBSD-13.0-CURRENT-amd64-20190725-r350322-disc1 system is installed. Made an upgrade for today (git clone git://github.com/freebsd/freebsd.git --progress -v --single-branch -b master /usr/src).
Result - The keyboard does not work at all.
I can’t even install the system from scratch, because The keyboard does not work (FreeBSD-13.0-CURRENT-amd64-20190920-r352544-disc1.iso). And when you turn on the system after install, on the initial screen for selecting the boot mode, the broken view.
Windows 2019 Hyper-V, Generation V2 FreeBSD-Current.
On the FreeBSD-13.0-CURRENT-amd64-20190725-r350322 version, absolutely everything works great.
Comment 1 Morgan Vandagriff 2019-09-23 01:12:29 UTC
I can confirm.
Comment 2 Michael 2019-09-28 11:40:26 UTC
FreeBSD-13.0-CURRENT-amd64-20190927-r352778-disc1.iso - nothing changed. It is also not possible to start the installation of the system.
Comment 3 Michael 2019-10-05 07:40:10 UTC
FreeBSD-13.0-CURRENT-amd64-20191004-r353072-disc1.iso - nothing changed. It is also not possible to start the installation of the system.
Comment 4 Michael 2019-10-15 10:56:36 UTC
git clone git://github.com/freebsd/freebsd.git --progress -v --single-branch -b master /usr/src

Today did the following:

root@test-freebsd-master-v2:/usr/src # git pull
...
root@test-freebsd-master-v2:/usr/src # make cleanworld && make cleandir && make -j8 buildworld && make -j8 buildkernel KERNCONF=GENERIC
...
root@test-freebsd-master-v2:/usr/src # make installkernel KERNCONF=GENERIC
...
root@test-freebsd-master-v2:/usr/src # make installworld
...
root@test-freebsd-master-v2:/usr/src # mergemaster -Ui
...
reboot

- on the initial screen for selecting the boot mode, the broken view (see attachment) and keyboard does not work in hyper-v management interface of Windows 2019 Hyper-V Generation V2 virtual machine.

Installation from FreeBSD-13.0-CURRENT-amd64-20191011-r353427-disc1.iso also - not possible.
Comment 5 Michael 2019-10-21 07:17:20 UTC
FreeBSD-13.0-CURRENT-amd64-20191018-r353709-disc1.iso - nothing changed. It is also not possible to start the installation of the system (keyboard does not work in hyper-v management interface).

Windows 2019 Hyper-V, Generation V2
Comment 6 Toomas Soome freebsd_committer freebsd_triage 2019-10-28 08:37:01 UTC
(In reply to Michael from comment #4)
You need to update the boot loader on disk, unfortunately the update process does not include the boot program update.

mount -t msdosfs with device name where your ESP is
cp /boot/loader.efi to esp efi/boot/bootx64.efi or efi/freebsd depending on how old your setup is. See the current files in your ESP.
Comment 7 Michael 2019-10-28 12:48:04 UTC
Created attachment 208650 [details]
Fatal trap

Windows 2019 Hyper-V, VM-gen-V2 - FreeBSD-current, 4x Network adapters - Mellanox Connectix 3 SR-IOV enabled in VM.
Comment 8 Michael 2019-10-28 12:50:30 UTC
Sometimes when creating a recovery point (Veeam backup - CBT fast clone) falls out in fatal trup, a screenshot is attached. In the version of three months ago, there was no such bug. But there was always such a bug - when adding a network card to a working virtual machine, it hangs tightly. Even the hypervisor freezes until the "Turn off" VM.

Please make a working version of the new 13th FreeBSD for Hyper-V gen-V2. It wakes up just a wonderful super-router for the "Cloud".
Comment 9 Michael 2019-10-28 13:15:20 UTC
(In reply to Toomas Soome from comment #6)

Please explain.
I am using the latest Windows 2019 server Hyper-V with the latest update, the latest FreeBSD-Current-amd64.
What else to update?
Comment 10 Michael 2019-10-28 13:20:57 UTC
Created attachment 208654 [details]
EFI \ freebsd \ loader.efi

loader.efi in Hyper-V gen-V2
Comment 11 Toomas Soome freebsd_committer freebsd_triage 2019-10-28 14:29:39 UTC
(In reply to Michael from comment #10)

Yes, you have ESP (Efi System Partition), with directory tree "efi/freebsd", so you would need to copy from updated freebsd /boot/loader.efi into that directory.

you can mount ESP from freebsd with mount -t msdosfs and then copy with normal cp command.
Comment 12 Michael 2019-10-29 11:55:24 UTC
(In reply to Toomas Soome from comment #11)
It did not help - the keyboard does not work.
Comment 13 Toomas Soome freebsd_committer freebsd_triage 2019-10-29 11:59:52 UTC
(In reply to Michael from comment #12)

it does not help about the keyboard, only about boot loader screen.
Comment 14 Michael 2019-10-30 09:49:50 UTC
I found the culprit in the disappearance of the keyboard.

commit	e609c3d1a1ef3699fcbdffe70a23ad316fbfe7d7
imp <imp@FreeBSD.org>	
Wed, 14 Aug 2019 22:58:28 +0200 (20:58 +0000)
 Move hyperv to files.x86
  Move the comomon part of hyperv to files.x86.
 Reviewed by: jhb (verbal OK on irc)
 Differential Revision: https://reviews.freebsd.org/D21248


root@frw03v2:~ # uname -a
  FreeBSD frw03v2.hv.lan 13.0-CURRENT FreeBSD 13.0-CURRENT b6af6d7d598-c261983(HEAD) GENERIC  amd64
root@frw03v2:~ # 
root@frw03v2:~ # sysctl -a | grep kbd
  kbd0 at kbdmux0
  hvkbd0: <Hyper-V KBD> on vmbus0
  kbd0 at kbdmux0
  hvkbd0: <Hyper-V KBD> on vmbus0
  kbd0 at kbdmux0
  hvkbd0: <Hyper-V KBD> on vmbus0
  kbd0 at kbdmux0
  hvkbd0: <Hyper-V KBD> on vmbus0
  kbd0 at kbdmux0
  hvkbd0: <Hyper-V KBD> on vmbus0
  kbd0 at kbdmux0
  hvkbd0: <Hyper-V KBD> on vmbus0
  kbd0 at kbdmux0
  hvkbd0: <Hyper-V KBD> on vmbus0
  kbd0 at kbdmux0
  hvkbd0: <Hyper-V KBD> on vmbus0
  kbd0 at kbdmux0
  hvkbd0: <Hyper-V KBD> on vmbus0
  device  atkbdc
  device  atkbd
  device  kbdmux
  device  ukbd
  kern.vt.kbd_panic: 0
  kern.vt.kbd_debug: 1
  kern.vt.kbd_reboot: 1
  kern.vt.kbd_poweroff: 1
  kern.vt.kbd_halt: 1
  kern.evdev.input.1.phys: kbdmux0
  "Giant","hv_kbdc mutex"
  hw.usb.ukbd.pollrate: 0
  hw.usb.ukbd.no_leds: 0
  hw.usb.ukbd.debug: 0
  hw.syscons.kbd_debug: 1
  hw.syscons.kbd_reboot: 1
  hw.kbd.keymap_restrict_change: 0
  dev.hvkbd.0.debug: 0
  dev.hvkbd.0.channel.4.br.tx.state: rindex:32 windex:32 imask:0 ravail:0 wavail:36864
  dev.hvkbd.0.channel.4.br.rx.state: rindex:592 windex:592 imask:0 ravail:0 wavail:36864
  dev.hvkbd.0.channel.4.mnf: 0
  dev.hvkbd.0.channel.4.cpu: 0
  dev.hvkbd.0.%parent: vmbus0
  dev.hvkbd.0.%pnpinfo: classid=f912ad6d-2b17-48ea-bd65-f927a61c7684 deviceid=d34b2567-b9b6-42b9-8778-0a4ec0b955bf
  dev.hvkbd.0.%location:
  dev.hvkbd.0.%driver: hvkbd
->dev.hvkbd.0.%desc: Hyper-V KBD
  dev.hvkbd.%parent:
root@frw03v2:~ # 
root@frw03v2:~ # cd /usr/src
root@frw03v2:/usr/src #
root@frw03v2:/usr/src # git checkout e609c3d1a1ef3699fcbdffe70a23ad316fbfe7d7
  Previous HEAD position was  b6af6d7d598 The bxe driver, QLogic NetXtreme II Ethernet 10Gb PCIe adapter driver, is x86 specific, and only builds there. Likewise the module is built there. Move it to the x86-only files.x86.
   HEAD is now at e609c3d1a1e Move hyperv to files.x86
    committer	imp <imp@FreeBSD.org>	
    Wed, 14 Aug 2019 22:58:28 +0200 (20:58 +0000)
root@frw03v2:/usr/src #
root@frw03v2:/usr/src # make cleanworld && make cleandir && make -j8 buildkernel KERNCONF=GENERIC
...
--------------------------------------------------------------
>>> Kernel build for GENERIC completed on Wed Oct 30 11:17:31 EET 2019
--------------------------------------------------------------
>>> Kernel(s)  GENERIC built in 620 seconds, ncpu: 8, make -j8
--------------------------------------------------------------
root@frw03v2:/usr/src # 
root@frw03v2:/usr/src # make installkernel KERNCONF=GENERIC
...
--------------------------------------------------------------
>>> Installing kernel GENERIC completed on Wed Oct 30 11:24:42 EET 2019
--------------------------------------------------------------
root@frw03v2:/usr/src # 
root@frw03v2:/usr/src # reboot
. . . . . 
root@frw03v2:~ # uname -a
  FreeBSD frw03v2.hv.lan 13.0-CURRENT FreeBSD 13.0-CURRENT e609c3d1a1e-c261984(HEAD) GENERIC  amd64
root@frw03v2:~ # 
root@frw03v2:~ # sysctl -a | grep kbd
kbd0 at kbdmux0
hvkbd0: <Hyper-V KBD> on vmbus0
kbd0 at kbdmux0
hvkbd0: <Hyper-V KBD> on vmbus0
kbd0 at kbdmux0
hvkbd0: <Hyper-V KBD> on vmbus0
kbd0 at kbdmux0
hvkbd0: <Hyper-V KBD> on vmbus0
kbd0 at kbdmux0
hvkbd0: <Hyper-V KBD> on vmbus0
kbd0 at kbdmux0
hvkbd0: <Hyper-V KBD> on vmbus0
kbd0 at kbdmux0
hvkbd0: <Hyper-V KBD> on vmbus0
kbd0 at kbdmux0
hvkbd0: <Hyper-V KBD> on vmbus0
kbd0 at kbdmux0
device  atkbdc
device  atkbd
device  kbdmux
device  ukbd
kern.vt.kbd_panic: 0
kern.vt.kbd_debug: 1
kern.vt.kbd_reboot: 1
kern.vt.kbd_poweroff: 1
kern.vt.kbd_halt: 1
kern.evdev.input.1.phys: kbdmux0
hw.usb.ukbd.pollrate: 0
hw.usb.ukbd.no_leds: 0
hw.usb.ukbd.debug: 0
hw.syscons.kbd_debug: 1
hw.syscons.kbd_reboot: 1
hw.kbd.keymap_restrict_change: 0
root@frw03v2:~ # 

After commit e609c3d1a1ef3699fcbdffe70a23ad316fbfe7d7 driver "Hyper-V KBD" is absent and keyboard does not work in hyper-v management interface of Windows 2019 Hyper-V, Generation V2
Comment 15 commit-hook freebsd_committer freebsd_triage 2019-10-30 17:18:42 UTC
A commit references this bug:

Author: imp
Date: Wed Oct 30 17:18:11 UTC 2019
New revision: 354192
URL: https://svnweb.freebsd.org/changeset/base/354192

Log:
  Make hyperv keyboard work again.

  r351049 bogusly deleted these lines from files.amd64 but failed to add them to
  files.x86. Since this works on i386, add them to files.x86 rather than just
  adding them back to files.amd64.

  PR: 240734
  Reported by: Michael Pro

Changes:
  head/sys/conf/files.x86