]> www.infradead.org Git - nvme.git/commit
LoongArch: KVM: Add PV steal time support in guest side
authorBibo Mao <maobibo@loongson.cn>
Tue, 9 Jul 2024 08:25:51 +0000 (16:25 +0800)
committerHuacai Chen <chenhuacai@loongson.cn>
Tue, 9 Jul 2024 08:25:51 +0000 (16:25 +0800)
commit03779999ac3053122c33173a652100c8fa6c61c5
tree0da3fff59c30171c9d34464712bd4fae65e943e7
parentb4ba157044ea433a66126603ad7140e12dbc794b
LoongArch: KVM: Add PV steal time support in guest side

Per-cpu struct kvm_steal_time is added here, its size is 64 bytes and
also defined as 64 bytes, so that the whole structure is in one physical
page.

When a VCPU is online, function pv_enable_steal_time() is called. This
function will pass guest physical address of struct kvm_steal_time and
tells hypervisor to enable steal time. When a vcpu is offline, physical
address is set as 0 and tells hypervisor to disable steal time.

Here is an output of vmstat on guest when there is workload on both host
and guest. It shows steal time stat information.

procs -----------memory---------- -----io---- -system-- ------cpu-----
 r  b   swpd   free  inact active   bi    bo   in   cs us sy id wa st
15  1      0 7583616 184112  72208    20    0  162   52 31  6 43  0 20
17  0      0 7583616 184704  72192    0     0 6318 6885  5 60  8  5 22
16  0      0 7583616 185392  72144    0     0 1766 1081  0 49  0  1 50
16  0      0 7583616 184816  72304    0     0 6300 6166  4 62 12  2 20
18  0      0 7583632 184480  72240    0     0 2814 1754  2 58  4  1 35

Signed-off-by: Bibo Mao <maobibo@loongson.cn>
Signed-off-by: Huacai Chen <chenhuacai@loongson.cn>
Documentation/admin-guide/kernel-parameters.txt
arch/loongarch/Kconfig
arch/loongarch/include/asm/paravirt.h
arch/loongarch/kernel/paravirt.c
arch/loongarch/kernel/time.c