linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v5 00/10] vITS Migration fixes and reset
@ 2017-10-23 14:08 Eric Auger
  2017-10-23 14:08 ` [PATCH v5 01/10] KVM: arm/arm64: vgic-its: Fix return value for device table restore Eric Auger
                   ` (9 more replies)
  0 siblings, 10 replies; 24+ messages in thread
From: Eric Auger @ 2017-10-23 14:08 UTC (permalink / raw)
  To: eric.auger.pro, eric.auger, linux-kernel, kvm, kvmarm,
	marc.zyngier, cdall, peter.maydell, andre.przywara,
	wanghaibin.wang
  Cc: wu.wubin, drjones, wei

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.

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-5] attempt to fix the migration issues without
implementing the reset IOCTL.
They are candidate for stable:
- handle case where all collection, device and ITT entries are
  invalid on restore (which is not an error)
- Check the GITS_BASER<n> valid bit before attempting the save
  any table
- Check the GITS_BASER<n> and GITS_CBASER are valid before enabling
  the ITS
- save the collection table before device tables

Patches [6-10] allow to empty the caches on reset and implement a
new ITS reset IOCTL

Best Regards

Eric

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

* 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:
v4 -> v5:
- came back to the original version of
  KVM: arm/arm64: vgic-its: Fix return value for device table restore
  Rework of error handling will come later
- remove [PATCH v4 03/11] KVM: arm/arm64: vgic-its: Improve error reporting
  on device table save as of now
- remove KVM: arm/arm64: vgic-its: Always attempt to save/restore device
  and collection tables
  inversing the save order of device/collection tables fixes the same issue
- reword ITS IOCTL doc
- add mutex lock in vgic_its_free_collection_list
- remove vgic_its_unmap_device

v3 -> v4:
- fixes a bug in indirect mode: in handle_l1_dte, set
  *valid at the beginning of the function

v2 -> v3:
- Revisited error handling in restore functions
- Added "KVM: arm/arm64: vgic-its: fix
        vgic_its_restore_collection_table returned value"
- Added "KVM: arm/arm64: vgic-its: Check CBASER/BASER validity
  before enabling the ITS"
- Removed KVM: arm/arm64: vgic-its: Always allow clearing
  GITS_CREADR/CWRITER
- Reworded documentation according to Christoffer's comments

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: Fix vgic_its_restore_collection_table
    returned value
  KVM: arm/arm64: vgic-its: Check CBASER/BASER validity before enabling
    the ITS
  KVM: arm/arm64: vgic-its: Check GITS_BASER Valid bit before saving
    tables
  KVM: arm/arm64: vgic-its: Save the collection table before device
    tables
  KVM: arm/arm64: vgic-its: Remove kvm_its_unmap_device
  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 device table restore
  KVM: arm/arm64: vgic-its: New helper functions to free the caches

 Documentation/virtual/kvm/devices/arm-vgic-its.txt |  21 +++
 arch/arm/include/uapi/asm/kvm.h                    |   1 +
 arch/arm64/include/uapi/asm/kvm.h                  |   1 +
 virt/kvm/arm/vgic/vgic-its.c                       | 205 ++++++++++++++-------
 4 files changed, 162 insertions(+), 66 deletions(-)

-- 
2.5.5

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

end of thread, other threads:[~2017-10-25 11:52 UTC | newest]

Thread overview: 24+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-10-23 14:08 [PATCH v5 00/10] vITS Migration fixes and reset Eric Auger
2017-10-23 14:08 ` [PATCH v5 01/10] KVM: arm/arm64: vgic-its: Fix return value for device table restore Eric Auger
2017-10-24 16:02   ` Christoffer Dall
2017-10-23 14:08 ` [PATCH v5 02/10] KVM: arm/arm64: vgic-its: Fix vgic_its_restore_collection_table returned value Eric Auger
2017-10-24 16:15   ` Christoffer Dall
2017-10-23 14:08 ` [PATCH v5 03/10] KVM: arm/arm64: vgic-its: Check CBASER/BASER validity before enabling the ITS Eric Auger
2017-10-25  9:38   ` Marc Zyngier
2017-10-25  9:46     ` Marc Zyngier
2017-10-25 11:52   ` Christoffer Dall
2017-10-23 14:08 ` [PATCH v5 04/10] KVM: arm/arm64: vgic-its: Check GITS_BASER Valid bit before saving tables Eric Auger
2017-10-25  9:47   ` Marc Zyngier
2017-10-23 14:08 ` [PATCH v5 05/10] KVM: arm/arm64: vgic-its: Save the collection table before device tables Eric Auger
2017-10-25  9:59   ` Christoffer Dall
2017-10-23 14:08 ` [PATCH v5 06/10] KVM: arm/arm64: vgic-its: Remove kvm_its_unmap_device Eric Auger
2017-10-25  9:45   ` Christoffer Dall
2017-10-23 14:08 ` [PATCH v5 07/10] KVM: arm/arm64: vgic-its: New helper functions to free the caches Eric Auger
2017-10-25 10:31   ` Christoffer Dall
2017-10-25 10:31   ` Marc Zyngier
2017-10-23 14:08 ` [PATCH v5 08/10] KVM: arm/arm64: vgic-its: Free caches when GITS_BASER Valid bit is cleared Eric Auger
2017-10-25 10:23   ` Marc Zyngier
2017-10-23 14:08 ` [PATCH v5 09/10] KVM: arm/arm64: Document KVM_DEV_ARM_ITS_CTRL_RESET Eric Auger
2017-10-25 10:40   ` Marc Zyngier
2017-10-23 14:08 ` [PATCH v5 10/10] KVM: arm/arm64: vgic-its: Implement KVM_DEV_ARM_ITS_CTRL_RESET Eric Auger
2017-10-25 10:52   ` Marc Zyngier

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).