Received: from eggs.gnu.org ([2001:4830:134:3::10]:53683) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Ze2YQ-0007ta-6V for qemu-devel@nongnu.org; Mon, 21 Sep 2015 10:58:55 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Ze2YL-0004p7-S3 for qemu-devel@nongnu.org; Mon, 21 Sep 2015 10:58:54 -0400 Received: from mx1.redhat.com ([209.132.183.28]:48319) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Ze2YL-0004oX-IL for qemu-devel@nongnu.org; Mon, 21 Sep 2015 10:58:49 -0400 Received: from int-mx14.intmail.prod.int.phx2.redhat.com (int-mx14.intmail.prod.int.phx2.redhat.com [10.5.11.27]) by mx1.redhat.com (Postfix) with ESMTPS id 140A7C0B919A for ; Mon, 21 Sep 2015 14:58:49 +0000 (UTC) Date: Mon, 21 Sep 2015 11:58:46 -0300 From: Eduardo Habkost Message-ID: <20150921145846.GA13681@thinpad.lan.raisama.net> References: <1442836223-282767-1-git-send-email-imammedo@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1442836223-282767-1-git-send-email-imammedo@redhat.com> Subject: Re: [Qemu-devel] [PATCH] pc: memhotplug: rise minimum DIMM addr/size alignment to 128Mb List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Igor Mammedov Cc: pbonzini@redhat.com, Marcel Apfelbaum , qemu-devel@nongnu.org, mst@redhat.com On Mon, Sep 21, 2015 at 01:50:23PM +0200, Igor Mammedov wrote: [...] > diff --git a/hw/i386/pc_piix.c b/hw/i386/pc_piix.c > index caa4edc..7671905 100644 > --- a/hw/i386/pc_piix.c > +++ b/hw/i386/pc_piix.c > @@ -301,9 +301,17 @@ static void pc_init1(MachineState *machine, > } > } > > +static void pc_compat_2_4(MachineState *machine) > +{ > + PCMachineState *pcms = PC_MACHINE(machine); > + > + pcms->enforce_aligned_dimm = TARGET_PAGE_SIZE; > +} > + I want to stop creating new machine-init-time pc_compat_*() functions because they make it harder to do any analysis or introspection of machine class data in the future. If enforce_aligned_dimm never changes during the lifetime of the machine object, it can be moved to PCMachineClass. If it can change, you can allow it to be set using PCMachineClass::default_machine_opts by providing a property setter. > static void pc_compat_2_3(MachineState *machine) > { > PCMachineState *pcms = PC_MACHINE(machine); > + pc_compat_2_4(machine); > savevm_skip_section_footers(); > if (kvm_enabled()) { > pcms->smm = ON_OFF_AUTO_OFF; > @@ -326,7 +334,7 @@ static void pc_compat_2_1(MachineState *machine) > pc_compat_2_2(machine); > smbios_uuid_encoded = false; > x86_cpu_compat_kvm_no_autodisable(FEAT_8000_0001_ECX, CPUID_EXT3_SVM); > - pcms->enforce_aligned_dimm = false; > + pcms->enforce_aligned_dimm = 0; > } > > static void pc_compat_2_0(MachineState *machine) > @@ -485,7 +493,7 @@ static void pc_i440fx_2_4_machine_options(MachineClass *m) > SET_MACHINE_COMPAT(m, PC_COMPAT_2_4); > } > > -DEFINE_I440FX_MACHINE(v2_4, "pc-i440fx-2.4", NULL, > +DEFINE_I440FX_MACHINE(v2_4, "pc-i440fx-2.4", pc_compat_2_3, Did you mean pc_compat_2_4? > pc_i440fx_2_4_machine_options) > > -- Eduardo