From mboxrd@z Thu Jan 1 00:00:00 1970 From: Rusty Russell Subject: Re: [PATCH v6 04/12] ARM: KVM: Hypervisor inititalization Date: Tue, 13 Mar 2012 13:50:09 +1030 Message-ID: <87boo1yyom.fsf@rustcorp.com.au> References: <20120223073159.3266.45217.stgit@ubuntu> <20120223073239.3266.35994.stgit@ubuntu> <878vjs5195.fsf@rustcorp.com.au> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: QUOTED-PRINTABLE Cc: android-virt@lists.cs.columbia.edu, kvm@vger.kernel.org, tech@virtualopensystems.com To: Christoffer Dall Return-path: Received: from ozlabs.org ([203.10.76.45]:60171 "EHLO ozlabs.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753479Ab2CMEkE convert rfc822-to-8bit (ORCPT ); Tue, 13 Mar 2012 00:40:04 -0400 In-Reply-To: Sender: kvm-owner@vger.kernel.org List-ID: On Sun, 11 Mar 2012 18:24:03 -0400, Christoffer Dall wrote: > On Thu, Feb 23, 2012 at 11:00 PM, Rusty Russell wrote: > > On Thu, 23 Feb 2012 02:32:39 -0500, Christoffer Dall wrote: > >> + =C2=A0 =C2=A0 /* > >> + =C2=A0 =C2=A0 =C2=A0* Allocate stack pages for Hypervisor-mode > >> + =C2=A0 =C2=A0 =C2=A0*/ > >> + =C2=A0 =C2=A0 for_each_possible_cpu(cpu) > >> + =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 per_cpu(kvm_arm_hyp_st= ack_page, cpu) =3D NULL; > > > > This is weird; we can't call this init function multiple times with= out > > reloading the module. > > >=20 > what you're saying is that static DEFINE_PER_CPU will still be > initialized to zero? I don't actually have experience with this, but = I > assumed that the data..percpu section would not necessarily be zeroed > out when loading a module... Now I tried to look, but I couldn't > convince myself. Can you enlighten me? Absolutely and definitely. It's placed in a special section, and from there copied into the per-cpu sections by the module loader but still follows the C semantics of being zero-initialized. Cheers, Rusty. --=20 How could I marry someone with more hair than me? http://baldalex.or= g