]> git.proxmox.com Git - mirror_qemu.git/commitdiff
Merge remote-tracking branch 'remotes/afaerber/tags/qom-cpu-for-peter' into staging
authorPeter Maydell <peter.maydell@linaro.org>
Tue, 4 Nov 2014 15:54:27 +0000 (15:54 +0000)
committerPeter Maydell <peter.maydell@linaro.org>
Tue, 4 Nov 2014 15:56:26 +0000 (15:56 +0000)
QOM CPUState and X86CPU

* Cleanups for -cpu ...,enforce

* remotes/afaerber/tags/qom-cpu-for-peter:
  target-i386: Disable SVM by default in KVM mode
  target-i386: Don't enable nested VMX by default
  target-i386: Remove unsupported bits from all CPU models
  target-i386: Disable CPUID_ACPI by default in KVM mode
  target-i386: Rename KVM auto-feature-enable compat function
  pc: Create pc_compat_2_1() functions

Conflicts:
hw/i386/pc_piix.c
hw/i386/pc_q35.c
[PMM: Fixed minor textual conflicts]

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
1  2 
hw/i386/pc_piix.c
hw/i386/pc_q35.c

diff --combined hw/i386/pc_piix.c
index 537bcf28dafc84dc5403b63b772d477bb895db13,93778cdc8f80163a017fd8c37678ec43040692e5..b559181ba7d567ba3d7ead3a76a853d76bc3cafc
@@@ -63,7 -63,6 +63,7 @@@ static bool has_acpi_build = true
  static int legacy_acpi_table_size;
  static bool smbios_defaults = true;
  static bool smbios_legacy_mode;
 +static bool smbios_uuid_encoded = true;
  /* Make sure that guest addresses aligned at 1Gbyte boundaries get mapped to
   * host addresses aligned at 1Gbyte boundaries.  This way we can use 1GByte
   * pages in the host.
@@@ -173,7 -172,7 +173,7 @@@ static void pc_init1(MachineState *mach
          MachineClass *mc = MACHINE_GET_CLASS(machine);
          /* These values are guest ABI, do not change */
          smbios_set_defaults("QEMU", "Standard PC (i440FX + PIIX, 1996)",
 -                            mc->name, smbios_legacy_mode);
 +                            mc->name, smbios_legacy_mode, smbios_uuid_encoded);
      }
  
      /* allocate ram and load rom/bios */
      }
  
      pc_cmos_init(below_4g_mem_size, above_4g_mem_size, machine->boot_order,
 -                 floppy, idebus[0], idebus[1], rtc_state);
 +                 machine, floppy, idebus[0], idebus[1], rtc_state);
  
      if (pci_enabled && usb_enabled(false)) {
          pci_create_simple(pci_bus, piix3_devfn + 2, "piix3-usb-uhci");
@@@ -305,7 -304,9 +305,10 @@@ static void pc_init_pci(MachineState *m
  
  static void pc_compat_2_1(MachineState *machine)
  {
 +    smbios_uuid_encoded = false;
+     x86_cpu_compat_set_features("coreduo", FEAT_1_ECX, CPUID_EXT_VMX, 0);
+     x86_cpu_compat_set_features("core2duo", FEAT_1_ECX, CPUID_EXT_VMX, 0);
+     x86_cpu_compat_kvm_no_autodisable(FEAT_8000_0001_ECX, CPUID_EXT3_SVM);
  }
  
  static void pc_compat_2_0(MachineState *machine)
@@@ -340,7 -341,7 +343,7 @@@ static void pc_compat_1_7(MachineState 
      gigabyte_align = false;
      option_rom_has_mr = true;
      legacy_acpi_table_size = 6414;
-     x86_cpu_compat_disable_kvm_features(FEAT_1_ECX, CPUID_EXT_X2APIC);
+     x86_cpu_compat_kvm_no_autoenable(FEAT_1_ECX, CPUID_EXT_X2APIC);
  }
  
  static void pc_compat_1_6(MachineState *machine)
@@@ -372,7 -373,7 +375,7 @@@ static void pc_compat_1_3(MachineState 
  static void pc_compat_1_2(MachineState *machine)
  {
      pc_compat_1_3(machine);
-     x86_cpu_compat_disable_kvm_features(FEAT_KVM, KVM_FEATURE_PV_EOI);
+     x86_cpu_compat_kvm_no_autoenable(FEAT_KVM, KVM_FEATURE_PV_EOI);
  }
  
  static void pc_init_pci_2_1(MachineState *machine)
@@@ -443,7 -444,7 +446,7 @@@ static void pc_init_isa(MachineState *m
      if (!machine->cpu_model) {
          machine->cpu_model = "486";
      }
-     x86_cpu_compat_disable_kvm_features(FEAT_KVM, KVM_FEATURE_PV_EOI);
+     x86_cpu_compat_kvm_no_autoenable(FEAT_KVM, KVM_FEATURE_PV_EOI);
      enable_compat_apic_id_mode();
      pc_init1(machine, 0, 1);
  }
@@@ -464,14 -465,12 +467,14 @@@ static void pc_xen_hvm_init(MachineStat
  
  #define PC_I440FX_MACHINE_OPTIONS \
      PC_DEFAULT_MACHINE_OPTIONS, \
 +    .family = "pc_piix", \
      .desc = "Standard PC (i440FX + PIIX, 1996)", \
      .hot_add_cpu = pc_hot_add_cpu
  
  #define PC_I440FX_2_2_MACHINE_OPTIONS                           \
      PC_I440FX_MACHINE_OPTIONS,                                  \
 -    .default_machine_opts = "firmware=bios-256k.bin"
 +    .default_machine_opts = "firmware=bios-256k.bin",           \
 +    .default_display = "std"
  
  static QEMUMachine pc_i440fx_machine_v2_2 = {
      PC_I440FX_2_2_MACHINE_OPTIONS,
      .is_default = 1,
  };
  
 -#define PC_I440FX_2_1_MACHINE_OPTIONS PC_I440FX_2_2_MACHINE_OPTIONS
 +#define PC_I440FX_2_1_MACHINE_OPTIONS                           \
 +    PC_I440FX_MACHINE_OPTIONS,                                  \
 +    .default_machine_opts = "firmware=bios-256k.bin"
  
  static QEMUMachine pc_i440fx_machine_v2_1 = {
      PC_I440FX_2_1_MACHINE_OPTIONS,
      .name = "pc-i440fx-2.1",
      .init = pc_init_pci_2_1,
      .compat_props = (GlobalProperty[]) {
 -        PC_COMPAT_2_1,
 +        HW_COMPAT_2_1,
          { /* end of list */ }
      },
  };
@@@ -678,7 -675,7 +681,7 @@@ static QEMUMachine pc_machine_v1_1 = 
              .property = "class",\
              .value    = stringify(PCI_CLASS_MEMORY_RAM),\
          },{\
 -            .driver   = "apic",\
 +            .driver   = "apic-common",\
              .property = "vapic",\
              .value    = "off",\
          },{\
diff --combined hw/i386/pc_q35.c
index 296bdecc80ea0fc6ac11c7789da0e7b79092761f,ec400e16df9c2ad6c11b17a96969bbf440be7f6c..598e679749c78f8f678e7c831c9e57f2b31ec0ee
@@@ -52,7 -52,6 +52,7 @@@
  static bool has_acpi_build = true;
  static bool smbios_defaults = true;
  static bool smbios_legacy_mode;
 +static bool smbios_uuid_encoded = true;
  /* Make sure that guest addresses aligned at 1Gbyte boundaries get mapped to
   * host addresses aligned at 1Gbyte boundaries.  This way we can use 1GByte
   * pages in the host.
@@@ -164,7 -163,7 +164,7 @@@ static void pc_q35_init(MachineState *m
          MachineClass *mc = MACHINE_GET_CLASS(machine);
          /* These values are guest ABI, do not change */
          smbios_set_defaults("QEMU", "Standard PC (Q35 + ICH9, 2009)",
 -                            mc->name, smbios_legacy_mode);
 +                            mc->name, smbios_legacy_mode, smbios_uuid_encoded);
      }
  
      /* allocate ram and load rom/bios */
                        8, NULL, 0);
  
      pc_cmos_init(below_4g_mem_size, above_4g_mem_size, machine->boot_order,
 -                 floppy, idebus[0], idebus[1], rtc_state);
 +                 machine, floppy, idebus[0], idebus[1], rtc_state);
  
      /* the rest devices to which pci devfn is automatically assigned */
      pc_vga_init(isa_bus, host_bus);
  
  static void pc_compat_2_1(MachineState *machine)
  {
 +    smbios_uuid_encoded = false;
+     x86_cpu_compat_set_features("coreduo", FEAT_1_ECX, CPUID_EXT_VMX, 0);
+     x86_cpu_compat_set_features("core2duo", FEAT_1_ECX, CPUID_EXT_VMX, 0);
+     x86_cpu_compat_kvm_no_autodisable(FEAT_8000_0001_ECX, CPUID_EXT3_SVM);
  }
  
  static void pc_compat_2_0(MachineState *machine)
