Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 20 Oct 2022 11:43:23 +0100
From:      Andrew Turner <andrew@fubar.geek.nz>
To:        Souradeep Chakrabarti <schakrabarti@microsoft.com>
Cc:        Warner Losh <imp@bsdimp.com>, "freebsd-hackers@freebsd.org" <freebsd-hackers@freebsd.org>, Wei Hu <weh@microsoft.com>
Subject:   Re: [EXTERNAL] allocating IRQ mentioned in _CRS of ACPI
Message-ID:  <F4CD9D0B-980D-40E5-B17B-A1D87B46EA3C@fubar.geek.nz>
In-Reply-To: <PSAP153MB0536D3DC3F8C7E37CC121C2ECC2B9@PSAP153MB0536.APCP153.PROD.OUTLOOK.COM>
References:  <PSAP153MB053667A618629ACFFDCEDCBFCC249@PSAP153MB0536.APCP153.PROD.OUTLOOK.COM> <PSAP153MB053698CAD8CB5439C99355B4CC249@PSAP153MB0536.APCP153.PROD.OUTLOOK.COM> <PSAP153MB053688DD7E9B60CE5AEB17A6CC289@PSAP153MB0536.APCP153.PROD.OUTLOOK.COM> <CANCZdfotdfuwK1t7efmh%2B_jNxjEJj4UmdrWhTVmUktZC9auzEQ@mail.gmail.com> <PSAP153MB0536D3DC3F8C7E37CC121C2ECC2B9@PSAP153MB0536.APCP153.PROD.OUTLOOK.COM>

next in thread | previous in thread | raw e-mail | index | archive | help

