All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 00/10] vITS Migration fixes and reset
@ 2017-09-27 13:28 Eric Auger
  2017-09-27 13:28 ` [PATCH v2 01/10] KVM: arm/arm64: vgic-its: fix return value for restore Eric Auger
                   ` (9 more replies)
  0 siblings, 10 replies; 46+ messages in thread
From: Eric Auger @ 2017-09-27 13:28 UTC (permalink / raw)
  To: eric.auger.pro, eric.auger, linux-kernel, kvm, marc.zyngier,
	cdall, peter.maydell, andre.przywara, wanghaibin.wang
  Cc: wu.wubin

This series fixes various bugs observed when saving/restoring the
ITS state before the guest writes the ITS registers (on first boot or
after reset/reboot).

This is a follow up of Wanghaibin's series [1] plus additional
patches following additional code review. It also proposes one
ITS reset implementation. I dared to include 2 Wanghaibin patches,
taking into account the discussions held on the ML but obviously
they can live separately.

Currently, the in-kernel emulated ITS is not reset. After a
reset/reboot, the ITS register values and caches are left
unchanged. Registers may point to some tables in guest memory
which do not exist anymore. If an ITS state backup is initiated
before the guest re-writes the registers, the save fails
because inconsistencies are detected. Also restore of data saved
as such moment is failing.

Patches [1-6] attempt to fix the migration issues without
implementing the reset.
As such they may be candidate for stable:
- do not fail restore if device or ITT tables only contain invalid
  entries
- allow clearing GITS_CREADR/CWRITER whatever CBASER queue size
- limit the cases where we return -EINVAL in table save()
- never attempt to use GITS_BASER<n> and GITS_CBASER if they are
  not valid.
- systematically do both device and collection save/restore even if
  one fails.

Patches [7-10] implement a new ITS reset IOCTL
  - maybe patch "free caches when GITS_BASER Valid bit is cleared" can
    be omitted if we consider the caches should not be cleared when
    GITS_BASER<n>.Valid is cleared.

Best Regards

Eric

Git: complete series available at
https://github.com/eauger/linux/tree/v4.14-rc2-its-reset-v2

* Testing:
- on Cavium using a virtio-net-pci guest and various sequences of
  guest shutdown -r now, virsh reset, virsh suspend/resume,
  virsh reboot, virsh save.restore, virsh shutdown

References:
[1] [RFC PATCH 0/3] fix migrate failed when vm is in booting
https://www.spinics.net/lists/kvm-arm/msg27121.html

History:
v1 -> v2:
- added KVM: arm/arm64: vgic-its: Always attempt to save/restore
  device and collection tables

PATCH v1
- series including 2 modified patches of Wanghaibin


Eric Auger (8):
  KVM: arm/arm64: vgic-its: Always allow clearing GITS_CREADR/CWRITER
  KVM: arm/arm64: vgic-its: Improve error reporting on device table save
  KVM: arm/arm64: vgic-its: Check GITS_BASER Valid bit before saving
    tables
  KVM: arm/arm64: vgic-its: Check GITS_CBASER validity before processing
    commands
  KVM: arm/arm64: vgic-its: Always attempt to save/restore device and
    collection tables
  KVM: arm/arm64: vgic-its: free caches when GITS_BASER Valid bit is
    cleared
  KVM: arm/arm64: Document KVM_DEV_ARM_ITS_CTRL_RESET
  KVM: arm/arm64: vgic-its: Implement KVM_DEV_ARM_ITS_CTRL_RESET

wanghaibin (2):
  KVM: arm/arm64: vgic-its: fix return value for restore
  KVM: arm/arm64: vgic-its: new helper functions to free the caches

 Documentation/virtual/kvm/devices/arm-vgic-its.txt |  16 ++
 arch/arm/include/uapi/asm/kvm.h                    |   1 +
 arch/arm64/include/uapi/asm/kvm.h                  |   1 +
 virt/kvm/arm/vgic/vgic-its.c                       | 222 +++++++++++++--------
 4 files changed, 158 insertions(+), 82 deletions(-)

