linux/arch
David Woodhouse 30b5c851af KVM: x86/xen: Add support for vCPU runstate information
This is how Xen guests do steal time accounting. The hypervisor records
the amount of time spent in each of running/runnable/blocked/offline
states.

In the Xen accounting, a vCPU is still in state RUNSTATE_running while
in Xen for a hypercall or I/O trap, etc. Only if Xen explicitly schedules
does the state become RUNSTATE_blocked. In KVM this means that even when
the vCPU exits the kvm_run loop, the state remains RUNSTATE_running.

The VMM can explicitly set the vCPU to RUNSTATE_blocked by using the
KVM_XEN_VCPU_ATTR_TYPE_RUNSTATE_CURRENT attribute, and can also use
KVM_XEN_VCPU_ATTR_TYPE_RUNSTATE_ADJUST to retrospectively add a given
amount of time to the blocked state and subtract it from the running
state.

The state_entry_time corresponds to get_kvmclock_ns() at the time the
vCPU entered the current state, and the total times of all four states
should always add up to state_entry_time.

Co-developed-by: Joao Martins <joao.m.martins@oracle.com>
Signed-off-by: Joao Martins <joao.m.martins@oracle.com>
Signed-off-by: David Woodhouse <dwmw@amazon.co.uk>
Message-Id: <20210301125309.874953-2-dwmw2@infradead.org>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2021-03-02 14:30:54 -05:00
..
alpha local64.h: make <asm/local64.h> mandatory 2020-12-29 15:36:49 -08:00
arc ARC: [hsdk]: Enable FPU_SAVE_RESTORE 2021-01-08 13:46:58 -08:00
arm xen: branch for v5.11-rc4 2021-01-15 10:52:00 -08:00
arm64 KVM/arm64 updates for Linux 5.12 2021-02-12 11:23:44 -05:00
c6x tif-task_work.arch-2020-12-14 2020-12-16 12:33:35 -08:00
csky local64.h: make <asm/local64.h> mandatory 2020-12-29 15:36:49 -08:00
h8300 local64.h: make <asm/local64.h> mandatory 2020-12-29 15:36:49 -08:00
hexagon local64.h: make <asm/local64.h> mandatory 2020-12-29 15:36:49 -08:00
ia64 local64.h: make <asm/local64.h> mandatory 2020-12-29 15:36:49 -08:00
m68k local64.h: make <asm/local64.h> mandatory 2020-12-29 15:36:49 -08:00
microblaze local64.h: make <asm/local64.h> mandatory 2020-12-29 15:36:49 -08:00
mips KVM/arm64 updates for Linux 5.12 2021-02-12 11:23:44 -05:00
nds32 local64.h: make <asm/local64.h> mandatory 2020-12-29 15:36:49 -08:00
nios2 tif-task_work.arch-2020-12-14 2020-12-16 12:33:35 -08:00
openrisc local64.h: make <asm/local64.h> mandatory 2020-12-29 15:36:49 -08:00
parisc local64.h: make <asm/local64.h> mandatory 2020-12-29 15:36:49 -08:00
powerpc KVM: x86/mmu: Consider the hva in mmu_notifier retry 2021-02-22 13:16:53 -05:00
riscv RISC-V: Fix maximum allowed phsyical memory for RV32 2021-01-15 21:35:48 -08:00
s390 KVM: Raise the maximum number of user memslots 2021-02-09 08:17:08 -05:00
sh local64.h: make <asm/local64.h> mandatory 2020-12-29 15:36:49 -08:00
sparc locking/arch: Move qrwlock.h include after qspinlock.h 2021-02-11 07:59:54 -05:00
um This pull request contains the following changes for UML: 2020-12-17 17:56:44 -08:00
x86 KVM: x86/xen: Add support for vCPU runstate information 2021-03-02 14:30:54 -05:00
xtensa locking/arch: Move qrwlock.h include after qspinlock.h 2021-02-11 07:59:54 -05:00
.gitignore
Kconfig fanotify: Fix sys_fanotify_mark() on native x86-32 2020-12-28 11:58:59 +01:00