Page MenuHomeFreeBSD

gicv3_its: do LPI init only once per CPU
ClosedPublic

Authored by jchandra on Apr 8 2019, 2:19 AM.
Tags
None
Referenced Files
Unknown Object (File)
Thu, Mar 28, 10:40 AM
Unknown Object (File)
Jan 15 2024, 12:12 PM
Unknown Object (File)
Dec 23 2023, 2:31 AM
Unknown Object (File)
Dec 21 2023, 11:29 PM
Unknown Object (File)
Dec 20 2023, 11:05 PM
Unknown Object (File)
Nov 24 2023, 11:15 PM
Unknown Object (File)
Nov 21 2023, 9:44 PM
Unknown Object (File)
Nov 21 2023, 5:43 PM

Details

Summary

The initialization required for LPIs (setting up pending tables etc.) has to be done just once per CPU, even in the case where there are multiple ITS blocks associated with the CPU.

Add a variable lpi_enabled in the per-cpu distributor info for this and use it ensure that we call its_init_cpu_lpi() just once.

This enables us to support the case where multiple ITS blocks can generate LPIs to a CPU.

Diff Detail

Lint
Lint Skipped
Unit
Tests Skipped
Build Status
Buildable 23566

Event Timeline

sys/arm64/arm64/gic_v3_var.h
46

Just make this an int or bool. The struct will be padded any way so it doesn't save any space.

sys/arm64/arm64/gicv3_its.c
674

How do we get into its_init_cpu on a given CPU? I assume it's when there are multiple ITS devices.

Let me know if you need a new rev with bool.

sys/arm64/arm64/gic_v3_var.h
46

The idea was to use other bits for more flags if needed. I think bool would work as well, if the bit field is looks like an unnecessary complication.

sys/arm64/arm64/gicv3_its.c
674

gicv3_its_init_secondary calls it for each secondary CPU.

This is to handle the case when there are multiple ITS blocks associated with a CPU. We need to do the LPI init once per CPU (per- redistributor actually). The collection init has to be done for all the ITS blocks.

So the idea is to get a per-redistributor flag to mark LPI initialization status.

If you think more flags will be needed later you can make it a u_int with a per-flag macro. If not just make it a bool.

sys/arm64/arm64/gic_v3_var.h
46

You could also make it a u_int and define a flag. e.g.:

struct redist_pcpu {
  ...
  u_int flags;
};

#define RDIST_PCPU_LPI_ENBLED 0x01
sys/arm64/arm64/gicv3_its.c
674

Ok, it would pay to explain this in a comment.

jchandra edited the summary of this revision. (Show Details)
This revision is now accepted and ready to land.May 27 2019, 10:36 AM
This revision was automatically updated to reflect the committed changes.