linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 00/16] kvm: arm64: Support for dynamic IPA size
@ 2018-01-09 19:03 Suzuki K Poulose
  2018-01-09 19:03 ` [PATCH v1 01/16] virtio: Validate queue pfn for 32bit transports Suzuki K Poulose
                   ` (19 more replies)
  0 siblings, 20 replies; 55+ messages in thread
From: Suzuki K Poulose @ 2018-01-09 19:03 UTC (permalink / raw)
  To: linux-arm-kernel

On arm64 we have a static limit of 40bits of physical address space
for the VM with KVM. This series lifts the limitation and allows the
VM to configure the physical address space upto 52bit on systems
where it is supported. We retain the default and minimum size to 40bits
to avoid breaking backward compatibility.

The interface provided is an IOCTL on the VM fd. The guest can change
only increase the limit from what is already configured, to prevent
breaking the devices which may have already been configured with a
particular guest PA. The guest can issue the request until something
is actually mapped into the stage2 table (e.g, memory region or device).
This also implies that we now have per VM configuration of stage2
control registers (VTCR_EL2 bits).

The arm64 page table level helpers are defined based on the page
table levels used by the host VA. So, the accessors may not work
if the guest uses more number of levels in stage2 than the stage1
of the host. In order to provide an independent stage2 page table,
we refactor the arm64 page table helpers to give us raw accessors
for each level, which should only used when that level is present.
And then, based on the VM, we make the decision of the stage2
page table using the raw accessors.


The series also adds :
 - Support for handling 52bit IPA for vgic ITS.
 - Cleanup in virtio to handle errors when the PFN used in
   the virtio transport doesn't fit in 32bit.

Tested with
  - Modified kvmtool, which can only be used for (patches included in
    the series for reference / testing):
    * with virtio-pci upto 44bit PA (Due to 4K page size for virtio-pci
      legacy implemented by kvmtool)
    * Upto 48bit PA with virtio-mmio, due to 32bit PFN limitation.
  - Hacked Qemu (boot loader support for highmem, phys-shift support)
    * with virtio-pci GIC-v3 ITS & MSI upto 52bit on Foundation model.

The series applies on arm64 for-next/core tree with 52bit PA support patches.
One would need the fix for virtio_mmio cleanup [1] on top of the arm64
tree to remove the warnings from virtio.

[1] https://marc.info/?l=linux-virtualization&m=151308636322117&w=2

Kristina Martsenko (1):
  vgic: its: Add support for 52bit guest physical address

Suzuki K Poulose (15):
  virtio: Validate queue pfn for 32bit transports
  irqchip: gicv3-its: Add helpers for handling 52bit address
  arm64: Make page table helpers reusable
  arm64: Refactor pud_huge for reusability
  arm64: Helper for parange to PASize
  kvm: arm/arm64: Fix stage2_flush_memslot for 4 level page table
  kvm: arm/arm64: Remove spurious WARN_ON
  kvm: arm/arm64: Clean up stage2 pgd life time
  kvm: arm/arm64: Delay stage2 page table allocation
  kvm: arm/arm64: Prepare for VM specific stage2 translations
  kvm: arm64: Make stage2 page table layout dynamic
  kvm: arm64: Dynamic configuration of VTCR and VTTBR mask
  kvm: arm64: Configure VTCR per VM
  kvm: arm64: Switch to per VM IPA
  kvm: arm64: Allow configuring physical address space size

 Documentation/virtual/kvm/api.txt             |  27 +++
 arch/arm/include/asm/kvm_arm.h                |   2 -
 arch/arm/include/asm/kvm_host.h               |   7 +
 arch/arm/include/asm/kvm_mmu.h                |  13 +-
 arch/arm/include/asm/stage2_pgtable.h         |  46 +++---
 arch/arm64/include/asm/cpufeature.h           |  16 ++
 arch/arm64/include/asm/kvm_arm.h              | 112 +++++++++++--
 arch/arm64/include/asm/kvm_asm.h              |   2 +-
 arch/arm64/include/asm/kvm_host.h             |  21 ++-
 arch/arm64/include/asm/kvm_mmu.h              |  83 ++++++++--
 arch/arm64/include/asm/pgalloc.h              |  32 +++-
 arch/arm64/include/asm/pgtable.h              |  61 ++++---
 arch/arm64/include/asm/stage2_pgtable-nopmd.h |  42 -----
 arch/arm64/include/asm/stage2_pgtable-nopud.h |  39 -----
 arch/arm64/include/asm/stage2_pgtable.h       | 211 ++++++++++++++++--------
 arch/arm64/kvm/hyp/s2-setup.c                 |  34 +---
 arch/arm64/kvm/hyp/switch.c                   |   8 +
 arch/arm64/kvm/reset.c                        |  28 ++++
 arch/arm64/mm/hugetlbpage.c                   |   2 +-
 drivers/irqchip/irq-gic-v3-its.c              |   2 +-
 drivers/virtio/virtio_mmio.c                  |  19 ++-
 drivers/virtio/virtio_pci_legacy.c            |  11 +-
 include/linux/irqchip/arm-gic-v3.h            |  32 +++-
 include/uapi/linux/kvm.h                      |   4 +
 virt/kvm/arm/arm.c                            |  25 ++-
 virt/kvm/arm/mmu.c                            | 228 +++++++++++++++-----------
 virt/kvm/arm/vgic/vgic-its.c                  |  36 ++--
 virt/kvm/arm/vgic/vgic-kvm-device.c           |   2 +-
 virt/kvm/arm/vgic/vgic-mmio-v3.c              |   1 -
 29 files changed, 738 insertions(+), 408 deletions(-)
 delete mode 100644 arch/arm64/include/asm/stage2_pgtable-nopmd.h
 delete mode 100644 arch/arm64/include/asm/stage2_pgtable-nopud.h

-- 
2.13.6

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

end of thread, other threads:[~2018-03-15 15:24 UTC | newest]

Thread overview: 55+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-01-09 19:03 [PATCH 00/16] kvm: arm64: Support for dynamic IPA size Suzuki K Poulose
2018-01-09 19:03 ` [PATCH v1 01/16] virtio: Validate queue pfn for 32bit transports Suzuki K Poulose
2018-01-09 23:29   ` Michael S. Tsirkin
2018-01-10 10:54     ` Suzuki K Poulose
2018-01-10 11:06       ` Michael S. Tsirkin
2018-01-10 11:18         ` Suzuki K Poulose
2018-01-10 11:19         ` Peter Maydell
2018-01-10 11:25           ` Jean-Philippe Brucker
2018-01-12 10:21             ` Peter Maydell
2018-01-12 11:01               ` Jean-Philippe Brucker
2018-01-10 11:30           ` Michael S. Tsirkin
2018-01-09 19:03 ` [PATCH v1 02/16] irqchip: gicv3-its: Add helpers for handling 52bit address Suzuki K Poulose
2018-02-07 15:10   ` Christoffer Dall
2018-02-08 11:20     ` Suzuki K Poulose
2018-02-08 11:36       ` Robin Murphy
2018-02-08 13:45       ` Christoffer Dall
2018-01-09 19:03 ` [PATCH v1 03/16] arm64: Make page table helpers reusable Suzuki K Poulose
2018-01-09 19:03 ` [PATCH v1 04/16] arm64: Refactor pud_huge for reusability Suzuki K Poulose
2018-01-09 19:04 ` [PATCH v1 05/16] arm64: Helper for parange to PASize Suzuki K Poulose
2018-02-08 11:00   ` Christoffer Dall
2018-02-08 11:08     ` Suzuki K Poulose
2018-02-08 11:21       ` Christoffer Dall
2018-01-09 19:04 ` [PATCH v1 06/16] kvm: arm/arm64: Fix stage2_flush_memslot for 4 level page table Suzuki K Poulose
2018-02-08 11:00   ` Christoffer Dall
2018-01-09 19:04 ` [PATCH v1 07/16] kvm: arm/arm64: Remove spurious WARN_ON Suzuki K Poulose
2018-02-08 11:00   ` Christoffer Dall
2018-01-09 19:04 ` [PATCH v1 08/16] kvm: arm/arm64: Clean up stage2 pgd life time Suzuki K Poulose
2018-02-08 11:00   ` Christoffer Dall
2018-02-08 17:19     ` Suzuki K Poulose
2018-02-09  8:11       ` Christoffer Dall
2018-01-09 19:04 ` [PATCH v1 09/16] kvm: arm/arm64: Delay stage2 page table allocation Suzuki K Poulose
2018-02-08 11:01   ` Christoffer Dall
2018-02-08 17:20     ` Suzuki K Poulose
2018-01-09 19:04 ` [PATCH v1 10/16] kvm: arm/arm64: Prepare for VM specific stage2 translations Suzuki K Poulose
2018-01-09 19:04 ` [PATCH v1 11/16] kvm: arm64: Make stage2 page table layout dynamic Suzuki K Poulose
2018-01-09 19:04 ` [PATCH v1 12/16] kvm: arm64: Dynamic configuration of VTCR and VTTBR mask Suzuki K Poulose
2018-01-09 19:04 ` [PATCH v1 13/16] kvm: arm64: Configure VTCR per VM Suzuki K Poulose
2018-02-08 18:04   ` Christoffer Dall
2018-03-15 15:24     ` Suzuki K Poulose
2018-01-09 19:04 ` [PATCH v1 14/16] kvm: arm64: Switch to per VM IPA Suzuki K Poulose
2018-02-08 11:00   ` Christoffer Dall
2018-02-08 17:22     ` Suzuki K Poulose
2018-02-09  8:12       ` Christoffer Dall
2018-01-09 19:04 ` [PATCH v1 15/16] kvm: arm64: Allow configuring physical address space size Suzuki K Poulose
2018-02-08 11:14   ` Christoffer Dall
2018-02-08 17:53     ` Suzuki K Poulose
2018-02-09  8:16       ` Christoffer Dall
2018-02-09  9:27         ` Andrew Jones
2018-03-15 11:06         ` Suzuki K Poulose
2018-01-09 19:04 ` [PATCH v1 16/16] vgic: its: Add support for 52bit guest physical address Suzuki K Poulose
2018-01-09 19:04 ` [kvmtool hack 1/3] virtio: Handle aborts using invalid PFN Suzuki K Poulose
2018-01-09 19:04 ` [kvmtool hack 2/3] kvmtool: arm64: Add support for guest physical address size Suzuki K Poulose
2018-01-09 19:04 ` [kvmtool hack 3/3] kvmtool: arm64: Switch memory layout Suzuki K Poulose
2018-02-08 11:18 ` [PATCH 00/16] kvm: arm64: Support for dynamic IPA size Christoffer Dall
2018-02-08 11:25   ` Will Deacon

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).