All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH kvmtool 0/3] arm/gic: minor fixes to ITS and GICv2m
@ 2018-04-25 10:09 Andre Przywara
  2018-04-25 10:09 ` [PATCH kvmtool 1/3] arm/gic: remove extra 64K from ITS allocation Andre Przywara
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Andre Przywara @ 2018-04-25 10:09 UTC (permalink / raw)
  To: Will Deacon, Marc Zyngier; +Cc: kvmarm, kvm

Three minor fixes I stumbled upon when hacking around in kvmtool.
Not sure how the v2m support actually worked at the moment.
We might want to look at some MMIO space allocation algorithm to use for
the GIC as well, possibly merging it with the virtio MMIO allocation we
already have in place (virtio_mmio_get_io_space_block()). Not sure what
the reason was to put the GIC at a different place.

Cheers,
Andre.

Andre Przywara (3):
  arm/gic: remove extra 64K from ITS allocation
  arm/gic: avoid GICv2m MMIO frame overlap
  arm/gic: move GICv2M gadget size into private header

 arm/aarch32/include/asm/kvm.h | 2 --
 arm/aarch64/include/asm/kvm.h | 2 --
 arm/gic.c                     | 6 +++---
 arm/include/arm-common/gic.h  | 2 ++
 4 files changed, 5 insertions(+), 7 deletions(-)

-- 
2.14.1

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH kvmtool 1/3] arm/gic: remove extra 64K from ITS allocation
  2018-04-25 10:09 [PATCH kvmtool 0/3] arm/gic: minor fixes to ITS and GICv2m Andre Przywara
@ 2018-04-25 10:09 ` Andre Przywara
  2018-04-25 10:09 ` [PATCH kvmtool 2/3] arm/gic: avoid GICv2m MMIO frame overlap Andre Przywara
  2018-04-25 10:09 ` [PATCH kvmtool 3/3] arm/gic: move GICv2M gadget size into private header Andre Przywara
  2 siblings, 0 replies; 4+ messages in thread
From: Andre Przywara @ 2018-04-25 10:09 UTC (permalink / raw)
  To: Will Deacon, Marc Zyngier; +Cc: kvmarm, kvm

The KVM_VGIC_V3_ITS_SIZE macro from the Linux API header file already
covers the doorbell page, so we don't need to add that extra page size
in our code.

Signed-off-by: Andre Przywara <andre.przywara@arm.com>
---
 arm/gic.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/arm/gic.c b/arm/gic.c
index aca0b939..dd4d747d 100644
--- a/arm/gic.c
+++ b/arm/gic.c
@@ -229,8 +229,8 @@ int gic__create(struct kvm *kvm, enum irqchip_type type)
 	case IRQCHIP_GICV2:
 		break;
 	case IRQCHIP_GICV3_ITS:
-		/* We reserve the 64K page with the doorbell as well. */
-		gic_msi_size = KVM_VGIC_V3_ITS_SIZE + SZ_64K;
+		/* The 64K page with the doorbell is included. */
+		gic_msi_size = KVM_VGIC_V3_ITS_SIZE;
 		/* fall through */
 	case IRQCHIP_GICV3:
 		gic_redists_size = kvm->cfg.nrcpus * ARM_GIC_REDIST_SIZE;
-- 
2.14.1

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [PATCH kvmtool 2/3] arm/gic: avoid GICv2m MMIO frame overlap
  2018-04-25 10:09 [PATCH kvmtool 0/3] arm/gic: minor fixes to ITS and GICv2m Andre Przywara
  2018-04-25 10:09 ` [PATCH kvmtool 1/3] arm/gic: remove extra 64K from ITS allocation Andre Przywara
@ 2018-04-25 10:09 ` Andre Przywara
  2018-04-25 10:09 ` [PATCH kvmtool 3/3] arm/gic: move GICv2M gadget size into private header Andre Przywara
  2 siblings, 0 replies; 4+ messages in thread
From: Andre Przywara @ 2018-04-25 10:09 UTC (permalink / raw)
  To: Will Deacon, Marc Zyngier; +Cc: kvmarm, kvm

Currently we accidentally overlap the GICv2m MMIO frame with the CPU
interface region. Fix this by moving the v2m frame below the CPUI region.

Signed-off-by: Andre Przywara <andre.przywara@arm.com>
---
 arm/gic.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arm/gic.c b/arm/gic.c
index dd4d747d..238a75c7 100644
--- a/arm/gic.c
+++ b/arm/gic.c
@@ -224,7 +224,7 @@ int gic__create(struct kvm *kvm, enum irqchip_type type)
 	switch (type) {
 	case IRQCHIP_GICV2M:
 		gic_msi_size = KVM_VGIC_V2M_SIZE;
-		gic_msi_base = ARM_GIC_DIST_BASE - gic_msi_size;
+		gic_msi_base = ARM_GIC_CPUI_BASE - gic_msi_size;
 		break;
 	case IRQCHIP_GICV2:
 		break;
-- 
2.14.1

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [PATCH kvmtool 3/3] arm/gic: move GICv2M gadget size into private header
  2018-04-25 10:09 [PATCH kvmtool 0/3] arm/gic: minor fixes to ITS and GICv2m Andre Przywara
  2018-04-25 10:09 ` [PATCH kvmtool 1/3] arm/gic: remove extra 64K from ITS allocation Andre Przywara
  2018-04-25 10:09 ` [PATCH kvmtool 2/3] arm/gic: avoid GICv2m MMIO frame overlap Andre Przywara
@ 2018-04-25 10:09 ` Andre Przywara
  2 siblings, 0 replies; 4+ messages in thread
From: Andre Przywara @ 2018-04-25 10:09 UTC (permalink / raw)
  To: Will Deacon, Marc Zyngier; +Cc: kvmarm, kvm

The header files in arm/aarch*/include/asm/ are directly copied from
Linux, so we can't just put our own definitions in there.
Move the GICv2M MMIO frame size into a more private header, to avoid
breaking the build once the header files are synced from Linux.

Signed-off-by: Andre Przywara <andre.przywara@arm.com>
---
 arm/aarch32/include/asm/kvm.h | 2 --
 arm/aarch64/include/asm/kvm.h | 2 --
 arm/include/arm-common/gic.h  | 2 ++
 3 files changed, 2 insertions(+), 4 deletions(-)

diff --git a/arm/aarch32/include/asm/kvm.h b/arm/aarch32/include/asm/kvm.h
index 02206673..6ebd3e6a 100644
--- a/arm/aarch32/include/asm/kvm.h
+++ b/arm/aarch32/include/asm/kvm.h
@@ -84,8 +84,6 @@ struct kvm_regs {
 #define KVM_VGIC_V2_DIST_SIZE		0x1000
 #define KVM_VGIC_V2_CPU_SIZE		0x2000
 
-#define KVM_VGIC_V2M_SIZE		0x1000
-
 /* Supported VGICv3 address types  */
 #define KVM_VGIC_V3_ADDR_TYPE_DIST	2
 #define KVM_VGIC_V3_ADDR_TYPE_REDIST	3
diff --git a/arm/aarch64/include/asm/kvm.h b/arm/aarch64/include/asm/kvm.h
index 7d14507b..c2860358 100644
--- a/arm/aarch64/include/asm/kvm.h
+++ b/arm/aarch64/include/asm/kvm.h
@@ -84,8 +84,6 @@ struct kvm_regs {
 #define KVM_VGIC_V2_DIST_SIZE		0x1000
 #define KVM_VGIC_V2_CPU_SIZE		0x2000
 
-#define KVM_VGIC_V2M_SIZE		0x1000
-
 /* Supported VGICv3 address types  */
 #define KVM_VGIC_V3_ADDR_TYPE_DIST	2
 #define KVM_VGIC_V3_ADDR_TYPE_REDIST	3
diff --git a/arm/include/arm-common/gic.h b/arm/include/arm-common/gic.h
index 687effc6..ae253c05 100644
--- a/arm/include/arm-common/gic.h
+++ b/arm/include/arm-common/gic.h
@@ -21,6 +21,8 @@
 #define GIC_MAX_CPUS			8
 #define GIC_MAX_IRQ			255
 
+#define KVM_VGIC_V2M_SIZE		0x1000
+
 enum irqchip_type {
 	IRQCHIP_GICV2,
 	IRQCHIP_GICV2M,
-- 
2.14.1

^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2018-04-25 10:09 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-04-25 10:09 [PATCH kvmtool 0/3] arm/gic: minor fixes to ITS and GICv2m Andre Przywara
2018-04-25 10:09 ` [PATCH kvmtool 1/3] arm/gic: remove extra 64K from ITS allocation Andre Przywara
2018-04-25 10:09 ` [PATCH kvmtool 2/3] arm/gic: avoid GICv2m MMIO frame overlap Andre Przywara
2018-04-25 10:09 ` [PATCH kvmtool 3/3] arm/gic: move GICv2M gadget size into private header Andre Przywara

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.