Statistics
| Branch: | Revision:

root / target-s390x / cpu.h @ cb446eca

History | View | Annotate | Download (37.5 kB)

# Date Author Comment
b4436a0b 06/25/2013 06:11 pm Cornelia Huck

virtio-ccw: Wire up ioeventfd.

On hosts that support ioeventfd, make use of it for host-to-guest
notifications via diagnose 500.

Signed-off-by: Cornelia Huck <>

5b23fd03 06/20/2013 05:32 pm Paolo Bonzini

Revert "s390x: reduce TARGET_PHYS_ADDR_SPACE_BITS to 62"

This reverts commit 311f83ca08c011b048c063c2fd3038a8957970bc.

Signed-off-by: Paolo Bonzini <>

311f83ca 05/24/2013 07:43 pm Paolo Bonzini

s390x: reduce TARGET_PHYS_ADDR_SPACE_BITS to 62

With the next patch, the memory API will complain if the
TARGET_PHYS_ADDR_SPACE_BITS gets dangerously close to an
overflow. s390x can handle up to 64 bit of physical address
space from its page tables, but we never use that much. Just...

420840e5 04/26/2013 09:18 pm Jason J. Herne

Allow selective runtime register synchronization

We want to avoid expensive register synchronization IOCTL's on the hot path so
a new kvm_s390_get_registers_partial() is introduced as a compliment to
kvm_arch_get_registers(). The new function is called on the hot path, and...

259186a7 03/12/2013 11:35 am Andreas Färber

cpu: Move halted and interrupt_request fields to CPUState

Both fields are used in VMState, thus need to be moved together.
Explicitly zero them on reset since they were located before
breakpoints.

Pass PowerPCCPU to kvmppc_handle_halt().

Signed-off-by: Andreas Färber <>

c3affe56 03/12/2013 11:35 am Andreas Färber

cpu: Pass CPUState to cpu_interrupt()

Move it to qom/cpu.h to avoid issues with include order.

Change pc_acpi_smi_interrupt() opaque to X86CPU.

Signed-off-by: Andreas Färber <>

97a8ea5a 03/12/2013 11:35 am Andreas Färber

cpu: Replace do_interrupt() by CPUClass::do_interrupt method

This removes a global per-target function and thus takes us one step
closer to compiling multiple targets into one executable.

It will also allow to override the interrupt handling for certain CPU...

38dd7cc7 03/08/2013 10:17 pm Christian Borntraeger

s390/css: Fix subchannel detection

We have to consider the m bit to find the real channel subsystem when
determining the last subchannel.

If we fail to take this into account, removal of a subchannel in
the middle of a big list of devices will stop device detection after...

0dac8459 02/16/2013 03:51 pm Andreas Färber

target-s390x: Drop unused cpu_s390x_close() prototype

It was never implemented.

Signed-off-by: Andreas Färber <>

91b0a8f3 02/13/2013 07:56 pm Cornelia Huck

s390: Fix handling of iscs.

There are two ways to express an interruption subclass:
- As a bitmask, as used in cr6.
- As a number, as used in the I/O interruption word.

Unfortunately, we have treated to I/O interruption word as if it
contained the bitmask as well, which went unnoticed so far as...

f9466733 02/01/2013 03:02 am Andreas Färber

target-s390x: Clean up cpu_inject_*() signatures

Despite cautioning that S390CPU is needed for upcoming CPUState
refactorings, commit 5d69c547d947798cba92d836d06f6e017ba2b19d (s390:
I/O interrupt and machine check injection.) added functions
cpu_inject_io() and cpu_inject_crw_mchk() with CPUS390XState argument,...

49e15878 02/01/2013 03:02 am Andreas Färber

target-s390x: Pass S390CPU to s390_{add, del}_running_cpu()

This prepares for moving the halted field to CPUState.
Most call sites can already supply S390CPU, for some env becomes unused.

Signed-off-by: Andreas Färber <>
Acked-by: Cornelia Huck <>...

50c8d9bf 01/29/2013 10:50 pm Cornelia Huck

s390: Use s390_cpu_physical_memory_map for tpi.

Map the I/O interruption code before calling into css.

Signed-off-by: Cornelia Huck <>
Signed-off-by: Alexander Graf <>

38322ed6 01/29/2013 10:50 pm Cornelia Huck

