~ubuntu-branches/ubuntu/trusty/qemu/trusty

« back to all changes in this revision

Viewing changes to hw/i386/pc_q35.c

  • Committer: Package Import Robot
  • Author(s): Serge Hallyn
  • Date: 2013-10-22 22:47:07 UTC
  • mfrom: (1.8.3) (10.1.42 sid)
  • Revision ID: package-import@ubuntu.com-20131022224707-1lya34fw3k3f24tv
Tags: 1.6.0+dfsg-2ubuntu1
* Merge 1.6.0~rc0+dfsg-2exp from debian experimental.  Remaining changes:
  - debian/control
    * update maintainer
    * remove libiscsi, usb-redir, vde, vnc-jpeg, and libssh2-1-dev
      from build-deps
    * enable rbd
    * add qemu-system and qemu-common B/R to qemu-keymaps
    * add D:udev, R:qemu, R:qemu-common and B:qemu-common to
      qemu-system-common
    * qemu-system-arm, qemu-system-ppc, qemu-system-sparc:
      - add qemu-kvm to Provides
      - add qemu-common, qemu-kvm, kvm to B/R
      - remove openbios-sparc from qemu-system-sparc D
      - drop openbios-ppc and openhackware Depends to Suggests (for now)
    * qemu-system-x86:
      - add qemu-common to Breaks/Replaces.
      - add cpu-checker to Recommends.
    * qemu-user: add B/R:qemu-kvm
    * qemu-kvm:
      - add armhf armel powerpc sparc to Architecture
      - C/R/P: qemu-kvm-spice
    * add qemu-common package
    * drop qemu-slof which is not packaged in ubuntu
  - add qemu-system-common.links for tap ifup/down scripts and OVMF link.
  - qemu-system-x86.links:
    * remove pxe rom links which are in kvm-ipxe
    * add symlink for kvm.1 manpage
  - debian/rules
    * add kvm-spice symlink to qemu-kvm
    * call dh_installmodules for qemu-system-x86
    * update dh_installinit to install upstart script
    * run dh_installman (Closes: #709241) (cherrypicked from 1.5.0+dfsg-2)
  - Add qemu-utils.links for kvm-* symlinks.
  - Add qemu-system-x86.qemu-kvm.upstart and .default
  - Add qemu-system-x86.modprobe to set nesting=1
  - Add qemu-system-common.preinst to add kvm group
  - qemu-system-common.postinst: remove bad group acl if there, then have
    udev relabel /dev/kvm.
  - New linaro patches from qemu-linaro rebasing branch
  - Dropped patches:
    * xen-simplify-xen_enabled.patch
    * sparc-linux-user-fix-missing-symbols-in-.rel-.rela.plt-sections.patch
    * main_loop-do-not-set-nonblocking-if-xen_enabled.patch
    * xen_machine_pv-do-not-create-a-dummy-CPU-in-machine-.patch
    * virtio-rng-fix-crash
  - Kept patches:
    * expose_vms_qemu64cpu.patch - updated
    * linaro arm patches from qemu-linaro rebasing branch
  - New patches:
    * fix-pci-add: change CONFIG variable in ifdef to make sure that
      pci_add is defined.
* Add linaro patches
* Add experimental mach-virt patches for arm virtualization.
* qemu-system-common.install: add debian/tmp/usr/lib to install the
  qemu-bridge-helper

Show diffs side-by-side

added added

removed removed

Lines of Context:
46
46
/* ICH9 AHCI has 6 ports */
47
47
#define MAX_SATA_PORTS     6
48
48
 
49
 
static bool has_pvpanic = true;
 
49
static bool has_pvpanic;
 
50
static bool has_pci_info = true;
50
51
 
51
52
/* PC hardware initialisation */
52
53
static void pc_q35_init(QEMUMachineInitArgs *args)
59
60
    const char *boot_device = args->boot_device;
60
61
    ram_addr_t below_4g_mem_size, above_4g_mem_size;
61
62
    Q35PCIHost *q35_host;
 
63
    PCIHostState *phb;
62
64
    PCIBus *host_bus;
63
65
    PCIDevice *lpc;
64
66
    BusState *idebus[MAX_SATA_PORTS];
77
79
    ICH9LPCState *ich9_lpc;
78
80
    PCIDevice *ahci;
79
81
    DeviceState *icc_bridge;
 
82
    PcGuestInfo *guest_info;
 
83
 
 
84
    if (xen_enabled() && xen_hvm_init(&ram_memory) != 0) {
 
85
        fprintf(stderr, "xen hardware virtual machine initialisation failed\n");
 
86
        exit(1);
 
87
    }
80
88
 
81
89
    icc_bridge = qdev_create(NULL, TYPE_ICC_BRIDGE);
82
90
    object_property_add_child(qdev_get_machine(), "icc-bridge",
98
106
    /* pci enabled */
99
107
    if (pci_enabled) {
100
108
        pci_memory = g_new(MemoryRegion, 1);
101
 
        memory_region_init(pci_memory, "pci", INT64_MAX);
 
109
        memory_region_init(pci_memory, NULL, "pci", INT64_MAX);
102
110
        rom_memory = pci_memory;
103
111
    } else {
104
112
        pci_memory = NULL;
105
113
        rom_memory = get_system_memory();
106
114
    }
107
115
 
 
116
    guest_info = pc_guest_info_init(below_4g_mem_size, above_4g_mem_size);
 
117
    guest_info->has_pci_info = has_pci_info;
 
118
    guest_info->isapc_ram_fw = false;
 
119
 
108
120
    /* allocate ram and load rom/bios */
109
121
    if (!xen_enabled()) {
110
122
        pc_memory_init(get_system_memory(), kernel_filename, kernel_cmdline,
111
123
                       initrd_filename, below_4g_mem_size, above_4g_mem_size,
112
 
                       rom_memory, &ram_memory);
 
124
                       rom_memory, &ram_memory, guest_info);
113
125
    }
114
126
 
115
127
    /* irq lines */
125
137
    /* create pci host bus */
126
138
    q35_host = Q35_HOST_DEVICE(qdev_create(NULL, TYPE_Q35_HOST_DEVICE));
127
139
 
 
140
    object_property_add_child(qdev_get_machine(), "q35", OBJECT(q35_host), NULL);
128
141
    q35_host->mch.ram_memory = ram_memory;
129
142
    q35_host->mch.pci_address_space = pci_memory;
130
143
    q35_host->mch.system_memory = get_system_memory();
131
144
    q35_host->mch.address_space_io = get_system_io();
132
145
    q35_host->mch.below_4g_mem_size = below_4g_mem_size;
133
146
    q35_host->mch.above_4g_mem_size = above_4g_mem_size;
 
147
    q35_host->mch.guest_info = guest_info;
134
148
    /* pci */
135
149
    qdev_init_nofail(DEVICE(q35_host));
136
 
    host_bus = q35_host->host.pci.bus;
 
150
    phb = PCI_HOST_BRIDGE(q35_host);
 
151
    host_bus = phb->bus;
137
152
    /* create ISA bus */
138
153
    lpc = pci_create_simple_multifunction(host_bus, PCI_DEVFN(ICH9_LPC_DEV,
139
154
                                          ICH9_LPC_FUNC), true,
208
223
    }
209
224
}
210
225
 
 
226
static void pc_q35_init_1_6(QEMUMachineInitArgs *args)
 
