GVT init failed when install windows


Jacky Lau
 

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/input3
[ 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/D279543825D611E8864ECB7A18B34643
open hugetlbfs file
/run/hugepage/acrn/huge_lv2/win_vm1/D279543825D611E8864ECB7A18B34643
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.