Skip to content

RFC RISC-V: Add steal-time support

Andrew Jones kvm-riscv linux-riscv 1 version New

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 RFC Latest14 patches 0 repliesNew

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/14RISC-V: paravirt: Add skeleton for pv-time supportDocumentation/admin-guide/kernel-parameters.txt arch/riscv/include/asm/paravirt.h arch/riscv/include/asm/paravirt_api_clock.h +3 more+114 -30 replies
2/14RISC-V: Add SBI STA extension definitionsarch/riscv/include/asm/sbi.h+15 -02 replies
2/14RISC-V: Add SBI STA extension definitions+0 -02 replies
2/14RISC-V: Add SBI STA extension definitions+0 -01 reply
2/14RISC-V: Add SBI STA extension definitions+0 -00 replies
3/14RISC-V: paravirt: Implement steal-time supportarch/riscv/kernel/paravirt.c+53 -31 reply
3/14RISC-V: paravirt: Implement steal-time support+0 -01 reply
3/14RISC-V: paravirt: Implement steal-time support+0 -01 reply
3/14RISC-V: paravirt: Implement steal-time support+0 -00 replies
3/14RISC-V: paravirt: Implement steal-time support+0 -00 replies
4/14RISC-V: paravirt: Add kconfigsarch/riscv/Kconfig+19 -01 reply
5/14RISC-V: KVM: Add SBI STA extension skeletonarch/riscv/include/asm/kvm_vcpu_sbi.h arch/riscv/include/uapi/asm/kvm.h arch/riscv/kvm/Makefile +2 more+54 -00 replies
6/14RISC-V: KVM: Add steal-update vcpu requestarch/riscv/include/asm/kvm_host.h arch/riscv/kvm/vcpu.c arch/riscv/kvm/vcpu_sbi_sta.c+12 -00 replies
7/14RISC-V: KVM: Add SBI STA info to vcpu_archarch/riscv/include/asm/kvm_host.h arch/riscv/kvm/vcpu.c arch/riscv/kvm/vcpu_sbi_sta.c+12 -00 replies
8/14RISC-V: KVM: Implement SBI STA extensionarch/riscv/kvm/Kconfig arch/riscv/kvm/vcpu_sbi_sta.c+95 -20 replies
9/14RISC-V: KVM: Add support for SBI extension registersarch/riscv/include/uapi/asm/kvm.h arch/riscv/kvm/vcpu.c+65 -00 replies
10/14RISC-V: KVM: Add support for SBI STA registersarch/riscv/include/asm/kvm_vcpu_sbi.h arch/riscv/include/uapi/asm/kvm.h arch/riscv/kvm/vcpu.c +1 more+71 -00 replies
11/14KVM: selftests: riscv: Move sbi_ecall to processor.ctools/testing/selftests/kvm/lib/riscv/processor.c tools/testing/selftests/kvm/lib/riscv/ucall.c+26 -260 replies
12/14KVM: selftests: riscv: Add guest_sbi_probe_extensiontools/testing/selftests/kvm/include/riscv/processor.h tools/testing/selftests/kvm/lib/riscv/processor.c+40 -00 replies
13/14KVM: selftests: riscv: Add RISCV_SBI_EXT_REGtools/testing/selftests/kvm/include/riscv/processor.h+11 -70 replies
14/14KVM: selftests: riscv: Add steal_time test supporttools/testing/selftests/kvm/Makefile tools/testing/selftests/kvm/include/riscv/processor.h tools/testing/selftests/kvm/steal_time.c+103 -10 replies

Reviews trailers per patch

5 of 21 patches have a Reviewed-by or Acked-by.

PatchConor Dooley
1/14
2/14R-b
2/14R-b
2/14R-b
2/14R-b
3/14
3/14
3/14
3/14
3/14
4/14R-b
5/14
6/14
7/14
8/14
9/14
10/14
11/14
12/14
13/14
14/14

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v1 thread

