linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [RFC PATCH v2 0/3] KVM: arm64: Errata management for VM Live migration
@ 2024-10-24  9:40 Shameer Kolothum
  2024-10-24  9:40 ` [RFC PATCH v2 1/3] KVM: arm64: Add hypercall support for retrieving migration targets Shameer Kolothum
                   ` (2 more replies)
  0 siblings, 3 replies; 10+ messages in thread
From: Shameer Kolothum @ 2024-10-24  9:40 UTC (permalink / raw)
  To: kvmarm, maz, oliver.upton
  Cc: catalin.marinas, will, mark.rutland, cohuck, eric.auger,
	yuzenghui, wangzhou1, jiangkunkun, jonathan.cameron,
	anthony.jebson, linux-arm-kernel, linuxarm

This is another attempt on this based on the feedback received
for RFC v1. Thanks for all the discussions and suggestions.

Changes from RFC v1[0]:
 -Introduced hypercalls to retrieve target CPUs info from user space VMM.
  see patch #1 for details.
 -Patch #2 uses the hypercall to retrieve the target CPU info if any.
 -Use the target CPUs MIDR/REVIDR in errata enablement. See patch #3.

Sanity tested on a HiSilicon ARM64 platform using a hacked Qemu that can
handle the above-mentioned hypercalls.

Please take a look and let me know if this is in the right direction or
not.

Also TBD:
1. Do we need some way of notifying the userspace VMM in case the Guest
   fails to update target CPUs?
2. Usage of synthetic MIDR mentioned in RFC v1 discussion. How do we
   envision the synthetic MIDR to be used/supported?
   1. VMM writes synthetic MIDR to KVM(SET_ONE_REG)
   2. Uses Guest hypercall to update the target CPUs info.

   If this is the case what happens if an old Guest (without hypercall
   support) is used?  VMM will abort the Guest if no hypercall is 
   received but a synthetic MIDR is set?

Thanks,
Shameer

[0]https://lore.kernel.org/kvmarm/20241011075053.80540-1-shameerali.kolothum.thodi@huawei.com/

Background from v1:

On ARM64 platforms most of the errata workarounds are based on CPU
MIDR/REVIDR values and a number of these workarounds need to be
implemented by the Guest kernel as well. This creates a problem when
Guest needs to be migrated to a platform that differs in these
MIDR/REVIDR values even if the VMM can come up with a common minimum
feature list for the Guest using the recently introduced "Writable
ID registers" support.

(This is roughly based on a discussion I had with Marc and Oliver
at KVM forum. Marc outlined his idea for a solution and this is an
attempt to implement it. Thanks to both and I take all the blame
if this is nowhere near what is intended/required)

Shameer Kolothum (3):
  KVM: arm64: Add hypercall support for retrieving migration targets
  KVM: arm64: Use hypercall to retrieve any migration targets
  KVM: arm64: Enable errata based on migration target CPUs

 Documentation/virt/kvm/arm/hypercalls.rst | 77 +++++++++++++++++++++++
 arch/arm64/include/asm/cpufeature.h       |  7 +++
 arch/arm64/include/asm/paravirt.h         |  3 +
 arch/arm64/kernel/cpu_errata.c            | 49 ++++++++++++---
 arch/arm64/kernel/cpufeature.c            |  3 +
 arch/arm64/kernel/paravirt.c              | 48 ++++++++++++++
 include/linux/arm-smccc.h                 | 13 ++++
 7 files changed, 190 insertions(+), 10 deletions(-)

-- 
2.45.2



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

end of thread, other threads:[~2024-10-30  4:41 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-10-24  9:40 [RFC PATCH v2 0/3] KVM: arm64: Errata management for VM Live migration Shameer Kolothum
2024-10-24  9:40 ` [RFC PATCH v2 1/3] KVM: arm64: Add hypercall support for retrieving migration targets Shameer Kolothum
2024-10-25  1:25   ` Oliver Upton
2024-10-29 16:00     ` Shameerali Kolothum Thodi
2024-10-30  4:39       ` Oliver Upton
2024-10-24  9:40 ` [RFC PATCH v2 2/3] KVM: arm64: Use hypercall to retrieve any " Shameer Kolothum
2024-10-24  9:40 ` [RFC PATCH v2 3/3] KVM: arm64: Enable errata based on migration target CPUs Shameer Kolothum
2024-10-25  1:36   ` Oliver Upton
2024-10-28 17:29     ` Shameerali Kolothum Thodi
2024-10-30  4:33       ` Oliver Upton

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