From: Aurelien Jarno <aurelien@aurel32.net>
To: Alexander Graf <agraf@suse.de>
Cc: peter.maydell@linaro.org,
QEMU-devel Developers <qemu-devel@nongnu.org>,
Richard Henderson <rth@twiddle.net>
Subject: Re: [Qemu-devel] [PATCH 09/17] s390x: virtio machine storage keys
Date: Mon, 18 Apr 2011 21:02:21 +0200 [thread overview]
Message-ID: <20110418190221.GJ16178@volta.aurel32.net> (raw)
In-Reply-To: <1302881578-5357-10-git-send-email-agraf@suse.de>
On Fri, Apr 15, 2011 at 05:32:50PM +0200, Alexander Graf wrote:
> For emulation (and migration) we need to know about the guest's storage keys.
> These are separate from actual RAM contents, so we need to allocate them in
> parallel to RAM.
>
> While touching the file, this patch also adjusts the hypercall function
> to a new syntax that aligns better with tcg emulated code.
>
> Signed-off-by: Alexander Graf <agraf@suse.de>
> ---
> hw/s390-virtio.c | 21 +++++++++------------
> 1 files changed, 9 insertions(+), 12 deletions(-)
Thanks, applied.
> diff --git a/hw/s390-virtio.c b/hw/s390-virtio.c
> index 48fb0d0..698ff6f 100644
> --- a/hw/s390-virtio.c
> +++ b/hw/s390-virtio.c
> @@ -82,13 +82,12 @@ CPUState *s390_cpu_addr2state(uint16_t cpu_addr)
> return ipi_states[cpu_addr];
> }
>
> -int s390_virtio_hypercall(CPUState *env, uint64_t mem_, uint64_t hypercall)
> +int s390_virtio_hypercall(CPUState *env, uint64_t mem, uint64_t hypercall)
> {
> int r = 0, i;
> - target_ulong mem = env->regs[2];
>
> - dprintf("KVM hypercall: %ld\n", env->regs[1]);
> - switch (env->regs[1]) {
> + dprintf("KVM hypercall: %ld\n", hypercall);
> + switch (hypercall) {
> case KVM_S390_VIRTIO_NOTIFY:
> if (mem > ram_size) {
> VirtIOS390Device *dev = s390_virtio_bus_find_vring(s390_bus,
> @@ -128,8 +127,7 @@ int s390_virtio_hypercall(CPUState *env, uint64_t mem_, uint64_t hypercall)
> break;
> }
>
> - env->regs[2] = r;
> - return 0;
> + return r;
> }
>
> /* PC hardware initialisation */
> @@ -145,14 +143,9 @@ static void s390_init(ram_addr_t ram_size,
> ram_addr_t kernel_size = 0;
> ram_addr_t initrd_offset;
> ram_addr_t initrd_size = 0;
> + uint8_t *storage_keys;
> int i;
>
> - /* XXX we only work on KVM for now */
> -
> - if (!kvm_enabled()) {
> - fprintf(stderr, "The S390 target only works with KVM enabled\n");
> - exit(1);
> - }
>
> /* get a BUS */
> s390_bus = s390_virtio_bus_init(&ram_size);
> @@ -161,6 +154,9 @@ static void s390_init(ram_addr_t ram_size,
> ram_addr = qemu_ram_alloc(NULL, "s390.ram", ram_size);
> cpu_register_physical_memory(0, ram_size, ram_addr);
>
> + /* allocate storage keys */
> + storage_keys = qemu_mallocz(ram_size / TARGET_PAGE_SIZE);
> +
> /* init CPUs */
> if (cpu_model == NULL) {
> cpu_model = "host";
> @@ -178,6 +174,7 @@ static void s390_init(ram_addr_t ram_size,
> ipi_states[i] = tmp_env;
> tmp_env->halted = 1;
> tmp_env->exception_index = EXCP_HLT;
> + tmp_env->storage_keys = storage_keys;
> }
>
> env->halted = 0;
> --
> 1.6.0.2
>
>
>
--
Aurelien Jarno GPG: 1024D/F1BCDB73
aurelien@aurel32.net http://www.aurel32.net
next prev parent reply other threads:[~2011-04-18 19:02 UTC|newest]
Thread overview: 48+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-04-15 15:32 [Qemu-devel] [PATCH 00/17] s390x emulation support v4 Alexander Graf
2011-04-15 15:32 ` [Qemu-devel] [PATCH 01/17] tcg: extend max tcg opcodes on 32bit Alexander Graf
2011-04-18 18:42 ` Aurelien Jarno
2011-04-15 15:32 ` [Qemu-devel] [PATCH 02/17] s390x: s390x-linux-user support Alexander Graf
2011-04-18 11:38 ` Riku Voipio
2011-04-18 12:06 ` Alexander Graf
2011-04-18 12:19 ` Riku Voipio
2011-04-18 13:21 ` Jan-Simon Möller
2011-04-18 13:31 ` Alexander Graf
2011-04-18 13:36 ` Aurelien Jarno
2011-04-18 13:42 ` Alexander Graf
2011-04-18 13:54 ` Aurelien Jarno
2011-04-15 15:32 ` [Qemu-devel] [PATCH 03/17] linux-user: define a couple of syscalls for non-uid16 targets Alexander Graf
2011-04-18 16:32 ` Riku Voipio
2011-04-18 21:11 ` Alexander Graf
2011-04-15 15:32 ` [Qemu-devel] [PATCH 04/17] linux-user: add s390x to llseek list Alexander Graf
2011-04-15 15:32 ` [Qemu-devel] [PATCH 05/17] kvm: add kvm stub for arch specific stuff Alexander Graf
2011-04-18 18:34 ` Aurelien Jarno
2011-05-03 14:17 ` Alexander Graf
2011-05-03 14:57 ` Jan Kiszka
2011-05-04 5:19 ` Alexander Graf
2011-05-04 8:31 ` Jan Kiszka
2011-05-04 8:40 ` Alexander Graf
2011-05-04 8:43 ` Jan Kiszka
2011-05-04 8:53 ` Alexander Graf
2011-05-03 15:05 ` Peter Maydell
2011-04-15 15:32 ` [Qemu-devel] [PATCH 06/17] s390x: Prepare cpu.h for emulation Alexander Graf
2011-04-18 18:55 ` Aurelien Jarno
2011-04-15 15:32 ` [Qemu-devel] [PATCH 07/17] s390x: Enable s390x-softmmu target Alexander Graf
2011-04-18 18:56 ` Aurelien Jarno
2011-04-15 15:32 ` [Qemu-devel] [PATCH 08/17] s390x: Dispatch interrupts to KVM or the real CPU Alexander Graf
2011-04-18 19:01 ` Aurelien Jarno
2011-04-15 15:32 ` [Qemu-devel] [PATCH 09/17] s390x: virtio machine storage keys Alexander Graf
2011-04-18 19:02 ` Aurelien Jarno [this message]
2011-04-15 15:32 ` [Qemu-devel] [PATCH 10/17] s390x: keep hint on virtio managing size Alexander Graf
2011-04-18 19:06 ` Aurelien Jarno
2011-04-18 21:03 ` Alexander Graf
2011-04-20 10:21 ` Aurelien Jarno
2011-04-15 15:32 ` [Qemu-devel] [PATCH 11/17] s390x: helper functions for system emulation Alexander Graf
2011-04-20 10:38 ` Aurelien Jarno
2011-05-04 4:57 ` Alexander Graf
2011-04-15 15:32 ` [Qemu-devel] [PATCH 12/17] s390x: Implement opcode helpers Alexander Graf
2011-04-15 15:32 ` [Qemu-devel] [PATCH 13/17] s390x: Adjust internal kvm code Alexander Graf
2011-04-15 15:32 ` [Qemu-devel] [PATCH 14/17] s390x: translate engine for s390x CPU Alexander Graf
2011-04-15 15:32 ` [Qemu-devel] [PATCH 15/17] s390x: Adjust GDB stub Alexander Graf
2011-04-15 15:32 ` [Qemu-devel] [PATCH 16/17] s390x: remove compatibility cc field Alexander Graf
2011-04-15 15:32 ` [Qemu-devel] [PATCH 17/17] s390x: build s390x by default Alexander Graf
2011-04-27 14:35 ` [Qemu-devel] [PATCH 00/17] s390x emulation support v4 Aurelien Jarno
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20110418190221.GJ16178@volta.aurel32.net \
--to=aurelien@aurel32.net \
--cc=agraf@suse.de \
--cc=peter.maydell@linaro.org \
--cc=qemu-devel@nongnu.org \
--cc=rth@twiddle.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.