From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from proxmox-new.maurer-it.com (proxmox-new.maurer-it.com [94.136.29.106]) by mx.groups.io with SMTP id smtpd.web10.22717.1684245669515903912 for ; Tue, 16 May 2023 07:01:11 -0700 Authentication-Results: mx.groups.io; dkim=missing; spf=pass (domain: proxmox.com, ip: 94.136.29.106, mailfrom: f.ebner@proxmox.com) Received: from proxmox-new.maurer-it.com (localhost.localdomain [127.0.0.1]) by proxmox-new.maurer-it.com (Proxmox) with ESMTP id 381764512A; Tue, 16 May 2023 16:01:06 +0200 (CEST) Message-ID: Date: Tue, 16 May 2023 16:00:55 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.10.0 Subject: Re: [PATCH v2 3/4] OvmfPkg/PlatformInitLib: dynamic mmio window size To: Gerd Hoffmann , devel@edk2.groups.io Cc: Jordan Justen , Pawel Polawski , Jiewen Yao , Oliver Steffen , Ard Biesheuvel , Thomas Lamprecht References: <20221004134728.55499-1-kraxel@redhat.com> <20221004134728.55499-4-kraxel@redhat.com> From: "Fiona Ebner" In-Reply-To: <20221004134728.55499-4-kraxel@redhat.com> Content-Language: en-US Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Am 04.10.22 um 15:47 schrieb Gerd Hoffmann: > In case we have a reliable PhysMemAddressWidth use that to dynamically > size the 64bit address window. Allocate 1/8 of the physical address > space and place the window at the upper end of the address space. > > Signed-off-by: Gerd Hoffmann Hi, a user recently reported that their Ubuntu 18.04 VM failed to boot after upgrading to our package based on edk2-stable202302 [0]. While the guest does reach GRUB, the disk attached via virtio-scsi-pci could not be found anymore. The user also reported that after changing the bus to pvscsi, the VM booted again, but the virtual NIC attached via virtio-net-pci did not work. Changing to e1000 made that work too. I was able to reproduce the issue (QEMU command line below[1]) and tracked it down to this patch. I verified that it is still an issue with current QEMU master and edk2 master, i.e. cafb4f3f36 ("UefiPayloadPkg: Fix boot shell issue for universal UEFI payload"). The issue happens with -cpu host, but not with -cpu kvm64. My host CPU is a AMD Ryzen Threadripper 2920X. "Reverting" with (this was the quickest way) > diff --git a/OvmfPkg/Library/PlatformInitLib/MemDetect.c b/OvmfPkg/Library/PlatformInitLib/MemDetect.c > index acf90b4e93..8563d7aedb 100644 > --- a/OvmfPkg/Library/PlatformInitLib/MemDetect.c > +++ b/OvmfPkg/Library/PlatformInitLib/MemDetect.c > @@ -855,7 +855,7 @@ PlatformAddressWidthInitialization ( > PlatformAddressWidthFromCpuid (PlatformInfoHob, TRUE); > if (PlatformInfoHob->PhysMemAddressWidth != 0) { > // physical address width is known > - PlatformDynamicMmioWindow (PlatformInfoHob); > + //PlatformDynamicMmioWindow (PlatformInfoHob);^M > return; > } allows the disk to be detected again. The kernel within the VM is for the user: 4.15.0-210-generic #221-Ubuntu for me: 4.15.0-211-generic #222-Ubuntu Happy to provide more information and relevant parts of debug logs. Best Regards, Fiona [0]: https://forum.proxmox.com/threads/127410/#post-557209 [1]: > ./qemu-system-x86_64 \ > -accel 'kvm' \ > -chardev 'socket,id=qmp,path=/var/run/qemu-server/113.qmp,server=on,wait=off' \ > -mon 'chardev=qmp,mode=control' \ > -pidfile /var/run/qemu-server/113.pid \ > -drive 'if=pflash,unit=0,format=raw,readonly=on,file=/root/OVMF_CODE.fd' \ > -drive 'if=pflash,unit=1,id=drive-efidisk0,format=raw,file=/dev/pve/vm-113-disk-2,size=540672' \ > -nodefaults \ > -vnc 'unix:/var/run/qemu-server/113.vnc,password=on' \ > -cpu host \ > -m 10240 \ > -device 'pci-bridge,id=pci.3,chassis_nr=3,bus=pci.0,addr=0x5' \ > -device 'vmware-svga,id=vga,bus=pci.0,addr=0x2' \ > -device 'virtio-scsi-pci,id=virtioscsi0,bus=pci.3,addr=0x1' \ > -drive 'file=/dev/pve/vm-113-disk-1,if=none,id=drive-scsi0,format=raw,cache=none,aio=io_uring,detect-zeroes=on' \ > -device 'scsi-hd,bus=virtioscsi0.0,channel=0,scsi-id=0,lun=0,drive=drive-scsi0,id=scsi0,bootindex=100' \ > -serial pty \ > -S \ > -machine 'type=pc'