blob: 3451cfaa5be412b3d0ffd840a44dd52390178a76 [file] [log] [blame]
Paolo Bonzini78e87792016-10-06 16:12:11 +02001@node Implementation notes
2@appendix Implementation notes
bellarddebc7062006-04-30 21:58:41 +00003
4@menu
Paolo Bonzini77d47e12016-10-06 16:49:03 +02005* CPU emulation::
6* Translator Internals::
Paolo Bonzini77d47e12016-10-06 16:49:03 +02007* QEMU compared to other emulators::
Igor Mammedov047f7032018-05-11 19:24:43 +02008* Managed start up options::
Paolo Bonzini77d47e12016-10-06 16:49:03 +02009* Bibliography::
bellarddebc7062006-04-30 21:58:41 +000010@end menu
bellarddebc7062006-04-30 21:58:41 +000011
Paolo Bonzini77d47e12016-10-06 16:49:03 +020012@node CPU emulation
Paolo Bonzini78e87792016-10-06 16:12:11 +020013@section CPU emulation
bellard1f673132004-04-04 15:21:17 +000014
bellarddebc7062006-04-30 21:58:41 +000015@menu
Paolo Bonzini77d47e12016-10-06 16:49:03 +020016* x86:: x86 and x86-64 emulation
17* ARM:: ARM emulation
18* MIPS:: MIPS emulation
19* PPC:: PowerPC emulation
20* SPARC:: Sparc32 and Sparc64 emulation
21* Xtensa:: Xtensa emulation
bellarddebc7062006-04-30 21:58:41 +000022@end menu
23
Paolo Bonzini77d47e12016-10-06 16:49:03 +020024@node x86
Paolo Bonzini78e87792016-10-06 16:12:11 +020025@subsection x86 and x86-64 emulation
bellard1f673132004-04-04 15:21:17 +000026
27QEMU x86 target features:
28
ths5fafdf22007-09-16 21:08:06 +000029@itemize
bellard1f673132004-04-04 15:21:17 +000030
ths5fafdf22007-09-16 21:08:06 +000031@item The virtual x86 CPU supports 16 bit and 32 bit addressing with segmentation.
blueswir1998a0502008-10-09 18:52:04 +000032LDT/GDT and IDT are emulated. VM86 mode is also supported to run
33DOSEMU. There is some support for MMX/3DNow!, SSE, SSE2, SSE3, SSSE3,
34and SSE4 as well as x86-64 SVM.
bellard1f673132004-04-04 15:21:17 +000035
36@item Support of host page sizes bigger than 4KB in user mode emulation.
37
38@item QEMU can emulate itself on x86.
39
ths5fafdf22007-09-16 21:08:06 +000040@item An extensive Linux x86 CPU test program is included @file{tests/test-i386}.
bellard1f673132004-04-04 15:21:17 +000041It can be used to test other x86 virtual CPUs.
42
43@end itemize
44
45Current QEMU limitations:
46
ths5fafdf22007-09-16 21:08:06 +000047@itemize
bellard1f673132004-04-04 15:21:17 +000048
blueswir1998a0502008-10-09 18:52:04 +000049@item Limited x86-64 support.
bellard1f673132004-04-04 15:21:17 +000050
51@item IPC syscalls are missing.
52
ths5fafdf22007-09-16 21:08:06 +000053@item The x86 segment limits and access rights are not tested at every
bellard1f673132004-04-04 15:21:17 +000054memory access (yet). Hopefully, very few OSes seem to rely on that for
55normal use.
56
bellard1f673132004-04-04 15:21:17 +000057@end itemize
58
Paolo Bonzini77d47e12016-10-06 16:49:03 +020059@node ARM
Paolo Bonzini78e87792016-10-06 16:12:11 +020060@subsection ARM emulation
bellard1f673132004-04-04 15:21:17 +000061
62@itemize
63
64@item Full ARM 7 user emulation.
65
66@item NWFPE FPU support included in user Linux emulation.
67
68@item Can run most ARM Linux binaries.
69
70@end itemize
71
Paolo Bonzini77d47e12016-10-06 16:49:03 +020072@node MIPS
Paolo Bonzini78e87792016-10-06 16:12:11 +020073@subsection MIPS emulation
ths24d4de42007-07-11 10:24:28 +000074
75@itemize
76
77@item The system emulation allows full MIPS32/MIPS64 Release 2 emulation,
78including privileged instructions, FPU and MMU, in both little and big
79endian modes.
80
81@item The Linux userland emulation can run many 32 bit MIPS Linux binaries.
82
83@end itemize
84
85Current QEMU limitations:
86
87@itemize
88
89@item Self-modifying code is not always handled correctly.
90
91@item 64 bit userland emulation is not implemented.
92
93@item The system emulation is not complete enough to run real firmware.
94
thsb1f45232007-07-12 09:03:30 +000095@item The watchpoint debug facility is not implemented.
96
ths24d4de42007-07-11 10:24:28 +000097@end itemize
98
Paolo Bonzini77d47e12016-10-06 16:49:03 +020099@node PPC
Paolo Bonzini78e87792016-10-06 16:12:11 +0200100@subsection PowerPC emulation
bellard1f673132004-04-04 15:21:17 +0000101
102@itemize
103
ths5fafdf22007-09-16 21:08:06 +0000104@item Full PowerPC 32 bit emulation, including privileged instructions,
bellard1f673132004-04-04 15:21:17 +0000105FPU and MMU.
106
107@item Can run most PowerPC Linux binaries.
108
109@end itemize
110
Paolo Bonzini77d47e12016-10-06 16:49:03 +0200111@node SPARC
Paolo Bonzini78e87792016-10-06 16:12:11 +0200112@subsection Sparc32 and Sparc64 emulation
bellard1f673132004-04-04 15:21:17 +0000113
114@itemize
115
blueswir1f6b647c2007-04-05 18:40:23 +0000116@item Full SPARC V8 emulation, including privileged
bellard34751872005-07-02 14:31:34 +0000117instructions, FPU and MMU. SPARC V9 emulation includes most privileged
blueswir1a785e422007-10-20 08:09:05 +0000118and VIS instructions, FPU and I/D MMU. Alignment is fully enforced.
bellard1f673132004-04-04 15:21:17 +0000119
blueswir1a785e422007-10-20 08:09:05 +0000120@item Can run most 32-bit SPARC Linux binaries, SPARC32PLUS Linux binaries and
121some 64-bit SPARC Linux binaries.
bellard34751872005-07-02 14:31:34 +0000122
123@end itemize
124
125Current QEMU limitations:
126
ths5fafdf22007-09-16 21:08:06 +0000127@itemize
bellard34751872005-07-02 14:31:34 +0000128
bellard34751872005-07-02 14:31:34 +0000129@item IPC syscalls are missing.
130
blueswir11f587322007-11-25 18:40:20 +0000131@item Floating point exception support is buggy.
bellard34751872005-07-02 14:31:34 +0000132
133@item Atomic instructions are not correctly implemented.
134
blueswir1998a0502008-10-09 18:52:04 +0000135@item There are still some problems with Sparc64 emulators.
bellard1f673132004-04-04 15:21:17 +0000136
137@end itemize
138
Paolo Bonzini77d47e12016-10-06 16:49:03 +0200139@node Xtensa
Paolo Bonzini78e87792016-10-06 16:12:11 +0200140@subsection Xtensa emulation
Max Filippov3aeaea62011-10-10 14:48:23 +0400141
142@itemize
143
144@item Core Xtensa ISA emulation, including most options: code density,
145loop, extended L32R, 16- and 32-bit multiplication, 32-bit division,
Max Filippov044d0032012-11-29 19:53:20 +0400146MAC16, miscellaneous operations, boolean, FP coprocessor, coprocessor
147context, debug, multiprocessor synchronization,
Max Filippov3aeaea62011-10-10 14:48:23 +0400148conditional store, exceptions, relocatable vectors, unaligned exception,
149interrupts (including high priority and timer), hardware alignment,
150region protection, region translation, MMU, windowed registers, thread
151pointer, processor ID.
152
Max Filippov044d0032012-11-29 19:53:20 +0400153@item Not implemented options: data/instruction cache (including cache
154prefetch and locking), XLMI, processor interface. Also options not
155covered by the core ISA (e.g. FLIX, wide branches) are not implemented.
Max Filippov3aeaea62011-10-10 14:48:23 +0400156
157@item Can run most Xtensa Linux binaries.
158
159@item New core configuration that requires no additional instructions
160may be created from overlay with minimal amount of hand-written code.
161
162@end itemize
163
Igor Mammedov047f7032018-05-11 19:24:43 +0200164@node Managed start up options
165@section Managed start up options
166
167In system mode emulation, it's possible to create a VM in a paused state using
168the -S command line option. In this state the machine is completely initialized
169according to command line options and ready to execute VM code but VCPU threads
170are not executing any code. The VM state in this paused state depends on the way
171QEMU was started. It could be in:
172@table @asis
173@item initial state (after reset/power on state)
174@item with direct kernel loading, the initial state could be amended to execute
175code loaded by QEMU in the VM's RAM and with incoming migration
176@item with incoming migration, initial state will by amended with the migrated
177machine state after migration completes.
178@end table
179
180This paused state is typically used by users to query machine state and/or
181additionally configure the machine (by hotplugging devices) in runtime before
182allowing VM code to run.
183
184However, at the -S pause point, it's impossible to configure options that affect
Markus Armbruster361ac942018-07-05 11:14:02 +0200185initial VM creation (like: -smp/-m/-numa ...) or cold plug devices. The
186experimental --preconfig command line option allows pausing QEMU
187before the initial VM creation, in a ``preconfig'' state, where additional
Igor Mammedov047f7032018-05-11 19:24:43 +0200188queries and configuration can be performed via QMP before moving on to
189the resulting configuration startup. In the preconfig state, QEMU only allows
190a limited set of commands over the QMP monitor, where the commands do not
191depend on an initialized machine, including but not limited to:
192@table @asis
193@item qmp_capabilities
194@item query-qmp-schema
195@item query-commands
196@item query-status
Markus Armbruster361ac942018-07-05 11:14:02 +0200197@item x-exit-preconfig
Igor Mammedov047f7032018-05-11 19:24:43 +0200198@end table