[<prev] [next>] [day] [month] [year] [list]
Message-ID: <DM6PR03MB4140D3396261607B81C45971CD30A@DM6PR03MB4140.namprd03.prod.outlook.com>
Date: Mon, 10 Jul 2023 14:03:24 +0800
From: Wang Jianchao <jianchwa@...look.com>
To: seanjc@...gle.com, tglx@...utronix.de, mingo@...hat.com,
bp@...en8.de, dave.hansen@...ux.intel.com, x86@...nel.org,
hpa@...or.com, kvm@...r.kernel.org
Cc: arkinjob@...look.com, linux-kernel@...r.kernel.org
Subject: [RFC PATCH V2 1/4] KVM: x86: add msr register and data structure for lazy tscdeadline
Lazy tscdeadline is a new paravirtulization feature which target
is to reduce vm-exit caused by msr-write to MSR_IA32_TSC_DEADLINE.
This patch adds things below:
- a new msr register to communicate between guest and host
- a new feature flag to tell guest open this feature
- a new data structure to exchange data between guest and host
There is no functional changes in this patch.
Signed-off-by: Li Shujin <arkinjob@...look.com>
Signed-off-by: Wang Jianchao <jianchwa@...look.com>
---
arch/x86/include/uapi/asm/kvm_para.h | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/arch/x86/include/uapi/asm/kvm_para.h b/arch/x86/include/uapi/asm/kvm_para.h
index 6e64b27b..86ba601 100644
--- a/arch/x86/include/uapi/asm/kvm_para.h
+++ b/arch/x86/include/uapi/asm/kvm_para.h
@@ -36,6 +36,7 @@
#define KVM_FEATURE_MSI_EXT_DEST_ID 15
#define KVM_FEATURE_HC_MAP_GPA_RANGE 16
#define KVM_FEATURE_MIGRATION_CONTROL 17
+#define KVM_FEATURE_LAZY_TSCDEADLINE 18
#define KVM_HINTS_REALTIME 0
@@ -58,6 +59,7 @@
#define MSR_KVM_ASYNC_PF_INT 0x4b564d06
#define MSR_KVM_ASYNC_PF_ACK 0x4b564d07
#define MSR_KVM_MIGRATION_CONTROL 0x4b564d08
+#define MSR_KVM_LAZY_TSCDEADLINE 0x4b564d09
struct kvm_steal_time {
__u64 steal;
@@ -84,6 +86,13 @@ struct kvm_clock_pairing {
#define KVM_STEAL_VALID_BITS ((-1ULL << (KVM_STEAL_ALIGNMENT_BITS + 1)))
#define KVM_STEAL_RESERVED_MASK (((1 << KVM_STEAL_ALIGNMENT_BITS) - 1 ) << 1)
+struct kvm_lazy_tscdeadline {
+ __u64 armed;
+ __u64 pending;
+ __u32 flags;
+ __u32 pad[11];
+};
+
#define KVM_MAX_MMU_OP_BATCH 32
#define KVM_ASYNC_PF_ENABLED (1 << 0)
--
2.7.4
Powered by blists - more mailing lists