Re: GVT init failed when install windows


Geoffroy Van Cutsem
 

Fuzhong, is this something you can help with?

Thanks,
Geoffroy

-----Original Message-----
From: acrn-users@... <acrn-users@...>
On Behalf Of Jacky Lau
Sent: Thursday, January 28, 2021 3:31 PM
To: acrn-users@...
Subject: Re: [acrn-users] GVT init failed when install windows

Well, I'm using acrn v2.3, so I following this tutorial:
https://projectacrn.github.io/2.3/tutorials/using_windows_as_uos.html

I checked the code and fixed the gvt init failed issue by enlarged
PCI_EMUL_MEMLIMIT32.
The install_win.sh run successful. But nothing displayed on my hdmi screen.
When I run install_win.sh, the kernel print messages:
[ 214.077918] IRQ 122: no longer affine to CPU1 [ 214.079031] smpboot: CPU
1 is now offline [ 215.083296] vhm: try to offline cpu 1 with lapicid 2 [
215.110031] IRQ 120: no longer affine to CPU2 [ 215.112118] smpboot: CPU 2
is now offline [ 216.114476] vhm: try to offline cpu 2 with lapicid 1 [
216.130278] IRQ 124: no longer affine to CPU3 [ 216.131571] smpboot: CPU 3
is now offline [ 217.135012] vhm: try to offline cpu 3 with lapicid 3 [
217.190688] vhm_dev_open: opening device node [ 217.191180] vhm-ioreq:
init request buffer @ 00000000d5da3ebd!
[ 217.191184] vhm-ioreq: created ioreq client 1 for ioeventfd-1 [ 217.191214]
ACRN vhm ioeventfd init done!
[ 217.191222] ACRN vhm irqfd init done!
[ 217.191223] vhm: VM 1 created
[ 217.385657] vhm-ioreq: created ioreq client 2 for ioreq gvt-g [ 217.387846]
IPv6: ADDRCONF(NETDEV_CHANGE): tap0: link becomes ready [ 217.387871]
acrn-br0: port 1(tap0) entered blocking state [ 217.387873] acrn-br0: port
1(tap0) entered forwarding state [ 217.475601] vhm-ioreq: created ioreq
client 3 for acrndm [ 217.563042] [drm] prepare GOP fb: 8100KB for
1920X1080@32 [ 217.567443] [drm] Set up display w:1920 h:1080 for GOP [
217.567456] gvt: vgpu 1: pvinfo read gop: [78860:4] = df000000 [ 217.567758]
gvt: vgpu 1: pvinfo read gop: [78864:4] = 780 [ 217.567904] gvt: vgpu 1: pvinfo
read gop: [78868:4] = 438 [ 217.568049] gvt: vgpu 1: pvinfo read gop:
[7886c:4] = 780 [ 217.568194] gvt: vgpu 1: pvinfo read gop: [78870:4] = 4 [
217.568336] gvt: vgpu 1: pvinfo read gop: [78874:4] = 7e9000 [ 217.574251]
[drm:intel_cpu_fifo_underrun_irq_handler] *ERROR* CPU pipe A FIFO
underrun [ 496.745805] [drm] hotplug can't be supported in idv [
497.781306] [drm] hotplug can't be supported in idv [ 498.869303] [drm]
hotplug can't be supported in idv

I must use GTV-g, as I need to display different content on different screens.

Geoffroy Van Cutsem <geoffroy.vancutsem@...> 于2021年1月28日
周四 下午8:21写道:

Hi,

Were you following this tutorial when you hit this issue?
https://projectacrn.github.io/latest/tutorials/using_windows_as_uos.ht
ml

We switched at some point and are now using GVT-d (direct assignement)
to run Windows as a Guest, and I believe there are some known issues if
trying to install Windows using GTV-g. Which version of ACRN are you using?

Thanks,
Geoffroy

-----Original Message-----
From: acrn-users@...
<acrn-users@...>
On Behalf Of Jacky Lau
Sent: Thursday, January 28, 2021 10:03 AM
To: acrn-users@...
Subject: [acrn-users] GVT init failed when install windows

Hi, all.
After setup an ACRN Industry Scenario with Ubuntu Service VM, I want
to launch Windows as the Guest VM. But there are some issues when I
install windows.

1. Service VM boot time become very long when enable gvt:
...
[ 0.699211] Linux agpgart interface v0.103
[ 0.699424] vhm: initializing
[ 0.699427] vhm: hv api version 1.0
[ 0.699428] vhm: registered correctly with major number 243
[ 0.699431] vhm: device class registered correctly
[ 0.699457] register IPI handler
[ 0.699515] vhm: Virtio & Hypervisor service module initialized
[ 0.700422] i915 0000:00:02.0: Direct firmware load for
i915/gvt/vid_0x8086_did_0x5912_rid_0x04.golden_hw_state failed with
error -2
[ 0.700424] i915 0000:00:02.0: Falling back to sysfs fallback for:
i915/gvt/vid_0x8086_did_0x5912_rid_0x04.golden_hw_state
[ 1.458633] tsc: Refined TSC clocksource calibration: 3912.000 MHz
[ 1.458640] clocksource: tsc: mask: 0xffffffffffffffff max_cycles:
0x70c747804da, max_idle_ns: 881591211608 ns
[ 1.458656] clocksource: Switched to clocksource tsc
[ 62.531820] [drm] Supports vblank timestamp caching Rev 2
(21.10.2013).
[ 62.531821] [drm] Driver supports precise vblank timestamp query.
[ 62.532332] i915 0000:00:02.0: vgaarb: changed VGA decodes:
olddecodes=io+mem,decodes=io+mem:owns=io+mem
[ 62.532346] [drm] Skip DMC firmware loading in IDV
[ 62.532347] i915 0000:00:02.0: Failed to load DMC firmware
i915/kbl_dmc_ver1_04.bin. Disabling runtime power management.
[ 62.532348] i915 0000:00:02.0: DMC firmware homepage:
https://git.kernel.org/pub/scm/linux/kernel/git/firmware/linux-
firmware.git/tree/i915
[ 62.532567] [drm] Disable FBC for direct display in IDV
[ 64.563004] [drm] Initialized i915 1.6.0 20191101 for 0000:00:02.0 on
minor 0
[ 64.565045] ACPI: Video Device [GFX0] (multi-head: yes rom: no post:
no)
[ 64.565372] input: Video Bus as
/devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/LNXVIDEO:00/input/inpu
t3
[ 64.568575] brd: module loaded
[ 64.570271] loop: module loaded
[ 64.570359] zram: Added device: zram0
[ 64.570457] mei_me 0000:00:16.0: enabling device (0000 -> 0002)
...

The kernel parameters of my Service VM is:
root=/dev/sda3 console=ttyS0 idle=halt rw rootwait console=tty0
consoleblank=0 no_timer_check quiet loglevel=3
i915.nuclear_pageflip=1
hvlog=2M@0xe00000 memmap=0x200000$0xe00000 maxcpus=4
root=PARTUUID=28259bf2-ab31-1048-a7b8-96cf62ef034f
intel_iommu=on
i915.enable_gvt=1 i915.enable_guc=0 i915.enable_inital_modeset=1
hugepagesz=1G hugepages=4

Full dmesg is in the attached file.

2. acrn-dm report "gvt pci bases are out of range" when init gvt:
jacky@acrn:~/acrn-work$ sudo ./install_win.sh
cpu1 online=0
cpu2 online=0
cpu3 online=0
passed gvt-g optargs low_gm 64, high_gm 448, fence 8
SW_LOAD: get ovmf path /usr/share/acrn/bios/OVMF.fd, size 0x200000
vm_create: win_vm1
VHM api version 1.0
vm_setup_memory: size=0x100000000
open hugetlbfs file
/run/hugepage/acrn/huge_lv1/win_vm1/D279543825D611E8864ECB7A18B34
643
open hugetlbfs file
/run/hugepage/acrn/huge_lv2/win_vm1/D279543825D611E8864ECB7A18B34
643
level 0 free/need pages:1/1 page size:0x200000 level 1 free/need
pages:4/4 page size:0x40000000

try to setup hugepage with:
level 0 - lowmem 0x0, biosmem 0x200000, highmem 0x0
level 1 - lowmem 0x80000000, biosmem 0x0, highmem 0x80000000
total_size 0x200000000

mmap ptr 0x0x7fd9e6fbf000 -> baseaddr 0x0x7fda00000000 mmap
0x80000000@0x7fda00000000 touch 2 pages with pagesz 0x40000000
mmap
0x80000000@0x7fdb40000000 touch 2 pages with pagesz 0x40000000
mmap
0x200000@0x7fdaffe00000 touch 1 pages with pagesz 0x200000

really setup hugepage with:
level 0 - lowmem 0x0, biosmem 0x200000, highmem 0x0
level 1 - lowmem 0x80000000, biosmem 0x0, highmem 0x80000000
vm_init_vdevs No correct pm notify channel given pci init hostbridge
pci init lpc pci init pci-gvt gvt pci bases are out of range
GVT: init failed
pci pci-gvt init failed

polling 34...

Listening 34...

Stop listening 34...

Stop polling 34...

No
correct pm notify channel given


Unable to init vdev (2)

my install_win.sh script:
#!/bin/bash
# Copyright (C) 2019 Intel Corporation.
# SPDX-License-Identifier: BSD-3-Clause

function launch_win()
{
vm_name=win_vm$1

#check if the vm is running or not
vm_ps=$(pgrep -a -f acrn-dm)
result=$(echo $vm_ps | grep "${vm_name}") if [[ "$result" != "" ]];
then echo "$vm_name is running, can't create twice!"
exit
fi

#for memsize setting
mem_size=4096M

acrn-dm -A -m $mem_size -s 0:0,hostbridge -s 1:0,lpc -l com1,stdio \
-s 2,pci- gvt -G "$2" \ -s 3,virtio-blk,./win10-20h2.img \ -s
4,virtio-net,tap0 \ -s
6,xhci,1-7 \ -s 8,ahci,cd:./Windows.iso \ -s
9,ahci,cd:./virtio-win-0.1.190.iso \ --ovmf
/usr/share/acrn/bios/OVMF.fd \ --windows \ $vm_name }

