From: Eric Auger <eric.auger@redhat.com>
To: eric.auger.pro@gmail.com, eric.auger@redhat.com,
linux-kernel@vger.kernel.org, kvm@vger.kernel.org,
kvmarm@lists.cs.columbia.edu, marc.zyngier@arm.com,
cdall@linaro.org, peter.maydell@linaro.org,
andre.przywara@arm.com, wanghaibin.wang@huawei.com
Cc: wu.wubin@huawei.com
Subject: [PATCH v4 00/11] vITS Migration fixes and reset
Date: Tue, 17 Oct 2017 09:09:58 +0200 [thread overview]
Message-ID: <1508224209-15366-1-git-send-email-eric.auger@redhat.com> (raw)
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-7] attempt to fix the migration issues without
implementing the reset.
As such they may be candidate for stable:
- handle case where all collection, device and ITT entries are
invalid on restore (which shouldn't be an error)
- 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.
- Check GITS_BASER<n> and GITS_CBASER on ITS enable
- systematically do both device and collection save/restore even if
one fails.
Patches [8-11] 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-v4
* 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:
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 (10):
KVM: arm/arm64: vgic-its: fix return value for device table restore
KVM: arm/arm64: vgic-its: fix vgic_its_restore_collection_table
returned value
KVM: arm/arm64: vgic-its: Improve error reporting on device table save
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: 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 (1):
KVM: arm/arm64: vgic-its: new helper functions to free the caches
Documentation/virtual/kvm/devices/arm-vgic-its.txt | 20 ++
arch/arm/include/uapi/asm/kvm.h | 1 +
arch/arm64/include/uapi/asm/kvm.h | 1 +
virt/kvm/arm/vgic/vgic-its.c | 361 ++++++++++++++-------
4 files changed, 270 insertions(+), 113 deletions(-)
--
2.5.5
next reply other threads:[~2017-10-17 7:09 UTC|newest]
Thread overview: 29+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-10-17 7:09 Eric Auger [this message]
2017-10-17 7:09 ` [PATCH v4 01/11] KVM: arm/arm64: vgic-its: fix return value for device table restore Eric Auger
2017-10-17 21:40 ` Christoffer Dall
2017-10-21 14:40 ` Auger Eric
2017-10-21 15:42 ` Christoffer Dall
2017-10-17 7:10 ` [PATCH v4 02/11] KVM: arm/arm64: vgic-its: fix vgic_its_restore_collection_table returned value Eric Auger
2017-10-17 21:54 ` Christoffer Dall
2017-10-17 7:10 ` [PATCH v4 03/11] KVM: arm/arm64: vgic-its: Improve error reporting on device table save Eric Auger
2017-10-17 22:00 ` Christoffer Dall
2017-10-17 7:10 ` [PATCH v4 04/11] KVM: arm/arm64: vgic-its: Check CBASER/BASER validity before enabling the ITS Eric Auger
2017-10-17 22:02 ` Christoffer Dall
2017-10-17 22:05 ` Christoffer Dall
2017-10-17 7:10 ` [PATCH v4 05/11] KVM: arm/arm64: vgic-its: Check GITS_BASER Valid bit before saving tables Eric Auger
2017-10-17 7:10 ` [PATCH v4 06/11] KVM: arm/arm64: vgic-its: Check GITS_CBASER validity before processing commands Eric Auger
2017-10-17 22:10 ` Christoffer Dall
2017-10-18 14:34 ` Auger Eric
2017-10-17 7:10 ` [PATCH v4 07/11] KVM: arm/arm64: vgic-its: Always attempt to save/restore device and collection tables Eric Auger
2017-10-17 22:15 ` Christoffer Dall
2017-10-17 7:10 ` [PATCH v4 08/11] KVM: arm/arm64: vgic-its: new helper functions to free the caches Eric Auger
2017-10-17 22:24 ` Christoffer Dall
2017-10-17 7:10 ` [PATCH v4 09/11] KVM: arm/arm64: vgic-its: free caches when GITS_BASER Valid bit is cleared Eric Auger
2017-10-17 22:34 ` Christoffer Dall
2017-10-21 10:13 ` Auger Eric
2017-10-21 14:31 ` Christoffer Dall
2017-10-21 14:36 ` Auger Eric
2017-10-21 15:42 ` Christoffer Dall
2017-10-17 7:10 ` [PATCH v4 10/11] KVM: arm/arm64: Document KVM_DEV_ARM_ITS_CTRL_RESET Eric Auger
2017-10-17 22:38 ` Christoffer Dall
2017-10-17 7:10 ` [PATCH v4 11/11] KVM: arm/arm64: vgic-its: Implement KVM_DEV_ARM_ITS_CTRL_RESET Eric Auger
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1508224209-15366-1-git-send-email-eric.auger@redhat.com \
--to=eric.auger@redhat.com \
--cc=andre.przywara@arm.com \
--cc=cdall@linaro.org \
--cc=eric.auger.pro@gmail.com \
--cc=kvm@vger.kernel.org \
--cc=kvmarm@lists.cs.columbia.edu \
--cc=linux-kernel@vger.kernel.org \
--cc=marc.zyngier@arm.com \
--cc=peter.maydell@linaro.org \
--cc=wanghaibin.wang@huawei.com \
--cc=wu.wubin@huawei.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox