summaryrefslogtreecommitdiffstats
path: root/cpu-all.h
Commit message (Collapse)AuthorAgeFilesLines
* cpu_dump_state: move DUMP_FPU and DUMP_CCOP flags from x86-only to genericPeter Maydell2012-10-051-0/+3
| | | | | | | | | | | Move the DUMP_FPU and DUMP_CCOP flags for cpu_dump_state() from being x86-specific flags to being generic ones. This allows us to drop some TARGET_I386 ifdefs in various places, and means that we can (potentially) be more consistent across architectures about which monitor commands or debug abort printouts include FPU register contents and info about QEMU's condition-code optimisations. Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
* Remove unused CONFIG_TCG_PASS_AREG0 and dead codeBlue Swirl2012-09-151-11/+0Star
| | | | | | | | | | | | | Now that CONFIG_TCG_PASS_AREG0 is enabled for all targets, remove dead code and support for !CONFIG_TCG_PASS_AREG0 case. Remove dyngen-exec.h and all references to it. Although included by hw/spapr_hcall.c, it does not seem to use it. Remove unused HELPER_CFLAGS. Signed-off-by: Blue Swirl <blauwirbel@gmail.com> Reviewed-by: Richard Henderson <rth@twiddle.net>
* x86: switch to AREG0 free modeBlue Swirl2012-08-141-0/+22
| | | | | | | | Add an explicit CPUX86State parameter instead of relying on AREG0. Remove temporary wrappers and switch to AREG0 free mode. Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* Maintain the number of dirty pagesJuan Quintela2012-06-291-0/+1
| | | | | | | Calculate the number of dirty pages takes a lot on hosts with lots of memory. Just maintain how many pages are dirty. Signed-off-by: Juan Quintela <quintela@redhat.com>
* ppc: Move load and store helpers, switch to AREG0 free modeBlue Swirl2012-06-241-0/+9
| | | | | | | | | | | | | | | Add an explicit CPUPPCState parameter instead of relying on AREG0 and rename op_helper.c (which only contains load and store helpers) to mem_helper.c. Remove AREG0 swapping in tlb_fill(). Switch to AREG0 free mode. Use cpu_ld{l,uw}_code in translation and interrupt handling, cpu_{ld,st}{l,uw}_data in loads and stores. Signed-off-by: Blue Swirl <blauwirbel@gmail.com> Signed-off-by: Alexander Graf <agraf@suse.de> Signed-off-by: Andreas Färber <afaerber@suse.de> Signed-off-by: Alexander Graf <agraf@suse.de>
* qemu-log: move logging to qemu-log.cBlue Swirl2012-06-211-24/+0Star
| | | | | | | Move logging functions from exec.c to qemu-log.c, compile it only once. Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* dump: remove dumping stuff from cpu-all.hPaolo Bonzini2012-06-071-70/+0Star
| | | | | | | | This simplifies things, because they will only be included for softmmu targets and because the stubs are taken out-of-line in separate files, which in the future could even be compiled only once. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
* dump: change cpu_get_note_size to return ssize_tPaolo Bonzini2012-06-071-2/+2
| | | | | | So that it can use the same prototype in both cases. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
* Merge remote-tracking branch 'qmp/queue/qmp' into stagingAnthony Liguori2012-06-061-0/+70
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * qmp/queue/qmp: (29 commits) Add 'query-events' command to QMP to query async events qapi: convert netdev_del qapi: convert netdev_add net: net_client_init(): use error_set() net: purge the monitor object from all init functions qemu-config: introduce qemu_find_opts_err() qemu-config: find_list(): use error_set() qerror: introduce QERR_INVALID_OPTION_GROUP qemu-option: qemu_opts_from_qdict(): use error_set() qemu-option: introduce qemu_opt_set_err() qemu-option: opt_set(): use error_set() qemu-option: qemu_opts_validate(): use error_set() qemu-option: qemu_opt_parse(): use error_set() qemu-option: parse_option_size(): use error_set() qemu-option: parse_option_bool(): use error_set() qemu-option: parse_option_number(): use error_set() qemu-option: qemu_opts_create(): use error_set() introduce a new monitor command 'dump-guest-memory' to dump guest's memory make gdb_id() generally avialable and rename it to cpu_index() target-i386: Add API to get note's size ...
| * target-i386: Add API to get note's sizeWen Congyang2012-06-041-0/+6
| | | | | | | | | | | | | | | | | | We should know where the note and memory is stored before writing them to vmcore. If we know this, we can avoid using lseek() when creating vmcore. Signed-off-by: Wen Congyang <wency@cn.fujitsu.com> Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
| * target-i386: add API to get dump infoWen Congyang2012-06-041-0/+7
| | | | | | | | | | | | | | | | | | Dump info contains: endian, class and architecture. The next patch will use these information to create vmcore. Note: on x86 box, the class is ELFCLASS64 if the memory is larger than 4G. Signed-off-by: Wen Congyang <wency@cn.fujitsu.com> Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
| * target-i386: Add API to write cpu status to core fileWen Congyang2012-06-041-0/+18
| | | | | | | | | | | | | | | | | | The core file has register's value. But it does not include all registers value. Store the cpu status into QEMU note, and the user can get more information from vmcore. If you change QEMUCPUState, please count up QEMUCPUSTATE_VERSION. Signed-off-by: Wen Congyang <wency@cn.fujitsu.com> Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
| * target-i386: Add API to write elf notes to core fileWen Congyang2012-06-041-0/+22
| | | | | | | | | | | | | | | | The core file contains register's value. These APIs write registers to core file, and them will be called in the following patch. Signed-off-by: Wen Congyang <wency@cn.fujitsu.com> Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
| * Add API to check whether paging mode is enabledWen Congyang2012-06-041-0/+6
| | | | | | | | | | | | | | This API will be used in the following patch. Signed-off-by: Wen Congyang <wency@cn.fujitsu.com> Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
| * implement cpu_get_memory_mapping()Wen Congyang2012-06-041-0/+11
| | | | | | | | | | | | | | | | | | Walk cpu's page table and collect all virtual address and physical address mapping. Then, add these mapping into memory mapping list. If the guest does not use paging, it will do nothing. Note: the I/O memory will be skipped. Signed-off-by: Wen Congyang <wency@cn.fujitsu.com> Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
* | Kill off cpu_state_reset()Andreas Färber2012-06-041-1/+0Star
|/ | | | | | | | | | | | | | | | | In commit 1bba0dc932e8826a7d030df3767daf0bc339f9a2 cpu_reset() was renamed to cpu_state_reset(), to allow introducing a new cpu_reset() that would operate on QOM objects. All callers have been updated except for one in target-mips, so drop all implementations except for the one in target-mips and move the declaration there until MIPSCPU reset can be fully QOM'ified. Signed-off-by: Andreas Färber <afaerber@suse.de> Acked-by: Michael Walle <michael@walle.cc> (for lm32) Acked-by: Max Filippov <jcmvbkbc@gmail.com> (for xtensa) Acked-by: Edgar E. Iglesias <edgar.iglesias@gmail.com> (for mb + cris) Acked-by: Alexander Graf <agraf@suse.de> (for ppc) Acked-by: Blue Swirl <blauwirbel@gmail.com>
* exec: prepare for splittingBlue Swirl2012-05-011-2/+0Star
| | | | | | | | | | | | | | | | | Make s_cputlb_empty_entry 'const'. Rename tlb_flush_jmp_cache() to tb_flush_jmp_cache(). Refactor code to add cpu_tlb_reset_dirty_all(), memory_region_section_get_iotlb() and memory_region_is_unassigned(). Remove unused cpu_tlb_update_dirty(). Fix coding style in areas to be moved. Reviewed-by: Richard Henderson <rth@twiddle.net> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* w64: Fix data types in cpu-all.h, exec.cStefan Weil2012-04-151-4/+4
| | | | | | | w64 needs uintptr_t instead of unsigned long. For other hosts, nothing changes. Signed-off-by: Stefan Weil <sw@weilnetz.de>
* w64: Fix type casts used in some macros in cpu-all.hStefan Weil2012-04-151-2/+2
| | | | | | | Instead of type casts to long, w64 needs type casts to intptr_t. For other hosts, this changes nothing. Signed-off-by: Stefan Weil <sw@weilnetz.de>
* linux-user: take RESERVED_VA into account for g2h_valid()Alexander Graf2012-04-061-1/+2
| | | | | | | | | | | | When running with -R (RESERVED_VA > 0) all guest virtual addresses are within the [0..RESERVED_VA] range. Reflect this with g2h_valid() too so we can safely check for boundaries of our guest address space. This is required to have the /proc/self/maps code not show maps that aren't accessible from the guest process's point of view. Signed-off-by: Alexander Graf <agraf@suse.de> Signed-off-by: Riku Voipio <riku.voipio@linaro.org>
* softmmu templates: optionally pass CPUState to memory access functionsBlue Swirl2012-03-181-0/+9
| | | | | | | | | | | Optionally, make memory access helpers take a parameter for CPUState instead of relying on global env. On most targets, perform simple moves to reorder registers. On i386, switch from regparm(3) calling convention to standard stack-based version. Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* Rename CPUState -> CPUArchStateAndreas Färber2012-03-141-28/+28
| | | | | | | | | | | | | Scripted conversion: for file in *.[hc] hw/*.[hc] hw/kvm/*.[hc] linux-user/*.[hc] linux-user/m68k/*.[hc] bsd-user/*.[hc] darwin-user/*.[hc] tcg/*/*.[hc] target-*/cpu.h; do sed -i "s/CPUState/CPUArchState/g" $file done All occurrences of CPUArchState are expected to be replaced by QOM CPUState, once all targets are QOM'ified and common fields have been extracted. Signed-off-by: Andreas Färber <afaerber@suse.de> Reviewed-by: Anthony Liguori <aliguori@us.ibm.com>
* Rename cpu_reset() to cpu_state_reset()Andreas Färber2012-03-141-1/+1
| | | | | | | | | | Frees the identifier cpu_reset for QOM CPUs (manual rename). Don't hide the parameter type behind explicit casts, use static functions with strongly typed argument to indirect. Signed-off-by: Andreas Färber <afaerber@suse.de> Reviewed-by: Anthony Liguori <aliguori@us.ibm.com>
* Merge remote-tracking branch 'qemu-kvm/memory/core' into stagingAnthony Liguori2012-03-131-8/+0Star
|\ | | | | | | | | | | | | | | | | * qemu-kvm/memory/core: memory: get rid of cpu_register_io_memory() memory: dispatch directly via MemoryRegion exec: fix code tlb entry misused as iotlb in get_page_addr_code() memory: store section indices in iotlb instead of io indices memory: make phys_page_find() return an unadjusted section
| * memory: get rid of cpu_register_io_memory()Avi Kivity2012-03-081-8/+0Star
| | | | | | | | | | | | | | The return value of cpu_register_io_memory() is no longer used anywhere, so we can remove it and all associated data and code. Signed-off-by: Avi Kivity <avi@redhat.com>
* | cpu-all.h: Don't accidentally sign extend in g2h()Peter Maydell2012-03-121-1/+1
|/ | | | | | | | | | | | | | Cast the argument of the g2h() macro to a target_ulong so that it isn't accidentally sign-extended if it is a signed 32 bit type and long is a 64 bit type. In particular, this fixes a bug where it would return the wrong value for 32 bit guests on 64 bit hosts when passed in one of the arg* values from do_syscall() [which are all abi_long and thus signed types]. This could result in spurious failure of mlock(), among others. Reviewed-by: Andreas F=E4rber <afaerber@suse.de> Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* target-i386: Add infrastructure for reporting TPR MMIO accessesJan Kiszka2012-02-181-1/+2
| | | | | | | | | | | | | | | | | This will allow the APIC core to file a TPR access report. Depending on the accelerator and kernel irqchip mode, it will either be delivered right away or queued for later reporting. In TCG mode, we can restart the triggering instruction and can therefore forward the event directly. KVM does not allows us to restart, so we postpone the delivery of events recording in the user space APIC until the current instruction is completed. Note that KVM without in-kernel irqchip will report the address after the instruction that triggered the access. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Avi Kivity <avi@redhat.com>
* Remove IO_MEM_SHIFTAvi Kivity2012-01-041-1/+1
| | | | | | | | | We no longer use any of the lower bits of a ram_addr, so we might as well use them for the io table index. This increases the number of potential I/O handlers by a factor of 8. Signed-off-by: Avi Kivity <avi@redhat.com> Reviewed-by: Richard Henderson <rth@twiddle.net>
* memory: obsolete more dirty memory related functionsAvi Kivity2012-01-041-49/+0Star
| | | | | | | No longer used outside memory.c and exec.c. Reviewed-by: Anthony Liguori <aliguori@us.ibm.com> Signed-off-by: Avi Kivity <avi@redhat.com>
* memory: obsolete cpu_physical_memory_[gs]et_dirty_tracking()Avi Kivity2012-01-041-4/+0Star
| | | | | | | The getter is no longer used, so it is completely removed. Reviewed-by: Anthony Liguori <aliguori@us.ibm.com> Signed-off-by: Avi Kivity <avi@redhat.com>
* Store MemoryRegion in RAMBlockAvi Kivity2012-01-041-0/+1
| | | | | | | | As a step in moving live migration from RAMBlocks to MemoryRegions, store the MemoryRegion in a RAMBlock. Reviewed-by: Anthony Liguori <aliguori@us.ibm.com> Signed-off-by: Avi Kivity <avi@redhat.com>
* memory: remove CPUPhysMemoryClientAvi Kivity2012-01-031-6/+0Star
| | | | | | No longer used. Signed-off-by: Avi Kivity <avi@redhat.com>
* memory: replace cpu_physical_sync_dirty_bitmap() with a memory APIAvi Kivity2011-12-201-3/+0Star
| | | | | | The function is still used as the implementation. Signed-off-by: Avi Kivity <avi@redhat.com>
* Rename get_tls to tls_varJan Kiszka2011-12-061-1/+1
| | | | | | | get_tls() can serve as a lvalue as well, so 'get' might be confusing. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
* fix spelling in main directoryDong Xu Wang2011-12-021-1/+1
| | | | | Signed-off-by: Dong Xu Wang <wdongxu@linux.vnet.ibm.com> Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
* Make cpu_single_env thread-localPaolo Bonzini2011-11-011-1/+3
| | | | | | | | | | | | Make cpu_single_env thread-local. This fixes a regression in handling of multi-threaded programs in linux-user mode (bug 823902). Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> [Peter Maydell: rename tls_cpu_single_env to cpu_single_env] Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Reviewed-by: Andreas Färber <afaerber@suse.de> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* Remove qemu_host_page_bitsStefan Weil2011-09-211-1/+0Star
| | | | | | | | It was introduced with commit 54936004fddc52c321cb3f9a9a51140e782bed5d as host_page_bits but never used. Signed-off-by: Stefan Weil <weil@mail.berlios.de> Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
* fix QLIST usage for RAM listPaolo Bonzini2011-08-121-1/+1
| | | | | | | Spotted while reviewing the migration thread patches. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
* move unaligned memory access functions to bswap.hPaolo Bonzini2011-07-291-445/+1Star
| | | | | | | | This is just code movement, and moving the fpu/ include path from target-dependent to target-independent Make variables. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* exec.h: fix coding style and change cpu_has_work to return boolBlue Swirl2011-06-261-1/+1
| | | | | | | | | Before the next patch, fix coding style of the areas affected. Change the type of the return value from cpu_has_work() and qemu_cpu_has_work() to bool. Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* softfloat: always enable floatx80 and float128 supportAurelien Jarno2011-06-031-2/+0Star
| | | | | | | | Now that softfloat-native is gone, there is no real point on not always enabling floatx80 and float128 support. Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
* softfloat-native: removeAurelien Jarno2011-06-031-4/+1Star
| | | | | | | | Remove softfloat-native support, all targets are now using softfloat instead. Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
* irq: Privatize CPU_INTERRUPT_NMI.Richard Henderson2011-05-081-4/+0Star
| | | | | | | | This interrupt name is used by i386, CRIS, and MicroBlaze. Copy the name into each target. Signed-off-by: Richard Henderson <rth@twiddle.net> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* target-i386: Privatize some i386-specific interrupt names.Richard Henderson2011-05-081-5/+0Star
| | | | | | | SMI, VIRQ, INIT, SIPI, and MCE are all only used by the i386 port. Signed-off-by: Richard Henderson <rth@twiddle.net> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* target-arm: Privatize CPU_INTERRUPT_FIQ.Richard Henderson2011-05-081-1/+0Star
| | | | | | | This interrupt name was only used by the ARM port. Signed-off-by: Richard Henderson <rth@twiddle.net> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* irq: Remove CPU_INTERRUPT_TIMER.Richard Henderson2011-05-081-1/+0Star
| | | | | | | It is no longer used anywhere. Signed-off-by: Richard Henderson <rth@twiddle.net> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* irq: Introduce and use CPU_INTERRUPT_SSTEP_MASK.Richard Henderson2011-05-081-0/+8
| | | | | | | | | | This mask contains all of the bits that should be ignored while single stepping in the debugger. The mask contains 2 bits that are not currently cleared, but are also never set. The bits are included in the mask for consistency in handling of the CPU_INTERRUPT_TGT_EXT_N bits. Signed-off-by: Richard Henderson <rth@twiddle.net> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* irq: Introduce CPU_INTERRUPT_TGT_* defines.Richard Henderson2011-05-081-12/+51
| | | | | | | | | | These defines will be place-holders for cpu-specific functionality. Generic code will, at the end of the patch series, no longer have to concern itself about how SMI, NMI, etc should be handled. Instead, generic code will know only that the interrupt is internal or external. Signed-off-by: Richard Henderson <rth@twiddle.net> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* Redirect cpu_interrupt to callback handlerJan Kiszka2011-05-021-1/+13
| | | | | | | | This allows to override the interrupt handling of QEMU in system mode. KVM will make use of it to set a specialized handler. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
* cpu-all.h: define CPU_LDoubleUAurelien Jarno2011-04-171-0/+10
| | | | | | | | | | | Add a CPU_LDoubleU type, matching the floatx80 definition and the long double type on x86 hosts. Based on a patch from Laurent Vivier <laurent@vivier.eu>. Cc: Laurent Vivier <laurent@vivier.eu> Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>