diff options
-rw-r--r-- | doc/book-enea-nfv-access-guide/doc/hypervisor_virtualization.xml | 229 |
1 files changed, 124 insertions, 105 deletions
diff --git a/doc/book-enea-nfv-access-guide/doc/hypervisor_virtualization.xml b/doc/book-enea-nfv-access-guide/doc/hypervisor_virtualization.xml index 9733544..76a2568 100644 --- a/doc/book-enea-nfv-access-guide/doc/hypervisor_virtualization.xml +++ b/doc/book-enea-nfv-access-guide/doc/hypervisor_virtualization.xml | |||
@@ -18,23 +18,23 @@ | |||
18 | 18 | ||
19 | <para>QEMU can make use of KVM when running a target architecture that is | 19 | <para>QEMU can make use of KVM when running a target architecture that is |
20 | the same as the host architecture. For instance, when running | 20 | the same as the host architecture. For instance, when running |
21 | qemu-system-x86_64 on an x86-64 compatible processor (containing | 21 | qemu-system-aarch64 on an aarch64 compatible processor (containing |
22 | virtualization extensions Intel VT or AMD-V), you can take advantage of | 22 | virtualization extensions AMD-V or Intel VT), you can take advantage of |
23 | the KVM acceleration, giving you benefit for your host and your guest | 23 | the KVM acceleration, giving you benefit for your host and your guest |
24 | system.</para> | 24 | system.</para> |
25 | 25 | ||
26 | <para>Enea NFV Access includes an optimizied version of QEMU with KVM-only | 26 | <para>Enea NFV Access includes an optimized version of QEMU with KVM-only |
27 | support. To use KVM pass<command> --enable-kvm</command> to QEMU.</para> | 27 | support. To use KVM pass<command> --enable-kvm</command> to QEMU.</para> |
28 | 28 | ||
29 | <para>The following is an example of starting a guest:</para> | 29 | <para>The following is an example of starting a guest:</para> |
30 | 30 | ||
31 | <programlisting>taskset -c 0,1 qemu-system-x86_64 \ | 31 | <programlisting>taskset -c 0,1 qemu-system-aarch64 \ |
32 | -cpu host -M q35 -smp cores=2,sockets=1 \ | 32 | -cpu host -machine virt,gic_version=3 -smp cores=2,sockets=1 \ |
33 | -vcpu 0,affinity=0 -vcpu 1,affinity=1 \ | 33 | -vcpu 0,affinity=0 -vcpu 1,affinity=1 \ |
34 | -enable-kvm -nographic \ | 34 | -enable-kvm -nographic \ |
35 | -kernel bzImage \ | 35 | -kernel Image \ |
36 | -drive file=enea-nfv-access-guest-qemux86-64.ext4,if=virtio,format=raw \ | 36 | -drive file=enea-nfv-access-guest-qemuarm64.ext4,if=virtio,format=raw \ |
37 | -append 'root=/dev/vda console=ttyS0,115200' \ | 37 | -append 'root=/dev/vda console=ttyAMA0,115200' \ |
38 | -m 4096 \ | 38 | -m 4096 \ |
39 | -object memory-backend-file,id=mem,size=4096M,mem-path=/dev/hugepages,share=on \ | 39 | -object memory-backend-file,id=mem,size=4096M,mem-path=/dev/hugepages,share=on \ |
40 | -numa node,memdev=mem -mem-prealloc</programlisting> | 40 | -numa node,memdev=mem -mem-prealloc</programlisting> |
@@ -97,9 +97,7 @@ | |||
97 | 97 | ||
98 | <para>If the hardware does not have an IOMMU (known as "Intel VT-d" on | 98 | <para>If the hardware does not have an IOMMU (known as "Intel VT-d" on |
99 | Intel-based machines and "AMD I/O Virtualization Technology" on AMD-based | 99 | Intel-based machines and "AMD I/O Virtualization Technology" on AMD-based |
100 | machines), it will not be possible to assign devices in KVM. | 100 | machines), it will not be possible to assign devices in KVM. </para> |
101 | Virtualization Technology features (VT-d, VT-x, etc.) must be enabled from | ||
102 | BIOS on the host target before starting a virtual machine.</para> | ||
103 | </section> | 101 | </section> |
104 | 102 | ||
105 | <section id="net_in_guest"> | 103 | <section id="net_in_guest"> |
@@ -156,19 +154,10 @@ | |||
156 | to appear and behave as if they were physically attached to the guest | 154 | to appear and behave as if they were physically attached to the guest |
157 | operating system.</para> | 155 | operating system.</para> |
158 | 156 | ||
159 | <para>Preparing an Intel system for PCI passthrough:</para> | 157 | <para>Preparing a system for PCI passthrough:</para> |
160 | 158 | ||
161 | <itemizedlist> | 159 | <itemizedlist> |
162 | <listitem> | 160 | <listitem> |
163 | <para>Enable the Intel VT-d extensions in BIOS</para> | ||
164 | </listitem> | ||
165 | |||
166 | <listitem> | ||
167 | <para>Activate Intel VT-d in the kernel by using | ||
168 | <literal>intel_iommu=on</literal> as a kernel boot parameter</para> | ||
169 | </listitem> | ||
170 | |||
171 | <listitem> | ||
172 | <para>Allow unsafe interrupts in case the system doesn't support | 161 | <para>Allow unsafe interrupts in case the system doesn't support |
173 | interrupt remapping. This can be done using | 162 | interrupt remapping. This can be done using |
174 | <literal>vfio_iommu_type1.allow_unsafe_interrupts=1</literal> as a | 163 | <literal>vfio_iommu_type1.allow_unsafe_interrupts=1</literal> as a |
@@ -179,15 +168,17 @@ | |||
179 | <para>Create guest with direct passthrough via VFIO framework like | 168 | <para>Create guest with direct passthrough via VFIO framework like |
180 | so:</para> | 169 | so:</para> |
181 | 170 | ||
182 | <programlisting>-device vfio-pci,host=0000:03:10.2 \</programlisting> | 171 | <programlisting>-device vfio-pci,host=0001:01:00.1 \</programlisting> |
172 | |||
173 | <para>On the host, there are Virtual Functions for each physical | ||
174 | Ethernet port. The primary VF has to be used for a guest network to | ||
175 | access, before starting QEMU:</para> | ||
183 | 176 | ||
184 | <para>On the host, one or more VirtualFunctions (VFs) must be created in | 177 | <programlisting>$ modprobe vfio_pci |
185 | order to be allocated for a guest network to access, before starting | 178 | $ dpdk-devbind.py --bind=vfio-pci 0001:01:00.1</programlisting> |
186 | QEMU:</para> | ||
187 | 179 | ||
188 | <programlisting>$ echo 2 > /sys/class/net/eno3/device/sriov_numvfs | 180 | <para>For more details related to Virtual Functions, see: <ulink |
189 | $ modprobe vfio_pci | 181 | url="http://dpdk.org/doc/guides/nics/thunderx.html">http://dpdk.org/doc/guides/nics/thunderx.html</ulink>.</para> |
190 | $ dpdk-devbind.py --bind=vfio-pci 0000:03:10.2</programlisting> | ||
191 | </section> | 182 | </section> |
192 | 183 | ||
193 | <section id="multiqueue"> | 184 | <section id="multiqueue"> |
@@ -215,7 +206,7 @@ where vectors is calculated as: 2 + 2 * queues number.</programlisting> | |||
215 | DPDK Virtio PMD | 206 | DPDK Virtio PMD |
216 | $ testpmd -c 0x7 -- -i --rxq=2 --txq=2 --nb-cores=2 ...</programlisting> | 207 | $ testpmd -c 0x7 -- -i --rxq=2 --txq=2 --nb-cores=2 ...</programlisting> |
217 | 208 | ||
218 | <para>For QEMU documentation please see: <ulink | 209 | <para>For QEMU documentation, see: <ulink |
219 | url="https://qemu.weilnetz.de/doc/qemu-doc.html">https://qemu.weilnetz.de/doc/qemu-doc.html</ulink>.</para> | 210 | url="https://qemu.weilnetz.de/doc/qemu-doc.html">https://qemu.weilnetz.de/doc/qemu-doc.html</ulink>.</para> |
220 | </section> | 211 | </section> |
221 | </section> | 212 | </section> |
@@ -340,12 +331,12 @@ $ testpmd -c 0x7 -- -i --rxq=2 --txq=2 --nb-cores=2 ...</programlisting> | |||
340 | following example:</para> | 331 | following example:</para> |
341 | 332 | ||
342 | <programlisting><os> | 333 | <programlisting><os> |
343 | <kernel>bzImage</kernel> | 334 | <kernel>Image</kernel> |
344 | </os> | 335 | </os> |
345 | <devices> | 336 | <devices> |
346 | <disk type='file' device='disk'> | 337 | <disk type='file' device='disk'> |
347 | <driver name='qemu' type='raw' cache='none'/> | 338 | <driver name='qemu' type='raw' cache='none'/> |
348 | <source file='enea-nfv-access-guest-qemux86-64.ext4'/> | 339 | <source file='enea-nfv-access-guest-qemuarm64.ext4'/> |
349 | <target dev='vda' bus='virtio'/> | 340 | <target dev='vda' bus='virtio'/> |
350 | </disk> | 341 | </disk> |
351 | </devices></programlisting> | 342 | </devices></programlisting> |
@@ -356,7 +347,7 @@ $ testpmd -c 0x7 -- -i --rxq=2 --txq=2 --nb-cores=2 ...</programlisting> | |||
356 | 347 | ||
357 | <para>Command <command>virsh create</command> starts a guest:</para> | 348 | <para>Command <command>virsh create</command> starts a guest:</para> |
358 | 349 | ||
359 | <programlisting>virsh create example-guest-x86.xml</programlisting> | 350 | <programlisting>virsh create example-guest-arm.xml</programlisting> |
360 | 351 | ||
361 | <para>If further configurations are needed before the guest is reachable | 352 | <para>If further configurations are needed before the guest is reachable |
362 | through <literal>ssh</literal>, a console can be started using command | 353 | through <literal>ssh</literal>, a console can be started using command |
@@ -370,7 +361,7 @@ $ testpmd -c 0x7 -- -i --rxq=2 --txq=2 --nb-cores=2 ...</programlisting> | |||
370 | the guest XML file:</para> | 361 | the guest XML file:</para> |
371 | 362 | ||
372 | <programlisting><os> | 363 | <programlisting><os> |
373 | <cmdline>console=ttyS0,115200</cmdline> | 364 | <cmdline>console=ttyAMA0,115200</cmdline> |
374 | </os> | 365 | </os> |
375 | <devices> | 366 | <devices> |
376 | <console type='pty'> | 367 | <console type='pty'> |
@@ -477,14 +468,14 @@ $ testpmd -c 0x7 -- -i --rxq=2 --txq=2 --nb-cores=2 ...</programlisting> | |||
477 | now, only bridged networks are supported (those where the user has | 468 | now, only bridged networks are supported (those where the user has |
478 | to manually create the bridge).</para> | 469 | to manually create the bridge).</para> |
479 | 470 | ||
480 | <programlisting> <interface type='vhostuser'> | 471 | <programlisting> <qemu:commandline> |
481 | <mac address='00:00:00:00:00:01'/> | 472 | <qemu:arg value='-chardev'/> |
482 | <source type='unix' path='/var/run/openvswitch/vhost-user1' mode='client'/> | 473 | <qemu:arg value='socket,id=charnet0,path=/var/run/openvswitch/vhost-user1'/> |
483 | <model type='virtio'/> | 474 | <qemu:arg value='-netdev'/> |
484 | <driver queues='1'> | 475 | <qemu:arg value='type=vhost-user,id=hostnet0,chardev=charnet0'/> |
485 | <host mrg_rxbuf='off'/> | 476 | <qemu:arg value='-device'/> |
486 | </driver> | 477 | <qemu:arg value='virtio-net-pci,netdev=hostnet0,id=net0,mac=00:00:00:00:00:01,bus=pcie.0,addr=0x2'/> |
487 | </interface></programlisting> | 478 | </qemu:commandline></programlisting> |
488 | </listitem> | 479 | </listitem> |
489 | 480 | ||
490 | <listitem> | 481 | <listitem> |
@@ -497,40 +488,68 @@ $ testpmd -c 0x7 -- -i --rxq=2 --txq=2 --nb-cores=2 ...</programlisting> | |||
497 | PCI devices to appear and behave as if they were physically attached | 488 | PCI devices to appear and behave as if they were physically attached |
498 | to the guest operating system.</para> | 489 | to the guest operating system.</para> |
499 | 490 | ||
500 | <para>Preparing an Intel system for PCI passthrough is done like | 491 | <para>Preparing a system for PCI passthrough is done like so:</para> |
501 | so:</para> | ||
502 | 492 | ||
503 | <itemizedlist> | 493 | <itemizedlist> |
504 | <listitem> | 494 | <listitem> |
505 | <para>Enable the Intel VT-d extensions in BIOS</para> | 495 | <para>Allow unsafe interrupts in case the system doesn't support |
496 | interrupt remapping. This can be done using | ||
497 | <literal>vfio_iommu_type1.allow_unsafe_interrupts=1</literal> as | ||
498 | a boot kernel parameter.</para> | ||
506 | </listitem> | 499 | </listitem> |
507 | 500 | ||
508 | <listitem> | 501 | <listitem> |
509 | <para>Activate Intel VT-d in the kernel by using | 502 | <para>Change the owner of the |
510 | <literal>intel_iommu=on</literal> as a kernel boot | 503 | <literal>/dev/vfio/<group></literal> to qemu and edit |
511 | parameter</para> | 504 | <literal>/etc/libvirt/qemu.conf</literal> to explicitly allow |
505 | permission to it:</para> | ||
506 | |||
507 | <para><programlisting>$ chown qemu:qemu /dev/vfio/66 | ||
508 | $ ls -l /dev/vfio/66 | ||
509 | crw------- 1 qemu qemu 244, 0 Dec 4 08:24 /dev/vfio/66 | ||
510 | |||
511 | $ cat /etc/libvirt/qemu.conf | ||
512 | ... | ||
513 | cgroup_device_acl = [ | ||
514 | "/dev/null", "/dev/full", "/dev/zero", | ||
515 | "/dev/random", "/dev/urandom", | ||
516 | "/dev/ptmx", "/dev/kvm", "/dev/kqemu", | ||
517 | "/dev/rtc","/dev/hpet", "/dev/vfio/vfio", | ||
518 | <command>"/dev/vfio/66"</command>, | ||
519 | ] | ||
520 | ...</programlisting></para> | ||
512 | </listitem> | 521 | </listitem> |
513 | 522 | ||
514 | <listitem> | 523 | <listitem> |
515 | <para>Allow unsafe interrupts in case the system doesn't support | 524 | <para>Increase the locked memory limits within the libvirtd |
516 | interrupt remapping. This can be done using | 525 | service file :</para> |
517 | <literal>vfio_iommu_type1.allow_unsafe_interrupts=1</literal> as | 526 | |
518 | a boot kernel parameter.</para> | 527 | <para><programlisting>$ cat /lib/systemd/system/libvirtd.service |
528 | ... | ||
529 | [Service] | ||
530 | Type=forking | ||
531 | PIDFile=/var/run/libvirtd.pid | ||
532 | EnvironmentFile=-/etc/sysconfig/libvirtd | ||
533 | <command>LimitMEMLOCK=infinity</command> | ||
534 | ExecStart=/usr/sbin/libvirtd $LIBVIRTD_ARGS | ||
535 | ExecReload=/bin/kill -HUP $MAINPID | ||
536 | KillMode=process | ||
537 | Restart=on-failure | ||
538 | # Override the maximum number of opened files | ||
539 | #LimitNOFILE=2048 | ||
540 | ...</programlisting></para> | ||
519 | </listitem> | 541 | </listitem> |
520 | </itemizedlist> | 542 | </itemizedlist> |
521 | 543 | ||
522 | <para>VFs must be created on the host before starting the | 544 | <para>VFs must be created on the host before starting the |
523 | guest:</para> | 545 | guest:</para> |
524 | 546 | ||
525 | <programlisting>$ echo 2 > /sys/class/net/eno3/device/sriov_numvfs | 547 | <programlisting>$ modprobe vfio_pci |
526 | $ modprobe vfio_pci | 548 | $ dpdk-devbind.py --bind=vfio-pci 0001:01:00.1 |
527 | $ dpdk-devbind.py --bind=vfio-pci 0000:03:10.0 | 549 | <qemu:commandline> |
528 | <interface type='hostdev' managed='yes'> | 550 | <qemu:arg value='-device'/> |
529 | <source> | 551 | <qemu:arg value='vfio-pci,host=0001:01:00.1'/> |
530 | <address type='pci' domain='0x0' bus='0x03' slot='0x10' function='0x0'/> | 552 | </qemu:commandline></programlisting> |
531 | </source> | ||
532 | <mac address='52:54:00:6d:90:02'/> | ||
533 | </interface></programlisting> | ||
534 | </listitem> | 553 | </listitem> |
535 | 554 | ||
536 | <listitem> | 555 | <listitem> |
@@ -542,8 +561,8 @@ $ dpdk-devbind.py --bind=vfio-pci 0000:03:10.0 | |||
542 | <programlisting> <interface type='bridge'> | 561 | <programlisting> <interface type='bridge'> |
543 | <mac address='52:54:00:71:b1:b6'/> | 562 | <mac address='52:54:00:71:b1:b6'/> |
544 | <source bridge='ovsbr0'/> | 563 | <source bridge='ovsbr0'/> |
564 | <model type='rtl8139'/> | ||
545 | <virtualport type='openvswitch'/> | 565 | <virtualport type='openvswitch'/> |
546 | <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/> | ||
547 | </interface></programlisting> | 566 | </interface></programlisting> |
548 | 567 | ||
549 | <para>For further details on the network XML format, see <ulink | 568 | <para>For further details on the network XML format, see <ulink |
@@ -558,58 +577,48 @@ $ dpdk-devbind.py --bind=vfio-pci 0000:03:10.0 | |||
558 | <section id="guest-config-vhost-user-interface"> | 577 | <section id="guest-config-vhost-user-interface"> |
559 | <title>Guest configuration with vhost-user interface</title> | 578 | <title>Guest configuration with vhost-user interface</title> |
560 | 579 | ||
561 | <programlisting><domain type='kvm'> | 580 | <programlisting><domain type='kvm' xmlns:qemu='http://libvirt.org/schemas/domain/qemu/1.0'> |
562 | <name>vm_vhost</name> | 581 | <name>vm_vhost</name> |
563 | <uuid>4a9b3f53-fa2a-47f3-a757-dd87720d9d1d</uuid> | 582 | <uuid>ed204646-1ad5-11e7-93ae-92361f002671</uuid> |
564 | <memory unit='KiB'>4194304</memory> | 583 | <memory unit='KiB'>4194304</memory> |
565 | <currentMemory unit='KiB'>4194304</currentMemory> | 584 | <currentMemory unit='KiB'>4194304</currentMemory> |
566 | <memoryBacking> | 585 | <memoryBacking> |
567 | <hugepages> | 586 | <hugepages> |
568 | <page size='1' unit='G' nodeset='0'/> | 587 | <page size='512' unit='M' nodeset='0'/> |
569 | </hugepages> | 588 | </hugepages> |
570 | </memoryBacking> | 589 | </memoryBacking> |
571 | <vcpu placement='static'>2</vcpu> | ||
572 | <cputune> | ||
573 | <shares>4096</shares> | ||
574 | <vcpupin vcpu='0' cpuset='4'/> | ||
575 | <vcpupin vcpu='1' cpuset='5'/> | ||
576 | <emulatorpin cpuset='4,5'/> | ||
577 | </cputune> | ||
578 | <os> | 590 | <os> |
579 | <type arch='x86_64' machine='pc'>hvm</type> | 591 | <type arch='aarch64' machine='virt,gic_version=3'>hvm</type> |
580 | <kernel>/mnt/qemu/bzImage</kernel> | 592 | <kernel>/mnt/qemu/Image</kernel> |
581 | <cmdline>root=/dev/vda console=ttyS0,115200</cmdline> | 593 | <cmdline>root=/dev/vda console=ttyAMA0,115200n8</cmdline> |
582 | <boot dev='hd'/> | 594 | <boot dev='hd'/> |
583 | </os> | 595 | </os> |
584 | <features> | 596 | <features> |
585 | <acpi/> | 597 | <acpi/> |
586 | <apic/> | 598 | <apic/> |
587 | </features> | 599 | </features> |
600 | <vcpu placement='static'>2</vcpu> | ||
588 | <cpu mode='host-model'> | 601 | <cpu mode='host-model'> |
589 | <model fallback='allow'/> | 602 | <model fallback='allow'/> |
590 | <topology sockets='2' cores='1' threads='1'/> | 603 | <topology sockets='1' cores='2' threads='1'/> |
591 | <numa> | 604 | <numa> |
592 | <cell id='0' cpus='0-1' memory='4194304' unit='KiB' memAccess='shared'/> | 605 | <cell id='0' cpus='0' memory='4194304' unit='KiB' memAccess='shared'/> |
593 | </numa> | 606 | </numa> |
594 | </cpu> | 607 | </cpu> |
608 | <cputune> | ||
609 | <vcpupin vcpu="0" cpuset="4"/> | ||
610 | <vcpupin vcpu="1" cpuset="5"/> | ||
611 | </cputune> | ||
595 | <on_poweroff>destroy</on_poweroff> | 612 | <on_poweroff>destroy</on_poweroff> |
596 | <on_reboot>restart</on_reboot> | 613 | <on_reboot>restart</on_reboot> |
597 | <on_crash>destroy</on_crash> | 614 | <on_crash>destroy</on_crash> |
598 | <devices> | 615 | <devices> |
599 | <emulator>/usr/bin/qemu-system-x86_64</emulator> | 616 | <emulator>/usr/bin/qemu-system-aarch64</emulator> |
600 | <disk type='file' device='disk'> | 617 | <disk type='file' device='disk'> |
601 | <driver name='qemu' type='raw' cache='none'/> | 618 | <driver name='qemu' type='raw' cache='none'/> |
602 | <source file='/mnt/qemu/enea-nfv-access-guest-qemux86-64.ext4'/> | 619 | <source file='/mnt/qemu/enea-nfv-access-guest-qemuarm64.ext4'/> |
603 | <target dev='vda' bus='virtio'/> | 620 | <target dev='vda' bus='virtio'/> |
604 | </disk> | 621 | </disk> |
605 | <interface type='vhostuser'> | ||
606 | <mac address='00:00:00:00:00:01'/> | ||
607 | <source type='unix' path='/var/run/openvswitch/vhost-user1' mode='client'/> | ||
608 | <model type='virtio'/> | ||
609 | <driver queues='1'> | ||
610 | <host mrg_rxbuf='off'/> | ||
611 | </driver> | ||
612 | </interface> | ||
613 | <serial type='pty'> | 622 | <serial type='pty'> |
614 | <target port='0'/> | 623 | <target port='0'/> |
615 | </serial> | 624 | </serial> |
@@ -617,33 +626,41 @@ $ dpdk-devbind.py --bind=vfio-pci 0000:03:10.0 | |||
617 | <target type='serial' port='0'/> | 626 | <target type='serial' port='0'/> |
618 | </console> | 627 | </console> |
619 | </devices> | 628 | </devices> |
629 | <qemu:commandline> | ||
630 | <qemu:arg value='-chardev'/> | ||
631 | <qemu:arg value='socket,id=charnet0,path=/var/run/openvswitch/vhost-user1'/> | ||
632 | <qemu:arg value='-netdev'/> | ||
633 | <qemu:arg value='type=vhost-user,id=hostnet0,chardev=charnet0'/> | ||
634 | <qemu:arg value='-device'/> | ||
635 | <qemu:arg value='virtio-net-pci,netdev=hostnet0,id=net0,mac=00:00:00:00:00:01,bus=pcie.0,addr=0x2'/> | ||
636 | </qemu:commandline> | ||
620 | </domain></programlisting> | 637 | </domain></programlisting> |
621 | </section> | 638 | </section> |
622 | 639 | ||
623 | <section id="guest-config-pci-passthrough"> | 640 | <section id="guest-config-pci-passthrough"> |
624 | <title>Guest configuration with PCI passthrough</title> | 641 | <title>Guest configuration with PCI passthrough</title> |
625 | 642 | ||
626 | <programlisting><domain type='kvm'> | 643 | <programlisting><domain type='kvm' xmlns:qemu='http://libvirt.org/schemas/domain/qemu/1.0'> |
627 | <name>vm_sriov1</name> | 644 | <name>vm_sriov</name> |
628 | <uuid>4a9b3f53-fa2a-47f3-a757-dd87720d9d1d</uuid> | 645 | <uuid>ed204646-1ad5-11e7-93ae-92361f002671</uuid> |
629 | <memory unit='KiB'>4194304</memory> | 646 | <memory unit='KiB'>4194304</memory> |
630 | <currentMemory unit='KiB'>4194304</currentMemory> | 647 | <currentMemory unit='KiB'>4194304</currentMemory> |
631 | <memoryBacking> | 648 | <memoryBacking> |
632 | <hugepages> | 649 | <hugepages> |
633 | <page size='1' unit='G' nodeset='0'/> | 650 | <page size='512' unit='M' nodeset='0'/> |
634 | </hugepages> | 651 | </hugepages> |
635 | </memoryBacking> | 652 | </memoryBacking> |
636 | <vcpu>2</vcpu> | ||
637 | <os> | 653 | <os> |
638 | <type arch='x86_64' machine='q35'>hvm</type> | 654 | <type arch='aarch64' machine='virt,gic_version=3'>hvm</type> |
639 | <kernel>/mnt/qemu/bzImage</kernel> | 655 | <kernel>/mnt/qemu/Image</kernel> |
640 | <cmdline>root=/dev/vda console=ttyS0,115200</cmdline> | 656 | <cmdline>root=/dev/vda console=ttyAMA0,115200n8</cmdline> |
641 | <boot dev='hd'/> | 657 | <boot dev='hd'/> |
642 | </os> | 658 | </os> |
643 | <features> | 659 | <features> |
644 | <acpi/> | 660 | <acpi/> |
645 | <apic/> | 661 | <apic/> |
646 | </features> | 662 | </features> |
663 | <vcpu placement='static'>2</vcpu> | ||
647 | <cpu mode='host-model'> | 664 | <cpu mode='host-model'> |
648 | <model fallback='allow'/> | 665 | <model fallback='allow'/> |
649 | <topology sockets='1' cores='2' threads='1'/> | 666 | <topology sockets='1' cores='2' threads='1'/> |
@@ -651,22 +668,20 @@ $ dpdk-devbind.py --bind=vfio-pci 0000:03:10.0 | |||
651 | <cell id='0' cpus='0' memory='4194304' unit='KiB' memAccess='shared'/> | 668 | <cell id='0' cpus='0' memory='4194304' unit='KiB' memAccess='shared'/> |
652 | </numa> | 669 | </numa> |
653 | </cpu> | 670 | </cpu> |
671 | <cputune> | ||
672 | <vcpupin vcpu="0" cpuset="4"/> | ||
673 | <vcpupin vcpu="1" cpuset="5"/> | ||
674 | </cputune> | ||
654 | <on_poweroff>destroy</on_poweroff> | 675 | <on_poweroff>destroy</on_poweroff> |
655 | <on_reboot>restart</on_reboot> | 676 | <on_reboot>restart</on_reboot> |
656 | <on_crash>destroy</on_crash> | 677 | <on_crash>destroy</on_crash> |
657 | <devices> | 678 | <devices> |
658 | <emulator>/usr/bin/qemu-system-x86_64</emulator> | 679 | <emulator>/usr/bin/qemu-system-aarch64</emulator> |
659 | <disk type='file' device='disk'> | 680 | <disk type='file' device='disk'> |
660 | <driver name='qemu' type='raw' cache='none'/> | 681 | <driver name='qemu' type='raw' cache='none'/> |
661 | <source file='/mnt/qemu/enea-nfv-access-guest-qemux86-64.ext4'/> | 682 | <source file='/mnt/qemu/enea-nfv-access-guest-qemuarm64.ext4'/> |
662 | <target dev='vda' bus='virtio'/> | 683 | <target dev='vda' bus='virtio'/> |
663 | </disk> | 684 | </disk> |
664 | <interface type='hostdev' managed='yes'> | ||
665 | <source> | ||
666 | <address type='pci' domain='0x0' bus='0x03' slot='0x10' function='0x0'/> | ||
667 | </source> | ||
668 | <mac address='52:54:00:6d:90:02'/> | ||
669 | </interface> | ||
670 | <serial type='pty'> | 685 | <serial type='pty'> |
671 | <target port='0'/> | 686 | <target port='0'/> |
672 | </serial> | 687 | </serial> |
@@ -674,6 +689,10 @@ $ dpdk-devbind.py --bind=vfio-pci 0000:03:10.0 | |||
674 | <target type='serial' port='0'/> | 689 | <target type='serial' port='0'/> |
675 | </console> | 690 | </console> |
676 | </devices> | 691 | </devices> |
692 | <qemu:commandline> | ||
693 | <qemu:arg value='-device'/> | ||
694 | <qemu:arg value='vfio-pci,host=0001:01:00.1'/> | ||
695 | </qemu:commandline> | ||
677 | </domain></programlisting> | 696 | </domain></programlisting> |
678 | </section> | 697 | </section> |
679 | 698 | ||
@@ -723,12 +742,12 @@ $ dpdk-devbind.py --bind=vfio-pci 0000:03:10.0 | |||
723 | <driver name='qemu' type='raw' cache='none'/> | 742 | <driver name='qemu' type='raw' cache='none'/> |
724 | <source file='/mnt/qemu/enea-nfv-access-guest-qemux86-64.ext4'/> | 743 | <source file='/mnt/qemu/enea-nfv-access-guest-qemux86-64.ext4'/> |
725 | <target dev='vda' bus='virtio'/> | 744 | <target dev='vda' bus='virtio'/> |
726 | </disk> | 745 | </disk>vi |
727 | <interface type='bridge'> | 746 | <interface type='bridge'> |
728 | <mac address='52:54:00:71:b1:b6'/> | 747 | <mac address='52:54:00:71:b1:b6'/> |
729 | <source bridge='ovsbr0'/> | 748 | <source bridge='ovsbr0'/> |
749 | <model type='rtl8139'/> | ||
730 | <virtualport type='openvswitch'/> | 750 | <virtualport type='openvswitch'/> |
731 | <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/> | ||
732 | </interface> | 751 | </interface> |
733 | <serial type='pty'> | 752 | <serial type='pty'> |
734 | <target port='0'/> | 753 | <target port='0'/> |
@@ -741,4 +760,4 @@ $ dpdk-devbind.py --bind=vfio-pci 0000:03:10.0 | |||
741 | </section> | 760 | </section> |
742 | </section> | 761 | </section> |
743 | </section> | 762 | </section> |
744 | </chapter> \ No newline at end of file | 763 | </chapter> |