-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path2022-04-28T17_13_30.571Z - PCI passthrough via OVMF - ArchWiki.html
1752 lines (1705 loc) · 250 KB
/
2022-04-28T17_13_30.571Z - PCI passthrough via OVMF - ArchWiki.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<!DOCTYPE html> <html class="client-js vector-animations-ready" lang=en dir=ltr style><!--
Page saved with SingleFile
url: https://wiki.archlinux.org/title/PCI_passthrough_via_OVMF
saved date: Thu Apr 28 2022 22:43:30 GMT+0530 (India Standard Time)
--><meta charset=utf-8>
<title>PCI passthrough via OVMF - ArchWiki</title>
<style>:root{--sf-img-8: url("data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz4KPHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxMyIgaGVpZ2h0PSIxMyI+Cgk8cGF0aCBmaWxsPSIjMzZiIiBkPSJNNS4wMDIgMS4wMWg3djdsLTItMi0zIDJ2LTFsMy0yLjI1IDEgMVYyLjAxaC0zLjc1bDEgMS0yLjI1IDNoLTFsMi0zeiIvPgoJPHBhdGggZmlsbD0iIzM2YiIgZD0iTTcuMDAyIDMuMDFoLTV2OGg4di01aC0xdjRoLTZ2LTZoNHoiLz4KCTxwYXRoIGZpbGw9IiMxNWE1ZWEiIGQ9Ik00LjA4MiA1LjUxYzAtLjYyMS42MjEtLjYyMS42MjEtLjYyMSAxLjg2NC42MjEgMy4xMDcgMS44NjQgMy43MjggMy43MjggMCAwIDAgLjYyMS0uNjIuNjIxLTEuMjQ1LTEuODY0LTEuODY2LTIuNDg1LTMuNzMtMy43Mjh6Ii8+Cjwvc3ZnPgo=");--sf-img-13: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAYAAABXAvmHAAAABmJLR0QA/wD/AP+gvaeTAAALuUlEQVRogb2Ze3BdxX3HP7vnnPuUdPV+WUIgIT+EBZjxg/BubCjUhEBqKJnWkDaN26E8WqYz9WSmU/ijk2kmJYTiNKQzJelAE5JhiqltOcG4xtTI0Bowx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border-box;box-sizing:border-box;border:1px solid #a2a9b1;border-radius:2px;cursor:pointer;vertical-align:middle;font-family:inherit;font-size:1em;line-height:1.28571429em;text-align:center;-webkit-appearance:none}.mw-ui-button:not(.mw-ui-icon-element){min-height:32px;min-width:4em;max-width:28.75em;margin:0;padding:5px 12px}.mw-ui-button:not(:disabled){-webkit-transition:background-color 100ms,color 100ms,border-color 100ms,box-shadow 100ms;transition:background-color 100ms,color 100ms,border-color 100ms,box-shadow 100ms}.mw-ui-button:not(:disabled):visited{color:#202122}.mw-ui-button:not(:disabled):hover{background-color:#ffffff;color:#404244;border-color:#a2a9b1}.mw-ui-button:not(:disabled):focus{color:#202122;border-color:#3366cc;box-shadow:inset 0 0 0 1px #3366cc,inset 0 0 0 2px #ffffff;outline-width:0}.mw-ui-button:not(:disabled):active,.mw-ui-button:not(:disabled).is-on{background-color:#c8ccd1;color:#000000;border-color:#72777d;box-shadow:none}.mw-ui-button:disabled{background-color:#c8ccd1;color:#ffffff;border-color:#c8ccd1;cursor:default}.mw-ui-button.mw-ui-icon-element:not(.mw-ui-icon-with-label-desktop){color:transparent!important}.mw-ui-button.mw-ui-icon-element:not(.mw-ui-icon-with-label-desktop) span{display:block;position:absolute!important;clip:rect(1px,1px,1px,1px);width:1px;height:1px;margin:-1px;border:0;padding:0;overflow:hidden}@media all and (max-width:1000px){.mw-ui-button.mw-ui-icon-element span{display:block;position:absolute!important;clip:rect(1px,1px,1px,1px);width:1px;height:1px;margin:-1px;border:0;padding:0;overflow:hidden}}.mw-ui-button.mw-ui-quiet{background-color:transparent;color:#202122;border-color:transparent;font-weight:bold}.mw-ui-button.mw-ui-quiet:not(.mw-ui-icon-element),.mw-ui-button.mw-ui-quiet.mw-ui-progressive:not(.mw-ui-icon-element),.mw-ui-button.mw-ui-quiet.mw-ui-destructive:not(.mw-ui-icon-element){min-height:32px}input[type='checkbox']:hover+.mw-ui-button.mw-ui-quiet,input[type='checkbox']:hover+.mw-ui-button.mw-ui-quiet.mw-ui-progressive,input[type='checkbox']:hover+.mw-ui-button.mw-ui-quiet.mw-ui-destructive,.mw-ui-button.mw-ui-quiet:hover,.mw-ui-button.mw-ui-quiet.mw-ui-progressive:hover,.mw-ui-button.mw-ui-quiet.mw-ui-destructive:hover{background-color:rgba(0,24,73,0.02745098);color:#202122;border-color:transparent}input[type='checkbox']:focus+.mw-ui-button.mw-ui-quiet,input[type='checkbox']:focus+.mw-ui-button.mw-ui-quiet.mw-ui-progressive,input[type='checkbox']:focus+.mw-ui-button.mw-ui-quiet.mw-ui-destructive,.mw-ui-button.mw-ui-quiet:focus,.mw-ui-button.mw-ui-quiet.mw-ui-progressive:focus,.mw-ui-button.mw-ui-quiet.mw-ui-destructive:focus{color:#202122;border-color:#3366cc;box-shadow:inset 0 0 0 1px #3366cc,inset 0 0 0 2px #ffffff}input[type='checkbox']:active+.mw-ui-button.mw-ui-quiet,input[type='checkbox']:active+.mw-ui-button.mw-ui-quiet.mw-ui-progressive,input[type='checkbox']:active+.mw-ui-button.mw-ui-quiet.mw-ui-destructive,.mw-ui-button.mw-ui-quiet:active,.mw-ui-button.mw-ui-quiet.mw-ui-progressive:active,.mw-ui-button.mw-ui-quiet.mw-ui-destructive:active{background-color:rgba(0,36,73,0.08235294);color:#000000;border-color:#72777d;box-shadow:none}.mw-ui-button.mw-ui-quiet:disabled,.mw-ui-button.mw-ui-quiet.mw-ui-progressive:disabled,.mw-ui-button.mw-ui-quiet.mw-ui-destructive:disabled,.mw-ui-button.mw-ui-quiet:disabled:hover,.mw-ui-button.mw-ui-quiet.mw-ui-progressive:disabled:hover,.mw-ui-button.mw-ui-quiet.mw-ui-destructive:disabled:hover,.mw-ui-button.mw-ui-quiet:disabled:active,.mw-ui-button.mw-ui-quiet.mw-ui-progressive:disabled:active,.mw-ui-button.mw-ui-quiet.mw-ui-destructive:disabled:active{background-color:transparent;color:#72777d;border-color:transparent}a.mw-ui-button{text-decoration:none}a.mw-ui-button:hover,a.mw-ui-button:focus{text-decoration:none}.mw-ui-icon{font-size:initial;position:relative;display:inline-block;box-sizing:content-box!important;width:1.25em;height:1.25em;min-width:1.25em;min-height:1.25em;flex-basis:1.25em;vertical-align:middle;line-height:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;-moz-appearance:none;-webkit-appearance:none;background-color:transparent;margin:0;padding:0}.mw-ui-icon:not(.mw-ui-button){border:0}.mw-ui-icon:before{content:'';display:block;width:100%;height:100%;min-width:1.25em;min-height:1.25em;background-repeat:no-repeat;background-size:1.25em 1.25em;background-position:center}.mw-ui-icon-element{border-radius:2px;padding:0.75em;-webkit-transition:background-color 100ms;transition:background-color 100ms}.mw-ui-icon-element:focus,.mw-ui-icon-element:active,.mw-ui-icon-element:visited{color:transparent}.mw-ui-icon-element:active{background-color:rgba(0,0,0,0.03)}@media (hover:hover){.mw-ui-icon-element:not(.disabled):hover{background-color:rgba(0,0,0,0.03)}}.mw-ui-icon-before{width:auto;max-width:100%}.mw-ui-icon-before:before{display:inline-block;font-size:initial;width:auto;min-width:1.25em;min-height:1.25em;margin-right:8px;vertical-align:middle}.mw-ui-icon-before span{vertical-align:middle}.mw-ui-icon-wikimedia-ellipsis:before{background-image:url(data:text/plain;base64,SW1hZ2UgZ2VuZXJhdGlvbiBmYWlsZWQ=);background-image:linear-gradient(transparent,transparent),url(data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz4KPHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMCIgaGVpZ2h0PSIyMCIgdmlld0JveD0iMCAwIDIwIDIwIj48dGl0bGU+ZWxsaXBzaXM8L3RpdGxlPjxnIGZpbGw9IiMwMDAiPjxjaXJjbGUgY3g9IjEwIiBjeT0iMTAiIHI9IjIiLz48Y2lyY2xlIGN4PSIzIiBjeT0iMTAiIHI9IjIiLz48Y2lyY2xlIGN4PSIxNyIgY3k9IjEwIiByPSIyIi8+PC9nPjwvc3ZnPgo=)}.mw-ui-icon-wikimedia-logIn:before{background-image:url(data:text/plain;base64,SW1hZ2UgZ2VuZXJhdGlvbiBmYWlsZWQ=);background-image:linear-gradient(transparent,transparent),url(data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz4KPHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMCIgaGVpZ2h0PSIyMCIgdmlld0JveD0iMCAwIDIwIDIwIj48dGl0bGU+bG9nIGluPC90aXRsZT48ZyBmaWxsPSIjMDAwIj48cGF0aCBkPSJNMSAxMXY2YzAgMS4xLjkgMiAyIDJoMTRjMS4xIDAgMi0uOSAyLTJWM2MwLTEuMS0uOS0yLTItMkgzYy0xLjEgMC0yIC45LTIgMnY2aDhWNWw0Ljc1IDVMOSAxNXYtNEgxeiIvPjwvZz48L3N2Zz4K)}body{margin:0}main{display:block}@supports (text-decoration:underline dotted){abbr[title]{border-bottom:0;text-decoration:underline dotted}}pre{font-family:monospace,monospace}sup{line-height:1}img{border:0}input{margin:0}.toctogglecheckbox:checked~ul{display:none}@media screen{html,body{height:100%}:focus{outline-color:#3366cc}html{font-size:100%}html,body{font-family:sans-serif}ul{list-style-image:url(data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz4KPHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSI1IiBoZWlnaHQ9IjEzIj4KCTxjaXJjbGUgY3g9IjIuNSIgY3k9IjkiIHI9IjIuNSIgZmlsbD0iIzIwMjEyMiIvPgo8L3N2Zz4K)}pre{line-height:1.3}.mw-jump-link:not(:focus){display:block;position:absolute!important;clip:rect(1px,1px,1px,1px);width:1px;height:1px;margin:-1px;border:0;padding:0;overflow:hidden}.mw-body h1,.mw-body-content h2{margin-bottom:0.25em;padding:0;font-family:'Linux Libertine','Georgia','Times',serif;line-height:1.3}.mw-body h1:lang(ja),.mw-body-content h1:lang(ja),.mw-body-content h2:lang(ja),.mw-body h1:lang(he),.mw-body-content h1:lang(he),.mw-body-content h2:lang(he),.mw-body h1:lang(ko),.mw-body-content h1:lang(ko),.mw-body-content h2:lang(ko){font-family:sans-serif}.mw-body h1:lang(my),.mw-body-content h1:lang(my),.mw-body-content h2:lang(my){line-height:normal}.mw-body h1{font-size:1.8em}.vector-body{font-size:calc(1em * 0.875);line-height:1.6}.vector-body h2{margin-top:1em;font-size:1.5em}.vector-body h3,.vector-body h4,.vector-body h5,.vector-body h6{margin-top:0.3em;margin-bottom:0;padding-bottom:0;line-height:1.6}.vector-body h3{font-size:1.2em}.vector-body h3,.vector-body h4{font-weight:bold}.vector-body h4,.vector-body h5,.vector-body h6{font-size:100%}.vector-body .toc h2{font-family:sans-serif;font-size:100%}.vector-body p{margin:0.5em 0}.mw-parser-output .external{background-image:url(data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz4KPHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxMiIgaGVpZ2h0PSIxMiI+Cgk8cGF0aCBmaWxsPSIjZmZmIiBzdHJva2U9IiMzNmMiIGQ9Ik0xLjUgNC41MThoNS45ODJWMTAuNUgxLjV6Ii8+Cgk8cGF0aCBmaWxsPSIjMzZjIiBkPSJNNS43NjUgMUgxMXY1LjM5TDkuNDI3IDcuOTM3bC0xLjMxLTEuMzFMNS4zOTMgOS4zNWwtMi42OS0yLjY4OCAyLjgxLTIuODA4TDQuMiAyLjU0NHoiLz4KCTxwYXRoIGZpbGw9IiNmZmYiIGQ9Im05Ljk5NSAyLjAwNC4wMjIgNC44ODVMOC4yIDUuMDcgNS4zMiA3Ljk1IDQuMDkgNi43MjNsMi44ODItMi44OC0xLjg1LTEuODUyeiIvPgo8L3N2Zz4K);background-position:center right;background-repeat:no-repeat;padding-right:13px}.mw-body .mw-indicators{font-size:0.875em;line-height:1.6;position:relative}#siteNotice{font-size:0.8em}.mw-portlet ul{list-style:none none;margin:0}.vector-menu-tabs{background-position:left bottom;float:left;height:2.5em;padding-left:1px}.vector-menu-tabs ul{float:left;height:100%;list-style:none none;margin:0;padding:0}.vector-menu-tabs li{background-image:linear-gradient(to top,#77c1f6 0,#e8f2f8 1px,#ffffff 100%);background-position:left bottom;background-repeat:repeat-x;float:left;display:block;height:100%;margin:0;padding:0;line-height:1.125em;white-space:nowrap}.vector-menu-tabs li a{background-position:right bottom;color:#0645ad;-moz-box-sizing:border-box;box-sizing:border-box;display:block;float:left;height:3.07692308em;position:relative;padding-top:1.25em;padding-left:8px;padding-right:8px;font-size:0.8125em;cursor:pointer}.vector-menu-tabs .selected{background:#ffffff}.vector-menu-tabs .selected a,.vector-menu-tabs .selected a:visited{color:#202122;text-decoration:none}@-webkit-keyframes rotate{from{-webkit-transform:rotate(0deg);transform:rotate(0deg)}to{-webkit-transform:rotate(360deg);transform:rotate(360deg)}}@keyframes rotate{from{-webkit-transform:rotate(0deg);transform:rotate(0deg)}to{-webkit-transform:rotate(360deg);transform:rotate(360deg)}}.vector-menu-dropdown{direction:ltr;float:left;cursor:pointer;position:relative;line-height:1.125em}.vector-menu-dropdown h3{color:#54595d;position:relative;display:block;-moz-box-sizing:border-box;box-sizing:border-box}.vector-menu-dropdown h3:after{content:'';background-image:url(data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz4KPHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxMiIgaGVpZ2h0PSIxMiIgdmlld0JveD0iMCAwIDEyIDEyIj4KCTxwYXRoIGZpbGw9IiMyMDIxMjIiIGQ9Im0xMS4wNSAzLjk5Ni0uOTY1LTEuMDUzLTQuMDM1IDMuODYtMy45NDctMy44NkwxLjA1IDMuOTk2bDUgNSA1LTUiLz4KPC9zdmc+Cg==);background-position:100% 50%;background-repeat:no-repeat;position:absolute;top:0.76923077em;right:8px;bottom:0;width:1.23076923em;opacity:0.84}.vector-menu-dropdown h3:hover,.vector-menu-dropdown h3:focus{color:#202122}.vector-menu-dropdown h3:hover:after,.vector-menu-dropdown h3:focus:after{opacity:1}.vector-menu-dropdown .vector-menu-content{background-color:#ffffff;list-style:none none;min-width:100%;position:absolute;top:2.5em;left:-1px;margin:0;border:1px solid #a2a9b1;border-top-width:0;padding:0;box-shadow:0 1px 1px 0 rgba(0,0,0,0.1);text-align:left;opacity:0;visibility:hidden;-webkit-transition:opacity 100ms;transition:opacity 100ms;z-index:3}.vector-menu-dropdown .vector-menu-checkbox-expanded,.vector-menu-dropdown .vector-menu-checkbox-collapsed{position:absolute!important;clip:rect(1px,1px,1px,1px);width:1px;height:1px;margin:-1px;border:0;padding:0;overflow:hidden;display:none}.vector-menu-dropdown .vector-menu-checkbox:checked+.vector-menu-heading .vector-menu-checkbox-expanded,.vector-menu-dropdown .vector-menu-checkbox:not(:checked)+.vector-menu-heading .vector-menu-checkbox-collapsed{display:inline}.vector-menu-dropdown .vector-menu-checkbox:checked~.vector-menu-content{opacity:1;visibility:visible}.vector-menu-dropdown ul{list-style:none}.vector-menu-tabs,.vector-menu-tabs a{background-image:linear-gradient(to bottom,rgba(167,215,249,0) 0,#a7d7f9 100%);background-repeat:no-repeat;background-size:1px 100%}.vector-menu-checkbox{cursor:pointer;position:absolute;top:0;left:0;z-index:1;opacity:0;width:100%;height:100%;margin:0;padding:0;display:none}:not(:checked)>.vector-menu-checkbox{display:block}.vector-menu-portal{margin:0 0.6em 0 0.7em;padding:0.25em 0;direction:ltr}.vector-menu-portal h3{display:block;background-image:linear-gradient(to right,rgba(200,204,209,0) 0,#c8ccd1 33%,#c8ccd1 66%,rgba(200,204,209,0) 100%);background-position:center bottom;background-repeat:no-repeat;background-size:100% 1px;color:#54595d;margin:0.5em 0 0 0.66666667em;border:0;padding:0.25em 0;font-size:0.75em;font-weight:normal;cursor:default}.vector-menu-portal .vector-menu-content{margin-left:0.5em;padding-top:0}.vector-menu-portal .vector-menu-content ul{list-style:none none;margin:0;padding-top:0.3em}.vector-menu-portal .vector-menu-content li{margin:0;padding:0.25em 0;font-size:0.75em;line-height:1.125em;word-wrap:break-word}.vector-menu-portal .vector-menu-content li a{color:#0645ad}.vector-menu-portal .vector-menu-content li a:visited{color:#0b0080}#p-search h3{display:block;position:absolute!important;clip:rect(1px,1px,1px,1px);width:1px;height:1px;margin:-1px;border:0;padding:0;overflow:hidden}#simpleSearch{position:relative;height:100%}#searchInput{background-color:rgba(255,255,255,0.5);color:#000000;width:100%;height:2.15384615em;-moz-box-sizing:border-box;box-sizing:border-box;border:1px solid #a2a9b1;border-radius:2px;padding:5px 2.15384615em 5px 0.4em;box-shadow:inset 0 0 0 1px transparent;font-family:inherit;font-size:0.8125em;direction:ltr;-webkit-transition:border-color 250ms,box-shadow 250ms;transition:border-color 250ms,box-shadow 250ms;-webkit-appearance:none;-moz-appearance:textfield}#simpleSearch:hover #searchInput{border-color:#72777d}#searchInput:focus,#simpleSearch:hover #searchInput:focus{outline:0;border-color:#3366cc;box-shadow:inset 0 0 0 1px #3366cc}#searchInput::-webkit-input-placeholder{color:#72777d;opacity:1}#searchInput::placeholder{color:#72777d;opacity:1}#searchInput::-webkit-search-decoration,#searchInput::-webkit-search-cancel-button,#searchInput::-webkit-search-results-button,#searchInput::-webkit-search-results-decoration{display:none}#searchButton,#mw-searchButton{background-color:transparent;position:absolute;top:1px;bottom:1px;right:1px;min-width:28px;width:2.15384615em;border:0;padding:0;cursor:pointer;font-size:0.8125em;direction:ltr;text-indent:-99999px;white-space:nowrap;overflow:hidden;z-index:1}#searchButton{background:no-repeat center / 1.23076923em url(data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz4KPHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMCIgaGVpZ2h0PSIyMCIgdmlld0JveD0iMCAwIDIwIDIwIj4KCTx0aXRsZT4KCQlzZWFyY2gKCTwvdGl0bGU+Cgk8cGF0aCBmaWxsLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik0xMi4yIDEzLjZhNyA3IDAgMSAxIDEuNC0xLjRsNS40IDUuNC0xLjQgMS40LTUuNC01LjR6TTEzIDhBNSA1IDAgMSAxIDMgOGE1IDUgMCAwIDEgMTAgMHoiLz4KPC9zdmc+Cg==);opacity:0.67}.vector-search-box-collapses>div{display:none}.mw-footer{direction:ltr}.mw-footer ul{list-style:none none;margin:0;padding:0}.mw-footer li{color:#202122;margin:0;padding:0.5em 0;font-size:0.75em}#footer-info li{line-height:1.4}#footer-places li{float:left;margin-right:1em;line-height:2}}@media screen and (min-width:1000px){.vector-search-box-collapses>div{display:block}}@media screen{body{background-color:#f8f9fa;color:#202122;overflow-y:scroll}.mw-body{direction:ltr}.mw-body{border-top:1px solid #a7d7f9;margin-top:-1px;padding:1.25em 0.5em 1.5em}.mw-body .firstHeading{overflow:visible}.mw-header{min-height:3.125em;margin:0.625em 0 0.3125em;padding:0.125em 0;display:-ms-flexbox;display:flex;flex-wrap:nowrap;align-items:center;position:relative;z-index:4}#p-search{float:left;margin:0 0 0 2.85714286em;z-index:3;flex-grow:1}#p-search>div>#searchform{-moz-box-sizing:border-box;box-sizing:border-box;margin-left:0}.mw-body,#left-navigation,.mw-footer{margin-left:0}.mw-indicators{z-index:1}.vector-body{position:relative;z-index:0}#mw-navigation h2{position:absolute;top:-9999px}.mw-article-toolbar-container{max-width:60em;margin-left:auto;margin-right:auto}.mw-article-toolbar-container:after{clear:both;content:'';display:block}#left-navigation{float:left}#right-navigation{float:right}#right-navigation .vector-menu-content{left:auto;right:-1px}#mw-sidebar-button{float:left;margin-left:-0.75em;margin-right:0.75em}#mw-panel{background-image:linear-gradient(to bottom,#ffffff 0%,#f8f9fa 10%,#f8f9fa 90%,#ffffff 100%);position:absolute;left:-1.875em;width:11em;-moz-box-sizing:border-box;box-sizing:border-box;padding:8px 0 40px 0.8125em;z-index:1}#p-namespaces{background-image:none;padding-left:0}.mw-footer{border-top:1px solid #a2a9b1;padding:0.75em}.mw-page-container{max-width:103.125em;min-height:100%;margin-left:auto;margin-right:auto;padding:0.05px 0.9375em;background-color:#ffffff}.skin--responsive .mw-page-container{min-width:auto}.mw-page-container-inner{position:relative}.mw-workspace-container{max-width:90em;margin-left:auto;margin-right:auto;position:relative}.mw-workspace-container.mw-footer-container{position:static}.mw-content-container{max-width:60em;margin-left:auto;margin-right:auto}.mw-footer-container{padding-top:50px;padding-bottom:82px}#mw-sidebar-checkbox:not(:checked)~.mw-workspace-container .mw-sidebar{-webkit-transform:translateX(-6.5625em);-ms-transform:translateX(-6.5625em);transform:translateX(-6.5625em)}@keyframes search-loader-progress-bar{0%{background-size:0 2px;background-position:-10% 0}30%{background-size:30% 2px;background-position:-10% 0}70%{background-size:30% 2px;background-position:110% 0}100%{background-size:0 2px;background-position:110% 0}}#p-search{font-size:calc(1em * 0.875)}#searchInput,#searchButton,#mw-searchButton{font-size:inherit}#searchInput{height:2.28571429em}#searchButton,#mw-searchButton{background-size:1.42857143em auto}.client-js .skin-vector-search-vue #searchInput{padding-left:2.57142857em;padding-right:8px}.client-js .skin-vector-search-vue #searchButton,.client-js .skin-vector-search-vue #mw-searchButton{pointer-events:none;right:auto;top:0;bottom:0;left:1px;width:2.57142857em}.client-js .skin-vector-search-vue .p-search--show-thumbnail #searchInput:focus,.client-js .skin-vector-search-vue .vector-search-box-show-thumbnail #searchInput:focus{position:relative;padding-left:calc(2.57142857em + 24px);width:calc(100% + 24px);left:calc(-1 * 24px)}.client-js .skin-vector-search-vue .p-search--show-thumbnail #searchInput:focus~#searchButton,.client-js .skin-vector-search-vue .vector-search-box-show-thumbnail #searchInput:focus~#searchButton,.client-js .skin-vector-search-vue .p-search--show-thumbnail #searchInput:focus~#mw-searchButton,.client-js .skin-vector-search-vue .vector-search-box-show-thumbnail #searchInput:focus~#mw-searchButton{left:-11px}#mw-panel{font-size:inherit}#mw-panel nav:first-child{background-image:none}#mw-panel nav:first-child h3{display:none}#mw-panel nav:first-child .vector-menu-content{margin-left:0.5em}.mw-checkbox-hack-button{display:inline-block;cursor:pointer}#mw-sidebar-button:before{opacity:0.67;background-image:url("data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 width=%2220%22 height=%2220%22 viewBox=%220 0 20 20%22%3E %3Ctitle%3E chevron %3C/title%3E %3Cpath d=%22m9 2 1.3 1.3L3.7 10l6.6 6.7L9 18l-8-8 8-8zm8.5 0L19 3.3 12.2 10l6.7 6.7-1.4 1.3-8-8 8-8z%22/%3E %3C/svg%3E")}#mw-sidebar-checkbox:not(:checked)~.mw-header #mw-sidebar-button:before{background-image:url("data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 width=%2220%22 height=%2220%22 viewBox=%220 0 20 20%22%3E %3Ctitle%3E menu %3C/title%3E %3Cpath d=%22M1 3v2h18V3zm0 8h18V9H1zm0 6h18v-2H1z%22/%3E %3C/svg%3E")}#mw-sidebar-button:hover:before{opacity:1}#mw-sidebar-checkbox:not(:checked)~.mw-workspace-container .mw-sidebar{visibility:hidden;opacity:0;-webkit-transform:translateX(-100%);-ms-transform:translateX(-100%);transform:translateX(-100%)}.vector-animations-ready .mw-sidebar{-webkit-transition:transform 100ms ease-out,opacity 100ms ease-out,visibility 100ms ease-out;transition:transform 100ms ease-out,opacity 100ms ease-out,visibility 100ms ease-out}.vector-animations-ready #mw-sidebar-button{-webkit-transition:background-color 100ms,border-color 100ms,box-shadow 100ms;transition:background-color 100ms,border-color 100ms,box-shadow 100ms}.vector-user-links{display:flex;align-items:center;position:relative;justify-content:flex-end;flex-shrink:1}.vector-user-links .vector-user-menu-more{font-size:0.875em}.vector-user-links .vector-user-menu-more .vector-menu-content-list{display:flex;align-items:center}.vector-user-links .vector-user-menu-more .vector-menu-content-list li{margin:0;white-space:nowrap}.vector-user-links .vector-user-menu-more .vector-menu-content-list li a{color:#202122;text-decoration:none}.vector-user-links .vector-user-menu-more .vector-menu-content-list li.user-links-collapsible-item{display:none}.vector-user-links .vector-user-menu-more .mw-ui-button{display:flex;align-items:center}.vector-user-links .vector-user-menu.emptyPortlet{display:block}.vector-user-links .vector-user-menu .vector-menu-heading.mw-ui-icon>span{color:transparent}.vector-user-links .vector-user-menu .vector-menu-content{min-width:200px;max-width:21.875em;top:100%;left:unset;right:0;border-top-width:1px;border-radius:2px;box-shadow:0 2px 2px 0 rgba(0,0,0,0.25)}.vector-user-links .vector-user-menu .vector-menu-content-item{min-height:2em;display:flex;align-items:center;padding:0 12px;color:#202122;text-decoration:none}.vector-user-links .vector-user-menu .vector-menu-content-item span{font-size:0.875em;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;line-height:initial}.vector-user-links .vector-user-menu li>a:hover,.vector-user-links .vector-user-menu .vector-menu-content-item:hover,.vector-user-links .vector-user-menu .mw-list-item>a:hover{background-color:#f6f6f6}.vector-user-links .vector-user-menu .vector-menu-content-item-login{border-bottom:1px solid #a2a9b1}.vector-user-links .vector-user-menu .vector-user-menu-anon-editor{padding:4px 12px;color:#54595d;font-size:0.875em}.vector-user-links .vector-user-menu .vector-user-menu-anon-editor p{margin:0}.vector-user-links .vector-user-menu .vector-user-menu-anon-editor a:before{content:'(';color:#54595d}.vector-user-links .vector-user-menu .vector-user-menu-anon-editor a:after{content:')';color:#54595d}.vector-user-links .vector-user-menu-logged-out h3:before{height:100%}.vector-user-links .vector-user-menu-logged-out h3:after{content:none}}@media screen and (min-width:106.875em){.mw-page-container{border-left:1px solid #f8f9fa;border-right:1px solid #f8f9fa}}@media screen and (max-width:86.75em){.mw-checkbox-hack-checkbox:checked~.mw-workspace-container .mw-content-container,.mw-checkbox-hack-checkbox:checked~.mw-workspace-container .mw-article-toolbar-container{margin-left:11.5em}.vector-animations-ready .mw-sidebar{-webkit-transition:none;transition:none}}@media screen and (min-width:93.75em){#mw-panel{background:#ffffff;border-right:1px solid #f8f9fa}}@media screen and (min-width:1000px){#p-search{margin:0 12px 0 2.85714286em;width:20vw;max-width:100%;min-width:25em;flex-basis:10.71428571em;flex-grow:1}#p-search>div>#searchform{max-width:35.71428571em}.mw-page-container{padding-left:1.875em;padding-right:1.875em}}@media screen and (max-width:720px){.mw-checkbox-hack-checkbox:checked~.mw-workspace-container #mw-panel{width:100%;position:relative;left:0}.mw-checkbox-hack-checkbox:checked~.mw-workspace-container .mw-content-container,.mw-checkbox-hack-checkbox:checked~.mw-workspace-container .mw-article-toolbar-container{margin-left:0!important}}@media screen and (max-width:720px){.vector-animations-ready .mw-sidebar{transition:none}}@media screen and (min-width:720px){.vector-user-links .vector-user-menu-more .vector-menu-content-list li.user-links-collapsible-item{display:block}}@media screen{.mw-parser-output a.extiw:visited,.mw-parser-output a.external:visited{color:#663366}.mw-parser-output a.extiw:active,.mw-parser-output a.external:active{color:#bb6633}.plainlinks a.external{background:none!important;padding:0!important}.mw-parser-output a.external{background-image:var(--sf-img-8);background-position:center right;background-repeat:no-repeat;padding-right:13px}.mw-parser-output a.external[href$='.pdf'],.mw-parser-output a.external[href*='.pdf#']{background-image:url(data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz4KPHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxMyIgaGVpZ2h0PSIxMyI+Cgk8cGF0aCBmaWxsPSIjMTVhNWVhIiBkPSJNNy41IDJ2M0gxMGwxLTFIOC41VjF6Ii8+Cgk8cGF0aCBmaWxsPSIjMzZiIiBkPSJNMyAxdjEwaDhWNEw4LjUgMXptMSAxaDRsMiAyLjVWMTBINHoiLz4KPC9zdmc+Cg==);background-position:center right;background-repeat:no-repeat;padding-right:13px}.mw-parser-output a.extiw,.mw-parser-output a.extiw:active{color:#36b}.mw-parser-output a.external{color:#36b}.mw-body-content:after{clear:both;content:'';display:block}.mw-body-content a.external.free{word-wrap:break-word}#siteNotice{position:relative;text-align:center;margin:0}#contentSub,#contentSub2{font-size:84%;line-height:1.2em;margin:0 0 1.4em 1em;color:#54595d;width:auto}.emptyPortlet{display:none}.mw-indicators{float:right}#catlinks{text-align:left}.catlinks{border:1px solid #a2a9b1;background-color:#f8f9fa;padding:5px;margin-top:1em;clear:both}.catlinks ul{display:inline;margin:0;padding:0;list-style:none}.catlinks li{display:inline-block;line-height:1.25em;border-left:1px solid #a2a9b1;margin:0.125em 0;padding:0 0.5em}.catlinks li:first-child{padding-left:0.25em;border-left:0}a{text-decoration:none;color:#0645ad;background:none}a:not([href]){cursor:pointer}a:visited{color:#0b0080}a:active{color:#faa700}a:hover,a:focus{text-decoration:underline}a:lang(ar),a:lang(kk-arab),a:lang(mzn),a:lang(ps),a:lang(ur){text-decoration:none}img{border:0;vertical-align:middle}h1,h2,h3,h4,h5,h6{color:#000;margin:0;padding-top:0.5em;padding-bottom:0.17em;overflow:hidden}h1,h2{margin-bottom:0.6em;border-bottom:1px solid #a2a9b1}h3,h4,h5{margin-bottom:0.3em}h1{font-size:188%;font-weight:normal}h2{font-size:150%;font-weight:normal}h3{font-size:128%}h4{font-size:116%}h5{font-size:108%}h6{font-size:100%}p{margin:0.4em 0 0.5em 0}p img{margin:0}ul{margin:0.3em 0 0 1.6em;padding:0}ol{list-style-image:none}li{margin-bottom:0.1em}pre,code{font-family:monospace,monospace}pre,code{background-color:#f8f9fa;color:#000;border:1px solid #eaecf0}code{border-radius:2px;padding:1px 4px}pre{padding:1em;white-space:pre-wrap;overflow-x:hidden;word-wrap:break-word}form{border:0;margin:0}@counter-style meetei{system:numeric;symbols:'\ABF0' '\ABF1' '\ABF2' '\ABF3' '\ABF4' '\ABF5' '\ABF6' '\ABF7' '\ABF8' '\ABF9';suffix:') '}@counter-style santali{system:numeric;symbols:'\1C50' '\1C51' '\1C52' '\1C53' '\1C54' '\1C55' '\1C56' '\1C57' '\1C58' '\1C59'}ol:lang(azb) li,ol:lang(bcc) li,ol:lang(bgn) li,ol:lang(bqi) li,ol:lang(fa) li,ol:lang(glk) li,ol:lang(kk-arab) li,ol:lang(lrc) li,ol:lang(luz) li,ol:lang(mzn) li{list-style-type:persian}ol:lang(ckb) li,ol:lang(sdh) li{list-style-type:arabic-indic}ol:lang(hi) li,ol:lang(mai) li,ol:lang(mr) li,ol:lang(ne) li{list-style-type:devanagari}ol:lang(as) li,ol:lang(bn) li{list-style-type:bengali}ol:lang(mni) li{list-style-type:meetei}ol:lang(or) li{list-style-type:oriya}ol:lang(sat) li{list-style-type:santali}.mw-content-ltr ul{margin:0.3em 0 0 1.6em;padding:0}.mw-content-ltr ol{margin:0.3em 0 0 3.2em;padding:0}h1:lang(anp),h1:lang(as),h1:lang(bh),h1:lang(bho),h1:lang(bn),h1:lang(gu),h1:lang(hi),h1:lang(kn),h1:lang(ks),h1:lang(ml),h1:lang(mr),h1:lang(my),h1:lang(mai),h1:lang(ne),h1:lang(new),h1:lang(or),h1:lang(pa),h1:lang(pi),h1:lang(sa),h1:lang(ta),h1:lang(te){line-height:1.6em!important}h2:lang(anp),h3:lang(anp),h4:lang(anp),h5:lang(anp),h6:lang(anp),h2:lang(as),h3:lang(as),h4:lang(as),h5:lang(as),h6:lang(as),h2:lang(bho),h3:lang(bho),h4:lang(bho),h5:lang(bho),h6:lang(bho),h2:lang(bh),h3:lang(bh),h4:lang(bh),h5:lang(bh),h6:lang(bh),h2:lang(bn),h3:lang(bn),h4:lang(bn),h5:lang(bn),h6:lang(bn),h2:lang(gu),h3:lang(gu),h4:lang(gu),h5:lang(gu),h6:lang(gu),h2:lang(hi),h3:lang(hi),h4:lang(hi),h5:lang(hi),h6:lang(hi),h2:lang(kn),h3:lang(kn),h4:lang(kn),h5:lang(kn),h6:lang(kn),h2:lang(ks),h3:lang(ks),h4:lang(ks),h5:lang(ks),h6:lang(ks),h2:lang(ml),h3:lang(ml),h4:lang(ml),h5:lang(ml),h6:lang(ml),h2:lang(mr),h3:lang(mr),h4:lang(mr),h5:lang(mr),h6:lang(mr),h2:lang(my),h3:lang(my),h4:lang(my),h5:lang(my),h6:lang(my),h2:lang(mai),h3:lang(mai),h4:lang(mai),h5:lang(mai),h6:lang(mai),h2:lang(ne),h3:lang(ne),h4:lang(ne),h5:lang(ne),h6:lang(ne),h2:lang(new),h3:lang(new),h4:lang(new),h5:lang(new),h6:lang(new),h2:lang(or),h3:lang(or),h4:lang(or),h5:lang(or),h6:lang(or),h2:lang(pa),h3:lang(pa),h4:lang(pa),h5:lang(pa),h6:lang(pa),h2:lang(pi),h3:lang(pi),h4:lang(pi),h5:lang(pi),h6:lang(pi),h2:lang(sa),h3:lang(sa),h4:lang(sa),h5:lang(sa),h6:lang(sa),h2:lang(ta),h3:lang(ta),h4:lang(ta),h5:lang(ta),h6:lang(ta),h2:lang(te),h3:lang(te),h4:lang(te),h5:lang(te),h6:lang(te){line-height:1.4em}h2:lang(th){line-height:1.6}.toc{border:1px solid #a2a9b1;background-color:#f8f9fa;font-size:95%}.toc{display:table;padding:7px}.toc h2{display:inline;border:0;padding:0;font-size:100%;font-weight:bold}.toc .toctitle{text-align:center}.toc ul{list-style:none;margin:0.3em 0;padding:0}.tocnumber,.toctext{display:table-cell;text-decoration:inherit}.tocnumber{color:#202122}.mw-content-ltr .tocnumber{padding-left:0;padding-right:0.5em}.toctogglecheckbox{display:inline!important;position:absolute;opacity:0;z-index:-1}.toctogglespan{font-size:94%}.toctogglespan:before{content:' ['}.toctogglespan:after{content:']'}.toctogglelabel{cursor:pointer;color:#0645ad}.toctogglelabel:hover{text-decoration:underline}.toctogglecheckbox:focus+.toctitle .toctogglelabel{text-decoration:underline;outline:dotted 1px;outline:auto -webkit-focus-ring-color}.toctogglecheckbox:checked+.toctitle .toctogglelabel:after{content:'show'}.toctogglecheckbox:not(:checked)+.toctitle .toctogglelabel:after{content:'hide'}.toc .toctitle{direction:ltr}.mw-content-ltr .toc ul{text-align:left}.mw-content-ltr .toc ul ul{margin:0 0 0 2em}}#archnavbar{height:40px!important;padding:10px 15px!important;background:#333!important;border-bottom:5px #08c solid!important}#archnavbarlogo{float:left!important;margin:0!important;padding:0!important;height:40px!important;width:190px!important}html>body #archnavbarlogo{background:url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZlcnNpb249IjEiIHdpZHRoPSI2MDAiIGhlaWdodD0iMTI2Ij48cGF0aCBkPSJNMTU5LjU2OCAzNC40MjdjLTguODktLjAxNC0xNi4yNjcgMS44MDktMTkuMTIgMi44MDNsLTIuOTM3IDE1Ljg1N2MtLjAwNy4wNTggMTQuNjE3LTMuOSAyMS4wNTktMy42NjcgMTAuNjY1LjM4MyAxMS42NDYgNC4wNzYgMTEuNDYgOS4wNi4xODIuMjkyLTIuNzUyLTQuNTAzLTExLjk3OS00LjY2NC0xMS42NC0uMi0yOC4wNjkgNC4xMjItMjguMDQ2IDIxLjY5Mi0uMzE0IDE5Ljc2NSAxNC43NjQgMjUuNTc5IDI1LjAzMiAyNS42ODYgOS4yMzItLjE2OCAxMy41NjMtMy40OTYgMTUuOTM0LTUuMjggMy4xMTUtMy4yNTcgNi42NzktNi41MzIgMTAuMDc4LTEwLjQ2Mi0zLjIxNiA1Ljg0NC02LjAwNSA5Ljg4NC04LjkwNyAxMi45Nzd2Mi42MTFsMTQuMDMzLTIuMzYxLjA5Ni0zOC4xNDRjLS4xNDMtNS4zOTkgMy4wOTYtMjYuMDU3LTI2LjcwMy0yNi4xMDh6bS0yLjAxNiAzMy4yMWM1LjgxNy4wOCAxMi40ODggMi45NDggMTIuNDk3IDkuODQ5LjAzIDYuMjc3LTcuODYzIDkuNjUxLTEyLjk5NiA5LjU5OC01LjEzNS0uMDUzLTExLjk0OS00LjAzNi0xMS45NzktMTAuMTU1LjA5OS01LjQ3IDYuNDI2LTkuNDMyIDEyLjQ3OC05LjI5MXptMzcuOTcyLTI5LjY4NWwtLjA5NSA2My4xNjYgMTYuMzQ4LT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MTgtMS4yOS43NjQtMi4zMDFsMy40MzctOS45OWgyLjU1NnYxNC4zNTdoLTEuODMxVjgxLjI1bC00LjE3MiAxMi4wMTZoLTEuNzE0bC00LjE1Mi0xMi4yMjJ2MTIuMjIyaC0xLjgzMiIgZm9udC13ZWlnaHQ9IjQwMCIgZm9udC1zaXplPSI4LjQ0MSIgZm9udC1mYW1pbHk9IkRlamFWdSBTYW5zIE1vbm8iIGZpbGw9ImdyYXkiLz48L3N2Zz4=) no-repeat!important;background-size:190px 40px!important}#archnavbarlogo p{margin:0!important;padding:0!important;text-indent:-9999px!important}#archnavbarlogo a{display:block!important;height:40px!important;width:190px!important}#archnavbar ul{display:inline!important;float:right!important;list-style:none!important;margin:0!important;padding:0!important}#archnavbar ul li{float:left!important;font-size:14px!important;font-family:sans-serif!important;line-height:45px!important;padding-right:15px!important;padding-left:15px!important}#archnavbar ul#archnavbarlist li a{color:#999;font-weight:bold!important;text-decoration:none!important}#archnavbar ul li a:hover{color:white!important;text-decoration:underline!important}#archnavbar ul li.anb-selected a{color:white!important}@media (max-width:600px){#anb-wiki{display:none}}@media (max-width:680px){html>body #archnavbarlogo{width:40px!important;margin-right:5px!important;background:url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxMjAwIiBoZWlnaHQ9IjEyMDAiIHZlcnNpb249IjEiPjxwYXRoIGQ9Ik02MDAgMGMtNTMuNDE2IDEzMC45NjItODUuNjcxIDIxNi43NC0xNDUuMTQzIDM0My44MSAzNi40NjQgMzguNjUxIDgxLjIyIDgzLjQ0OSAxNTMuOTA1IDEzNC4yODUtNzguMTQ1LTMyLjE1Ni0xMzEuNDAzLTY0LjIxMy0xNzEuMjM4LTk3LjcxNEMzNjEuNDEgNTM5LjIgMjQxLjk4OSA3NjUuMTk0IDAgMTIwMGMxOTAuMTYxLTEwOS43ODQgMzM3LjY2NS0xNzcuMzk3IDQ3NS4wNDgtMjAzLjIzOC01Ljg5NS0yNS4zNjctOS4xOC01Mi44OTYtOC45NTMtODEuNTI0bC4xOS01LjkwNUM0NjkuMzA1IDc4Ny40OCA1MzIuNzIgNjkzLjYzOCA2MDcuODEgNzAwYzc1LjA4OSA2LjM2MiAxMzMuNDk0IDExMC41MjggMTMwLjQ3NiAyMzIuMzgxLS41NjggMjIuOTE2LTMuMTA1IDQ0Ljg4NS03LjYyIDY1LjMzM0M4NjYuNTI4IDEwMjQuMzI1IDEwMTIuNDYyIDEwOTEuNzMgMTIwMCAxMjAwYy0zNi45OTUtNjguMTExLTcwLjE4LTEyOS4zMzUtMTAxLjcxNC0xODcuODEtNDkuNjcyLTM4LjQ5OS0xMDEuMzY1LTg4LjYxMy0yMDcuMDQ4LTE0Mi44NTcgNzIuNjQgMTguODc1IDEyNC43OTMgNDAuNjEyIDE2NS4zMzMgNjQuOTUzQzczNS45NTIgMzM3LjM0OCA3MDkuOTQ4IDI1OC4wMTYgNjAwIDB6IiBmaWxsPSIjMTc5M2QxIiBmaWxsLXJ1bGU9ImV2ZW5vZGQiLz48L3N2Zz4=) no-repeat!important;background-size:40px 40px!important}#archnavbar ul{display:flex!important;justify-content:space-between;flex-wrap:nowrap;overflow:hidden;float:none!important}#archnavbar ul li{padding:0!important;float:none!important}}@media (max-width:845px){#anb-home{display:none}html>body #archnavbarlogo{padding-right:15px!important}#archnavbar{padding-left:5px!important;padding-right:5px!important}#archnavbar ul li{padding-left:5px!important;padding-right:5px!important}}body{background:#f6f9fc}#content{background:#ffffff;border:1px solid #cccccc}#content h1,#content h2,#content h3,#content h4,#content h5,#content pre,#content code{color:#222222}#content ul{list-style-image:none}#content pre:not([class*="CodeMirror"]){border:1px solid #bbccdd;overflow:auto;word-break:break-all;white-space:pre-wrap!important}#content pre:not([class*="CodeMirror"]),#content code{background-color:#ebf1f5;font-family:monospace,monospace}#content code{display:inline-block;padding:0 0.3em;border-width:0;border-radius:0}#footer{color:#333333}#toc{background-color:#f9faff;border:1px solid #d7dfe3}#bodyContent>div.mw-content-ltr a{font-weight:bold}#bodyContent #toc a{font-weight:normal}#content a:not(.new),header.mw-header li:not(.new) a:not(.new),#mw-navigation li:not(.new) a:not(.new),#mw-panel li:not(.new) a:not(.new),#column-one li:not(.new) a:not(.new),#footer a:not(.new){text-decoration:none;color:#0077bb!important}#content a:not(.new):hover,header.mw-header li:not(.new) a:not(.new):hover,#mw-navigation li:not(.new) a:not(.new):hover,#mw-panel li:not(.new) a:not(.new):hover,#column-one li:not(.new) a:not(.new):hover,#footer a:not(.new):hover{text-decoration:underline;background-color:transparent;color:#999999!important}#content a:active,header.mw-header li:not(.new) a:active,#mw-navigation li:not(.new) a:active,#mw-panel li:not(.new) a:active,#column-one li:not(.new) a:active,#footer a:active,#content a:focus,header.mw-header li:not(.new) a:focus,#mw-navigation li:not(.new) a:focus,#mw-panel li:not(.new) a:focus,#column-one li:not(.new) a:focus,#footer a:focus,#content a:active:hover,header.mw-header li:not(.new) a:active:hover,#mw-navigation li:not(.new) a:active:hover,#mw-panel li:not(.new) a:active:hover,#column-one li:not(.new) a:active:hover,#footer a:active:hover,#content a:focus:hover,header.mw-header li:not(.new) a:focus:hover,#mw-navigation li:not(.new) a:focus:hover,#mw-panel li:not(.new) a:focus:hover,#column-one li:not(.new) a:focus:hover,#footer a:focus:hover{color:#ee9900!important}#content a:not(.new):visited,#mw-panel li:not(.new) a:not(.new):visited,#p-navigation li:not(.new) a:not(.new):visited,#p-tb li:not(.new) a:not(.new):visited{color:#666666!important}.mw-body-content a.external,.mw-body-content a.extiw{background:var(--sf-img-8) center right no-repeat;padding-right:13px}.mw-body h1,.mw-body-content h2{font-family:sans-serif}nav.vector-menu-tabs{padding-left:0}nav.vector-menu-tabs ul,nav.vector-menu-tabs ul li{background:none}nav.vector-menu-tabs li.selected{border:1px solid #cccccc;border-bottom-color:#ffffff;background-color:#ffffff}nav.vector-menu-tabs li.selected a{background:none!important}nav.vector-menu-tabs ul li{border:1px}body.skin-vector.skin--responsive nav.vector-menu-tabs li.selected{margin-top:-1px;border-bottom:none}body.skin-vector.skin--responsive li:not(:first-child).selected{margin-left:-1px}body.skin-vector.skin--responsive div.mw-page-container{background-color:#f6f9fc}body.skin-vector.skin--responsive div#mw-panel{background-image:none}</style>
<meta name=ResourceLoaderDynamicStyles content>
<style>pre{white-space:pre}#bodyContent a.external[href^="https://wiki.archlinux.org"]{background:none;padding-right:0}span.archwiki-template-pkg,span.archwiki-template-man{font-family:monospace,monospace}div.archwiki-template-box{padding:5px;border:thin solid black;margin:0.5em 0;overflow:hidden}div.archwiki-template-box.archwiki-template-box-note{background-color:#ddf;border-color:#bbd}div.archwiki-template-box.archwiki-template-box-warning{background-color:#fdd;border-color:#dbb}div.archwiki-template-box.archwiki-template-box-tip{background-color:#dfd;border-color:#bdb}div.archwiki-template-message{position:relative;overflow:hidden;min-height:4.6em;margin-bottom:1em;background-color:#f9faff;border:1px solid #d7dfe3;padding:0 100px;text-align:center}div.archwiki-template-message>p>a{display:block;position:absolute;top:5px}div.archwiki-template-message>p>a:first-of-type{left:26px}div.archwiki-template-message>p>a:last-of-type{right:26px}div.archwiki-template-message>div{font-size:90%}div.archwiki-template-meta-related-articles-start{float:right;clear:right;width:25%;margin:0 0 0.5em 0.5em}div.archwiki-template-meta-related-articles-start>p{background:#333;color:white;padding:0.2em;border-bottom:5px #08c solid;margin:0;text-align:center;font-weight:bold}div.archwiki-template-meta-related-articles-start>ul{list-style-type:none;margin:0;padding:0.3em}div.archwiki-template-meta-related-articles-start>ul>li{padding:0.4em 0;line-height:1}</style>
<meta name=generator content="MediaWiki 1.37.2">
<meta name=referrer content=no-referrer-when-downgrade>
<meta name=format-detection content="telephone=no">
<meta name=viewport content="width=device-width, initial-scale=1.0, user-scalable=yes, minimum-scale=0.25, maximum-scale=5.0">
<link rel=search type=application/opensearchdescription+xml href=https://wiki.archlinux.org/opensearch_desc.php title="ArchWiki (en)">
<link rel=EditURI type=application/rsd+xml href="https://wiki.archlinux.org/api.php?action=rsd">
<link rel=license href=http://www.gnu.org/copyleft/fdl.html>
<link rel=alternate type=application/atom+xml title="ArchWiki Atom feed" href="https://wiki.archlinux.org/index.php?title=Special:RecentChanges&feed=atom">
<link rel="shortcut icon" href=data:image/vnd.microsoft.icon;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAABvElEQVQ4jY2TP4gTQRTGfzM7ybp35mBX8LY4GxM5OI4UiqDWtoKIjWhl4QmmEQwIhzZaa3GLlYWgjViI+AcUrrASUYTbQ0UxepwpFj1EDCSXuLNj4QYSLxP8mnm8972P3wyMMMZgUxjF+ycLUjUW5l/YPMq6/VfnHCEmAGuAsBHsurG6QwiaRUeq2cCdfXy88nmUT9qSJ4tywVNyGxjVSbPzNp81wFNyt6cknpJ00uzk2Wfr/n8HHLrz4ajriFeuEsuekvS08Zu/eoujvFveYN+t98XAUw1jmEmN+ZEZfG2M8BzZKhVl+f6x8vexBIGn6hMFOeMqgTEEXZ2J39qwqbNSR5tLYwnmbr6b2hO4axvt1P/a6tHTw3SuI1pTrlNZPT33bSTBps7qb5K23/jZ7S8/AO72511tShud9MJIgjCKdwINYHs+e5TUqkfy2W3gVN5vA+WkVk3+Jbg8sAzwcKB+mp8G+ALUh64QRnEZOMOwPg3Ub/vEgAvcGwoArgKFvF4DrgEfBwKawHVgHagAy2EUnwAQ00sre4HXwBPgSlKrvmSMwig+CCwCh4F5Mb20chF4ntSq1h83JujAH3Eom+H9uAq8AAAAAElFTkSuQmCC><style>.sf-hidden{display:none!important}</style><link rel=canonical href=https://wiki.archlinux.org/title/PCI_passthrough_via_OVMF><meta http-equiv=content-security-policy content="default-src 'none'; font-src 'self' data:; img-src 'self' data:; style-src 'unsafe-inline'; media-src 'self' data:; script-src 'unsafe-inline' data:;"></head>
<body class="mediawiki ltr sitedir-ltr mw-hide-empty-elt ns-0 ns-subject page-PCI_passthrough_via_OVMF rootpage-PCI_passthrough_via_OVMF skin-vector action-view skin--responsive skin-vector-search-vue" data-new-gr-c-s-check-loaded=14.1058.0 data-gr-ext-installed><div id=archnavbar class=noprint>
<div id=archnavbarlogo>
<p><a id=logo href=https://www.archlinux.org/></a></p>
</div>
<div id=archnavbarmenu>
<ul id=archnavbarlist>
<li id=anb-home><a href=https://www.archlinux.org/>Home</a></li> <li id=anb-packages><a href=https://www.archlinux.org/packages/>Packages</a></li> <li id=anb-forums><a href=https://bbs.archlinux.org/>Forums</a></li> <li id=anb-wiki class=anb-selected><a href=https://wiki.archlinux.org/>Wiki</a></li> <li id=anb-bugs><a href=https://bugs.archlinux.org/>Bugs</a></li> <li id=anb-security><a href=https://security.archlinux.org/>Security</a></li> <li id=anb-aur><a href=https://aur.archlinux.org/>AUR</a></li> <li id=anb-download><a href=https://www.archlinux.org/download/>Download</a></li> </ul>
</div>
</div>
<div class=mw-page-container>
<a class=mw-jump-link href=#content>Jump to content</a>
<div class=mw-page-container-inner>
<input type=checkbox id=mw-sidebar-checkbox class="mw-checkbox-hack-checkbox sf-hidden">
<header class=mw-header>
<label id=mw-sidebar-button class="mw-checkbox-hack-button mw-ui-icon mw-ui-button mw-ui-quiet mw-ui-icon-element" for=mw-sidebar-checkbox role=button aria-controls=mw-panel data-event-name=ui.sidebar tabindex=0 title="Main menu" aria-expanded=false>
Toggle sidebar
</label>
<a href=https://wiki.archlinux.org/title/Main_page class="mw-logo sf-hidden">
</a>
<div id=p-search role=search class="vector-search-box vector-search-box-collapses vector-search-box-show-thumbnail">
<div>
<h3>
<label for=searchInput>Search</label>
</h3>
<form action=/index.php id=searchform>
<div id=simpleSearch data-search-loc=header-moved>
<input type=search name=search placeholder="Search ArchWiki" autocapitalize=sentences accesskey=f id=searchInput autocomplete=off value>
<input type=submit name=fulltext value=Search title="Search the pages for this text" id=mw-searchButton class="searchButton mw-fallbackSearchButton">
<input type=submit name=go value=Go title="Go to a page with this exact name if it exists" id=searchButton class=searchButton>
</div>
</form>
</div>
<a href=https://wiki.archlinux.org/title/Special:Search class="mw-ui-button mw-ui-quiet mw-ui-icon mw-ui-icon-element mw-ui-icon-wikimedia-search search-toggle sf-hidden">
</a>
</div>
<div class=vector-user-links>
<nav id=p-personal-more class="mw-portlet mw-portlet-personal-more vector-menu vector-user-menu-more" aria-labelledby=p-personal-more-label role=navigation>
<h3 id=p-personal-more-label class="vector-menu-heading sf-hidden">
</h3>
<div class=vector-menu-content>
<ul class=vector-menu-content-list>
<li id=p-createaccount class=user-links-collapsible-item>
<a href="https://wiki.archlinux.org/index.php?title=Special:CreateAccount&returnto=PCI+passthrough+via+OVMF" icon=userAvatar class="mw-ui-button mw-ui-quiet" title="You are encouraged to create an account and log in; however, it is not mandatory"><span>Create account</span></a>
</li>
</ul>
</div>
</nav>
<nav id=p-personal class="mw-portlet mw-portlet-personal emptyPortlet vector-user-menu vector-user-menu-logged-out vector-menu vector-menu-dropdown" aria-labelledby=p-personal-label role=navigation title="More options">
<input type=checkbox id=p-personal-checkbox role=button aria-haspopup=true data-event-name=ui.dropdown-p-personal class=vector-menu-checkbox aria-labelledby=p-personal-label>
<h3 id=p-personal-label class="vector-menu-heading mw-ui-button mw-ui-quiet mw-ui-icon mw-ui-icon-element mw-ui-icon-wikimedia-ellipsis"> <span>Personal tools</span>
<span class=vector-menu-checkbox-expanded>expanded</span>
<span class=vector-menu-checkbox-collapsed>collapsed</span>
</h3>
<div class=vector-menu-content>
<div class=vector-user-menu-create-account><a href="https://wiki.archlinux.org/index.php?title=Special:CreateAccount&returnto=PCI+passthrough+via+OVMF" icon=userAvatar class="user-links-collapsible-item vector-menu-content-item mw-ui-icon mw-ui-icon-before mw-ui-icon-wikimedia-userAvatar sf-hidden" title="You are encouraged to create an account and log in; however, it is not mandatory"></a></div>
<div class=vector-user-menu-login><a href="https://wiki.archlinux.org/index.php?title=Special:UserLogin&returnto=PCI+passthrough+via+OVMF" icon=logIn class="vector-menu-content-item vector-menu-content-item-login mw-ui-icon mw-ui-icon-before mw-ui-icon-wikimedia-logIn" title="You are encouraged to log in; however, it is not mandatory [alt-shift-o]" accesskey=o><span>Log in</span></a></div>
<div class=vector-user-menu-anon-editor>
<p>
Pages for logged out editors <a href=https://wiki.archlinux.org/title/Help:Introduction aria-label="Learn more about editing"><span>learn more</span></a>
</p>
</div>
<ul class=vector-menu-content-list></ul>
</div>
</nav>
</div>
</header>
<div class=mw-workspace-container>
<div id=mw-navigation>
<h2>Navigation menu</h2>
<div id=mw-panel class=mw-sidebar>
<nav id=p-navigation class="mw-portlet mw-portlet-navigation vector-menu vector-menu-portal portal" aria-labelledby=p-navigation-label role=navigation>
<h3 id=p-navigation-label class="vector-menu-heading sf-hidden">
</h3>
<div class=vector-menu-content>
<ul class=vector-menu-content-list><li id=n-mainpage-description class=mw-list-item><a href=https://wiki.archlinux.org/title/Main_page title="Visit the main page [alt-shift-z]" accesskey=z><span>Main page</span></a><li id=n-Table-of-contents class=mw-list-item><a href=https://wiki.archlinux.org/title/Table_of_contents><span>Table of contents</span></a><li id=n-portal class=mw-list-item><a href=https://wiki.archlinux.org/title/Getting_involved title="Various ways Archers can contribute to the community"><span>Getting involved</span></a><li id=n-currentevents class=mw-list-item><a href=https://wiki.archlinux.org/title/ArchWiki:News title="The latest lowdown on the wiki"><span>Wiki news</span></a><li id=n-randompage class=mw-list-item><a href=https://wiki.archlinux.org/title/Special:Random title="Load a random page [alt-shift-x]" accesskey=x><span>Random page</span></a></ul>
</div>
</nav>
<nav id=p-Interaction class="mw-portlet mw-portlet-Interaction vector-menu vector-menu-portal portal" aria-labelledby=p-Interaction-label role=navigation>
<h3 id=p-Interaction-label class=vector-menu-heading> <span>Interaction</span>
</h3>
<div class=vector-menu-content>
<ul class=vector-menu-content-list><li id=n-help class=mw-list-item><a href=https://wiki.archlinux.org/title/Category:Help title="Wiki navigation, reading, and editing help"><span>Help</span></a><li id=n-Contributing class=mw-list-item><a href=https://wiki.archlinux.org/title/ArchWiki:Contributing><span>Contributing</span></a><li id=n-recentchanges class=mw-list-item><a href=https://wiki.archlinux.org/title/Special:RecentChanges title="A list of recent changes in the wiki [alt-shift-r]" accesskey=r><span>Recent changes</span></a><li id=n-Recent-talks class=mw-list-item><a href="https://wiki.archlinux.org/index.php?title=Special:RecentChanges&namespace=all-discussions" rel=nofollow><span>Recent talks</span></a><li id=n-newpages class=mw-list-item><a href=https://wiki.archlinux.org/title/Special:NewPages><span>New pages</span></a><li id=n-Statistics class=mw-list-item><a href=https://wiki.archlinux.org/title/ArchWiki:Statistics><span>Statistics</span></a><li id=n-Requests class=mw-list-item><a href=https://wiki.archlinux.org/title/ArchWiki_talk:Requests><span>Requests</span></a></ul>
</div>
</nav>
<nav id=p-tb class="mw-portlet mw-portlet-tb vector-menu vector-menu-portal portal" aria-labelledby=p-tb-label role=navigation>
<h3 id=p-tb-label class=vector-menu-heading> <span>Tools</span>
</h3>
<div class=vector-menu-content>
<ul class=vector-menu-content-list><li id=t-whatlinkshere class=mw-list-item><a href=https://wiki.archlinux.org/title/Special:WhatLinksHere/PCI_passthrough_via_OVMF title="A list of all wiki pages that link here [alt-shift-j]" accesskey=j><span>What links here</span></a><li id=t-recentchangeslinked class=mw-list-item><a href=https://wiki.archlinux.org/title/Special:RecentChangesLinked/PCI_passthrough_via_OVMF rel=nofollow title="Recent changes in pages linked from this page [alt-shift-k]" accesskey=k><span>Related changes</span></a><li id=t-specialpages class=mw-list-item><a href=https://wiki.archlinux.org/title/Special:SpecialPages title="A list of all special pages [alt-shift-q]" accesskey=q><span>Special pages</span></a><li id=t-print class=mw-list-item><a href=https://wiki.archlinux.org/title/PCI_passthrough_via_OVMF rel=alternate title="Printable version of this page [alt-shift-p]" accesskey=p><span>Printable version</span></a><li id=t-permalink class=mw-list-item><a href="https://wiki.archlinux.org/index.php?title=PCI_passthrough_via_OVMF&oldid=724650" title="Permanent link to this revision of the page"><span>Permanent link</span></a><li id=t-info class=mw-list-item><a href="https://wiki.archlinux.org/index.php?title=PCI_passthrough_via_OVMF&action=info" title="More information about this page"><span>Page information</span></a></ul>
</div>
</nav>
<nav id=p-lang class="mw-portlet mw-portlet-lang vector-menu vector-menu-portal portal" aria-labelledby=p-lang-label role=navigation>
<h3 id=p-lang-label class=vector-menu-heading> <span>In other languages</span>
</h3>
<div class=vector-menu-content>
<ul class=vector-menu-content-list><li class="interlanguage-link interwiki-ja mw-list-item"><a href=https://wiki.archlinux.jp/index.php/OVMF_%E3%81%AB%E3%82%88%E3%82%8B_PCI_%E3%83%91%E3%82%B9%E3%82%B9%E3%83%AB%E3%83%BC title="OVMF による PCI パススルー – 日本語" lang=ja hreflang=ja class=interlanguage-link-target><span>日本語</span></a><li class="interlanguage-link interwiki-zh-hans mw-list-item"><a href=https://wiki.archlinux.org/title/PCI_passthrough_via_OVMF_(%E7%AE%80%E4%BD%93%E4%B8%AD%E6%96%87) title="PCI passthrough via OVMF – 中文(简体)" lang=zh-Hans hreflang=zh-Hans class=interlanguage-link-target><span>中文(简体)</span></a></ul>
</div>
</nav>
</div>
<div id=mw-head>
<div class=mw-article-toolbar-container>
<div id=left-navigation>
<nav id=p-namespaces class="mw-portlet mw-portlet-namespaces vector-menu vector-menu-tabs" aria-labelledby=p-namespaces-label role=navigation>
<h3 id=p-namespaces-label class="vector-menu-heading sf-hidden">
</h3>
<div class=vector-menu-content>
<ul class=vector-menu-content-list><li id=ca-nstab-main class="selected mw-list-item"><a href=https://wiki.archlinux.org/title/PCI_passthrough_via_OVMF title="View the content page [alt-shift-c]" accesskey=c><span>Page</span></a><li id=ca-talk class=mw-list-item><a href=https://wiki.archlinux.org/title/Talk:PCI_passthrough_via_OVMF rel=discussion title="Discussion about the content page [alt-shift-t]" accesskey=t><span>Discussion</span></a></ul>
</div>
</nav>
<nav id=p-variants class="mw-portlet mw-portlet-variants emptyPortlet vector-menu-dropdown-noicon vector-menu vector-menu-dropdown sf-hidden" aria-labelledby=p-variants-label role=navigation>
</nav>
</div>
<div id=right-navigation>
<nav id=p-views class="mw-portlet mw-portlet-views vector-menu vector-menu-tabs" aria-labelledby=p-views-label role=navigation>
<h3 id=p-views-label class="vector-menu-heading sf-hidden">
</h3>
<div class=vector-menu-content>
<ul class=vector-menu-content-list><li id=ca-view class="selected mw-list-item collapsible"><a href=https://wiki.archlinux.org/title/PCI_passthrough_via_OVMF><span>Read</span></a><li id=ca-viewsource class="mw-list-item collapsible"><a href="https://wiki.archlinux.org/index.php?title=PCI_passthrough_via_OVMF&action=edit" title="This page is protected.
You can view its source [alt-shift-e]" accesskey=e><span>View source</span></a><li id=ca-history class="mw-list-item collapsible"><a href="https://wiki.archlinux.org/index.php?title=PCI_passthrough_via_OVMF&action=history" title="Past revisions of this page [alt-shift-h]" accesskey=h><span>View history</span></a></ul>
</div>
</nav>
<nav id=p-cactions class="mw-portlet mw-portlet-cactions emptyPortlet vector-menu-dropdown-noicon vector-menu vector-menu-dropdown sf-hidden" aria-labelledby=p-cactions-label role=navigation title="More options">
</nav>
</div>
</div>
</div>
</div>
<div class=mw-content-container>
<main id=content class=mw-body role=main>
<a id=top></a>
<div id=siteNotice></div>
<div class=mw-indicators>
</div>
<h1 id=firstHeading class=firstHeading>PCI passthrough via OVMF</h1>
<div id=bodyContent class=vector-body>
<div id=siteSub class="noprint sf-hidden">From ArchWiki</div>
<div id=contentSub></div>
<div id=contentSub2></div>
<div id=mw-content-text class="mw-body-content mw-content-ltr" lang=en dir=ltr><div class=mw-parser-output><div class=archwiki-template-meta-related-articles-start><p>Related articles<ul>
<li><a href=https://wiki.archlinux.org/title/Intel_GVT-g title="Intel GVT-g">Intel GVT-g</a></li>
<li><a href=https://wiki.archlinux.org/title/PCI_passthrough_via_OVMF/Examples title="PCI passthrough via OVMF/Examples">PCI passthrough via OVMF/Examples</a></li>
</ul></div>
<p>The Open Virtual Machine Firmware (<a rel=nofollow class="external text" href=https://github.com/tianocore/tianocore.github.io/wiki/OVMF>OVMF</a>) is a project to enable UEFI support for virtual machines. Starting with Linux 3.9 and recent versions of <a href=https://wiki.archlinux.org/title/QEMU title=QEMU>QEMU</a>, it is now possible to passthrough a graphics card, offering the virtual machine native graphics performance which is useful for graphic-intensive tasks.
<p>Provided you have a desktop computer with a spare GPU you can dedicate to the host (be it an integrated GPU or an old OEM card, the brands do not even need to match) and that your hardware supports it (see <a href=#Prerequisites>#Prerequisites</a>), it is possible to have a virtual machine of any OS with its own dedicated GPU and near-native performance. For more information on techniques see the background <a rel=nofollow class="external text" href=https://www.linux-kvm.org/images/b/b3/01x09b-VFIOandYou-small.pdf>presentation (pdf)</a>.
</p>
<div id=toc class=toc role=navigation aria-labelledby=mw-toc-heading><input type=checkbox role=button id=toctogglecheckbox class=toctogglecheckbox style=display:none><div class=toctitle lang=en dir=ltr><h2 id=mw-toc-heading>Contents</h2><span class=toctogglespan><label class=toctogglelabel for=toctogglecheckbox></label></span></div>
<ul>
<li class="toclevel-1 tocsection-1"><a href=#Prerequisites><span class=tocnumber>1</span> <span class=toctext>Prerequisites</span></a></li>
<li class="toclevel-1 tocsection-2"><a href=#Setting_up_IOMMU><span class=tocnumber>2</span> <span class=toctext>Setting up IOMMU</span></a>
<ul>
<li class="toclevel-2 tocsection-3"><a href=#Enabling_IOMMU><span class=tocnumber>2.1</span> <span class=toctext>Enabling IOMMU</span></a></li>
<li class="toclevel-2 tocsection-4"><a href=#Ensuring_that_the_groups_are_valid><span class=tocnumber>2.2</span> <span class=toctext>Ensuring that the groups are valid</span></a></li>
<li class="toclevel-2 tocsection-5"><a href=#Gotchas><span class=tocnumber>2.3</span> <span class=toctext>Gotchas</span></a>
<ul>
<li class="toclevel-3 tocsection-6"><a href=#Plugging_your_guest_GPU_in_an_unisolated_CPU-based_PCIe_slot><span class=tocnumber>2.3.1</span> <span class=toctext>Plugging your guest GPU in an unisolated CPU-based PCIe slot</span></a></li>
</ul>
</li>
</ul>
</li>
<li class="toclevel-1 tocsection-7"><a href=#Isolating_the_GPU><span class=tocnumber>3</span> <span class=toctext>Isolating the GPU</span></a>
<ul>
<li class="toclevel-2 tocsection-8"><a href=#Binding_vfio-pci_via_device_ID><span class=tocnumber>3.1</span> <span class=toctext>Binding vfio-pci via device ID</span></a></li>
<li class="toclevel-2 tocsection-9"><a href=#Loading_vfio-pci_early><span class=tocnumber>3.2</span> <span class=toctext>Loading vfio-pci early</span></a>
<ul>
<li class="toclevel-3 tocsection-10"><a href=#mkinitcpio><span class=tocnumber>3.2.1</span> <span class=toctext>mkinitcpio</span></a></li>
<li class="toclevel-3 tocsection-11"><a href=#booster><span class=tocnumber>3.2.2</span> <span class=toctext>booster</span></a></li>
<li class="toclevel-3 tocsection-12"><a href=#dracut><span class=tocnumber>3.2.3</span> <span class=toctext>dracut</span></a></li>
</ul>
</li>
<li class="toclevel-2 tocsection-13"><a href=#Verifying_that_the_configuration_worked><span class=tocnumber>3.3</span> <span class=toctext>Verifying that the configuration worked</span></a></li>
</ul>
</li>
<li class="toclevel-1 tocsection-14"><a href=#Setting_up_an_OVMF-based_guest_virtual_machine><span class=tocnumber>4</span> <span class=toctext>Setting up an OVMF-based guest virtual machine</span></a>
<ul>
<li class="toclevel-2 tocsection-15"><a href=#Configuring_libvirt><span class=tocnumber>4.1</span> <span class=toctext>Configuring libvirt</span></a></li>
<li class="toclevel-2 tocsection-16"><a href=#Setting_up_the_guest_OS><span class=tocnumber>4.2</span> <span class=toctext>Setting up the guest OS</span></a></li>
<li class="toclevel-2 tocsection-17"><a href=#Attaching_the_PCI_devices><span class=tocnumber>4.3</span> <span class=toctext>Attaching the PCI devices</span></a></li>
<li class="toclevel-2 tocsection-18"><a href=#Video_card_driver_virtualisation_detection><span class=tocnumber>4.4</span> <span class=toctext>Video card driver virtualisation detection</span></a></li>
<li class="toclevel-2 tocsection-19"><a href=#Passing_keyboard/mouse_via_Evdev><span class=tocnumber>4.5</span> <span class=toctext>Passing keyboard/mouse via Evdev</span></a></li>
<li class="toclevel-2 tocsection-20"><a href=#Gotchas_2><span class=tocnumber>4.6</span> <span class=toctext>Gotchas</span></a>
<ul>
<li class="toclevel-3 tocsection-21"><a href=#Using_a_non-EFI_image_on_an_OVMF-based_virtual_machine><span class=tocnumber>4.6.1</span> <span class=toctext>Using a non-EFI image on an OVMF-based virtual machine</span></a></li>
</ul>
</li>
</ul>
</li>
<li class="toclevel-1 tocsection-22"><a href=#Performance_tuning><span class=tocnumber>5</span> <span class=toctext>Performance tuning</span></a>
<ul>
<li class="toclevel-2 tocsection-23"><a href=#CPU_pinning><span class=tocnumber>5.1</span> <span class=toctext>CPU pinning</span></a>
<ul>
<li class="toclevel-3 tocsection-24"><a href=#CPU_topology><span class=tocnumber>5.1.1</span> <span class=toctext>CPU topology</span></a></li>
<li class="toclevel-3 tocsection-25"><a href=#XML_examples><span class=tocnumber>5.1.2</span> <span class=toctext>XML examples</span></a>
<ul>
<li class="toclevel-4 tocsection-26"><a href=#4c/1t_CPU_w/o_Hyperthreading_Example><span class=tocnumber>5.1.2.1</span> <span class=toctext>4c/1t CPU w/o Hyperthreading Example</span></a></li>
<li class="toclevel-4 tocsection-27"><a href=#4c/2t_Intel/AMD_CPU_example_(after_ComboPI_AGESA_bios_update)><span class=tocnumber>5.1.2.2</span> <span class=toctext>4c/2t Intel/AMD CPU example (after ComboPI AGESA bios update)</span></a></li>
<li class="toclevel-4 tocsection-28"><a href=#4c/2t_AMD_CPU_example_(Before_ComboPi_AGESA_bios_update)><span class=tocnumber>5.1.2.3</span> <span class=toctext>4c/2t AMD CPU example (Before ComboPi AGESA bios update)</span></a></li>
</ul>
</li>
</ul>
</li>
<li class="toclevel-2 tocsection-29"><a href=#Huge_memory_pages><span class=tocnumber>5.2</span> <span class=toctext>Huge memory pages</span></a>
<ul>
<li class="toclevel-3 tocsection-30"><a href=#Transparent_huge_pages><span class=tocnumber>5.2.1</span> <span class=toctext>Transparent huge pages</span></a></li>
<li class="toclevel-3 tocsection-31"><a href=#Static_huge_pages><span class=tocnumber>5.2.2</span> <span class=toctext>Static huge pages</span></a></li>
<li class="toclevel-3 tocsection-32"><a href=#Dynamic_huge_pages><span class=tocnumber>5.2.3</span> <span class=toctext>Dynamic huge pages</span></a></li>
</ul>
</li>
<li class="toclevel-2 tocsection-33"><a href=#CPU_frequency_governor><span class=tocnumber>5.3</span> <span class=toctext>CPU frequency governor</span></a></li>
<li class="toclevel-2 tocsection-34"><a href=#Isolating_pinned_CPUs><span class=tocnumber>5.4</span> <span class=toctext>Isolating pinned CPUs</span></a>
<ul>
<li class="toclevel-3 tocsection-35"><a href=#With_isolcpus_kernel_parameter><span class=tocnumber>5.4.1</span> <span class=toctext>With isolcpus kernel parameter</span></a></li>
<li class="toclevel-3 tocsection-36"><a href=#Dynamically_isolating_CPUs><span class=tocnumber>5.4.2</span> <span class=toctext>Dynamically isolating CPUs</span></a>
<ul>
<li class="toclevel-4 tocsection-37"><a href=#Example_with_systemd><span class=tocnumber>5.4.2.1</span> <span class=toctext>Example with systemd</span></a></li>
</ul>
</li>
</ul>
</li>
<li class="toclevel-2 tocsection-38"><a href=#Improving_performance_on_AMD_CPUs><span class=tocnumber>5.5</span> <span class=toctext>Improving performance on AMD CPUs</span></a></li>
<li class="toclevel-2 tocsection-39"><a href=#Virtio_disk><span class=tocnumber>5.6</span> <span class=toctext>Virtio disk</span></a>
<ul>
<li class="toclevel-3 tocsection-40"><a href=#Drivers><span class=tocnumber>5.6.1</span> <span class=toctext>Drivers</span></a></li>
<li class="toclevel-3 tocsection-41"><a href=#Considerations><span class=tocnumber>5.6.2</span> <span class=toctext>Considerations</span></a></li>
<li class="toclevel-3 tocsection-42"><a href=#IO_threads><span class=tocnumber>5.6.3</span> <span class=toctext>IO threads</span></a></li>
<li class="toclevel-3 tocsection-43"><a href=#Examples_with_libvirt><span class=tocnumber>5.6.4</span> <span class=toctext>Examples with libvirt</span></a></li>
<li class="toclevel-3 tocsection-44"><a href=#Example_with_virt-manager><span class=tocnumber>5.6.5</span> <span class=toctext>Example with virt-manager</span></a></li>
</ul>
</li>
<li class="toclevel-2 tocsection-45"><a href=#Virtio_network><span class=tocnumber>5.7</span> <span class=toctext>Virtio network</span></a></li>
<li class="toclevel-2 tocsection-46"><a href=#Further_tuning><span class=tocnumber>5.8</span> <span class=toctext>Further tuning</span></a></li>
</ul>
</li>
<li class="toclevel-1 tocsection-47"><a href=#Special_procedures><span class=tocnumber>6</span> <span class=toctext>Special procedures</span></a>
<ul>
<li class="toclevel-2 tocsection-48"><a href=#Using_identical_guest_and_host_GPUs><span class=tocnumber>6.1</span> <span class=toctext>Using identical guest and host GPUs</span></a>
<ul>
<li class="toclevel-3 tocsection-49"><a href=#Script_variants><span class=tocnumber>6.1.1</span> <span class=toctext>Script variants</span></a>
<ul>
<li class="toclevel-4 tocsection-50"><a href=#Passthrough_all_GPUs_but_the_boot_GPU><span class=tocnumber>6.1.1.1</span> <span class=toctext>Passthrough all GPUs but the boot GPU</span></a></li>
<li class="toclevel-4 tocsection-51"><a href=#Passthrough_selected_GPU><span class=tocnumber>6.1.1.2</span> <span class=toctext>Passthrough selected GPU</span></a></li>
<li class="toclevel-4 tocsection-52"><a href=#Passthrough_IOMMU_Group_based_of_GPU><span class=tocnumber>6.1.1.3</span> <span class=toctext>Passthrough IOMMU Group based of GPU</span></a></li>
</ul>
</li>
<li class="toclevel-3 tocsection-53"><a href=#Script_installation><span class=tocnumber>6.1.2</span> <span class=toctext>Script installation</span></a></li>
</ul>
</li>
<li class="toclevel-2 tocsection-54"><a href=#Passing_the_boot_GPU_to_the_guest><span class=tocnumber>6.2</span> <span class=toctext>Passing the boot GPU to the guest</span></a></li>
<li class="toclevel-2 tocsection-55"><a href=#Using_Looking_Glass_to_stream_guest_screen_to_the_host><span class=tocnumber>6.3</span> <span class=toctext>Using Looking Glass to stream guest screen to the host</span></a>
<ul>
<li class="toclevel-3 tocsection-56"><a href=#Adding_IVSHMEM_Device_to_virtual_machines><span class=tocnumber>6.3.1</span> <span class=toctext>Adding IVSHMEM Device to virtual machines</span></a></li>
<li class="toclevel-3 tocsection-57"><a href=#Installing_the_IVSHMEM_Host_to_Windows_guest><span class=tocnumber>6.3.2</span> <span class=toctext>Installing the IVSHMEM Host to Windows guest</span></a></li>
<li class="toclevel-3 tocsection-58"><a href=#Setting_up_the_null_video_device><span class=tocnumber>6.3.3</span> <span class=toctext>Setting up the null video device</span></a></li>
<li class="toclevel-3 tocsection-59"><a href=#Getting_a_client><span class=tocnumber>6.3.4</span> <span class=toctext>Getting a client</span></a></li>
<li class="toclevel-3 tocsection-60"><a href=#Additional_information><span class=tocnumber>6.3.5</span> <span class=toctext>Additional information</span></a></li>
</ul>
</li>
<li class="toclevel-2 tocsection-61"><a href=#Swap_peripherals_to_and_from_the_Host><span class=tocnumber>6.4</span> <span class=toctext>Swap peripherals to and from the Host</span></a></li>
<li class="toclevel-2 tocsection-62"><a href=#Bypassing_the_IOMMU_groups_(ACS_override_patch)><span class=tocnumber>6.5</span> <span class=toctext>Bypassing the IOMMU groups (ACS override patch)</span></a></li>
</ul>
</li>
<li class="toclevel-1 tocsection-63"><a href=#Plain_QEMU_without_libvirt><span class=tocnumber>7</span> <span class=toctext>Plain QEMU without libvirt</span></a></li>
<li class="toclevel-1 tocsection-64"><a href=#Passing_through_other_devices><span class=tocnumber>8</span> <span class=toctext>Passing through other devices</span></a>
<ul>
<li class="toclevel-2 tocsection-65"><a href=#USB_controller><span class=tocnumber>8.1</span> <span class=toctext>USB controller</span></a></li>
<li class="toclevel-2 tocsection-66"><a href=#Passing_audio_from_virtual_machine_to_host_via_PulseAudio><span class=tocnumber>8.2</span> <span class=toctext>Passing audio from virtual machine to host via PulseAudio</span></a></li>
<li class="toclevel-2 tocsection-67"><a href=#Passing_audio_from_virtual_machine_to_host_via_JACK_and_PipeWire><span class=tocnumber>8.3</span> <span class=toctext>Passing audio from virtual machine to host via JACK and PipeWire</span></a></li>
<li class="toclevel-2 tocsection-68"><a href=#Passing_audio_from_virtual_machine_to_host_via_Scream><span class=tocnumber>8.4</span> <span class=toctext>Passing audio from virtual machine to host via Scream</span></a>
<ul>
<li class="toclevel-3 tocsection-69"><a href=#Using_Scream_with_a_bridged_network><span class=tocnumber>8.4.1</span> <span class=toctext>Using Scream with a bridged network</span></a></li>
<li class="toclevel-3 tocsection-70"><a href=#Adding_the_IVSHMEM_device_to_use_Scream_with_IVSHMEM><span class=tocnumber>8.4.2</span> <span class=toctext>Adding the IVSHMEM device to use Scream with IVSHMEM</span></a>
<ul>
<li class="toclevel-4 tocsection-71"><a href=#Configuring_the_Windows_guest_for_IVSHMEM><span class=tocnumber>8.4.2.1</span> <span class=toctext>Configuring the Windows guest for IVSHMEM</span></a>
<ul>
<li class="toclevel-5 tocsection-72"><a href=#Configuring_the_host><span class=tocnumber>8.4.2.1.1</span> <span class=toctext>Configuring the host</span></a></li>
</ul>
</li>
</ul>
</li>
</ul>
</li>
<li class="toclevel-2 tocsection-73"><a href=#Physical_disk/partition><span class=tocnumber>8.5</span> <span class=toctext>Physical disk/partition</span></a></li>
<li class="toclevel-2 tocsection-74"><a href=#Gotchas_3><span class=tocnumber>8.6</span> <span class=toctext>Gotchas</span></a>
<ul>
<li class="toclevel-3 tocsection-75"><a href=#Passing_through_a_device_that_does_not_support_resetting><span class=tocnumber>8.6.1</span> <span class=toctext>Passing through a device that does not support resetting</span></a></li>
</ul>
</li>
</ul>
</li>
<li class="toclevel-1 tocsection-76"><a href=#Complete_setups_and_examples><span class=tocnumber>9</span> <span class=toctext>Complete setups and examples</span></a></li>
<li class="toclevel-1 tocsection-77"><a href=#Troubleshooting><span class=tocnumber>10</span> <span class=toctext>Troubleshooting</span></a>
<ul>
<li class="toclevel-2 tocsection-78"><a href=#QEMU_4.0:_Unable_to_load_graphics_drivers/BSOD/Graphics_stutter_after_driver_install_using_Q35><span class=tocnumber>10.1</span> <span class=toctext>QEMU 4.0: Unable to load graphics drivers/BSOD/Graphics stutter after driver install using Q35</span></a></li>
<li class="toclevel-2 tocsection-79"><a href="#QEMU_5.0:_host-passthrough_with_kernel_version_5.5_to_5.8.1_when_using_Zen_2_processors:_Windows_10_BSOD_loop_'KERNEL_SECURITY_CHECK_FAILURE'"><span class=tocnumber>10.2</span> <span class=toctext>QEMU 5.0: host-passthrough with kernel version 5.5 to 5.8.1 when using Zen 2 processors: Windows 10 BSOD loop 'KERNEL SECURITY CHECK FAILURE'</span></a></li>
<li class="toclevel-2 tocsection-80"><a href=#%22Error_43:_Driver_failed_to_load%22_with_mobile_(Optimus/max-q)_nvidia_GPUs><span class=tocnumber>10.3</span> <span class=toctext>"Error 43: Driver failed to load" with mobile (Optimus/max-q) nvidia GPUs</span></a></li>
<li class="toclevel-2 tocsection-81"><a href=#%22BAR_3:_cannot_reserve_[mem]%22_error_in_dmesg_after_starting_virtual_machine><span class=tocnumber>10.4</span> <span class=toctext>"BAR 3: cannot reserve [mem]" error in dmesg after starting virtual machine</span></a></li>
<li class="toclevel-2 tocsection-82"><a href=#UEFI_(OVMF)_compatibility_in_VBIOS><span class=tocnumber>10.5</span> <span class=toctext>UEFI (OVMF) compatibility in VBIOS</span></a></li>
<li class="toclevel-2 tocsection-83"><a href=#Slowed_down_audio_pumped_through_HDMI_on_the_video_card><span class=tocnumber>10.6</span> <span class=toctext>Slowed down audio pumped through HDMI on the video card</span></a></li>
<li class="toclevel-2 tocsection-84"><a href=#No_HDMI_audio_output_on_host_when_intel_iommu_is_enabled><span class=tocnumber>10.7</span> <span class=toctext>No HDMI audio output on host when intel_iommu is enabled</span></a></li>
<li class="toclevel-2 tocsection-85"><a href=#X_does_not_start_after_enabling_vfio_pci><span class=tocnumber>10.8</span> <span class=toctext>X does not start after enabling vfio_pci</span></a></li>
<li class="toclevel-2 tocsection-86"><a href=#Chromium_ignores_integrated_graphics_for_acceleration><span class=tocnumber>10.9</span> <span class=toctext>Chromium ignores integrated graphics for acceleration</span></a></li>
<li class="toclevel-2 tocsection-87"><a href=#Virtual_machine_only_uses_one_core><span class=tocnumber>10.10</span> <span class=toctext>Virtual machine only uses one core</span></a></li>
<li class="toclevel-2 tocsection-88"><a href=#Passthrough_seems_to_work_but_no_output_is_displayed><span class=tocnumber>10.11</span> <span class=toctext>Passthrough seems to work but no output is displayed</span></a></li>
<li class="toclevel-2 tocsection-89"><a href=#Host_lockup_after_virtual_machine_shutdown><span class=tocnumber>10.12</span> <span class=toctext>Host lockup after virtual machine shutdown</span></a></li>
<li class="toclevel-2 tocsection-90"><a href=#Host_lockup_if_guest_is_left_running_during_sleep><span class=tocnumber>10.13</span> <span class=toctext>Host lockup if guest is left running during sleep</span></a></li>
<li class="toclevel-2 tocsection-91"><a href=#Cannot_boot_after_upgrading_ovmf><span class=tocnumber>10.14</span> <span class=toctext>Cannot boot after upgrading ovmf</span></a></li>
<li class="toclevel-2 tocsection-92"><a href=#Bluescreen_at_boot_since_Windows_10_1803><span class=tocnumber>10.15</span> <span class=toctext>Bluescreen at boot since Windows 10 1803</span></a></li>
<li class="toclevel-2 tocsection-93"><a href=#AMD_Ryzen_/_BIOS_updates_(AGESA)_yields_%22Error:_internal_error:_Unknown_PCI_header_type_%E2%80%98127%E2%80%99%22><span class=tocnumber>10.16</span> <span class=toctext>AMD Ryzen / BIOS updates (AGESA) yields "Error: internal error: Unknown PCI header type ‘127’"</span></a></li>
<li class="toclevel-2 tocsection-94"><a href=#AMD_GPU_not_resetting_properly_yielding_%22Error:_internal_error:_Unknown_PCI_header_type_%E2%80%98127%E2%80%99%22_(Separate_issue_from_the_one_above)><span class=tocnumber>10.17</span> <span class=toctext>AMD GPU not resetting properly yielding "Error: internal error: Unknown PCI header type ‘127’" (Separate issue from the one above)</span></a></li>
<li class="toclevel-2 tocsection-95"><a href=#Host_crashes_when_hotplugging_Nvidia_card_with_USB><span class=tocnumber>10.18</span> <span class=toctext>Host crashes when hotplugging Nvidia card with USB</span></a></li>
<li class="toclevel-2 tocsection-96"><a href=#Host_unable_to_boot_and_stuck_in_black_screen_after_enabling_vfio><span class=tocnumber>10.19</span> <span class=toctext>Host unable to boot and stuck in black screen after enabling vfio</span></a></li>
<li class="toclevel-2 tocsection-97"><a href=#AER_errors_when_passing_through_PCIe_USB_hub><span class=tocnumber>10.20</span> <span class=toctext>AER errors when passing through PCIe USB hub</span></a></li>
<li class="toclevel-2 tocsection-98"><a href=#Reserved_Memory_Region_Reporting_(RMRR)_Conflict><span class=tocnumber>10.21</span> <span class=toctext>Reserved Memory Region Reporting (RMRR) Conflict</span></a></li>
<li class="toclevel-2 tocsection-99"><a href=#Too-low_frequency_limit_for_AMD_GPU_passed-through_to_virtual_machine><span class=tocnumber>10.22</span> <span class=toctext>Too-low frequency limit for AMD GPU passed-through to virtual machine</span></a></li>
</ul>
</li>
<li class="toclevel-1 tocsection-100"><a href=#See_also><span class=tocnumber>11</span> <span class=toctext>See also</span></a></li>
</ul>
</div>
<h2><span class=mw-headline id=Prerequisites>Prerequisites</span></h2>
<p>A VGA Passthrough relies on a number of technologies that are not ubiquitous as of today and might not be available on your hardware. You will not be able to do this on your machine unless the following requirements are met :
</p>
<ul><li>Your CPU must support hardware virtualization (for kvm) and IOMMU (for the passthrough itself)
<ul><li><a rel=nofollow class="external text" href="https://ark.intel.com/Search/FeatureFilter?productType=873&0_VTD=True">List of compatible Intel CPUs (Intel VT-x and Intel VT-d)</a></li>
<li>All AMD CPUs from the Bulldozer generation and up (including Zen) should be compatible.
<ul><li>CPUs from the K10 generation (2007) do not have an IOMMU, so you <b>need</b> to have a motherboard with a <a rel=nofollow class="external text" href="https://support.amd.com/TechDocs/43403.pdf#page=18">890FX</a> or <a rel=nofollow class="external text" href="https://support.amd.com/TechDocs/48691.pdf#page=21">990FX</a> chipset to make it work, as those have their own IOMMU.</ul></ul></li>
<li>Your motherboard must also support IOMMU
<ul><li>Both the chipset and the BIOS must support it. It is not always easy to tell at a glance whether or not this is the case, but there is a fairly comprehensive list on the matter on the <a rel=nofollow class="external text" href=https://wiki.xen.org/wiki/VTd_HowTo>Xen wiki</a> as well as <a href=https://en.wikipedia.org/wiki/List_of_IOMMU-supporting_hardware class=extiw title="wikipedia:List of IOMMU-supporting hardware">Wikipedia:List of IOMMU-supporting hardware</a>.</ul></li>
<li>Your guest GPU ROM must support UEFI.
<ul><li>If you can find <a rel=nofollow class="external text" href=https://www.techpowerup.com/vgabios/>any ROM in this list</a> that applies to your specific GPU and is said to support UEFI, you are generally in the clear. All GPUs from 2012 and later should support this, as Microsoft made UEFI a requirement for devices to be marketed as compatible with Windows 8.</ul></ul>
<p>You will probably want to have a spare monitor or one with multiple input ports connected to different GPUs (the passthrough GPU will not display anything if there is no screen plugged in and using a VNC or Spice connection will not help your performance), as well as a mouse and a keyboard you can pass to your virtual machine. If anything goes wrong, you will at least have a way to control your host machine this way.
</p>
<h2><span class=mw-headline id=Setting_up_IOMMU>Setting up IOMMU</span></h2>
<div class="archwiki-template-box archwiki-template-box-note"><strong>Note:</strong>
<ul><li>IOMMU is a generic name for Intel VT-d and AMD-Vi.</li>
<li>VT-d stands for <i>Intel Virtualization Technology for Directed I/O</i> and should not be confused with VT-x <i>Intel Virtualization Technology</i>. VT-x allows one hardware platform to function as multiple “virtual” platforms while VT-d improves security and reliability of the systems and also improves performance of I/O devices in virtualized environments.</ul>
</div>
<p>Using IOMMU opens to features like PCI passthrough and memory protection from faulty or malicious devices, see <a href=https://en.wikipedia.org/wiki/Input-output_memory_management_unit#Advantages class=extiw title="wikipedia:Input-output memory management unit">Wikipedia:Input-output memory management unit#Advantages</a> and <a rel=nofollow class="external text" href=https://www.quora.com/Memory-Management-computer-programming/Could-you-explain-IOMMU-in-plain-English>Memory Management (computer programming): Could you explain IOMMU in plain English?</a>.
</p>
<h3><span class=mw-headline id=Enabling_IOMMU>Enabling IOMMU</span></h3>
<p>Ensure that AMD-Vi/Intel VT-d is supported by the CPU and enabled in the BIOS settings. Both normally show up alongside other CPU features (meaning they could be in an overclocking-related menu) either with their actual names ("VT-d" or "AMD-Vi") or in more ambiguous terms such as "Virtualization technology", which may or may not be explained in the manual.
<p>Manually enable IOMMU support by setting the correct <a href=https://wiki.archlinux.org/title/Kernel_parameter class=mw-redirect title="Kernel parameter">kernel parameter</a> depending on the type of CPU in use:
</p>
<ul><li>For Intel CPUs (VT-d) set <code>intel_iommu=on</code>. Since the kernel config option CONFIG_INTEL_IOMMU_DEFAULT_ON is not set in <span class="plainlinks archwiki-template-pkg"><a rel=nofollow class="external text" href="https://archlinux.org/packages/?name=linux">linux</a></span>.</li>
<li>For AMD CPUs (AMD-Vi), it is on if kernel detects IOMMU hardware support from BIOS.</ul>
<p>You should also append the <code>iommu=pt</code> parameter. This will prevent Linux from touching devices which cannot be passed through.
<p>After rebooting, check <a href=https://wiki.archlinux.org/title/Dmesg class=mw-redirect title=Dmesg>dmesg</a> to confirm that IOMMU has been correctly enabled:
</p>
<pre style=margin-bottom:0;border-bottom:none;padding-bottom:0.8em># dmesg | grep -i -e DMAR -e IOMMU</pre>
<pre style=margin-top:0;border-top-style:dashed;padding-top:0.8em>[ 0.000000] ACPI: DMAR 0x00000000BDCB1CB0 0000B8 (v01 INTEL BDW 00000001 INTL 00000001)
[ 0.000000] Intel-IOMMU: enabled
[ 0.028879] dmar: IOMMU 0: reg_base_addr fed90000 ver 1:0 cap c0000020660462 ecap f0101a
[ 0.028883] dmar: IOMMU 1: reg_base_addr fed91000 ver 1:0 cap d2008c20660462 ecap f010da
[ 0.028950] IOAPIC id 8 under DRHD base 0xfed91000 IOMMU 1
[ 0.536212] DMAR: No ATSR found
[ 0.536229] IOMMU 0 0xfed90000: using Queued invalidation
[ 0.536230] IOMMU 1 0xfed91000: using Queued invalidation
[ 0.536231] IOMMU: Setting RMRR:
[ 0.536241] IOMMU: Setting identity map for device 0000:00:02.0 [0xbf000000 - 0xcf1fffff]
[ 0.537490] IOMMU: Setting identity map for device 0000:00:14.0 [0xbdea8000 - 0xbdeb6fff]
[ 0.537512] IOMMU: Setting identity map for device 0000:00:1a.0 [0xbdea8000 - 0xbdeb6fff]
[ 0.537530] IOMMU: Setting identity map for device 0000:00:1d.0 [0xbdea8000 - 0xbdeb6fff]
[ 0.537543] IOMMU: Prepare 0-16MiB unity mapping for LPC
[ 0.537549] IOMMU: Setting identity map for device 0000:00:1f.0 [0x0 - 0xffffff]
[ 2.182790] [drm] DMAR active, disabling use of stolen memory
</pre>
<h3><span class=mw-headline id=Ensuring_that_the_groups_are_valid>Ensuring that the groups are valid</span></h3>
<p>The following script should allow you to see how your various PCI devices are mapped to IOMMU groups. If it does not return anything, you either have not enabled IOMMU support properly or your hardware does not support it.
</p>
<pre>#!/bin/bash
shopt -s nullglob
for g in $(find /sys/kernel/iommu_groups/* -maxdepth 0 -type d | sort -V); do
echo "IOMMU Group ${g##*/}:"
for d in $g/devices/*; do
echo -e "\t$(lspci -nns ${d##*/})"
done;
done;
</pre>
<p>Example output:
</p>
<pre>IOMMU Group 1:
00:01.0 PCI bridge: Intel Corporation Xeon E3-1200 v2/3rd Gen Core processor PCI Express Root Port [8086:0151] (rev 09)
IOMMU Group 2:
00:14.0 USB controller: Intel Corporation 7 Series/C210 Series Chipset Family USB xHCI Host Controller [8086:0e31] (rev 04)
IOMMU Group 4:
00:1a.0 USB controller: Intel Corporation 7 Series/C210 Series Chipset Family USB Enhanced Host Controller #2 [8086:0e2d] (rev 04)
IOMMU Group 10:
00:1d.0 USB controller: Intel Corporation 7 Series/C210 Series Chipset Family USB Enhanced Host Controller #1 [8086:0e26] (rev 04)
IOMMU Group 13:
06:00.0 VGA compatible controller: NVIDIA Corporation GM204 [GeForce GTX 970] [10de:13c2] (rev a1)
06:00.1 Audio device: NVIDIA Corporation GM204 High Definition Audio Controller [10de:0fbb] (rev a1)
</pre>
<p>An IOMMU group is the smallest set of physical devices that can be passed to a virtual machine. For instance, in the example above, both the GPU in 06:00.0 and its audio controller in 6:00.1 belong to IOMMU group 13 and can only be passed together. The frontal USB controller, however, has its own group (group 2) which is separate from both the USB expansion controller (group 10) and the rear USB controller (group 4), meaning that <a href=#USB_controller>any of them could be passed to a virtual machine without affecting the others</a>.
</p>
<h3><span class=mw-headline id=Gotchas>Gotchas</span></h3>
<h4><span class=mw-headline id=Plugging_your_guest_GPU_in_an_unisolated_CPU-based_PCIe_slot>Plugging your guest GPU in an unisolated CPU-based PCIe slot</span></h4>
<p>Not all PCI-E slots are the same. Most motherboards have PCIe slots provided by both the CPU and the PCH. Depending on your CPU, it is possible that your processor-based PCIe slot does not support isolation properly, in which case the PCI slot itself will appear to be grouped with the device that is connected to it.
</p>
<pre>IOMMU Group 1:
00:01.0 PCI bridge: Intel Corporation Xeon E3-1200 v2/3rd Gen Core processor PCI Express Root Port (rev 09)
01:00.0 VGA compatible controller: NVIDIA Corporation GM107 [GeForce GTX 750] (rev a2)
01:00.1 Audio device: NVIDIA Corporation Device 0fbc (rev a1)
</pre>
<p>This is fine so long as only your guest GPU is included in here, such as above. Depending on what is plugged in to your other PCIe slots and whether they are allocated to your CPU or your PCH, you may find yourself with additional devices within the same group, which would force you to pass those as well. If you are ok with passing everything that is in there to your virtual machine, you are free to continue. Otherwise, you will either need to try and plug your GPU in your other PCIe slots (if you have any) and see if those provide isolation from the rest or to install the ACS override patch, which comes with its own drawbacks. See <a href=#Bypassing_the_IOMMU_groups_(ACS_override_patch)>#Bypassing the IOMMU groups (ACS override patch)</a> for more information.
</p>
<div class="archwiki-template-box archwiki-template-box-note"><strong>Note:</strong> If they are grouped with other devices in this manner, pci root ports and bridges should neither be bound to vfio at boot, nor be added to the virtual machine.</div>
<h2><span class=mw-headline id=Isolating_the_GPU>Isolating the GPU</span></h2>
<p>In order to assign a device to a virtual machine, this device and all those sharing the same IOMMU group must have their driver replaced by a stub driver or a VFIO driver in order to prevent the host machine from interacting with them. In the case of most devices, this can be done on the fly right before the virtual machine starts.
<p>However, due to their size and complexity, GPU drivers do not tend to support dynamic rebinding very well, so you cannot just have some GPU you use on the host be transparently passed to a virtual machine without having both drivers conflict with each other. Because of this, it is generally advised to bind those placeholder drivers manually before starting the virtual machine, in order to stop other drivers from attempting to claim it.
<p>The following section details how to configure a GPU so those placeholder drivers are bound early during the boot process, which makes said device inactive until a virtual machine claims it or the driver is switched back. This is the preferred method, considering it has less caveats than switching drivers once the system is fully online.
</p>
<div class="archwiki-template-box archwiki-template-box-warning"><strong>Warning:</strong> Once you reboot after this procedure, whatever GPU you have configured will no longer be usable on the host until you reverse the manipulation. Make sure the GPU you intend to use on the host is properly configured before doing this - your motherboard should be set to display using the host GPU.</div>
<p>Starting with Linux 4.1, the kernel includes vfio-pci. This is a VFIO driver, meaning it fulfills the same role as pci-stub did, but it can also control devices to an extent, such as by switching them into their D3 state when they are not in use.
</p>
<h3><span class=mw-headline id=Binding_vfio-pci_via_device_ID>Binding vfio-pci via device ID</span></h3>
<p>Vfio-pci normally targets PCI devices by ID, meaning you only need to specify the IDs of the devices you intend to passthrough. For the following IOMMU group, you would want to bind vfio-pci with <code>10de:13c2</code> and <code>10de:0fbb</code>, which will be used as example values for the rest of this section.
</p>
<pre>IOMMU Group 13:
06:00.0 VGA compatible controller: NVIDIA Corporation GM204 [GeForce GTX 970] [10de:13c2] (rev a1)
06:00.1 Audio device: NVIDIA Corporation GM204 High Definition Audio Controller [10de:0fbb] (rev a1)}}
</pre>
<div class="archwiki-template-box archwiki-template-box-note"><strong>Note:</strong>
<ul><li>You cannot specify which device to isolate using vendor-device ID pairs if the host GPU and the guest GPU share the same pair (i.e : if both are the same model). If this is your case, read <a href=#Using_identical_guest_and_host_GPUs>#Using identical guest and host GPUs</a> instead.</li>
<li>If, as noted in <a href=#Plugging_your_guest_GPU_in_an_unisolated_CPU-based_PCIe_slot>#Plugging your guest GPU in an unisolated CPU-based PCIe slot</a>, your pci root port is part of your IOMMU group, you <b>must not</b> pass its ID to <code>vfio-pci</code>, as it needs to remain attached to the host to function properly. Any other device within that group, however, should be left for <code>vfio-pci</code> to bind with.</li>
<li>Binding the audio device (<code>10de:0fbb</code> in above's example) is optional. Libvirt is able to unbind it from the <code>snd_hda_intel</code> driver on its own.</ul>
</div>
<p>Two methods exist for providing the device IDs. Specifying them via <a href=https://wiki.archlinux.org/title/Kernel_parameters title="Kernel parameters">kernel parameters</a> has the advantage of being able to easily edit, remove, or undo any breaking changes via your boot loader:
</p>
<pre>vfio-pci.ids=10de:13c2,10de:0fbb
</pre>
<p>Alternatively, the IDs may be added to a modprobe conf file. Since these conf files are embedded in the initramfs image, any changes require regenerating a new image each time:
</p>
<pre style=margin-bottom:0;border-bottom:none;padding-bottom:0.8em>/etc/modprobe.d/vfio.conf</pre>
<pre style=margin-top:0;border-top-style:dashed;padding-top:0.8em>options vfio-pci ids=10de:13c2,10de:0fbb</pre>
<h3><span class=mw-headline id=Loading_vfio-pci_early>Loading vfio-pci early</span></h3>
<h4><span class=mw-headline id=mkinitcpio>mkinitcpio</span></h4>
<p>Since Arch's <span class="plainlinks archwiki-template-pkg"><a rel=nofollow class="external text" href="https://archlinux.org/packages/?name=linux">linux</a></span> has vfio-pci built as a module, we need to force it to load early before the graphics drivers have a chance to bind to the card. To ensure that, add <code>vfio_pci</code>, <code>vfio</code>, <code>vfio_iommu_type1</code>, and <code>vfio_virqfd</code> to <a href=https://wiki.archlinux.org/title/Mkinitcpio title=Mkinitcpio>mkinitcpio</a>:
</p>
<pre style=margin-bottom:0;border-bottom:none;padding-bottom:0.8em>/etc/mkinitcpio.conf</pre>
<pre style=margin-top:0;border-top-style:dashed;padding-top:0.8em>MODULES=(... vfio_pci vfio vfio_iommu_type1 vfio_virqfd ...)</pre>
<div class="archwiki-template-box archwiki-template-box-note"><strong>Note:</strong>
<ul><li>If you also have another driver loaded this way for <a href=https://wiki.archlinux.org/title/Kernel_mode_setting#Early_KMS_start title="Kernel mode setting">early modesetting</a> (such as <code>nouveau</code>, <code>radeon</code>, <code>amdgpu</code>, <code>i915</code>, etc.), all of the aforementioned VFIO modules must precede it.</li>
<li>If you are modesetting the <code>nvidia</code> driver, the <code>vfio-pci.ids</code> must be embedded in the initramfs image. If given via kernel arguments, they will be read too late to take effect. Follow the instructions in <a href=#Binding_vfio-pci_via_device_ID>#Binding vfio-pci via device ID</a> for adding the ids to a modprobe conf file.</ul>
</div>
<p>Also, ensure that the modconf hook is included in the HOOKS list of <code>mkinitcpio.conf</code>:
</p>
<pre style=margin-bottom:0;border-bottom:none;padding-bottom:0.8em>/etc/mkinitcpio.conf</pre>
<pre style=margin-top:0;border-top-style:dashed;padding-top:0.8em>HOOKS=(... modconf ...)</pre>
<p>Since new modules have been added to the initramfs configuration, you must <a href=https://wiki.archlinux.org/title/Regenerate_the_initramfs class=mw-redirect title="Regenerate the initramfs">regenerate the initramfs</a>.
</p>
<h4><span class=mw-headline id=booster>booster</span></h4>
<p>Similar to mkinitcpio you need to specify modules to load early:
</p>
<pre style=margin-bottom:0;border-bottom:none;padding-bottom:0.8em>/etc/booster.yaml</pre>
<pre style=margin-top:0;border-top-style:dashed;padding-top:0.8em>modules_force_load: vfio_pci,vfio,vfio_iommu_type1,vfio_virqfd</pre>
<p>and then <a href=https://wiki.archlinux.org/title/Booster#Regenerate_booster_images title=Booster>regenerate the initramfs</a>.
</p>
<h4><span class=mw-headline id=dracut>dracut</span></h4>
<p>dracut's early loading mechanism is configured via kernel parameters. To load vfio-pci early, add both the <a href=#Binding_vfio-pci_via_device_ID>device ids</a> and the following line to your <a href=https://wiki.archlinux.org/title/Kernel_parameters title="Kernel parameters">kernel parameters</a>:
</p>
<pre>rd.driver.pre=vfio_pci
</pre>
<p>We also need to add all the vfio drivers to the initramfs. Add the following file to <code>/etc/dracut.conf.d</code>:
</p>
<pre style=margin-bottom:0;border-bottom:none;padding-bottom:0.8em>10-vfio.conf</pre>
<pre style=margin-top:0;border-top-style:dashed;padding-top:0.8em>add_drivers+=" vfio_pci vfio vfio_iommu_type1 vfio_virqfd "</pre>
<p>As with mkinitcpio, you must regenerate the initramfs. See <a href=https://wiki.archlinux.org/title/Dracut title=Dracut>dracut</a> for more details.
</p>
<h3><span class=mw-headline id=Verifying_that_the_configuration_worked>Verifying that the configuration worked</span></h3>
<p>Reboot and verify that vfio-pci has loaded properly and that it is now bound to the right devices.
</p>
<pre style=margin-bottom:0;border-bottom:none;padding-bottom:0.8em># dmesg | grep -i vfio</pre>
<pre style=margin-top:0;border-top-style:dashed;padding-top:0.8em>[ 0.329224] VFIO - User Level meta-driver version: 0.3
[ 0.341372] vfio_pci: add [10de:13c2[ffff:ffff]] class 0x000000/00000000
[ 0.354704] vfio_pci: add [10de:0fbb[ffff:ffff]] class 0x000000/00000000
[ 2.061326] vfio-pci 0000:06:00.0: enabling device (0100 -> 0103)
</pre>
<p>It is not necessary for all devices (or even expected device) from <code>vfio.conf</code> to be in <i>dmesg</i> output.
Even if a device does not appear, it might still be visible and usable in the guest virtual machine.
</p>
<pre style=margin-bottom:0;border-bottom:none;padding-bottom:0.8em>$ lspci -nnk -d 10de:13c2</pre>
<pre style=margin-top:0;border-top-style:dashed;padding-top:0.8em>06:00.0 VGA compatible controller: NVIDIA Corporation GM204 [GeForce GTX 970] [10de:13c2] (rev a1)
Kernel driver in use: vfio-pci
Kernel modules: nouveau nvidia
</pre>
<pre style=margin-bottom:0;border-bottom:none;padding-bottom:0.8em>$ lspci -nnk -d 10de:0fbb</pre>
<pre style=margin-top:0;border-top-style:dashed;padding-top:0.8em>06:00.1 Audio device: NVIDIA Corporation GM204 High Definition Audio Controller [10de:0fbb] (rev a1)
Kernel driver in use: vfio-pci
Kernel modules: snd_hda_intel
</pre>
<h2><span class=mw-headline id=Setting_up_an_OVMF-based_guest_virtual_machine>Setting up an OVMF-based guest virtual machine</span></h2>
<p>OVMF is an open-source UEFI firmware for QEMU virtual machines. While it is possible to use SeaBIOS to get similar results to an actual PCI passthrough, the setup process is different and it is generally preferable to use the EFI method if your hardware supports it.
</p>
<h3><span class=mw-headline id=Configuring_libvirt>Configuring libvirt</span></h3>
<p><a href=https://wiki.archlinux.org/title/Libvirt title=Libvirt>Libvirt</a> is a wrapper for a number of virtualization utilities that greatly simplifies the configuration and deployment process of virtual machines. In the case of KVM and QEMU, the frontend it provides allows us to avoid dealing with the permissions for QEMU and make it easier to add and remove various devices on a live virtual machine. Its status as a wrapper, however, means that it might not always support all of the latest qemu features, which could end up requiring the use of a wrapper script to provide some extra arguments to QEMU.
</p>
<div class="noprint archwiki-template-message">
<p><a href=https://wiki.archlinux.org/title/File:Tango-inaccurate.png class=image><img alt=Tango-inaccurate.png src='data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="48" height="48"><rect fill-opacity="0"/></svg>' decoding=async width=48 height=48 style="background-blend-mode:normal!important;background-clip:content-box!important;background-position:50% 50%!important;background-color:rgba(0,0,0,0)!important;background-image:var(--sf-img-13)!important;background-size:100% 100%!important;background-origin:content-box!important;background-repeat:no-repeat!important"></a><b>The factual accuracy of this article or section is disputed.</b><a href=https://wiki.archlinux.org/title/File:Tango-inaccurate.png class=image><img alt=Tango-inaccurate.png src='data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="48" height="48"><rect fill-opacity="0"/></svg>' decoding=async width=48 height=48 style="background-blend-mode:normal!important;background-clip:content-box!important;background-position:50% 50%!important;background-color:rgba(0,0,0,0)!important;background-image:var(--sf-img-13)!important;background-size:100% 100%!important;background-origin:content-box!important;background-repeat:no-repeat!important"></a></p>
<div><b>Reason:</b> <span class="plainlinks archwiki-template-pkg"><a rel=nofollow class="external text" href="https://archlinux.org/packages/?name=libvirt">libvirt</a></span> depends on <i>ebtables</i>, not <span class="plainlinks archwiki-template-pkg"><a rel=nofollow class="external text" href="https://archlinux.org/packages/?name=iptables-nft">iptables-nft</a></span> which is just a translation layer. (Discuss in <a rel=nofollow class="external text" href=https://wiki.archlinux.org/title/Talk:PCI_passthrough_via_OVMF>Talk:PCI passthrough via OVMF</a>)</div>
</div>
<p>Install <span class="plainlinks archwiki-template-pkg"><a rel=nofollow class="external text" href="https://archlinux.org/packages/?name=qemu">qemu</a></span>, <span class="plainlinks archwiki-template-pkg"><a rel=nofollow class="external text" href="https://archlinux.org/packages/?name=libvirt">libvirt</a></span>, <span class="plainlinks archwiki-template-pkg"><a rel=nofollow class="external text" href="https://archlinux.org/packages/?name=edk2-ovmf">edk2-ovmf</a></span>, and <span class="plainlinks archwiki-template-pkg"><a rel=nofollow class="external text" href="https://archlinux.org/packages/?name=virt-manager">virt-manager</a></span>. For the default network connection, <span class="plainlinks archwiki-template-pkg"><a rel=nofollow class="external text" href="https://archlinux.org/packages/?name=iptables-nft">iptables-nft</a></span> and <span class="plainlinks archwiki-template-pkg"><a rel=nofollow class="external text" href="https://archlinux.org/packages/?name=dnsmasq">dnsmasq</a></span> are required.
<p>You can now <a href=https://wiki.archlinux.org/title/Enable class=mw-redirect title=Enable>enable</a> and <a href=https://wiki.archlinux.org/title/Start class=mw-redirect title=Start>start</a> <code>libvirtd.service</code> and its logging component <code>virtlogd.socket</code>.
<p>You may also need to <a rel=nofollow class="external text" href=https://wiki.libvirt.org/page/Networking#NAT_forwarding_.28aka_.22virtual_networks.22.29>activate the default libvirt network</a>:
</p>
<pre># virsh net-autostart default
# virsh net-start default
</pre>
<div class="archwiki-template-box archwiki-template-box-note"><strong>Note:</strong> The default libvirt network will only be listed if the virsh command is run as root.</div>
<h3><span class=mw-headline id=Setting_up_the_guest_OS>Setting up the guest OS</span></h3>
<p>The process of setting up a virtual machine using <code>virt-manager</code> is mostly self-explanatory, as most of the process comes with fairly comprehensive on-screen instructions.
<p>However, you should pay special attention to the following steps:
</p>
<ul><li>When the virtual machine creation wizard asks you to name your virtual machine (final step before clicking "Finish"), check the "Customize before install" checkbox.</li>
<li>In the "Overview" section, <a rel=nofollow class="external text" href=https://i.imgur.com/73r2ctM.png>set your firmware to "UEFI"</a>. If the option is grayed out, make sure that:
<ul><li>Your hypervisor is running as a system session and not a user session. This can be verified <a rel=nofollow class="external text" href=https://i.ibb.co/N1XZCdp/Deepin-Screenshot-select-area-20190125113216.png>by clicking, then hovering</a> over the session in virt-manager. If you are accidentally running it as a user session, you must open a new connection by clicking "File" > "Add Connection..", then select the option from the drop-down menu station "QEMU/KVM" and not "QEMU/KVM user session".</ul></li>
<li>In the "CPUs" section, change your CPU model to "host-passthrough". If it is not in the list, you will have to either type it by hand or by using <code>virt-xml <i>vmname</i> --edit --cpu host-passthrough</code>. This will ensure that your CPU is detected properly, since it causes libvirt to expose your CPU capabilities exactly as they are instead of only those it recognizes (which is the preferred default behavior to make CPU behavior easier to reproduce). Without it, some applications may complain about your CPU being of an unknown model.</li>
<li>If you want to minimize IO overhead, it is easier to setup <a href=#Virtio_disk>#Virtio disk</a> before installing</ul>
<p>The rest of the installation process will take place as normal using a standard QXL video adapter running in a window. At this point, there is no need to install additional drivers for the rest of the virtual devices, since most of them will be removed later on. Once the guest OS is done installing, simply turn off the virtual machine. It is possible you will be dropped into the UEFI menu instead of starting the installation upon powering your virtual machine for the first time. Sometimes the correct ISO file was not automatically detected and you will need to manually specify the drive to boot. By typing exit and navigating to "boot manager" you will enter a menu that allows you to choose between devices.
</p>
<h3><span class=mw-headline id=Attaching_the_PCI_devices>Attaching the PCI devices</span></h3>
<p>With the installation done, it is now possible to edit the hardware details in libvirt and remove virtual integration devices, such as the spice channel and virtual display, the QXL video adapter, the emulated mouse and keyboard and the USB tablet device. For example, remove the following sections from your XML file:
</p>
<pre> <channel type="spicevmc">
...
</channel>
<input type="tablet" bus="usb">
...
</input>
<input type="mouse" bus="ps2"/>
<input type="keyboard" bus="ps2"/>
<graphics type="spice" autoport="yes">
...
</graphics>
<video>
<model type="qxl" .../>
...
</video></pre>
<p>Since that leaves you with no input devices, you may want to bind a few USB host devices to your virtual machine as well, but remember to <b>leave at least one mouse and/or keyboard assigned to your host</b> in case something goes wrong with the guest. This may be done by using <code>Add Hardware > USB Host Device</code>.
<p>At this point, it also becomes possible to attach the PCI device that was isolated earlier; simply click on "Add Hardware" and select the PCI Host Devices you want to passthrough. If everything went well, the screen plugged into your GPU should show the OVMF splash screen and your virtual machine should start up normally. From there, you can setup the drivers for the rest of your virtual machine.
</p>
<h3><span class=mw-headline id=Video_card_driver_virtualisation_detection>Video card driver virtualisation detection</span></h3>
<p>Video card drivers by AMD incorporate very basic virtual machine detection targeting Hyper-V extensions. Should this detection mechanism trigger, the drivers will refuse to run, resulting in a black screen.
<p>If this is the case, it is required to modify the reported Hyper-V vendor ID:
</p>
<pre style=margin-bottom:0;border-bottom:none;padding-bottom:0.8em>$ virsh edit <i>vmname</i></pre>
<pre style=margin-top:0;border-top-style:dashed;padding-top:0.8em>...
<features>
...
<hyperv>
...
<vendor_id state='on' value='randomid'/>
...
</hyperv>
...
</features>
...</pre>
<p>Nvidia guest drivers prior to version 465 exhibited a similar behaviour which resulted in a generic error 43 in the card's device manager status. Systems using these older drivers therefore also need the above modification. In addition, they also require hiding the KVM CPU leaf:
</p>
<pre style=margin-bottom:0;border-bottom:none;padding-bottom:0.8em>$ virsh edit <i>vmname</i></pre>
<pre style=margin-top:0;border-top-style:dashed;padding-top:0.8em>...
<features>
...
<kvm>
<hidden state='on'/>
</kvm>
...
</features>
...</pre>
<p>Note that the above steps do not equate 'hiding' the virtual machine from Windows or any drivers/programs running in the virtual machine. Also, various other issues not related to any detection mechanism referred to here can also trigger error 43.
</p>
<h3><span id=Passing_keyboard.2Fmouse_via_Evdev></span><span class=mw-headline id=Passing_keyboard/mouse_via_Evdev>Passing keyboard/mouse via Evdev</span></h3>
<p>If you do not have a spare mouse or keyboard to dedicate to your guest, and you do not want to suffer from the video overhead of Spice, you can setup evdev to share them between your Linux host and your virtual machine.
</p>
<div class="archwiki-template-box archwiki-template-box-note"><strong>Note:</strong> Press both left and right <b>Ctrl</b> keys at the same time to swap control between the host and the guest.</div>
<p>First, find your keyboard and mouse devices in <code>/dev/input/by-id/</code>. Only devices with <code>event</code> in their name are valid. You may find multiple devices associated to your mouse or keyboard, so try <code>cat /dev/input/by-id/<i>device_id</i></code> and either hit some keys on the keyboard or wiggle your mouse to see if input comes through, if so you have got the right device. Now add those devices to your configuration:
</p>
<pre style=margin-bottom:0;border-bottom:none;padding-bottom:0.8em>$ virsh edit <i>vmname</i></pre>
<pre style=margin-top:0;border-top-style:dashed;padding-top:0.8em>...
<devices>
...
<input type='evdev'>
<source dev='/dev/input/by-id/MOUSE_NAME'/>
</input>
<input type='evdev'>
<source dev='/dev/input/by-id/KEYBOARD_NAME' grab='all' repeat='on'/>
</input>
...
</devices></pre>
<p>Replace <code>MOUSE_NAME</code> and <code>KEYBOARD_NAME</code> with your device path. Now you can startup the guest OS and test swapping control of your mouse and keyboard between the host and guest by pressing both the left and right control keys at the same time.
<p>You may also consider switching from PS/2 to Virtio inputs in your configurations. Add these two devices:
</p>
<pre style=margin-bottom:0;border-bottom:none;padding-bottom:0.8em>$ virsh edit <i>vmname</i></pre>
<pre style=margin-top:0;border-top-style:dashed;padding-top:0.8em>...
<input type='mouse' bus='virtio'/>
<input type='keyboard' bus='virtio'/>
...</pre>
<p>The virtio input devices will not actually be used until the guest drivers are installed. QEMU will continue to send key events to the PS2 devices until it detects the virtio input driver initialization. Note that the PS2 devices cannot be removed as they are an internal function of the emulated Q35/440FX chipsets.
</p>
<h3><span class=mw-headline id=Gotchas_2>Gotchas</span></h3>
<h4><span class=mw-headline id=Using_a_non-EFI_image_on_an_OVMF-based_virtual_machine>Using a non-EFI image on an OVMF-based virtual machine</span></h4>
<p>The OVMF firmware does not support booting off non-EFI mediums. If the installation process drops you in a UEFI shell right after booting, you may have an invalid EFI boot media. Try using an alternate Linux/Windows image to determine if you have an invalid media.
</p>
<h2><span class=mw-headline id=Performance_tuning>Performance tuning</span></h2>
<p>Most use cases for PCI passthroughs relate to performance-intensive domains such as video games and GPU-accelerated tasks. While a PCI passthrough on its own is a step towards reaching native performance, there are still a few ajustments on the host and guest to get the most out of your virtual machine.
</p>
<h3><span class=mw-headline id=CPU_pinning>CPU pinning</span></h3>
<p>The default behavior for KVM guests is to run operations coming from the guest as a number of threads representing virtual processors. Those threads are managed by the Linux scheduler like any other thread and are dispatched to any available CPU cores based on niceness and priority queues. As such, the local CPU cache benefits (L1/L2/L3) are lost each time the host scheduler reschedules the virtual CPU thread on a different physical CPU. This can noticeably harm performance on the guest. CPU pinning aims to resolve this by limiting which physical CPUs the virtual CPUs are allowed to run on. The ideal setup is a one to one mapping such that the virtual CPU cores match physical CPU cores while taking hyperthreading/SMT into account.
<p>In addition, in some modern CPUs, groups of cores often share a common L3 cache. In such cases, care should be taken to pin exactly those physical cores that share a particular L3. Failing to do so might lead to cache evictions which could result in microstutters.
</p>
<div class="archwiki-template-box archwiki-template-box-note"><strong>Note:</strong> For certain users enabling CPU pinning may introduce stuttering and short hangs, especially with the MuQSS scheduler (present in linux-ck and linux-zen kernels). You might want to try disabling pinning first if you experience similar issues, which effectively trades maximum performance for responsiveness at all times.</div>
<h4><span class=mw-headline id=CPU_topology>CPU topology</span></h4>
<p>Most modern CPUs support hardware multitasking, also known as hyper-threading on Intel CPUs or SMT on AMD CPUs. Hyper-threading/SMT is simply a very efficient way of running two threads on one CPU core at any given time. You will want to take into consideration that the CPU pinning you choose will greatly depend on what you do with your host while your virtual machine is running.
<p>To find the topology for your CPU run <code>lscpu -e</code>:
</p>
<div class="archwiki-template-box archwiki-template-box-note"><strong>Note:</strong> Pay special attention to the 4th column <b>"CORE"</b> as this shows the association of the Physical/Logical CPU cores as well as the 8th column <b>"L3"</b> which shows which cores are connected to which L3 cache.</div>
<p><code>lscpu -e</code> on a 6c/12t Ryzen 5 1600:
</p>
<pre>CPU NODE SOCKET CORE L1d:L1i:L2:L3 ONLINE MAXMHZ MINMHZ
0 0 0 0 0:0:0:0 yes 3800.0000 1550.0000
1 0 0 0 0:0:0:0 yes 3800.0000 1550.0000
2 0 0 1 1:1:1:0 yes 3800.0000 1550.0000
3 0 0 1 1:1:1:0 yes 3800.0000 1550.0000
4 0 0 2 2:2:2:0 yes 3800.0000 1550.0000
5 0 0 2 2:2:2:0 yes 3800.0000 1550.0000
6 0 0 3 3:3:3:1 yes 3800.0000 1550.0000
7 0 0 3 3:3:3:1 yes 3800.0000 1550.0000
8 0 0 4 4:4:4:1 yes 3800.0000 1550.0000
9 0 0 4 4:4:4:1 yes 3800.0000 1550.0000
10 0 0 5 5:5:5:1 yes 3800.0000 1550.0000
11 0 0 5 5:5:5:1 yes 3800.0000 1550.0000
</pre>
<p>Considering the L3 mapping, it is recommended to pin and isolate CPUs 6–11. Pinning and isolating fewer than these (e.g. 8–11) would result in the host system making use of the L3 cache in core 6 and 7 which would eventually lead to cache evictions and therefore bad performance.
</p>
<div class="archwiki-template-box archwiki-template-box-note"><strong>Note:</strong> Ryzen 3000 ComboPi AGESA changes topology to match Intel example, even on prior generation CPUs. Above valid only on older AGESA.</div>
<p><code>lscpu -e</code> on a 6c/12t Intel 8700k:
</p>
<pre>CPU NODE SOCKET CORE L1d:L1i:L2:L3 ONLINE MAXMHZ MINMHZ
0 0 0 0 0:0:0:0 yes 4600.0000 800.0000
1 0 0 1 1:1:1:0 yes 4600.0000 800.0000
2 0 0 2 2:2:2:0 yes 4600.0000 800.0000
3 0 0 3 3:3:3:0 yes 4600.0000 800.0000
4 0 0 4 4:4:4:0 yes 4600.0000 800.0000
5 0 0 5 5:5:5:0 yes 4600.0000 800.0000
6 0 0 0 0:0:0:0 yes 4600.0000 800.0000
7 0 0 1 1:1:1:0 yes 4600.0000 800.0000
8 0 0 2 2:2:2:0 yes 4600.0000 800.0000
9 0 0 3 3:3:3:0 yes 4600.0000 800.0000
10 0 0 4 4:4:4:0 yes 4600.0000 800.0000
11 0 0 5 5:5:5:0 yes 4600.0000 800.0000
</pre>
<p>Since all cores are connected to the same L3 in this example, it does not matter much how many CPUs you pin and isolate as long as you do it in the proper thread pairs. For instance, (0, 6), (1, 7), etc.
<p>As we see above, with AMD <b>Core 0</b> is sequential with <b>CPU 0 & 1</b>, whereas Intel places <b>Core 0</b> on <b>CPU 0 & 6</b>.
</p>
<div class="archwiki-template-box archwiki-template-box-tip"><strong>Tip:</strong> You can view your systems topology in diagram form, which may help some users. If you have <span class="plainlinks archwiki-template-pkg"><a rel=nofollow class="external text" href="https://archlinux.org/packages/?name=hwloc">hwloc</a></span> installed, run <code>lstopo</code> to generate a helpful image of your CPU/Thread groupings.</div>
<p>If you do not need all cores for the guest, it would then be preferable to leave at the very least one core for the host. Choosing which cores one to use for the host or guest should be based on the specific hardware characteristics of your CPU, however <b>Core 0</b> is a good choice for the host in most cases. If any cores are reserved for the host, it is recommended to pin the emulator and iothreads, if used, to the host cores rather than the VCPUs. This may improve performance and reduce latency for the guest since those threads will not pollute the cache or contend for scheduling with the guest VCPU threads. If all cores are passed to the guest, there is no need or benefit to pinning the emulator or iothreads.
</p>
<h4><span class=mw-headline id=XML_examples>XML examples</span></h4>
<div class="archwiki-template-box archwiki-template-box-note"><strong>Note:</strong> Do not use the <b>iothread</b> lines from the XML examples shown below if you have not added an <b>iothread</b> to your disk controller. <b>iothread'</b>s only work on <b>virtio-scsi</b> or <b>virtio-blk</b> devices.</div>
<h5><span id=4c.2F1t_CPU_w.2Fo_Hyperthreading_Example></span><span class=mw-headline id=4c/1t_CPU_w/o_Hyperthreading_Example>4c/1t CPU w/o Hyperthreading Example</span></h5>
<pre style=margin-bottom:0;border-bottom:none;padding-bottom:0.8em>$ virsh edit <i>vmname</i></pre>
<pre style=margin-top:0;border-top-style:dashed;padding-top:0.8em>...
<vcpu placement='static'>4</vcpu>
<cputune>
<vcpupin vcpu='0' cpuset='0'/>
<vcpupin vcpu='1' cpuset='1'/>
<vcpupin vcpu='2' cpuset='2'/>
<vcpupin vcpu='3' cpuset='3'/>
</cputune>
...</pre>
<h5><span id=4c.2F2t_Intel.2FAMD_CPU_example_.28after_ComboPI_AGESA_bios_update.29></span><span class=mw-headline id=4c/2t_Intel/AMD_CPU_example_(after_ComboPI_AGESA_bios_update)>4c/2t Intel/AMD CPU example (after ComboPI AGESA bios update)</span></h5>
<pre style=margin-bottom:0;border-bottom:none;padding-bottom:0.8em>$ virsh edit <i>vmname</i></pre>
<pre style=margin-top:0;border-top-style:dashed;padding-top:0.8em>...
<vcpu placement='static'>8</vcpu>
<iothreads>1</iothreads>
<cputune>
<vcpupin vcpu='0' cpuset='2'/>
<vcpupin vcpu='1' cpuset='8'/>
<vcpupin vcpu='2' cpuset='3'/>
<vcpupin vcpu='3' cpuset='9'/>
<vcpupin vcpu='4' cpuset='4'/>
<vcpupin vcpu='5' cpuset='10'/>
<vcpupin vcpu='6' cpuset='5'/>
<vcpupin vcpu='7' cpuset='11'/>
<emulatorpin cpuset='0,6'/>
<iothreadpin iothread='1' cpuset='0,6'/>
</cputune>
...
<cpu mode='host-passthrough'>
<topology sockets='1' cores='4' threads='2'/>
</cpu>
...</pre>
<h5><span id=4c.2F2t_AMD_CPU_example_.28Before_ComboPi_AGESA_bios_update.29></span><span class=mw-headline id=4c/2t_AMD_CPU_example_(Before_ComboPi_AGESA_bios_update)>4c/2t AMD CPU example (Before ComboPi AGESA bios update)</span></h5>
<pre style=margin-bottom:0;border-bottom:none;padding-bottom:0.8em>$ virsh edit <i>vmname</i></pre>
<pre style=margin-top:0;border-top-style:dashed;padding-top:0.8em>...
<vcpu placement='static'>8</vcpu>
<iothreads>1</iothreads>
<cputune>
<vcpupin vcpu='0' cpuset='2'/>
<vcpupin vcpu='1' cpuset='3'/>
<vcpupin vcpu='2' cpuset='4'/>
<vcpupin vcpu='3' cpuset='5'/>
<vcpupin vcpu='4' cpuset='6'/>
<vcpupin vcpu='5' cpuset='7'/>
<vcpupin vcpu='6' cpuset='8'/>
<vcpupin vcpu='7' cpuset='9'/>
<emulatorpin cpuset='0-1'/>
<iothreadpin iothread='1' cpuset='0-1'/>
</cputune>
...
<cpu mode='host-passthrough'>
<topology sockets='1' cores='4' threads='2'/>
</cpu>
...</pre>
<div class="archwiki-template-box archwiki-template-box-note"><strong>Note:</strong> If further CPU isolation is needed, consider using the <b>isolcpus</b> kernel command-line parameter on the unused physical/logical cores.</div>
<p>If you do not intend to be doing any computation-heavy work on the host (or even anything at all) at the same time as you would on the virtual machine, you may want to pin your virtual machine threads across all of your cores, so that the virtual machine can fully take advantage of the spare CPU time the host has available. Be aware that pinning all physical and logical cores of your CPU could induce latency in the guest virtual machine.
</p>
<h3><span class=mw-headline id=Huge_memory_pages>Huge memory pages</span></h3>
<p>When dealing with applications that require large amounts of memory, memory latency can become a problem since the more memory pages are being used, the more likely it is that this application will attempt to access information across multiple memory "pages", which is the base unit for memory allocation. Resolving the actual address of the memory page takes multiple steps, and so CPUs normally cache information on recently used memory pages to make subsequent uses on the same pages faster. Applications using large amounts of memory run into a problem where, for instance, a virtual machine uses 4 GiB of memory divided into 4 KiB pages (which is the default size for normal pages) for a total of 1.04 million pages, meaning that such cache misses can become extremely frequent and greatly increase memory latency. Huge pages exist to mitigate this issue by giving larger individual pages to those applications, increasing the odds that multiple operations will target the same page in succession.
</p>
<h4><span class=mw-headline id=Transparent_huge_pages>Transparent huge pages</span></h4>
<p>QEMU will use 2MiB sized transparent huge pages automatically without any explicit configuration in QEMU or Libvirt, subject to some important caveats. When using VFIO the pages are locked in at boot time and transparent huge pages are allocated up front when the virtual machine first boots. If the kernel memory is highly fragmented, or the virtual machine is using a majority of the remaining free memory, it is likely that the kernel will not have enough 2MiB pages to fully satisfy the allocation. In such a case, it silently fails by using a mix of 2MiB and 4KiB pages. Since the pages are locked in VFIO mode, the kernel will not be able to convert those 4KiB pages to huge after the virtual machine starts either. The number of available 2MiB huge pages available to THP is the same as via the <a href=#Dynamic_huge_pages>#Dynamic huge pages</a> mechanism described in the following sections.
<p>To check how much memory THP is using globally:
</p>
<pre style=margin-bottom:0;border-bottom:none;padding-bottom:0.8em>$ grep AnonHugePages /proc/meminfo</pre>
<pre style=margin-top:0;border-top-style:dashed;padding-top:0.8em>AnonHugePages: 8091648 kB
</pre>
<p>To check a specific QEMU instance. QEMU's PID must be substituted in the grep command:
</p>
<pre style=margin-bottom:0;border-bottom:none;padding-bottom:0.8em>$ grep -P 'AnonHugePages:\s+(?!0)\d+' /proc/[PID]/smaps</pre>
<pre style=margin-top:0;border-top-style:dashed;padding-top:0.8em>AnonHugePages: 8087552 kB
</pre>
<p>In this example, the virtual machine was allocated 8388608KiB of memory, but only 8087552KiB was available via THP. The remaining 301056KiB are allocated as 4KiB pages. Aside from manually checking, there is no indication when partial allocations occur. As such, THP's effectiveness is very much dependent on the host system's memory fragmentation at the time of virtual machine startup. If this trade off is unacceptable or strict guarantees are required, <a href=#Static_huge_pages>#Static huge pages</a> is recommended.
<p>Arch kernels have THP compiled in and enabled by default with <code>/sys/kernel/mm/transparent_hugepage/enabled</code> set to <code>madvise</code> mode.
</p>
<h4><span class=mw-headline id=Static_huge_pages>Static huge pages</span></h4>
<p>While transparent huge pages should work in the vast majority of cases, they can also be allocated statically during boot. This should only be needed to make use 1 GiB hugepages on machines that support it, since transparent huge pages normally only go up to 2 MiB.
</p>
<div class="archwiki-template-box archwiki-template-box-warning"><strong>Warning:</strong> Static huge pages lock down the allocated amount of memory, making it unavailable for applications that are not configured to use them. Allocating 4 GiBs worth of huge pages on a machine with 8 GiB of memory will only leave you with 4 GiB of available memory on the host <b>even when the virtual machine is not running</b>.</div>
<div class="archwiki-template-box archwiki-template-box-note"><strong>Note:</strong> The described procedures have some drawbacks but will not necessarily net you a great performance advantage. According to <a rel=nofollow class="external text" href=https://developers.redhat.com/blog/2021/04/27/benchmarking-transparent-versus-1gib-static-huge-page-performance-in-linux-virtual-machines#benchmarks>Red Hat benchmarks</a>, you should not expect more than a 2% performance gain from this over <a href=#Transparent_huge_pages>#Transparent huge pages</a>.</div>
<p>To allocate huge pages at boot, one must simply specify the desired amount on their kernel command line with <code>hugepages=<i>x</i></code>. For instance, reserving 1024 pages with <code>hugepages=1024</code> and the default size of 2048 KiB per huge page creates 2 GiB worth of memory for the virtual machine to use.
<p>If supported by CPU page size could be set manually. 1 GiB huge page support could be verified by <code>grep pdpe1gb /proc/cpuinfo</code>. Setting 1 GiB huge page size via kernel parameters : <code>default_hugepagesz=1G hugepagesz=1G hugepages=X</code>.
<p>Also, since static huge pages can only be used by applications that specifically request it, you must add this section in your libvirt domain configuration to allow kvm to benefit from them :
</p>
<pre style=margin-bottom:0;border-bottom:none;padding-bottom:0.8em>$ virsh edit <i>vmname</i></pre>
<pre style=margin-top:0;border-top-style:dashed;padding-top:0.8em>...
<memoryBacking>
<hugepages/>
</memoryBacking>
...</pre>
<h4><span class=mw-headline id=Dynamic_huge_pages>Dynamic huge pages</span></h4>
<div class="noprint archwiki-template-message">
<p><a href=https://wiki.archlinux.org/title/File:Tango-inaccurate.png class=image><img alt=Tango-inaccurate.png src='data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="48" height="48"><rect fill-opacity="0"/></svg>' decoding=async width=48 height=48 style="background-blend-mode:normal!important;background-clip:content-box!important;background-position:50% 50%!important;background-color:rgba(0,0,0,0)!important;background-image:var(--sf-img-13)!important;background-size:100% 100%!important;background-origin:content-box!important;background-repeat:no-repeat!important"></a><b>The factual accuracy of this article or section is disputed.</b><a href=https://wiki.archlinux.org/title/File:Tango-inaccurate.png class=image><img alt=Tango-inaccurate.png src='data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="48" height="48"><rect fill-opacity="0"/></svg>' decoding=async width=48 height=48 style="background-blend-mode:normal!important;background-clip:content-box!important;background-position:50% 50%!important;background-color:rgba(0,0,0,0)!important;background-image:var(--sf-img-13)!important;background-size:100% 100%!important;background-origin:content-box!important;background-repeat:no-repeat!important"></a></p>
<div><b>Reason:</b> Need futher testing if this variant as effective as static one (Discuss in <a rel=nofollow class="external text" href=https://wiki.archlinux.org/title/Talk:PCI_passthrough_via_OVMF>Talk:PCI passthrough via OVMF</a>)</div>
</div>
<p>Hugepages could be allocated manually via <code>vm.nr_overcommit_hugepages</code> <a href=https://wiki.archlinux.org/title/Sysctl title=Sysctl>sysctl</a> parameter.
</p>
<pre style=margin-bottom:0;border-bottom:none;padding-bottom:0.8em>/etc/sysctl.d/10-kvm.conf</pre>
<pre style=margin-top:0;border-top-style:dashed;padding-top:0.8em>vm.nr_hugepages = 0
vm.nr_overcommit_hugepages = <i>num</i></pre>
<p>Where <code><i>num</i></code> - is the number of huge pages, which default size if 2 MiB.
Pages will be automatically allocated, and freed after the virtual machine stops.
<p>More manual way:
</p>
<pre># echo <i>num</i> > /sys/kernel/mm/hugepages/hugepages-2048kB/nr_hugepages
# echo <i>num</i> > /sys/kernel/mm/hugepages/hugepages-1048576kB/nr_hugepages
</pre>
<p>For 2 MiB and 1 GiB page size respectively.
And they should be manually freed in the same way.
<p>It is hardly recommended to drop caches, compact memory and wait a couple of seconds before starting the virtual machine, as there could be not enough free contiguous memory for required huge pages blocks. Especially after some uptime of the host system.
</p>
<pre># echo 3 > /proc/sys/vm/drop_caches
# echo 1 > /proc/sys/vm/compact_memory
</pre>
<p>Theoretically, 1 GiB pages works as 2 MiB. But practically - no guaranteed way was found to get contiguous 1 GiB memory blocks. Each consequent request of 1 GiB blocks lead to lesser and lesser dynamically allocated count.
</p>
<h3><span class=mw-headline id=CPU_frequency_governor>CPU frequency governor</span></h3>
<p>Depending on the way your <a href=https://wiki.archlinux.org/title/CPU_frequency_scaling title="CPU frequency scaling">CPU governor</a> is configured, the virtual machine threads may not hit the CPU load thresholds for the frequency to ramp up. Indeed, KVM cannot actually change the CPU frequency on its own, which can be a problem if it does not scale up with vCPU usage as it would result in underwhelming performance. An easy way to see if it behaves correctly is to check if the frequency reported by <code>watch lscpu</code> goes up when running a CPU-intensive task on the guest. If you are indeed experiencing stutter and the frequency does not go up to reach its reported maximum, it may be due to <a rel=nofollow class="external text" href="https://lime-technology.com/forum/index.php?topic=46664.msg447678#msg447678">cpu scaling being controlled by the host OS</a>. In this case, try setting all cores to maximum frequency to see if this improves performance. Note that if you are using a modern intel chip with the default pstate driver, cpupower commands will be <a href=https://wiki.archlinux.org/title/CPU_frequency_scaling#CPU_frequency_driver title="CPU frequency scaling">ineffective</a>, so monitor <code>/proc/cpuinfo</code> to make sure your cpu is actually at max frequency.
</p>
<div class="archwiki-template-box archwiki-template-box-warning"><strong>Warning:</strong> Depending on your processor, it might actually be detrimental to performance to force the whole CPU to run at full frequency at all times. For instance, modern AMD processors (Zen 2 and Zen 3) depend heavily on being able to scale individual cores in separate core complexes for optimal thermal distribution. If the whole CPU is running at full frequency at all times, there is less headroom for invididual cores to clock high, resulting in worse performance for processes that are not heavily multithreaded such as games. This should be benchmarked in your virtual machine.</div>
<h3><span class=mw-headline id=Isolating_pinned_CPUs>Isolating pinned CPUs</span></h3>
<p>CPU pinning by itself will not prevent other host processes from running on the pinned CPUs. Properly isolating the pinned CPUs can reduce latency in the guest virtual machine.
</p>
<h4><span class=mw-headline id=With_isolcpus_kernel_parameter>With isolcpus kernel parameter</span></h4>
<p>In this example, let us assume you are using CPUs 4-7.
Use the <a href=https://wiki.archlinux.org/title/Kernel_parameters title="Kernel parameters">kernel parameters</a> <code>isolcpus nohz_full</code> to completely isolate the CPUs from the kernel. For example:
</p>
<pre>isolcpus=4-7 nohz_full=4-7
</pre>
<p>Then, run <code>qemu-system-x86_64</code> with taskset and chrt:
</p>
<pre># chrt -r 1 taskset -c 4-7 qemu-system-x86_64 ...
</pre>
<p>The <code>chrt</code> command will ensure that the task scheduler will round-robin distribute work (otherwise it will all stay on the first cpu). For <code>taskset</code>, the CPU numbers can be comma- and/or dash-separated, like "0,1,2,3" or "0-4" or "1,7-8,10" etc.
<p>See <a rel=nofollow class="external text" href=https://web.archive.org/web/20210520061110/https://www.removeddit.com/r/VFIO/comments/6vgtpx/high_dpc_latency_and_audio_stuttering_on_windows/dm0sfto/>this Internet Archive copy of a Removeddit mirror of a Reddit thread</a> for more info. (<a rel=nofollow class="external text" href=https://www.reddit.com/r/VFIO/comments/6vgtpx/high_dpc_latency_and_audio_stuttering_on_windows/dm0sfto/>The original thread</a> is worthless because of deleted comments, and Removeddit not longer works.)
</p>
<h4><span class=mw-headline id=Dynamically_isolating_CPUs>Dynamically isolating CPUs</span></h4>
<p>The isolcpus kernel parameter will permanently reserve CPU cores, even when the guest is not running. A more flexible alternative is to dynamically isolate CPUs when starting the guest. This can be achieved with the following alternatives:
</p>
<ul><li><span class="plainlinks archwiki-template-pkg"><a rel=nofollow class="external text" href=https://aur.archlinux.org/packages/cpuset-git/>cpuset-git</a></span><sup><small>AUR</small></sup> (<a rel=nofollow class="external text" href=https://www.redhat.com/archives/vfio-users/2016-September/msg00072.html>vfio-users post</a>, <a rel=nofollow class="external text" href=https://rokups.github.io/#!pages/gaming-vm-performance.md>blog post</a>, <a rel=nofollow class="external text" href=https://github.com/PassthroughPOST/VFIO-Tools/blob/master/libvirt_hooks/hooks/cset.sh>example script</a>)</li>
<li><span class="plainlinks archwiki-template-pkg"><a rel=nofollow class="external text" href=https://aur.archlinux.org/packages/vfio-isolate/>vfio-isolate</a></span><sup><small>AUR</small></sup></li>
<li>systemd</ul>
<h5><span class=mw-headline id=Example_with_systemd>Example with systemd</span></h5>
<p>In this example, we assume a host with 12 CPUs, where CPUs 2-5 and 8-11 are <a href=#CPU_pinning>pinned</a> to the guest. Then run the following to isolate the host to CPUs 0, 1, 6, and 7:
</p>
<pre># systemctl set-property --runtime -- user.slice AllowedCPUs=0,1,6,7
# systemctl set-property --runtime -- system.slice AllowedCPUs=0,1,6,7
# systemctl set-property --runtime -- init.scope AllowedCPUs=0,1,6,7
</pre>
<p>After shutting down the guest, run the following to reallocate all 12 CPUs back to the host:
</p>
<pre># systemctl set-property --runtime -- user.slice AllowedCPUs=0-11
# systemctl set-property --runtime -- system.slice AllowedCPUs=0-11
# systemctl set-property --runtime -- init.scope AllowedCPUs=0-11
</pre>
<p>You can use a <a rel=nofollow class="external text" href=https://libvirt.org/hooks.html>libvirt hook</a> to automatically run the above at startup/shutdown of the guest like so:
<p>Create or edit <code>/etc/libvirt/hooks/qemu</code> with the following content.
</p>
<pre style=margin-bottom:0;border-bottom:none;padding-bottom:0.8em>/etc/libvirt/hooks/qemu</pre>
<pre style=margin-top:0;border-top-style:dashed;padding-top:0.8em>#!/bin/sh
command=$2
if [ "$command" = "started" ]; then
systemctl set-property --runtime -- system.slice AllowedCPUs=0,1,6,7
systemctl set-property --runtime -- user.slice AllowedCPUs=0,1,6,7
systemctl set-property --runtime -- init.scope AllowedCPUs=0,1,6,7
elif [ "$command" = "release" ]; then
systemctl set-property --runtime -- system.slice AllowedCPUs=0-11
systemctl set-property --runtime -- user.slice AllowedCPUs=0-11
systemctl set-property --runtime -- init.scope AllowedCPUs=0-11
fi</pre>
<p>Afterwards make it <a href=https://wiki.archlinux.org/title/Executable class=mw-redirect title=Executable>executable</a>.
<p><a href=https://wiki.archlinux.org/title/Restart class=mw-redirect title=Restart>Restart</a> <code>libvirtd.service</code> and then start your virtual machine. If you create some heavily multithreaded load on your host now, you should see that it keeps your chosen CPUs free from load while the virtual machine can still make use of it. You should also see those CPUs automatically getting fully used by your host once you terminate the virtual machine.
<p>More examples are contained in the following reddit threads: <a rel=nofollow class="external autonumber" href=https://www.reddit.com/r/VFIO/comments/ebe3l5/deprecated_isolcpus_workaround/fem8jgk>[1]</a> <a rel=nofollow class="external autonumber" href=https://www.reddit.com/r/VFIO/comments/gyem88/noob_question_how_to_isolate_cpu_cores/ftaqno1/>[2]</a> <a rel=nofollow class="external autonumber" href=https://www.reddit.com/r/VFIO/comments/ij25rg/splitting_ht_cores_between_host_and_vm/>[3]</a>
<p>Note that this requires systemd 244 or higher, and <a href=https://wiki.archlinux.org/title/Cgroups title=Cgroups>cgroups v2</a>, which is now enabled by default.
</p>
<h3><span class=mw-headline id=Improving_performance_on_AMD_CPUs>Improving performance on AMD CPUs</span></h3>
<p>Starting with QEMU 3.1 the TOPOEXT cpuid flag is disabled by default. In order to use hyperthreading (SMT) on AMD CPUs you need to manually enable it:
</p>
<pre> <cpu mode='host-passthrough' check='none'>
<topology sockets='1' cores='4' threads='2'/>
<feature policy='require' name='topoext'/>
</cpu>
</pre>
<p>commit: <a rel=nofollow class="external free" href="https://git.qemu.org/?p=qemu.git;a=commit;h=7210a02c58572b2686a3a8d610c6628f87864aed">https://git.qemu.org/?p=qemu.git;a=commit;h=7210a02c58572b2686a3a8d610c6628f87864aed</a>
</p>
<h3><span class=mw-headline id=Virtio_disk>Virtio disk</span></h3>
<div class="noprint archwiki-template-message">
<p><a href=https://wiki.archlinux.org/title/File:Merge-arrows-2.png class=image><img alt=Merge-arrows-2.png src='data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="48" height="48"><rect fill-opacity="0"/></svg>' decoding=async width=48 height=48 style="background-blend-mode:normal!important;background-clip:content-box!important;background-position:50% 50%!important;background-color:rgba(0,0,0,0)!important;background-image:var(--sf-img-14)!important;background-size:100% 100%!important;background-origin:content-box!important;background-repeat:no-repeat!important"></a><b>This article or section is a candidate for merging with <a href=https://wiki.archlinux.org/title/QEMU#Installing_virtio_drivers title=QEMU>QEMU#Installing virtio drivers</a>.</b><a href=https://wiki.archlinux.org/title/File:Merge-arrows-2.png class=image><img alt=Merge-arrows-2.png src='data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="48" height="48"><rect fill-opacity="0"/></svg>' decoding=async width=48 height=48 style="background-blend-mode:normal!important;background-clip:content-box!important;background-position:50% 50%!important;background-color:rgba(0,0,0,0)!important;background-image:var(--sf-img-14)!important;background-size:100% 100%!important;background-origin:content-box!important;background-repeat:no-repeat!important"></a></p>
<div><b>Notes:</b> Off-topic. (Discuss in <a href=https://wiki.archlinux.org/title/Talk:PCI_passthrough_via_OVMF#Moving_virtio_disk_section_to_QEMU title="Talk:PCI passthrough via OVMF">Talk:PCI passthrough via OVMF#Moving virtio disk section to QEMU</a>)</div>
</div>
<p>The default disk types are SATA or IDE emulation out of the box. These controllers offer maximum compatibility but are not suited for efficient virtualization. Two accelerated models exist: <code>virtio-scsi</code> for SCSI emulation and passthrough, or <code>virtio-blk</code> for a more basic block device emulation.
</p>
<h4><span class=mw-headline id=Drivers>Drivers</span></h4>
<ul><li>Linux guests should support these out of the box on any modern kernel</li>
<li>macOS has <code>virtio-blk</code> support starting in Mojave via <code>AppleVirtIO.kext</code></li>
<li>Windows needs the <a rel=nofollow class="external text" href=https://docs.fedoraproject.org/en-US/quick-docs/creating-windows-virtual-machines-using-virtio-drivers/>Windows virtio drivers</a>. <code>virtio-scsi</code> uses the <code>vioscsi</code> driver. <code>virtio-blk</code> uses the <code>viostor</code> driver</li>
<li>Windows can be installed directly onto these disks by selecting 'load driver' on the installer disk selection menu. The windows iso and virtio driver iso should both be attached as regular SATA/IDE cdroms during the installation process</li>
<li>To switch boot disks to virtio on an existing Windows installation:
<ul><li><code>virtio-blk</code>: Add a temporary disk with bus <code>virtio</code>, boot windows & load the driver for the disk, then shutdown and switch the boot disk disk bus to <code>virtio</code></li>
<li><code>virtio-scsi</code>: Add a scsi controller with model <code>virtio</code>, boot windows & load the driver for the controller, then shutdown and switch the boot disk bus to <code>scsi</code> (not virtio)</ul></ul>
<h4><span class=mw-headline id=Considerations>Considerations</span></h4>
<ul><li><code>virtio-scsi</code> TRIM support is mature, all versions should support it. Traditionally, <code>virtio-scsi</code> has been the preferred approach for this reason</li>
<li><code>virtio-blk</code> TRIM support is new, this requires requires qemu 4.0+, guest linux kernel 5.0+, guest windows drivers 0.1.173+</li>
<li>Thin provisioning works by enabling TRIM on a sparse image file: <code>discard='unmap'</code>. Unused blocks will be freed and the disk usage will drop (works on both raw and qcow2). Actual on-disk size of a sparse image file may be checked with <code>du /path/to/disk.img</code></li>
<li>Thin provisioning can also work with block storage such as zfs zvols or thin lvm</li>
<li>Virt queue count will influence the number of threads inside the guest kernel used for IO processing, suggest using <code>queues='4'</code> or more</li>
<li>Native mode (<code>io='native'</code>) uses a single threaded model based on linux AIO, is a bit more CPU efficient but may have lower peak performance and does not allow host side caching to be used</li>
<li>Threaded mode (<code>io='threads'</code>) will spawn dozens of threads on demand as the disk is used. This is less efficient but may perform better if there are enough host cores available to run them, and allows for host side caching to be used</li>
<li>Modern versions of libvirt will group the dynamic worker threads created when using threaded mode in with the iothread=1 cgroup for pinning purposes. Very old versions of libvirt left these in the emulator cgroup</ul>
<h4><span class=mw-headline id=IO_threads>IO threads</span></h4>
<p>An IO thread is a dedicated thread for processing disk events, rather than using the main qemu emulator loop. This should not be confused with the worker threads spawned on demand with <code>io='threads'</code>.
</p>
<ul><li>You can only use one iothread per disk controller. The thread must be assigned to a specific controller with <code>iothread='X'</code> in the <code><driver></code> tag. Furthermore, extra & unassigned iothreads will not be used and do nothing</li>
<li>In the case of <code>virtio-scsi</code>, there is one controller for multiple scsi disks. The iothread is assigned on the controller: <code><controller><driver iothread='X'></code></li>
<li>In the case of <code>virtio-blk</code>, each disk has its own controller. The iothread is assigned in the driver tag under the disk itself: <code><disk><driver iothread='X'></code></li>
<li>Since emulated disks incur a significant amount of CPU overhead, that can lead to vcpu stuttering under high disk load (especially high random IOPS). In this case it helps to pin the IO to different core(s) than your vcpus with <code><iothreadpin></code></ul>
<h4><span class=mw-headline id=Examples_with_libvirt>Examples with libvirt</span></h4>
<p>virtio-scsi + iothread + worker threads + host side writeback caching + full disk block device backend:
</p>
<pre><domain>
<devices>
<disk type='block' device='disk'>
<driver name='qemu' type='raw' cache='writeback' io='threads' discard='unmap'/>
<source dev='/dev/disk/by-id/ata-Samsung_SSD_840_EVO_1TB_S1D9NSAF206396F'/>
<target dev='sda' bus='scsi'/>
</disk>
<controller type='scsi' index='0' model='virtio-scsi'>
<driver iothread='1' queues='8'/>
</controller>
</pre>
<p>virtio-blk + iothread + native aio + no host caching + raw sparse image backend:
</p>
<pre><domain>
<devices>
<disk type='file' device='disk'>
<driver name='qemu' type='raw' cache='none' io='native' discard='unmap' iothread='1' queues='8'/>
<source file='/var/lib/libvirt/images/pool/win10.img'/>
<target dev='vda' bus='virtio'/>
</disk>
</pre>
<p>Creating the iothreads:
</p>
<pre><domain>
<iothreads>1</iothreads>
</pre>
<p>Pinning iothreads:
</p>
<pre><domain>
<cputune>
<iothreadpin iothread='1' cpuset='0-1,6-7'/>
</pre>
<h4><span class=mw-headline id=Example_with_virt-manager>Example with virt-manager</span></h4>
<p>This will create a <code>virtio-blk</code> device:
</p>
<ol><li>Open the virtual machine preferences</li>
<li>Go to <code>Add Hardware > Storage</code></li>
<li>Create or choose a storage file</li>
<li>Select <code>Device Type: Disk device</code> and <code>Bus type: VirtIO</code></li>
<li>Click Finish</ol>
<h3><span class=mw-headline id=Virtio_network>Virtio network</span></h3>
<p>The default NIC models rtl8139 or e1000 can be a bottleneck for gigabit+ speeds and have a significant amount of CPU overhead compared to <code>virtio-net</code>.
</p>
<ul><li>Select <code>virtio</code> as the model for the NIC with libvirt or use the <code>virtio-net-pci</code> device in bare qemu</li>
<li>Windows needs the <code>NetKVM</code> driver from <a rel=nofollow class="external text" href=https://docs.fedoraproject.org/en-US/quick-docs/creating-windows-virtual-machines-using-virtio-drivers/>Windows virtio drivers</a></li>
<li>Virtio uses vhost-net by default for in-kernel packet processing without exiting to userspace</li>
<li>Multiqueue can enabled for a further speedup with multiple connections but typically will not boost single stream speeds. For libvirt add <code><driver queues='8'/></code> under the interface tag</li>
<li>Zero copy transmit may also be enabled on macvtap by setting the module parameter <code>vhost_net.experimental_zcopytx=1</code> but this may actually have worse performance, see <a rel=nofollow class="external text" href=https://github.com/torvalds/linux/commit/098eadce3c622c07b328d0a43dda379b38cf7c5e>commit</a></ul>
<p>Libvirt example with a bridge:
</p>
<pre><interface type='bridge'>
<mac address="52:54:00:6d:6e:2e"/>
<source bridge='br0'/>
<model type='virtio'/>
<driver queues='8'/>
</interface>
</pre>
<p>MACVTAP example with a bridge:
</p>
<pre><interface type="direct">
<source dev="<b>eno1</b>" mode="vepa"/>
<target dev="macvtap0"/>
<model type="virtio"/>
<alias name="net0"/>
</interface>
</pre>
<p>Possible options for mode are 'vepa', 'bridge', 'private', and 'passthrough'. A guide with decriptions of the differences is available from redhat<a rel=nofollow class="external autonumber" href=https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/7/html/virtualization_deployment_and_administration_guide/sect-virtual_networking-directly_attaching_to_physical_interface>[4]</a>.
<p>Replace the source <code>/dev</code> device with your own device address. You can get your local address with the following command:
</p>
<pre style=margin-bottom:0;border-bottom:none;padding-bottom:0.8em>$ ip link</pre>
<pre style=margin-top:0;border-top-style:dashed;padding-top:0.8em>1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN mode DEFAULT group default qlen 1000
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
2: <b>eno1</b>: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP mode DEFAULT group default qlen 1000
link/ether 30:9c:23:ac:51:d0 brd ff:ff:ff:ff:ff:ff
altname enp0s31f6