# offline SOS CPUs except BSP before launch UOS for i in `ls -d
/sys/devices/system/cpu/cpu[1-99]`; do
online=`cat $i/online`
idx=`echo $i | tr -cd "[1-99]"`
echo cpu$idx online=$online
if [ "$online" = "1" ]; then
echo 0 > $i/online
# during boot time, cpu hotplug may be disabled by
pci_device_probe during a pci module insmod
while [ "$online" = "1" ]; do
sleep 1
echo 0 > $i/online
online=`cat $i/online`
done
echo $idx > /sys/class/vhm/acrn_vhm/offline_cpu
fi
done

launch_win 1 "64 448 8"


3. There are no mdev_supported_types file in the /sys filesystem
jacky@acrn:~/acrn-work$ lspci|grep -i vga
00:02.0 VGA compatible controller: Intel Corporation HD Graphics 630
(rev 04)

jacky@acrn:~/acrn-work$ ls -l
/sys/devices/pci0000\:00/0000\:00\:02.0/
total 0
-r--r--r-- 1 root root 4096 Jan 28 15:58 ari_enabled
-r--r--r-- 1 root root 4096 Jan 28 15:58 boot_vga
-rw-r--r-- 1 root root 4096 Jan 28 15:58 broken_parity_status
-r--r--r-- 1 root root 4096 Jan 28 15:58 class
-rw-r--r-- 1 root root 4096 Jan 28 15:58 config
-r--r--r-- 1 root root 4096 Jan 28 15:58 consistent_dma_mask_bits
-r--r--r-- 1 root root 4096 Jan 28 15:58 current_link_speed
-r--r--r-- 1 root root 4096 Jan 28 15:58 current_link_width
-rw-r--r-- 1 root root 4096 Jan 28 15:58 d3cold_allowed
-r--r--r-- 1 root root 4096 Jan 28 15:58 device
-r--r--r-- 1 root root 4096 Jan 28 15:58 dma_mask_bits
lrwxrwxrwx 1 root root 0 Jan 28 15:58 driver ->
../../../bus/pci/drivers/i915
-rw-r--r-- 1 root root 4096 Jan 28 15:58 driver_override
drwxr-xr-x 4 root root 0 Jan 28 15:58 drm
-rw-r--r-- 1 root root 4096 Jan 28 15:58 enable
lrwxrwxrwx 1 root root 0 Jan 28 15:58 firmware_node ->
../../LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/LNXVIDEO:00
drwxr-xr-x 3 root root 0 Jan 28 15:58 graphics
-r-------- 1 root root 2101304 Jan 28 15:58 gvt_firmware
drwxr-xr-x 4 root root 0 Jan 28 15:58 i2c-0
drwxr-xr-x 4 root root 0 Jan 28 15:58 i2c-1
drwxr-xr-x 4 root root 0 Jan 28 15:58 i2c-2
-r--r--r-- 1 root root 4096 Jan 28 15:58 index
-r--r--r-- 1 root root 4096 Jan 28 15:58 irq
-r--r--r-- 1 root root 4096 Jan 28 15:58 label
-r--r--r-- 1 root root 4096 Jan 28 15:58 local_cpulist
-r--r--r-- 1 root root 4096 Jan 28 15:58 local_cpus
-r--r--r-- 1 root root 4096 Jan 28 15:58 max_link_speed
-r--r--r-- 1 root root 4096 Jan 28 15:58 max_link_width
-r--r--r-- 1 root root 4096 Jan 28 15:58 modalias
-rw-r--r-- 1 root root 4096 Jan 28 15:58 msi_bus
drwxr-xr-x 2 root root 0 Jan 28 15:58 msi_irqs
drwxr-xr-x 2 root root 0 Jan 28 15:58 power
--w--w---- 1 root root 4096 Jan 28 15:58 remove
--w------- 1 root root 4096 Jan 28 15:58 rescan
--w------- 1 root root 4096 Jan 28 15:58 reset
-r--r--r-- 1 root root 4096 Jan 28 15:58 resource
-rw------- 1 root root 16777216 Jan 28 15:58 resource0
-rw------- 1 root root 268435456 Jan 28 15:58 resource2
-rw------- 1 root root 268435456 Jan 28 15:58 resource2_wc
-rw------- 1 root root 64 Jan 28 15:58 resource4
-r--r--r-- 1 root root 4096 Jan 28 15:58 revision
-rw------- 1 root root 131072 Jan 28 15:58 rom
lrwxrwxrwx 1 root root 0 Jan 28 15:58 subsystem -> ../../../bus/pci
-r--r--r-- 1 root root 4096 Jan 28 15:58 subsystem_device
-r--r--r-- 1 root root 4096 Jan 28 15:58 subsystem_vendor
-rw-r--r-- 1 root root 4096 Jan 28 15:58 uevent
-r--r--r-- 1 root root 4096 Jan 28 15:58 vendor

So, do I miss anything?









Join acrn-users@lists.projectacrn.org to automatically receive all group messages.