xref: /openbmc/qemu/include/hw/boards.h (revision b5fdf410)
10d09e41aSPaolo Bonzini /* Declarations for use by board files for creating devices.  */
20d09e41aSPaolo Bonzini 
30d09e41aSPaolo Bonzini #ifndef HW_BOARDS_H
40d09e41aSPaolo Bonzini #define HW_BOARDS_H
50d09e41aSPaolo Bonzini 
6d4842052SMarkus Armbruster #include "exec/memory.h"
7aa8b1839SIgor Mammedov #include "sysemu/hostmem.h"
80d09e41aSPaolo Bonzini #include "sysemu/blockdev.h"
9940e43aaSClaudio Fontana #include "qemu/accel.h"
108ac25c84SMarkus Armbruster #include "qapi/qapi-types-machine.h"
110b8fa32fSMarkus Armbruster #include "qemu/module.h"
1236d20cb2SMarcel Apfelbaum #include "qom/object.h"
132e5b09fdSMarkus Armbruster #include "hw/core/cpu.h"
140d09e41aSPaolo Bonzini 
15dfabb8b9SPaolo Bonzini #define TYPE_MACHINE_SUFFIX "-machine"
16c84a8f01SEduardo Habkost 
17c84a8f01SEduardo Habkost /* Machine class name that needs to be used for class-name-based machine
18c84a8f01SEduardo Habkost  * type lookup to work.
19c84a8f01SEduardo Habkost  */
20c84a8f01SEduardo Habkost #define MACHINE_TYPE_NAME(machinename) (machinename TYPE_MACHINE_SUFFIX)
21c84a8f01SEduardo Habkost 
2236d20cb2SMarcel Apfelbaum #define TYPE_MACHINE "machine"
23c8897e8eSMarcel Apfelbaum #undef MACHINE  /* BSD defines it and QEMU does not use it */
24a489d195SEduardo Habkost OBJECT_DECLARE_TYPE(MachineState, MachineClass, MACHINE)
2536d20cb2SMarcel Apfelbaum 
260056ae24SMarcel Apfelbaum extern MachineState *current_machine;
270056ae24SMarcel Apfelbaum 
28482dfe9aSIgor Mammedov void machine_run_board_init(MachineState *machine);
295e97b623SMarcel Apfelbaum bool machine_usb(MachineState *machine);
306cabe7faSMarcel Apfelbaum int machine_phandle_start(MachineState *machine);
3147c8ca53SMarcel Apfelbaum bool machine_dump_guest_core(MachineState *machine);
3275cc7f01SMarcel Apfelbaum bool machine_mem_merge(MachineState *machine);
33f2d672c2SIgor Mammedov HotpluggableCPUList *machine_query_hotpluggable_cpus(MachineState *machine);
347c88e65dSIgor Mammedov void machine_set_cpu_numa_node(MachineState *machine,
357c88e65dSIgor Mammedov                                const CpuInstanceProperties *props,
367c88e65dSIgor Mammedov                                Error **errp);
3786ce2d28SYanan Wang void smp_parse(MachineState *ms, SMPConfiguration *config, Error **errp);
385e97b623SMarcel Apfelbaum 
39387c0e8bSPeter Maydell /**
40387c0e8bSPeter Maydell  * machine_class_allow_dynamic_sysbus_dev: Add type to list of valid devices
41387c0e8bSPeter Maydell  * @mc: Machine class
42387c0e8bSPeter Maydell  * @type: type to allow (should be a subtype of TYPE_SYS_BUS_DEVICE)
43387c0e8bSPeter Maydell  *
44387c0e8bSPeter Maydell  * Add the QOM type @type to the list of devices of which are subtypes
45387c0e8bSPeter Maydell  * of TYPE_SYS_BUS_DEVICE but which are still permitted to be dynamically
46387c0e8bSPeter Maydell  * created (eg by the user on the command line with -device).
47387c0e8bSPeter Maydell  * By default if the user tries to create any devices on the command line
48387c0e8bSPeter Maydell  * that are subtypes of TYPE_SYS_BUS_DEVICE they will get an error message;
49387c0e8bSPeter Maydell  * for the special cases which are permitted for this machine model, the
50387c0e8bSPeter Maydell  * machine model class init code must call this function to add them
51387c0e8bSPeter Maydell  * to the list of specifically permitted devices.
52387c0e8bSPeter Maydell  */
530bd1909dSEduardo Habkost void machine_class_allow_dynamic_sysbus_dev(MachineClass *mc, const char *type);
54387c0e8bSPeter Maydell 
550fb124dbSPeter Maydell /**
56*b5fdf410SDamien Hedde  * device_type_is_dynamic_sysbus: Check if type is an allowed sysbus device
57*b5fdf410SDamien Hedde  * type for the machine class.
58*b5fdf410SDamien Hedde  * @mc: Machine class
59*b5fdf410SDamien Hedde  * @type: type to check (should be a subtype of TYPE_SYS_BUS_DEVICE)
60*b5fdf410SDamien Hedde  *
61*b5fdf410SDamien Hedde  * Returns: true if @type is a type in the machine's list of
62*b5fdf410SDamien Hedde  * dynamically pluggable sysbus devices; otherwise false.
63*b5fdf410SDamien Hedde  *
64*b5fdf410SDamien Hedde  * Check if the QOM type @type is in the list of allowed sysbus device
65*b5fdf410SDamien Hedde  * types (see machine_class_allowed_dynamic_sysbus_dev()).
66*b5fdf410SDamien Hedde  * Note that if @type has a parent type in the list, it is allowed too.
67*b5fdf410SDamien Hedde  */
68*b5fdf410SDamien Hedde bool device_type_is_dynamic_sysbus(MachineClass *mc, const char *type);
69*b5fdf410SDamien Hedde 
70*b5fdf410SDamien Hedde /**
710fb124dbSPeter Maydell  * device_is_dynamic_sysbus: test whether device is a dynamic sysbus device
720fb124dbSPeter Maydell  * @mc: Machine class
730fb124dbSPeter Maydell  * @dev: device to check
740fb124dbSPeter Maydell  *
750fb124dbSPeter Maydell  * Returns: true if @dev is a sysbus device on the machine's list
760fb124dbSPeter Maydell  * of dynamically pluggable sysbus devices; otherwise false.
770fb124dbSPeter Maydell  *
780fb124dbSPeter Maydell  * This function checks whether @dev is a valid dynamic sysbus device,
790fb124dbSPeter Maydell  * by first confirming that it is a sysbus device and then checking it
800fb124dbSPeter Maydell  * against the list of permitted dynamic sysbus devices which has been
810fb124dbSPeter Maydell  * set up by the machine using machine_class_allow_dynamic_sysbus_dev().
820fb124dbSPeter Maydell  *
830fb124dbSPeter Maydell  * It is valid to call this with something that is not a subclass of
840fb124dbSPeter Maydell  * TYPE_SYS_BUS_DEVICE; the function will return false in this case.
850fb124dbSPeter Maydell  * This allows hotplug callback functions to be written as:
860fb124dbSPeter Maydell  *     if (device_is_dynamic_sysbus(mc, dev)) {
870fb124dbSPeter Maydell  *         handle dynamic sysbus case;
880fb124dbSPeter Maydell  *     } else if (some other kind of hotplug) {
890fb124dbSPeter Maydell  *         handle that;
900fb124dbSPeter Maydell  *     }
910fb124dbSPeter Maydell  */
920fb124dbSPeter Maydell bool device_is_dynamic_sysbus(MachineClass *mc, DeviceState *dev);
930fb124dbSPeter Maydell 
9482b911aaSIgor Mammedov /*
9582b911aaSIgor Mammedov  * Checks that backend isn't used, preps it for exclusive usage and
9682b911aaSIgor Mammedov  * returns migratable MemoryRegion provided by backend.
9782b911aaSIgor Mammedov  */
9882b911aaSIgor Mammedov MemoryRegion *machine_consume_memdev(MachineState *machine,
9982b911aaSIgor Mammedov                                      HostMemoryBackend *backend);
1000bd1909dSEduardo Habkost 
10136d20cb2SMarcel Apfelbaum /**
1023811ef14SIgor Mammedov  * CPUArchId:
1033811ef14SIgor Mammedov  * @arch_id - architecture-dependent CPU ID of present or possible CPU
1043811ef14SIgor Mammedov  * @cpu - pointer to corresponding CPU object if it's present on NULL otherwise
105d342eb76SIgor Mammedov  * @type - QOM class name of possible @cpu object
106c67ae933SIgor Mammedov  * @props - CPU object properties, initialized by board
107f2d672c2SIgor Mammedov  * #vcpus_count - number of threads provided by @cpu object
1083811ef14SIgor Mammedov  */
109a44432b4SMarkus Armbruster typedef struct CPUArchId {
1103811ef14SIgor Mammedov     uint64_t arch_id;
111f2d672c2SIgor Mammedov     int64_t vcpus_count;
112c67ae933SIgor Mammedov     CpuInstanceProperties props;
1138aba3842SIgor Mammedov     Object *cpu;
114d342eb76SIgor Mammedov     const char *type;
1153811ef14SIgor Mammedov } CPUArchId;
1163811ef14SIgor Mammedov 
1173811ef14SIgor Mammedov /**
1183811ef14SIgor Mammedov  * CPUArchIdList:
1193811ef14SIgor Mammedov  * @len - number of @CPUArchId items in @cpus array
1203811ef14SIgor Mammedov  * @cpus - array of present or possible CPUs for current machine configuration
1213811ef14SIgor Mammedov  */
1223811ef14SIgor Mammedov typedef struct {
1233811ef14SIgor Mammedov     int len;
124880a7817SPhilippe Mathieu-Daudé     CPUArchId cpus[];
1253811ef14SIgor Mammedov } CPUArchIdList;
1263811ef14SIgor Mammedov 
1273811ef14SIgor Mammedov /**
128e4a97a89SYanan Wang  * SMPCompatProps:
1292b526199SYanan Wang  * @prefer_sockets - whether sockets are preferred over cores in smp parsing
130e4a97a89SYanan Wang  * @dies_supported - whether dies are supported by the machine
131e4a97a89SYanan Wang  */
132e4a97a89SYanan Wang typedef struct {
1332b526199SYanan Wang     bool prefer_sockets;
134e4a97a89SYanan Wang     bool dies_supported;
135e4a97a89SYanan Wang } SMPCompatProps;
136e4a97a89SYanan Wang 
137e4a97a89SYanan Wang /**
13836d20cb2SMarcel Apfelbaum  * MachineClass:
13908fe6824SThomas Huth  * @deprecation_reason: If set, the machine is marked as deprecated. The
14008fe6824SThomas Huth  *    string should provide some clear information about what to use instead.
14172649619SEmilio G. Cota  * @max_cpus: maximum number of CPUs supported. Default: 1
14272649619SEmilio G. Cota  * @min_cpus: minimum number of CPUs supported. Default: 1
14372649619SEmilio G. Cota  * @default_cpus: number of CPUs instantiated if none are specified. Default: 1
144ea0ac7f6SPhilippe Mathieu-Daudé  * @is_default:
145ea0ac7f6SPhilippe Mathieu-Daudé  *    If true QEMU will use this machine by default if no '-M' option is given.
146b7454548SIgor Mammedov  * @get_hotplug_handler: this function is called during bus-less
147b7454548SIgor Mammedov  *    device hotplug. If defined it returns pointer to an instance
148b7454548SIgor Mammedov  *    of HotplugHandler object, which handles hotplug operation
149b7454548SIgor Mammedov  *    for a given @dev. It may return NULL if @dev doesn't require
150b7454548SIgor Mammedov  *    any actions to be performed by hotplug handler.
151ea089eebSIgor Mammedov  * @cpu_index_to_instance_props:
152ea089eebSIgor Mammedov  *    used to provide @cpu_index to socket/core/thread number mapping, allowing
153ea089eebSIgor Mammedov  *    legacy code to perform maping from cpu_index to topology properties
154ea089eebSIgor Mammedov  *    Returns: tuple of socket/core/thread ids given cpu_index belongs to.
15557924bcdSIgor Mammedov  *    used to provide @cpu_index to socket number mapping, allowing
15657924bcdSIgor Mammedov  *    a machine to group CPU threads belonging to the same socket/package
15757924bcdSIgor Mammedov  *    Returns: socket number given cpu_index belongs to.
158fac862ffSEduardo Habkost  * @hw_version:
159fac862ffSEduardo Habkost  *    Value of QEMU_VERSION when the machine was added to QEMU.
160fac862ffSEduardo Habkost  *    Set only by old machines because they need to keep
161fac862ffSEduardo Habkost  *    compatibility on code that exposed QEMU_VERSION to guests in
162fac862ffSEduardo Habkost  *    the past (and now use qemu_hw_version()).
1633811ef14SIgor Mammedov  * @possible_cpu_arch_ids:
1643811ef14SIgor Mammedov  *    Returns an array of @CPUArchId architecture-dependent CPU IDs
1653811ef14SIgor Mammedov  *    which includes CPU IDs for present and possible to hotplug CPUs.
1663811ef14SIgor Mammedov  *    Caller is responsible for freeing returned list.
16779e07936SIgor Mammedov  * @get_default_cpu_node_id:
16879e07936SIgor Mammedov  *    returns default board specific node_id value for CPU slot specified by
16979e07936SIgor Mammedov  *    index @idx in @ms->possible_cpus[]
170c5514d0eSIgor Mammedov  * @has_hotpluggable_cpus:
171c5514d0eSIgor Mammedov  *    If true, board supports CPUs creation with -device/device_add.
1726063d4c0SIgor Mammedov  * @default_cpu_type:
1736063d4c0SIgor Mammedov  *    specifies default CPU_TYPE, which will be used for parsing target
1746063d4c0SIgor Mammedov  *    specific features and for creating CPUs if CPU name wasn't provided
1756063d4c0SIgor Mammedov  *    explicitly at CLI
17620bccb82SPeter Maydell  * @minimum_page_bits:
17720bccb82SPeter Maydell  *    If non-zero, the board promises never to create a CPU with a page size
17820bccb82SPeter Maydell  *    smaller than this, so QEMU can use a more efficient larger page
17920bccb82SPeter Maydell  *    size than the target architecture's minimum. (Attempting to create
18020bccb82SPeter Maydell  *    such a CPU will fail.) Note that changing this is a migration
18120bccb82SPeter Maydell  *    compatibility break for the machine.
182ed860129SPeter Maydell  * @ignore_memory_transaction_failures:
183ed860129SPeter Maydell  *    If this is flag is true then the CPU will ignore memory transaction
184ed860129SPeter Maydell  *    failures which should cause the CPU to take an exception due to an
185ed860129SPeter Maydell  *    access to an unassigned physical address; the transaction will instead
186ed860129SPeter Maydell  *    return zero (for a read) or be ignored (for a write). This should be
187ed860129SPeter Maydell  *    set only by legacy board models which rely on the old RAZ/WI behaviour
188ed860129SPeter Maydell  *    for handling devices that QEMU does not yet model. New board models
189ed860129SPeter Maydell  *    should instead use "unimplemented-device" for all memory ranges where
190ed860129SPeter Maydell  *    the guest will attempt to probe for a device that QEMU doesn't
191ed860129SPeter Maydell  *    implement and a stub device is required.
192dc0ca80eSEric Auger  * @kvm_type:
193dc0ca80eSEric Auger  *    Return the type of KVM corresponding to the kvm-type string option or
194dc0ca80eSEric Auger  *    computed based on other criteria such as the host kernel capabilities.
195516fc0a0SAndrew Jones  *    kvm-type may be NULL if it is not needed.
196cd5ff833SIgor Mammedov  * @numa_mem_supported:
197cd5ff833SIgor Mammedov  *    true if '--numa node.mem' option is supported and false otherwise
198d2321d31SPeter Xu  * @hotplug_allowed:
199d2321d31SPeter Xu  *    If the hook is provided, then it'll be called for each device
200d2321d31SPeter Xu  *    hotplug to check whether the device hotplug is allowed.  Return
201d2321d31SPeter Xu  *    true to grant allowance or false to reject the hotplug.  When
202d2321d31SPeter Xu  *    false is returned, an error must be set to show the reason of
203d2321d31SPeter Xu  *    the rejection.  If the hook is not provided, all hotplug will be
204d2321d31SPeter Xu  *    allowed.
205900c0ba3SIgor Mammedov  * @default_ram_id:
206900c0ba3SIgor Mammedov  *    Specifies inital RAM MemoryRegion name to be used for default backend
207900c0ba3SIgor Mammedov  *    creation if user explicitly hasn't specified backend with "memory-backend"
208900c0ba3SIgor Mammedov  *    property.
209900c0ba3SIgor Mammedov  *    It also will be used as a way to optin into "-m" option support.
210900c0ba3SIgor Mammedov  *    If it's not set by board, '-m' will be ignored and generic code will
211900c0ba3SIgor Mammedov  *    not create default RAM MemoryRegion.
2125c30ef93SChristian Borntraeger  * @fixup_ram_size:
2135c30ef93SChristian Borntraeger  *    Amends user provided ram size (with -m option) using machine
2145c30ef93SChristian Borntraeger  *    specific algorithm. To be used by old machine types for compat
2155c30ef93SChristian Borntraeger  *    purposes only.
2165c30ef93SChristian Borntraeger  *    Applies only to default memory backend, i.e., explicit memory backend
2175c30ef93SChristian Borntraeger  *    wasn't used.
21836d20cb2SMarcel Apfelbaum  */
21936d20cb2SMarcel Apfelbaum struct MachineClass {
22036d20cb2SMarcel Apfelbaum     /*< private >*/
22136d20cb2SMarcel Apfelbaum     ObjectClass parent_class;
22236d20cb2SMarcel Apfelbaum     /*< public >*/
22336d20cb2SMarcel Apfelbaum 
2242709f263SLaszlo Ersek     const char *family; /* NULL iff @name identifies a standalone machtype */
2258ea75371SMarc-André Lureau     char *name;
22600b4fbe2SMarcel Apfelbaum     const char *alias;
22700b4fbe2SMarcel Apfelbaum     const char *desc;
22808fe6824SThomas Huth     const char *deprecation_reason;
22900b4fbe2SMarcel Apfelbaum 
2303ef96221SMarcel Apfelbaum     void (*init)(MachineState *state);
231a0628599SLike Xu     void (*reset)(MachineState *state);
2324b5e06c9SNicholas Piggin     void (*wakeup)(MachineState *state);
233dc0ca80eSEric Auger     int (*kvm_type)(MachineState *machine, const char *arg);
23400b4fbe2SMarcel Apfelbaum 
23500b4fbe2SMarcel Apfelbaum     BlockInterfaceType block_default_type;
23616026518SJohn Snow     int units_per_default_bus;
23700b4fbe2SMarcel Apfelbaum     int max_cpus;
23872649619SEmilio G. Cota     int min_cpus;
23972649619SEmilio G. Cota     int default_cpus;
24000b4fbe2SMarcel Apfelbaum     unsigned int no_serial:1,
24100b4fbe2SMarcel Apfelbaum         no_parallel:1,
24200b4fbe2SMarcel Apfelbaum         no_floppy:1,
24300b4fbe2SMarcel Apfelbaum         no_cdrom:1,
24433cd52b5SAlexander Graf         no_sdcard:1,
245bab47d9aSGerd Hoffmann         pci_allow_0_address:1,
246bab47d9aSGerd Hoffmann         legacy_fw_cfg_order:1;
247ea0ac7f6SPhilippe Mathieu-Daudé     bool is_default;
24800b4fbe2SMarcel Apfelbaum     const char *default_machine_opts;
24900b4fbe2SMarcel Apfelbaum     const char *default_boot_order;
2506f00494aSGerd Hoffmann     const char *default_display;
251b66bbee3SMarc-André Lureau     GPtrArray *compat_props;
25200b4fbe2SMarcel Apfelbaum     const char *hw_version;
253076b35b5SNikunj A Dadhania     ram_addr_t default_ram_size;
2546063d4c0SIgor Mammedov     const char *default_cpu_type;
255b2fc91dbSPeter Xu     bool default_kernel_irqchip_split;
25671ae9e94SEduardo Habkost     bool option_rom_has_mr;
25771ae9e94SEduardo Habkost     bool rom_file_has_mr;
25820bccb82SPeter Maydell     int minimum_page_bits;
259c5514d0eSIgor Mammedov     bool has_hotpluggable_cpus;
260ed860129SPeter Maydell     bool ignore_memory_transaction_failures;
26155641213SLaurent Vivier     int numa_mem_align_shift;
262c9cf636dSAlistair Francis     const char **valid_cpu_types;
2630bd1909dSEduardo Habkost     strList *allowed_dynamic_sysbus_devices;
2647b8be49dSDou Liyang     bool auto_enable_numa_with_memhp;
265195784a0SDavid Hildenbrand     bool auto_enable_numa_with_memdev;
266907aac2fSMark Cave-Ayland     bool ignore_boot_device_suffixes;
2677fccf2a0SCorey Minyard     bool smbus_no_migration_support;
268f6a0d06bSEric Auger     bool nvdimm_supported;
269cd5ff833SIgor Mammedov     bool numa_mem_supported;
2700533ef5fSTao Xu     bool auto_enable_numa;
271e4a97a89SYanan Wang     SMPCompatProps smp_props;
272900c0ba3SIgor Mammedov     const char *default_ram_id;
273b7454548SIgor Mammedov 
274b7454548SIgor Mammedov     HotplugHandler *(*get_hotplug_handler)(MachineState *machine,
275b7454548SIgor Mammedov                                            DeviceState *dev);
276d2321d31SPeter Xu     bool (*hotplug_allowed)(MachineState *state, DeviceState *dev,
277d2321d31SPeter Xu                             Error **errp);
278ea089eebSIgor Mammedov     CpuInstanceProperties (*cpu_index_to_instance_props)(MachineState *machine,
279ea089eebSIgor Mammedov                                                          unsigned cpu_index);
28080e5db30SIgor Mammedov     const CPUArchIdList *(*possible_cpu_arch_ids)(MachineState *machine);
28179e07936SIgor Mammedov     int64_t (*get_default_cpu_node_id)(const MachineState *ms, int idx);
2825c30ef93SChristian Borntraeger     ram_addr_t (*fixup_ram_size)(ram_addr_t size);
28336d20cb2SMarcel Apfelbaum };
28436d20cb2SMarcel Apfelbaum 
28536d20cb2SMarcel Apfelbaum /**
286e017da37SDavid Hildenbrand  * DeviceMemoryState:
287b0c14ec4SDavid Hildenbrand  * @base: address in guest physical address space where the memory
288b0c14ec4SDavid Hildenbrand  * address space for memory devices starts
289b0c14ec4SDavid Hildenbrand  * @mr: address space container for memory devices
290b0c14ec4SDavid Hildenbrand  */
291e017da37SDavid Hildenbrand typedef struct DeviceMemoryState {
292b0c14ec4SDavid Hildenbrand     hwaddr base;
293b0c14ec4SDavid Hildenbrand     MemoryRegion mr;
294e017da37SDavid Hildenbrand } DeviceMemoryState;
295b0c14ec4SDavid Hildenbrand 
296b0c14ec4SDavid Hildenbrand /**
297edeeec91SLike Xu  * CpuTopology:
298edeeec91SLike Xu  * @cpus: the number of present logical processors on the machine
2998cb30e3aSBabu Moger  * @sockets: the number of sockets on the machine
300003f230eSYanan Wang  * @dies: the number of dies in one socket
301003f230eSYanan Wang  * @cores: the number of cores in one die
302003f230eSYanan Wang  * @threads: the number of threads in one core
303edeeec91SLike Xu  * @max_cpus: the maximum number of logical processors on the machine
304edeeec91SLike Xu  */
305edeeec91SLike Xu typedef struct CpuTopology {
306edeeec91SLike Xu     unsigned int cpus;
307003f230eSYanan Wang     unsigned int sockets;
30867872eb8SPaolo Bonzini     unsigned int dies;
309edeeec91SLike Xu     unsigned int cores;
310edeeec91SLike Xu     unsigned int threads;
311edeeec91SLike Xu     unsigned int max_cpus;
312edeeec91SLike Xu } CpuTopology;
313edeeec91SLike Xu 
314edeeec91SLike Xu /**
31536d20cb2SMarcel Apfelbaum  * MachineState:
31636d20cb2SMarcel Apfelbaum  */
31736d20cb2SMarcel Apfelbaum struct MachineState {
31836d20cb2SMarcel Apfelbaum     /*< private >*/
31936d20cb2SMarcel Apfelbaum     Object parent_obj;
32033cd52b5SAlexander Graf     Notifier sysbus_notifier;
32133cd52b5SAlexander Graf 
32236d20cb2SMarcel Apfelbaum     /*< public >*/
32336d20cb2SMarcel Apfelbaum 
324a6487d37SAlex Bennée     void *fdt;
32536d20cb2SMarcel Apfelbaum     char *dtb;
32636d20cb2SMarcel Apfelbaum     char *dumpdtb;
32736d20cb2SMarcel Apfelbaum     int phandle_start;
32836d20cb2SMarcel Apfelbaum     char *dt_compatible;
32936d20cb2SMarcel Apfelbaum     bool dump_guest_core;
33036d20cb2SMarcel Apfelbaum     bool mem_merge;
33136d20cb2SMarcel Apfelbaum     bool usb;
332c6e76503SPaolo Bonzini     bool usb_disabled;
33336d20cb2SMarcel Apfelbaum     char *firmware;
334a52a7fdfSLe Tan     bool iommu;
3359850c604SAlexander Graf     bool suppress_vmdesc;
336cfc58cf3SEduardo Habkost     bool enable_graphics;
337e0292d7cSDavid Gibson     ConfidentialGuestSupport *cgs;
338aa8b1839SIgor Mammedov     char *ram_memdev_id;
33982b911aaSIgor Mammedov     /*
34082b911aaSIgor Mammedov      * convenience alias to ram_memdev_id backend memory region
34182b911aaSIgor Mammedov      * or to numa container memory region
34282b911aaSIgor Mammedov      */
34382b911aaSIgor Mammedov     MemoryRegion *ram;
344e017da37SDavid Hildenbrand     DeviceMemoryState *device_memory;
34536d20cb2SMarcel Apfelbaum 
3463ef96221SMarcel Apfelbaum     ram_addr_t ram_size;
347c270fb9eSIgor Mammedov     ram_addr_t maxram_size;
348c270fb9eSIgor Mammedov     uint64_t   ram_slots;
3493ef96221SMarcel Apfelbaum     const char *boot_order;
3504b7acd2aSPaolo Bonzini     const char *boot_once;
3516b1b1440SMarcel Apfelbaum     char *kernel_filename;
3526b1b1440SMarcel Apfelbaum     char *kernel_cmdline;
3536b1b1440SMarcel Apfelbaum     char *initrd_filename;
3546063d4c0SIgor Mammedov     const char *cpu_type;
355ac2da55eSEduardo Habkost     AccelState *accelerator;
35638690a1cSIgor Mammedov     CPUArchIdList *possible_cpus;
357edeeec91SLike Xu     CpuTopology smp;
358f6a0d06bSEric Auger     struct NVDIMMState *nvdimms_state;
359aa570207STao Xu     struct NumaState *numa_state;
36036d20cb2SMarcel Apfelbaum };
36136d20cb2SMarcel Apfelbaum 
362ed0b6de3SEduardo Habkost #define DEFINE_MACHINE(namestr, machine_initfn) \
363ed0b6de3SEduardo Habkost     static void machine_initfn##_class_init(ObjectClass *oc, void *data) \
364ed0b6de3SEduardo Habkost     { \
365ed0b6de3SEduardo Habkost         MachineClass *mc = MACHINE_CLASS(oc); \
366ed0b6de3SEduardo Habkost         machine_initfn(mc); \
367ed0b6de3SEduardo Habkost     } \
368ed0b6de3SEduardo Habkost     static const TypeInfo machine_initfn##_typeinfo = { \
369ed0b6de3SEduardo Habkost         .name       = MACHINE_TYPE_NAME(namestr), \
370ed0b6de3SEduardo Habkost         .parent     = TYPE_MACHINE, \
371ed0b6de3SEduardo Habkost         .class_init = machine_initfn##_class_init, \
372ed0b6de3SEduardo Habkost     }; \
373ed0b6de3SEduardo Habkost     static void machine_initfn##_register_types(void) \
374ed0b6de3SEduardo Habkost     { \
375ed0b6de3SEduardo Habkost         type_register_static(&machine_initfn##_typeinfo); \
376ed0b6de3SEduardo Habkost     } \
3770e6aac87SEduardo Habkost     type_init(machine_initfn##_register_types)
378ed0b6de3SEduardo Habkost 
37952e64f5bSYanan Wang extern GlobalProperty hw_compat_6_1[];
38052e64f5bSYanan Wang extern const size_t hw_compat_6_1_len;
38152e64f5bSYanan Wang 
382da7e13c0SCornelia Huck extern GlobalProperty hw_compat_6_0[];
383da7e13c0SCornelia Huck extern const size_t hw_compat_6_0_len;
384da7e13c0SCornelia Huck 
385576a00bdSCornelia Huck extern GlobalProperty hw_compat_5_2[];
386576a00bdSCornelia Huck extern const size_t hw_compat_5_2_len;
387576a00bdSCornelia Huck 
3883ff3c5d3SCornelia Huck extern GlobalProperty hw_compat_5_1[];
3893ff3c5d3SCornelia Huck extern const size_t hw_compat_5_1_len;
3903ff3c5d3SCornelia Huck 
391541aaa1dSCornelia Huck extern GlobalProperty hw_compat_5_0[];
392541aaa1dSCornelia Huck extern const size_t hw_compat_5_0_len;
393541aaa1dSCornelia Huck 
3945f258577SEvgeny Yakovlev extern GlobalProperty hw_compat_4_2[];
3955f258577SEvgeny Yakovlev extern const size_t hw_compat_4_2_len;
3965f258577SEvgeny Yakovlev 
3979aec2e52SCornelia Huck extern GlobalProperty hw_compat_4_1[];
3989aec2e52SCornelia Huck extern const size_t hw_compat_4_1_len;
3999aec2e52SCornelia Huck 
4009bf2650bSCornelia Huck extern GlobalProperty hw_compat_4_0[];
4019bf2650bSCornelia Huck extern const size_t hw_compat_4_0_len;
4029bf2650bSCornelia Huck 
403abd93cc7SMarc-André Lureau extern GlobalProperty hw_compat_3_1[];
404abd93cc7SMarc-André Lureau extern const size_t hw_compat_3_1_len;
405abd93cc7SMarc-André Lureau 
406ddb3235dSMarc-André Lureau extern GlobalProperty hw_compat_3_0[];
407ddb3235dSMarc-André Lureau extern const size_t hw_compat_3_0_len;
408ddb3235dSMarc-André Lureau 
4090d47310bSMarc-André Lureau extern GlobalProperty hw_compat_2_12[];
4100d47310bSMarc-André Lureau extern const size_t hw_compat_2_12_len;
4110d47310bSMarc-André Lureau 
41243df70a9SMarc-André Lureau extern GlobalProperty hw_compat_2_11[];
41343df70a9SMarc-André Lureau extern const size_t hw_compat_2_11_len;
41443df70a9SMarc-André Lureau 
415503224f4SMarc-André Lureau extern GlobalProperty hw_compat_2_10[];
416503224f4SMarc-André Lureau extern const size_t hw_compat_2_10_len;
417503224f4SMarc-André Lureau 
4183e803152SMarc-André Lureau extern GlobalProperty hw_compat_2_9[];
4193e803152SMarc-André Lureau extern const size_t hw_compat_2_9_len;
4203e803152SMarc-André Lureau 
421edc24ccdSMarc-André Lureau extern GlobalProperty hw_compat_2_8[];
422edc24ccdSMarc-André Lureau extern const size_t hw_compat_2_8_len;
423edc24ccdSMarc-André Lureau 
4245a995064SMarc-André Lureau extern GlobalProperty hw_compat_2_7[];
4255a995064SMarc-André Lureau extern const size_t hw_compat_2_7_len;
4265a995064SMarc-André Lureau 
427ff8f261fSMarc-André Lureau extern GlobalProperty hw_compat_2_6[];
428ff8f261fSMarc-André Lureau extern const size_t hw_compat_2_6_len;
429ff8f261fSMarc-André Lureau 
430fe759610SMarc-André Lureau extern GlobalProperty hw_compat_2_5[];
431fe759610SMarc-André Lureau extern const size_t hw_compat_2_5_len;
432fe759610SMarc-André Lureau 
4332f99b9c2SMarc-André Lureau extern GlobalProperty hw_compat_2_4[];
4342f99b9c2SMarc-André Lureau extern const size_t hw_compat_2_4_len;
4352f99b9c2SMarc-André Lureau 
4368995dd90SMarc-André Lureau extern GlobalProperty hw_compat_2_3[];
4378995dd90SMarc-André Lureau extern const size_t hw_compat_2_3_len;
4388995dd90SMarc-André Lureau 
4391c30044eSMarc-André Lureau extern GlobalProperty hw_compat_2_2[];
4401c30044eSMarc-André Lureau extern const size_t hw_compat_2_2_len;
4411c30044eSMarc-André Lureau 
442c4fc5695SMarc-André Lureau extern GlobalProperty hw_compat_2_1[];
443c4fc5695SMarc-André Lureau extern const size_t hw_compat_2_1_len;
444c4fc5695SMarc-André Lureau 
4450d09e41aSPaolo Bonzini #endif
446