s390: Add mapping helper functions.

Add s390_cpu_physical_memory_{map,unmap} with special handling
for the lowcore.

Signed-off-by: Cornelia Huck <>
Signed-off-by: Alexander Graf <>

db1c8f53 01/29/2013 10:50 pm Cornelia Huck

s390: Channel I/O basic definitions.

Basic channel I/O structures and helper function.

Signed-off-by: Cornelia Huck <>
Signed-off-by: Alexander Graf <>

5d69c547 01/29/2013 10:50 pm Cornelia Huck

s390: I/O interrupt and machine check injection.

I/O interrupts are queued per isc. Only crw pending machine checks
are supported.

Signed-off-by: Cornelia Huck <>
Signed-off-by: Alexander Graf <>

7b18aad5 01/29/2013 10:50 pm Cornelia Huck

s390: Add channel I/O instructions.

Provide handlers for (most) channel I/O instructions.

Signed-off-by: Cornelia Huck <>
Signed-off-by: Alexander Graf <>

df1fe5bb 01/29/2013 10:50 pm Cornelia Huck

s390: Virtual channel subsystem support.

Provide a mechanism for qemu to provide fully virtual subchannels to
the guest.

Signed-off-by: Cornelia Huck <>
Signed-off-by: Alexander Graf <>

09b99878 01/29/2013 10:50 pm Cornelia Huck

s390: Wire up channel I/O in kvm.

Trigger the code for our virtual css in case of instruction
intercepts for I/O instructions.

Handle the tsch exit for the subchannel-related part of tsch.

Signed-off-by: Cornelia Huck <>
Signed-off-by: Alexander Graf <>

ccb084d3 01/18/2013 08:07 pm Christian Borntraeger

s390: new contributions GPLv2 or later

IBMs s390 contributions were meant to to be gplv2 or later (since
we were contributing to qemu). Several of the s390 specific files
link to gpl code anyway, so lets clarify the licence statement for
new contributions for those files that we have touched multiple...

904e5fd5 01/18/2013 08:07 pm Viktor Mihajlovski

S390: Enable -cpu help and QMP query-cpu-definitions

This enables qemu -cpu help to return a list of supported CPU models
on s390 and also to query for cpu definitions in the monitor.
Initially only cpu model = host is returned. This needs to be reworked...

a158986d 01/18/2013 08:07 pm Stefan Weil

s390x: Remove inline function ebcdic_put and related data from cpu.h

The function is only used in misc_helper.c, so move it to that file.

This reduces the size of debug executables (compiled without optimization)
because they get unused code and data for each compilation which includes...

28e942f8 01/18/2013 08:07 pm Cornelia Huck

s390: Add a hypercall registration interface.

Allow virtio machines to register for different diag500 function
codes and convert s390-virtio to use it.

Signed-off-by: Cornelia Huck <>
Signed-off-by: Alexander Graf <>

90b4f8ad 01/05/2013 10:18 pm Richard Henderson

target-s390: Fix cpu_clone_regs

R2 is the syscall return register, not R0.

Signed-off-by: Richard Henderson <>

102bf2c6 01/05/2013 10:18 pm Richard Henderson

target-s390: Convert FLOGR

Signed-off-by: Richard Henderson <>

587626f8 01/05/2013 10:18 pm Richard Henderson

target-s390: Convert FP ADD, COMPARE, LOAD TEST/ROUND/LENGTHENED

Signed-off-by: Richard Henderson <>

cbe24bfa 01/05/2013 10:18 pm Richard Henderson

target-s390: Convert SHIFT, ROTATE SINGLE

Note that we were missing the 32-bit SLA.

Signed-off-by: Richard Henderson <>

b4e2bd35 01/05/2013 10:18 pm Richard Henderson

target-s390: Send signals for divide

Signed-off-by: Richard Henderson <>

4e4bb438 01/05/2013 10:00 pm Richard Henderson

target-s390: Convert ADD LOGICAL CARRY and SUBTRACT LOGICAL BORROW

I'm resonably certain that the carry/borrow-out condition for both
helpers was incorrect, failing to take into account the carry-in.
Adding the new CC_OP codes also allows removing the awkward interface...

d5a103cd 01/05/2013 10:00 pm Richard Henderson

target-s390: Reorg exception handling

