From: Jan Kiszka <[email protected]> As long as we are virtualizing MPIDR and, thus, also the region layout, we can easily mark the end. However, when removing this virtualization and starting to hand out the regions as-is, it will become complex to identify contiguous ones.
To make this simple (for the hypervisor), just declare each of them to be last. That means we will have to construct device trees for non-root cells that declare multiple redistributor regions, even if they are physically contiguous. Signed-off-by: Jan Kiszka <[email protected]> --- hypervisor/arch/arm/control.c | 1 - hypervisor/arch/arm/gic-v3.c | 12 ++++++++---- hypervisor/arch/arm/include/asm/cell.h | 2 -- 3 files changed, 8 insertions(+), 7 deletions(-) diff --git a/hypervisor/arch/arm/control.c b/hypervisor/arch/arm/control.c index 8ef25fed..b930bc83 100644 --- a/hypervisor/arch/arm/control.c +++ b/hypervisor/arch/arm/control.c @@ -201,7 +201,6 @@ int arch_cell_create(struct cell *cell) */ for_each_cpu(cpu, cell->cpu_set) per_cpu(cpu)->virt_id = virt_id++; - cell->arch.last_virt_id = virt_id - 1; err = irqchip_cell_init(cell); if (err) { diff --git a/hypervisor/arch/arm/gic-v3.c b/hypervisor/arch/arm/gic-v3.c index 2ea947f5..f629f9fc 100644 --- a/hypervisor/arch/arm/gic-v3.c +++ b/hypervisor/arch/arm/gic-v3.c @@ -235,10 +235,14 @@ static enum mmio_result gic_handle_redist_access(void *arg, if (!mmio->is_write) { switch (mmio->address) { case GICR_TYPER: - if (virt_id == cell->arch.last_virt_id) - mmio->value = GICR_TYPER_Last; - else - mmio->value = 0; + /* + * Declare each redistributor region to be last. This + * avoids that we miss one and cause the guest to + * overscan while matching redistributors in a + * partitioned region. + */ + mmio->value = GICR_TYPER_Last; + /* AArch64 can use a writeq for this register */ if (mmio->size == 8) mmio->value |= (u64)virt_id << 32; diff --git a/hypervisor/arch/arm/include/asm/cell.h b/hypervisor/arch/arm/include/asm/cell.h index 5413d301..a935eb33 100644 --- a/hypervisor/arch/arm/include/asm/cell.h +++ b/hypervisor/arch/arm/include/asm/cell.h @@ -22,8 +22,6 @@ struct arch_cell { struct paging_structures mm; u32 irq_bitmap[1024/32]; - - unsigned int last_virt_id; }; /** PCI-related cell states. */ -- 2.12.3 -- 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.
