How to pass DMAR information with virt-install utility

Asked by IndrasenaReddy Gali

Hi,
   I am trying pass DMAR formation with virt-install --qemu-commandline option.
Below is my command.
virt-install --connect qemu:///system --name <machine_name> \
 --ram=4096 --vcpus 1 --noautoconsole \
 --disk path=<img_path> \
 --network network=<network_name> \
 --mac=52:54:BE:EF:64:04 --graphics vnc,listen=0.0.0.0 \
 --qemu-commandline='-machine q35,accel=kvm,kernel-irqchip=split -device intel-iommu,intremap=on,caching-mode=on,aw-bits=48 -device ioh3420,id=pcie.1,chassis=1 -device virtio-net-pci,bus=pcie.1,disable-legacy=on,disable-modern=off,iommu_platform=on,ats=on,netdev=net0'
 --import

Below is the error I am observing :
ERROR internal error: qemu unexpectedly closed the monitor: 2019-12-02T11:54:43.125911Z qemu-system-x86_64: -device ich9-usb-ehci1,id=usb,bus=pci.0,addr=0x4.0x7: Bus 'pci.0' not found

With qemu-system-x86_64 I can able to lunch VM without any issue with DMAR enabled properly:

qemu-system-x86_64 -name guest=fedora24 -machine q35,accel=kvm,kernel-irqchip=split \
        -enable-kvm \
        -m 8G \
        -smp 8,sockets=1,cores=8,threads=1 \
        -device intel-iommu,intremap=on,caching-mode=on,aw-bits=48 \
        -drive file=/root/OsImages/ixa00385352_002.img,format=raw \
        -device ioh3420,id=pcie.1,chassis=1 \
        -device virtio-net-pci,bus=pcie.1,disable-legacy=on,disable-modern=off,iommu_platform=on,ats=on,netdev=net0 \
        -netdev user,id=net0,hostfwd=tcp::1111-:22 \
  -nographic

Success Log:
[ 0.015543] ACPI: DMAR 0x000000007FFE2361 000048 (v01 BOCHS BXPCDMAR 00000001 BXPC 00000001)
[ 0.079601] DMAR: IOMMU enabled
[ 0.398082] DMAR: Host address width 48
[ 0.399273] DMAR: DRHD base: 0x000000fed90000 flags: 0x1
[ 0.400764] DMAR: dmar0: reg_base_addr fed90000 ver 1:0 cap d2008c222f0686 ecap f00f5a
[ 0.402936] DMAR-IR: IOAPIC id 0 under DRHD base 0xfed90000 IOMMU 0
[ 0.404580] DMAR-IR: Queued invalidation will be enabled to support x2apic and Intr-remapping.
[ 0.408761] DMAR-IR: Enabled IRQ remapping in x2apic mode
[ 1.543582] DMAR: No RMRR found
[ 1.544548] DMAR: No ATSR found
[ 1.545568] DMAR: dmar0: Using Queued invalidation
[ 1.547154] pci 0000:00:00.0: DMAR: Hardware identity mapping
[ 1.548762] pci 0000:00:01.0: DMAR: Hardware identity mapping
[ 1.550363] pci 0000:00:02.0: DMAR: Hardware identity mapping
[ 1.551963] pci 0000:00:1f.0: DMAR: Hardware identity mapping
[ 1.553567] pci 0000:00:1f.2: DMAR: Hardware identity mapping
[ 1.555174] pci 0000:00:1f.3: DMAR: Hardware identity mapping
[ 1.556780] pci 0000:01:00.0: DMAR: Hardware identity mapping
[ 1.558212] DMAR: Setting RMRR:
[ 1.559168] DMAR: Prepare 0-16MiB unity mapping for LPC
[ 1.560535] pci 0000:00:1f.0: DMAR: Ignoring identity map for HW passthrough [0x0 - 0xffffff]
[ 1.562641] DMAR: Intel(R) Virtualization Technology for Directed I/O

Could you please let me know how can I enable above qemu-system_x86_64 options with virt-install with all DMAR enabled options with Host address width 48.

Question information

Language:
English Edit question
Status:
Solved
For:
Ubuntu libvirt Edit question
Assignee:
No assignee Edit question
Solved by:
IndrasenaReddy Gali
Solved:
Last query:
Last reply:
Revision history for this message
IndrasenaReddy Gali (gisena) said :
#1

In a simple words how can i pass below qemu-commandline parameters with virt-install.

qemu-system-x86_64 -name guest=fedora24 -machine q35,accel=kvm,kernel-irqchip=split \
        -enable-kvm \
        -m 4G \
        -smp 8,sockets=1,cores=8,threads=1 \
        -device intel-iommu,intremap=on,caching-mode=on,aw-bits=48 \
        -drive file=/root/OsImages/ixa00385352_002_1.img,format=raw \
        -device ioh3420,id=pcie.1,chassis=1 \
        -device virtio-net-pci,bus=pcie.1,disable-legacy=on,disable-modern=off,iommu_platform=on,ats=on,netdev=net0 \
        -netdev user,id=net0,hostfwd=tcp::6001-:6000\
        -device vfio-pci,host=3d:02.4 \
  -device vfio-pci,host=3d:02.5 \
  -device vfio-pci,host=3d:02.6 \
        -nographi

Revision history for this message
IndrasenaReddy Gali (gisena) said :
#2

In a simple words how can i pass below qemu-commandline parameters with virt-install.

qemu-system-x86_64 -name guest=fedora24 -machine q35,accel=kvm,kernel-irqchip=split \
        -enable-kvm \
        -m 4G \
        -smp 8,sockets=1,cores=8,threads=1 \
        -device intel-iommu,intremap=on,caching-mode=on,aw-bits=48 \
        -drive file=/root/OsImages/ixa00385352_002_1.img,format=raw \
        -device ioh3420,id=pcie.1,chassis=1 \
        -device virtio-net-pci,bus=pcie.1,disable-legacy=on,disable-modern=off,iommu_platform=on,ats=on,netdev=net0 \
        -netdev user,id=net0,hostfwd=tcp::6001-:6000\
        -device vfio-pci,host=3d:02.4 \
  -device vfio-pci,host=3d:02.5 \
  -device vfio-pci,host=3d:02.6 \
        -nographi

Revision history for this message
actionparsnip (andrew-woodhead666) said :
#3

Great share. Hopefully this will help others

Revision history for this message
Ravi C (ravikiran242) said :
#4

where is the answer?