qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH] pc: memhotplug: rise minimum DIMM addr/size ali


From: Eduardo Habkost
Subject: Re: [Qemu-devel] [PATCH] pc: memhotplug: rise minimum DIMM addr/size alignment to 128Mb
Date: Mon, 21 Sep 2015 11:58:46 -0300
User-agent: Mutt/1.5.23 (2014-03-12)

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



reply via email to

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