summaryrefslogtreecommitdiffstats
path: root/cpu-all.h
Commit message (Collapse)AuthorAgeFilesLines
* 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/+0
| | | | | | | | 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/+1
| | | | | | | | 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/+0
| | | | | | | | 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/+1
| | | | | | | | 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/+0
| | | | | | | | 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/+0
| | | | | | | 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/+0
| | | | | | | 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/+0
| | | | | | | 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>
* cpu-all.h: Remove unnecessary target-specific ifdef for CPU_QuadUPeter Maydell2011-04-041-3/+2
| | | | | | | | | | | CPU_QuadU isn't used on all targets, but there's no harm in defining the typedef anyway. It only needs to be guarded by CONFIG_SOFTFLOAT, because softfloat-native doesn't have a float128 type. This avoids the need for every new target which uses CPU_QuadU to add itself to an #ifdef in what ought to be target-agnostic code. Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
* s390x: enable CPU_QuadUUlrich Hecht2011-04-041-1/+1
| | | | | | | S390x uses the QuadU type, so let's enable it. Signed-off-by: Ulrich Hecht <uli@suse.de> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
* Add qemu_ram_remapHuang Ying2011-03-151-0/+4
| | | | | | | | | | | | | qemu_ram_remap() unmaps the specified RAM pages, then re-maps these pages again. This is used by KVM HWPoison support to clear HWPoisoned page tables across guest rebooting, so that a new page may be allocated later to recover the memory error. [ Jan: style fixlets, WIN32 fix ] Signed-off-by: Huang Ying <ying.huang@intel.com> Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
* x86: Small cleanups of MCE helpersJan Kiszka2011-03-151-4/+0
| | | | | | | | | | | Fix some code style issues, use proper headers, and align to cpu_x86 naming scheme. No functional changes. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> CC: Huang Ying <ying.huang@intel.com> CC: Hidetoshi Seto <seto.hidetoshi@jp.fujitsu.com> CC: Jin Dongming <jin.dongming@np.css.fujitsu.com> Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
* Introduce log_start/log_stop in CPUPhysMemoryClientAnthony PERARD2011-02-141-0/+6
| | | | | | | | | | | | | | | In order to use log_start/log_stop with Xen as well in the vga code, this two operations have been put in CPUPhysMemoryClient. The two new functions cpu_physical_log_start,cpu_physical_log_stop are used in hw/vga.c and replace the kvm_log_start/stop. With this, vga does no longer depends on kvm header. [ Jan: rebasing and style fixlets ] Signed-off-by: Anthony PERARD <anthony.perard@citrix.com> Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
* x86: Optionally dump code bytes on cpu_dump_stateJan Kiszka2011-01-231-0/+2
| | | | | | | | | | Introduce the cpu_dump_state flag CPU_DUMP_CODE and implement it for x86. This writes out the code bytes around the current instruction pointer. Make use of this feature in KVM to help debugging fatal vm exits. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
* Add "broadcast" option for mce commandJin Dongming2011-01-211-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When the following test case is injected with mce command, maybe user could not get the expected result. DATA command cpu bank status mcg_status addr misc (qemu) mce 1 1 0xbd00000000000000 0x05 0x1234 0x8c Expected Result panic type: "Fatal Machine check" That is because each mce command can only inject the given cpu and could not inject mce interrupt to other cpus. So user will get the following result: panic type: "Fatal machine check on current CPU" "broadcast" option is used for injecting dummy data into other cpus. Injecting mce with this option the expected result could be gotten. Usage: Broadcast[on] command broadcast cpu bank status mcg_status addr misc (qemu) mce -b 1 1 0xbd00000000000000 0x05 0x1234 0x8c Broadcast[off] command cpu bank status mcg_status addr misc (qemu) mce 1 1 0xbd00000000000000 0x05 0x1234 0x8c Signed-off-by: Jin Dongming <jin.dongming@np.css.fujitsu.com> Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
* target-xxx: Use fprintf_function (format checking)Stefan Weil2010-10-301-5/+3
| | | | | | | | | | | | | fprintf_function uses format checking with GCC_FMT_ATTR. Format errors were fixed in * target-i386/helper.c * target-mips/translate.c * target-ppc/translate.c Cc: Blue Swirl <blauwirbel@gmail.com> Signed-off-by: Stefan Weil <weil@mail.berlios.de> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* exec: Use fprintf_function for dump_exec_info (format checking)Stefan Weil2010-10-301-2/+1
| | | | | | | | | | | | | | | fprintf_function uses format checking with GCC_FMT_ATTR. It is declared in qemu-common.h and used in cpu-all.h (which is included from cpu.h), so qemu-common.h must be included earlier. Some redundant include statements for standard include files were removed. Fix also two format errors (ptrdiff_t needs %td). Cc: Blue Swirl <blauwirbel@gmail.com> Signed-off-by: Stefan Weil <weil@mail.berlios.de> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* Replace remaining gcc format attributes by macro GCC_FMT_ATTR (format checking)Stefan Weil2010-10-221-1/+1
| | | | | | | | | | | | | Replace the remaining format attribute printf by macro GCC_FMT_ATTR which uses gnu_printf (if supported). v2 * Removal of dyngen specific code is now done in a separate patch. * Handle attribute in new ui/spice-display.c, too. Cc: Blue Swirl <blauwirbel@gmail.com> Signed-off-by: Stefan Weil <weil@mail.berlios.de> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* linux-user: fix build on hosts not using guest baseAurelien Jarno2010-07-301-0/+2
| | | | | | | | Commit 68a1c816868b3e35a1da698af412b29e61b1948a broke qemu on hosts not using guest base. It uses reserved_va unconditionally in mmap.c. To avoid to many #ifdef #endif blocks, define RESERVED_VA as either reserved_va or 0ul, and use it instead of reserved_va, similarly to what has been done with guest_base/GUEST_BASE.
* qemu_ram_free: Implement itAlex Williamson2010-07-061-0/+3
| | | | | | | | Now that we can support a ram_addr_t space with holes, we can implement qemu_ram_free(). Signed-off-by: Alex Williamson <alex.williamson@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* ramblocks: Make use of DeviceState pointer and BusInfo.get_dev_pathAlex Williamson2010-07-061-0/+1
| | | | | | | | | | | | | With these two pieces in place, we can start naming ramblocks. When the device is present and it lives on a bus that provides a device path, we concatenate the path and the provided name. Otherwise we just use name. The resulting id string must be unique. For now we assume an allocation for the same name and size is a device that has been removed and reinserted and return the same block. This will go away once qemu_ram_free() is implemented. Signed-off-by: Alex Williamson <alex.williamson@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* Remove uses of ram.last_offset (aka last_ram_offset)Alex Williamson2010-07-061-1/+0
| | | | | | | | | We currently need this either to allocate the next ram_addr_t for a new block, or for total memory to be migrated. Both of which we can calculate without need of this to keep us in a contiguous address space. Signed-off-by: Alex Williamson <alex.williamson@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* ram_blocks: Convert to a QLISTAlex Williamson2010-06-141-8/+20
| | | | | | | | | This makes the RAM block list easier to manipulate. Also incorporate relevant variables into the RAMList struct. Signed-off-by: Alex Williamson <alex.williamson@redhat.com> Acked-by: Chris Wright <chrisw@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* Pre-allocate guest address spacePaul Brook2010-05-291-0/+1
| | | | | | Allow pre-allocation of the guest virtual address space in usermode emulation. Signed-off-by: Paul Brook <paul@codesourcery.com>
* add cpu_is_stopped helperMarcelo Tosatti2010-05-111-0/+1
| | | | | Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com> Signed-off-by: Avi Kivity <avi@redhat.com>
* port qemu-kvm's on_vcpu codeMarcelo Tosatti2010-05-111-0/+1
| | | | | | | run_on_cpu allows to execute work on a given CPUState context. Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com> Signed-off-by: Avi Kivity <avi@redhat.com>
* Remove PAGE_RESERVEDPaul Brook2010-05-051-0/+3
| | | | | | | | | The usermode PAGE_RESERVED code is not required by the current mmap implementation, and is already broken when guest_base != 0. Unfortunately the bsd emulation still uses the old mmap implementation, so we can't rip it out altogether. Signed-off-by: Paul Brook <paul@codesourcery.com>
* Fix --enable-profiler compilation.Richard Henderson2010-04-171-12/+0
| | | | | | | | | There's a header file inclusion ordering problem between cpu-all.h and qemu-timer.h, such that cpu_get_real_ticks is not defined when we attempt to use it in profile_getclock. Signed-off-by: Richard Henderson <rth@twiddle.net> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* Introduce wrapper functions to access phys_ram_dirty.Yoshiaki Tamura2010-04-081-0/+26
| | | | | | | | | Adds wrapper functions to prevent direct access to the phys_ram_dirty bitmap. Signed-off-by: Yoshiaki Tamura <tamura.yoshiaki@lab.ntt.co.jp> Signed-off-by: OHMURA Kei <ohmura.kei@lab.ntt.co.jp> Reviewed-by: Avi Kivity <avi@redhat.com> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
* Compile qemu-timer only onceBlue Swirl2010-03-291-147/+0
| | | | | | | | | Arrange various declarations so that also non-CPU code can access them, adjust users. Move CPU specific code to cpus.c. Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* Move cpu_exec_init_all() declaration to qemu-common.hBlue Swirl2010-03-291-1/+0
| | | | | | Let cpu_exec_init_all() be called from non-CPU code. Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* Compile pci only onceBlue Swirl2010-03-211-12/+0
| | | | | | Move coalesced_mmio declarations to a more accessible location. Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* split out qemu-timer.cPaolo Bonzini2010-03-171-0/+2
| | | | | Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* Fix usermode virtual address typePaul Brook2010-03-121-2/+4
| | | | | | Usermode virtual addresses are abi_ulong, not target_ulong. Signed-off-by: Paul Brook <paul@codesourcery.com>
* Remove cpu_get_phys_page_debug from userspace emulationPaul Brook2010-03-121-5/+5
| | | | | | cpu_get_phys_page_debug makes no sense for userspace emulation, so remove it. Signed-off-by: Paul Brook <paul@codesourcery.com>
* Disable phsyical memory handling in userspace emulation.Paul Brook2010-03-121-3/+7
| | | | | | | Code to handle physical memory access is not meaningful in usrmode emulation, so disable it. Signed-off-by: Paul Brook <paul@codesourcery.com>
* Implement multi-level page tables.Richard Henderson2010-03-121-2/+5
| | | | | | | | | | | | | Define L1_MAP_ADDR_SPACE_BITS to be either the virtual address size (in user mode) or physical address size (in system mode), and use that to size l1_map. This rewrites page_find_alloc, page_flush_tb, and walk_memory_regions. Use TARGET_PHYS_ADDR_SPACE_BITS for the physical memory map based off of l1_phys_map. This rewrites page_phys_find_alloc and phys_page_for_each. Signed-off-by: Richard Henderson <rth@twiddle.net>
* Use TARGET_VIRT_ADDR_SPACE_BITS in h2g_valid.Richard Henderson2010-03-121-5/+11
| | | | | | | | Previously, only 32-bit guests had a proper check for the validity of the virtual address. Extend that check to 64-bit guests with a restricted virtual address space. Signed-off-by: Richard Henderson <rth@twiddle.net>
* Add option to use file backed guest memoryMarcelo Tosatti2010-03-041-0/+3
| | | | | | | | Port qemu-kvm's -mem-path and -mem-prealloc options. These are useful for backing guest memory with huge pages via hugetlbfs. Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com> CC: john cooper <john.cooper@redhat.com>
* Move ioport.h out of cpu-all.hPaul Brook2010-03-011-3/+0
| | | | | | Only include ioport.h where it is actually needed. Signed-off-by: Paul Brook <paul@codesourcery.com>
* kvm: Flush coalesced MMIO buffer periodlySheng Yang2010-02-031-0/+2
| | | | | | | | | | | | | | | | | | | | | | The default action of coalesced MMIO is, cache the writing in buffer, until: 1. The buffer is full. 2. Or the exit to QEmu due to other reasons. But this would result in a very late writing in some condition. 1. The each time write to MMIO content is small. 2. The writing interval is big. 3. No need for input or accessing other devices frequently. This issue was observed in a experimental embbed system. The test image simply print "test" every 1 seconds. The output in QEmu meets expectation, but the output in KVM is delayed for seconds. Per Avi's suggestion, I hooked flushing coalesced MMIO buffer in VGA update handler. By this way, We don't need vcpu explicit exit to QEmu to handle this issue. Signed-off-by: Sheng Yang <sheng@linux.intel.com> Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
* cpu-all.h: fix cpu_get_real_ticks() #ifdefAurelien Jarno2009-12-201-1/+2
| | | | | | Reported-by: Hervé Poussineau <hpoussin@reactos.org> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
OpenPOWER on IntegriCloud