mirror of
https://github.com/projectacrn/acrn-hypervisor.git
synced 2025-09-18 07:18:45 +00:00
dm: add ssram support for user VM
Hook ssram init && de-init functions to vdev devices lifecycle management: 1) initialize ssram when vdev devices are initialized. 2) de-initialize ssram when vdev devices are reset or destroyed. notes: ssram configuration data can be released only when user VM shutdown, hence it can't be done in deinit_vssram(). - VM reboot: do deinit_vssram() only. - VM shutdown: do both deinit_vssram() and clean_vssram_config(). Tracked-On: #7010 Signed-off-by: Yonghua Huang <yonghua.huang@intel.com> Acked-by: Wang Yu1 <yu1.wang@intel.com>
This commit is contained in:
committed by
acrnsi-robot
parent
5ff532b08c
commit
6bf70e3e35
@@ -484,6 +484,9 @@ vm_init_vdevs(struct vmctx *ctx)
|
||||
if (debugexit_enabled)
|
||||
init_debugexit();
|
||||
|
||||
if ((ssram) && (init_vssram(ctx) < 0))
|
||||
goto ssram_fail;
|
||||
|
||||
ret = monitor_init(ctx);
|
||||
if (ret < 0)
|
||||
goto monitor_fail;
|
||||
@@ -505,6 +508,9 @@ pci_fail:
|
||||
deinit_mmio_devs(ctx);
|
||||
mmio_dev_fail:
|
||||
monitor_close();
|
||||
ssram_fail:
|
||||
if (ssram)
|
||||
deinit_vssram(ctx);
|
||||
monitor_fail:
|
||||
if (debugexit_enabled)
|
||||
deinit_debugexit();
|
||||
@@ -539,6 +545,9 @@ vm_deinit_vdevs(struct vmctx *ctx)
|
||||
if (debugexit_enabled)
|
||||
deinit_debugexit();
|
||||
|
||||
if (ssram)
|
||||
deinit_vssram(ctx);
|
||||
|
||||
vhpet_deinit(ctx);
|
||||
vpit_deinit(ctx);
|
||||
vrtc_deinit(ctx);
|
||||
@@ -574,6 +583,9 @@ vm_reset_vdevs(struct vmctx *ctx)
|
||||
if (debugexit_enabled)
|
||||
deinit_debugexit();
|
||||
|
||||
if (ssram)
|
||||
deinit_vssram(ctx);
|
||||
|
||||
vhpet_deinit(ctx);
|
||||
vpit_deinit(ctx);
|
||||
vrtc_deinit(ctx);
|
||||
@@ -591,6 +603,9 @@ vm_reset_vdevs(struct vmctx *ctx)
|
||||
if (debugexit_enabled)
|
||||
init_debugexit();
|
||||
|
||||
if (ssram)
|
||||
init_vssram(ctx);
|
||||
|
||||
ioapic_init(ctx);
|
||||
init_pci(ctx);
|
||||
|
||||
|
Reference in New Issue
Block a user