summaryrefslogtreecommitdiff
path: root/target-s390x/cpu.h
AgeCommit message (Collapse)AuthorFilesLines
2012-12-19kvm: Pass CPUState to kvm_vcpu_ioctl()Andreas Färber1-6/+6
Adapt helper functions to pass X86CPU / PowerPCCPU / S390CPU. Signed-off-by: Andreas Färber <afaerber@suse.de>
2012-12-19fpu: move public header file to include/fpuPaolo Bonzini1-1/+1
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2012-12-19exec: move include files to include/exec/Paolo Bonzini1-3/+3
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2012-10-31cpus: Pass CPUState to [qemu_]cpu_has_work()Andreas Färber1-1/+3
For target-mips also change the return type to bool. Make include paths for cpu-qom.h consistent for alpha and unicore32. Signed-off-by: Andreas Färber <afaerber@suse.de> [AF: Updated new target-openrisc function accordingly] Acked-by: Richard Henderson <rth@twiddle.net> (for alpha)
2012-10-29s390: sclp base supportHeinz Graalfs1-12/+1
This adds a more generic infrastructure for handling Service-Call requests on s390. Currently we only support a small subset of Read SCP Info directly in target-s390x. This patch provides the base infrastructure for supporting more commands and moves Read SCP Info. In the future we could add additional commands for hotplug, call home and event handling. Signed-off-by: Heinz Graalfs <graalfs@linux.vnet.ibm.com> Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com> Signed-off-by: Jens Freimann <jfrei@linux.vnet.ibm.com> Signed-off-by: Alexander Graf <agraf@suse.de>
2012-10-23Rename target_phys_addr_t to hwaddrAvi Kivity1-1/+1
target_phys_addr_t is unwieldly, violates the C standard (_t suffixes are reserved) and its purpose doesn't match the name (most target_phys_addr_t addresses are not target specific). Replace it with a finger-friendly, standards conformant hwaddr. Outstanding patchsets can be fixed up with the command git rebase -i --exec 'find -name "*.[ch]" | xargs s/target_phys_addr_t/hwaddr/g' origin Signed-off-by: Avi Kivity <avi@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2012-09-10target-s390x: switch to AREG0 free modeBlue Swirl1-10/+0
Add an explicit CPUState parameter instead of relying on AREG0. Remove temporary wrappers and switch to AREG0 free mode. Signed-off-by: Blue Swirl <blauwirbel@gmail.com> [agraf: fix conflicts] Signed-off-by: Alexander Graf <agraf@suse.de>
2012-09-10target-s390x: avoid AREG0 for FPU helpersBlue Swirl1-2/+12
Make FPU helpers take a parameter for CPUState instead of relying on global env. Introduce temporary wrappers for FPU load and store ops. Signed-off-by: Blue Swirl <blauwirbel@gmail.com> Signed-off-by: Alexander Graf <agraf@suse.de>
2012-09-10target-s390x: rename op_helper.c to misc_helper.cBlue Swirl1-1/+1
Now op_helper.c contains miscellaneous helpers, rename it to misc_helper.c. Signed-off-by: Blue Swirl <blauwirbel@gmail.com> [agraf: fix conflict] Signed-off-by: Alexander Graf <agraf@suse.de>
2012-09-10target-s390x: split condition code helpersBlue Swirl1-0/+3
Move condition code helpers to cc_helper.c. Signed-off-by: Blue Swirl <blauwirbel@gmail.com> Signed-off-by: Alexander Graf <agraf@suse.de>
2012-09-10target-s390x: split FPU opsBlue Swirl1-0/+6
Move floating point instructions to fpu_helper.c. While exporting some condition code helpers, avoid duplicate identifier conflict with translate.c. Remove unused set_cc_nz_f64() in translate.c. Signed-off-by: Blue Swirl <blauwirbel@gmail.com> Signed-off-by: Alexander Graf <agraf@suse.de>
2012-08-15s390: provide interface for service interrupt/introduce interrupt.cChristian Borntraeger1-0/+3
This patch creates interrupt.c. The first user is a callback for hw/* code to trigger an service interrupt for a given sccb value. Several interrupt types for s390 are floating (can be delivered to all CPUs). so this code does not belong to a specific CPU. Other interrupts (like the virtio one) are also floating and can be moved here later on. Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com> Signed-off-by: Alexander Graf <agraf@suse.de>
2012-06-11s390-virtio: Let s390_cpu_addr2state() return S390CPUAndreas Färber1-1/+1
Convert ipi_states to S390CPU**. Needed for s390_cpu_restart() in handle_sigp(). Signed-off-by: Andreas Färber <afaerber@suse.de>
2012-06-11target-s390x: Let cpu_s390x_init() return S390CPUAndreas Färber1-4/+4
Let cpu_init() return CPUS390XState for backwards compatibility. Signed-off-by: Andreas Färber <afaerber@suse.de>
2012-04-04target-s390x: QOM'ify CPU initAndreas Färber1-0/+3
Move code from cpu_s390x_init() into an initfn. Signed-off-by: Andreas Färber <afaerber@suse.de> Tested-by: Christian Borntraeger <borntraeger@de.ibm.com>
2012-04-04target-s390x: QOM'ify CPUAndreas Färber1-0/+2
Embed CPUS390XState as first member of S390CPU. Since -cpu is being ignored, make TYPE_S390_CPU non-abstract. Signed-off-by: Andreas Färber <afaerber@suse.de> Tested-by: Christian Borntraeger <borntraeger@de.ibm.com>
2012-03-14Rename CPUState -> CPUArchStateAndreas Färber1-1/+1
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 All occurrences of CPUArchState are expected to be replaced by QOM CPUState, once all targets are QOM'ified and common fields have been extracted. Signed-off-by: Andreas Färber <afaerber@suse.de> Reviewed-by: Anthony Liguori <aliguori@us.ibm.com>
2012-03-14target-s390x: Don't overuse CPUStateAndreas Färber1-23/+23
Scripted conversion: sed -i "s/CPUState/CPUS390XState/g" target-s390x/*.[hc] sed -i "s/#define CPUS390XState/#define CPUState/" target-s390x/cpu.h Signed-off-by: Andreas Färber <afaerber@suse.de> Acked-by: Anthony Liguori <aliguori@us.ibm.com>
2012-02-28target-s390x: Clean includesStefan Weil1-0/+3
The change in cpu.h is needed when HOST_LONG_BITS is defined in qemu-common.h. Signed-off-by: Stefan Weil <sw@weilnetz.de>
2011-12-14Fix spelling in comments, documentation and messagesStefan Weil1-4/+4
accidently->accidentally annother->another choosen->chosen consideres->considers decriptor->descriptor developement->development paramter->parameter preceed->precede preceeding->preceding priviledge->privilege propogation->propagation substraction->subtraction throught->through upto->up to usefull->useful Fix also grammar in posix-aio-compat.c Signed-off-by: Stefan Weil <sw@weilnetz.de> Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
2011-11-14s390x: Add shutdown for TCG s390-virtio machineAlexander Graf1-0/+9
Now that we have code in place to do refcounting of online CPUs, we can drag the TCG code along and implement shutdown for that one too, so it doesn't feel left out by its KVM counterpart. Signed-off-by: Alexander Graf <agraf@suse.de>
2011-11-14s390: Fix cpu shutdown for KVMChristian Borntraeger1-0/+2
On s390 a shutdown is the state of all CPUs being either stopped or disabled (for interrupts) waiting. We have to track the overall number of running CPUs to call the shutdown sequence accordingly. This patch implements the counting and shutdown handling for the kvm path in qemu. Lets also wrap changes to env->halted and env->exception_index. Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com> Signed-off-by: Alexander Graf <agraf@suse.de>
2011-11-14s390x: update R and C bits in storage keyAlexander Graf1-0/+4
When the s390x maps a page or writes happen to a page, the R and C bits get updated. The easiest way to implement this in qemu is to simply update them whenever we map a TLB translation and act according to the permissions. Signed-off-by: Alexander Graf <agraf@suse.de>
2011-09-03Use new macro QEMU_PACKED for packed structuresStefan Weil1-1/+1
Most changes were made using these commands: git grep -la '__attribute__((packed))'|xargs perl -pi -e 's/__attribute__\(\(packed\)\)/QEMU_PACKED/' git grep -la '__attribute__ ((packed))'|xargs perl -pi -e 's/__attribute__ \(\(packed\)\)/QEMU_PACKED/' git grep -la '__attribute__((__packed__))'|xargs perl -pi -e 's/__attribute__\(\(__packed__\)\)/QEMU_PACKED/' git grep -la '__attribute__ ((__packed__))'|xargs perl -pi -e 's/__attribute__ \(\(__packed__\)\)/QEMU_PACKED/' git grep -la '__attribute((packed))'|xargs perl -pi -e 's/__attribute\(\(packed\)\)/QEMU_PACKED/' Whitespace in linux-user/syscall_defs.h was fixed manually to avoid warnings from scripts/checkpatch.pl. Manual changes were also applied to hw/pc.c. I did not fix indentation with tabs in block/vvfat.c. The patch will show 4 errors with scripts/checkpatch.pl. Signed-off-by: Stefan Weil <weil@mail.berlios.de> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2011-08-07Remove unused is_softmmu parameter from cpu_handle_mmu_faultBlue Swirl1-1/+1
Parameter is_softmmu (and its evil mutant twin brother is_softmuu) is not used in cpu_*_handle_mmu_fault() functions, remove them and adjust callers. Acked-by: Richard Henderson <rth@twiddle.net> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2011-06-26Move cpu_has_work and cpu_pc_from_tb to cpu.hBlue Swirl1-0/+11
Move functions cpu_has_work() and cpu_pc_from_tb() from exec.h to cpu.h. This is needed by later patches. Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2011-06-20Switch build system to accompanied kernel headersJan Kiszka1-10/+0
This helps reducing our build-time checks for feature support in the available Linux kernel headers. And it helps users that do not have sufficiently recent headers installed on their build machine. Consequently, the patch removes and build-time checks for kvm and vhost in configure, the --kerneldir switch, and KVM_CFLAGS. Kernel headers are supposed to be provided by QEMU only. s390 needs some extra love as it carries redefinitions from kernel headers. CC: Alexander Graf <agraf@suse.de> Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
2011-05-20s390x: remove compatibility cc fieldAlexander Graf1-1/+0
Remove the now unused cc field that was only required to not break bisectability. Signed-off-by: Alexander Graf <agraf@suse.de>
2011-05-20s390x: Shift variables in CPUState for memset(0)Alexander Graf1-3/+4
The default reset handler does a memset(0) until right in between CPU_COMMON. I incorrectly changed that behavior on the s390x port, so let's move the fields in CPUState around to reflect the correct split up to which point memset(0) zeros out everything. Signed-off-by: Alexander Graf <agraf@suse.de>
2011-05-20s390x: keep hint on virtio managing sizeAlexander Graf1-0/+3
The s390x virtio bus keeps management information on virtio after the top of the guest's RAM. We need to be able to tell the guest the size of its RAM (without virtio stuff), but also be able to trap when the guest accesses RAM outside of its scope (including virtio stuff). So we need a variable telling us the size of the virtio stuff, so we can calculate the highest available RAM address from that. While at it, also increase the maximum number of virtio pages, so we play along well with more recent kernels that spawn a ridiculous number of virtio console adapters. Signed-off-by: Alexander Graf <agraf@suse.de>
2011-05-20s390x: make kvm exported functions conditional on kvmAlexander Graf1-0/+17
We have some helper functions we use to directly invoke KVM functionality from device emulation code. This patch replaces those exported functions with static inline stubs when not building with KVM enabled. Signed-off-by: Alexander Graf <agraf@suse.de>
2011-04-18s390x: Prepare cpu.h for emulationAlexander Graf1-44/+730
We need to add some more logic to the CPU description to leverage emulation of an s390x CPU. This patch adds all the required helpers, fields in CPUState and constant definitions required for user and system emulation. Signed-off-by: Alexander Graf <agraf@suse.de> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2011-01-23Delete useless 'extern' qualifiers for functionsBlue Swirl1-3/+3
'extern' qualifier is useless for function declarations. Delete them. Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2010-07-03remove exec-all.h inclusion from cpu.hPaolo Bonzini1-1/+0
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2010-07-03move cpu_pc_from_tb to target-*/exec.hPaolo Bonzini1-5/+0
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2010-03-12Move TARGET_PHYS_ADDR_SPACE_BITS to target-*/cpu.h.Richard Henderson1-0/+5
Removes a set of ifdefs from exec.c. Introduce TARGET_VIRT_ADDR_SPACE_BITS for all targets other than Alpha. This will be used for page_find_alloc, which is supposed to be using virtual addresses in the first place. Signed-off-by: Richard Henderson <rth@twiddle.net>
2010-03-07Update to a hopefully more future proof FSF addressBlue Swirl1-2/+1
See also 8167ee883931cb20c6264fc19d040ce2dc6ceaaa, 530e7615ce3c01882e582c84dc6304ab98a3d5c5 and fad6cb1a565bb73f83fc0e2654489457b489e436. Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2009-12-05Add support for S390x system emulationAlexander Graf1-2/+151
Let's enable the basics for system emulation so we can run virtual machines with KVM! Signed-off-by: Alexander Graf <agraf@suse.de> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2009-12-05S/390 CPU fake emulationAlexander Graf1-0/+122
Because Qemu currently requires a TCG target to exist and there are quite some useful helpers here to lay the groundwork for out KVM target, let's create a stub TCG emulation target for S390X CPUs. This is required to make tcg happy. The emulation target itself won't work though. Signed-off-by: Alexander Graf <agraf@suse.de> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>