summaryrefslogtreecommitdiff
path: root/target-i386
AgeCommit message (Collapse)AuthorFilesLines
2012-12-28Merge branch 'qom-cpu' of git://repo.or.cz/qemu/afaerberBlue Swirl2-103/+144
* 'qom-cpu' of git://repo.or.cz/qemu/afaerber: MAINTAINERS: Include X86CPU in CPU maintenance area cpu: Move kvm_run into CPUState cpu: Move kvm_state field into CPUState ppc_booke: Pass PowerPCCPU to ppc_booke_timers_init() ppc4xx_devs: Return PowerPCCPU from ppc4xx_init() ppc_booke: Pass PowerPCCPU to {decr,fit,wdt} timer callbacks ppc: Pass PowerPCCPU to [h]decr timer callbacks ppc: Pass PowerPCCPU to [h]decr callbacks ppc: Pass PowerPCCPU to ppc_set_irq() kvm: Pass CPUState to kvm_vcpu_ioctl() kvm: Pass CPUState to kvm_arch_* cpu: Move kvm_fd into CPUState qdev-properties.c: Separate core from the code used only by qemu-system-* qdev: Coding style fixes cpu: Introduce CPUListState struct target-alpha: Add support for -cpu ? target-alpha: Turn CPU definitions into subclasses target-alpha: Avoid leaking the alarm timer over reset alpha: Pass AlphaCPU array to Typhoon target-alpha: Let cpu_alpha_init() return AlphaCPU
2012-12-23target-i386: CPUID: return highest basic leaf if eax > cpuid_xlevelEduardo Habkost1-1/+5
This fixes a subtle bug. A bug that probably won't cause trouble for any existing OS, but a bug anyway: Intel SDM Volume 2, CPUID Instruction states: > Two types of information are returned: basic and extended function > information. If a value entered for CPUID.EAX is higher than the maximum > input value for basic or extended function for that processor then the > data for the highest basic information leaf is returned. For example, > using the Intel Core i7 processor, the following is true: > > CPUID.EAX = 05H (* Returns MONITOR/MWAIT leaf. *) > CPUID.EAX = 0AH (* Returns Architectural Performance Monitoring leaf. *) > CPUID.EAX = 0BH (* Returns Extended Topology Enumeration leaf. *) > CPUID.EAX = 0CH (* INVALID: Returns the same information as CPUID.EAX = 0BH. *) > CPUID.EAX = 80000008H (* Returns linear/physical address size data. *) > CPUID.EAX = 8000000AH (* INVALID: Returns same information as CPUID.EAX = 0BH. *) AMD's CPUID Specification, on the other hand, is less specific: > The CPUID instruction supports two sets or ranges of functions, > standard and extended. > > • The smallest function number of the standard function range is > Fn0000_0000. The largest function num- ber of the standard function > range, for a particular implementation, is returned in CPUID > Fn0000_0000_EAX. > > • The smallest function number of the extended function range is > Fn8000_0000. The largest function num- ber of the extended function > range, for a particular implementation, is returned in CPUID > Fn8000_0000_EAX. > > Functions that are neither standard nor extended are undefined and > should not be relied upon. QEMU's behavior matched Intel's specification before, but this was changed by commit b3baa152aaef1905876670590275c2dd0bbb088c. This patch restores the behavior documented by Intel when cpuid_xlevel2 is 0. The existing behavior when cpuid_xlevel2 is set (falling back to level=cpuid_xlevel) is being kept, as I couldn't find any public documentation on the CPUID 0xC0000000 function range on Centaur CPUs. Signed-off-by: Eduardo Habkost <ehabkost@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2012-12-23Merge branch 'master' of git://git.qemu.org/qemu into qom-cpuAndreas Färber19-48/+50
Adapt header include paths. Signed-off-by: Andreas Färber <afaerber@suse.de>
2012-12-20exec: change RAM list to a TAILQPaolo Bonzini1-1/+1
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Juan Quintela <quintela@redhat.com>
2012-12-19cpu: Move kvm_run into CPUStateAndreas Färber1-4/+5
Pass CPUState / {X86,S390}CPU to helper functions. Signed-off-by: Andreas Färber <afaerber@suse.de>
2012-12-19cpu: Move kvm_state field into CPUStateAndreas Färber2-13/+16
Adapt some functions to take CPUState / {PowerPC,S390}CPU argument. Signed-off-by: Andreas Färber <afaerber@suse.de>
2012-12-19kvm: Pass CPUState to kvm_vcpu_ioctl()Andreas Färber1-70/+88
Adapt helper functions to pass X86CPU / PowerPCCPU / S390CPU. Signed-off-by: Andreas Färber <afaerber@suse.de>
2012-12-19kvm: Pass CPUState to kvm_arch_*Andreas Färber1-20/+39
Move kvm_vcpu_dirty field into CPUState to simplify things and change its type to bool while at it. Signed-off-by: Andreas Färber <afaerber@suse.de>
2012-12-19fpu: move public header file to include/fpuPaolo Bonzini1-1/+1
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2012-12-19softmmu: move include files to include/sysemu/Paolo Bonzini8-12/+12
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2012-12-19misc: move include files to include/qemu/Paolo Bonzini5-7/+7
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2012-12-19qom: move include files to include/qom/Paolo Bonzini1-1/+1
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2012-12-19monitor: move include files to include/monitor/Paolo Bonzini1-1/+1
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2012-12-19exec: move include files to include/exec/Paolo Bonzini12-22/+22
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2012-12-19qapi: move include files to include/qobject/Paolo Bonzini2-3/+3
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2012-12-19qapi: remove qapi/qapi-types-core.hPaolo Bonzini1-0/+1
The file is only including error.h and qerror.h. Prefer explicit inclusion of whatever files are needed. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2012-12-19janitor: do not rely on indirect inclusions of or from qemu-char.hPaolo Bonzini1-0/+1
Various header files rely on qemu-char.h including qemu-config.h or main-loop.h, but they really do not need qemu-char.h at all (particularly interesting is the case of the block layer!). Clean this up, and also add missing inclusions of qemu-char.h itself. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2012-12-19build: kill libdis, move disassemblers to disas/Paolo Bonzini1-1/+1
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2012-12-17Merge commit '1dd3a74d2ee2d873cde0b390b536e45420b3fe05' into HEADPaolo Bonzini1-1/+1
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2012-12-17pci: update all users to look in pci/Michael S. Tsirkin1-1/+1
update all users so we can remove the makefile hack. Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2012-12-16exec: refactor cpu_restore_stateBlue Swirl2-11/+2
Refactor common code around calls to cpu_restore_state(). tb_find_pc() has now no external users, make it static. Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2012-12-10Merge remote-tracking branch 'afaerber/qom-cpu' into stagingAnthony Liguori2-39/+68
* afaerber/qom-cpu: target-i386: Postpone cpuid_level update to realize time target-i386: Use define for cpuid vendor string size target-i386: Separate feature string parsing from CPU model lookup target-i386/cpu.c: Coding style fixes qdev: qdev_create(): use error_report() instead of hw_error() sysemu.h: Include qemu-types.h instead of qemu-common.h Create qemu-types.h for struct typedefs qlist.h: Do not include qemu-common.h qga/channel-posix.c: Include headers it needs qapi/qmp-registry.c: Include headers it needs ui/vnc-palette.c: Include headers it needs user: Rename qemu-types.h to qemu-user-types.h user: Move *-user/qemu-types.h to main directory Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2012-12-08TCG: Use gen_opc_instr_start from context instead of global variable.Evgeny Voevodin1-4/+4
Signed-off-by: Evgeny Voevodin <e.voevodin@samsung.com> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2012-12-08TCG: Use gen_opc_icount from context instead of global variable.Evgeny Voevodin1-1/+1
Signed-off-by: Evgeny Voevodin <e.voevodin@samsung.com> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2012-12-08TCG: Use gen_opc_pc from context instead of global variable.Evgeny Voevodin1-4/+5
Signed-off-by: Evgeny Voevodin <e.voevodin@samsung.com> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2012-12-07target-i386: Postpone cpuid_level update to realize timeIgor Mammedov1-3/+5
Delay capping cpuid_level to 7 to realize time so property setters for cpuid_7_0_ebx_features and "level" could be used in any order/time between x86_cpu_initfn() and x86_cpu_realize(). Signed-off-by: Igor Mammedov <imammedo@redhat.com> Signed-off-by: Eduardo Habkost <ehabkost@redhat.com> Signed-off-by: Andreas Färber <afaerber@suse.de>
2012-12-06target-i386: Use define for cpuid vendor string sizeIgor Mammedov2-3/+5
Signed-off-by: Igor Mammedov <imammedo@redhat.com> Reviewed-by: Eduardo Habkost <ehabkost@redhat.com> Signed-off-by: Andreas Färber <afaerber@suse.de>
2012-12-06target-i386: Separate feature string parsing from CPU model lookupEduardo Habkost1-23/+46
Instead of parsing the whole cpu_model string inside cpu_x86_find_by_name(), first split it into the CPU model name and the full feature string, then parse the feature string into pieces. When using CPU model classes, those two pieces of information will be used at different moments (CPU model name will be used to find CPU class, feature string will be used after CPU object was created), so making the split in two steps will make it easier to refactor the code later. This should also help on the CPU properties work, that will just need to replace the cpu_x86_parse_featurestr() logic (and can keep the CPU model lookup code as-is). Signed-off-by: Eduardo Habkost <ehabkost@redhat.com> Reviewed-by: Igor Mammedov <imammedo@redhat.com> Signed-off-by: Andreas Färber <afaerber@suse.de>
2012-12-06target-i386/cpu.c: Coding style fixesEduardo Habkost1-14/+16
- Use spaces instead of tabs on cpu_x86_cpuid(). - Use braces on 'if' statement cpu_x86_find_by_name(). Signed-off-by: Eduardo Habkost <ehabkost@redhat.com> Reviewed-by: Igor Mammedov <imammedo@redhat.com> Signed-off-by: Andreas Färber <afaerber@suse.de>
2012-11-26target-i386: Enable SSSE3 TCG supportAurelien Jarno1-1/+1
SSSE3 support has been added to TCG more than 4 years ago in commit 4242b1bd8acc19aaaacffdaad4ac23213d72a72b. It has been disabled by mistake in commit 551a2dec8fa55006a68393b9d6fb63577d2b3f1c. Signed-off-by: Aurelien Jarno <aurelien@aurel32.net> Signed-off-by: Andreas Färber <afaerber@suse.de>
2012-11-26target-i386/cpu: Add missing flags to Haswell CPU modelEduardo Habkost1-2/+3
When adding the Haswell CPU model, I intended to make it a superset of the features present on the SandyBridge model, but I have removed the SEP and RDTSCP features from the feature list by mistake. This patch adds the missing SEP and RDTSCP features (that are present on SandyBridge) to Haswell. Reported-by: Martin Kletzander <mkletzan@redhat.com> Signed-off-by: Eduardo Habkost <ehabkost@redhat.com> Signed-off-by: Andreas Färber <afaerber@suse.de>
2012-11-19Merge remote-tracking branch 'afaerber/qom-cpu' into stagingAnthony Liguori2-6/+89
* afaerber/qom-cpu: target-i386: Add Haswell CPU model target-i386/cpu: Add new Opteron CPU model target-i386/cpu: Name new CPUID bits qapi-types.h: Don't include qemu-common.h osdep: Move qemu_{open,close}() prototypes qemu-config.h: Include headers it needs vnc-palette.h: Include <stdbool.h> qemu-fsdev-dummy.c: Include module.h qdev: Split up header so it can be used in cpu.h Move qemu_irq typedef out of qemu-common.h qemu-common.h: Comment about usage rules Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2012-11-17TCG: Use gen_opc_buf from context instead of global variable.Evgeny Voevodin1-3/+3
Signed-off-by: Evgeny Voevodin <e.voevodin@samsung.com> Reviewed-by: Richard Henderson <rth@twiddle.net> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2012-11-17TCG: Use gen_opc_ptr from context instead of global variable.Evgeny Voevodin1-4/+4
Signed-off-by: Evgeny Voevodin <e.voevodin@samsung.com> Reviewed-by: Richard Henderson <rth@twiddle.net> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2012-11-15target-i386: Add Haswell CPU modelEduardo Habkost1-0/+29
Features added to the model, in relation to SandyBridge: fma CPUID[1].ECX[12] pcid CPUID[1].ECX[17] movbe CPUID[1].ECX[22] fsgsbase CPUID[EAX=7,ECX=0].EBX[0] bmi1 CPUID[EAX=7,ECX=0].EBX[3] hle CPUID[EAX=7,ECX=0].EBX[4] avx2 CPUID[EAX=7,ECX=0].EBX[5] smep CPUID[EAX=7,ECX=0].EBX[7] bmi2 CPUID[EAX=7,ECX=0].EBX[8] erms CPUID[EAX=7,ECX=0].EBX[9] invpcid CPUID[EAX=7,ECX=0].EBX[10] rtm CPUID[EAX=7,ECX=0].EBX[11] Signed-off-by: Eduardo Habkost <ehabkost@redhat.com> Reviewed-by: Igor Mammedov <imammedo@redhat.com> Signed-off-by: Andreas Färber <afaerber@suse.de>
2012-11-15target-i386/cpu: Add new Opteron CPU modelAndre Przywara1-0/+32
Add a new base CPU model called Opteron_G5 to model the latest Opteron CPUs. This increases the model value and model numbers and adds TBM, F16C and FMA over the latest G4 model. Signed-off-by: Andre Przywara <osp@andrep.de> Signed-off-by: Boris Ostrovsky <boris.ostrovsky@amd.com> [ehabkost: edited commit message] Signed-off-by: Eduardo Habkost <ehabkost@redhat.com> Reviewed-by: Igor Mammedov <imammedo@redhat.com> Signed-off-by: Andreas Färber <afaerber@suse.de>
2012-11-15target-i386/cpu: Name new CPUID bitsAndre Przywara2-6/+28
Update QEMU's knowledge of CPUID bit names. This allows to enable/disable those new features on QEMU's command line when using KVM and prepares future feature enablement in QEMU. This adds F16C, RDRAND, LWP, TBM, TopoExt, PerfCtr_Core, PerfCtr_NB, FSGSBASE, BMI1, AVX2, BMI2, ERMS, PCID, InvPCID, RTM, RDSeed and ADX. Sources where the AMD BKDG for Family 15h/Model 10h, Intel Software Developer Manual, and the Linux kernel for the leaf 7 bits. Signed-off-by: Andre Przywara <osp@andrep.de> Signed-off-by: Boris Ostrovsky <boris.ostrovsky@amd.com> [ehabkost: added CPUID_EXT_PCID] [ehabkost: edited commit message] [ehabkost: rebased against latest qemu.git master] Signed-off-by: Eduardo Habkost <ehabkost@redhat.com> Reviewed-by: Igor Mammedov <imammedo@redhat.com> Signed-off-by: Andreas Färber <afaerber@suse.de>
2012-11-10target-i386: avoid using cpu_single_envBlue Swirl1-218/+222
Pass around CPUArchState instead of using global cpu_single_env. Signed-off-by: Blue Swirl <blauwirbel@gmail.com> Reviewed-by: Andreas Färber <afaerber@suse.de>
2012-11-10kvm: avoid using cpu_single_envBlue Swirl1-10/+11
Pass around CPUArchState instead of using global cpu_single_env. Signed-off-by: Blue Swirl <blauwirbel@gmail.com> Reviewed-by: Andreas Färber <afaerber@suse.de>
2012-11-10disas: avoid using cpu_single_envBlue Swirl1-1/+1
Pass around CPUArchState instead of using global cpu_single_env. Signed-off-by: Blue Swirl <blauwirbel@gmail.com> Acked-by: Richard Henderson <rth@twiddle.net> Acked-by: Aurelien Jarno <aurelien@aurel32.net> Acked-by: Guan Xuetao <gxt@mprc.pku.edu.cn>
2012-11-02target-i386: cpu: fix --disable-kvm compilationEduardo Habkost1-0/+4
This fixes the following: target-i386/cpu.o: In function `kvm_cpu_fill_host': target-i386/cpu.c:783: undefined reference to `kvm_state' I didn't notice the problem before because GCC was optimizing the entire kvm_cpu_fill_host() function out (because all calls are conditional on kvm_enabled()). * cpu_x86_fill_model_id() is used only if CONFIG_KVM is set, so #ifdef it entirely to avoid compiler warnings. * kvm_cpu_fill_host() should be called only if KVM is enabled, so use #ifdef CONFIG_KVM around the entire function body. Reported-by: Andreas Färber <afaerber@suse.de> Signed-off-by: Eduardo Habkost <ehabkost@redhat.com> Signed-off-by: Andreas Färber <afaerber@suse.de>
2012-11-01Merge remote-tracking branch 'qemu-kvm/uq/master' into stagingAnthony Liguori2-87/+164
* qemu-kvm/uq/master: (28 commits) update-linux-headers.sh: Handle new kernel uapi/ directories target-i386: kvm_cpu_fill_host: use GET_SUPPORTED_CPUID target-i386: cpu: make -cpu host/check/enforce code KVM-specific target-i386: make cpu_x86_fill_host() void Emulate qemu-kvms -no-kvm option Issue warning when deprecated -tdf option is used Issue warning when deprecated drive parameter boot=on|off is used Use global properties to emulate -no-kvm-pit-reinjection Issue warning when deprecated -no-kvm-pit is used Use machine options to emulate -no-kvm-irqchip cirrus_vga: allow configurable vram size target-i386: Add missing kvm cpuid feature name i386: cpu: add missing CPUID[EAX=7,ECX=0] flag names i386: kvm: filter CPUID leaf 7 based on GET_SUPPORTED_CPUID, too i386: kvm: reformat filter_features_for_kvm() code i386: kvm: filter CPUID feature words earlier, on cpu.c i386: kvm: mask cpuid_ext4_features bits earlier i386: kvm: mask cpuid_kvm_features earlier i386: kvm: x2apic is not supported without in-kernel irqchip i386: kvm: set CPUID_EXT_TSC_DEADLINE_TIMER on kvm_arch_get_supported_cpuid() ... Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2012-10-31target-i386: Pass X86CPU to kvm_handle_halt()Andreas Färber1-2/+5
Needed for moving interrupt_request and halted fields to CPUState. Signed-off-by: Andreas Färber <afaerber@suse.de>
2012-10-31target-i386: Pass X86CPU to kvm_get_mp_state()Andreas Färber1-4/+5
Needed for moving halted field to CPUState. Signed-off-by: Andreas Färber <afaerber@suse.de>
2012-10-31cpus: Pass CPUState to run_on_cpu()Andreas Färber1-2/+2
CPUArchState is no longer needed. Move the declaration to include/qemu/cpu.h and add documentation. Signed-off-by: Andreas Färber <afaerber@suse.de>
2012-10-31target-i386: Pass X86CPU to cpu_x86_inject_mce()Andreas Färber3-3/+4
Needed for changing run_on_cpu() argument to CPUState. Signed-off-by: Andreas Färber <afaerber@suse.de>
2012-10-31target-i386: Pass X86CPU to kvm_mce_inject()Andreas Färber1-3/+5
Needed for changing cpu_x86_inject_mce() argument to X86CPU. Signed-off-by: Andreas Färber <afaerber@suse.de> [AF: Rebased onto hwaddr]
2012-10-31cpus: Pass CPUState to [qemu_]cpu_has_work()Andreas Färber1-1/+3
For target-mips also change the return type to bool. Make include paths for cpu-qom.h consistent for alpha and unicore32. Signed-off-by: Andreas Färber <afaerber@suse.de> [AF: Updated new target-openrisc function accordingly] Acked-by: Richard Henderson <rth@twiddle.net> (for alpha)
2012-10-30target-i386: kvm_cpu_fill_host: use GET_SUPPORTED_CPUIDEduardo Habkost1-10/+15
Change the kvm_cpu_fill_host() function to use kvm_arch_get_supported_cpuid() instead of running the CPUID instruction directly, when checking for supported CPUID features. This should solve two problems at the same time: * "-cpu host" was not enabling features that don't need support on the host CPU (e.g. x2apic); * "check" and "enforce" options were not detecting problems when the host CPU did support a feature, but the KVM kernel code didn't support it. Signed-off-by: Eduardo Habkost <ehabkost@redhat.com> Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
2012-10-30target-i386: cpu: make -cpu host/check/enforce code KVM-specificEduardo Habkost1-7/+18
Rationale: * "-cpu host" is available only when using KVM * The current implementation of -cpu check/enforce (check_features_against_host()) makes sense only when using KVM. So this makes the functions check_features_against_host() and cpu_x86_fill_host() KVM-specific, document them as such, and rename them to kvm_check_features_against_host() and kvm_cpu_fill_host(). Signed-off-by: Eduardo Habkost <ehabkost@redhat.com> Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>