@@@ -301,7 -302,7 +304,7 @@@ static void pc_compat_1_7(MachineState 
      smbios_defaults = false;
      gigabyte_align = false;
      option_rom_has_mr = true;
-     x86_cpu_compat_disable_kvm_features(FEAT_1_ECX, CPUID_EXT_X2APIC);
+     x86_cpu_compat_kvm_no_autoenable(FEAT_1_ECX, CPUID_EXT_X2APIC);
  }
  
  static void pc_compat_1_6(MachineState *machine)
@@@ -361,15 -362,13 +364,15 @@@ static void pc_q35_init_1_4(MachineStat
  
  #define PC_Q35_MACHINE_OPTIONS \
      PC_DEFAULT_MACHINE_OPTIONS, \
 +    .family = "pc_q35", \
      .desc = "Standard PC (Q35 + ICH9, 2009)", \
      .hot_add_cpu = pc_hot_add_cpu, \
      .units_per_default_bus = 1
  
  #define PC_Q35_2_2_MACHINE_OPTIONS                      \
      PC_Q35_MACHINE_OPTIONS,                             \
 -    .default_machine_opts = "firmware=bios-256k.bin"
 +    .default_machine_opts = "firmware=bios-256k.bin",   \
 +    .default_display = "std"
  
  static QEMUMachine pc_q35_machine_v2_2 = {
      PC_Q35_2_2_MACHINE_OPTIONS,
      .init = pc_q35_init,
  };
  
 -#define PC_Q35_2_1_MACHINE_OPTIONS PC_Q35_2_2_MACHINE_OPTIONS
 +#define PC_Q35_2_1_MACHINE_OPTIONS                      \
 +    PC_Q35_MACHINE_OPTIONS,                             \
 +    .default_machine_opts = "firmware=bios-256k.bin"
  
  static QEMUMachine pc_q35_machine_v2_1 = {
      PC_Q35_2_1_MACHINE_OPTIONS,
      .name = "pc-q35-2.1",
      .init = pc_q35_init_2_1,
      .compat_props = (GlobalProperty[]) {
 -        PC_COMPAT_2_1,
 +        HW_COMPAT_2_1,
          { /* end of list */ }
      },
  };