Page MenuHomeFreeBSD

arm64/vmm: Implement vgic_v5
Needs ReviewPublic

Authored by sarah.walker2_arm.com on Tue, Sep 29, 11:14 AM.
Tags
None
Referenced Files
F176522293: D60115.id189711.diff
Mon, Oct 19, 12:55 PM
Unknown Object (File)
Sun, Oct 18, 1:40 AM
Unknown Object (File)
Sat, Oct 17, 10:53 AM
Unknown Object (File)
Fri, Oct 16, 12:23 PM
Unknown Object (File)
Fri, Oct 16, 12:23 PM
Unknown Object (File)
Tue, Oct 13, 5:52 PM
Unknown Object (File)
Tue, Oct 13, 5:40 PM
Unknown Object (File)
Tue, Oct 13, 2:44 PM
Subscribers

Details

Reviewers
andrew
manu
Group Reviewers
bhyve
arm64
Summary

Adds support for GICv5 as both a host and guest. Additionally, on platforms with
FEAT_GICE_LEGACY, supports a GICv3 guest under a GICv5 host.

The current implementation only implements the IRS component. The ITS is not
currently emulated, which prevents the use of MSIs.

Co-developed-by: Andrew Turner <andrew@FreeBSD.org>
Sponsored by: Arm Ltd

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Skipped
Unit
Tests Skipped
Build Status
Buildable 78119
Build 75002: arc lint + arc unit

Event Timeline

I think we also need to handle IRS_IIDR and IRS_PE_*.

sys/arm64/vmm/io/vgic.c
180

Unneeded

sys/arm64/vmm/io/vgic_internal.h
101

Unneeded

118

Do we need any per-CPU data for GICv5? If not this can change to say so

sys/arm64/vmm/io/vgic_v5.c
30

Not needed as later headers include it. It was previously needed for the __FBSDID macro, but that has been removed from .c files.

92–93

Should this use the sanitised register value?

120–125

We should create macros for these

128

And this

172

Do we have a macro for this?

182

We can remove some of these, they were there so I could check which registers have been implemented

242

It would be useful to add a comment here explaining why registers are unimplemented, e.g. is RAZ/WI because IRS_IDR0.VIRT == 0

393

Don't we need LPIs for IPIs? It looks like Linux checks for it.

451

Should we check IRS_IST_BASER.VALID != 1 first? If it's valid then this is read-only

551

We should only write when IRS_IST_BASER.Valid != 1

696–697

And the same for SPI

702

You could move GICV5_PPIS_PER_REG and GICV5_PPI_COUNT to a header & use them here

734

Do we need this panic?

750

This should return an error

sys/arm64/vmm/vmm_hyp.c
946

Is there a reason to put this here & not in a vgic specific function?