227
{
 
228
    has_pci_info = false;
 
229
    pc_q35_init(args);
 
230
}
 
231
 
 
232
static void pc_q35_init_1_5(QEMUMachineInitArgs *args)
 
233
{
 
234
    has_pvpanic = true;
 
235
    pc_q35_init_1_6(args);
 
236
}
 
237
 
211
238
static void pc_q35_init_1_4(QEMUMachineInitArgs *args)
212
239
{
213
 
    has_pvpanic = false;
214
240
    x86_cpu_compat_set_features("n270", FEAT_1_ECX, 0, CPUID_EXT_MOVBE);
 
241
    x86_cpu_compat_set_features("Westmere", FEAT_1_ECX, 0, CPUID_EXT_PCLMULQDQ);
 
242
    has_pci_info = false;
215
243
    pc_q35_init(args);
216
244
}
217
245
 
 
246
static QEMUMachine pc_q35_machine_v1_6 = {
 
247
    .name = "pc-q35-1.6",
 
248
    .alias = "q35",
 
249
    .desc = "Standard PC (Q35 + ICH9, 2009)",
 
250
    .init = pc_q35_init_1_6,
 
251
    .hot_add_cpu = pc_hot_add_cpu,
 
252
    .max_cpus = 255,
 
253
    DEFAULT_MACHINE_OPTIONS,
 
254
};
 
255
 
218
256
static QEMUMachine pc_q35_machine_v1_5 = {
219
257
    .name = "pc-q35-1.5",
220
 
    .alias = "q35",
221
258
    .desc = "Standard PC (Q35 + ICH9, 2009)",
222
 
    .init = pc_q35_init,
 
259
    .init = pc_q35_init_1_5,
223
260
    .hot_add_cpu = pc_hot_add_cpu,
224
261
    .max_cpus = 255,
 
262
    .compat_props = (GlobalProperty[]) {
 
263
        PC_COMPAT_1_5,
 
264
        { /* end of list */ }
 
265
    },
225
266
    DEFAULT_MACHINE_OPTIONS,
226
267
};
227
268
 
239
280
 
240
281
static void pc_q35_machine_init(void)
241
282
{
 
283
    qemu_register_machine(&pc_q35_machine_v1_6);
242
284
    qemu_register_machine(&pc_q35_machine_v1_5);
243
285
    qemu_register_machine(&pc_q35_machine_v1_4);
244
286
}