Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 3 Nov 2022 12:50:53 +0000
From:      Andrew Turner <andrew@fubar.geek.nz>
To:        Souradeep Chakrabarti <schakrabarti@microsoft.com>
Cc:        Warner Losh <imp@bsdimp.com>, Wei Hu <weh@microsoft.com>, "freebsd-hackers@FreeBSD.org" <freebsd-hackers@freebsd.org>
Subject:   Re: [EXTERNAL] pcib msix allocation in arm64
Message-ID:  <947DBD67-6443-480F-82DA-2BDDF44C3D03@fubar.geek.nz>
In-Reply-To: <PSAP153MB05367C2284B34BD1A3456F61CC399@PSAP153MB0536.APCP153.PROD.OUTLOOK.COM>
References:  <PSAP153MB05363055DF2B4AE3F39C987BCC399@PSAP153MB0536.APCP153.PROD.OUTLOOK.COM> <146F5D18-6366-4953-A8D9-61FE7EC67F71@fubar.geek.nz> <PSAP153MB05367C2284B34BD1A3456F61CC399@PSAP153MB0536.APCP153.PROD.OUTLOOK.COM>

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

For the vmbus_pcib driver you=E2=80=99ll need to implement the =
pcib_alloc_msi, pcib_release_msi, and the msix versions, and =
pcib_map_msi.

For alloc and release you can just call into the same intr_* function as =
pci_host_generic_acpi.c. You=E2=80=99ll need to pass in the xref for the =
interrupt controller. It needs to be the xref the MSI controller =
registered. For the GICv2m it=E2=80=99s ACPI_MSI_XREF.

For pcib_map_msi I am unsure if the current code is valid on arm64. If =
not you=E2=80=99ll need to call intr_map_msi.

Andrew

> On 2 Nov 2022, at 22:27, Souradeep Chakrabarti =
<schakrabarti@microsoft.com> wrote:
>=20
> Hi Andrew,
> Thanks for the reply. Regarding generic_pcie_acpi_alloc_msix( ), it =
can be called if the
> PCI device is child of the generic pcib ( DRIVER_MODULE(pcib, acpi, =
generic_pcie_acpi_driver, 0, 0) .=20
> But if the PCI device is communicating with a different pcib driver =
(like vmbus_pcib),
> in that case do we need to implement all these functions of =
pci_host_generic_acpi.c ?
>=20
> Or there are some ways to reuse them?
>=20
>> -----Original Message-----
>> From: Andrew Turner <andrew@fubar.geek.nz>
>> Sent: Wednesday, November 2, 2022 6:54 PM
>> To: Souradeep Chakrabarti <schakrabarti@microsoft.com>
>> Cc: Warner Losh <imp@bsdimp.com>; Wei Hu <weh@microsoft.com>; =
freebsd-
>> hackers@FreeBSD.org
>> Subject: [EXTERNAL] Re: pcib msix allocation in arm64
>>=20
>>=20
>>> On 2 Nov 2022, at 12:56, Souradeep Chakrabarti =
<schakrabarti@microsoft.com>
>> wrote:
>>>=20
>>> Hi,
>>> I can see in x86 nexus.c has implemented pcib_alloc_msix using
>> nexus_alloc_msix().
>>> Which calls msix_alloc() for msix allocation.
>>>=20
>>> But in case of arm64 I don't find similar pcib_alloc_msix =
implementation in
>> nexus.c .
>>> So, on arm64 what is correct way to get allocate msix ?
>>=20
>> For an arm64 system with ACPI it is most likely handled in
>> generic_pcie_acpi_release_msix. For FDT it can depend on which PCI =
driver is
>> used.
>>=20
>> In either case it will call into intr_release_msix that then calls =
into the MSI
>> controller to allocate the vectors. For a GICv3 driver it will either =
be
>> gicv3_its_alloc_msix if you have an ITS device, or gic_v3_alloc_msix =
if using MBI
>> ranges.
>>=20
>> On ACPI we don=E2=80=99t currently support MBI ranges, although it =
looks like this could
>> be handled by the existing gicv2m driver. This driver should already =
work as a
>> child of the GICv3, however it appears to be FDT only, so will need =
some work to
>> add ACPI support.
>>=20
>> Andrew
>=20




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?947DBD67-6443-480F-82DA-2BDDF44C3D03>