RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 1967747 - edk2: review features and drivers shipped in RHEL
Summary: edk2: review features and drivers shipped in RHEL
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Red Hat Enterprise Linux 9
Classification: Red Hat
Component: edk2
Version: 9.0
Hardware: Unspecified
OS: Unspecified
high
medium
Target Milestone: beta
: ---
Assignee: Philippe Mathieu-Daudé
QA Contact: Xueqiang Wei
URL:
Whiteboard:
: 1967743 (view as bug list)
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2021-06-03 19:03 UTC by Ademar Reis
Modified: 2021-12-07 21:52 UTC (History)
14 users (show)

Fixed In Version: edk2-20210527gite1999b264f1f-3.el9
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2021-12-07 21:50:14 UTC
Type: Feature Request
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Gitlab redhat/centos-stream/src edk2 merge_requests 3 0 None None None 2021-07-01 20:07:44 UTC

Description Ademar Reis 2021-06-03 19:03:16 UTC
Let's review the list of features and drivers we're shipping in our edk2 builds so we distribute a leaner and well-tested/supported package.

This BZ is about an audit to list potential candidates for disablement. Actually disabling them may require upstream patches and is something that can be tracked in separate BZs.

One idea is to ship unsupported drivers in a separate subpackage (an ISO which could be loaded in the UEFI shell).

Comment 2 Laszlo Ersek 2021-06-24 11:08:21 UTC
The following drivers are candidates for disablement (covering both
edk2-aarch64 and edk2-ovmf):

Filesystem drivers:

- MdeModulePkg/Universal/Disk/UdfDxe/UdfDxe.inf
  (UDF driver)

- OvmfPkg/VirtioFsDxe/VirtioFsDxe.inf
  (virtio-fs driver)

Device drivers:

- MdeModulePkg/Bus/Pci/NvmExpressDxe/NvmExpressDxe.inf
  (NVME driver; no real known use case)

- OvmfPkg/QemuRamfbDxe/QemuRamfbDxe.inf
  (ramfb display device driver; only potentially needed for aarch64
  Windows guests)

- OvmfPkg/VirtioGpuDxe/VirtioGpu.inf
  (required in edk2-aarch64 where only virtio-gpu-pci is available,
   not needed in edk2-ovmf where QemuVideoDxe binds virtio-vga anyway)

