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

Re: [Xen-devel] Size of irq field



Hi, Ian! Hi, Julien!
Thank you for your replies.

On Thu, Apr 2, 2015 at 6:19 PM, Ian Campbell <ian.campbell@xxxxxxxxxx> wrote:
> Please can you give some example of this?
On Thu, Apr 2, 2015 at 6:34 PM, Julien Grall <julien.grall@xxxxxxxxxx> wrote:
> Can you give an example of files/structures using uint8_t for IRQ?

As Julien wrote, it is related to irq_permission. I am not sure if it is supported on ARM, but we use it, and this function fails during domain creation, because IRQ number is truncated and permission operation is applied for incorrect IRQ, so domain creation fails. So, do we need to change logic and do not check IRQ permissions?

In tools/libxc/include/xenctrl.h:
int xc_domain_irq_permission(xc_interface *xch,
ÂÂÂ uint32_t domid,
ÂÂÂ uint8_t pirq,
ÂÂÂ uint8_t allow_access);

In tools/libxc/xc_domain.c:
int xc_domain_irq_permission(xc_interface *xch,
ÂÂÂ uint32_t domid,
ÂÂÂ uint8_t pirq,
ÂÂÂ uint8_t allow_access)

In xen/include/public/domctl.h:
struct xen_domctl_irq_permission {
ÂÂÂ
uint8_t pirq;
ÂÂÂ
uint8_t allow_access;
};

Also, as we plan to use passtrough, we there are such places:
In tools/libxc/include/xenctrl.h:
int xc_domain_bind_pt_irq(xc_interface *xch,
ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂ uint32_t domid,
ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂ uint8_t machine_irq,
ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂ uint8_t irq_type,
ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂ uint8_t bus,
ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂ uint8_t device,
ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂ uint8_t intx,
ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂ uint8_t isa_irq);

int xc_domain_unbind_pt_irq(xc_interface *xch,
ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂ uint32_t domid,
ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂ uint8_t machine_irq,
ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂ uint8_t irq_type,
ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂ uint8_t bus,
ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂ uint8_t device,
ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂ uint8_t intx,
ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂ uint8_t isa_irq);

int xc_domain_bind_pt_pci_irq(xc_interface *xch,
ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂ uint32_t domid,
ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂ uint8_t machine_irq,
ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂ uint8_t bus,
ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂ uint8_t device,
ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂ uint8_t intx);

int xc_domain_bind_pt_isa_irq(xc_interface *xch,
ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂ uint32_t domid,
ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂ uint8_t machine_irq);

And theirs implementation in tools/libxc/xc_domain.c


On Thu, Apr 2, 2015 at 6:19 PM, Ian Campbell <ian.campbell@xxxxxxxxxx> wrote:
> We should certainly fix anywhere which is not using a large enough data
> type.
On Thu, Apr 2, 2015 at 6:34 PM, Julien Grall <julien.grall@xxxxxxxxxx> wrote:
> Ideally the IRQ should use uint32_t. This is allow us to support LPIs (IRQ
> number start a 8192 up to a very high number).

I have patch that increase size to uint32_t for cases, I described previously. Can I push it for review?

Best regards.

Iurii KonovalenkoÂ| Senior Software Engineer
GlobalLogic

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel

 


Rackspace

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