Make the user path more like the system path. Prepare for more kinds
of runtime exceptions. Rename ILC to ILEN to make it clear that we
want to pass around a full instruction length, rather than a "code"
that happens to be stored one bit left in a larger field....

1ac5889f 01/05/2013 10:00 pm Richard Henderson

target-s390: Convert 64-bit MULTIPLY LOGICAL

Use a new "retxl" member of CPUS290XState to return the "eXtra Low" part
of a 128-bit value. That said, this will get used when two independent
values need returning (e.g. quotient+remainder) as well.

At the same time, shuffle the elements of CPUS390XState to get this new...

6ee77b16 01/05/2013 10:00 pm Richard Henderson

target-s390: Fix gdbstub

The real gdb protocol doesn't split out pc or cc as real registers.
Those are pseudos that are extracted as needed from the PSW. Don't
modify env->cc_op during read -- that way lies heisenbugs.

Fill in the XXX for the fp registers....

501a7ce7 12/23/2012 01:40 am Andreas Färber

Merge branch 'master' of git://git.qemu.org/qemu into qom-cpu

Adapt header include paths.

Signed-off-by: Andreas Färber <>

1bc22652 12/19/2012 03:09 pm Andreas Färber

kvm: Pass CPUState to kvm_vcpu_ioctl()

Adapt helper functions to pass X86CPU / PowerPCCPU / S390CPU.

Signed-off-by: Andreas Färber <>

6b4c305c 12/19/2012 09:32 am Paolo Bonzini

fpu: move public header file to include/fpu

Signed-off-by: Paolo Bonzini <>

022c62cb 12/19/2012 09:31 am Paolo Bonzini

exec: move include files to include/exec/

Signed-off-by: Paolo Bonzini <>

3993c6bd 10/31/2012 05:11 am Andreas Färber

cpus: Pass CPUState to [qemu_]cpu_has_work()

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 <>
[AF: Updated new target-openrisc function accordingly]...

f6c98f92 10/29/2012 08:41 pm Heinz Graalfs

s390: sclp base support

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...

a8170e5e 10/23/2012 04:58 pm Avi Kivity

Rename target_phys_addr_t to hwaddr

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,...

19b0516f 09/10/2012 02:38 pm Blue Swirl

target-s390x: switch to AREG0 free mode

Add an explicit CPUState parameter instead of relying on AREG0.

Remove temporary wrappers and switch to AREG0 free mode.

Signed-off-by: Blue Swirl <>
[agraf: fix conflicts]
Signed-off-by: Alexander Graf <>

e72ca652 09/10/2012 02:38 pm Blue Swirl

target-s390x: split FPU ops

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 <>...

a78b0504 09/10/2012 02:38 pm Blue Swirl

target-s390x: split condition code helpers

Move condition code helpers to cc_helper.c.

Signed-off-by: Blue Swirl <>
Signed-off-by: Alexander Graf <>

aea1e885 09/10/2012 02:38 pm Blue Swirl

target-s390x: rename op_helper.c to misc_helper.c

Now op_helper.c contains miscellaneous helpers, rename
it to misc_helper.c.

Signed-off-by: Blue Swirl <>
[agraf: fix conflict]
Signed-off-by: Alexander Graf <>

449c0d70 09/10/2012 02:38 pm Blue Swirl

target-s390x: avoid AREG0 for FPU helpers

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 <>
Signed-off-by: Alexander Graf <>

000a1a38 08/15/2012 06:47 pm Christian Borntraeger

s390: provide interface for service interrupt/introduce interrupt.c

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)....

564b863d 06/11/2012 01:23 am Andreas Färber

target-s390x: Let cpu_s390x_init() return S390CPU

Let cpu_init() return CPUS390XState for backwards compatibility.

Signed-off-by: Andreas Färber <>

45fa769b 06/11/2012 01:23 am Andreas Färber

s390-virtio: Let s390_cpu_addr2state() return S390CPU

Convert ipi_states to S390CPU**.

Needed for s390_cpu_restart() in handle_sigp().

Signed-off-by: Andreas Färber <>

8f22e0df 04/04/2012 06:35 pm Andreas Färber

target-s390x: QOM'ify CPU init

Move code from cpu_s390x_init() into an initfn.

Signed-off-by: Andreas Färber <>
Tested-by: Christian Borntraeger <>

29e4bcb2 04/04/2012 06:29 pm Andreas Färber

