mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-08 18:23:57 -06:00
virtio,pc,acpi fixes, cleanups
Mostly cleanups, notably Eduardo's compat code rework, and smbios rearrangement for use by ARM. Signed-off-by: Michael S. Tsirkin <mst@redhat.com> -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQEcBAABAgAGBQJVzIaUAAoJECgfDbjSjVRpnR4IAK8rXJYmByh4haqhHnDCVSTR EHmYyZrMHFAVLw4o5iu62a8Fe8De4JlwLIK5N/nM68ct0eVJkP1NbWRSQGTq5bbc LNOElWunxChvSiF/6ZbyuLkIUN69L+S3bGf8vnB8TvxS4h2PLpswdsw7fOuBR1zB S1fa6Me4iR/O8qss5HlchAf6Ugske8bWlrr2uh+UFiphzyE7rTwJ0Iop4KLxhn2m R8b5ll+b5IN8Crvi3kCPn/cwR7qWjYDeZ2bpVpAOcM6xG3As0uBp7Dx+03bBei/p SqPbnCLBVEF7iKjKw4QW79iQMFSapEKTX2Z8n6kjNMWGSDFbbplGVHEQmaWqfBw= =2yy6 -----END PGP SIGNATURE----- Merge remote-tracking branch 'remotes/mst/tags/for_upstream' into staging virtio,pc,acpi fixes, cleanups Mostly cleanups, notably Eduardo's compat code rework, and smbios rearrangement for use by ARM. Signed-off-by: Michael S. Tsirkin <mst@redhat.com> # gpg: Signature made Thu 13 Aug 2015 12:59:16 BST using RSA key ID D28D5469 # gpg: Good signature from "Michael S. Tsirkin <mst@kernel.org>" # gpg: aka "Michael S. Tsirkin <mst@redhat.com>" * remotes/mst/tags/for_upstream: (24 commits) MAINTAINERS: list smbios maintainers smbios: move smbios code into a common folder smbios: remove dependency on x86 e820 tables smbios: extract x86 smbios building code into a function acpi: avoid potential uninitialized access to cpu_hp_io_base virtio-net: remove useless codes pci: allow 0 address for PCI IO/MEM regions pc: Remove redundant arguments from pc_memory_init() pc: Remove redundant arguments from pc_cmos_init() pc: Remove redundant arguments from *load_linux() pc: Use PCMachineState as pc_guest_info_init() argument pc: Move {above,below}_4g_mem_size variables to PCMachineState pc: Use PCMachineState for pc_memory_init() argument pc: Use PCMachineState for pc_cmos_init() argument pc: Eliminate pc_default_machine_options() pc: Eliminate pc_common_machine_options() pc: Move PCMachineClass, PCMachineState to qemu/typedefs.h pc: Rename pc_machine variables to pcms pc: Use error_abort when registering properties target-i386: Remove x86_cpu_compat_set_features() ... Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
This commit is contained in:
commit
5c314a2eb7
28 changed files with 312 additions and 259 deletions
|
@ -100,7 +100,8 @@ struct MachineClass {
|
|||
no_cdrom:1,
|
||||
no_sdcard:1,
|
||||
has_dynamic_sysbus:1,
|
||||
no_tco:1;
|
||||
no_tco:1,
|
||||
pci_allow_0_address:1;
|
||||
int is_default;
|
||||
const char *default_machine_opts;
|
||||
const char *default_boot_order;
|
||||
|
|
|
@ -2,6 +2,7 @@
|
|||
#define HW_PC_H
|
||||
|
||||
#include "qemu-common.h"
|
||||
#include "qemu/typedefs.h"
|
||||
#include "exec/memory.h"
|
||||
#include "hw/boards.h"
|
||||
#include "hw/isa/isa.h"
|
||||
|
@ -39,6 +40,7 @@ struct PCMachineState {
|
|||
OnOffAuto vmport;
|
||||
OnOffAuto smm;
|
||||
bool enforce_aligned_dimm;
|
||||
ram_addr_t below_4g_mem_size, above_4g_mem_size;
|
||||
};
|
||||
|
||||
#define PC_MACHINE_ACPI_DEVICE_PROP "acpi-device"
|
||||
|
@ -61,9 +63,6 @@ struct PCMachineClass {
|
|||
DeviceState *dev);
|
||||
};
|
||||
|
||||
typedef struct PCMachineState PCMachineState;
|
||||
typedef struct PCMachineClass PCMachineClass;
|
||||
|
||||
#define TYPE_PC_MACHINE "generic-pc-machine"
|
||||
#define PC_MACHINE(obj) \
|
||||
OBJECT_CHECK(PCMachineState, (obj), TYPE_PC_MACHINE)
|
||||
|
@ -166,8 +165,7 @@ void pc_cpus_init(const char *cpu_model, DeviceState *icc_bridge);
|
|||
void pc_hot_add_cpu(const int64_t id, Error **errp);
|
||||
void pc_acpi_init(const char *default_dsdt);
|
||||
|
||||
PcGuestInfo *pc_guest_info_init(ram_addr_t below_4g_mem_size,
|
||||
ram_addr_t above_4g_mem_size);
|
||||
PcGuestInfo *pc_guest_info_init(PCMachineState *pcms);
|
||||
|
||||
void pc_set_legacy_acpi_data_size(void);
|
||||
|
||||
|
@ -182,15 +180,10 @@ void pc_set_legacy_acpi_data_size(void);
|
|||
void pc_pci_as_mapping_init(Object *owner, MemoryRegion *system_memory,
|
||||
MemoryRegion *pci_address_space);
|
||||
|
||||
FWCfgState *xen_load_linux(const char *kernel_filename,
|
||||
const char *kernel_cmdline,
|
||||
const char *initrd_filename,
|
||||
ram_addr_t below_4g_mem_size,
|
||||
FWCfgState *xen_load_linux(PCMachineState *pcms,
|
||||
PcGuestInfo *guest_info);
|
||||
FWCfgState *pc_memory_init(MachineState *machine,
|
||||
FWCfgState *pc_memory_init(PCMachineState *pcms,
|
||||
MemoryRegion *system_memory,
|
||||
ram_addr_t below_4g_mem_size,
|
||||
ram_addr_t above_4g_mem_size,
|
||||
MemoryRegion *rom_memory,
|
||||
MemoryRegion **ram_memory,
|
||||
PcGuestInfo *guest_info);
|
||||
|
@ -202,8 +195,7 @@ void pc_basic_device_init(ISABus *isa_bus, qemu_irq *gsi,
|
|||
bool no_vmport,
|
||||
uint32 hpet_irqs);
|
||||
void pc_init_ne2k_isa(ISABus *bus, NICInfo *nd);
|
||||
void pc_cmos_init(ram_addr_t ram_size, ram_addr_t above_4g_mem_size,
|
||||
const char *boot_device, MachineState *machine,
|
||||
void pc_cmos_init(PCMachineState *pcms,
|
||||
BusState *ide0, BusState *ide1,
|
||||
ISADevice *s);
|
||||
void pc_nic_init(ISABus *isa_bus, PCIBus *pci_bus);
|
||||
|
@ -374,11 +366,111 @@ bool e820_get_entry(int, uint32_t, uint64_t *, uint64_t *);
|
|||
|
||||
#define PC_COMPAT_2_2 \
|
||||
PC_COMPAT_2_3 \
|
||||
HW_COMPAT_2_2
|
||||
HW_COMPAT_2_2 \
|
||||
{\
|
||||
.driver = "kvm64" "-" TYPE_X86_CPU,\
|
||||
.property = "vme",\
|
||||
.value = "off",\
|
||||
},\
|
||||
{\
|
||||
.driver = "kvm32" "-" TYPE_X86_CPU,\
|
||||
.property = "vme",\
|
||||
.value = "off",\
|
||||
},\
|
||||
{\
|
||||
.driver = "Conroe" "-" TYPE_X86_CPU,\
|
||||
.property = "vme",\
|
||||
.value = "off",\
|
||||
},\
|
||||
{\
|
||||
.driver = "Penryn" "-" TYPE_X86_CPU,\
|
||||
.property = "vme",\
|
||||
.value = "off",\
|
||||
},\
|
||||
{\
|
||||
.driver = "Nehalem" "-" TYPE_X86_CPU,\
|
||||
.property = "vme",\
|
||||
.value = "off",\
|
||||
},\
|
||||
{\
|
||||
.driver = "Westmere" "-" TYPE_X86_CPU,\
|
||||
.property = "vme",\
|
||||
.value = "off",\
|
||||
},\
|
||||
{\
|
||||
.driver = "SandyBridge" "-" TYPE_X86_CPU,\
|
||||
.property = "vme",\
|
||||
.value = "off",\
|
||||
},\
|
||||
{\
|
||||
.driver = "Haswell" "-" TYPE_X86_CPU,\
|
||||
.property = "vme",\
|
||||
.value = "off",\
|
||||
},\
|
||||
{\
|
||||
.driver = "Broadwell" "-" TYPE_X86_CPU,\
|
||||
.property = "vme",\
|
||||
.value = "off",\
|
||||
},\
|
||||
{\
|
||||
.driver = "Opteron_G1" "-" TYPE_X86_CPU,\
|
||||
.property = "vme",\
|
||||
.value = "off",\
|
||||
},\
|
||||
{\
|
||||
.driver = "Opteron_G2" "-" TYPE_X86_CPU,\
|
||||
.property = "vme",\
|
||||
.value = "off",\
|
||||
},\
|
||||
{\
|
||||
.driver = "Opteron_G3" "-" TYPE_X86_CPU,\
|
||||
.property = "vme",\
|
||||
.value = "off",\
|
||||
},\
|
||||
{\
|
||||
.driver = "Opteron_G4" "-" TYPE_X86_CPU,\
|
||||
.property = "vme",\
|
||||
.value = "off",\
|
||||
},\
|
||||
{\
|
||||
.driver = "Opteron_G5" "-" TYPE_X86_CPU,\
|
||||
.property = "vme",\
|
||||
.value = "off",\
|
||||
},\
|
||||
{\
|
||||
.driver = "Haswell" "-" TYPE_X86_CPU,\
|
||||
.property = "f16c",\
|
||||
.value = "off",\
|
||||
},\
|
||||
{\
|
||||
.driver = "Haswell" "-" TYPE_X86_CPU,\
|
||||
.property = "rdrand",\
|
||||
.value = "off",\
|
||||
},\
|
||||
{\
|
||||
.driver = "Broadwell" "-" TYPE_X86_CPU,\
|
||||
.property = "f16c",\
|
||||
.value = "off",\
|
||||
},\
|
||||
{\
|
||||
.driver = "Broadwell" "-" TYPE_X86_CPU,\
|
||||
.property = "rdrand",\
|
||||
.value = "off",\
|
||||
},
|
||||
|
||||
#define PC_COMPAT_2_1 \
|
||||
PC_COMPAT_2_2 \
|
||||
HW_COMPAT_2_1
|
||||
HW_COMPAT_2_1 \
|
||||
{\
|
||||
.driver = "coreduo" "-" TYPE_X86_CPU,\
|
||||
.property = "vmx",\
|
||||
.value = "on",\
|
||||
},\
|
||||
{\
|
||||
.driver = "core2duo" "-" TYPE_X86_CPU,\
|
||||
.property = "vmx",\
|
||||
.value = "on",\
|
||||
},
|
||||
|
||||
#define PC_COMPAT_2_0 \
|
||||
PC_COMPAT_2_1 \
|
||||
|
@ -589,20 +681,18 @@ bool e820_get_entry(int, uint32_t, uint64_t *, uint64_t *);
|
|||
.driver = "486-" TYPE_X86_CPU,\
|
||||
.property = "model",\
|
||||
.value = stringify(0),\
|
||||
},\
|
||||
{\
|
||||
.driver = "n270" "-" TYPE_X86_CPU,\
|
||||
.property = "movbe",\
|
||||
.value = "off",\
|
||||
},\
|
||||
{\
|
||||
.driver = "Westmere" "-" TYPE_X86_CPU,\
|
||||
.property = "pclmulqdq",\
|
||||
.value = "off",\
|
||||
},
|
||||
|
||||
static inline void pc_common_machine_options(MachineClass *m)
|
||||
{
|
||||
m->default_boot_order = "cad";
|
||||
}
|
||||
|
||||
static inline void pc_default_machine_options(MachineClass *m)
|
||||
{
|
||||
pc_common_machine_options(m);
|
||||
m->hot_add_cpu = pc_hot_add_cpu;
|
||||
m->max_cpus = 255;
|
||||
}
|
||||
|
||||
#define DEFINE_PC_MACHINE(suffix, namestr, initfn, optsfn) \
|
||||
static void pc_machine_##suffix##_class_init(ObjectClass *oc, void *data) \
|
||||
{ \
|
||||
|
|
|
@ -17,13 +17,21 @@
|
|||
|
||||
#define SMBIOS_MAX_TYPE 127
|
||||
|
||||
/* memory area description, used by type 19 table */
|
||||
struct smbios_phys_mem_area {
|
||||
uint64_t address;
|
||||
uint64_t length;
|
||||
};
|
||||
|
||||
void smbios_entry_add(QemuOpts *opts);
|
||||
void smbios_set_cpuid(uint32_t version, uint32_t features);
|
||||
void smbios_set_defaults(const char *manufacturer, const char *product,
|
||||
const char *version, bool legacy_mode,
|
||||
bool uuid_encoded);
|
||||
uint8_t *smbios_get_table_legacy(size_t *length);
|
||||
void smbios_get_tables(uint8_t **tables, size_t *tables_len,
|
||||
void smbios_get_tables(const struct smbios_phys_mem_area *mem_array,
|
||||
const unsigned int mem_array_size,
|
||||
uint8_t **tables, size_t *tables_len,
|
||||
uint8_t **anchor, size_t *anchor_len);
|
||||
|
||||
/*
|
|
@ -48,7 +48,6 @@ typedef struct VirtIONetQueue {
|
|||
int tx_waiting;
|
||||
struct {
|
||||
VirtQueueElement elem;
|
||||
ssize_t len;
|
||||
} async_tx;
|
||||
struct VirtIONet *n;
|
||||
} VirtIONetQueue;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue