From mboxrd@z Thu Jan 1 00:00:00 1970 From: Iurii Konovalenko Subject: Re: Size of irq field Date: Fri, 3 Apr 2015 15:40:00 +0300 Message-ID: References: <551D61A2.6020201@citrix.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============1792233791971563310==" Return-path: In-Reply-To: <551D61A2.6020201@citrix.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Julien Grall Cc: Embedded-pv-devel@lists.xenproject.org, Julien Grall , Ian Campbell , Stefano Stabellini , "xen-devel@lists.xen.org" List-Id: xen-devel@lists.xenproject.org --===============1792233791971563310== Content-Type: multipart/alternative; boundary=001a11402ada20656e0512d13f60 --001a11402ada20656e0512d13f60 Content-Type: text/plain; charset=UTF-8 Hi, Ian! Hi, Julien! Thank you for your replies. On Thu, Apr 2, 2015 at 6:19 PM, Ian Campbell wrote: > Please can you give some example of this? On Thu, Apr 2, 2015 at 6:34 PM, Julien Grall 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 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 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 --001a11402ada20656e0512d13f60 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: base64 PGRpdiBkaXI9Imx0ciI+PGRpdj48ZGl2PjxkaXY+PGRpdj5IaSwgSWFuISBIaSwgSnVsaWVuITxi cj5UaGFuayB5b3UgZm9yIHlvdXIgcmVwbGllcy48YnI+PGJyPk9uIFRodSwgQXByIDIsIDIwMTUg YXQgNjoxOSBQTSwgSWFuIENhbXBiZWxsICZsdDs8YSBocmVmPSJtYWlsdG86aWFuLmNhbXBiZWxs QGNpdHJpeC5jb20iPmlhbi5jYW1wYmVsbEBjaXRyaXguY29tPC9hPiZndDsgd3JvdGU6PGJyPiZn dDsgUGxlYXNlIGNhbiB5b3UgZ2l2ZSBzb21lIGV4YW1wbGUgb2YgdGhpcz88YnI+T24gVGh1LCBB cHIgMiwgMjAxNSBhdCA2OjM0IFBNLCBKdWxpZW4gR3JhbGwgJmx0OzxhIGhyZWY9Im1haWx0bzpq dWxpZW4uZ3JhbGxAY2l0cml4LmNvbSI+anVsaWVuLmdyYWxsQGNpdHJpeC5jb208L2E+Jmd0OyB3 cm90ZTo8YnI+Jmd0OyBDYW4geW91IGdpdmUgYW4gZXhhbXBsZSBvZiBmaWxlcy9zdHJ1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N0 IHJlZ2FyZHMuPC9kaXY+PGRpdj48YnI+PHNwYW4gc3R5bGU9ImZvbnQtZmFtaWx5OkFyaWFsO2Zv bnQtc2l6ZToxMnB4O2ZvbnQtc3R5bGU6bm9ybWFsO2ZvbnQtdmFyaWFudDpub3JtYWw7dGV4dC1k ZWNvcmF0aW9uOm5vbmU7dmVydGljYWwtYWxpZ246YmFzZWxpbmU7YmFja2dyb3VuZC1jb2xvcjp0 cmFuc3BhcmVudCI+SXVyaWkgS29ub3ZhbGVua2/CoHwgU2VuaW9yIFNvZnR3YXJlIEVuZ2luZWVy PC9zcGFuPjwvZGl2PjxkaXY+PHNwYW4gc3R5bGU9ImZvbnQtZmFtaWx5OkFyaWFsO2ZvbnQtc2l6 ZToxMnB4O2ZvbnQtc3R5bGU6bm9ybWFsO2ZvbnQtdmFyaWFudDpub3JtYWw7Zm9udC13ZWlnaHQ6 Ym9sZDt0ZXh0LWRlY29yYXRpb246bm9uZTt2ZXJ0aWNhbC1hbGlnbjpiYXNlbGluZTtiYWNrZ3Jv dW5kLWNvbG9yOnRyYW5zcGFyZW50Ij48L3NwYW4+PHNwYW4gc3R5bGU9ImZvbnQtZmFtaWx5OkFy aWFsO2ZvbnQtc2l6ZToxMnB4O2ZvbnQtc3R5bGU6bm9ybWFsO2ZvbnQtdmFyaWFudDpub3JtYWw7 Zm9udC13ZWlnaHQ6bm9ybWFsO3RleHQtZGVjb3JhdGlvbjpub25lO3ZlcnRpY2FsLWFsaWduOmJh c2VsaW5lO2JhY2tncm91bmQtY29sb3I6dHJhbnNwYXJlbnQiPkdsb2JhbExvZ2ljPC9zcGFuPjwv ZGl2Pjxicj48L2Rpdj48L2Rpdj48L2Rpdj48L2Rpdj48L2Rpdj4NCg== --001a11402ada20656e0512d13f60-- --===============1792233791971563310== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Xen-devel mailing list Xen-devel@lists.xen.org http://lists.xen.org/xen-devel --===============1792233791971563310==--