summaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2013-07-23linux-user: fix segmentation fault passing with h2g(x) != xAlexander Graf2-2/+10
When forwarding a segmentation fault into the guest process, we were passing the host's address directly into the guest process's signal descriptor. That obviously confused the guest process, since it didn't know what to make of the (usually 32-bit truncated) address. Passing in h2g(address) makes the guest process a lot happier. To make the code more obvious, introduce a h2g_nocheck() macro that does the same as h2g(), but allows us to convert addresses that may be outside of guest mapped range into the guest's view of address space. This fixes java running in arm-linux-user for me. Signed-off-by: Alexander Graf <agraf@suse.de> Signed-off-by: Riku Voipio <riku.voipio@linaro.org>
2013-07-23linux-user: Fix pipe syscall return for SPARCPeter Maydell1-0/+3
SPARC is one of the CPUs which has a funny syscall ABI for the pipe syscall; add it to the set of special cases in do_pipe(). Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Riku Voipio <riku.voipio@linaro.org>
2013-07-23linux-user: Fix target_stat and target_stat64 for OpenRISCPeter Maydell1-12/+37
OpenRISC uses the asm-generic versions of target_stat and target_stat64, but it was incorrectly using the x86/ARM/etc version due to a misplaced defined(TARGET_OPENRISC). The previously unused OpenRISC section of the ifdef ladder also defined an incorrect target_stat and omitted the target_stat64 definition. Fix target_stat, provide target_stat64, and add a comment noting that these are the asm-generic versions for the benefit of future ports. Reviewed-by: Jia Liu <proljc@gmail.com> Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Riku Voipio <riku.voipio@linaro.org>
2013-07-23migration: add autoconvergence documentationJuan Quintela1-0/+3
This hunk got lost during merge. It is documentation. Spotted-by: Peter Lieven <lieven-lists@dlhnet.de> Signed-off-by: Juan Quintela <quintela@redhat.com>
2013-07-23Fix real mode guest segments dpl value in savevmOrit Wasserman1-0/+18
Older KVM version put invalid value in the segments registers dpl field for real mode guests (0x3). This breaks migration from those hosts to hosts with unrestricted guest support. We detect it by checking CS dpl value for real mode guest and fix the dpl values of all the segment registers. Signed-off-by: Orit Wasserman <owasserm@redhat.com> Reviewed-by: Juan Quintela <quintela@redhat.com> Signed-off-by: Juan Quintela <quintela@redhat.com>
2013-07-23Fix real mode guest migrationOrit Wasserman1-0/+18
Older KVM versions save CS dpl value to an invalid value for real mode guests (0x3). This patch detect this situation when loading CPU state and set all the segments dpl to zero. This will allow migration from older KVM on host without unrestricted guest to hosts with restricted guest support. For example migration from a Penryn host (with kernel 2.6.32) to a Westmere host (for real mode guest) will fail with "kvm: unhandled exit 80000021". Signed-off-by: Orit Wasserman <owasserm@redhat.com> Reviewed-by: Juan Quintela <quintela@redhat.com> Signed-off-by: Juan Quintela <quintela@redhat.com>
2013-07-23rdma: account for the time spent in MIG_STATE_SETUP through QMPMichael R. Hines4-1/+22
Using the previous patches, we're now able to timestamp the SETUP state. Once we have this time, let the user know about it in the schema. Reviewed-by: Juan Quintela <quintela@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Signed-off-by: Michael R. Hines <mrhines@us.ibm.com> Signed-off-by: Juan Quintela <quintela@redhat.com>
2013-07-23rdma: introduce MIG_STATE_NONE and change MIG_STATE_SETUP state transitionMichael R. Hines1-7/+14
As described in the previous patch, until now, the MIG_STATE_SETUP state was not really a 'formal' state. It has been used as a 'zero' state (what we're calling 'NONE' here) and QEMU has been unconditionally transitioning into this state when the QMP migration command was called. Instead we want to introduce MIG_STATE_NONE, which is our starting state in the state machine, and then immediately transition into the MIG_STATE_SETUP state when the QMP migrate command is issued. In order to do this, we must delay the transition into MIG_STATE_ACTIVE until later in the migration_thread(). This is done to be able to timestamp the amount of time spent in the SETUP state for proper accounting to the user during an RDMA migration. Furthermore, the management software, until now, has never been aware of the existence of the SETUP state whatsoever. This must change, because, timing of this state implies that the state actually exists. These two patches cannot be separated because the 'query_migrate' QMP switch statement needs to know how to handle this new state transition. Reviewed-by: Juan Quintela <quintela@redhat.com> Tested-by: Michael R. Hines <mrhines@us.ibm.com> Signed-off-by: Michael R. Hines <mrhines@us.ibm.com> Signed-off-by: Juan Quintela <quintela@redhat.com>
2013-07-23rdma: allow state transitions between other states besides ACTIVEMichael R. Hines1-6/+6
This patch is in preparation for the next ones: Until now the MIG_STATE_SETUP state was not really a 'formal' state. It has been used as a 'zero' state and QEMU has been unconditionally transitioning into this state when the QMP migrate command was called. In preparation for timing this state, we have to make this state a a 'real' state which actually gets transitioned from later in the migration_thread() from SETUP => ACTIVE, rather than just automatically dropping into this state at the beginninig of the migration. This means that the state transition function (migration_finish_set_state()) needs to be capable of transitioning from valid states _other_ than just MIG_STATE_ACTIVE. The function is in fact already capable of doing that, but was not allowing the old state to be a parameter specified as an input. This patch fixes that and only makes the transition if the current state matches the old state that the caller intended to transition from. Reviewed-by: Juan Quintela <quintela@redhat.com> Tested-by: Michael R. Hines <mrhines@us.ibm.com> Signed-off-by: Michael R. Hines <mrhines@us.ibm.com> Signed-off-by: Juan Quintela <quintela@redhat.com>
2013-07-23target-openrisc: Free typename in openrisc_cpu_class_by_nameJia Liu1-0/+1
We should free typename here. Signed-off-by: Jia Liu <proljc@gmail.com> Reviewed-by: Andreas Färber <afaerber@suse.de>
2013-07-23hw/openrisc: Use stderr output instead of qemu_logJia Liu1-2/+2
We should use stderr output instead of qemu_log in order to output ErrMsg onto the screen. Signed-off-by: Jia Liu <proljc@gmail.com> Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Reviewed-by: Andreas Färber <afaerber@suse.de>
2013-07-23hw/openrisc: Indent typoJia Liu1-1/+1
Indent typo. Signed-off-by: Jia Liu <proljc@gmail.com> Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Reviewed-by: Andreas Färber <afaerber@suse.de>
2013-07-23rdma: send pc.ramMichael R. Hines1-1/+32
This takes advantages of the previous patches: 1. use the new QEMUFileOps hook 'save_page' 2. call out to the right accessor methods to invoke the iteration hooks defined in QEMUFileOps Reviewed-by: Paolo Bonzini <pbonzini@redhat.com> Reviewed-by: Chegu Vinod <chegu_vinod@hp.com> Tested-by: Chegu Vinod <chegu_vinod@hp.com> Tested-by: Michael R. Hines <mrhines@us.ibm.com> Signed-off-by: Michael R. Hines <mrhines@us.ibm.com> Signed-off-by: Juan Quintela <quintela@redhat.com>
2013-07-23rdma: core logicMichael R. Hines5-0/+3302
Code that does need to be visible is kept well contained inside this file and this is the only new additional file to the entire patch. This file includes the entire protocol and interfaces required to perform RDMA migration. Also, the configure and Makefile modifications to link this file are included. Full documentation is in docs/rdma.txt Reviewed-by: Paolo Bonzini <pbonzini@redhat.com> Reviewed-by: Chegu Vinod <chegu_vinod@hp.com> Tested-by: Chegu Vinod <chegu_vinod@hp.com> Tested-by: Michael R. Hines <mrhines@us.ibm.com> Signed-off-by: Michael R. Hines <mrhines@us.ibm.com> Signed-off-by: Juan Quintela <quintela@redhat.com>
2013-07-23rdma: introduce ram_handle_compressed()Michael R. Hines2-10/+21
This gives RDMA shared access to madvise() on the destination side when an entire chunk is found to be zero. Reviewed-by: Juan Quintela <quintela@redhat.com> Reviewed-by: Paolo Bonzini <pbonzini@redhat.com> Reviewed-by: Chegu Vinod <chegu_vinod@hp.com> Tested-by: Chegu Vinod <chegu_vinod@hp.com> Tested-by: Michael R. Hines <mrhines@us.ibm.com> Signed-off-by: Michael R. Hines <mrhines@us.ibm.com> Signed-off-by: Juan Quintela <quintela@redhat.com>
2013-07-23rdma: bugfix: ram_control_save_page()Michael R. Hines1-1/+1
We were not checking for a valid 'bytes_sent' pointer before accessing it. Reviewed-by: Eric Blake <eblake@redhat.com> Signed-off-by: Michael R. Hines <mrhines@us.ibm.com> Signed-off-by: Juan Quintela <quintela@redhat.com>
2013-07-23rdma: update documentation to reflect new unpin supportMichael R. Hines1-21/+30
As requested, the protocol now includes memory unpinning support. This has been implemented in a non-optimized manner, in such a way that one could devise an LRU or other workload-specific information on top of the basic mechanism to influence the way unpinning happens during runtime. The feature is not yet user-facing, and is thus can only be enabled at compile-time. Reviewed-by: Eric Blake <eblake@redhat.com> Signed-off-by: Michael R. Hines <mrhines@us.ibm.com> Signed-off-by: Juan Quintela <quintela@redhat.com>
2013-07-23linux-user: Use X86CPU property to retrieve CPUID familyAndreas Färber1-4/+6
Avoids duplicating the calculation. Reviewed-by: Igor Mammedov <imammedo@redhat.com> Signed-off-by: Andreas Färber <afaerber@suse.de>
2013-07-23gdbstub: Change gdb_register_coprocessor() argument to CPUStateAndreas Färber5-16/+18
Signed-off-by: Andreas Färber <afaerber@suse.de>
2013-07-23cpu: Move gdb_regs field from CPU_COMMON to CPUStateAndreas Färber3-7/+8
Prepares for changing gdb_register_coprocessor() argument to CPUState. Signed-off-by: Andreas Färber <afaerber@suse.de>
2013-07-23gdbstub: Change GDBState::{c,g}_cpu and find_cpu() to CPUStateAndreas Färber1-52/+52
Use CPUState::env_ptr where still needed. Signed-off-by: Andreas Färber <afaerber@suse.de>
2013-07-23cpu: Introduce CPUClass::memory_rw_debug() for target_memory_rw_debug()Andreas Färber5-15/+25
Make inline target_memory_rw_debug() always available and change its argument to CPUState. Let it check if CPUClass::memory_rw_debug provides a specialized callback and fall back to cpu_memory_rw_debug() otherwise. The only overriding implementation is for 32-bit sparc. This prepares for changing GDBState::g_cpu to CPUState. Signed-off-by: Andreas Färber <afaerber@suse.de>
2013-07-23exec: Change cpu_memory_rw_debug() argument to CPUStateAndreas Färber13-73/+77
Propagate X86CPU in kvmvapic for simplicity. Signed-off-by: Andreas Färber <afaerber@suse.de>
2013-07-23cpu: Turn cpu_get_phys_page_debug() into a CPUClass hookAndreas Färber55-128/+182
Change breakpoint_invalidate() argument to CPUState alongside. Since all targets now assign a softmmu-only field, we can drop helpers cpu_class_set_{do_unassigned_access,vmsd}() and device_class_set_vmsd(). Prepares for changing cpu_memory_rw_debug() argument to CPUState. Acked-by: Max Filippov <jcmvbkbc@gmail.com> (for xtensa) Signed-off-by: Andreas Färber <afaerber@suse.de>
2013-07-23gdbstub: Change gdb_{read,write}_register() argument to CPUStateAndreas Färber1-6/+10
Use CPUState::env_ptr for now. Prepares for changing GDBState::g_cpu to CPUState. Signed-off-by: Andreas Färber <afaerber@suse.de>
2013-07-23gdbstub: Change gdb_handlesig() argument to CPUStateAndreas Färber5-25/+31
Prepares for changing GDBState::c_cpu to CPUState. Signed-off-by: Andreas Färber <afaerber@suse.de>
2013-07-23gdbstub: Change syscall callback argument to CPUStateAndreas Färber4-5/+12
Callback implementations were specific to arm and m68k, so can easily cast to ARMCPU and M68kCPU respectively. Prepares for changing GDBState::c_cpu to CPUState. Signed-off-by: Andreas Färber <afaerber@suse.de>
2013-07-23kvm: Change kvm_{insert,remove}_breakpoint() argument to CPUStateAndreas Färber4-14/+16
CPUArchState is no longer directly used since converting CPU loops to CPUState. Prepares for changing GDBState::c_cpu to CPUState. Signed-off-by: Andreas Färber <afaerber@suse.de>
2013-07-23cpu: Change cpu_single_step() argument to CPUStateAndreas Färber4-12/+20
Use CPUState::env_ptr for now. Needed for GdbState::c_cpu. Signed-off-by: Andreas Färber <afaerber@suse.de>
2013-07-23gdbstub: Update gdb_handlesig() and gdb_signalled() Coding StyleAndreas Färber1-47/+47
In particular reindent to 4 instead of 2 spaces. Prepares for changing cpu_single_step() argument in gdb_handlesig(). Signed-off-by: Andreas Färber <afaerber@suse.de>
2013-07-23cpu: Move singlestep_enabled field from CPU_COMMON to CPUStateAndreas Färber23-52/+78
Prepares for changing cpu_single_step() argument to CPUState. Acked-by: Michael Walle <michael@walle.cc> (for lm32) Signed-off-by: Andreas Färber <afaerber@suse.de>
2013-07-23target-alpha: Copy implver to DisasContextRichard Henderson1-4/+7
Which allows removing env from DisasContext. Signed-off-by: Richard Henderson <rth@twiddle.net> Signed-off-by: Andreas Färber <afaerber@suse.de>
2013-07-23target-alpha: Copy singlestep_enabled to DisasContextRichard Henderson1-3/+6
Prepare for removing env from DisasContext. Signed-off-by: Richard Henderson <rth@twiddle.net> Signed-off-by: Andreas Färber <afaerber@suse.de>
2013-07-23cpu: Introduce CPUClass::synchronize_from_tb() for cpu_pc_from_tb()Andreas Färber22-84/+49
Where no extra implementation is needed, fall back to CPUClass::set_pc(). Acked-by: Michael Walle <michael@walle.cc> (for lm32) Signed-off-by: Andreas Färber <afaerber@suse.de>
2013-07-23target-unicore32: Implement CPUClass::set_pc()Andreas Färber1-0/+8
This adds support for GDB's c addr (Continue) and s addr (Single Step). Prepares for dropping cpu_pc_from_tb(). Signed-off-by: Andreas Färber <afaerber@suse.de>
2013-07-23target-moxie: Implement CPUClass::set_pc()Andreas Färber1-0/+8
This adds support for GDB's c addr (Continue) and s addr (Single Step). Prepares for dropping cpu_pc_from_tb(). Signed-off-by: Andreas Färber <afaerber@suse.de>
2013-07-23target-m68k: Implement CPUClass::set_pc()Andreas Färber1-0/+8
This adds support for GDB's c addr (Continue) and s addr (Single Step). Prepares for dropping cpu_pc_from_tb(). Signed-off-by: Andreas Färber <afaerber@suse.de>
2013-07-23cpu: Introduce CPUClass::set_pc() for gdb_set_cpu_pc()Andreas Färber15-33/+119
This moves setting the Program Counter from gdbstub into target code. Use vaddr type as upper-bound replacement for target_ulong. Signed-off-by: Andreas Färber <afaerber@suse.de>
2013-07-23HACKING: Document vaddr type usagePeter Maydell1-2/+17
Also extend documentation of target_ulong and abi_ulong. Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Andreas Färber <afaerber@suse.de>
2013-07-23cpu: Introduce vaddr typeAndreas Färber1-0/+12
vaddr is to target_ulong what uintmax_t is to unsigned int. Its purpose is to allow turning per-target functions with target_ulong arguments into CPUClass hooks. Suggested-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Andreas Färber <afaerber@suse.de>
2013-07-23gdbstub: Change GDBState::query_cpu to CPUStateAndreas Färber1-5/+4
Since first_cpu/next_cpu are CPUState, CPUArchState is no longer needed. This resolves a NULL pointer dereference of query_cpu, introduced with commit 182735efaf956ccab50b6d74a4fed163e0f35660 and reported by TeLeMan and Max Filippov. Reviewed-by: Richard Henderson <rth@twiddle.net> Signed-off-by: Andreas Färber <afaerber@suse.de>
2013-07-23isa-bus: Drop isabus_bridge_init() since it does nothingHu Tao1-8/+0
This works since commit 4ce5dae88ecf2bafa0cd663de7e923728b1b3672. Signed-off-by: Hu Tao <hutao@cn.fujitsu.com> [AF: Edited] Signed-off-by: Andreas Färber <afaerber@suse.de>
2013-07-23ioapic: Use QOM realize for ioapicHu Tao1-7/+5
Signed-off-by: Hu Tao <hutao@cn.fujitsu.com> [AF: Tweaked error message] Signed-off-by: Andreas Färber <afaerber@suse.de>
2013-07-23kvmvapic: Use QOM realizeHu Tao1-7/+5
Signed-off-by: Hu Tao <hutao@cn.fujitsu.com> [AF: Renamed variable] Signed-off-by: Andreas Färber <afaerber@suse.de>
2013-07-23kvm/clock: Use QOM realize for kvmclockHu Tao1-4/+2
Signed-off-by: Hu Tao <hutao@cn.fujitsu.com> Signed-off-by: Andreas Färber <afaerber@suse.de>
2013-07-23hpet: Use QOM realize for hpetHu Tao1-13/+19
Signed-off-by: Hu Tao <hutao@cn.fujitsu.com> [AF: Avoided SYS_BUS_DEVICE() in loop] Signed-off-by: Andreas Färber <afaerber@suse.de>
2013-07-23scsi: Improve error propagation for scsi_bus_legacy_handle_cmdline()Andreas Färber10-18/+55
Let scsi_bus_legacy_add_drive() and scsi_bus_legacy_handle_cmdline() return an Error**. Prepare qdev initfns for QOM realize error model. Signed-off-by: Andreas Färber <afaerber@suse.de>
2013-07-23megasas: Legacy command line handling fixAndreas Färber1-1/+4
Only apply legacy command line handling when the device has not been hot-plugged. Propagate failure of legacy command line handling. Cc: qemu-stable@nongnu.org Acked-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Andreas Färber <afaerber@suse.de>
2013-07-23scsi/esp: Use QOM realize for scsi espHu Tao1-8/+11
Signed-off-by: Hu Tao <hutao@cn.fujitsu.com> [AF: Drop sysbus_esp_init()] Signed-off-by: Andreas Färber <afaerber@suse.de>
2013-07-23fw_cfg: Use QOM realize for fw_cfgHu Tao1-10/+17
Signed-off-by: Hu Tao <hutao@cn.fujitsu.com> [AF: Moved sysbus_init_mmio() to instance_init, renamed variable] Signed-off-by: Andreas Färber <afaerber@suse.de>