Re: [EXTERNAL] MSI CPU affinity for ARM64
Andrew Turner <[email protected]>
| Newsgroups | gmane.os.freebsd.devel.arm |
|---|---|
| Message-ID | <[email protected]> |
> On 9 Jan 2023, at 15:24, Souradeep Chakrabarti <[email protected]> wrote: > > > > >> -----Original Message----- >> From: Andrew Turner <[email protected]> >> Sent: Monday, January 9, 2023 5:14 PM >> To: Souradeep Chakrabarti <[email protected]> >> Cc: [email protected]; Li-Wen Hsu <[email protected]>; Wei Hu >> <[email protected]> >> Subject: [EXTERNAL] Re: MSI CPU affinity for ARM64 >> >> Hello Souradeep, >> >> In what driver do you need to query the CPU affinity? In the GICv3 driver you can >> read the set of CPUs from isrc->isrc_cpu. In other drivers it appears to be more >> difficult. >> >> Andrew > [Souradeep] > I am trying to get the CPU id from vmbus_pcib driver. > I need to find for the MSI interrupt, what is the CPUid. If the MSI is for a child of vmbus_pcib you might be able to get this by implementing the bus_bind_intr method, however I don’t think you’ll see the default CPU assignment. Why do you need the CPU ID in the vmbus_pcib driver? It’s stored in struct intr_event which could be found by adding a bus_setup_intr method that extracts it from the cookie passed back to the driver. This does require the driver to know the type for the cookie. On arm64 it should be a struct intr_handler that contains a pointer to a struct intr_event that has either the CPU the interrupt is assigned to or NOCPU. Having said that I’m not sure how safe it is to assume the cookie is a pointer to the intr_handler. Andrew