[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] [PATCH 2/2] libxc: enabling emulated MSI injection



On Thu, May 26, 2011 at 8:34 PM, Konrad Rzeszutek Wilk
<konrad.wilk@xxxxxxxxxx> wrote:
> On Thu, May 26, 2011 at 11:09:43AM +0800, Wei Liu wrote:
>> commit 67038b5b18096b3bdcda7fe393d1be6a91dc75a6
>> Author: Wei Liu <liuw@xxxxxxxxx>
>> Date: Â Thu May 26 10:27:41 2011 +0800
>>
>> Â Â libxc: add new operation in HVMOP to deliver emulated MSI.
>
> What is the purpose of this call?

Sorry I missed this one.

Currently QEMU cannot inject MSI for emulated devices, which limits
virtio to use irq to deliver interrupts. This call is used to inject
MSI from QEMU to HVM, suggested by Stefano.

>>
>> Â Â Signed-off-by: Wei Liu <liuw@xxxxxxxxx>
>>
>> diff --git a/tools/libxc/xc_misc.c b/tools/libxc/xc_misc.c
>> index b87bbc0..38af397 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_inj_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;
>
> Shouldn't those be done before you make the HYPERCALL_BUFFER_AS_ARG
> in case they get bounced?
>
>> +
>> + Â Â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,
>> diff --git a/tools/libxc/xenctrl.h b/tools/libxc/xenctrl.h
>> index 9a4355f..2442c84 100644
>> --- a/tools/libxc/xenctrl.h
>> +++ b/tools/libxc/xenctrl.h
>> @@ -1387,6 +1387,8 @@ int xc_hvm_set_isa_irq_level(
>> Âint xc_hvm_set_pci_link_route(
>> Â Â Âxc_interface *xch, domid_t dom, uint8_t link, uint8_t isa_irq);
>>
>> +int xc_hvm_inj_msi(
>> + Â Âxc_interface *xch, domid_t dom, uint64_t addr, uint32_t data);
>>
>> Â/*
>> Â * Track dirty bit changes in the VRAM area
>>
>> --
>> Best regards
>> Wei Liu
>> Twitter: @iliuw
>> Site: http://liuw.name
>>
>> _______________________________________________
>> Xen-devel mailing list
>> Xen-devel@xxxxxxxxxxxxxxxxxxx
>> http://lists.xensource.com/xen-devel
>



-- 
Best regards
Wei Liu
Twitter: @iliuw
Site: http://liuw.name

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.