https://linux-kvm.org/api.php?action=feedcontributions&user=HollisBlanchard&feedformat=atomKVM - User contributions [en]2024-03-19T03:27:46ZUser contributionsMediaWiki 1.39.5https://linux-kvm.org/index.php?title=PowerPC_Exittimings&diff=3097PowerPC Exittimings2010-07-15T17:28:14Z<p>HollisBlanchard: kvmppc_timing.py was never imported from the old wiki; it's gone now</p>
<hr />
<div>== About exit timing ==<br />
<br />
PowerPC KVM exports information to debugfs about the exits caused by virtualization and the time consumed by them. This data can typically be found as <code>/sys/kernel/debug/kvm/vm*_vcpu*_timing</code>.<br />
<br />
Because the PowerPC hardware currently supported by KVM has no hardware virtualization support, the guest must run in non-privileged mode. When the guest executes a privileged instruction, the KVM host must emulate its behavior, and this emulation time is accounted for as EMULINST. (It can be expected that upcoming hardware extension reduce most of these emulation exits as the guest can then run in privileged mode.)<br />
<br />
Another frequent exit reason is caused by the memory/TLB management. Because a guest can not be allowed to program the real TLB (privileged commands and it would be an isolation violation anyway), the host has to track the state of the guest TLB and recover TLB faults caused because the guest is virtualized. Such a kind of TLB interrupts caused by virtualization is called [DI]TLBVIRT in the exit statistics. If the guest TLB tracked by the host does not have a mapping for the address reported by a TLB exception it is delivered to the guest as it is done on bare metal. This appears as [DI]TLBREAL in the exit statistics.<br />
<br />
When the guest idles, it will enter "wait mode" until an interrupt is delivered. This time is accounted for by exit type of WAIT.<br />
<br />
The other exits are less frequent like MMIO, DCR and SIGNAL which need to exit to kvm-userspace to be handled. The only value not really being an exit is the TIMEINGUEST which is the time in the guest.<br />
<br />
The timing statistic itself tracks exit and reenter time as well as the type of the exit. Then the duration exit -> enter is accounted for the specific exit type while enter -> exit is accounted for the TIMEINGUEST values.<br />
<br />
'''Note:''' All times are in usec's.<br />
<br />
== workloads and performance expectations ==<br />
<br />
It can be expected that loads causing a high number of exits have a high overhead while loads that run in guest with only a few interceptions should be fine. Those loads with high exit ratios can be for example a guest booting and initializing all its virtual hardware (EMULINST), as well as load that creates memory pressure and therefore causes a lot of virtual TLB misses ([DI]TLBVIRT).<br />
<br />
The following measurements are taken on a 440epx (Sequoia) board. Thins means running an unmodified guests on Hardware without virtualization support. therefore a lot of overhead can be expected. The following statistics give you an idea which exit reasons are frequent dependeing on the workload. And as mentioned above you can think what happens once you run that on virtualization powerpc Hardware coming with Power ISA 2.06 (http://en.wikipedia.org/wiki/Power_Architecture#Power_ISA_v.2.06).<br />
<br />
The following sections describe the workloads shown on this page.<br />
[[Image:workload_classification.gif]]<br />
<br />
=== boot guest ===<br />
<br />
The workload traces a guest from the initialization until you see a boot prompt. Although being simple, this workload is useful to get a load with a high amount of privileged instructions.<br />
<br />
=== Hashes ===<br />
This is a custom written small program calculating a lot of hashes. It uses the hash algorithm used in the Berkley db and calculates hash of hash of and so on.<br />
This program represents a workload that has only a few I/O and privileged instructions and therefore has only a low virtualization overhead.<br />
attachment:foohash.c<br />
To execute it just call the binary without options:<br />
<code><br />
./foohash<br />
</code><br />
<br />
=== Fhourstone ===<br />
The Fhourstone benchmark (http://homepages.cwi.nl/~tromp/c4/fhour.html) uses a 64Mb transposition table to solve positions of the game connect-4. In a small environment as the sequoia board is this is a high amount of memory pressure and therefore it is expected that it causes a lot of TLB exits. After compiling the sources you get a binary called SearchGame and a file called "inputs" which represents the workload. The benchmark is invoked with:<br />
<code><br />
SearchGame < inputs<br />
</code><br />
<br />
=== Lame ===<br />
Lame (http://lame.sourceforge.net/) is the known mp3 encoder and in the workload testcase used to convert a file in very high quality (option --preset insane). This workload has to do some I/O, as well as a lot of calculations that should not exit to the hypervisor. Therefore it can be expected that lame is a good example of average workload.<br />
The wav file used is from a free sample page in the web (http://bellatrix.ece.mcgill.ca/Documents/AudioFormats/WAVE/Samples.html). We used the M1F1-int32-AFsp.wav from that page using the "insane" preset to get a max quality mp3.<br />
<code><br />
lame --preset insane M1F1-int32-AFsp.wav M1F1-int32-AFsp.mp3<br />
</code><br />
<br />
=== find ===<br />
<br />
At last using find to find a file and search for it all over the disk is a simple workload using only a few CPU calculations but requiring a lot of I/O.<br />
As testcase find is executed on root to search for the wav file we use in the Lame testcase, but with a wildcard. The disk we have is the ELDK ramdisk plus the files for the workloads listed here. To be fair and use the same file system the bare metal test mounts the same as loop device.<br />
<code><br />
cd /<br />
time find -name "*.wav*"<br />
</code><br />
<br />
== Performance results ==<br />
This Section lists at which % of the native bare metal speed these tests run on the current kvmppc implementation. As described below there are alerady known options for improvement like paravirtualization. The tests are run on the source level on 11. November 2008 which included some new performance improvements in memory management, interrupt delivery as well as several minor improvements.<br />
The tests are run on a Host and Guest with 64k page size. The Host uses a nfs mount as root file system while the guest is using virtio to access a disk image placed on the host root nfs mount.<br />
<br />
{|<br />
|'''workload'''<br />
|'''% of bae metal speed'''<br />
|-<br />
<br />
| hashes <br />
| 96.49% <br />
|-<br />
<br />
| lame <br />
| 84.47% <br />
|-<br />
<br />
| boot <br />
| ~80% <br />
|-<br />
<br />
| find <br />
| 6.11% <br />
|-<br />
<br />
| fhourstone <br />
| 5.96% <br />
|}<br />
<br />
'''Note:''' network latency after the virtio indirection might be a big issue for the find testcase so treat the numbers unfinished until we verified that number it on e.g. a local usb stick.<br />
<br />
'''Note:''' the time accounted for MMIO is the time a guest exits and KVM prepares the mmio until it returns to the guest. It is not the time until the IO arrives and is ready for the guest. Additional IO performance data may be obtained by running blktrace on the virtio disk inside the guest.<br />
<br />
== Timings results ==<br />
<br />
The following tables show the results of the exit timing analysis using the 5 different workloads mentioned above.<br />
<br />
=== boot guest ===<br />
<code><br />
sum of time 8309940<br />
type count min max sum avg stddev %<br />
MMIO: 9402 44 1997 1697610 180.5584 155.768 20.43<br />
DCR: 680 41 99 32096 47.2000 7.008 0.39<br />
SIGNAL: 1 98 98 98 98.0000 0.000 0.00<br />
ITLBREAL: 926 8 14 7810 8.4341 0.658 0.09<br />
ITLBVIRT: 3595 18 202 76185 21.1919 4.954 0.92<br />
DTLBREAL: 950 8 16 8891 9.3589 1.427 0.11<br />
DTLBVIRT: 6695 18 282 156727 23.4096 13.781 1.89<br />
SYSCALL: 1801 6 59 11372 6.3143 2.575 0.14<br />
ISI: 116 6 8 764 6.5862 0.588 0.01<br />
DSI: 43 6 7 292 6.7907 0.407 0.00<br />
EMULINST: 65247 7 96 484081 7.4192 1.818 5.83<br />
EMUL_WAIT: 801 659 9200 3721789 4646.4282 1687.218 44.79<br />
EMUL_CORE: 66806 7 86 540053 8.0839 1.895 6.50<br />
EMUL_MTSPR: 13415 8 62 111358 8.3010 2.583 1.34<br />
EMUL_MFSPR: 7635 8 61 62772 8.2216 1.921 0.76<br />
EMUL_MTMSR: 5678 8 59 45704 8.0493 1.434 0.55<br />
EMUL_MFMSR: 32853 7 67 267603 8.1455 1.875 3.22<br />
EMUL_TLBSX: 354 9 60 3745 10.5791 3.919 0.05<br />
EMUL_TLBWE: 6403 9 112 99522 15.5430 7.668 1.20<br />
EMUL_RFI: 9515 7 57 71420 7.5060 2.108 0.86<br />
DEC: 290 49 161 15786 54.4345 9.708 0.19<br />
EXTINT: 7 74 75 522 74.5714 0.495 0.01<br />
TIMEINGUEST: 233213 0 3954 893740 3.8323 65.837 10.76<br />
</code><br />
<br />
=== Hashes ===<br />
<code><br />
sum of time 21576367<br />
type count min max sum avg stddev %<br />
MMIO: 827 49 6700 224632 271.6227 259.231 1.04<br />
DCR: 161 42 94 7468 46.3851 4.314 0.03<br />
SIGNAL: 2 291 1214 1505 752.5000 461.500 0.01<br />
ITLBREAL: 53 8 12 445 8.3962 0.682 0.00<br />
ITLBVIRT: 216 19 68 4566 21.1389 3.346 0.02<br />
DTLBREAL: 44 9 16 420 9.5455 1.738 0.00<br />
DTLBVIRT: 407 19 73 8706 21.3907 3.687 0.04<br />
SYSCALL: 66 6 7 428 6.4848 0.500 0.00<br />
ISI: 5 6 8 34 6.8000 0.748 0.00<br />
DSI: 1 7 7 7 7.0000 0.000 0.00<br />
EMULINST: 67009 6 97 508311 7.5857 1.247 2.36<br />
EMUL_WAIT: 231 1254 8902 1074304 4650.6667 1699.150 4.98<br />
EMUL_CORE: 32964 7 59 262866 7.9743 0.622 1.22<br />
EMUL_MTSPR: 9201 8 14 74751 8.1242 0.339 0.35<br />
EMUL_MFSPR: 379 8 60 3134 8.2691 2.686 0.01<br />
EMUL_MTMSR: 4749 8 9 37996 8.0008 0.029 0.18<br />
EMUL_MFMSR: 14257 7 55 114282 8.0159 0.776 0.53<br />
EMUL_TLBSX: 18 9 15 185 10.2778 1.193 0.00<br />
EMUL_TLBWE: 393 9 69 5477 13.9364 6.905 0.03<br />
EMUL_RFI: 9006 7 57 67271 7.4696 0.722 0.31<br />
DEC: 5065 49 269 267567 52.8267 13.544 1.24<br />
EXTINT: 2 77 451 528 264.0000 187.000 0.00<br />
TIMEINGUEST: 145056 0 3954 18911484 130.3737 678.943 87.65<br />
</code><br />
<br />
=== Lame ===<br />
<code><br />
sum of time 6592939<br />
type count min max sum avg stddev %<br />
MMIO: 1827 48 18883 550073 301.0799 772.936 8.34<br />
DCR: 392 42 1074 22162 56.5357 83.884 0.34<br />
SIGNAL: 1 1812 1812 1812 1812.0000 0.000 0.03<br />
ITLBREAL: 142 8 13 1200 8.4507 0.623 0.02<br />
ITLBVIRT: 1860 18 118 39336 21.1484 4.514 0.60<br />
DTLBREAL: 164 8 66 1707 10.4085 4.885 0.03<br />
DTLBVIRT: 2724 18 1039 63063 23.1509 23.705 0.96<br />
SYSCALL: 255 6 8 1626 6.3765 0.531 0.02<br />
ISI: 17 6 8 114 6.7059 0.570 0.00<br />
DSI: 1 7 7 7 7.0000 0.000 0.00<br />
EMULINST: 26682 6 161 203151 7.6138 2.885 3.08<br />
EMUL_WAIT: 261 501 7683 1211114 4640.2835 1683.305 18.37<br />
EMUL_CORE: 19247 7 161 158089 8.2137 4.052 2.40<br />
EMUL_MTSPR: 4309 8 161 35697 8.2843 2.371 0.54<br />
EMUL_MFSPR: 1238 8 61 10395 8.3966 3.510 0.16<br />
EMUL_MTMSR: 2098 8 61 17045 8.1244 2.403 0.26<br />
EMUL_MFMSR: 9158 7 163 75613 8.2565 3.392 1.15<br />
EMUL_TLBSX: 36 9 13 364 10.1111 0.698 0.01<br />
EMUL_TLBWE: 1062 9 75 17011 16.0179 7.539 0.26<br />
EMUL_RFI: 3736 7 142 28230 7.5562 2.974 0.43<br />
DEC: 1109 49 263 61117 55.1100 15.174 0.93<br />
EXTINT: 36 52 1377 12085 335.6944 308.306 0.18<br />
TIMEINGUEST: 76355 0 3954 4081928 53.4599 415.345 61.91<br />
</code><br />
<br />
=== Fhourstone ===<br />
<code><br />
sum of time 7483768<br />
type count min max sum avg stddev %<br />
MMIO: 818 47 9565 221609 270.9156 501.827 2.96<br />
DCR: 301 40 473 14408 47.8671 29.403 0.19<br />
SIGNAL: 1 2521 2521 2521 2521.0000 0.000 0.03<br />
ITLBREAL: 322 8 58 2665 8.2764 2.810 0.04<br />
ITLBVIRT: 5773 18 1360 120111 20.8056 18.569 1.60<br />
DTLBREAL: 16433 8 73 184196 11.2089 3.709 2.46<br />
DTLBVIRT: 19913 18 1845 500349 25.1268 23.006 6.69<br />
SYSCALL: 91 6 7 579 6.3626 0.481 0.01<br />
ISI: 5 6 8 33 6.6000 0.800 0.00<br />
DSI: 1 7 7 7 7.0000 0.000 0.00<br />
EMULINST: 127113 6 102 949687 7.4712 2.244 12.69<br />
EMUL_WAIT: 76 3526 7578 354928 4670.1053 1679.367 4.74<br />
EMUL_CORE: 16733 7 159 134306 8.0264 1.701 1.79<br />
EMUL_MTSPR: 71886 8 149 594618 8.2717 2.595 7.95<br />
EMUL_MFSPR: 83877 8 93 689016 8.2146 2.580 9.21<br />
EMUL_MTMSR: 3166 8 57 25438 8.0347 1.220 0.34<br />
EMUL_MFMSR: 7392 7 61 59415 8.0377 1.294 0.79<br />
EMUL_TLBSX: 19 9 11 192 10.1053 0.640 0.00<br />
EMUL_TLBWE: 47187 9 2757 1131527 23.9796 13.359 15.12<br />
EMUL_RFI: 21782 7 132 172428 7.9161 2.323 2.30<br />
DEC: 715 50 224 42155 58.9580 15.052 0.56<br />
EXTINT: 2 142 161 303 151.5000 9.500 0.00<br />
TIMEINGUEST: 423606 0 499 2283277 5.3901 25.629 30.51<br />
</code><br />
<br />
=== find ===<br />
<code><br />
sum of time 3426052<br />
type count min max sum avg stddev %<br />
MMIO: 222 49 413 48228 217.2432 141.096 1.41<br />
DCR: 91 43 93 4239 46.5824 5.285 0.12<br />
SIGNAL: 3 476 5651 7952 2650.6667 2191.871 0.23<br />
ITLBREAL: 77 8 13 665 8.6364 0.754 0.02<br />
ITLBVIRT: 1341 18 120 28340 21.1335 4.968 0.83<br />
DTLBREAL: 59 8 16 573 9.7119 2.042 0.02<br />
DTLBVIRT: 2253 19 214 48630 21.5846 7.083 1.42<br />
SYSCALL: 4590 6 57 29503 6.4277 2.114 0.86<br />
ISI: 11 6 8 72 6.5455 0.656 0.00<br />
DSI: 1 7 7 7 7.0000 0.000 0.00<br />
EMULINST: 71560 6 77 525976 7.3501 1.945 15.35<br />
EMUL_WAIT: 374 184 9384 1724701 4611.5000 1752.946 50.34<br />
EMUL_CORE: 32646 7 100 262449 8.0392 1.792 7.66<br />
EMUL_MTSPR: 6668 8 78 54829 8.2227 2.213 1.60<br />
EMUL_MFSPR: 538 8 61 4507 8.3773 3.181 0.13<br />
EMUL_MTMSR: 5829 8 58 47036 8.0693 1.765 1.37<br />
EMUL_MFMSR: 15805 7 92 127426 8.0624 1.774 3.72<br />
EMUL_TLBSX: 29 9 14 297 10.2414 0.857 0.01<br />
EMUL_TLBWE: 462 9 27 6717 14.5390 6.606 0.20<br />
EMUL_RFI: 10855 7 57 81776 7.5335 2.132 2.39<br />
DEC: 160 50 403 9244 57.7750 32.861 0.27<br />
EXTINT: 4 427 1410 2991 747.7500 387.275 0.09<br />
TIMEINGUEST: 153578 0 762 409894 2.6690 6.322 11.96<br />
</code><br />
<br />
<br />
== Paravirtualization improvement ==<br />
<br />
As mentioned above improvements to all these overhead statistics are already known. On one hand the hardware virtualization support specified in the Power ISA 2.06, on the other hand on older hardware paravirtualization can be an option. For KVMPPC we wrote a simple paravirtualization interface to test hypercalls and measure some benefits from such implementations.<br />
In the concept measured here the hypervisor tells the guest that it supports special paravirtualization features if the guest (hyper)calls him passing a guest virtual and guest physical address and an amount of x (4096byte in the example) of ram big. This is a very basic, but also flexible interface as the hypervisor can now use this guest addressable memory to do all kind of things. In the example the hypervisor rewrites guest code to replace privileged instructions mfspr (SPRG1-3, ESR, DEAR) mtspr ((SPRG1-3, ESR, DEAR) and mfmsr. The hypervisor keeps the guest copies of these values updated in the memory area provided by the guest and rewrites the privileged instructions to simple non trapping load/store instructions. That save a lot of EMULINST exits while running the guest and has shown around 35-50% improvement for workloads with a high amount of EMULINST instructions (e.g. the boot workload)<br />
<br />
The net benefit of that improvement is high while the "guest invasiveness" is very low (The guest only has to donate a small amount of ram and virtual address space, all the other things can be done by the hypervisor transparently). And remember this is just one simple example of pv extensions, there are a lot other areas e.g. collaborative guest/host TLB management that can improve performance significantly (could be as easy as telling the guest to program more virtual TLB entries in the guest TLB to allow the host fix more misses directly).<br />
<br />
The following numbers show the improvement comparing the same workload with/without this paravirtualization feature. The workload used in this test is the boot workload, but using a more complex guest and Host environment (Ubuntu instead of ELDK) and it also uses an older version of our kernel and userspace code (also containing an older version of that exit timing and therefore not being directly comparable with the measurements above).<br />
<br />
=== No paravirtualization ===<br />
<code><br />
sum of time 144837890 => ~2:24 runtime<br />
count min max sum avg stddev %<br />
MMIO 10105 46 1534 2952467 292.17 295.933 2.04<br />
DCR 5428 40 209 246168 45.35 6.758 0.17<br />
SIGNAL 695 65 3755 89767 129.16 314.421 0.06<br />
ITLBREAL 80045 13 108 1063127 13.28 2.338 0.73<br />
ITLBVIRT 1000585 21 264827 24300596 24.28 264.753 16.78<br />
DTLBREAL 91206 13 69 1285214 14.09 2.225 0.89<br />
DTLBVIRT 977434 21 1446 24007008 24.56 4.426 16.58<br />
SYSCALL 10460 11 55 116447 11.13 1.929 0.08<br />
ISI 11724 11 61 130007 11.08 1.929 0.09<br />
DSI 20737 11 57 230009 11.09 1.914 0.16<br />
EMULINST 5683356 11 3778 79339467 13.96 50.275 54.78<br />
DEC 13079 50 826 732712 56.02 22.382 0.51<br />
EXTINT 55 30 1478 10996 199.92 238.150 0.01<br />
FP_UNAVAIL 280 11 53 3163 11.29 3.495 0.00<br />
TIMEINGUEST 7905189 0 3688 10330742 1.30 8.970 7.13<br />
</code><br />
<br />
=== paravirtualization ===<br />
<code><br />
sum of time 92206510 => ~1:32 runtime (~37% net improvement)<br />
count min max sum avg stddev %<br />
MMIO 12505 46 3087 3693782 295.38 260.788 4.01<br />
DCR 5595 40 706 273578 48.89 31.305 0.30<br />
SIGNAL 654 65 4132 300027 458.75 571.130 0.33<br />
ITLBREAL 71711 13 104 943053 13.15 2.360 1.02<br />
ITLBVIRT 750649 21 1503 18178245 24.21 7.335 19.71<br />
DTLBREAL 83356 13 102 1146242 13.75 2.406 1.24<br />
DTLBPV 30086 20 237 653556 21.72 4.639 0.71<br />
DTLBVIRT 772811 21 713 19079477 24.68 6.593 20.69<br />
SYSCALL 7647 11 57 84821 11.09 1.897 0.09<br />
HCALL 1 19 19 19 19.00 0.000 0.00<br />
ISI 9895 11 73 109667 11.08 1.904 0.12<br />
DSI 17974 10 57 199504 11.09 2.046 0.22<br />
EMULINST 2567245 11 4212 40501314 15.77 65.673 43.92<br />
DEC 7488 51 641 426813 56.99 23.893 0.46<br />
EXTINT 2215 31 1677 297495 134.30 116.219 0.32<br />
FP_UNAVAIL 258 11 11 2838 11.00 0.000 0.00<br />
TIMEINGUEST 4340090 0 3850 6316079 1.45 12.599 6.85<br />
</code><br />
<br />
== More Results ==<br />
This should actually just be an overview and is already huge, some more results can be found in all kind of timing and improvement discussions on kvm-ppc@vger.kernel.org <br />
<br />
----<br />
[[Category:PowerPC]]</div>HollisBlanchardhttps://linux-kvm.org/index.php?title=PowerPC_Exittimings&diff=3096PowerPC Exittimings2010-07-15T17:26:57Z<p>HollisBlanchard: replace MoinMoin "smiley" formatting</p>
<hr />
<div>== About exit timing ==<br />
<br />
PowerPC KVM exports information to debugfs about the exits caused by virtualization and the time consumed by them. This data can typically be found as <code>/sys/kernel/debug/kvm/vm*_vcpu*_timing</code>.<br />
<br />
Because the PowerPC hardware currently supported by KVM has no hardware virtualization support, the guest must run in non-privileged mode. When the guest executes a privileged instruction, the KVM host must emulate its behavior, and this emulation time is accounted for as EMULINST. (It can be expected that upcoming hardware extension reduce most of these emulation exits as the guest can then run in privileged mode.)<br />
<br />
Another frequent exit reason is caused by the memory/TLB management. Because a guest can not be allowed to program the real TLB (privileged commands and it would be an isolation violation anyway), the host has to track the state of the guest TLB and recover TLB faults caused because the guest is virtualized. Such a kind of TLB interrupts caused by virtualization is called [DI]TLBVIRT in the exit statistics. If the guest TLB tracked by the host does not have a mapping for the address reported by a TLB exception it is delivered to the guest as it is done on bare metal. This appears as [DI]TLBREAL in the exit statistics.<br />
<br />
When the guest idles, it will enter "wait mode" until an interrupt is delivered. This time is accounted for by exit type of WAIT.<br />
<br />
The other exits are less frequent like MMIO, DCR and SIGNAL which need to exit to kvm-userspace to be handled. The only value not really being an exit is the TIMEINGUEST which is the time in the guest.<br />
<br />
The timing statistic itself tracks exit and reenter time as well as the type of the exit. Then the duration exit -> enter is accounted for the specific exit type while enter -> exit is accounted for the TIMEINGUEST values.<br />
<br />
'''Note:''' All times are in usec's.<br />
<br />
== workloads and performance expectations ==<br />
<br />
It can be expected that loads causing a high number of exits have a high overhead while loads that run in guest with only a few interceptions should be fine. Those loads with high exit ratios can be for example a guest booting and initializing all its virtual hardware (EMULINST), as well as load that creates memory pressure and therefore causes a lot of virtual TLB misses ([DI]TLBVIRT).<br />
<br />
The following measurements are taken on a 440epx (Sequoia) board. Thins means running an unmodified guests on Hardware without virtualization support. therefore a lot of overhead can be expected. The following statistics give you an idea which exit reasons are frequent dependeing on the workload. And as mentioned above you can think what happens once you run that on virtualization powerpc Hardware coming with Power ISA 2.06 (http://en.wikipedia.org/wiki/Power_Architecture#Power_ISA_v.2.06).<br />
<br />
The following sections describe the workloads shown on this page.<br />
[[Image:workload_classification.gif]]<br />
<br />
=== boot guest ===<br />
<br />
The workload traces a guest from the initialization until you see a boot prompt. Although being simple, this workload is useful to get a load with a high amount of privileged instructions.<br />
<br />
=== Hashes ===<br />
This is a custom written small program calculating a lot of hashes. It uses the hash algorithm used in the Berkley db and calculates hash of hash of and so on.<br />
This program represents a workload that has only a few I/O and privileged instructions and therefore has only a low virtualization overhead.<br />
attachment:foohash.c<br />
To execute it just call the binary without options:<br />
<code><br />
./foohash<br />
</code><br />
<br />
=== Fhourstone ===<br />
The Fhourstone benchmark (http://homepages.cwi.nl/~tromp/c4/fhour.html) uses a 64Mb transposition table to solve positions of the game connect-4. In a small environment as the sequoia board is this is a high amount of memory pressure and therefore it is expected that it causes a lot of TLB exits. After compiling the sources you get a binary called SearchGame and a file called "inputs" which represents the workload. The benchmark is invoked with:<br />
<code><br />
SearchGame < inputs<br />
</code><br />
<br />
=== Lame ===<br />
Lame (http://lame.sourceforge.net/) is the known mp3 encoder and in the workload testcase used to convert a file in very high quality (option --preset insane). This workload has to do some I/O, as well as a lot of calculations that should not exit to the hypervisor. Therefore it can be expected that lame is a good example of average workload.<br />
The wav file used is from a free sample page in the web (http://bellatrix.ece.mcgill.ca/Documents/AudioFormats/WAVE/Samples.html). We used the M1F1-int32-AFsp.wav from that page using the "insane" preset to get a max quality mp3.<br />
<code><br />
lame --preset insane M1F1-int32-AFsp.wav M1F1-int32-AFsp.mp3<br />
</code><br />
<br />
=== find ===<br />
<br />
At last using find to find a file and search for it all over the disk is a simple workload using only a few CPU calculations but requiring a lot of I/O.<br />
As testcase find is executed on root to search for the wav file we use in the Lame testcase, but with a wildcard. The disk we have is the ELDK ramdisk plus the files for the workloads listed here. To be fair and use the same file system the bare metal test mounts the same as loop device.<br />
<code><br />
cd /<br />
time find -name "*.wav*"<br />
</code><br />
<br />
== Performance results ==<br />
This Section lists at which % of the native bare metal speed these tests run on the current kvmppc implementation. As described below there are alerady known options for improvement like paravirtualization. The tests are run on the source level on 11. November 2008 which included some new performance improvements in memory management, interrupt delivery as well as several minor improvements.<br />
The tests are run on a Host and Guest with 64k page size. The Host uses a nfs mount as root file system while the guest is using virtio to access a disk image placed on the host root nfs mount.<br />
<br />
{|<br />
|'''workload'''<br />
|'''% of bae metal speed'''<br />
|-<br />
<br />
| hashes <br />
| 96.49% <br />
|-<br />
<br />
| lame <br />
| 84.47% <br />
|-<br />
<br />
| boot <br />
| ~80% <br />
|-<br />
<br />
| find <br />
| 6.11% <br />
|-<br />
<br />
| fhourstone <br />
| 5.96% <br />
|}<br />
<br />
'''Note:''' network latency after the virtio indirection might be a big issue for the find testcase so treat the numbers unfinished until we verified that number it on e.g. a local usb stick.<br />
<br />
'''Note:''' the time accounted for MMIO is the time a guest exits and KVM prepares the mmio until it returns to the guest. It is not the time until the IO arrives and is ready for the guest. Additional IO performance data may be obtained by running blktrace on the virtio disk inside the guest.<br />
<br />
== Timings results ==<br />
<br />
The following tables show the results of the exit timing analysis using the 5 different workloads mentioned above.<br />
You can get similar postprocessed reports when using this script (attachment:kvmppc_timing.py) with the data reported by the debugfs interface.<br />
<br />
=== boot guest ===<br />
<code><br />
sum of time 8309940<br />
type count min max sum avg stddev %<br />
MMIO: 9402 44 1997 1697610 180.5584 155.768 20.43<br />
DCR: 680 41 99 32096 47.2000 7.008 0.39<br />
SIGNAL: 1 98 98 98 98.0000 0.000 0.00<br />
ITLBREAL: 926 8 14 7810 8.4341 0.658 0.09<br />
ITLBVIRT: 3595 18 202 76185 21.1919 4.954 0.92<br />
DTLBREAL: 950 8 16 8891 9.3589 1.427 0.11<br />
DTLBVIRT: 6695 18 282 156727 23.4096 13.781 1.89<br />
SYSCALL: 1801 6 59 11372 6.3143 2.575 0.14<br />
ISI: 116 6 8 764 6.5862 0.588 0.01<br />
DSI: 43 6 7 292 6.7907 0.407 0.00<br />
EMULINST: 65247 7 96 484081 7.4192 1.818 5.83<br />
EMUL_WAIT: 801 659 9200 3721789 4646.4282 1687.218 44.79<br />
EMUL_CORE: 66806 7 86 540053 8.0839 1.895 6.50<br />
EMUL_MTSPR: 13415 8 62 111358 8.3010 2.583 1.34<br />
EMUL_MFSPR: 7635 8 61 62772 8.2216 1.921 0.76<br />
EMUL_MTMSR: 5678 8 59 45704 8.0493 1.434 0.55<br />
EMUL_MFMSR: 32853 7 67 267603 8.1455 1.875 3.22<br />
EMUL_TLBSX: 354 9 60 3745 10.5791 3.919 0.05<br />
EMUL_TLBWE: 6403 9 112 99522 15.5430 7.668 1.20<br />
EMUL_RFI: 9515 7 57 71420 7.5060 2.108 0.86<br />
DEC: 290 49 161 15786 54.4345 9.708 0.19<br />
EXTINT: 7 74 75 522 74.5714 0.495 0.01<br />
TIMEINGUEST: 233213 0 3954 893740 3.8323 65.837 10.76<br />
</code><br />
<br />
=== Hashes ===<br />
<code><br />
sum of time 21576367<br />
type count min max sum avg stddev %<br />
MMIO: 827 49 6700 224632 271.6227 259.231 1.04<br />
DCR: 161 42 94 7468 46.3851 4.314 0.03<br />
SIGNAL: 2 291 1214 1505 752.5000 461.500 0.01<br />
ITLBREAL: 53 8 12 445 8.3962 0.682 0.00<br />
ITLBVIRT: 216 19 68 4566 21.1389 3.346 0.02<br />
DTLBREAL: 44 9 16 420 9.5455 1.738 0.00<br />
DTLBVIRT: 407 19 73 8706 21.3907 3.687 0.04<br />
SYSCALL: 66 6 7 428 6.4848 0.500 0.00<br />
ISI: 5 6 8 34 6.8000 0.748 0.00<br />
DSI: 1 7 7 7 7.0000 0.000 0.00<br />
EMULINST: 67009 6 97 508311 7.5857 1.247 2.36<br />
EMUL_WAIT: 231 1254 8902 1074304 4650.6667 1699.150 4.98<br />
EMUL_CORE: 32964 7 59 262866 7.9743 0.622 1.22<br />
EMUL_MTSPR: 9201 8 14 74751 8.1242 0.339 0.35<br />
EMUL_MFSPR: 379 8 60 3134 8.2691 2.686 0.01<br />
EMUL_MTMSR: 4749 8 9 37996 8.0008 0.029 0.18<br />
EMUL_MFMSR: 14257 7 55 114282 8.0159 0.776 0.53<br />
EMUL_TLBSX: 18 9 15 185 10.2778 1.193 0.00<br />
EMUL_TLBWE: 393 9 69 5477 13.9364 6.905 0.03<br />
EMUL_RFI: 9006 7 57 67271 7.4696 0.722 0.31<br />
DEC: 5065 49 269 267567 52.8267 13.544 1.24<br />
EXTINT: 2 77 451 528 264.0000 187.000 0.00<br />
TIMEINGUEST: 145056 0 3954 18911484 130.3737 678.943 87.65<br />
</code><br />
<br />
=== Lame ===<br />
<code><br />
sum of time 6592939<br />
type count min max sum avg stddev %<br />
MMIO: 1827 48 18883 550073 301.0799 772.936 8.34<br />
DCR: 392 42 1074 22162 56.5357 83.884 0.34<br />
SIGNAL: 1 1812 1812 1812 1812.0000 0.000 0.03<br />
ITLBREAL: 142 8 13 1200 8.4507 0.623 0.02<br />
ITLBVIRT: 1860 18 118 39336 21.1484 4.514 0.60<br />
DTLBREAL: 164 8 66 1707 10.4085 4.885 0.03<br />
DTLBVIRT: 2724 18 1039 63063 23.1509 23.705 0.96<br />
SYSCALL: 255 6 8 1626 6.3765 0.531 0.02<br />
ISI: 17 6 8 114 6.7059 0.570 0.00<br />
DSI: 1 7 7 7 7.0000 0.000 0.00<br />
EMULINST: 26682 6 161 203151 7.6138 2.885 3.08<br />
EMUL_WAIT: 261 501 7683 1211114 4640.2835 1683.305 18.37<br />
EMUL_CORE: 19247 7 161 158089 8.2137 4.052 2.40<br />
EMUL_MTSPR: 4309 8 161 35697 8.2843 2.371 0.54<br />
EMUL_MFSPR: 1238 8 61 10395 8.3966 3.510 0.16<br />
EMUL_MTMSR: 2098 8 61 17045 8.1244 2.403 0.26<br />
EMUL_MFMSR: 9158 7 163 75613 8.2565 3.392 1.15<br />
EMUL_TLBSX: 36 9 13 364 10.1111 0.698 0.01<br />
EMUL_TLBWE: 1062 9 75 17011 16.0179 7.539 0.26<br />
EMUL_RFI: 3736 7 142 28230 7.5562 2.974 0.43<br />
DEC: 1109 49 263 61117 55.1100 15.174 0.93<br />
EXTINT: 36 52 1377 12085 335.6944 308.306 0.18<br />
TIMEINGUEST: 76355 0 3954 4081928 53.4599 415.345 61.91<br />
</code><br />
<br />
=== Fhourstone ===<br />
<code><br />
sum of time 7483768<br />
type count min max sum avg stddev %<br />
MMIO: 818 47 9565 221609 270.9156 501.827 2.96<br />
DCR: 301 40 473 14408 47.8671 29.403 0.19<br />
SIGNAL: 1 2521 2521 2521 2521.0000 0.000 0.03<br />
ITLBREAL: 322 8 58 2665 8.2764 2.810 0.04<br />
ITLBVIRT: 5773 18 1360 120111 20.8056 18.569 1.60<br />
DTLBREAL: 16433 8 73 184196 11.2089 3.709 2.46<br />
DTLBVIRT: 19913 18 1845 500349 25.1268 23.006 6.69<br />
SYSCALL: 91 6 7 579 6.3626 0.481 0.01<br />
ISI: 5 6 8 33 6.6000 0.800 0.00<br />
DSI: 1 7 7 7 7.0000 0.000 0.00<br />
EMULINST: 127113 6 102 949687 7.4712 2.244 12.69<br />
EMUL_WAIT: 76 3526 7578 354928 4670.1053 1679.367 4.74<br />
EMUL_CORE: 16733 7 159 134306 8.0264 1.701 1.79<br />
EMUL_MTSPR: 71886 8 149 594618 8.2717 2.595 7.95<br />
EMUL_MFSPR: 83877 8 93 689016 8.2146 2.580 9.21<br />
EMUL_MTMSR: 3166 8 57 25438 8.0347 1.220 0.34<br />
EMUL_MFMSR: 7392 7 61 59415 8.0377 1.294 0.79<br />
EMUL_TLBSX: 19 9 11 192 10.1053 0.640 0.00<br />
EMUL_TLBWE: 47187 9 2757 1131527 23.9796 13.359 15.12<br />
EMUL_RFI: 21782 7 132 172428 7.9161 2.323 2.30<br />
DEC: 715 50 224 42155 58.9580 15.052 0.56<br />
EXTINT: 2 142 161 303 151.5000 9.500 0.00<br />
TIMEINGUEST: 423606 0 499 2283277 5.3901 25.629 30.51<br />
</code><br />
<br />
=== find ===<br />
<code><br />
sum of time 3426052<br />
type count min max sum avg stddev %<br />
MMIO: 222 49 413 48228 217.2432 141.096 1.41<br />
DCR: 91 43 93 4239 46.5824 5.285 0.12<br />
SIGNAL: 3 476 5651 7952 2650.6667 2191.871 0.23<br />
ITLBREAL: 77 8 13 665 8.6364 0.754 0.02<br />
ITLBVIRT: 1341 18 120 28340 21.1335 4.968 0.83<br />
DTLBREAL: 59 8 16 573 9.7119 2.042 0.02<br />
DTLBVIRT: 2253 19 214 48630 21.5846 7.083 1.42<br />
SYSCALL: 4590 6 57 29503 6.4277 2.114 0.86<br />
ISI: 11 6 8 72 6.5455 0.656 0.00<br />
DSI: 1 7 7 7 7.0000 0.000 0.00<br />
EMULINST: 71560 6 77 525976 7.3501 1.945 15.35<br />
EMUL_WAIT: 374 184 9384 1724701 4611.5000 1752.946 50.34<br />
EMUL_CORE: 32646 7 100 262449 8.0392 1.792 7.66<br />
EMUL_MTSPR: 6668 8 78 54829 8.2227 2.213 1.60<br />
EMUL_MFSPR: 538 8 61 4507 8.3773 3.181 0.13<br />
EMUL_MTMSR: 5829 8 58 47036 8.0693 1.765 1.37<br />
EMUL_MFMSR: 15805 7 92 127426 8.0624 1.774 3.72<br />
EMUL_TLBSX: 29 9 14 297 10.2414 0.857 0.01<br />
EMUL_TLBWE: 462 9 27 6717 14.5390 6.606 0.20<br />
EMUL_RFI: 10855 7 57 81776 7.5335 2.132 2.39<br />
DEC: 160 50 403 9244 57.7750 32.861 0.27<br />
EXTINT: 4 427 1410 2991 747.7500 387.275 0.09<br />
TIMEINGUEST: 153578 0 762 409894 2.6690 6.322 11.96<br />
</code><br />
<br />
<br />
== Paravirtualization improvement ==<br />
<br />
As mentioned above improvements to all these overhead statistics are already known. On one hand the hardware virtualization support specified in the Power ISA 2.06, on the other hand on older hardware paravirtualization can be an option. For KVMPPC we wrote a simple paravirtualization interface to test hypercalls and measure some benefits from such implementations.<br />
In the concept measured here the hypervisor tells the guest that it supports special paravirtualization features if the guest (hyper)calls him passing a guest virtual and guest physical address and an amount of x (4096byte in the example) of ram big. This is a very basic, but also flexible interface as the hypervisor can now use this guest addressable memory to do all kind of things. In the example the hypervisor rewrites guest code to replace privileged instructions mfspr (SPRG1-3, ESR, DEAR) mtspr ((SPRG1-3, ESR, DEAR) and mfmsr. The hypervisor keeps the guest copies of these values updated in the memory area provided by the guest and rewrites the privileged instructions to simple non trapping load/store instructions. That save a lot of EMULINST exits while running the guest and has shown around 35-50% improvement for workloads with a high amount of EMULINST instructions (e.g. the boot workload)<br />
<br />
The net benefit of that improvement is high while the "guest invasiveness" is very low (The guest only has to donate a small amount of ram and virtual address space, all the other things can be done by the hypervisor transparently). And remember this is just one simple example of pv extensions, there are a lot other areas e.g. collaborative guest/host TLB management that can improve performance significantly (could be as easy as telling the guest to program more virtual TLB entries in the guest TLB to allow the host fix more misses directly).<br />
<br />
The following numbers show the improvement comparing the same workload with/without this paravirtualization feature. The workload used in this test is the boot workload, but using a more complex guest and Host environment (Ubuntu instead of ELDK) and it also uses an older version of our kernel and userspace code (also containing an older version of that exit timing and therefore not being directly comparable with the measurements above).<br />
<br />
=== No paravirtualization ===<br />
<code><br />
sum of time 144837890 => ~2:24 runtime<br />
count min max sum avg stddev %<br />
MMIO 10105 46 1534 2952467 292.17 295.933 2.04<br />
DCR 5428 40 209 246168 45.35 6.758 0.17<br />
SIGNAL 695 65 3755 89767 129.16 314.421 0.06<br />
ITLBREAL 80045 13 108 1063127 13.28 2.338 0.73<br />
ITLBVIRT 1000585 21 264827 24300596 24.28 264.753 16.78<br />
DTLBREAL 91206 13 69 1285214 14.09 2.225 0.89<br />
DTLBVIRT 977434 21 1446 24007008 24.56 4.426 16.58<br />
SYSCALL 10460 11 55 116447 11.13 1.929 0.08<br />
ISI 11724 11 61 130007 11.08 1.929 0.09<br />
DSI 20737 11 57 230009 11.09 1.914 0.16<br />
EMULINST 5683356 11 3778 79339467 13.96 50.275 54.78<br />
DEC 13079 50 826 732712 56.02 22.382 0.51<br />
EXTINT 55 30 1478 10996 199.92 238.150 0.01<br />
FP_UNAVAIL 280 11 53 3163 11.29 3.495 0.00<br />
TIMEINGUEST 7905189 0 3688 10330742 1.30 8.970 7.13<br />
</code><br />
<br />
=== paravirtualization ===<br />
<code><br />
sum of time 92206510 => ~1:32 runtime (~37% net improvement)<br />
count min max sum avg stddev %<br />
MMIO 12505 46 3087 3693782 295.38 260.788 4.01<br />
DCR 5595 40 706 273578 48.89 31.305 0.30<br />
SIGNAL 654 65 4132 300027 458.75 571.130 0.33<br />
ITLBREAL 71711 13 104 943053 13.15 2.360 1.02<br />
ITLBVIRT 750649 21 1503 18178245 24.21 7.335 19.71<br />
DTLBREAL 83356 13 102 1146242 13.75 2.406 1.24<br />
DTLBPV 30086 20 237 653556 21.72 4.639 0.71<br />
DTLBVIRT 772811 21 713 19079477 24.68 6.593 20.69<br />
SYSCALL 7647 11 57 84821 11.09 1.897 0.09<br />
HCALL 1 19 19 19 19.00 0.000 0.00<br />
ISI 9895 11 73 109667 11.08 1.904 0.12<br />
DSI 17974 10 57 199504 11.09 2.046 0.22<br />
EMULINST 2567245 11 4212 40501314 15.77 65.673 43.92<br />
DEC 7488 51 641 426813 56.99 23.893 0.46<br />
EXTINT 2215 31 1677 297495 134.30 116.219 0.32<br />
FP_UNAVAIL 258 11 11 2838 11.00 0.000 0.00<br />
TIMEINGUEST 4340090 0 3850 6316079 1.45 12.599 6.85<br />
</code><br />
<br />
== More Results ==<br />
This should actually just be an overview and is already huge, some more results can be found in all kind of timing and improvement discussions on kvm-ppc@vger.kernel.org <br />
<br />
----<br />
[[Category:PowerPC]]</div>HollisBlanchardhttps://linux-kvm.org/index.php?title=PowerPC_Run&diff=2658PowerPC Run2009-10-30T16:54:13Z<p>HollisBlanchard: replace moinmoin smileys</p>
<hr />
<div>== Run ==<br />
<br />
Log in to target and run:<br />
<br />
<code><br />
./qemu-system-ppcemb --enable-kvm \<br />
-nographic \<br />
-m 128 \<br />
-M bamboo \<br />
-kernel uImage.bamboo \<br />
-L . \<br />
-append "your guest kernel command line"<br />
</code><br />
<br />
The location specified with -L must contain the <code>bamboo.dtb</code> device tree file.<br />
<br />
{|<br />
|'''Note:''' Consult the [http://bellard.org/qemu/qemu-doc.html QEMU documentation] for a more complete list and explanation of these options.<br />
|}<br />
<br />
== virtio ==<br />
In the case that virtio is activated in the guest kernel, you can add virtio devices at the qemu command line.<br />
<br />
Examples (nothing special for ppc):<br />
<br />
=== network ===<br />
<br />
This adds a virtio network device visible to the guest and the external network:<br />
<code><br />
./qemu-system-ppcemb [...] -net nic,model=virtio -net tap <br />
</code><br />
<br />
{|<br />
|'''Note:''' You must have CONFIG_VIRTIO_NET=y in your guest kernel .config.<br />
|}<br />
<br />
{|<br />
|'''Note:''' You must have Qemu networking configured to use a <code>tap</code> device. See [[Networking]] for details.<br />
|}<br />
<br />
=== disk ===<br />
<br />
This adds a virtio disk device:<br />
<code><br />
./qemu-system-ppcemb [...] -drive file=pathtoyourfile.img,if=virtio <br />
</code><br />
<br />
The device appears as <code>/dev/vda</code> in the guest.<br />
<br />
{|<br />
|'''Note:''' You must have CONFIG_VIRTIO_BLK=y in your guest kernel .config.<br />
|}<br />
<br />
== Known Pitfalls ==<br />
=== no guest console ===<br />
Specifying a console in the guest kernel parameters might let the guest output fail. If you think your output is missing try without any "console=" parameter<br />
<br />
=== virtio net requirements ===<br />
You will need to enable tap and bridge support in the host kernel.<br />
<br />
You may also need to download and install bridge-utils (use <code>configure --host=i386-linux --target=ppc-linux</code> and all other cross build stuff you need).<br />
<br />
Usually embedded boards use a nfs root device, this may conflict with the need to ifdown the device you want to bridge, but you might use the second ethernet device in that case.<br />
You need to edit /etc/qemu-ifup to your needs here is an example that creates bridge br0 on demand and uses eth1 as external device on that bridge:<br />
<code><br />
#!/bin/bash<br />
<br />
bridge=br0<br />
netdev=eth1<br />
guestdev=$1<br />
<br />
if [ ! -c /dev/net/tun ]<br />
then<br />
echo "network init failed - /dev/net/tun does not exist"<br />
exit 1<br />
fi<br />
<br />
echo "test for existing bridge $bridge"<br />
brctl showmacs $bridge<br />
<br />
if [ $? -eq 0 ]<br />
then<br />
echo "ok - bridge $bridge already available"<br />
else<br />
echo "need to create bridge $bridge"<br />
ifconfig $netdev down<br />
brctl addbr $bridge<br />
ifconfig $bridge up<br />
ifconfig $netdev up<br />
brctl addif $bridge $netdev<br />
echo "created bridge $bridge"<br />
brctl show<br />
fi<br />
<br />
ifconfig $guestdev up<br />
brctl addif $bridge $guestdev<br />
</code><br />
<br />
----<br />
[[Category:PowerPC]]</div>HollisBlanchardhttps://linux-kvm.org/index.php?title=PowerPC_Host_Userspace&diff=2545PowerPC Host Userspace2009-08-26T16:48:28Z<p>HollisBlanchard: remove obsolete configure option</p>
<hr />
<div>== What You Need ==<br />
<br />
# A copy of the [http://savannah.nongnu.org/git/?group=qemu qemu development source tree].<br />
# A copy of the Linux kernel source tree. Note: <code>qemu.git</code> will not build with Linux 2.6.28 or earlier.<br />
# An installed copy of [http://git.jdl.com/gitweb/?p=dtc.git;a=summary libfdt], built for PowerPC.<br />
<br />
If you are cross-compiling from a non-PowerPC host, you also need:<br />
<br />
# A cross-compiler, such as one built by [http://kegel.com/crosstool crosstool].<br />
# An installed copy of the [http://zlib.net/ zlib] library, built for PowerPC.<br />
<br />
=== Where to install the libraries ===<br />
<br />
Before building qemu, you install the <code>libfdt</code> and <code>zlib</code> libraries where your toolchain will find them. If you are not cross-compiling, skip this section (because your toolchain will find them in the usual /usr/lib).<br />
<br />
You can use <code>cpp -v</code> to find your toolchain's built-in prefix. For example, if your toolchain was created by [http://kegel.com/crosstool crosstool], cpp will say something like this:<br />
<code><br />
% powerpc-440-linux-gnu-cpp -v<br />
...<br />
#include "..." search starts here:<br />
#include <...> search starts here:<br />
/opt/crosstool/gcc-3.4.5-glibc-2.3.6/powerpc-440-linux-gnu/lib/gcc/powerpc-440-linux-gnu/3.4.5/include<br />
/opt/crosstool/gcc-3.4.5-glibc-2.3.6/powerpc-440-linux-gnu/lib/gcc/powerpc-440-linux-gnu/3.4.5/../../../../powerpc-440-linux-gnu/sys-include<br />
/opt/crosstool/gcc-3.4.5-glibc-2.3.6/powerpc-440-linux-gnu/lib/gcc/powerpc-440-linux-gnu/3.4.5/../../../../powerpc-440-linux-gnu/include<br />
End of search list.<br />
</code><br />
<br />
The prefix here is <code>/opt/crosstool/gcc-3.4.5-glibc-2.3.6/powerpc-440-linux-gnu/powerpc-440-linux-gnu</code>. (Basically pick the last ".../include" path and go up one directory.) Use that prefix to install <code>zlib</code> and <code>libfdt</code>.<br />
<br />
== Building Qemu for PowerPC KVM ==<br />
<br />
Here is an example for the configure script at the top level of the kvm-userspace repository:<br />
<br />
If cross-compiling, run this first:<br />
<code><br />
cross=powerpc-440-linux-gnu-<br />
</code><br />
<br />
<code><br />
./configure \<br />
--disable-sdl \<br />
--target-list=ppcemb-softmmu \<br />
--cross-prefix="$cross" \<br />
--kerneldir="/home/hollisb/source/kvmppc-dev.hg"<br />
</code><br />
<br />
== Build ==<br />
<br />
<code>make</code> will produce <code>qemu/ppcemb-softmmu/qemu-system-ppcemb</code>. You must transfer that executable and <code>qemu/pc-bios/bamboo.dtb</code> to the target.<br />
<br />
----<br />
[[Category:PowerPC]]</div>HollisBlanchardhttps://linux-kvm.org/index.php?title=Documents&diff=2373Documents2009-07-09T00:01:25Z<p>HollisBlanchard: fix wiki markup (linkify Forum pages)</p>
<hr />
<div>= Documents =<br />
<br />
== User/Admin documentation ==<br />
* [[HOWTO]]<br />
* [http://www.nongnu.org/qemu/qemu-doc.html QEMU user manual]<br />
== Presentations ==<br />
* Presentations on many aspects of KVM were made at [[KvmForum2007]] (Aug 2007).<br />
* Presentations from the [[KvmForum2008]] (June 2008)<br />
* Avi Kivity's presentation from the [http://ols.108.redhat.com/2007/Reprints/kivity-Reprint.pdf Ottawa Linux Symposium 2007] (Jun 2007).<br />
* TPR patching [attachment:kvm-tpr-patching.odp overview] (Avi Kivity, Oct 2008)<br />
* [http://markmc.fedorapeople.org/virtio-code-review/VirtioCodeReview.pdf Virtio code walkthrough], [http://markmc.fedorapeople.org/virtio-code-review/virtio-talk.txt notes], [http://blogs.gnome.org/markmc/2008/05/28/checksums-scatter-gather-io-and-segmentation-offload/ GSO background] (Mark McLoughlin, Oct 2008), and [http://portal.acm.org/citation.cfm?id=1400097.1400108 ACM pdf about virtio by Rusty Russell]<br />
== White papers: ==<br />
* Qumranet's [http://www.qumranet.com/files/white_papers/KVM_Whitepaper.pdf KVM Whitepaper]<br />
== Magazine Articles ==<br />
* [http://www.linux-magazine.com/issues/2008/86/kernel_tricks Linux Magazine]<br />
* [http://www.linuxplanet.com/linuxplanet/reports/6490/4/ KVM for Embedded] at Linux Planet<br />
== Benchmarks ==<br />
* [http://www.phoronix.com/scan.php?page=article&item=ubuntu_virt_benchmarks&num=1 Phoronix - Ubuntu 8.04 KVM Benchmarks]<br />
* [http://www.phoronix.com/scan.php?page=article&item=intel_corei7_virt&num=1 Phoronix - Intel Core i7 Virtualization Performance]<br />
== Documentation ==<br />
* [[small_look_inside|small look inside(kvm-54)]]<br />
* [[buildup|qemu kvm buildup]]<br />
* [[vl_runthrough|qemu-system-x86_64 startup (kvm-57)]]<br />
* [[initialization|initialization (kvm-57)]]<br />
* [[file_layout_in_kernel|file layout in kernel (~kvm-58)]]<br />
== KVM Doxygen Documentation ==<br />
* [http://kvmapi.ath.cx kvm doxygen documentation]<br />
== Tools ==<br />
* [[tools|Tools]]<br />
== Supported cpus ==<br />
* [[processor_support|cpus]]</div>HollisBlanchardhttps://linux-kvm.org/index.php?title=PowerPC_Host_Userspace&diff=2305PowerPC Host Userspace2009-05-13T21:03:56Z<p>HollisBlanchard: link text with URL</p>
<hr />
<div>== What You Need ==<br />
<br />
# A copy of the [http://savannah.nongnu.org/git/?group=qemu qemu development source tree].<br />
# A copy of the Linux kernel source tree. Note: <code>qemu.git</code> will not build with Linux 2.6.28 or earlier.<br />
# An installed copy of [http://git.jdl.com/gitweb/?p=dtc.git;a=summary libfdt], built for PowerPC.<br />
<br />
If you are cross-compiling from a non-PowerPC host, you also need:<br />
<br />
# A cross-compiler, such as one built by [http://kegel.com/crosstool crosstool].<br />
# An installed copy of the [http://zlib.net/ zlib] library, built for PowerPC.<br />
<br />
=== Where to install the libraries ===<br />
<br />
Before building qemu, you install the <code>libfdt</code> and <code>zlib</code> libraries where your toolchain will find them. If you are not cross-compiling, skip this section (because your toolchain will find them in the usual /usr/lib).<br />
<br />
You can use <code>cpp -v</code> to find your toolchain's built-in prefix. For example, if your toolchain was created by [http://kegel.com/crosstool crosstool], cpp will say something like this:<br />
<code><br />
% powerpc-440-linux-gnu-cpp -v<br />
...<br />
#include "..." search starts here:<br />
#include <...> search starts here:<br />
/opt/crosstool/gcc-3.4.5-glibc-2.3.6/powerpc-440-linux-gnu/lib/gcc/powerpc-440-linux-gnu/3.4.5/include<br />
/opt/crosstool/gcc-3.4.5-glibc-2.3.6/powerpc-440-linux-gnu/lib/gcc/powerpc-440-linux-gnu/3.4.5/../../../../powerpc-440-linux-gnu/sys-include<br />
/opt/crosstool/gcc-3.4.5-glibc-2.3.6/powerpc-440-linux-gnu/lib/gcc/powerpc-440-linux-gnu/3.4.5/../../../../powerpc-440-linux-gnu/include<br />
End of search list.<br />
</code><br />
<br />
The prefix here is <code>/opt/crosstool/gcc-3.4.5-glibc-2.3.6/powerpc-440-linux-gnu/powerpc-440-linux-gnu</code>. (Basically pick the last ".../include" path and go up one directory.) Use that prefix to install <code>zlib</code> and <code>libfdt</code>.<br />
<br />
== Building Qemu for PowerPC KVM ==<br />
<br />
Here is an example for the configure script at the top level of the kvm-userspace repository:<br />
<br />
If cross-compiling, run this first:<br />
<code><br />
cross=powerpc-440-linux-gnu-<br />
</code><br />
<br />
<code><br />
./configure \<br />
--disable-sdl \<br />
--disable-gfx-check \<br />
--target-list=ppcemb-softmmu \<br />
--cross-prefix="$cross" \<br />
--kerneldir="/home/hollisb/source/kvmppc-dev.hg"<br />
</code><br />
<br />
== Build ==<br />
<br />
<code>make</code> will produce <code>qemu/ppcemb-softmmu/qemu-system-ppcemb</code>. You must transfer that executable and <code>qemu/pc-bios/bamboo.dtb</code> to the target.<br />
<br />
----<br />
[[Category:PowerPC]]</div>HollisBlanchardhttps://linux-kvm.org/index.php?title=PowerPC_Host_Userspace&diff=2304PowerPC Host Userspace2009-05-13T20:55:38Z<p>HollisBlanchard: update qemu.git URL</p>
<hr />
<div>== What You Need ==<br />
<br />
# A copy of the qemu development source tree (http://savannah.nongnu.org/git/?group=qemu).<br />
# A copy of the Linux kernel source tree. Note: <code>qemu.git</code> will not build with Linux 2.6.28 or earlier.<br />
# An installed copy of [http://git.jdl.com/gitweb/?p=dtc.git;a=summary libfdt], built for PowerPC.<br />
<br />
If you are cross-compiling from a non-PowerPC host, you also need:<br />
<br />
# A cross-compiler, such as one built by [http://kegel.com/crosstool crosstool].<br />
# An installed copy of the [http://zlib.net/ zlib] library, built for PowerPC.<br />
<br />
=== Where to install the libraries ===<br />
<br />
Before building qemu, you install the <code>libfdt</code> and <code>zlib</code> libraries where your toolchain will find them. If you are not cross-compiling, skip this section (because your toolchain will find them in the usual /usr/lib).<br />
<br />
You can use <code>cpp -v</code> to find your toolchain's built-in prefix. For example, if your toolchain was created by [http://kegel.com/crosstool crosstool], cpp will say something like this:<br />
<code><br />
% powerpc-440-linux-gnu-cpp -v<br />
...<br />
#include "..." search starts here:<br />
#include <...> search starts here:<br />
/opt/crosstool/gcc-3.4.5-glibc-2.3.6/powerpc-440-linux-gnu/lib/gcc/powerpc-440-linux-gnu/3.4.5/include<br />
/opt/crosstool/gcc-3.4.5-glibc-2.3.6/powerpc-440-linux-gnu/lib/gcc/powerpc-440-linux-gnu/3.4.5/../../../../powerpc-440-linux-gnu/sys-include<br />
/opt/crosstool/gcc-3.4.5-glibc-2.3.6/powerpc-440-linux-gnu/lib/gcc/powerpc-440-linux-gnu/3.4.5/../../../../powerpc-440-linux-gnu/include<br />
End of search list.<br />
</code><br />
<br />
The prefix here is <code>/opt/crosstool/gcc-3.4.5-glibc-2.3.6/powerpc-440-linux-gnu/powerpc-440-linux-gnu</code>. (Basically pick the last ".../include" path and go up one directory.) Use that prefix to install <code>zlib</code> and <code>libfdt</code>.<br />
<br />
== Building Qemu for PowerPC KVM ==<br />
<br />
Here is an example for the configure script at the top level of the kvm-userspace repository:<br />
<br />
If cross-compiling, run this first:<br />
<code><br />
cross=powerpc-440-linux-gnu-<br />
</code><br />
<br />
<code><br />
./configure \<br />
--disable-sdl \<br />
--disable-gfx-check \<br />
--target-list=ppcemb-softmmu \<br />
--cross-prefix="$cross" \<br />
--kerneldir="/home/hollisb/source/kvmppc-dev.hg"<br />
</code><br />
<br />
== Build ==<br />
<br />
<code>make</code> will produce <code>qemu/ppcemb-softmmu/qemu-system-ppcemb</code>. You must transfer that executable and <code>qemu/pc-bios/bamboo.dtb</code> to the target.<br />
<br />
----<br />
[[Category:PowerPC]]</div>HollisBlanchardhttps://linux-kvm.org/index.php?title=Virtio&diff=1738Virtio2008-03-24T17:14:40Z<p>HollisBlanchard: typo</p>
<hr />
<div>= Paravirtualized drivers for kvm/Linux =<br />
* Virtio was chosen to be the main platform for IO virtualization in KVM<br />
* The idea behind it is to have a common framework for hypervisors for IO virtualization<br />
* More information (although not uptodate) can be found in kvm [http://kvm.qumranet.com/kvmwiki/KvmForum2007?action=[[AttachFile]]&do=get&target=kvm_pv_drv.pdf pv driver] <br />
* At the moment network/block/balloon devices are suported for kvm<br />
* The host implementation is in userspace - qemu, so no driver is needed in the host.<br />
<br />
= How to use Virtio =<br />
* Get kvm version >= 60<br />
* Get Linux kernel with virtio drivers for the guest<br />
** Get Kernel >= 2.6.25 and activate (modules should also work, but take care of initramdisk)<br />
*** CONFIG_VIRTIO_PCI=y (Virtualization -> PCI driver for virtio devices)<br />
*** CONFIG_VIRTIO_BALLOON=y (Virtualization -> Virtio balloon driver)<br />
*** CONFIG_VIRTIO_BLK=y (Device Drivers -> Block -> Virtio block driver)<br />
*** CONFIG_VIRTIO_NET=y (Device Drivers -> Network device support -> Virtio network driver)<br />
*** CONFIG_VIRTIO=y (automatically selected)<br />
*** CONFIG_VIRTIO_RING=y (automatically selected)<br />
*** CONFIG_HIGH_RES_TIMERS=y (Processor type and features -> High Resolution Timer Support **optional**)<br />
*** you can safely disable SATA/SCSI and also all other nic drivers if you only use VIRTIO (disk/nic)<br />
* Either build it around Rusty's tree [http://ozlabs.org/~rusty/kernel/hg/ repo]<br />
** Or git clone git://kvm.qumranet.com/home/dor/src/linux-2.6-nv use branch rusty<br />
** Soon an official repository will be released<br />
** As an alternative one can use a standard guest kernel for the guest > 2.6.18 and make use sync backward compatibility option<br />
** Backport and instructions can be found in Anthony Liguori's [http://codemonkey.ws/virtio-ext-modules virtio-ext-modules]<br />
** At the moment it's broken since the guest got developed, soon update<br />
* Use model=virtio for the network devices and if=virtio for disk<br />
** Example<br />
<pre><nowiki><br />
qemu/x86_64-softmmu/qemu-system-x86_64 -boot c -drive file=/images/xpbase.qcow2,if=virtio,boot=on -m 384 -net nic,model=virtio -net tap,script=/etc/kvm/qemu-ifup<br />
</nowiki></pre><br />
* -hd[ab] for disk won't work, use -drive<br />
* Disk will show up as /dev/vd[a-z][1-9], if you migrate you need to change "root=" in Lilo/GRUB config<br />
* At the moment the kernel modules are automatically loaded in the guest but the interface should be started manually (dhclient/ifconfig)<br />
* Currently performance is much better when using a host kernel configured with CONFIG_HIGH_RES_TIMERS. Another option is use HPET/RTC and -clock= qemu option.<br />
* Expected performance<br />
** Performance varies from host to host, kernel to kernel<br />
** On my laptop I measured 1.1Gbps rx throughput using 2.6.23, 850Mbps tx.<br />
** Ping latency is 300-500 usec<br />
* Enjoy, more to come :)<br />
<br />
__NOTOC__</div>HollisBlanchardhttps://linux-kvm.org/index.php?title=KVM_Forum_2007&diff=1769KVM Forum 20072007-09-12T16:30:43Z<p>HollisBlanchard: </p>
<hr />
<div>[http://www.qumranet.com/images/kvm_logo.gif]<br />
<br />
= Information on the recently-concluded KVM Forum 2007 =<br />
== Agenda ==<br />
==== Wednesday August 29th ====<br />
{| border="1" cellpadding="2" cellspacing="0"<br />
| <b>Time</b> <br />
| <b>Session Topic</b> <br />
| <b>Speaker</b> <br />
| <br />
|-<br />
| 8:45 AM - 9:40 AM <br />
| [attachment:kf2007-keynote.pdf KVM, One Year On] <br />
| Avi Kivity, Qumranet <br />
| <br />
|-<br />
| 9:40 AM - 10:30 AM <br />
| The future of virtualization - KVM <br />
| Sunil Saxena, Intel <br />
| <br />
|-<br />
| 10:45 AM - 11:50 AM <br />
| KVM Security <br />
| Hadi Nahari, Montavista <br />
| <br />
|-<br />
| 1:35 PM - 2:30 PM <br />
| KVM & S390 <br />
| Carsten Otte, IBM <br />
| <br />
|-<br />
| 2:30 PM - 3:30 PM <br />
| KVM Lite, No Hardware Support, Fewer Calories <br />
| Rusty Russell, IBM <br />
| <br />
|-<br />
| 4:00 PM - 5:00 PM <br />
| VT Roadmap, Hybrid Virtualization, Power Management, Fat vs Thin Hypervisor <br />
| Jun Nakajima, Intel <br />
| <br />
|}<br />
==== Thursday August 30th ====<br />
{| border="1" cellpadding="2" cellspacing="0"<br />
| <b>Time</b> <br />
| <b>Session Topic</b> <br />
| <b>Speaker</b> <br />
| <br />
|-<br />
| 9:00 AM - 9:50 AM <br />
| [attachment:kvm_pv_drv.pdf KVM Para-Virtualized Guest Drivers] <br />
| Dor Laor, Qumranet <br />
| <br />
|-<br />
| 9:50 AM - 10:50 AM <br />
| [attachment:AMD_Extended_Migration-KVMForum-ElsieWahlig.pdf KVM Support for the AMD DEV] <br />
| Elsie Wahlig, AMD <br />
| <br />
|-<br />
| 9:50 AM - 10:50 AM <br />
| [attachment:kvm_iommu_talk.pdf A KVM friendly IOMMU API for Linux] <br />
| Joerg Roedel, AMD <br />
| <br />
|-<br />
| 10:50 AM - 11:45 AM <br />
| [attachment:KVMForum07_Liguori.pdf Automating VM Installation Testing] <br />
| Anthony Liguori, IBM <br />
| <br />
|-<br />
| 1:35 PM - 2:30 PM <br />
| [attachment:CIM4KVM.pdf Standards Based Systems Management Solution for KVM] <br />
| Anthony Liguori, IBM <br />
| <br />
|-<br />
| 2:35 PM - 3:30 PM <br />
| [attachment:KVM-tuning-testing-SMP2.pdf KVM Performance, SMP and in kernel PIC/APIC, KVM Validation] <br />
| Eddie Dong, Yungen Zhao, Xin Lin, Intel <br />
| <br />
|-<br />
| 4:00 PM - 5:35 PM <br />
| Open Session Panel <br />
| Avi Kivity, Qumranet <br />
| <br />
|}<br />
==== Friday August 31st ====<br />
{| border="1" cellpadding="2" cellspacing="0"<br />
| <b>Time</b> <br />
| <b>Session Topic</b> <br />
| <b>Speaker</b> <br />
| <br />
|-<br />
| 9:00 AM - 9:45 AM <br />
| [attachment:Kvm_Live_Migration_Forum_2007.pdf KVM Live Migration] <br />
| Anthony Liguori, IBM & Uri Lubin, Qumranet <br />
| <br />
|-<br />
| 9:50 AM - 10:35 AM <br />
| [attachment:shadowy-depths-of-the-kvm-mmu.pdf The Shadowy Depths of the KVM MMU] <br />
| Avi Kivity, Qumranet <br />
| <br />
|-<br />
| 10:50 AM - 11:45 AM <br />
| [attachment:KVM-IA64_forum_083107.pdf KVM for IPF (ia64)] <br />
| Anthony Xu, Intel <br />
| <br />
|-<br />
| 11:50 AM -12:45 PM <br />
| [attachment:KVM_Forum_-_Embedded_PowerPC.pdf Implementing KVM for Embedded PowerPC] <br />
| Hollis Blanchard, IBM <br />
| <br />
|-<br />
| 12:45 PM - 1.30 PM <br />
| [attachment:KVM_Forum_Concluding_Keynote.pdf Concluding Keynote] <br />
| Benny Schnaider, Qumranet <br />
| <br />
|}<br />
== Presentations ==<br />
== Blogs ==<br />
== Pictures ==<br />
* (from [[AmitShah]]) Pictures from the Pima Air and Space Museum and the Loews Ventana Canyon Resort: http://travel.webshots.com/album/560535651amWFjh<br />
<br />
__NOTOC__</div>HollisBlanchard