hw/cxl: Push linking of CXL targets into i386/pc rather than in machine.c
Whilst here take the oportunity to shorten the function name. Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com> Reviewed-by: Ben Widawsky <ben@bwidawsk.net> Message-Id: <20220608145440.26106-4-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
513598050a
commit
dab390ff24
|
@ -8,7 +8,7 @@
|
||||||
#include "hw/cxl/cxl.h"
|
#include "hw/cxl/cxl.h"
|
||||||
#include "hw/cxl/cxl_host.h"
|
#include "hw/cxl/cxl_host.h"
|
||||||
|
|
||||||
void cxl_fixed_memory_window_link_targets(Error **errp) {};
|
void cxl_fmws_link_targets(CXLState *stat, Error **errp) {};
|
||||||
void cxl_machine_init(Object *obj, CXLState *state) {};
|
void cxl_machine_init(Object *obj, CXLState *state) {};
|
||||||
|
|
||||||
const MemoryRegionOps cfmws_ops;
|
const MemoryRegionOps cfmws_ops;
|
||||||
|
|
|
@ -68,14 +68,12 @@ static void cxl_fixed_memory_window_config(CXLState *cxl_state,
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
void cxl_fixed_memory_window_link_targets(Error **errp)
|
void cxl_fmws_link_targets(CXLState *cxl_state, Error **errp)
|
||||||
{
|
{
|
||||||
MachineState *ms = MACHINE(qdev_get_machine());
|
if (cxl_state && cxl_state->fixed_windows) {
|
||||||
|
|
||||||
if (ms->cxl_devices_state && ms->cxl_devices_state->fixed_windows) {
|
|
||||||
GList *it;
|
GList *it;
|
||||||
|
|
||||||
for (it = ms->cxl_devices_state->fixed_windows; it; it = it->next) {
|
for (it = cxl_state->fixed_windows; it; it = it->next) {
|
||||||
CXLFixedWindow *fw = it->data;
|
CXLFixedWindow *fw = it->data;
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
|
|
|
@ -732,6 +732,11 @@ void pc_machine_done(Notifier *notifier, void *data)
|
||||||
PCMachineState *pcms = container_of(notifier,
|
PCMachineState *pcms = container_of(notifier,
|
||||||
PCMachineState, machine_done);
|
PCMachineState, machine_done);
|
||||||
X86MachineState *x86ms = X86_MACHINE(pcms);
|
X86MachineState *x86ms = X86_MACHINE(pcms);
|
||||||
|
MachineState *ms = MACHINE(pcms);
|
||||||
|
|
||||||
|
if (ms->cxl_devices_state) {
|
||||||
|
cxl_fmws_link_targets(ms->cxl_devices_state, &error_fatal);
|
||||||
|
}
|
||||||
|
|
||||||
/* set the number of CPUs */
|
/* set the number of CPUs */
|
||||||
x86_rtc_set_cpus_count(x86ms->rtc, x86ms->boot_cpus);
|
x86_rtc_set_cpus_count(x86ms->rtc, x86ms->boot_cpus);
|
||||||
|
|
|
@ -53,6 +53,4 @@ struct CXLHost {
|
||||||
#define TYPE_PXB_CXL_HOST "pxb-cxl-host"
|
#define TYPE_PXB_CXL_HOST "pxb-cxl-host"
|
||||||
OBJECT_DECLARE_SIMPLE_TYPE(CXLHost, PXB_CXL_HOST)
|
OBJECT_DECLARE_SIMPLE_TYPE(CXLHost, PXB_CXL_HOST)
|
||||||
|
|
||||||
void cxl_fixed_memory_window_link_targets(Error **errp);
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -15,6 +15,7 @@
|
||||||
#define CXL_HOST_H
|
#define CXL_HOST_H
|
||||||
|
|
||||||
void cxl_machine_init(Object *obj, CXLState *state);
|
void cxl_machine_init(Object *obj, CXLState *state);
|
||||||
|
void cxl_fmws_link_targets(CXLState *stat, Error **errp);
|
||||||
|
|
||||||
extern const MemoryRegionOps cfmws_ops;
|
extern const MemoryRegionOps cfmws_ops;
|
||||||
|
|
||||||
|
|
|
@ -93,7 +93,6 @@
|
||||||
#include "qemu/config-file.h"
|
#include "qemu/config-file.h"
|
||||||
#include "qemu/qemu-options.h"
|
#include "qemu/qemu-options.h"
|
||||||
#include "qemu/main-loop.h"
|
#include "qemu/main-loop.h"
|
||||||
#include "hw/cxl/cxl.h"
|
|
||||||
#ifdef CONFIG_VIRTFS
|
#ifdef CONFIG_VIRTFS
|
||||||
#include "fsdev/qemu-fsdev.h"
|
#include "fsdev/qemu-fsdev.h"
|
||||||
#endif
|
#endif
|
||||||
|
@ -2568,7 +2567,6 @@ void qmp_x_exit_preconfig(Error **errp)
|
||||||
|
|
||||||
qemu_init_board();
|
qemu_init_board();
|
||||||
qemu_create_cli_devices();
|
qemu_create_cli_devices();
|
||||||
cxl_fixed_memory_window_link_targets(errp);
|
|
||||||
qemu_machine_creation_done();
|
qemu_machine_creation_done();
|
||||||
|
|
||||||
if (loadvm) {
|
if (loadvm) {
|
||||||
|
|
Loading…
Reference in New Issue