summaryrefslogtreecommitdiffstats
path: root/cpu-all.h
Commit message (Collapse)AuthorAgeFilesLines
* 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>
* cpu-all.h: fix cpu_get_real_ticks on mips hostArnaud Patard2009-11-241-9/+18
| | | | | | | | | | | | | Fix cpu_get_real_ticks: - check should be done on __mips and not __mips_isa_rev - linux kernels >= 2.6.25 are emulating the 2 needed rdhwr functions so it's safe to use rdhwr. This is better than what's currently in but it doesn't mean it works nicely Some tests needs to be done imho Signed-off-by: Arnaud Patard <arnaud.patard@rtp-net.org> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
* Revert "Get rid of _t suffix"Anthony Liguori2009-10-011-11/+11
| | | | | | | | | | | | In the very least, a change like this requires discussion on the list. The naming convention is goofy and it causes a massive merge problem. Something like this _must_ be presented on the list first so people can provide input and cope with it. This reverts commit 99a0949b720a0936da2052cb9a46db04ffc6db29. Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* Get rid of _t suffixmalc2009-10-011-11/+11
| | | | | | | Some not so obvious bits, slirp and Xen were left alone for the time being. Signed-off-by: malc <av1474@comtv.ru>
* Fix conditional compilation (MIPS host)Stefan Weil2009-09-111-1/+1
| | | | | | | | Compilation for MIPS host (not part of official QEMU) checks __mips_isa_rev which is not always defined. Signed-off-by: Stefan Weil <weil@mail.berlios.de> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* Unbreak large mem support by removing kqemuAnthony Liguori2009-08-241-6/+0
| | | | | | | | | | | | | | | | | | | | | | kqemu introduces a number of restrictions on the i386 target. The worst is that it prevents large memory from working in the default build. Furthermore, kqemu is fundamentally flawed in a number of ways. It relies on the TSC as a time source which will not be reliable on a multiple processor system in userspace. Since most modern processors are multicore, this severely limits the utility of kqemu. kvm is a viable alternative for people looking to accelerate qemu and has the benefit of being supported by the upstream Linux kernel. If someone can implement work arounds to remove the restrictions introduced by kqemu, I'm happy to avoid and/or revert this patch. N.B. kqemu will still function in the 0.11 series but this patch removes it from the 0.12 series. Paul, please Ack or Nack this patch. Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* rename WORDS_BIGENDIAN to HOST_WORDS_BIGENDIANJuan Quintela2009-07-271-6/+6
| | | | | Signed-off-by: Juan Quintela <quintela@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* Userspace guest address offsettingPaul Brook2009-07-171-2/+7
| | | | | | | | | | Re-implement GUEST_BASE support. Offset guest ddress space by default if the guest binary contains regions below the host mmap_min_addr. Implement support for i386, x86-64 and arm hosts. Signed-off-by: Riku Voipio <riku.voipio@iki.fi> Signed-off-by: Paul Brook <paul@codesourcery.com>
* Update to a hopefully more future proof FSF addressBlue Swirl2009-07-161-2/+1
| | | | Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* split out ioport related stuffs from vl.c into ioport.c.Isaku Yamahata2009-07-091-11/+1
| | | | | Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* QEMU: MCE: Add MCE simulation to qemu/tcgHuang Ying2009-07-091-0/+4
| | | | | | | | | | | - MCE features are initialized when VCPU is intialized according to CPUID. - A monitor command "mce" is added to inject a MCE. - A new interrupt mask: CPU_INTERRUPT_MCE is added to inject the MCE. aliguori: fix build for linux-user Signed-off-by: Huang Ying <ying.huang@intel.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* Handle init/sipi in a main cpu exec loop. (v2)Gleb Natapov2009-06-221-0/+2
| | | | | | | | | | | | | This should fix compilation problem in case of CONFIG_USER_ONLY. Currently INIT/SIPI is handled in the context of CPU that sends IPI. This patch changes this to handle them like all other events in a main cpu exec loop. When KVM will gain thread per vcpu capability it will be much more clear to handle those event by cpu thread itself and not modify one cpu's state from the context of the other. Signed-off-by: Gleb Natapov <gleb@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* provide cpu_index to env mappingGlauber Costa2009-06-161-0/+1
| | | | | | | | | There are some people interested in, given a cpu number, pick its CPUState. KVM is an example, although not yet in tree. This patch provides a way of doing that. Signed-off-by: Glauber Costa <glommer@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* linux-user: implemented ELF coredump support for ARM targetMika Westerberg2009-06-161-0/+2
| | | | | | | | | | | | When target process is killed with signal (such signal that should dump core) a coredump file is created. This file is similar than coredump generated by Linux (there are few exceptions though). Riku Voipio: added support for rlimit Signed-off-by: Mika Westerberg <mika.westerberg@iki.fi> Signed-off-by: Riku Voipio <riku.voipio@iki.fi>
* kvm: Rework dirty bitmap synchronizationJan Kiszka2009-05-221-1/+2
| | | | | | | | | Extend kvm_physical_sync_dirty_bitmap() so that is can sync across multiple slots. Useful for updating the whole dirty log during migration. Moreover, properly pass down errors the whole call chain. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* Hardware convenience libraryPaul Brook2009-05-191-84/+1
| | | | | | | | | | | | | | The only target dependency for most hardware is sizeof(target_phys_addr_t). Build these files into a convenience library, and use that instead of building for every target. Remove and poison various target specific macros to avoid bogus target dependencies creeping back in. Big/Little endian is not handled because devices should not know or care about this to start with. Signed-off-by: Paul Brook <paul@codesourcery.com>
* Remove cpu_get_io_memory_{read,write}.Paul Brook2009-04-301-2/+0
| | | | Signed-off-by: Paul Brook <paul@codesourcery.com>
* qemu: per-arch cpu_has_work (Marcelo Tosatti)aliguori2009-04-241-0/+2
| | | | | | | | | | Blue Swirl: fix Sparc32 breakage Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com> git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@7238 c046a42c-6fe2-441c-8c8c-71466251a162
* kqemu: merge CONFIG_KQEMU and USE_KQEMUblueswir12009-04-191-1/+1
| | | | | | | | | | Basically a recursive ":%s/USE_KQEMU/CONFIG_KQEMU/g". Signed-off-by: Paul Bolle <pebolle@tiscali.nl> git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@7189 c046a42c-6fe2-441c-8c8c-71466251a162
* Implement dynamic guest ram allocation.pbrook2009-04-111-2/+1
| | | | | | | Signed-off-by: Paul Brook <paul@codesourcery.com> git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@7088 c046a42c-6fe2-441c-8c8c-71466251a162
* Remove code phys_ram_base uses.pbrook2009-04-111-0/+3
| | | | | | | Signed-off-by: Paul Brook <paul@codesourcery.com> git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@7085 c046a42c-6fe2-441c-8c8c-71466251a162
* Cleanup SPARC/TCX framebuffer allocation.pbrook2009-04-091-0/+2
| | | | | | | Signed-off-by: Paul Brook <paul@codesourcery.com> git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@7059 c046a42c-6fe2-441c-8c8c-71466251a162
OpenPOWER on IntegriCloud