Age | Commit message (Collapse) | Author | Files | Lines |
|
Push mpstate reading/writing into kvm_arch_load/save_regs and, on x86,
properly synchronize with halted in the accessor functions.
At this chance, drop the special reset of interrupt_request and halted
in kvm_arch_cpu_reset. The former is done via memset in cpu_reset, the
latter in apic_init_reset anyway.
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
|
|
This grand cleanup drops all reset and vmsave/load related
synchronization points in favor of four(!) generic hooks:
- cpu_synchronize_all_states in qemu_savevm_state_complete
(initial sync from kernel before vmsave)
- cpu_synchronize_all_post_init in qemu_loadvm_state
(writeback after vmload)
- cpu_synchronize_all_post_init in main after machine init
- cpu_synchronize_all_post_reset in qemu_system_reset
(writeback after system reset)
These writeback points + the existing one of VCPU exec after
cpu_synchronize_state map on three levels of writeback:
- KVM_PUT_RUNTIME_STATE (during runtime, other VCPUs continue to run)
- KVM_PUT_RESET_STATE (on synchronous system reset, all VCPUs stopped)
- KVM_PUT_FULL_STATE (on init or vmload, all VCPUs stopped as well)
This level is passed to the arch-specific VCPU state writing function
that will decide which concrete substates need to be written. That way,
no writer of load, save or reset functions that interact with in-kernel
KVM states will ever have to worry about synchronization again. That
also means that a lot of reasons for races, segfaults and deadlocks are
eliminated.
cpu_synchronize_state remains untouched, just as Anthony suggested. We
continue to need it before reading or writing of VCPU states that are
also tracked by in-kernel KVM subsystems.
Consequently, this patch removes many cpu_synchronize_state calls that
are now redundant, just like remaining explicit register syncs. It does
not touch qemu-kvm's special hooks for mpstate, vcpu_events, or tsc
loading. They will be cleaned up by individual patches.
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
|
|
qemu-kvm's functions for accessing the VCPU registers are
kvm_arch_load/save_regs. Use them directly instead of going through
various wrappers. Specifically, we do not need on_vcpu wrapping as all
users either already run in the related thread or call while the vm is
stopped. This is now also validated during runtime via asserts.
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: Avi Kivity <avi@redhat.com>
|
|
To be consistent with other function naming.
Signed-off-by: Gleb Natapov <gleb@redhat.com>
Signed-off-by: Avi Kivity <avi@redhat.com>
|
|
This file has no purpose in life in new scheme of things. Move
its contents to libkvm-all.h. There are some name clashes
in qemu-kvm.c. Those function names are then changed.
Signed-off-by: Glauber Costa <glommer@redhat.com>
Signed-off-by: Avi Kivity <avi@redhat.com>
|
|
Fix typo s/vcp/vcpu/
Signed-off-by: Jes Sorensen <jes@sgi.com>
Signed-off-by: Avi Kivity <avi@redhat.com>
|
|
ia64 system depends on that platform issues snoop cycle to flush
icache for memory touched by DMA write operations, but virtual DMA
operations is emulated by memcpy, so use explict instrustions to flush
the related icache, otherwise, guest may use obsolete icache.
Signed-off-by: Xiantao Zhang <xiantao.zhang@intel.com>
Signed-off-by: Jes Sorensen <jes@sgi.com>
Signed-off-by: Avi Kivity <avi@redhat.com>
|
|
On vcpu creation cookie is returned which is used in future communication.
Signed-off-by: Gleb Natapov <gleb@redhat.com>
Signed-off-by: Avi Kivity <avi@redhat.com>
|
|
This paves the way for moving functionality out of libkvm and into the
native qemu/kvm integration code.
Signed-off-by: Avi Kivity <avi@redhat.com>
|
|
* 'master' of git://git.sv.gnu.org/qemu:
Convert machine registration to use module init functions
Eliminate --disable-gfx-check and make VNC default when SDL not available
Do not attempt to allocate sn_tab when there are no snapshots
Cast pointer arguments of get/setsockopt, send to void * to keep GCC
Conflicts:
hw/boards.h
Signed-off-by: Avi Kivity <avi@redhat.com>
|
|
Signed-off-by: Jes Sorensen <jes@sgi.com>
Signed-off-by: Avi Kivity <avi@redhat.com>
|
|
Fix ia64 code to use copy_physical_memory_{read,write} in hob and
nvram code, removing dependencies of qemu_get_ram_ptr() usage.
This results in cleaned up APIs and removal of unnecessary global
variables.
Signed-off-by: Jes Sorensen <jes@sgi.com>
Signed-off-by: Avi Kivity <avi@redhat.com>
|
|
Upstream has dropped phys_ram_base, so ia64 also remove
the dependency for that.
Signed-off-by: Xiantao Zhang <xiantao.zhang@intel.com>
Signed-off-by: Avi Kivity <avi@redhat.com>
|
|
Define CPUState as struct CPUIA64State to avoid compile errors on ia64.
Signed-off-by: Jes Sorensen <jes@sgi.com>
Signed-off-by: Avi Kivity <avi@redhat.com>
|
|
clean up the warning info in the ia64's code
Signed-off-by: Yang Zhang <yang.zhang@intel.com>
Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
|
|
Save nvram to a file given by a command line parameter.
Signed-off-by: Yang Zhang <yang.zhang@intel.com>
Signed-off-by: Avi Kivity <avi@redhat.com>
|
|
Signed-off-by: Xiantao Zhang <xiantao.zhang@intel.com>
Signed-off-by: Avi Kivity <avi@redhat.com>
|
|
Conflicts:
qemu/block-raw-posix.c
qemu/configure
qemu/cpu-defs.h
qemu/cpu-exec.c
qemu/exec.c
qemu/gdbstub.c
qemu/loader.c
qemu/osdep.c
qemu/sysemu.h
qemu/target-i386/helper.c
qemu/target-ppc/cpu.h
qemu/target-ppc/helper.c
qemu/usb-linux.c
Signed-off-by: Avi Kivity <avi@redhat.com>
|
|
Also define kvm_arch_do_ioperm for ia64 arch.
Signed-off-by: Xiantao Zhang <xiantao.zhang@intel.com>
Signed-off-by: Avi Kivity <avi@redhat.com>
|
|
- Declare 'env' properly as on all other architectures, instead of
having a local declaration in every object
- Introduce kvm_arch_try_push_nmi()
- Remove and cleanup fallout from having stdio.h included in cpu.h
Signed-off-by: Jes Sorensen <jes@sgi.com>
Acked-by : Xiantao zhang <xiantao.zhang@intel.com>
Signed-off-by: Avi Kivity <avi@redhat.com>
|
|
Reindent a bunch of ia64 code to better match the QEMU coding style.
Signed-off-by: Jes Sorensen <jes@sgi.com>
Signed-off-by : Xiantao Zhang <xiantao.zhang@intel.com>
Signed-off-by: Avi Kivity <avi@redhat.com>
|
|
Add missing prototypes to the ia64 header files. Remove unused variables
T0/T1/T2 declared in exec.h and fix a small formatting issue to match the
formatting style of qemu. Add 'const' to cpu_ia64_init() to match the
rest of qemu.
Signed-off-by: Jes Sorensen <jes@sgi.com>
Acked-by: Xiantao Zhang <xiantao.zhang@intel.com>
Signed-off-by: Avi Kivity <avi@qumranet.com>
|
|
Add get/set_mpstate for Ipf.
Signed-off-by: Xiantao Zhang <xiantao.zhang@intel.com>
Signed-off-by: Avi Kivity <avi@qumranet.com>
|
|
Fix ia64 build issue due to latest merge with upstream.
Signed-off-by: Xiantao Zhang <xiantao.zhang@intel.com>
Signed-off-by: Avi Kivity <avi@qumranet.com>
|
|
Since merging with Qemu upstream, it can't be compiled
for kvm-ia64
Signed-off-by: Anthony Xu <anthony.xu@intel.com>
Signed-off-by: Avi Kivity <avi@qumranet.com>
|
|
There's no need to polute the already poluted CPUState
with "ready_for_interrupt_injection". We can compute it
in the few times we use it, and be fine.
Signed-off-by: Glauber Costa <gcosta@redhat.com>
Signed-off-by: Avi Kivity <avi@qumranet.com>
|
|
Remove unexisting header inclusion, and set correct phys_ram_size
for ipf machine.
Signed-off-by: Xiantao Zhang <xiantao.zhang@intel.com>
Signed-off-by: Avi Kivity <avi@qumranet.com>
|
|
Conflicts:
qemu/Makefile
qemu/Makefile.target
qemu/configure
qemu/cpu-all.h
qemu/cpu-exec.c
qemu/exec.c
qemu/hw/boards.h
qemu/hw/pc.c
qemu/hw/vga.c
qemu/monitor.c
qemu/osdep.c
qemu/pc-bios/bios.bin
qemu/sysemu.h
qemu/vl.c
|
|
Include qemu-common.h for the prototype for qemu_mallocz to avoid
the being truncated to 32 bit.
Signed-off-by: Jes Sorensen <jes@sgi.com>
Signed-off-by: Avi Kivity <avi@qumranet.com>
|
|
Signed-off-by: Avi Kivity <avi@qumranet.com>
|
|
Signed-off-by: Xiantao Zhang <xiantao.zhang@intel.com>
Signed-off-by: Avi Kivity <avi@qumranet.com>
|
|
This patch attempts to clean up the interactions between KVM and QEMU. Sorry
for such a big patch, but I don't think there's a better way to approach this
such that it's still bisect friendly. I think this is most of what's needed to
get basic KVM support into QEMU though.
Right now, there's a mix of #ifdef USE_KVM, if (kvm_allowed), and various
extern declarations. It's all pretty fugly and there's a lot of mistakes due
to it.
The following patch eliminates almost all uses of #ifdef USE_KVM by introducing
a kvm_enabled() macro. If USE_KVM is set, this macro evaluates to kvm_allowed.
If USE_KVM isn't set, the macro evaluates to 0.
Since GCC eliminates if (0) blocks, this is just as good as using #ifdef. By
making sure that we never call into libkvm directly from QEMU, we can also just
not link qemu-kvm when USE_KVM isn't set instead of having the entire file
wrapped in a USE_KVM.
We also change the --enable-kvm configure option to --disable-kvm since KVM is
enabled by default.
I've tested this patch on x86 with 32-bit and 64-bit Linux guests and a 32-bit
Windows guest. I've also tested with USE_KVM not set. Jerone has also
verified that it doesn't PPC. My apologies if it breaks ia64 but I have no
way of testing that.
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Signed-off-by: Avi Kivity <avi@qumranet.com>
|
|
Add the existence check before reading the image.
Signed-off-by: Zhang Xiantao <xiantao.zhang@intel.com>
Signed-off-by: Avi Kivity <avi@qumranet.com>
|
|
Due to last merge with qemu upstream, ia64 build
is broken. This patch fix it.
Signed-off-by: Zhang Xiantao <xiantao.zhang@intel.com>
Signed-off-by: Avi Kivity <avi@qumranet.com>
|
|
In order to adapt the requirement of open guest firmware.
Since open guest firmware use hard-code to check
hob entries, so add one empty entry to workaround it.
Signed-off-by: Zhang Xiantao <xiantao.zhang@intel.com>
Signed-off-by: Avi Kivity <avi@qumranet.com>
|
|
A ia64 patch introduced kvm_sync_icache within a ifdef __ia64__, but the
concept of split caches is not bound to ia64. This patch replaces the the
call to kvm_synch_icache by the flush_icache_range function
that is already available in qemu for ia64 and ppc (noop for x86).
The call now depends on USE_KVM.
Signed-off-by: Christian Ehrhardt <ehrhardt@linux.vnet.ibm.com>
Signed-off-by: Avi Kivity <avi@qumranet.com>
|
|
This adds files for a dummy qemu ia64 target. This target is not usable
for emulation; only virtualization.
Signed-off-by: Zhang Xiantao <xiantao.zhang@intel.com>
Signed-off-by: Avi Kivity <avi@qumranet.com>
|
|
Add two files for ia64 building firmware.
target-ia64/firmware.c
target-ia64/firmware.h
Signed-off-by: Zhang Xiantao <xiantao.zhang@intel.com>
Signed-off-by: Avi Kivity <avi@qumranet.com>
|