diff options
author | Wei Liu <liuw@liuw.name> | 2011-05-26 15:01:17 +0100 |
---|---|---|
committer | Wei Liu <liuw@liuw.name> | 2011-05-26 15:01:17 +0100 |
commit | 79df5f2ba8d3f892cadd0dc10b26864601ab0019 (patch) | |
tree | 9327a1d39b6d60abfb155b2b8dee280937dadd7e /tools/libxc/xc_misc.c | |
parent | 080bc640708f40ade856a4eba67f47781415d754 (diff) | |
download | xen-79df5f2ba8d3f892cadd0dc10b26864601ab0019.tar.gz xen-79df5f2ba8d3f892cadd0dc10b26864601ab0019.tar.bz2 xen-79df5f2ba8d3f892cadd0dc10b26864601ab0019.zip |
libxc: add new operation in HVMOP to deliver emulated MSI.
Signed-off-by: Wei Liu <liuw@liuw.name>
Diffstat (limited to 'tools/libxc/xc_misc.c')
-rw-r--r-- | tools/libxc/xc_misc.c | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/tools/libxc/xc_misc.c b/tools/libxc/xc_misc.c index b87bbc0cf9..a99aebb8ad 100644 --- a/tools/libxc/xc_misc.c +++ b/tools/libxc/xc_misc.c @@ -417,6 +417,35 @@ int xc_hvm_set_pci_link_route( return rc; } +int xc_hvm_inject_msi( + xc_interface *xch, domid_t dom, uint64_t addr, uint32_t data) +{ + DECLARE_HYPERCALL; + DECLARE_HYPERCALL_BUFFER(struct xen_hvm_inj_msi, arg); + int rc; + + arg = xc_hypercall_buffer_alloc(xch, arg, sizeof(*arg)); + if ( arg == NULL ) + { + PERROR("Could not allocate memory for xc_hvm_inj_msi hypercall"); + return -1; + } + + hypercall.op = __HYPERVISOR_hvm_op; + hypercall.arg[0] = HVMOP_inj_msi; + hypercall.arg[1] = HYPERCALL_BUFFER_AS_ARG(arg); + + arg->domid = dom; + arg->addr = addr; + arg->data = data; + + rc = do_xen_hypercall(xch, &hypercall); + + xc_hypercall_buffer_free(xch, arg); + + return rc; +} + int xc_hvm_track_dirty_vram( xc_interface *xch, domid_t dom, uint64_t first_pfn, uint64_t nr, |