History | View | Annotate | Download (119.4 kB)
tcg: Initialize the prologue after GUEST_BASE is fixed.
This will allow backends to make intelligent choices about howto implement GUEST_BASE.
Signed-off-by: Richard Henderson <rth@twiddle.net>Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
Fix -mem-path with hugetlbfs
Fallback to qemu_vmalloc in case file_ram_alloc fails.
Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>Signed-off-by: Avi Kivity <avi@redhat.com>
Fill in unassigned mem read/write callbacks.
Implement the "functions may be omitted with NULL pointer" interface mentioned in the function block comment by transformingNULL entries in the read/write arrays into calls to theunassigned_mem family of functions....
qemu: address todo comment in exec.c
exec.c has a comment 'XXX: optimize' for lduw_phys/stw_phys,so let's do it, along the lines of stl_phys.
The reason to address 16 bit accesses specifically is that virtio relieson these accesses to be done atomically, using memset as we do now...
Fix zero-length write(2).
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....
Remove IO_MEM_SUBWIDTH.
Greatly simplify the subpage implementation by not supportingmultiple devices at the same address at different widths. Wedon't need full copies of mem_read/mem_write/opaque for eachaddress, only a single index back into the main io_mem_* arrays....
Cleanup dead code
This patch removes some dead code in exec.c
Signed-off-by: Jun Koi <junkoi2004@gmail.com>Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
Revert "Avoid page_set_flags() assert in qemu-user host page protection code"
This reverts commit 01c0bef1625d8e5d6d5c6abaf413214d667615ad.
(breaks build on 32-bit hosts)
Avoid page_set_flags() assert in qemu-user host page protection code
V2 that uses endaddr = end-of-guest-address-space if !h2g_valid(endaddr)after I found out that indeed works; and also disables the FreeBSD 6.x/compat/linux/proc/self/maps fallback because it can return partial lines...
Replace direct phys_ram_dirty access with wrapper functions.
Replaces direct phys_ram_dirty access with wrapper functions to preventdirect 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>...
Split TLB addend and target_phys_addr_t
Historically the qemu tlb "addend" field was used for both RAM and IO accesses,so needed to be able to hold both host addresses (unsigned long) and guestphysical addresses (target_phys_addr_t). However since the introduction of...
linux-user: fix page_unprotect when host page size > target page size
When the host page size is bigger that the target one, unprotecting apage should:- mark all the target pages corresponding to the host page as writable- invalidate all tb corresponding to the host page (and not the target...
tcg: align static_code_gen_buffer to CODE_GEN_ALIGN
On ia64, the default memory alignement is not enough for a codealignement. To fix that, force static_code_gen_buffer alignmentto CODE_GEN_ALIGN.
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
Get bsd-user host page protection code working on FreeBSD hosts
Use kinfo_getvmmap(3) on FeeBSD >= 7.x and /compat/linux/proc on olderFreeBSD. (kinfo_getvmmap is preferred since /compat/linux/proc isusually only mounted on hosts also using the Linuxolator.)...
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.
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
exec: remove dead code
be more specific in -mem-path error messages
Signed-Off-By: Michael Tokarev <mjt@tls.msk.ru>Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
Large page TLB flush
QEMU uses a fixed page size for the CPU TLB. If the guest uses largepages then we effectively split these into multiple smaller pages, andpopulate the corresponding TLB entries on demand.
When the guest invalidates the TLB by virtual address we must invalidate...
Fix pagetable code
The multi-level pagetable code fails to iterate ove all entries becauseof the L2_BITS v.s. L2_SIZE thinko.
Signed-off-by: Paul Brook <paul@codesourcery.com>
Fix more wrong usermode virtual address types
Fixes warning: CC sparc-bsd-user/exec.o/src/qemu/exec.c: In function `page_check_range':/src/qemu/exec.c:2375: warning: comparison is always true due to limited range of data type
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.
Add tb_page_addr_t
The page tracking code in exec.c is used by both userspace and systememulation. Userspace emulation uses it to track virtual pages, andsystem emulation to track ram pages. Introduce a new type to hold thiskind of address.
Fix last page errors in page_check_range and page_set_flags.
The addr < end comparison prevents iterating over the lastpage in the guest address space; an iteration based onlength avoids this problem.
At the same time, assert that the given address is in the...
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....
Move TARGET_PHYS_ADDR_SPACE_BITS to target-*/cpu.h.
Removes a set of ifdefs from exec.c.
Introduce TARGET_VIRT_ADDR_SPACE_BITS for all targets otherthan Alpha. This will be used for page_find_alloc, which issupposed to be using virtual addresses in the first place....
KVM: Rework VCPU state writeback API
This grand cleanup drops all reset and vmsave/load relatedsynchronization points in favor of four(!) generic hooks:
- cpu_synchronize_all_states in qemu_savevm_state_complete (initial sync from kernel before vmsave)...
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>
Avoid tlb_set_page in userspace emulation
tlb_set_page isn't meaningful for userspace emulation, so remove it.
Move subpage definitions
Move definitions for subpage handling into !CONFIG_USER_ONLY code.
Remove bogus cpu_physical_memory_rw
Userspace doesn't have physical memory, so cpu_physical_memory_rwmakes no sense. This is only used to implement cpu_memory_rw_debug, sojust implement that directly instead.
Remove l1_phys_map from userspace emulation
Userspace emulation doesn't have a physical address space, sol1_phys_map makes no sense. This code is never actually used, so don'ttry and build it.
Fix userspace breakpoint invalidation
Remove bogus virtual->physical address translation inbreakpoint_invalidate for userspace emulation.
qemu: memory notifiers
This adds notifiers for phys memory changes: a set of callbacks thatvhost can register and update kernel accordingly. Down the road, kvmcode can be switched to use these as well, instead of calling kvm codedirectly from exec.c as is done now....
kvm: move kvm to use memory notifiers
remove direct kvm calls from exec.c, makekvm use memory notifiers framework instead.
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>Acked-by: Avi Kivity <avi@redhat.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Merge remote branch 'qemu-kvm/uq/master' into staging-tmp
fix locking error with current_tb
Signed-off-by: Riku Voipio <riku.voipio@nokia.com>
linux-user: remove signal handler before calling abort()
Qemu may hang in host_signal_handler after qemu has done aseppuku with cpu_abort(). But at this stage we are not reallyinterested in target process coredump anymore, so unregisterhost_signal_handler to die grafefully....
exec.c: dead assignments
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
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....
win32: pair qemu_memalign() with qemu_vfree()
Win32 suffers from a very big memory leak when dealing with SCSI devices.Each read/write request allocates memory with qemu_memalign (ieVirtualAlloc) but frees it with qemu_free (ie free).Pair all qemu_memalign() calls with qemu_vfree() to prevent such leaks....
linux-user: enable tb unlinking when compiled with NPTL
Fixes receiving signals when guest code is being executed in a tightloop. For an example, try interrupting the following code with ctrl-c.
http://nchipin.kos.to/test-loop.c
The tight loop is ofcourse brainless, but it is also exactly how the waitpid* testcases...
Fix win32 log file location
/tmp doesn't exist under win32. Ease the pain of win32 development slightly.
From: Juha Riihimäki <juha.riihimaki@nokia.com>Signed-off-by: Riku Voipio <riku.voipio@nokia.com>Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
Give a error when running out of iomem areas.
The limit of iomem areas is quite low. Without thedebug print, it is quite hard to figure out why moredevices are not getting registered.
Signed-off-by: Riku Voipio <riku.voipio@nokia.com>Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
Allocate physical memory in low virtual address space
KVM on S390x requires the virtual address space of the guest's RAM to bewithin the first 256GB.
The general direction I'd like to see KVM on S390 move is that this requirementis losened, but for now that's what we're stuck with....
Add support for GNU/kFreeBSD
ksm support
Call MADV_MERGEABLE on guest memory allocations. MADV_MERGABLE will beavailable starting in Linux 2.6.32. This system call registers a region ofvirtual address space with Linux as a candidate for transparent memorysharing.
Patchworks-ID: 35447...
fix comment on cpu_register_physical_memory_offset
We don't require full pages in cpu_register_physical_memory,except for RAM.
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
vmstate: remove const from pre_save() functions
Signed-off-by: Juan Quintela <quintela@redhat.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
vmstate: add version_id argument to post_load
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 sys-queue.h conflict for good
Problem: Our file sys-queue.h is a copy of the BSD file, but there aresome additions and it's not entirely compatible. Because of that, there havebeen conflicts with system headers on BSD systems. Some hacks have beenintroduced in the commits 15cc9235840a22c289edbe064a9b3c19c5f49896,...
vmstate: port cpu_comon
microblaze: Trap on bus accesses to unmapped areas.
Signed-off-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>
kvm: Simplify cpu_synchronize_state()
cpu_synchronize_state() is a little unreadable since the 'modified'argument isn't self-explanatory. Simplify it by making it alwayssynchronize the kernel state into qemu, and automatically flush theregisters back to the kernel if they've been synchronized on this...
Make CPURead/WriteFunc structure 'const'
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...
Fix Sparse warnings: "Using plain integer as NULL pointer"
rename USE_NPTL to CONFIG_USE_NPTL
Remove setvbuf(<handle>, NULL, _IOLBF, 0) calls for Win32
On Win32 the setvbuf function requires the last parameter to be size between 2 and INT_MAX bytes, so the calls always failed. Since the whole point of the calls is to set line-buffered mode for the file handle and that's not supported on Win32 anyway, conditionally remove them....
Fix most warnings (errors with -Werror) when debugging is enabled
I used the following command to enable debugging:perl -p -i -e 's/^\/\/#define DEBUG/#define DEBUG/g' * /* *//*
tlb flush cleanup
Use static empty variable s_cputlb_empty_entry to clear entries,also reset addend member when clearing entries.This helps running with valgrind/memcheck
Signed-off-by: igor.v.kovalenko@gmail.com
--Kind regards,Igor V. KovalenkoSigned-off-by: Anthony Liguori <aliguori@us.ibm.com>
Update to a hopefully more future proof FSF address
cpu_unregister_map_client: fix memory leak.
fix memory leak in cpu_unregister_map_client() and cpu_notify_map_clients().
Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Win32: Reduce section alignment for Windows.
Maximum alignment for Win32 is 16, so don't tryto set it to 32. Otherwise the compiler complains:
exec.c:102: warning: alignment of 'code_gen_prologue'is greater than maximum object file alignment. Using 16...
exec.c: remove unnecessary #if NB_MMU_MODES
remove unnecessary #if NB_MMU_MODES by using loop.
Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>Acked-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
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>
Rearrange io_mem_init()
Move io_mem_init() downwards to avoid a forward declaration. No code change.
Signed-off-by: Avi Kivity <avi@redhat.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Remove io_index argument from cpu_register_io_memory()
The parameter is always zero except when registering the three internalio regions (ROM, unassigned, notdirty). Remove the parameter to reducethe API's power, thus facilitating future change.
Signed-off-by: Avi Kivity <avi@redhat.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)....
fix gdbstub support for multiple threads in usermode, v3
When debugging multi-threaded programs, QEMU's gdb stub would report thecorrect number of threads (the qfThreadInfo and qsThreadInfo packets).However, the stub was unable to actually switch between threads (the T...
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>...
kvm: Add missing bits to support live migration
This patch adds the missing hooks to allow live migration in KVM mode.It adds proper synchronization before/after saving/restoring the VCPUstates (note: PPC is untested), hooks intocpu_physical_memory_set_dirty_tracking() to enable dirty memory logging...
Fix typos in comments in exec.c
This patch fixes several typos in comments in exec.c:
longet -> longer recommanded -> recommended ajustments -> adjustments inconsistancies -> inconsistencies phsical -> physical positionned -> positioned...
kvm: Avoid COW if KVM MMU is asynchronous
Avi Kivity wrote:
Suggest wrapping in a function and hiding it deep inside kvm-all.c.
Done in v2:
---------->
If the KVM MMU is asynchronous (kernel does not support MMU_NOTIFIER),we have to avoid COW for the guest memory. Otherwise we risk serious...
Remove cpu_get_io_memory_{read,write}.
qemu: introduce qemu_cpu_kick (Marcelo Tosatti)
To notify cpu of pending interrupt.
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@7243 c046a42c-6fe2-441c-8c8c-71466251a162
added -numa cmdline parameter parser (Andre Przywara)
adds a -numa command line parameter and sets a QEMU global array withthe memory sizes. The CPU-to-node assignemnt is written into theCPUState. If no specific values for memory and CPUs are given,all resources will be split equally across all nodes....
kqemu: merge CONFIG_KQEMU and USE_KQEMU
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.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@7088 c046a42c-6fe2-441c-8c8c-71466251a162
Remove code phys_ram_base uses.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@7085 c046a42c-6fe2-441c-8c8c-71466251a162
Cleanup SPARC/TCX framebuffer allocation.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@7059 c046a42c-6fe2-441c-8c8c-71466251a162
Allow 5 mmu indexes.
This is necessary for alpha because it has 4 protection levels and pal mode.
Signed-off-by: Tristan Gingold <gingold@adacore.com>Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@7028 c046a42c-6fe2-441c-8c8c-71466251a162
Fix some win32 compile warnings
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6984 c046a42c-6fe2-441c-8c8c-71466251a162
ROM write access for debugging (Jan Kiszka)
Enhance cpu_memory_rw_debug so that it can write even to ROM regions.This allows to modify ROM via gdb (I see no point in denying this to theuser), and it will enable us to drop kvm_patch_opcode_byte().
Credits go to Avi for suggesting this....
Delete some unused macros detected with -Wp,-Wunused-macros use
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6856 c046a42c-6fe2-441c-8c8c-71466251a162
Guest debugging support for KVM (Jan Kiszka)
This is a backport of the guest debugging support for the KVMaccelerator that is now part of the KVM tree. It implements the reworkedKVM kernel API for guest debugging (KVM_CAP_SET_GUEST_DEBUG) which isnot yet part of any mainline kernel but will probably be 2.6.30 stuff....
Use a dedicated function to request exit from execution loop
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6762 c046a42c-6fe2-441c-8c8c-71466251a162
Clear CPU_INTERRUPT_EXIT on VM load
CPU_INTERRUPT_EXIT is not set anymore in env->interrupt_request sincerevision 6728. Make sure the bit is cleared on VM load.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6756 c046a42c-6fe2-441c-8c8c-71466251a162
Support for DragonFly BSD (Hasso Tepper)
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6746 c046a42c-6fe2-441c-8c8c-71466251a162
Sparse fixes: NULL use, header order, ANSI prototypes, static
Fix Sparse warnings: * use NULL instead of plain 0 * rearrange header include order to avoid redefining types accidentally * ANSIfy SLIRP * avoid "restrict" keyword * add static
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6736 c046a42c-6fe2-441c-8c8c-71466251a162
The _exit syscall is used for both thread termination in NPTL applications,and process termination in legacy applications. Try to guess which we wantbased on the presence of multiple threads.
Also implement locking when modifying the CPU list.
Signed-off-by: Paul Brook <paul@codesourcery.com>...
Fix race condition on access to env->interrupt_request
env->interrupt_request is accessed as the bit level from both main codeand signal handler, making a race condition possible even on CISC CPU.This causes freeze of QEMU under high load when running the dyntick...
Fix unassigned region offsets.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6639 c046a42c-6fe2-441c-8c8c-71466251a162
Fix cpu_physical_memory_rw() for 64-bit I/O accesses
KVM uses cpu_physical_memory_rw() to access the I/O devices. When aread or write with a length of 8-byte is requested, it is split into 24-byte accesses.
This has been broken in revision 5849. After this revision, only the...
qemu: add cpu_unregister_io_memory and make io mem table index dynamic (Marcelo Tosatti)
So drivers can clear their mem io table entries on exit back to unassignedstate.
Also make the io mem index allocation dynamic.
Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>...
toplevel: remove error handling from qemu_malloc() callers (Avi Kivity)
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6531 c046a42c-6fe2-441c-8c8c-71466251a162
Log reset events (Jan Kiszka)
Original idea&code by Kevin Wolf, split-up in two patches and added morearchs.
This patch introduces a flag to log CPU resets. Useful for tracingunexpected resets (such as those triggered by x86 triple faults).