Skip to content

Commit b33012a

Browse files
fyin1lijinxia
authored andcommitted
DM: add vm reset API
vm reset API will be used by guest system reset and S3. Signed-off-by: Yin Fengwei <fengwei.yin@intel.com> Acked-by: Anthony Xu <anthony.xu@intel.com>
1 parent 8d12c06 commit b33012a

File tree

3 files changed

+8
-0
lines changed

3 files changed

+8
-0
lines changed

devicemodel/core/vmmapi.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -405,6 +405,12 @@ vm_pause(struct vmctx *ctx)
405405
ioctl(ctx->fd, IC_PAUSE_VM, &ctx->vmid);
406406
}
407407

408+
void
409+
vm_reset(struct vmctx *ctx)
410+
{
411+
ioctl(ctx->fd, IC_RESET_VM, &ctx->vmid);
412+
}
413+
408414
static int suspend_mode = VM_SUSPEND_NONE;
409415

410416
void

devicemodel/include/public/vhm_ioctl_defs.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,7 @@
7272
#define IC_START_VM _IC_ID(IC_ID, IC_ID_VM_BASE + 0x02)
7373
#define IC_PAUSE_VM _IC_ID(IC_ID, IC_ID_VM_BASE + 0x03)
7474
#define IC_CREATE_VCPU _IC_ID(IC_ID, IC_ID_VM_BASE + 0x04)
75+
#define IC_RESET_VM _IC_ID(IC_ID, IC_ID_VM_BASE + 0x05)
7576

7677
/* IRQ and Interrupts */
7778
#define IC_ID_IRQ_BASE 0x20UL

devicemodel/include/vmmapi.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,7 @@ int vm_get_device_fd(struct vmctx *ctx);
9999
struct vmctx *vm_open(const char *name);
100100
void vm_close(struct vmctx *ctx);
101101
void vm_pause(struct vmctx *ctx);
102+
void vm_reset(struct vmctx *ctx);
102103
int vm_set_shared_io_page(struct vmctx *ctx, uint64_t page_vma);
103104
int vm_create_ioreq_client(struct vmctx *ctx);
104105
int vm_destroy_ioreq_client(struct vmctx *ctx);

0 commit comments

Comments
 (0)