[-- Attachment #1 --]
Based on my reading of the ACPI tables, and looking how Linux handles it I don’t think the vmbus_res driver should be used. If the vmbus driver was to attach to the “VMBUS" _HID it would be able to manage the interrupt directly.

Ideally acpi_syscontainer would become a proper bus, but that would need checking that existing drivers that depend on the current behaviour still work.

Andrew

> On 19 Oct 2022, at 18:51, Souradeep Chakrabarti <schakrabarti@microsoft.com> wrote:
> 
> Hi Warner,
>  
> 1) PCI mmio resource in HID "ACPI0004", which is needed by the FreeBSD guest for SRIOV devices.
>  
>    Device (\_SB.VMOD)    <-- This is currently owned by acpi_syscontainer module on FreeBSD
>     {
>         Name (_HID, "ACPI0004" /* Module Device */)  // _HID: Hardware ID
>         Name (_UID, Zero)  // _UID: Unique ID
>         Name (_CRS, ResourceTemplate ()  // _CRS: Current Resource Settings
>         {
>             ...
>         }
>         CreateDWordField (_CRS, \_SB.VMOD._Y00._MIN, MIN6)  // _MIN: Minimum Base Address
>         CreateDWordField (_CRS, \_SB.VMOD._Y00._MAX, MAX6)  // _MAX: Maximum Base Address
>         CreateDWordField (_CRS, \_SB.VMOD._Y00._LEN, LEN6)  // _LEN: Length
>         CreateQWordField (_CRS, \_SB.VMOD._Y01._MIN, MIN7)  // _MIN: Minimum Base Address
>         CreateQWordField (_CRS, \_SB.VMOD._Y01._MAX, MAX7)  // _MAX: Maximum Base Address
>         CreateQWordField (_CRS, \_SB.VMOD._Y01._LEN, LEN7)  // _LEN: Length
>         Method (_INI, 0, NotSerialized)  // _INI: Initialize
>         {
>             MIN6 = MG2B /* \MG2B */
>             LEN6 = MG2L /* \MG2L */
>             Local0 = MG2L /* \MG2L */
>             MAX6 = (MIN6 + Local0--)
>             Local1 = (HMIB << 0x14)
>             Local2 = (HMIL << 0x14)
>             MIN7 = Local1
>             LEN7 = Local2
>             Local0 = Local2
>             MAX7 = (MIN7 + Local0--)
>         }
>     }
>  
> 2) Vmbus IRQ resource in HID "VMBus", which is needed to get Hyper-V vmbus interrupt to work on guests.
> Device (\_SB.VMOD.VMBS)   <--- currently owned by vmbus_res module on FreeBSD
>     {
>         ...
>         Name (_HID, "VMBus")  // _HID: Hardware ID
>         Name (_UID, Zero)  // _UID: Unique ID
>         ...
>         Name (_CRS, ResourceTemplate ()  // _CRS: Current Resource Settings
>         {
>             Interrupt (ResourceConsumer, Edge, ActiveHigh, Exclusive, ,, )
>             {
>                 0x00000012,
>             }
>         })
>     }
>  
> <image001.png>
>  
> Today I was able to get both IRQ and MMIO allocation successful using below snippet in vmbus:
>  
> +       device_t dev =  devclass_get_device(devclass_find("vmbus_res"), 0);
> +       sc->ires = bus_alloc_resource_any(dev,
>             SYS_RES_IRQ, &sc->vector, RF_ACTIVE | RF_SHAREABLE);
>  
>  
> Thanks & Regards,
>  Souradeep
>  
> From: Warner Losh <imp@bsdimp.com> 
> Sent: Wednesday, October 19, 2022 11:09 PM
> To: Souradeep Chakrabarti <schakrabarti@microsoft.com>
> Cc: freebsd-hackers@freebsd.org; Wei Hu <weh@microsoft.com>
> Subject: [EXTERNAL] Re: allocating IRQ mentioned in _CRS of ACPI
>  
> Sorry for the late reply... I've been busy with some things for work...
>  
> I think you'll need to get the parent of vmbus to allow a pass through allocation. What bus is that
> currently?
>  
> Warner
>  
> On Tue, Oct 18, 2022 at 12:33 PM Souradeep Chakrabarti <schakrabarti@microsoft.com <mailto:schakrabarti@microsoft.com>> wrote:
> Hi,
> It will be a great help, if someone can help here with some idea.
> As it is blocking the FreeBSD on Hyper-V ARM64.
> 
> Thanks & Regards,
> Souradeep
> 
> > -----Original Message-----
> > From: Souradeep Chakrabarti
> > Sent: Friday, October 14, 2022 1:24 PM
> > To: 'Warner Losh' <imp@bsdimp.com <mailto:imp@bsdimp.com>>
> > Cc: freebsd-hackers@freebsd.org <mailto:freebsd-hackers@freebsd.org>; Wei Hu <weh@microsoft.com <mailto:weh@microsoft.com>>
> > Subject: RE: allocating IRQ mentioned in _CRS of ACPI
> > 
> > Last mail was having incorrect FreeBSD hacker alias. Replacing that with correct
> > one here.
> > 
> > 
> > > -----Original Message-----
> > > From: Souradeep Chakrabarti
> > > Sent: Friday, October 14, 2022 1:19 PM
> > > To: Warner Losh <imp@bsdimp.com <mailto:imp@bsdimp.com>>
> > > Cc: hacker@freebsd.org <mailto:hacker@freebsd.org>; Wei Hu <weh@microsoft.com <mailto:weh@microsoft.com>>
> > > Subject: allocating IRQ mentioned in _CRS of ACPI
> > >
> > > Hi,
> > > I would like to allocate IRQ to a device, mentioned in the _CRS of
> > > that device in ACPI table.
> > > I have tried with bus_alloc_resource_any(), but it is failing as the
> > > parent of that device is not owning the IRQ.
> > >
> > > Current ACPI topo for the device :
> > > ACPI0->SB.VMOD(HID ACPI0004, has SYS_RES_MEM for MMIO in _CRS)-
> > > >VMBUS( it has SYS_RES_IRQ in it's _CRS).
> > >
> > > How can I get here both SYS_RES_IRQ and SYS_RES_MEM allocated to VMBUS?
> > >
> > > Thanks & Regards,
> > > Souradeep


[-- Attachment #2 --]
<html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class="">Based on my reading of the ACPI tables, and looking how Linux handles it I don’t think the vmbus_res driver should be used. If the vmbus driver was to attach to the “VMBUS" _HID it would be able to manage the interrupt directly.<div class=""><br class=""></div><div class="">Ideally acpi_syscontainer would become a proper bus, but that would need checking that existing drivers that depend on the current behaviour still work.<br class=""><div class=""><br class=""></div><div class="">Andrew<br class=""><div><br class=""><blockquote type="cite" class=""><div class="">On 19 Oct 2022, at 18:51, Souradeep Chakrabarti &lt;<a href="mailto:schakrabarti@microsoft.com" class="">schakrabarti@microsoft.com</a>&gt; wrote:</div><br class="Apple-interchange-newline"><div class=""><meta charset="UTF-8" class=""><div class="WordSection1" style="page: WordSection1; caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;"><div style="margin: 0cm; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><span class="">Hi Warner,<o:p class=""></o:p></span></div><div style="margin: 0cm; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><span class=""><o:p class="">&nbsp;</o:p></span></div><div style="margin: 0cm; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><span lang="EN-US" class="">1) PCI mmio resource in HID "ACPI0004", which is needed by the FreeBSD guest for SRIOV devices.<o:p class=""></o:p></span></div><div style="margin: 0cm; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><span lang="EN-US" class=""><o:p class="">&nbsp;</o:p></span></div><div style="margin: 0cm; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><span lang="EN-US" class="">&nbsp;&nbsp; Device (\_SB.VMOD)&nbsp;&nbsp;&nbsp; &lt;-- This is currently owned by acpi_syscontainer module on FreeBSD<o:p class=""></o:p></span></div><div style="margin: 0cm; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><span lang="EN-US" class="">&nbsp;&nbsp;&nbsp; {<o:p class=""></o:p></span></div><div style="margin: 0cm; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><span lang="EN-US" class="">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Name (_HID, "<span style="background-color: yellow;" class="">ACPI0004</span>" /* Module Device */)&nbsp; // _HID: Hardware ID<o:p class=""></o:p></span></div><div style="margin: 0cm; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><span lang="EN-US" class="">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Name (_UID, Zero)&nbsp; // _UID: Unique ID<o:p class=""></o:p></span></div><div style="margin: 0cm; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><span lang="EN-US" class="">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Name (_CRS, ResourceTemplate ()&nbsp; // _CRS: Current Resource Settings<o:p class=""></o:p></span></div><div style="margin: 0cm; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><span lang="EN-US" class="">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {<o:p class=""></o:p></span></div><div style="margin: 0cm; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><span lang="EN-US" class="">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ...<o:p class=""></o:p></span></div><div style="margin: 0cm; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><span lang="EN-US" class="">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<o:p class=""></o:p></span></div><div style="margin: 0cm; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><span lang="EN-US" class="">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; CreateDWordField (_CRS, \_SB.VMOD._Y00._MIN, MIN6)&nbsp; // _MIN: Minimum Base Address<o:p class=""></o:p></span></div><div style="margin: 0cm; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><span lang="EN-US" class="">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; CreateDWordField (_CRS, \_SB.VMOD._Y00._MAX, MAX6)&nbsp; // _MAX: Maximum Base Address<o:p class=""></o:p></span></div><div style="margin: 0cm; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><span lang="EN-US" class="">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; CreateDWordField (_CRS, \_SB.VMOD._Y00._LEN, LEN6)&nbsp; // _LEN: Length<o:p class=""></o:p></span></div><div style="margin: 0cm; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><span lang="EN-US" class="">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; CreateQWordField (_CRS, \_SB.VMOD._Y01._MIN, MIN7)&nbsp; // _MIN: Minimum Base Address<o:p class=""></o:p></span></div><div style="margin: 0cm; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><span lang="EN-US" class="">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; CreateQWordField (_CRS, \_SB.VMOD._Y01._MAX, MAX7)&nbsp; // _MAX: Maximum Base Address<o:p class=""></o:p></span></div><div style="margin: 0cm; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><span lang="EN-US" class="">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; CreateQWordField (_CRS, \_SB.VMOD._Y01._LEN, LEN7)&nbsp; // _LEN: Length<o:p class=""></o:p></span></div><div style="margin: 0cm; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><span lang="EN-US" class="">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Method (_INI, 0, NotSerialized)&nbsp; // _INI: Initialize<o:p class=""></o:p></span></div><div style="margin: 0cm; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><span lang="EN-US" class="">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {<o:p class=""></o:p></span></div><div style="margin: 0cm; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><span lang="EN-US" class="">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; MIN6 = MG2B /* \MG2B */<o:p class=""></o:p></span></div><div style="margin: 0cm; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><span lang="EN-US" class="">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; LEN6 = MG2L /* \MG2L */<o:p class=""></o:p></span></div><div style="margin: 0cm; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><span lang="EN-US" class="">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Local0 = MG2L /* \MG2L */<o:p class=""></o:p></span></div><div style="margin: 0cm; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><span lang="EN-US" class="">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; MAX6 = (MIN6 + Local0--)<o:p class=""></o:p></span></div><div style="margin: 0cm; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><span lang="EN-US" class="">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Local1 = (HMIB &lt;&lt; 0x14)<o:p class=""></o:p></span></div><div style="margin: 0cm; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><span lang="EN-US" class="">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Local2 = (HMIL &lt;&lt; 0x14)<o:p class=""></o:p></span></div><div style="margin: 0cm; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><span lang="EN-US" class="">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; MIN7 = Local1<o:p class=""></o:p></span></div><div style="margin: 0cm; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><span lang="EN-US" class="">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; LEN7 = Local2<o:p class=""></o:p></span></div><div style="margin: 0cm; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><span lang="EN-US" class="">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Local0 = Local2<o:p class=""></o:p></span></div><div style="margin: 0cm; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><span lang="EN-US" class="">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; MAX7 = (MIN7 + Local0--)<o:p class=""></o:p></span></div><div style="margin: 0cm; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><span lang="EN-US" class="">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<o:p class=""></o:p></span></div><div style="margin: 0cm; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><span lang="EN-US" class="">&nbsp;&nbsp;&nbsp; }<o:p class=""></o:p></span></div><div style="margin: 0cm; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><span lang="EN-US" class=""><o:p class="">&nbsp;</o:p></span></div><div style="margin: 0cm; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><span lang="EN-US" class="">2) Vmbus IRQ resource in HID "VMBus", which is needed to get Hyper-V vmbus interrupt to work on guests.<o:p class=""></o:p></span></div><div style="margin: 0cm; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><span lang="EN-US" class="">Device (\_SB.VMOD.VMBS)&nbsp; &nbsp;&lt;--- currently owned by vmbus_res module on FreeBSD<o:p class=""></o:p></span></div><div style="margin: 0cm; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><span lang="EN-US" class="">&nbsp;&nbsp;&nbsp; {<o:p class=""></o:p></span></div><div style="margin: 0cm; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><span lang="EN-US" class="">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ...<o:p class=""></o:p></span></div><div style="margin: 0cm; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><span lang="EN-US" class="">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Name (_HID, "<span style="background-color: yellow;" class="">VMBus</span>")&nbsp; // _HID: Hardware ID<o:p class=""></o:p></span></div><div style="margin: 0cm; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><span lang="EN-US" class="">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Name (_UID, Zero)&nbsp; // _UID: Unique ID<o:p class=""></o:p></span></div><div style="margin: 0cm; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><span lang="EN-US" class="">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ...<o:p class=""></o:p></span></div><div style="margin: 0cm; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><span lang="EN-US" class="">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Name (_CRS, ResourceTemplate ()&nbsp; // _CRS: Current Resource Settings<o:p class=""></o:p></span></div><div style="margin: 0cm; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><span lang="EN-US" class="">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {<o:p class=""></o:p></span></div><div style="margin: 0cm; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><span lang="EN-US" class="">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Interrupt (ResourceConsumer, Edge, ActiveHigh, Exclusive, ,, )<o:p class=""></o:p></span></div><div style="margin: 0cm; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><span lang="EN-US" class="">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {<o:p class=""></o:p></span></div><div style="margin: 0cm; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><span lang="EN-US" class="">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 0x00000012,<o:p class=""></o:p></span></div><div style="margin: 0cm; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><span lang="EN-US" class="">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<o:p class=""></o:p></span></div><div style="margin: 0cm; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><span lang="EN-US" class="">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; })<o:p class=""></o:p></span></div><div style="margin: 0cm; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><span lang="EN-US" class="">&nbsp;&nbsp;&nbsp; }<o:p class=""></o:p></span></div><div style="margin: 0cm; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><span lang="EN-US" class=""><o:p class="">&nbsp;</o:p></span></div><div style="margin: 0cm; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><span class=""><span id="cid:image001.png@01D8E411.80EECBE0">&lt;image001.png&gt;</span></span><span class=""><o:p class=""></o:p></span></div><div style="margin: 0cm; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><span class=""><o:p class="">&nbsp;</o:p></span></div><div style="margin: 0cm; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><span class="">Today I was able to get both IRQ and MMIO allocation successful using below snippet in vmbus:<o:p class=""></o:p></span></div><div style="margin: 0cm; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><span class=""><o:p class="">&nbsp;</o:p></span></div><div style="margin: 0cm; font-size: 11pt; font-family: Calibri, sans-serif;" class="">+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; device_t dev =&nbsp; devclass_get_device(devclass_find("vmbus_res"), 0);<o:p class=""></o:p></div><div style="margin: 0cm; font-size: 11pt; font-family: Calibri, sans-serif;" class="">+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; sc-&gt;ires = bus_alloc_resource_any(dev,<o:p class=""></o:p></div><div style="margin: 0cm; font-size: 11pt; font-family: Calibri, sans-serif;" class="">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; SYS_RES_IRQ, &amp;sc-&gt;vector, RF_ACTIVE | RF_SHAREABLE);<o:p class=""></o:p></div><div style="margin: 0cm; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><span class=""><o:p class="">&nbsp;</o:p></span></div><div class=""><div style="margin: 0cm; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><span style="font-size: 12pt;" class=""><o:p class="">&nbsp;</o:p></span></div></div><div class=""><div style="margin: 0cm; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><span style="font-size: 12pt;" class="">Thanks &amp; Regards,<o:p class=""></o:p></span></div></div><div class=""><div style="margin: 0cm; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><span style="font-size: 12pt;" class="">&nbsp;Souradeep<o:p class=""></o:p></span></div></div><div style="margin: 0cm; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><span class=""><o:p class="">&nbsp;</o:p></span></div><div style="border-style: none none none solid; border-left-width: 1.5pt; border-left-color: blue; padding: 0cm 0cm 0cm 4pt;" class=""><div class=""><div style="border-style: solid none none; border-top-width: 1pt; border-top-color: rgb(225, 225, 225); padding: 3pt 0cm 0cm;" class=""><div style="margin: 0cm; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><b class=""><span lang="EN-US" class="">From:</span></b><span lang="EN-US" class=""><span class="Apple-converted-space">&nbsp;</span>Warner Losh &lt;<a href="mailto:imp@bsdimp.com" class="">imp@bsdimp.com</a>&gt;<span class="Apple-converted-space">&nbsp;</span><br class=""><b class="">Sent:</b><span class="Apple-converted-space">&nbsp;</span>Wednesday, October 19, 2022 11:09 PM<br class=""><b class="">To:</b><span class="Apple-converted-space">&nbsp;</span>Souradeep Chakrabarti &lt;<a href="mailto:schakrabarti@microsoft.com" class="">schakrabarti@microsoft.com</a>&gt;<br class=""><b class="">Cc:</b><span class="Apple-converted-space">&nbsp;</span><a href="mailto:freebsd-hackers@freebsd.org" class="">freebsd-hackers@freebsd.org</a>; Wei Hu &lt;<a href="mailto:weh@microsoft.com" class="">weh@microsoft.com</a>&gt;<br class=""><b class="">Subject:</b><span class="Apple-converted-space">&nbsp;</span>[EXTERNAL] Re: allocating IRQ mentioned in _CRS of ACPI<o:p class=""></o:p></span></div></div></div><div style="margin: 0cm; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><o:p class="">&nbsp;</o:p></div><div class=""><div class=""><div style="margin: 0cm; font-size: 11pt; font-family: Calibri, sans-serif;" class="">Sorry for the&nbsp;late reply... I've been busy with some things for work...<o:p class=""></o:p></div></div><div class=""><div style="margin: 0cm; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><o:p class="">&nbsp;</o:p></div></div><div class=""><div style="margin: 0cm; font-size: 11pt; font-family: Calibri, sans-serif;" class="">I think you'll need to get the parent of vmbus to allow a pass through allocation. What bus is that<o:p class=""></o:p></div></div><div class=""><div style="margin: 0cm; font-size: 11pt; font-family: Calibri, sans-serif;" class="">currently?<o:p class=""></o:p></div></div><div class=""><div style="margin: 0cm; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><o:p class="">&nbsp;</o:p></div></div><div class=""><div style="margin: 0cm; font-size: 11pt; font-family: Calibri, sans-serif;" class="">Warner<o:p class=""></o:p></div></div><div style="margin: 0cm; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><o:p class="">&nbsp;</o:p></div><div class=""><div class=""><div style="margin: 0cm; font-size: 11pt; font-family: Calibri, sans-serif;" class="">On Tue, Oct 18, 2022 at 12:33 PM Souradeep Chakrabarti &lt;<a href="mailto:schakrabarti@microsoft.com" style="color: blue; text-decoration: underline;" class="">schakrabarti@microsoft.com</a>&gt; wrote:<o:p class=""></o:p></div></div><blockquote style="border-style: none none none solid; border-left-width: 1pt; border-left-color: rgb(204, 204, 204); padding: 0cm 0cm 0cm 6pt; margin-left: 4.8pt; margin-right: 0cm;" class=""><div style="margin: 0cm; font-size: 11pt; font-family: Calibri, sans-serif;" class="">Hi,<br class="">It will be a great help, if someone can help here with some idea.<br class="">As it is blocking the FreeBSD on Hyper-V ARM64.<br class=""><br class="">Thanks &amp; Regards,<br class="">Souradeep<br class=""><br class="">&gt; -----Original Message-----<br class="">&gt; From: Souradeep Chakrabarti<br class="">&gt; Sent: Friday, October 14, 2022 1:24 PM<br class="">&gt; To: 'Warner Losh' &lt;<a href="mailto:imp@bsdimp.com" target="_blank" style="color: blue; text-decoration: underline;" class="">imp@bsdimp.com</a>&gt;<br class="">&gt; Cc:<span class="Apple-converted-space">&nbsp;</span><a href="mailto:freebsd-hackers@freebsd.org" target="_blank" style="color: blue; text-decoration: underline;" class="">freebsd-hackers@freebsd.org</a>; Wei Hu &lt;<a href="mailto:weh@microsoft.com" target="_blank" style="color: blue; text-decoration: underline;" class="">weh@microsoft.com</a>&gt;<br class="">&gt; Subject: RE: allocating IRQ mentioned in _CRS of ACPI<br class="">&gt;<span class="Apple-converted-space">&nbsp;</span><br class="">&gt; Last mail was having incorrect FreeBSD hacker alias. Replacing that with correct<br class="">&gt; one here.<br class="">&gt;<span class="Apple-converted-space">&nbsp;</span><br class="">&gt;<span class="Apple-converted-space">&nbsp;</span><br class="">&gt; &gt; -----Original Message-----<br class="">&gt; &gt; From: Souradeep Chakrabarti<br class="">&gt; &gt; Sent: Friday, October 14, 2022 1:19 PM<br class="">&gt; &gt; To: Warner Losh &lt;<a href="mailto:imp@bsdimp.com" target="_blank" style="color: blue; text-decoration: underline;" class="">imp@bsdimp.com</a>&gt;<br class="">&gt; &gt; Cc:<span class="Apple-converted-space">&nbsp;</span><a href="mailto:hacker@freebsd.org" target="_blank" style="color: blue; text-decoration: underline;" class="">hacker@freebsd.org</a>; Wei Hu &lt;<a href="mailto:weh@microsoft.com" target="_blank" style="color: blue; text-decoration: underline;" class="">weh@microsoft.com</a>&gt;<br class="">&gt; &gt; Subject: allocating IRQ mentioned in _CRS of ACPI<br class="">&gt; &gt;<br class="">&gt; &gt; Hi,<br class="">&gt; &gt; I would like to allocate IRQ to a device, mentioned in the _CRS of<br class="">&gt; &gt; that device in ACPI table.<br class="">&gt; &gt; I have tried with bus_alloc_resource_any(), but it is failing as the<br class="">&gt; &gt; parent of that device is not owning the IRQ.<br class="">&gt; &gt;<br class="">&gt; &gt; Current ACPI topo for the device :<br class="">&gt; &gt; ACPI0-&gt;SB.VMOD(HID ACPI0004, has SYS_RES_MEM for MMIO in _CRS)-<br class="">&gt; &gt; &gt;VMBUS( it has SYS_RES_IRQ in it's _CRS).<br class="">&gt; &gt;<br class="">&gt; &gt; How can I get here both SYS_RES_IRQ and SYS_RES_MEM allocated to VMBUS?<br class="">&gt; &gt;<br class="">&gt; &gt; Thanks &amp; Regards,<br class="">&gt; &gt; Souradeep</div></blockquote></div></div></div></div></div></blockquote></div><br class=""></div></div></body></html>

Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?F4CD9D0B-980D-40E5-B17B-A1D87B46EA3C>