On 05/04/2017 07:26 PM, Mark Rutland wrote: > On Tue, May 02, 2017 at 06:08:49PM +0200, Ralf Ramsauer wrote: >> Hi, >> >> is there a way on ARM to find out on which physical CPU I'm currently >> running on? >> >> I need this information for interrupt routing. (In Jailhouse) GIC's >> ITARGETSR expects physical CPU IDs. Of course I could statically provide >> this information, but I'd like to find it out during runtime. > > You can determine this as Linux does, by having a CPU read the targets > for all of its SGIs+PPIs. Any of these which are implemented will (only) > describe the CPU performing the read. Thanks a lot for that hint. That works!
I just understood that the GIC's CPU interface does not necessarily have to correlate with the CPUs MPIDR. Ralf > > I am not aware of any mechanism to determine the GIC CPU ID of another > CPU. > >> Reading the Multi Processor Affinity Register (MPIDR) [1] reports the >> "CPU ID". However, reading this register as a Jailhouse inmate always >> reports 0 for the primary boot CPU, regardless of the real physical CPU. > > Architecturally, the CPU IDs used by the GIC ITARGETSR register have no > relationship with the MPIDR. The GIC CPU ID cannot be inferred from the > MPIDR. > > (for GICv3 things are a little different). > > Thanks, > Mark. > -- You received this message because you are subscribed to the Google Groups "Jailhouse" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/d/optout.
