qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH 4/8] [PATCH RFC v3] s390-qemu: cpu hotplug - Sto


From: Jason J. Herne
Subject: Re: [Qemu-devel] [PATCH 4/8] [PATCH RFC v3] s390-qemu: cpu hotplug - Storage key global access
Date: Fri, 13 Sep 2013 11:11:27 -0400
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130623 Thunderbird/17.0.7

On 09/05/2013 07:46 AM, Andreas Färber wrote:
Am 01.08.2013 16:12, schrieb Jason J. Herne:
From: "Jason J. Herne" <address@hidden>

diff --git a/hw/s390x/s390-virtio.c b/hw/s390x/s390-virtio.c
index 439d732..21e9124 100644
--- a/hw/s390x/s390-virtio.c
+++ b/hw/s390x/s390-virtio.c
@@ -123,6 +123,18 @@ static void s390_virtio_register_hcalls(void)
                                     s390_virtio_hcall_set_status);
  }

+static uint8_t *storage_keys;
+
+uint8_t *s390_get_storage_keys(void)
+{
+    return storage_keys;
+}
+
+void s390_alloc_storage_keys(ram_addr_t ram_size)
+{
+    storage_keys = g_malloc0(ram_size / TARGET_PAGE_SIZE);
+}
+
  /*
   * The number of running CPUs. On s390 a shutdown is the state of all CPUs
   * being either stopped or disabled (for interrupts) waiting. We have to
@@ -176,7 +188,7 @@ void s390_init_ipl_dev(const char *kernel_filename,
      qdev_init_nofail(dev);
  }

-void s390_init_cpus(const char *cpu_model, uint8_t *storage_keys)
+void s390_init_cpus(const char *cpu_model)
  {
      int i;

@@ -196,7 +208,7 @@ void s390_init_cpus(const char *cpu_model, uint8_t 
*storage_keys)
          ipi_states[i] = cpu;
          cs->halted = 1;
          cpu->env.exception_index = EXCP_HLT;
-        cpu->env.storage_keys = storage_keys;
+        cpu->env.storage_keys = s390_get_storage_keys();

Why not go this from the CPU initfn? Is there any ccw- vs. non-ccw
difference? Thinking about -device s390-cpu here. I believe it's safe to
assume that machine init and thus allocation has run before the CPU is
instantiated - possibly assert that.



Patch 6/8 does exactly that.

--
-- Jason J. Herne (address@hidden)




reply via email to

[Prev in Thread] Current Thread [Next in Thread]