History | View | Annotate | Download (15.6 kB)
Remove unused CONFIG_TCG_PASS_AREG0 and dead code
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 byhw/spapr_hcall.c, it does not seem to use it....
x86: switch to AREG0 free mode
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 pages
Calculate the number of dirty pages takes a lot on hosts with lotsof 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 mode
Add an explicit CPUPPCState parameter instead of relying on AREG0and rename op_helper.c (which only contains load and store helpers)to mem_helper.c. Remove AREG0 swapping intlb_fill().
Switch to AREG0 free mode. Use cpu_ld{l,uw}_code in translation...
qemu-log: move logging to qemu-log.c
Move logging functions from exec.c to qemu-log.c,compile it only once.
dump: remove dumping stuff from cpu-all.h
This simplifies things, because they will only be included for softmmutargets 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_t
So that it can use the same prototype in both cases.
Merge remote-tracking branch 'qmp/queue/qmp' into staging
Kill off cpu_state_reset()
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...
target-i386: Add API to write elf notes to core file
The core file contains register's value. These APIs write registers tocore 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>
target-i386: Add API to write cpu status to core file
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 informationfrom vmcore. If you change QEMUCPUState, please count up QEMUCPUSTATE_VERSION....
target-i386: add API to get dump info
Dump info contains: endian, class and architecture. The nextpatch will use these information to create vmcore. Note: onx86 box, the class is ELFCLASS64 if the memory is larger than 4G.
Signed-off-by: Wen Congyang <wency@cn.fujitsu.com>...
target-i386: Add API to get note's size
We should know where the note and memory is stored before writingthem to vmcore. If we know this, we can avoid using lseek() whencreating vmcore.
implement cpu_get_memory_mapping()
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....
Add API to check whether paging mode is enabled
This API will be used in the following patch.
exec: prepare for splitting
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() andmemory_region_is_unassigned().
Remove unused cpu_tlb_update_dirty()....
w64: Fix type casts used in some macros in cpu-all.h
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>
w64: Fix data types in cpu-all.h, exec.c
w64 needs uintptr_t instead of unsigned long.For other hosts, nothing changes.
linux-user: take RESERVED_VA into account for g2h_valid()
When running with -R (RESERVED_VA > 0) all guest virtual addressesare within the [0..RESERVED_VA] range. Reflect this with g2h_valid()too so we can safely check for boundaries of our guest address space....
softmmu templates: optionally pass CPUState to memory access functions
Optionally, make memory access helpers take a parameter for CPUStateinstead 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...
Rename CPUState -> CPUArchState
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...
Rename cpu_reset() to cpu_state_reset()
Frees the identifier cpu_reset for QOM CPUs (manual rename).
Don't hide the parameter type behind explicit casts, use staticfunctions with strongly typed argument to indirect.
Signed-off-by: Andreas Färber <afaerber@suse.de>...
Merge remote-tracking branch 'qemu-kvm/memory/core' into staging
cpu-all.h: Don't accidentally sign extend in g2h()
Cast the argument of the g2h() macro to a target_ulong so thatit isn't accidentally sign-extended if it is a signed 32 bittype and long is a 64 bit type. In particular, this fixes abug where it would return the wrong value for 32 bit guests...
memory: get rid of cpu_register_io_memory()
The return value of cpu_register_io_memory() is no longer used anywhere, sowe can remove it and all associated data and code.
Signed-off-by: Avi Kivity <avi@redhat.com>
target-i386: Add infrastructure for reporting TPR MMIO accesses
This will allow the APIC core to file a TPR access report. Depending onthe accelerator and kernel irqchip mode, it will either be deliveredright away or queued for later reporting.
In TCG mode, we can restart the triggering instruction and can therefore...
Remove IO_MEM_SHIFT
We no longer use any of the lower bits of a ram_addr, so we might as welluse them for the io table index. This increases the number of potentialI/O handlers by a factor of 8.
Signed-off-by: Avi Kivity <avi@redhat.com>Reviewed-by: Richard Henderson <rth@twiddle.net>
memory: obsolete cpu_physical_memory_[gs]et_dirty_tracking()
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>
memory: obsolete more dirty memory related functions
No longer used outside memory.c and exec.c.
Store MemoryRegion in RAMBlock
As a step in moving live migration from RAMBlocks to MemoryRegions,store the MemoryRegion in a RAMBlock.
memory: remove CPUPhysMemoryClient
No longer used.
memory: replace cpu_physical_sync_dirty_bitmap() with a memory API
The function is still used as the implementation.
Rename get_tls to tls_var
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 directory
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-local
Make cpu_single_env thread-local. This fixes a regressionin 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]...
Remove qemu_host_page_bits
It was introduced with commit 54936004fddc52c321cb3f9a9a51140e782bed5das 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 list
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.h
This is just code movement, and moving the fpu/ include path fromtarget-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 bool
Before the next patch, fix coding style of the areas affected.
Change the type of the return value from cpu_has_work() andqemu_cpu_has_work() to bool.
softfloat-native: remove
Remove softfloat-native support, all targets are now using softfloatinstead.
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
softfloat: always enable floatx80 and float128 support
Now that softfloat-native is gone, there is no real point on not alwaysenabling floatx80 and float128 support.
irq: Privatize CPU_INTERRUPT_NMI.
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>
irq: Introduce CPU_INTERRUPT_TGT_* defines.
These defines will be place-holders for cpu-specific functionality.Generic code will, at the end of the patch series, no longer have toconcern itself about how SMI, NMI, etc should be handled. Instead,generic code will know only that the interrupt is internal or external....
irq: Introduce and use CPU_INTERRUPT_SSTEP_MASK.
This mask contains all of the bits that should be ignored while singlestepping in the debugger. The mask contains 2 bits that are not currentlycleared, but are also never set. The bits are included in the mask for...
irq: Remove CPU_INTERRUPT_TIMER.
It is no longer used anywhere.
target-arm: Privatize CPU_INTERRUPT_FIQ.
This interrupt name was only used by the ARM port.
target-i386: Privatize some i386-specific interrupt names.
SMI, VIRQ, INIT, SIPI, and MCE are all only used by the i386 port.
Redirect cpu_interrupt to callback handler
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_LDoubleU
Add a CPU_LDoubleU type, matching the floatx80 definition and the longdouble 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>...
cpu-all.h: Remove unnecessary target-specific ifdef for CPU_QuadU
CPU_QuadU isn't used on all targets, but there's no harm in defining thetypedef anyway. It only needs to be guarded by CONFIG_SOFTFLOAT, becausesoftfloat-native doesn't have a float128 type. This avoids the need for...
s390x: enable CPU_QuadU
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_remap
qemu_ram_remap() unmaps the specified RAM pages, then re-maps thesepages again. This is used by KVM HWPoison support to clear HWPoisonedpage tables across guest rebooting, so that a new page may beallocated later to recover the memory error....
x86: Small cleanups of MCE helpers
Fix some code style issues, use proper headers, and align to cpu_x86naming 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>...
Introduce log_start/log_stop in CPUPhysMemoryClient
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 areused in hw/vga.c and replace the kvm_log_start/stop. With this, vga does...
x86: Optionally dump code bytes on cpu_dump_state
Introduce the cpu_dump_state flag CPU_DUMP_CODE and implement it forx86. This writes out the code bytes around the current instructionpointer. Make use of this feature in KVM to help debugging fatal vmexits....
Add "broadcast" option for mce command
When the following test case is injected with mce command, maybe user could notget the expected result. DATA command cpu bank status mcg_status addr misc (qemu) mce 1 1 0xbd00000000000000 0x05 0x1234 0x8c...
exec: Use fprintf_function for dump_exec_info (format checking)
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 mustbe included earlier. Some redundant include statements...
target-xxx: Use fprintf_function (format checking)
Cc: Blue Swirl <blauwirbel@gmail.com>Signed-off-by: Stefan Weil <weil@mail.berlios.de>...
Replace remaining gcc format attributes by macro GCC_FMT_ATTR (format checking)
Replace the remaining format attribute printf by macroGCC_FMT_ATTR which uses gnu_printf (if supported).
linux-user: fix build on hosts not using guest base
Commit 68a1c816868b3e35a1da698af412b29e61b1948a broke qemu on hosts notusing guest base. It uses reserved_va unconditionally in mmap.c. Toavoid to many #ifdef #endif blocks, define RESERVED_VA as either...
ramblocks: Make use of DeviceState pointer and BusInfo.get_dev_path
With these two pieces in place, we can start naming ramblocks. Whenthe device is present and it lives on a bus that provides a devicepath, we concatenate the path and the provided name. Otherwise we...
qemu_ram_free: Implement it
Now that we can support a ram_addr_t space with holes, we can implementqemu_ram_free().
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)
We currently need this either to allocate the next ram_addr_t for anew block, or for total memory to be migrated. Both of which we cancalculate without need of this to keep us in a contiguous address space....
ram_blocks: Convert to a QLIST
This makes the RAM block list easier to manipulate. Also incorporaterelevant 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 space
Allow pre-allocation of the guest virtual address space in usermode emulation.
Signed-off-by: Paul Brook <paul@codesourcery.com>
port qemu-kvm's on_vcpu code
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>
add cpu_is_stopped helper
Remove PAGE_RESERVED
The usermode PAGE_RESERVED code is not required by the current mmapimplementation, 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....
Fix --enable-profiler compilation.
There's a header file inclusion ordering problem between cpu-all.hand qemu-timer.h, such that cpu_get_real_ticks is not defined whenwe attempt to use it in profile_getclock.
Signed-off-by: Richard Henderson <rth@twiddle.net>...
Introduce wrapper functions to access phys_ram_dirty.
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>...
Compile qemu-timer only once
Arrange various declarations so that also non-CPU code can accessthem, adjust users.
Move CPU specific code to cpus.c.
Move cpu_exec_init_all() declaration to qemu-common.h
Let cpu_exec_init_all() be called from non-CPU code.
Compile pci only once
Move coalesced_mmio declarations to a more accessible location.
split out qemu-timer.c
Fix usermode virtual address type
Usermode virtual addresses are abi_ulong, not target_ulong.
Disable phsyical memory handling in userspace emulation.
Code to handle physical memory access is not meaningful in usrmode emulation,so disable it.
Remove cpu_get_phys_page_debug from userspace emulation
cpu_get_phys_page_debug makes no sense for userspace emulation, so remove it.
Implement multi-level page tables.
Define L1_MAP_ADDR_SPACE_BITS to be either the virtual address size(in user mode) or physical address size (in system mode), and usethat to size l1_map. This rewrites page_find_alloc, page_flush_tb,and walk_memory_regions....
Use TARGET_VIRT_ADDR_SPACE_BITS in h2g_valid.
Previously, only 32-bit guests had a proper check for thevalidity of the virtual address. Extend that check to 64-bitguests with a restricted virtual address space.
Signed-off-by: Richard Henderson <rth@twiddle.net>
Add option to use file backed guest memory
Port qemu-kvm's -mem-path and -mem-prealloc options. These are usefulfor 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.h
Only include ioport.h where it is actually needed.
kvm: Flush coalesced MMIO buffer periodly
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....
cpu-all.h: fix cpu_get_real_ticks() #ifdef
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 host
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...
Revert "Get rid of _t suffix"
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. Somethinglike this must be presented on the list first so people can provide input...
Get rid of _t suffix
Some not so obvious bits, slirp and Xen were left alone for the timebeing.
Signed-off-by: malc <av1474@comtv.ru>
Fix conditional compilation (MIPS host)
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 kqemu
kqemu introduces a number of restrictions on the i386 target. The worst is thatit prevents large memory from working in the default build.
Furthermore, kqemu is fundamentally flawed in a number of ways. It relies on...
rename WORDS_BIGENDIAN to HOST_WORDS_BIGENDIAN
Signed-off-by: Juan Quintela <quintela@redhat.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Userspace guest address offsetting
Re-implement GUEST_BASE support.Offset guest ddress space by default if the guest binary containsregions below the host mmap_min_addr.Implement support for i386, x86-64 and arm hosts.
Signed-off-by: Riku Voipio <riku.voipio@iki.fi>...
Update to a hopefully more future proof FSF address
split out ioport related stuffs from vl.c into ioport.c.
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/tcg
- 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...
Handle init/sipi in a main cpu exec loop. (v2)
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 maincpu exec loop. When KVM will gain thread per vcpu capability it will...
provide cpu_index to env mapping
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 target
When target process is killed with signal (such signal thatshould dump core) a coredump file is created. This file issimilar than coredump generated by Linux (there are few exceptionsthough)....
kvm: Rework dirty bitmap synchronization
Extend kvm_physical_sync_dirty_bitmap() so that is can sync acrossmultiple slots. Useful for updating the whole dirty log duringmigration. Moreover, properly pass down errors the whole call chain.
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>...
Hardware convenience library
The only target dependency for most hardware is sizeof(target_phys_addr_t).Build these files into a convenience library, and use that instead ofbuilding for every target.
Remove and poison various target specific macros to avoid bogus target...
Remove cpu_get_io_memory_{read,write}.
qemu: per-arch cpu_has_work (Marcelo Tosatti)
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