Cover letter [RFC PATCH 00/14] RISC-V: Add steal-time support

One frequently touted benefit of virtualization is the ability to consolidate machines, increasing resource utilization. It may even be desirable to overcommit, at the risk of one or more VCPUs having to wait. Hypervisors which have interfaces for guests to retrieve the amount of time each VCPU had to wait give observers within the guests ways to account for less progress than would otherwise be expected. The SBI STA extension proposal[1] provides a standard interface for guest VCPUs to retrieve the amount of time "stolen".

This series has three parts:
1) Patches 01-04 - Add paravirt support to RISC-V and implement steal-time accounting support using the SBI STA extension.
2) Patches 05-10 - Implement SBI STA in KVM so KVM guests, such as Linux guests which enable the paravirt steal-time support, can be enlightened about stolen time.
3) Patches 11-12 - Add support to the KVM selftests steal_time test for RISC-V.

Note, while we can review and revise this series now, we'll keep the RFC tag and refrain from merging it until the proposed SBI extension has been ratified.

[1] https://lists.riscv.org/g/tech-prs/message/401

This patches are also available here
https://github.com/jones-drew/linux/commits/kvm/steal-time-rfc-v1

Thanks,
drew

Andrew Jones (14):
RISC-V: paravirt: Add skeleton for pv-time support
RISC-V: Add SBI STA extension definitions
RISC-V: paravirt: Implement steal-time support
RISC-V: paravirt: Add kconfigs
RISC-V: KVM: Add SBI STA extension skeleton
RISC-V: KVM: Add steal-update vcpu request
RISC-V: KVM: Add SBI STA info to vcpu_arch
RISC-V: KVM: Implement SBI STA extension
RISC-V: KVM: Add support for SBI extension registers
RISC-V: KVM: Add support for SBI STA registers
KVM: selftests: riscv: Move sbi_ecall to processor.c
KVM: selftests: riscv: Add guest_sbi_probe_extension
KVM: selftests: riscv: Add RISCV_SBI_EXT_REG
KVM: selftests: riscv: Add steal_time test support

 .../admin-guide/kernel-parameters.txt         |   6 +-
 arch/riscv/Kconfig                            |  19 ++
 arch/riscv/include/asm/kvm_host.h             |   9 +
 arch/riscv/include/asm/kvm_vcpu_sbi.h         |   5 +
 arch/riscv/include/asm/paravirt.h             |  29 +++
 arch/riscv/include/asm/paravirt_api_clock.h   |   1 +
 arch/riscv/include/asm/sbi.h                  |  15 ++
 arch/riscv/include/uapi/asm/kvm.h             |  14 ++
 arch/riscv/kernel/Makefile                    |   1 +
 arch/riscv/kernel/paravirt.c                  | 127 +++++++++++
 arch/riscv/kernel/time.c                      |   3 +
 arch/riscv/kvm/Kconfig                        |   1 +
 arch/riscv/kvm/Makefile                       |   1 +
 arch/riscv/kvm/vcpu.c                         |  74 +++++++
 arch/riscv/kvm/vcpu_sbi.c                     |   4 +
 arch/riscv/kvm/vcpu_sbi_sta.c                 | 199 ++++++++++++++++++
 tools/testing/selftests/kvm/Makefile          |   3 +-
 .../selftests/kvm/include/riscv/processor.h   |  40 +++-
 .../selftests/kvm/lib/riscv/processor.c       |  45 ++++
 tools/testing/selftests/kvm/lib/riscv/ucall.c |  26 ---
 tools/testing/selftests/kvm/steal_time.c      | 100 +++++++++
 21 files changed, 685 insertions(+), 37 deletions(-)
 create mode 100644 arch/riscv/include/asm/paravirt.h
 create mode 100644 arch/riscv/include/asm/paravirt_api_clock.h
 create mode 100644 arch/riscv/kernel/paravirt.c
 create mode 100644 arch/riscv/kvm/vcpu_sbi_sta.c
Signature · 1 line
2.39.2