Skip to content

GICv3 emulation#8

Closed
pingerino wants to merge 21 commits intoseL4:masterfrom
pingerino:vgic-cleanups
Closed

GICv3 emulation#8
pingerino wants to merge 21 commits intoseL4:masterfrom
pingerino:vgic-cleanups

Conversation

@pingerino
Copy link
Copy Markdown
Contributor

@pingerino pingerino commented Aug 9, 2019

This PR preps the vgic code in libsel4arm-vmm for gicv3 support with minimal code duplication and introduces gicv3 emulation.

It also cleans up the code a lot, to make it easier to read and maintain and pulls in some fixes by
@chrisguikema from the dornerworks branches.

Anna Lyons added 5 commits August 9, 2019 10:34
Avoid using GLOB for src/arch/arm/*/*.c so we can easily swap
files in and out depending on the platform.
Move functionality that is common to gicv2 and gicv3 drivers from vgic.c
to vgic.h so it can be used by the gicv3 driver.
- pull virq functionality that is not only relevant to the gicv2 into
another header file, virq.h
set_active is completely unused
@pingerino pingerino force-pushed the vgic-cleanups branch 2 times, most recently from 67e67af to ce59382 Compare August 12, 2019 08:35
Anna Lyons and others added 12 commits August 13, 2019 09:02
This code is common between the gicv2 and giv3
vgic.c virtualises the gicv2
There are a few subtle differences in the gic distributor between gicv2
and v3. Refactor these into the gicv2 header to prepare for a gicv3
implementation.
Previously map_emulated_devices could only map a single 4k page. Now it
will select the largest page size for the region and map multiple pages
to cover it as required.
Allow faults to handle doublewords

Change-Id: I990044bff6a7f05defb2adf86de7c239597d5fc7
Advance a read fault so the read data returns to the VM

Change-Id: I11ec28160d382c96c423df83dfce5463850205bb
remove unneccessary indirection via vgic_priv_get_lr which made code
difficult to read.
Party like it's not C99. Declaring variables before use can be useful
but in this case the overuse makes the file much longer and harder to
comprehend.
Remove virq_init, which is just used to zero a struct field by field.
Allocate said struct with calloc so it is already zerod for simplicity.
- remove unneccessary asserts
- replace assert(!"string") with ZF_LOGF
Instead of harding ARG0 as the location of the idx in the VGIC fault,
use the correct libsel4 constant.
This commit adds support for emulating the gicv3. Work for this commit
was pulled from prototype works by the following authors:

Co-authored-by: Yanyan Shen <yanyan.shen@data61.csiro.au>
Co-authored-by: Chris Guikema <chris.guikema@dornerworks.com>
@pingerino pingerino changed the title Prep VGIC for GICv3 GICv3 emulation Aug 13, 2019
This is the first platform to officially support the gicv3 in master.

// this must be provided by files including this file, to select the appropriate
// gic dist per the hardware.
struct gic_dist_map;
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this isn't required, delete

* @TAG(DATA61_BSD)
*/
/*
* This component controls and maintains the GIC for the VM.
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe this comment should be moved to vgic.h?

Anna Lyons added 3 commits August 14, 2019 16:02
Rather than have is_wfi, is_prefetch, add an enum type.
This is simple and makes it easy to add new fault types.
Let's reduce the uninitialised variables.
- add some decoding of SMC instructions with output messages
- return the latest pcsi version from PSCI_VERSION
- tell the vm we don't need migration in PSCI_MIGRATE_INFO_TYPE
- ignore SIP service calls
    - these are custom calls to the SoC and are currently unsupported
@axel-h
Copy link
Copy Markdown
Member

axel-h commented Jul 10, 2022

Closing this, as @kent-mcleod picked this up in #58 now.

@axel-h axel-h closed this Jul 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants