diff options
| author | Eric Auger <eric.auger@redhat.com> | 2017-04-13 03:06:20 -0400 |
|---|---|---|
| committer | Christoffer Dall <cdall@linaro.org> | 2017-05-08 08:35:04 -0400 |
| commit | 71afe470e20db133b30730cfa856e5d6854312e9 (patch) | |
| tree | ed474996951d6e6be477c076768f32ecf29780ce /include | |
| parent | 0979bfa69421279459b4516542503f1d577d2ec5 (diff) | |
KVM: arm64: vgic-its: Introduce migration ABI infrastructure
We plan to support different migration ABIs, ie. characterizing
the ITS table layout format in guest RAM. For example, a new ABI
will be needed if vLPIs get supported for nested use case.
So let's introduce an array of supported ABIs (at the moment a single
ABI is supported though). The following characteristics are foreseen
to vary with the ABI: size of table entries, save/restore operation,
the way abi settings are applied.
By default the MAX_ABI_REV is applied on its creation. In subsequent
patches we will introduce a way for the userspace to change the ABI
in use.
The entry sizes now are set according to the ABI version and not
hardcoded anymore.
Signed-off-by: Eric Auger <eric.auger@redhat.com>
Reviewed-by: Christoffer Dall <cdall@linaro.org>
Diffstat (limited to 'include')
| -rw-r--r-- | include/kvm/arm_vgic.h | 3 | ||||
| -rw-r--r-- | include/linux/irqchip/arm-gic-v3.h | 5 |
2 files changed, 8 insertions, 0 deletions
diff --git a/include/kvm/arm_vgic.h b/include/kvm/arm_vgic.h index 26ed4fb896bb..fabcc649e2ce 100644 --- a/include/kvm/arm_vgic.h +++ b/include/kvm/arm_vgic.h | |||
| @@ -162,6 +162,9 @@ struct vgic_its { | |||
| 162 | u32 creadr; | 162 | u32 creadr; |
| 163 | u32 cwriter; | 163 | u32 cwriter; |
| 164 | 164 | ||
| 165 | /* migration ABI revision in use */ | ||
| 166 | u32 abi_rev; | ||
| 167 | |||
| 165 | /* Protects the device and collection lists */ | 168 | /* Protects the device and collection lists */ |
| 166 | struct mutex its_lock; | 169 | struct mutex its_lock; |
| 167 | struct list_head device_list; | 170 | struct list_head device_list; |
diff --git a/include/linux/irqchip/arm-gic-v3.h b/include/linux/irqchip/arm-gic-v3.h index 97cbca19430d..81ebe437ccc3 100644 --- a/include/linux/irqchip/arm-gic-v3.h +++ b/include/linux/irqchip/arm-gic-v3.h | |||
| @@ -132,6 +132,9 @@ | |||
| 132 | #define GIC_BASER_SHAREABILITY(reg, type) \ | 132 | #define GIC_BASER_SHAREABILITY(reg, type) \ |
| 133 | (GIC_BASER_##type << reg##_SHAREABILITY_SHIFT) | 133 | (GIC_BASER_##type << reg##_SHAREABILITY_SHIFT) |
| 134 | 134 | ||
| 135 | /* encode a size field of width @w containing @n - 1 units */ | ||
| 136 | #define GIC_ENCODE_SZ(n, w) (((unsigned long)(n) - 1) & GENMASK_ULL(((w) - 1), 0)) | ||
| 137 | |||
| 135 | #define GICR_PROPBASER_SHAREABILITY_SHIFT (10) | 138 | #define GICR_PROPBASER_SHAREABILITY_SHIFT (10) |
| 136 | #define GICR_PROPBASER_INNER_CACHEABILITY_SHIFT (7) | 139 | #define GICR_PROPBASER_INNER_CACHEABILITY_SHIFT (7) |
| 137 | #define GICR_PROPBASER_OUTER_CACHEABILITY_SHIFT (56) | 140 | #define GICR_PROPBASER_OUTER_CACHEABILITY_SHIFT (56) |
| @@ -232,6 +235,7 @@ | |||
| 232 | #define GITS_CTLR_QUIESCENT (1U << 31) | 235 | #define GITS_CTLR_QUIESCENT (1U << 31) |
| 233 | 236 | ||
| 234 | #define GITS_TYPER_PLPIS (1UL << 0) | 237 | #define GITS_TYPER_PLPIS (1UL << 0) |
| 238 | #define GITS_TYPER_ITT_ENTRY_SIZE_SHIFT 4 | ||
| 235 | #define GITS_TYPER_IDBITS_SHIFT 8 | 239 | #define GITS_TYPER_IDBITS_SHIFT 8 |
| 236 | #define GITS_TYPER_DEVBITS_SHIFT 13 | 240 | #define GITS_TYPER_DEVBITS_SHIFT 13 |
| 237 | #define GITS_TYPER_DEVBITS(r) ((((r) >> GITS_TYPER_DEVBITS_SHIFT) & 0x1f) + 1) | 241 | #define GITS_TYPER_DEVBITS(r) ((((r) >> GITS_TYPER_DEVBITS_SHIFT) & 0x1f) + 1) |
| @@ -290,6 +294,7 @@ | |||
| 290 | #define GITS_BASER_TYPE(r) (((r) >> GITS_BASER_TYPE_SHIFT) & 7) | 294 | #define GITS_BASER_TYPE(r) (((r) >> GITS_BASER_TYPE_SHIFT) & 7) |
| 291 | #define GITS_BASER_ENTRY_SIZE_SHIFT (48) | 295 | #define GITS_BASER_ENTRY_SIZE_SHIFT (48) |
| 292 | #define GITS_BASER_ENTRY_SIZE(r) ((((r) >> GITS_BASER_ENTRY_SIZE_SHIFT) & 0x1f) + 1) | 296 | #define GITS_BASER_ENTRY_SIZE(r) ((((r) >> GITS_BASER_ENTRY_SIZE_SHIFT) & 0x1f) + 1) |
| 297 | #define GITS_BASER_ENTRY_SIZE_MASK GENMASK_ULL(52, 48) | ||
| 293 | #define GITS_BASER_SHAREABILITY_SHIFT (10) | 298 | #define GITS_BASER_SHAREABILITY_SHIFT (10) |
| 294 | #define GITS_BASER_InnerShareable \ | 299 | #define GITS_BASER_InnerShareable \ |
| 295 | GIC_BASER_SHAREABILITY(GITS_BASER, InnerShareable) | 300 | GIC_BASER_SHAREABILITY(GITS_BASER, InnerShareable) |
