mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-04 16:23:55 -06:00
hw/cxl: Make the CXL fixed memory window setup a machine parameter.
Paolo Bonzini requested this change to simplify the ongoing effort to allow machine setup entirely via RPC. Includes shortening the command line form cxl-fixed-memory-window to cxl-fmw as the command lines are extremely long even with this change. The json change is needed to ensure that there is a CXLFixedMemoryWindowOptionsList even though the actual element in the json is never used. Similar to existing SgxEpcProperties. Update qemu-options.hx to reflect that this is now a -machine parameter. The bulk of -M / -machine parameters are documented under machine, so use that in preference to M. Update cxl-test and bios-tables-test to reflect new parameters. Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com> Reviewed-by: Ben Widawsky <ben@bwidawsk.net> Reviewed-by: Davidlohr Bueso <dave@stgolabs.net> Message-Id: <20220608145440.26106-2-Jonathan.Cameron@huawei.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
This commit is contained in:
parent
92344e76b8
commit
03b39fcf64
14 changed files with 150 additions and 126 deletions
44
softmmu/vl.c
44
softmmu/vl.c
|
@ -147,12 +147,6 @@ typedef struct BlockdevOptionsQueueEntry {
|
|||
|
||||
typedef QSIMPLEQ_HEAD(, BlockdevOptionsQueueEntry) BlockdevOptionsQueue;
|
||||
|
||||
typedef struct CXLFMWOptionQueueEntry {
|
||||
CXLFixedMemoryWindowOptions *opts;
|
||||
Location loc;
|
||||
QSIMPLEQ_ENTRY(CXLFMWOptionQueueEntry) entry;
|
||||
} CXLFMWOptionQueueEntry;
|
||||
|
||||
typedef struct ObjectOption {
|
||||
ObjectOptions *opts;
|
||||
QTAILQ_ENTRY(ObjectOption) next;
|
||||
|
@ -179,8 +173,6 @@ static int snapshot;
|
|||
static bool preconfig_requested;
|
||||
static QemuPluginList plugin_list = QTAILQ_HEAD_INITIALIZER(plugin_list);
|
||||
static BlockdevOptionsQueue bdo_queue = QSIMPLEQ_HEAD_INITIALIZER(bdo_queue);
|
||||
static QSIMPLEQ_HEAD(, CXLFMWOptionQueueEntry) CXLFMW_opts =
|
||||
QSIMPLEQ_HEAD_INITIALIZER(CXLFMW_opts);
|
||||
static bool nographic = false;
|
||||
static int mem_prealloc; /* force preallocation of physical target memory */
|
||||
static const char *vga_model = NULL;
|
||||
|
@ -1072,24 +1064,6 @@ static void parse_display(const char *p)
|
|||
}
|
||||
}
|
||||
|
||||
static void parse_cxl_fixed_memory_window(const char *optarg)
|
||||
{
|
||||
CXLFMWOptionQueueEntry *cfmws_entry;
|
||||
Visitor *v;
|
||||
|
||||
v = qobject_input_visitor_new_str(optarg, "cxl-fixed-memory-window",
|
||||
&error_fatal);
|
||||
cfmws_entry = g_new(CXLFMWOptionQueueEntry, 1);
|
||||
visit_type_CXLFixedMemoryWindowOptions(v, NULL, &cfmws_entry->opts,
|
||||
&error_fatal);
|
||||
if (!cfmws_entry->opts) {
|
||||
exit(1);
|
||||
}
|
||||
visit_free(v);
|
||||
loc_save(&cfmws_entry->loc);
|
||||
QSIMPLEQ_INSERT_TAIL(&CXLFMW_opts, cfmws_entry, entry);
|
||||
}
|
||||
|
||||
static inline bool nonempty_str(const char *str)
|
||||
{
|
||||
return str && *str;
|
||||
|
@ -1948,20 +1922,6 @@ static void qemu_create_late_backends(void)
|
|||
qemu_semihosting_console_init();
|
||||
}
|
||||
|
||||
static void cxl_set_opts(void)
|
||||
{
|
||||
while (!QSIMPLEQ_EMPTY(&CXLFMW_opts)) {
|
||||
CXLFMWOptionQueueEntry *cfmws_entry = QSIMPLEQ_FIRST(&CXLFMW_opts);
|
||||
|
||||
loc_restore(&cfmws_entry->loc);
|
||||
QSIMPLEQ_REMOVE_HEAD(&CXLFMW_opts, entry);
|
||||
cxl_fixed_memory_window_config(current_machine, cfmws_entry->opts,
|
||||
&error_fatal);
|
||||
qapi_free_CXLFixedMemoryWindowOptions(cfmws_entry->opts);
|
||||
g_free(cfmws_entry);
|
||||
}
|
||||
}
|
||||
|
||||
static void qemu_resolve_machine_memdev(void)
|
||||
{
|
||||
if (ram_memdev_id) {
|
||||
|
@ -2789,9 +2749,6 @@ void qemu_init(int argc, char **argv, char **envp)
|
|||
exit(1);
|
||||
}
|
||||
break;
|
||||
case QEMU_OPTION_cxl_fixed_memory_window:
|
||||
parse_cxl_fixed_memory_window(optarg);
|
||||
break;
|
||||
case QEMU_OPTION_display:
|
||||
parse_display(optarg);
|
||||
break;
|
||||
|
@ -3598,7 +3555,6 @@ void qemu_init(int argc, char **argv, char **envp)
|
|||
|
||||
qemu_resolve_machine_memdev();
|
||||
parse_numa_opts(current_machine);
|
||||
cxl_set_opts();
|
||||
|
||||
if (vmstate_dump_file) {
|
||||
/* dump and exit */
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue