From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:35678) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VKV29-0005NH-W9 for qemu-devel@nongnu.org; Fri, 13 Sep 2013 11:11:54 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VKV21-0004uG-1S for qemu-devel@nongnu.org; Fri, 13 Sep 2013 11:11:45 -0400 Received: from e36.co.us.ibm.com ([32.97.110.154]:51023) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VKV20-0004tv-RO for qemu-devel@nongnu.org; Fri, 13 Sep 2013 11:11:36 -0400 Received: from /spool/local by e36.co.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Fri, 13 Sep 2013 09:11:34 -0600 Received: from d03relay01.boulder.ibm.com (d03relay01.boulder.ibm.com [9.17.195.226]) by d03dlp01.boulder.ibm.com (Postfix) with ESMTP id A2C081FF001B for ; Fri, 13 Sep 2013 09:11:28 -0600 (MDT) Received: from d03av04.boulder.ibm.com (d03av04.boulder.ibm.com [9.17.195.170]) by d03relay01.boulder.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id r8DFBUgD308358 for ; Fri, 13 Sep 2013 09:11:30 -0600 Received: from d03av04.boulder.ibm.com (loopback [127.0.0.1]) by d03av04.boulder.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id r8DFBUr4020816 for ; Fri, 13 Sep 2013 09:11:30 -0600 Message-ID: <52332B1F.7010803@linux.vnet.ibm.com> Date: Fri, 13 Sep 2013 11:11:27 -0400 From: "Jason J. Herne" MIME-Version: 1.0 References: <1375366359-11553-1-git-send-email-jjherne@us.ibm.com> <1375366359-11553-5-git-send-email-jjherne@us.ibm.com> <52286F1C.8080703@suse.de> In-Reply-To: <52286F1C.8080703@suse.de> Content-Type: text/plain; charset=ISO-8859-15; format=flowed Content-Transfer-Encoding: 8bit Subject: Re: [Qemu-devel] [PATCH 4/8] [PATCH RFC v3] s390-qemu: cpu hotplug - Storage key global access Reply-To: jjherne@linux.vnet.ibm.com List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: =?ISO-8859-15?Q?Andreas_F=E4rber?= Cc: ehabkost@redhat.com, qemu-devel@nongnu.org, agraf@suse.de, borntraeger@de.ibm.com, jfrei@linux.vnet.ibm.com, imammedo@redhat.com, "Jason J. Herne" 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" >> >> 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 (jjherne@linux.vnet.ibm.com)