UEFI shell command implementations expressed as drivers ("dynamic shell
commands"):

- ShellPkg/DynamicCommand/TftpDynamicCommand/TftpDynamicCommand.inf
  (download files in the shell via TFTP)

- ShellPkg/DynamicCommand/HttpDynamicCommand/HttpDynamicCommand.inf
  (download files in the shell via HTTP(S))

- OvmfPkg/LinuxInitrdDynamicShellCommand/LinuxInitrdDynamicShellCommand.inf
  (register a file in the shell as the initial ramdisk for a UEFI
  stubbed kernel, to be booted next)

Misc:

- MdeModulePkg/Universal/EbcDxe/EbcDxe.inf
  (EFI Byte Code interpreter)

Xen support:

- already absent from edk2-aarch64

- will disappear from edk2-ovmf automatically after rebasing to
  edk2-stable202108 (see
  <https://bugzilla.tianocore.org/show_bug.cgi?id=2122>)

Service drivers:

- MdeModulePkg/Universal/PrintDxe/PrintDxe.inf
  (should be removed unconditionall upstream from OVMF; it's not used)

Drivers that we should keep -- if we want to deprecate any of these use
cases, that should be done at the QEMU device model level:

- USB drivers:
  - transport: UhciDxe, EhciDxe, XhciDxe
  - generic bus: UsbBusDxe
  - devices: UsbKbDxe, UsbMassStorageDxe

- SCSI drivers:
  - generic bus: ScsiBusDxe
  - generic disk: ScsiDiskDxe
  - devices: VirtioScsiDxe

- virtio-0.9.5 transport drivers:
  - VirtioFdtDxe [MMIO, edk2-aarch64 only]
  - VirtioPciDeviceDxe

- ACPI S3 support modules:
  - Removing these modules at build time would cause a bunch of harmful
    churn in OVMF. The ACPI S3 stack in OVMF is already dynamically
    controlled via fw_cfg, and our downstream QEMU binaries already
    disable ACPI S3, by default.

I'm not commenting on the drivers that we must absolutely keep; if
questions arise, please ask me them.

Comment 4 Ademar Reis 2021-06-24 20:29:33 UTC
*** Bug 1967743 has been marked as a duplicate of this bug. ***

Comment 5 Laszlo Ersek 2021-06-28 16:00:55 UTC
(In reply to Laszlo Ersek from comment #2)

> - OvmfPkg/QemuRamfbDxe/QemuRamfbDxe.inf
>   (ramfb display device driver; only potentially needed for aarch64
>   Windows guests)

see also bug 1841068

Comment 10 Yanan Fu 2021-07-14 14:19:49 UTC
QE bot(pre verify): Set 'Verified:Tested,SanityOnly' as gating/tier1 test pass.

Comment 14 Zhenyu Zhang 2021-07-23 08:14:01 UTC
According to the following test results, the verification is passed on aarch64.

tier1 test rhel9 on aarch64 pass:

Test Environment:
Host Distro: RHEL-9.0.0-20210717.1
Host Kernel: 5.13.0-1.el9.aarch64
Qemu-kvm: qemu-kvm-6.0.0-9.el9
Guest Kernel: 5.13.0-0.rc7.51.el9.aarch64
edke2: edk2-aarch64-20210527gite1999b264f1f-3.el9.noarch

Results Analysis:
RESULTS    : PASS 76 | ERROR 0 | FAIL 0 | SKIP 0 | WARN 0 | INTERRUPT 0 | CANCEL 0
ALL PASS

New bugs(0):
Existing bugs(0):

Job link:
http://10.0.136.47/zhenyzha/edk2-3_tier1_test_rhel9_aarch64/results.html


====== virtio-gpu-pci is available ======
1. boot guest
/usr/libexec/qemu-kvm \
-name 'avocado-vt-vm1'  \
-sandbox on  \
-blockdev node-name=file_aavmf_code,driver=file,filename=/usr/share/edk2/aarch64/QEMU_EFI-silent-pflash.raw,auto-read-only=on,discard=unmap \
-blockdev node-name=drive_aavmf_code,driver=raw,read-only=on,file=file_aavmf_code \
-blockdev node-name=file_aavmf_vars,driver=file,filename=/home/kvm_autotest_root/images/avocado-vt-vm1_rhel900-aarch64-virtio-scsi.qcow2_VARS.fd,auto-read-only=on,discard=unmap \
-blockdev node-name=drive_aavmf_vars,driver=raw,read-only=off,file=file_aavmf_vars \
-machine virt,gic-version=host,memory-backend=mem-machine_mem,pflash0=drive_aavmf_code,pflash1=drive_aavmf_vars \
-device pcie-root-port,id=pcie-root-port-0,multifunction=on,bus=pcie.0,addr=0x1,chassis=1 \
-device pcie-pci-bridge,id=pcie-pci-bridge-0,addr=0x0,bus=pcie-root-port-0  \
-nodefaults \
-device pcie-root-port,id=pcie-root-port-1,port=0x1,addr=0x1.0x1,bus=pcie.0,chassis=2 \
-device virtio-gpu-pci,bus=pcie-root-port-1,addr=0x0 \
-m 8192 \
-object memory-backend-ram,size=8192M,id=mem-machine_mem  \
-smp 4,maxcpus=4,cores=2,threads=1,sockets=2  \
-cpu 'host' \
-chardev socket,id=qmp_id_qmpmonitor1,wait=off,path=/tmp/monitor-qmpmonitor1-20210723-000926-Bqk6sP3E,server=on  \
-mon chardev=qmp_id_qmpmonitor1,mode=control \
-chardev socket,id=qmp_id_catch_monitor,wait=off,path=/tmp/monitor-catch_monitor-20210723-000926-Bqk6sP3E,server=on  \
-mon chardev=qmp_id_catch_monitor,mode=control  \
-serial unix:'/tmp/serial-serial0-20210723-000926-Bqk6sP3E',server=on,wait=off \
-object rng-random,filename=/dev/random,id=passthrough-Rckw6KaF \
-device pcie-root-port,id=pcie-root-port-2,port=0x2,addr=0x1.0x2,bus=pcie.0,chassis=3 \
-device virtio-rng-pci,id=virtio-rng-pci-i9sMq0Ma,rng=passthrough-Rckw6KaF,bus=pcie-root-port-2,addr=0x0 \
-device pcie-root-port,id=pcie-root-port-3,port=0x3,addr=0x1.0x3,bus=pcie.0,chassis=4 \
-device qemu-xhci,id=usb1,bus=pcie-root-port-3,addr=0x0 \
-device usb-tablet,id=usb-tablet1,bus=usb1.0,port=1 \
-device pcie-root-port,id=pcie-root-port-4,port=0x4,addr=0x1.0x4,bus=pcie.0,chassis=5 \
-device virtio-scsi-pci,id=virtio_scsi_pci0,bus=pcie-root-port-4,addr=0x0 \
-blockdev node-name=file_image1,driver=file,auto-read-only=on,discard=unmap,aio=threads,filename=/home/kvm_autotest_root/images/rhel900-aarch64-virtio-scsi.qcow2,cache.direct=on,cache.no-flush=off \
-blockdev node-name=drive_image1,driver=qcow2,read-only=off,cache.direct=on,cache.no-flush=off,file=file_image1 \
-device scsi-hd,id=image1,drive=drive_image1,write-cache=on \
-device pcie-root-port,id=pcie-root-port-5,port=0x5,addr=0x1.0x5,bus=pcie.0,chassis=6 \
-device virtio-net-pci,mac=9a:8c:57:b2:55:0f,rombar=0,id=idfk4Sw4,netdev=idXsBQFs,bus=pcie-root-port-5,addr=0x0  \
-netdev tap,id=idXsBQFs,vhost=on  \
-vnc :20  \
-rtc base=utc,clock=host \
-enable-kvm \
-device pcie-root-port,id=pcie-root-port-6,port=0x6,addr=0x1.0x6,bus=pcie.0,chassis=7 \
-device virtio-balloon-pci,id=balloon0,bus=pcie-root-port-6,addr=0x0 \
-device pcie-root-port,id=pcie_extra_root_port_0,multifunction=on,bus=pcie.0,addr=0x2,chassis=8 \
-device pcie-root-port,id=pcie_extra_root_port_1,addr=0x2.0x1,bus=pcie.0,chassis=9 \
-monitor stdio 

2.Connect to the serial port
nc -U /tmp/serial-serial0-20210723-000926-Bqk6sP3E
...
[    3.236491] [drm] pci: virtio-gpu-pci detected at 0000:03:00.0
[    3.236679] sd 0:0:0:0: [sda] Attached SCSI disk
[    3.239006] [drm] features: -virgl +edid -resource_blob -host_visible
[    3.243388] [drm] number of scanouts: 1
[    3.244725] [drm] number of cap sets: 0
[    3.246697] [drm] Initialized virtio_gpu 0.1.0 0 for virtio0 on minor 0
[    3.250253] Console: switching to colour frame buffer device 128x48
[    3.255252] virtio_gpu virtio0: [drm] fb0: virtio_gpudrmfb frame buffer device

3. Check on guest
# lspci
03:00.0 Display controller: Red Hat, Inc. Virtio GPU (rev 01)

Comment 15 Xueqiang Wei 2021-07-25 17:57:23 UTC
Thanks Zhenyu for the verification on aarch64. Many thanks.


I Tested edk2 test loop(secure boot, uefi shell commands, https installation, pxe installation, iscsi boot and so on), no new bug found.


Versions:
kernel-5.13.0-0.rc7.51.el9.x86_64
qemu-kvm-6.0.0-7.el9
edk2-20210527gite1999b264f1f-3.el9



Bug 1967743 CLOSED DUPLICATE of bug 1967747, virtiofs driver should be disabled on edk2-20210527gite1999b264f1f-3.el9.  

But I tested it with the following steps, it still works. 

Steps:
1. Install a basic linux root file system as follows
# mkdir virtio-fs-root
# dnf --installroot=$PWD/virtio-fs-root --releasever=29 install system-release vim-minimal systemd passwd dnf rootfiles

2. Run the virtiofsd daemon on host with the directory created above.
# /usr/libexec/virtiofsd --socket-path=/tmp/vhostqemu -o source=$PWD/virtio-fs-root -o cache=none

3. boot a rhel9 guest
/usr/libexec/qemu-kvm \
    -S  \
    -name 'avocado-vt-vm1'  \
    -sandbox on  \
    -blockdev node-name=file_ovmf_code,driver=file,filename=/usr/share/OVMF/OVMF_CODE.secboot.fd,auto-read-only=on,discard=unmap \
    -blockdev node-name=drive_ovmf_code,driver=raw,read-only=on,file=file_ovmf_code \
    -blockdev node-name=file_ovmf_vars,driver=file,filename=/home/OVMF_VARS.fd,auto-read-only=on,discard=unmap \
    -blockdev node-name=drive_ovmf_vars,driver=raw,read-only=off,file=file_ovmf_vars \
    -machine q35,pflash0=drive_ovmf_code,pflash1=drive_ovmf_vars \
    -device pcie-root-port,id=pcie-root-port-0,multifunction=on,bus=pcie.0,addr=0x1,chassis=1 \
    -device pcie-pci-bridge,id=pcie-pci-bridge-0,addr=0x0,bus=pcie-root-port-0  \
    -nodefaults \
    -device VGA,bus=pcie.0,addr=0x2 \
    -m 4G \
    -object memory-backend-file,id=mem,size=4G,mem-path=/dev/shm,share=on \
    -numa node,memdev=mem \
    -chardev socket,id=char0,path=/tmp/vhostqemu \
    -device vhost-user-fs-pci,queue-size=1024,chardev=char0,tag=myfs \
    -smp 16,maxcpus=16,cores=8,threads=1,dies=1,sockets=2  \
    -cpu 'Haswell-noTSX',+kvm_pv_unhalt  \
    -chardev socket,path=/tmp/avocado_goh5qzsl/monitor-qmpmonitor1-20210630-142945-fM1LdhhS,wait=off,server=on,id=qmp_id_qmpmonitor1  \
    -mon chardev=qmp_id_qmpmonitor1,mode=control \
    -chardev socket,path=/tmp/avocado_goh5qzsl/monitor-catch_monitor-20210630-142945-fM1LdhhS,wait=off,server=on,id=qmp_id_catch_monitor  \
    -mon chardev=qmp_id_catch_monitor,mode=control \
    -device pvpanic,ioport=0x505,id=id4vwSWI \
    -chardev socket,path=/tmp/avocado_goh5qzsl/serial-serial0-20210630-142945-fM1LdhhS,wait=off,server=on,id=chardev_serial0 \
    -device isa-serial,id=serial0,chardev=chardev_serial0  \
    -chardev socket,id=seabioslog_id_20210630-142945-fM1LdhhS,path=/tmp/avocado_goh5qzsl/seabios-20210630-142945-fM1LdhhS,server=on,wait=off \
    -device isa-debugcon,chardev=seabioslog_id_20210630-142945-fM1LdhhS,iobase=0x402 \
    -device pcie-root-port,id=pcie-root-port-1,port=0x1,addr=0x1.0x1,bus=pcie.0,chassis=2 \
    -device qemu-xhci,id=usb1,bus=pcie-root-port-1,addr=0x0 \
    -device usb-tablet,id=usb-tablet1,bus=usb1.0,port=1 \
    -device pcie-root-port,id=pcie-root-port-4,port=0x4,addr=0x1.0x4,bus=pcie.0,chassis=5 \
    -device virtio-net-pci,mac=24:be:05:15:d1:62,id=net0,netdev=hostnet0,bus=pcie-root-port-4,addr=0x0  \
    -netdev tap,id=hostnet0,vhost=on \
    -device pcie-root-port,id=pcie-root-port-5,port=0x5,addr=0x1.0x5,bus=pcie.0,chassis=6 \
    -device virtio-scsi-pci,id=virtio_scsi_pci0,bus=pcie-root-port-5,addr=0x0 \
    -blockdev node-name=file_uefishell,driver=file,auto-read-only=on,discard=unmap,aio=threads,filename=/home/kvm_autotest_root/images/UefiShell.iso,cache.direct=on,cache.no-flush=off \
    -blockdev node-name=drive_uefishell,driver=raw,read-only=on,cache.direct=on,cache.no-flush=off,file=file_uefishell \
    -device scsi-cd,id=uefishell,drive=drive_uefishell,write-cache=on  \
    -vnc :0  \
    -monitor stdio \
    -boot menu=off,order=cdn,once=c,strict=off \
    -rtc base=utc,clock=host,driftfix=slew  \
    -debugcon file:/home/edk2_log \
    -global isa-debugcon.iobase=0x402 \
    -device pcie-root-port,id=pcie-root-port-6,port=0x6,addr=0x1.0x6,bus=pcie.0,chassis=7 \
    -device virtio-scsi-pci,id=virtio_scsi_pci1,bus=pcie-root-port-6,addr=0x0 \
    -blockdev node-name=image1,driver=file,auto-read-only=off,discard=unmap,aio=threads,filename=/home/kvm_autotest_root/images/rhel900-64-virtio-scsi.qcow2,cache.direct=on,cache.no-flush=off \
    -blockdev node-name=drive_image1,driver=qcow2,read-only=off,cache.direct=on,cache.no-flush=off,file=image1 \
    -device scsi-hd,id=image1,drive=drive_image1,write-cache=on  \

4. Log into guest then mount the file system 
# mount -t virtiofs myfs /mnt
 

After step 4, mount successfully.

The output:

# /usr/libexec/virtiofsd --socket-path=/tmp/vhostqemu -o source=$PWD/virtio-fs-root -o cache=none
virtio_session_mount: Waiting for vhost-user socket connection...
virtio_session_mount: Received vhost-user socket connection
virtio_loop: Entry
fv_queue_set_started: qidx=0 started=1
fv_queue_set_started: qidx=1 started=1
fv_queue_thread: Start for queue 0 kick_fd 9
fv_queue_thread: Start for queue 1 kick_fd 12


# mount -t virtiofs myfs /mnt
# ls /mnt	
bin   dev  home  lib64	mnt  proc  run	 srv  tmp  var
boot  etc  lib	 media	opt  root  sbin  sys  usr



Hi Xiaoling,

Could you help check the steps? I need to add "rootfstype=virtiofs"? If I was wrong, please correct me. Thanks.


Hi Philippe,

Could you please help double check whether virtiofs driver has been disabled? Thanks.

Comment 16 xiagao 2021-07-26 03:26:40 UTC
(In reply to Xueqiang Wei from comment #15)
> Thanks Zhenyu for the verification on aarch64. Many thanks.
> 
> 
> I Tested edk2 test loop(secure boot, uefi shell commands, https
> installation, pxe installation, iscsi boot and so on), no new bug found.
> 
> 
> Versions:
> kernel-5.13.0-0.rc7.51.el9.x86_64
> qemu-kvm-6.0.0-7.el9
> edk2-20210527gite1999b264f1f-3.el9
> 
> 
> 
> Bug 1967743 CLOSED DUPLICATE of bug 1967747, virtiofs driver should be
> disabled on edk2-20210527gite1999b264f1f-3.el9.  
> 
> But I tested it with the following steps, it still works. 
> 
> Steps:
> 1. Install a basic linux root file system as follows
> # mkdir virtio-fs-root
> # dnf --installroot=$PWD/virtio-fs-root --releasever=29 install
> system-release vim-minimal systemd passwd dnf rootfiles
> 
> 2. Run the virtiofsd daemon on host with the directory created above.
> # /usr/libexec/virtiofsd --socket-path=/tmp/vhostqemu -o
> source=$PWD/virtio-fs-root -o cache=none
> 
> 3. boot a rhel9 guest
> /usr/libexec/qemu-kvm \
>     -S  \
>     -name 'avocado-vt-vm1'  \
>     -sandbox on  \
>     -blockdev
> node-name=file_ovmf_code,driver=file,filename=/usr/share/OVMF/OVMF_CODE.
> secboot.fd,auto-read-only=on,discard=unmap \
>     -blockdev
> node-name=drive_ovmf_code,driver=raw,read-only=on,file=file_ovmf_code \
>     -blockdev
> node-name=file_ovmf_vars,driver=file,filename=/home/OVMF_VARS.fd,auto-read-
> only=on,discard=unmap \
>     -blockdev
> node-name=drive_ovmf_vars,driver=raw,read-only=off,file=file_ovmf_vars \
>     -machine q35,pflash0=drive_ovmf_code,pflash1=drive_ovmf_vars \
>     -device
> pcie-root-port,id=pcie-root-port-0,multifunction=on,bus=pcie.0,addr=0x1,
> chassis=1 \
>     -device
> pcie-pci-bridge,id=pcie-pci-bridge-0,addr=0x0,bus=pcie-root-port-0  \
>     -nodefaults \
>     -device VGA,bus=pcie.0,addr=0x2 \
>     -m 4G \
>     -object memory-backend-file,id=mem,size=4G,mem-path=/dev/shm,share=on \
>     -numa node,memdev=mem \
>     -chardev socket,id=char0,path=/tmp/vhostqemu \
>     -device vhost-user-fs-pci,queue-size=1024,chardev=char0,tag=myfs \
>     -smp 16,maxcpus=16,cores=8,threads=1,dies=1,sockets=2  \
>     -cpu 'Haswell-noTSX',+kvm_pv_unhalt  \
>     -chardev
> socket,path=/tmp/avocado_goh5qzsl/monitor-qmpmonitor1-20210630-142945-
> fM1LdhhS,wait=off,server=on,id=qmp_id_qmpmonitor1  \
>     -mon chardev=qmp_id_qmpmonitor1,mode=control \
>     -chardev
> socket,path=/tmp/avocado_goh5qzsl/monitor-catch_monitor-20210630-142945-
> fM1LdhhS,wait=off,server=on,id=qmp_id_catch_monitor  \
>     -mon chardev=qmp_id_catch_monitor,mode=control \
>     -device pvpanic,ioport=0x505,id=id4vwSWI \
>     -chardev
> socket,path=/tmp/avocado_goh5qzsl/serial-serial0-20210630-142945-fM1LdhhS,
> wait=off,server=on,id=chardev_serial0 \
>     -device isa-serial,id=serial0,chardev=chardev_serial0  \
>     -chardev
> socket,id=seabioslog_id_20210630-142945-fM1LdhhS,path=/tmp/avocado_goh5qzsl/
> seabios-20210630-142945-fM1LdhhS,server=on,wait=off \
>     -device
> isa-debugcon,chardev=seabioslog_id_20210630-142945-fM1LdhhS,iobase=0x402 \
>     -device
> pcie-root-port,id=pcie-root-port-1,port=0x1,addr=0x1.0x1,bus=pcie.0,
> chassis=2 \
>     -device qemu-xhci,id=usb1,bus=pcie-root-port-1,addr=0x0 \
>     -device usb-tablet,id=usb-tablet1,bus=usb1.0,port=1 \
>     -device
> pcie-root-port,id=pcie-root-port-4,port=0x4,addr=0x1.0x4,bus=pcie.0,
> chassis=5 \
>     -device
> virtio-net-pci,mac=24:be:05:15:d1:62,id=net0,netdev=hostnet0,bus=pcie-root-
> port-4,addr=0x0  \
>     -netdev tap,id=hostnet0,vhost=on \
>     -device
> pcie-root-port,id=pcie-root-port-5,port=0x5,addr=0x1.0x5,bus=pcie.0,
> chassis=6 \
>     -device
> virtio-scsi-pci,id=virtio_scsi_pci0,bus=pcie-root-port-5,addr=0x0 \
>     -blockdev
> node-name=file_uefishell,driver=file,auto-read-only=on,discard=unmap,
> aio=threads,filename=/home/kvm_autotest_root/images/UefiShell.iso,cache.
> direct=on,cache.no-flush=off \
>     -blockdev
> node-name=drive_uefishell,driver=raw,read-only=on,cache.direct=on,cache.no-
> flush=off,file=file_uefishell \
>     -device scsi-cd,id=uefishell,drive=drive_uefishell,write-cache=on  \
>     -vnc :0  \
>     -monitor stdio \
>     -boot menu=off,order=cdn,once=c,strict=off \
>     -rtc base=utc,clock=host,driftfix=slew  \
>     -debugcon file:/home/edk2_log \
>     -global isa-debugcon.iobase=0x402 \
>     -device
> pcie-root-port,id=pcie-root-port-6,port=0x6,addr=0x1.0x6,bus=pcie.0,
> chassis=7 \
>     -device
> virtio-scsi-pci,id=virtio_scsi_pci1,bus=pcie-root-port-6,addr=0x0 \
>     -blockdev
> node-name=image1,driver=file,auto-read-only=off,discard=unmap,aio=threads,
> filename=/home/kvm_autotest_root/images/rhel900-64-virtio-scsi.qcow2,cache.
> direct=on,cache.no-flush=off \
>     -blockdev
> node-name=drive_image1,driver=qcow2,read-only=off,cache.direct=on,cache.no-
> flush=off,file=image1 \
>     -device scsi-hd,id=image1,drive=drive_image1,write-cache=on  \
> 
> 4. Log into guest then mount the file system 
> # mount -t virtiofs myfs /mnt
>  
> 
> After step 4, mount successfully.
> 
> The output:
> 
> # /usr/libexec/virtiofsd --socket-path=/tmp/vhostqemu -o
> source=$PWD/virtio-fs-root -o cache=none
> virtio_session_mount: Waiting for vhost-user socket connection...
> virtio_session_mount: Received vhost-user socket connection
> virtio_loop: Entry
> fv_queue_set_started: qidx=0 started=1
> fv_queue_set_started: qidx=1 started=1
> fv_queue_thread: Start for queue 0 kick_fd 9
> fv_queue_thread: Start for queue 1 kick_fd 12
> 
> 
> # mount -t virtiofs myfs /mnt
> # ls /mnt	
> bin   dev  home  lib64	mnt  proc  run	 srv  tmp  var
> boot  etc  lib	 media	opt  root  sbin  sys  usr
> 
> 
> 
> Hi Xiaoling,
> 
> Could you help check the steps? I need to add "rootfstype=virtiofs"? If I
> was wrong, please correct me. Thanks.

The steps are right as you can mount with virtiofs.

Btw, there is no need to create rootfs with the following cmd, just making a shared dir is enough.
 # dnf --installroot=$PWD/virtio-fs-root --releasever=29 install
 system-release vim-minimal systemd passwd dnf rootfiles

> 
> 
> Hi Philippe,
> 
> Could you please help double check whether virtiofs driver has been
> disabled? Thanks.

Comment 17 Xueqiang Wei 2021-07-26 09:23:13 UTC
> > Hi Xiaoling,
> > 
> > Could you help check the steps? I need to add "rootfstype=virtiofs"? If I
> > was wrong, please correct me. Thanks.
> 
> The steps are right as you can mount with virtiofs.
> 
> Btw, there is no need to create rootfs with the following cmd, just making a
> shared dir is enough.
>  # dnf --installroot=$PWD/virtio-fs-root --releasever=29 install
>  system-release vim-minimal systemd passwd dnf rootfiles
> 

Discussed the test steps with Xiaoliang and XuHan, Tested with the following steps, the test works as expected. Thank you Xiaoling and Xuhan.


Since Bug 1741615 has been fixed, I tested it, edk2-20210527gite1999b264f1f-1.el8 supports virtio-fs.
(Bug 1741615 - virtio-fs: host<->guest shared file system (edk2/OVMF - TechPreview))

Steps:
1. Install a basic linux  root file system as follows
# mkdir virtio-fs-root
# dnf --installroot=$PWD/virtio-fs-root --releasever=8 install system-release vim-minimal systemd passwd dnf rootfiles

2. Run the virtiofsd daemon on host with the directory created above.
# /usr/libexec/virtiofsd --socket-path=/tmp/vhostqemu -o source=$PWD/virtio-fs-root -o cache=auto

3. boot a guest from shared directory and add bootindex for vhost-user-fs-pci device.
/usr/libexec/qemu-kvm \
    -S  \
    -name 'avocado-vt-vm1'  \
    -sandbox on  \
    -blockdev node-name=file_ovmf_code,driver=file,filename=/usr/share/OVMF/OVMF_CODE.secboot.fd,auto-read-only=on,discard=unmap \
    -blockdev node-name=drive_ovmf_code,driver=raw,read-only=on,file=file_ovmf_code \
    -blockdev node-name=file_ovmf_vars,driver=file,filename=/home/OVMF_VARS.fd,auto-read-only=on,discard=unmap \
    -blockdev node-name=drive_ovmf_vars,driver=raw,read-only=off,file=file_ovmf_vars \
    -machine q35,pflash0=drive_ovmf_code,pflash1=drive_ovmf_vars \
    -device pcie-root-port,id=pcie-root-port-0,multifunction=on,bus=pcie.0,addr=0x1,chassis=1 \
    -device pcie-pci-bridge,id=pcie-pci-bridge-0,addr=0x0,bus=pcie-root-port-0  \
    -nodefaults \
    -device VGA,bus=pcie.0,addr=0x2 \
    -m 4G \
    -object memory-backend-file,id=mem,size=4G,mem-path=/dev/shm,share=on \
    -numa node,memdev=mem \
    -device pcie-root-port,id=pcie-root-port-8,port=0x17,addr=0x1.0x7,bus=pcie.0,chassis=8 \
    -chardev socket,id=char0,path=/tmp/vhostqemu \
    -device vhost-user-fs-pci,queue-size=1024,chardev=char0,tag=myfs,bootindex=0,bus=pcie-root-port-8 \
    -smp 16,maxcpus=16,cores=8,threads=1,dies=1,sockets=2  \
    -cpu 'host',+kvm_pv_unhalt  \
    -chardev socket,path=/tmp/avocado_goh5qzsl/monitor-qmpmonitor1-20210630-142945-fM1LdhhS,wait=off,server=on,id=qmp_id_qmpmonitor1  \
    -mon chardev=qmp_id_qmpmonitor1,mode=control \
    -chardev socket,path=/tmp/avocado_goh5qzsl/monitor-catch_monitor-20210630-142945-fM1LdhhS,wait=off,server=on,id=qmp_id_catch_monitor  \
    -mon chardev=qmp_id_catch_monitor,mode=control \
    -device pvpanic,ioport=0x505,id=id4vwSWI \
    -chardev socket,path=/tmp/avocado_snlh6ljp/serial-serial0-20210713-061255-Twij90r8,server=on,id=chardev_serial0,wait=off \
    -device isa-serial,id=serial0,chardev=chardev_serial0  \
    -chardev socket,id=seabioslog_id_20210630-142945-fM1LdhhS,path=/tmp/avocado_goh5qzsl/seabios-20210630-142945-fM1LdhhS,server=on,wait=off \
    -device isa-debugcon,chardev=seabioslog_id_20210630-142945-fM1LdhhS,iobase=0x402 \
    -device pcie-root-port,id=pcie-root-port-1,port=0x1,addr=0x1.0x1,bus=pcie.0,chassis=2 \
    -device qemu-xhci,id=usb1,bus=pcie-root-port-1,addr=0x0 \
    -device usb-tablet,id=usb-tablet1,bus=usb1.0,port=1 \
    -device pcie-root-port,id=pcie-root-port-4,port=0x4,addr=0x1.0x4,bus=pcie.0,chassis=5 \
    -device virtio-net-pci,mac=24:be:05:15:d1:62,id=net0,netdev=hostnet0,bus=pcie-root-port-4,addr=0x0  \
    -netdev tap,id=hostnet0,vhost=on \
    -device pcie-root-port,id=pcie-root-port-5,port=0x5,addr=0x1.0x5,bus=pcie.0,chassis=6 \
    -device virtio-scsi-pci,id=virtio_scsi_pci0,bus=pcie-root-port-5,addr=0x0 \
    -blockdev node-name=file_uefishell,driver=file,auto-read-only=on,discard=unmap,aio=threads,filename=/usr/share/OVMF/UefiShell.iso,cache.direct=on,cache.no-flush=off \
    -blockdev node-name=drive_uefishell,driver=raw,read-only=on,cache.direct=on,cache.no-flush=off,file=file_uefishell \
    -device scsi-cd,id=uefishell,drive=drive_uefishell,write-cache=on  \
    -vnc :0  \
    -monitor stdio \
    -boot menu=off,order=cdn,once=c,strict=off \
    -rtc base=utc,clock=host,driftfix=slew  \
    -debugcon file:/home/edk2_log \
    -global isa-debugcon.iobase=0x402 \
   
4. check device manager from uefi
During booting up, press 'Esc' button, select boot manager.
Can get virtio-fs device in boot manager, name is "UEFI None-Block Boot Device".

5. access to the UEFI shell from UefiShell.iso
boot manager -> select UEFI QEMU DVD-ROM ....
in the UEFI shell, verify with the "MAP" command that an FSx
shell > map -v
shell > fs1:
FX1:\> ls

Get the shared directory via ls command successfully. And change the child dir via cd command successfully.




Tested on edk2-20210527gite1999b264f1f-3.el9 with the same steps:

After step 4, Can not get virtio-fs device in boot manager, so edk2 has disabled virtiofs driver.



Hi Philippe,

Could you please help double check the test steps? If I was wrong, please correct me. Many thanks.

Comment 18 Xueqiang Wei 2021-07-28 18:27:12 UTC
According to Comment 14, Comment 15 and Comment 17, no new bug found, set the status to VERIFIED. 
And I will keep tracking the action item "edk2: disable nvme driver" and "edk2: disable virtio-fs driver". If hit any issue, I will report a new bug. Thanks.

Comment 19 Philippe Mathieu-Daudé 2021-07-28 18:49:39 UTC
(In reply to Xueqiang Wei from comment #17)
> Discussed the test steps with Xiaoliang and XuHan, Tested with the following
> steps, the test works as expected. Thank you Xiaoling and Xuhan.
...

> Hi Philippe,
> 
> Could you please help double check the test steps? If I was wrong, please
> correct me. Many thanks.

To the best of my knowledge this looks OK, thanks!


Note You need to log in before you can comment on or make changes to this bug.