All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/3] Introduce new vcpu ioctls KVM_(GET|SET)_MANY_REGS
@ 2020-11-20 12:56 darkhan
  2020-11-20 12:56 ` [PATCH 1/3] Documentation: KVM: change description of vcpu ioctls KVM_(GET|SET)_ONE_REG darkhan
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: darkhan @ 2020-11-20 12:56 UTC (permalink / raw)
  To: pbonzini
  Cc: kvm, corbet, maz, james.morse, catalin.marinas, chenhc, paulus,
	frankja, mingo, acme, graf, darkhan, Darkhan Mukashov

From: Darkhan Mukashov <darkhan@amazon.com>

The ultimate goal is to introduce new vcpu ioctls KVM_(GET|SET)_MANY_REGS.
To introduce these ioctls, implementations of KVM_(GET|SET)_ONE_REG have
to be refactored. Specifically, KVM_(GET|SET)_ONE_REG should be handled in
a generic kvm_vcpu_ioctl function.

New KVM APIs KVM_(GET|SET)_MANY_REGS make it possible to bulk read/write
vCPU registers at one ioctl call. These ioctls can be very useful when
vCPU state serialization/deserialization is required (e.g. live update of
kvm, live migration of guests), hence all registers have to be
saved/restored. KVM_(GET|SET)_MANY_REGS will help avoid performance
overhead associated with syscall (ioctl in our case) handling. Tests
conducted on AWS Graviton2 Processors (64-bit ARM Neoverse cores) show
that average save/restore time of all vCPU registers can be optimized
~3.5 times per vCPU with new ioctls. Test results can be found in Table 1.
+---------+-------------+---------------+
|         | kvm_one_reg | kvm_many_regs |
+---------+-------------+---------------+
| get all |   123 usec  |    33 usec    |
+---------+-------------+---------------+
| set all |   120 usec  |    36 usec    |
+---------+-------------+---------------+
	Table 1. Test results

The patches are based out of kvm/queue.

Darkhan Mukashov (3):
  Documentation: KVM: change description of vcpu ioctls
    KVM_(GET|SET)_ONE_REG
  KVM: handle vcpu ioctls KVM_(GET|SET)_ONE_REG in a generic function
  KVM: introduce new vcpu ioctls KVM_GET_MANY_REGS and KVM_SET_MANY_REGS

 Documentation/virt/kvm/api.rst     | 80 ++++++++++++++++++++++++++++--
 arch/arm64/include/asm/kvm_host.h  |  5 +-
 arch/arm64/kvm/arm.c               | 25 +++-------
 arch/arm64/kvm/guest.c             |  6 ++-
 arch/mips/include/asm/kvm_host.h   |  6 +++
 arch/mips/kvm/mips.c               | 32 ++++++------
 arch/powerpc/include/asm/kvm_ppc.h |  2 -
 arch/powerpc/kvm/powerpc.c         | 20 ++------
 arch/s390/include/asm/kvm_host.h   |  6 +++
 arch/s390/kvm/kvm-s390.c           | 38 +++++++-------
 arch/x86/kvm/x86.c                 | 12 +++++
 include/linux/kvm_host.h           | 18 +++++++
 include/uapi/linux/kvm.h           | 11 ++++
 virt/kvm/kvm_main.c                | 62 +++++++++++++++++++++++
 14 files changed, 244 insertions(+), 79 deletions(-)

-- 
2.17.1


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

end of thread, other threads:[~2020-11-23 11:39 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-11-20 12:56 [PATCH 0/3] Introduce new vcpu ioctls KVM_(GET|SET)_MANY_REGS darkhan
2020-11-20 12:56 ` [PATCH 1/3] Documentation: KVM: change description of vcpu ioctls KVM_(GET|SET)_ONE_REG darkhan
2020-11-20 12:56 ` [PATCH 2/3] KVM: handle vcpu ioctls KVM_(GET|SET)_ONE_REG in a generic function darkhan
2020-11-20 12:56 ` [PATCH 3/3] KVM: introduce new vcpu ioctls KVM_GET_MANY_REGS and KVM_SET_MANY_REGS darkhan
2020-11-23 11:39 ` [PATCH 0/3] Introduce new vcpu ioctls KVM_(GET|SET)_MANY_REGS Marc Zyngier

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.