-- 
2.5.5

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

end of thread, other threads:[~2017-10-21 14:34 UTC | newest]

Thread overview: 46+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-09-27 13:28 [PATCH v2 00/10] vITS Migration fixes and reset Eric Auger
2017-09-27 13:28 ` [PATCH v2 01/10] KVM: arm/arm64: vgic-its: fix return value for restore Eric Auger
2017-10-06 14:37   ` Andre Przywara
2017-10-06 15:33     ` Auger Eric
2017-10-13 11:04   ` Christoffer Dall
2017-09-27 13:28 ` [PATCH v2 02/10] KVM: arm/arm64: vgic-its: Always allow clearing GITS_CREADR/CWRITER Eric Auger
2017-10-06 14:37   ` Andre Przywara
2017-10-06 15:29     ` Auger Eric
2017-10-13 11:44       ` Christoffer Dall
2017-10-13 11:54         ` Auger Eric
2017-10-13 17:54           ` Christoffer Dall
2017-10-14  8:53             ` Auger Eric
2017-10-14 15:04               ` Christoffer Dall
2017-09-27 13:28 ` [PATCH v2 03/10] KVM: arm/arm64: vgic-its: Improve error reporting on device table save Eric Auger
2017-10-06 14:38   ` Andre Przywara
2017-10-13 13:16   ` Christoffer Dall
2017-10-13 14:22     ` Auger Eric
2017-10-13 17:56       ` Christoffer Dall
2017-10-14  8:52         ` Auger Eric
2017-10-14 15:06           ` Christoffer Dall
2017-09-27 13:28 ` [PATCH v2 04/10] KVM: arm/arm64: vgic-its: Check GITS_BASER Valid bit before saving tables Eric Auger
2017-10-06 14:38   ` Andre Przywara
2017-10-13 13:24   ` Christoffer Dall
2017-09-27 13:28 ` [PATCH v2 05/10] KVM: arm/arm64: vgic-its: Check GITS_CBASER validity before processing commands Eric Auger
2017-10-06 14:38   ` Andre Przywara
2017-10-06 15:29     ` Auger Eric
2017-09-27 13:28 ` [PATCH v2 06/10] KVM: arm/arm64: vgic-its: Always attempt to save/restore device and collection tables Eric Auger
2017-10-06 14:38   ` Andre Przywara
2017-10-06 15:29     ` Auger Eric
2017-09-27 13:28 ` [PATCH v2 07/10] KVM: arm/arm64: vgic-its: new helper functions to free the caches Eric Auger
2017-10-13 13:35   ` Christoffer Dall
2017-10-13 14:37     ` Auger Eric
2017-10-21  9:02     ` Auger Eric
2017-10-21 14:34       ` Christoffer Dall
2017-09-27 13:28 ` [PATCH v2 08/10] KVM: arm/arm64: vgic-its: free caches when GITS_BASER Valid bit is cleared Eric Auger
2017-10-13 15:19   ` Christoffer Dall
2017-10-13 15:34     ` Auger Eric
2017-10-13 17:59       ` Christoffer Dall
2017-09-27 13:28 ` [PATCH v2 09/10] KVM: arm/arm64: Document KVM_DEV_ARM_ITS_CTRL_RESET Eric Auger
2017-10-12 10:57   ` Peter Maydell
2017-10-12 11:34     ` Auger Eric
2017-10-13 15:26   ` Christoffer Dall
2017-10-13 15:41     ` Auger Eric
2017-10-13 18:00       ` Christoffer Dall
2017-09-27 13:28 ` [PATCH v2 10/10] KVM: arm/arm64: vgic-its: Implement KVM_DEV_ARM_ITS_CTRL_RESET Eric Auger
2017-10-13 15:40   ` Christoffer Dall

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.