summaryrefslogtreecommitdiffstats
path: root/target-i386
Commit message (Collapse)AuthorAgeFilesLines
* kvm: Synchronize cpu state in kvm_arch_stop_on_emulation_error()Gleb Natapov2012-02-161-0/+1
| | | | | | | | | Call to kvm_cpu_synchronize_state() is missing. kvm_arch_stop_on_emulation_error may look at outdated registers here. Signed-off-by: Gleb Natapov <gleb@redhat.com> Signed-off-by: Avi Kivity <avi@redhat.com> Reviewed-by: Jan Kiszka <jan.kiszka@siemens.com>
* kvm: Implement kvm_irqchip_in_kernel like kvm_enabledJan Kiszka2012-02-081-2/+2
| | | | | | | | | | To both avoid that kvm_irqchip_in_kernel always has to be paired with kvm_enabled and that the former ends up in a function call, implement it like the latter. This means keeping the state in a global variable and defining kvm_irqchip_in_kernel as a preprocessor macro. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
* kvm: Allow to set shadow MMU sizeJan Kiszka2012-02-081-0/+13
| | | | | | | | | | | | Introduce the KVM-specific machine option kvm_shadow_mem. It allows to set a custom shadow MMU size for the virtual machine. This is useful for stress testing e.g. Only x86 supports this for now, but it is in principle a generic concept for all targets with shadow MMUs. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
* hyperv: fix build on non-KVM hostsBlue Swirl2012-01-231-1/+3
| | | | Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* kvm: x86: Add user space part for in-kernel APICJan Kiszka2012-01-191-0/+38
| | | | | | | | | | | | | This introduces the alternative APIC device which makes use of KVM's in-kernel device model. External NMI injection via LINT1 is emulated by checking the current state of the in-kernel APIC, only injecting a NMI into the VCPU if LINT1 is unmasked and configured to DM_NMI. MSI is not yet supported, so we disable this when the in-kernel model is in use. CC: Lai Jiangshan <laijs@cn.fujitsu.com> Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
* kvm: Introduce core services for in-kernel irqchip supportJan Kiszka2012-01-191-0/+11
| | | | | | | | | | | | | | Add the basic infrastructure to active in-kernel irqchip support, inject interrupts into these models, and maintain IRQ routes. Routing is optional and depends on the host arch supporting KVM_CAP_IRQ_ROUTING. When it's not available on x86, we looe the HPET as we can't route GSI0 to IOAPIC pin 2. In-kernel irqchip support will once be controlled by the machine property 'kernel_irqchip', but this is not yet wired up. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
* hyper-v: initialize Hyper-V CPUID leaves.Vadim Rozenfeld2012-01-191-2/+63
| | | | Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
* hyper-v: introduce Hyper-V support infrastructure.Vadim Rozenfeld2012-01-193-0/+121
| | | | | | [Jan: fix build with CONFIG_USER_ONLY] Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
* target-i386: fix compilation with --enable-debug-tcgAurelien Jarno2012-01-131-1/+2
| | | | | | | | Commit 2355c16e74ffa4d14e7fc2b4a23b055565ac0221 introduced a new ldmxcsr helper taking an i32 argument, but the helper is actually passed a long. Fix that by truncating the long to i32. Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
* target-i386: fix SSE rounding and flush to zeroAurelien Jarno2012-01-113-11/+56
| | | | | | | | | | | | SSE rounding and flush to zero control has never been implemented. However given that softfloat-native was using a single state for FPU and SSE and given that glibc is setting both FPU and SSE state in fesetround(), this was working correctly up to the switch to softfloat. Fix that by adding an update_sse_status() function similar to update_fpu_status(), and callin git on write to mxcsr. Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
* target-i386: fix dpps and dppd SSE2 instructionsAurelien Jarno2012-01-111-14/+14
| | | | | | | | The helpers implemented dpps and dppd SSE instructions are not passing the correct argument types to the softfloat functions. While they do work anyway providing a correct behaviour, this patch fixes that. Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
* target-i386: fix round{pd,ps,sd,ss} SSE2 instructionsAurelien Jarno2012-01-111-8/+8
| | | | | | | | | | | | | roundps and roundss SSE2 instructions have been broken when switching target-i386 to softfloat. They use float64_round_to_int to convert a float32, and while the implicit conversion from float32 to float64 was correct for softfloat-native, it is not for pure softfloat. Fix that by using the correct registers and correct functions. Also fix roundpd and roundsd implementation at the same time, even if these functions are behaving correctly. Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
* target-i386: fix {min,max}{pd,ps,sd,ss} SSE2 instructionsAurelien Jarno2012-01-112-3/+7
| | | | | | | | | | | | | | | | | | | minpd, minps, minsd, minss and maxpd, maxps, maxsd, maxss SSE2 instructions have been broken when switching target-i386 to softfloat. It's not possible to use comparison instructions on float types anymore to softfloat, so use the floatXX_lt function instead, as the float_XX_min and float_XX_max functions can't be used due to the Intel specific behaviour. As it implements the correct NaNs behaviour, let's remove the corresponding entry from the TODO. It fixes GDM screen display on Debian Lenny. Thanks to Peter Maydell and Jason Wessel for their analysis of the problem. Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
* Merge remote-tracking branch 'qemu-kvm/memory/page_desc' into stagingAnthony Liguori2012-01-031-4/+3
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * qemu-kvm/memory/page_desc: (22 commits) Remove cpu_get_physical_page_desc() sparc: avoid cpu_get_physical_page_desc() virtio-balloon: avoid cpu_get_physical_page_desc() vhost: avoid cpu_get_physical_page_desc() kvm: avoid cpu_get_physical_page_desc() memory: remove CPUPhysMemoryClient xen: convert to MemoryListener API memory: temporarily add memory_region_get_ram_addr() xen, vga: add API for registering the framebuffer vhost: convert to MemoryListener API kvm: convert to MemoryListener API kvm: switch kvm slots to use host virtual address instead of ram_addr_t memory: add API for observing updates to the physical memory map memory: replace cpu_physical_sync_dirty_bitmap() with a memory API framebuffer: drop use of cpu_physical_sync_dirty_bitmap() loader: remove calls to cpu_get_physical_page_desc() framebuffer: drop use of cpu_get_physical_page_desc() memory: introduce memory_region_find() memory: add memory_region_is_logging() memory: add memory_region_is_rom() ...
| * kvm: switch kvm slots to use host virtual address instead of ram_addr_tAvi Kivity2011-12-201-4/+3
| | | | | | | | | | | | This simplifies a later switch to the memory API in slot management. Signed-off-by: Avi Kivity <avi@redhat.com>
* | enable architectural PMU cpuid leaf for kvmGleb Natapov2011-12-221-4/+13
| | | | | | | | | | Signed-off-by: Gleb Natapov <gleb@redhat.com> Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
* | kvm: x86: Drop redundant apic base and tpr update from kvm_get_sregsJan Kiszka2011-12-221-3/+2
| | | | | | | | | | | | | | | | | | The latter was already commented out, the former is redundant as well. We always get the latest changes after return from the guest via kvm_arch_post_run. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
* | kvm: x86: Avoid runtime allocation of xsave bufferJan Kiszka2011-12-222-9/+9
| | | | | | | | | | | | | | | | Keep a per-VCPU xsave buffer for kvm_put/get_xsave instead of continuously allocating and freeing it on state sync. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
* | kvm: x86: Use symbols for all xsave fieldJan Kiszka2011-12-221-6/+8
|/ | | | | | | Field 0 (FCW+FSW) and 1 (FTW+FOP) were hard-coded so far. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
* target-i386: fix cmpxchg instruction emulationAndreas Gustafsson2011-12-121-4/+7
| | | | | | | | | | | | | When the i386 cmpxchg instruction is executed with a memory operand and the comparison result is "unequal", do the memory write before changing the accumulator instead of the other way around, because otherwise the new accumulator value will incorrectly be used in the comparison when the instruction is restarted after a page fault. This bug was originally reported on 2010-04-25 as https://bugs.launchpad.net/qemu/+bug/569760 Signed-off-by: Andreas Gustafsson <gson@gson.org>
* x86/cpuid: Tighten parsing of tsc_freq=FREQMarkus Armbruster2011-11-281-1/+1
| | | | | | | | | | | | | cpu_x86_find_by_name() uses strtosz_suffix_unit(), but screws up the error checking. It detects some failures, but not all. Undetected failures result in a zero tsc_khz value (error value -1 divided by 1000), which means "no tsc_freq set". To reproduce, try "-cpu qemu64,tsc_freq=9999999T". strtosz_suffix_unit() fails, because the value overflows int64_t, Signed-off-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* Revert "i386: derive '-cpu host' from KVM_GET_SUPPORTED_CPUID"Anthony Liguori2011-11-281-4/+23
| | | | | | | | | | | | This reverts commit 66e3dd9282141b5ae75637c9676002cf3ceeb988. From Avi, "Anthony, I think we should revert that commit and refactor cpuid for 1.1. The logic is spread over too many places which makes it hard to reason about." Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* Merge remote-tracking branch 'origin/master' into stagingAnthony Liguori2011-11-211-4/+8
|\
| * x86: fix pcmpestrm and pcmpistrmBlue Swirl2011-11-191-4/+8
| | | | | | | | | | | | | | | | | | Fix obvious typos (decrement and off-by-one error) in pcmpestrm and pcmpistrm which resulted in infinite loop. Reported by Frank Mehnert, spotted also by Coverity (bug 84752853). Reported-by: Frank Mehnert <frank.mehnert@oracle.com> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* | Fix typo: runnning -> runningVagrant Cascadian2011-11-171-1/+1
|/ | | | | | | | One n too many for running, need we say more. Signed-Off-By: Vagrant Cascadian <vagrant@freegeek.org> Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
* x86/cpuid: Fix crash on -cpu ""Markus Armbruster2011-11-101-2/+2
| | | | | | | Spotted by Coverity. Signed-off-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
* x86/cpuid: Plug memory leak in cpudef_setfield()Markus Armbruster2011-11-101-0/+1
| | | | | | | | To reproduce the leak, put two name options into the same [cpudef] section of target-x86_64.conf. Signed-off-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
* x86/cpuid: Convert remaining strdup() to g_strdup()Markus Armbruster2011-11-101-4/+4
| | | | | | | Fixes missing error checking. Signed-off-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
* i386: derive '-cpu host' from KVM_GET_SUPPORTED_CPUIDAvi Kivity2011-11-091-23/+4
| | | | | | | | | | | | The fact that a host cpu supports a feature doesn't mean that QEMU and KVM will also support it, yet -cpuid host brings host features wholesale. We need to whitelist each feature separately to make sure we support it. This patch adds KVM whitelisting (by simply using KVM_GET_SUPPORTED_CPUID instead of the CPUID instruction). Signed-off-by: Avi Kivity <avi@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* Fix X86 CPU topology in KVM modeBharata B Rao2011-11-021-0/+1
| | | | | | | | | | | | | | apic id returned to guest kernel in ebx for cpuid(function=1) depends on CPUX86State->cpuid_apic_id which gets populated after the cpuid information is cached in the host kernel. This results in broken CPU topology in guest. Fix this by setting cpuid_apic_id before cpuid information is passed to the host kernel. This is done by moving the setting of cpuid_apic_id to cpu_x86_init() where it will work for both KVM as well as TCG modes. Acked-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Bharata B Rao <bharata.rao@gmail.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* i386: wire up MSR_IA32_MISC_ENABLEAvi Kivity2011-10-245-0/+48
| | | | | | | | | It's needed for its default value - bit 0 specifies that "rep movs" is good enough for memcpy, and Linux may use a slower memcpu if it is not set, depending on cpu family/model. Signed-off-by: Avi Kivity <avi@redhat.com> Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
* kvm: support TSC deadline MSR with subsectionLiu, Jinsong2011-10-243-0/+37
| | | | | | | | | | KVM add emulation of lapic tsc deadline timer for guest. This patch is co-operation work at qemu side. Use subsections to save/restore the field (mtosatti). Signed-off-by: Liu, Jinsong <jinsong.liu@intel.com> Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
* Revert "kvm: support TSC deadline MSR"Marcelo Tosatti2011-10-243-18/+1
| | | | | | | This reverts commit bfc2455ddbb41148494a084d15777e6bed7533c3. New patch with subsections will follow. Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
* kvm: support TSC deadline MSRLiu, Jinsong2011-10-033-1/+18
| | | | | | | | KVM add emulation of lapic tsc deadline timer for guest. This patch is co-operation work at qemu side. Signed-off-by: Liu, Jinsong <jinsong.liu@intel.com> Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
* softmmu_header: pass CPUState to tlb_fillBlue Swirl2011-10-011-4/+3
| | | | | | | Pass CPUState pointer to tlb_fill() instead of architecture local cpu_single_env hacks. Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* target-i386: Remove redundant word mask in port out instructionsJan Kiszka2011-10-011-2/+0
| | | | | | | | T0 was already masked to 16 bits when loading it. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Reviewed-by: Richard Henderson <rth@twiddle.net> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* target-i386: Remove data type CCTableStefan Weil2011-09-212-10/+0
| | | | | | | Remove also two assert statements which were the last remaining users. Signed-off-by: Stefan Weil <weil@mail.berlios.de> Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
* Merge remote-tracking branch 'qmp/queue/qmp' into stagingAnthony Liguori2011-09-201-2/+2
|\
| * Drop the vm_running global variableLuiz Capitulino2011-09-151-1/+1
| | | | | | | | | | | | Use runstate_is_running() instead, which is introduced by this commit. Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
| * Replace the VMSTOP macros with a proper state typeLuiz Capitulino2011-09-151-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Today, when notifying a VM state change with vm_state_notify(), we pass a VMSTOP macro as the 'reason' argument. This is not ideal because the VMSTOP macros tell why qemu stopped and not exactly what the current VM state is. One example to demonstrate this problem is that vm_start() calls vm_state_notify() with reason=0, which turns out to be VMSTOP_USER. This commit fixes that by replacing the VMSTOP macros with a proper state type called RunState. Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
* | target-i386: Fix several SSE3 instructions.Max Reitz2011-09-171-18/+18
|/ | | | | | | | | | haddp[sd], hsubp[sd] and addsubp[sd] operate on floats, thus it is necessary to use the appropriate floating point calculation functions. If this is not done, those functions operate merely on integers, which is not correct. Signed-off-by: Max Reitz <max@tyndur.org> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* kvm: remove unnecessary assignmentsBlue Swirl2011-09-101-1/+1
| | | | | | | | | | Avoid these warnings from clang analyzer: /src/qemu/target-i386/kvm.c:772:5: warning: Value stored to 'cwd' is never read cwd = swd = twd = 0; /src/qemu/target-i386/kvm.c:772:11: warning: Although the value stored to 'swd' is used in the enclosing expression, the value is never actually read from 'swd' cwd = swd = twd = 0; Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* Merge remote-tracking branch 'origin/master' into stagingAnthony Liguori2011-09-081-29/+43
|\
| * target-i386: Compute all flag data inside %cl != 0 test.Richard Henderson2011-09-081-29/+43
| | | | | | | | | | | | | | | | | | | | | | | | The (x << (cl - 1)) quantity is only used if CL != 0. Move the computation of that quantity nearer its use. This avoids the creation of undefined TCG operations when the constant propagation optimization proves that CL == 0, and thus CL-1 is outside the range [0-wordsize). Signed-off-by: Richard Henderson <rth@twiddle.net> Signed-off-by: malc <av1474@comtv.ru>
* | Merge remote-tracking branch 'stefanha/trivial-patches' into stagingAnthony Liguori2011-09-081-3/+3
|\ \ | |/ |/|
| * x86: fix daa opcode for al register values higher than 0xf9Boris Figovsky2011-09-021-3/+3
| | | | | | | | | | | | | | | | | | The second if statement should consider the original al register value, and not the new one. Signed-off-by: Boris Figovsky <boris.figovksy@ravellosystems.com> Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
* | Use new macro QEMU_PACKED for packed structuresStefan Weil2011-09-032-5/+5
|/ | | | | | | | | | | | | | | | | | | | | Most changes were made using these commands: git grep -la '__attribute__((packed))'|xargs perl -pi -e 's/__attribute__\(\(packed\)\)/QEMU_PACKED/' git grep -la '__attribute__ ((packed))'|xargs perl -pi -e 's/__attribute__ \(\(packed\)\)/QEMU_PACKED/' git grep -la '__attribute__((__packed__))'|xargs perl -pi -e 's/__attribute__\(\(__packed__\)\)/QEMU_PACKED/' git grep -la '__attribute__ ((__packed__))'|xargs perl -pi -e 's/__attribute__ \(\(__packed__\)\)/QEMU_PACKED/' git grep -la '__attribute((packed))'|xargs perl -pi -e 's/__attribute\(\(packed\)\)/QEMU_PACKED/' Whitespace in linux-user/syscall_defs.h was fixed manually to avoid warnings from scripts/checkpatch.pl. Manual changes were also applied to hw/pc.c. I did not fix indentation with tabs in block/vvfat.c. The patch will show 4 errors with scripts/checkpatch.pl. Signed-off-by: Stefan Weil <weil@mail.berlios.de> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* Fix up some style nits of last uq/master mergeJan Kiszka2011-08-251-2/+3
| | | | | Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
* Use glib memory allocation and free functionsAnthony Liguori2011-08-203-13/+13
| | | | | | qemu_malloc/qemu_free no longer exist after this commit. Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* Merge remote-tracking branch 'qemu-kvm/uq/master' into stagingAnthony Liguori2011-08-083-1/+29
|\
OpenPOWER on IntegriCloud