target-s390x: QOM'ify CPU

Embed CPUS390XState as first member of S390CPU.
Since -cpu is being ignored, make TYPE_S390_CPU non-abstract.

Signed-off-by: Andreas Färber <>
Tested-by: Christian Borntraeger <>

9349b4f9 03/14/2012 11:20 pm Andreas Färber

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...

a4e3ad19 03/14/2012 11:20 pm Andreas Färber

target-s390x: Don't overuse CPUState

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 <>
Acked-by: Anthony Liguori <>

45133b74 02/28/2012 11:33 pm Stefan Weil

target-s390x: Clean includes

The change in cpu.h is needed when HOST_LONG_BITS is defined in qemu-common.h.

Signed-off-by: Stefan Weil <>

e7d81004 12/14/2011 01:09 pm Stefan Weil

Fix spelling in comments, documentation and messages

accidently->accidentally
annother->another
choosen->chosen
consideres->considers
decriptor->descriptor
developement->development
paramter->parameter
preceed->precede
preceeding->preceding
priviledge->privilege...

b9959138 11/14/2011 06:47 pm Alexander Graf

s390x: update R and C bits in storage key

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....

854e42f3 11/14/2011 06:47 pm Christian Borntraeger

s390: Fix cpu shutdown for KVM

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...

ef81522b 11/14/2011 06:47 pm Alexander Graf

s390x: Add shutdown for TCG s390-virtio machine

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 <>

541dc0d4 09/03/2011 01:45 pm Stefan Weil

Use new macro QEMU_PACKED for packed structures

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/'...

97b348e7 08/07/2011 12:32 pm Blue Swirl

Remove unused is_softmmu parameter from cpu_handle_mmu_fault

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 <>...

f081c76c 06/26/2011 09:25 pm Blue Swirl

Move cpu_has_work and cpu_pc_from_tb to cpu.h

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 <>

e205c790 06/20/2011 09:16 pm Jan Kiszka

Switch build system to accompanied kernel headers

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...

1f206266 05/20/2011 06:35 pm Alexander Graf

s390x: make kvm exported functions conditional on kvm

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....

d1ff903c 05/20/2011 06:35 pm Alexander Graf

s390x: keep hint on virtio managing size

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...

4e836781 05/20/2011 06:35 pm Alexander Graf

s390x: Shift variables in CPUState for memset(0)

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)...

fe9b35b7 05/20/2011 06:35 pm Alexander Graf

s390x: remove compatibility cc field

Remove the now unused cc field that was only required to not break
bisectability.

Signed-off-by: Alexander Graf <>

bcec36ea 04/18/2011 09:51 pm Alexander Graf

s390x: Prepare cpu.h for emulation

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.
...

64b85a8f 01/23/2011 06:21 pm Blue Swirl

Delete useless 'extern' qualifiers for functions

'extern' qualifier is useless for function declarations. Delete
them.

Signed-off-by: Blue Swirl <>

a88790a1 07/03/2010 09:48 am Paolo Bonzini

remove exec-all.h inclusion from cpu.h

Signed-off-by: Paolo Bonzini <>
Signed-off-by: Blue Swirl <>

10eb0cc0 07/03/2010 09:48 am Paolo Bonzini

move cpu_pc_from_tb to target-*/exec.h

Signed-off-by: Paolo Bonzini <>
Signed-off-by: Blue Swirl <>

52705890 03/12/2010 06:28 pm Richard Henderson

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 other
than Alpha. This will be used for page_find_alloc, which is
supposed to be using virtual addresses in the first place....

70539e18 03/07/2010 05:48 pm Blue Swirl

Update to a hopefully more future proof FSF address

See also 8167ee883931cb20c6264fc19d040ce2dc6ceaaa,
530e7615ce3c01882e582c84dc6304ab98a3d5c5 and
fad6cb1a565bb73f83fc0e2654489457b489e436.

Signed-off-by: Blue Swirl <>

10c339a0 12/05/2009 06:36 pm Alexander Graf

Add support for S390x system emulation

Let's enable the basics for system emulation so we can run virtual machines
with KVM!

Signed-off-by: Alexander Graf <>
Signed-off-by: Aurelien Jarno <>

10ec5117 12/05/2009 06:36 pm Alexander Graf

S/390 CPU fake emulation

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...