summaryrefslogtreecommitdiff
path: root/target-ia64
AgeCommit message (Collapse)AuthorFilesLines
2010-03-01qemu-kvm: Clean up mpstate synchronizationJan Kiszka1-0/+3
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>
2010-03-01qemu-kvm: Rework VCPU state writeback APIJan Kiszka1-2/+0
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>
2010-02-21Clean up register access APIJan Kiszka1-2/+2
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>
2009-06-15Rename kvm_(load|save)_mpstate to kvm_arch_(load|save)_mpstateGleb Natapov1-2/+2
To be consistent with other function naming. Signed-off-by: Gleb Natapov <gleb@redhat.com> Signed-off-by: Avi Kivity <avi@redhat.com>
2009-06-11Fold libkvm-common.h into libkvm-all.hGlauber Costa1-1/+1
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>
2009-06-08build-fix typo in target-ia64/libkvm.cJes Sorensen1-1/+1
Fix typo s/vcp/vcpu/ Signed-off-by: Jes Sorensen <jes@sgi.com> Signed-off-by: Avi Kivity <avi@redhat.com>
2009-06-07Flush icache after dma operations for ia64Jes Sorensen2-10/+0
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>
2009-06-04Do not use cpu_index in interface between libkvm and qemuGleb Natapov1-4/+4
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>
2009-05-21Copy libkvm into the qemu directory structureAvi Kivity2-0/+113
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>
2009-05-21Merge branch 'master' of git://git.sv.gnu.org/qemuAvi Kivity1-5/+9
* '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>
2009-05-07Define cpu_has_work() for ia64Jes Sorensen1-0/+5
Signed-off-by: Jes Sorensen <jes@sgi.com> Signed-off-by: Avi Kivity <avi@redhat.com>
2009-05-04Remove the dependency for phys_ram_base for ipf.cJes Sorensen2-33/+46
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>
2009-04-28ia64: Remove the dependency for phys_ram_base for ipf.cXiantao Zhang2-14/+23
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>
2009-03-25Ia64 CPUStatebuild fixJes Sorensen1-1/+3
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>
2009-03-08Fix warnings in ia64Zhang, Yang4-3/+9
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>
2009-01-15Save ia64 nvramYang2-8/+126
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>
2008-12-18Fix build breakage for ia64Xiantao Zhang1-0/+5
Signed-off-by: Xiantao Zhang <xiantao.zhang@intel.com> Signed-off-by: Avi Kivity <avi@redhat.com>
2008-11-23Merge branch 'qemu-cvs'Avi Kivity1-0/+8
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>
2008-11-10Use new interface kvm_init_vcpu for vcpu's initilization.Xiantao Zhang1-1/+1
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>
2008-10-05Fix build breakage on ia64Jes Sorensen4-5/+14
- 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>
2008-09-27Reindent ia64 code to match qemu code styleJes Sorensen4-45/+30
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>
2008-09-07Fix missing prototypes on ia64 and minor cleanupsJes Sorensen3-10/+16
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>
2008-09-01Add get/set_mpstate for ia64Xiantao Zhang2-1/+13
Add get/set_mpstate for Ipf. Signed-off-by: Xiantao Zhang <xiantao.zhang@intel.com> Signed-off-by: Avi Kivity <avi@qumranet.com>
2008-07-13Fix ia64 build issue caused by last qemu mergeXiantao Zhang2-5/+9
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>
2008-06-25Compile fixes for ia64Anthony Xu3-3/+11
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>
2008-06-12Remove env->ready_for_interrupt_injectionGlauber Costa2-3/+0
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>
2008-05-12Ia64 build fixXiantao Zhang1-1/+0
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>
2008-05-05Merge branch 'qemu-cvs'Avi Kivity1-0/+20
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
2008-04-22Ia64: include prototype for qemu_malloczJes Sorensen1-0/+1
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>
2008-04-16Spin up vcpu threads before attempting to set lapic contentsAvi Kivity1-0/+1
Signed-off-by: Avi Kivity <avi@qumranet.com>
2008-02-17IA64 also need to workaround tcg breakage on non-x86Xiantao Zhang1-0/+44
Signed-off-by: Xiantao Zhang <xiantao.zhang@intel.com> Signed-off-by: Avi Kivity <avi@qumranet.com>
2008-01-30Clean up KVM/QEMU interactionAnthony Liguori2-14/+6
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>
2008-01-03Ia64: Add check for guest firmware.Zhang Xiantao2-6/+14
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>
2007-12-22Fix ia64 build on latest sourceZhang Xiantao3-5/+8
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>
2007-12-20Ia64: Add one empty entry in hobZhang Xiantao1-0/+12
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>
2007-12-18Sync icache for more architecturesChristian Ehrhardt1-5/+0
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>
2007-12-11Add ia64 targetZhang Xiantao5-0/+297
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>
2007-12-11Add firmware build logic support for ia64 platformZhang Xiantao2-0/+625
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>