kvm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Hikaru Nishida <hikalium@chromium.org>
To: kvm@vger.kernel.org
Cc: suleiman@google.com, Hikaru Nishida <hikalium@chromium.org>,
	Borislav Petkov <bp@alien8.de>, "H. Peter Anvin" <hpa@zytor.com>,
	Ingo Molnar <mingo@redhat.com>, Jim Mattson <jmattson@google.com>,
	Joerg Roedel <joro@8bytes.org>,
	John Stultz <john.stultz@linaro.org>,
	Paolo Bonzini <pbonzini@redhat.com>,
	Sean Christopherson <seanjc@google.com>,
	Stephen Boyd <sboyd@kernel.org>,
	Thomas Gleixner <tglx@linutronix.de>,
	Vitaly Kuznetsov <vkuznets@redhat.com>,
	Wanpeng Li <wanpengli@tencent.com>,
	linux-kernel@vger.kernel.org, x86@kernel.org
Subject: [RFC PATCH 2/6] x86/kvm: Add a struct and constants for virtual suspend time injection
Date: Mon, 26 Apr 2021 18:06:41 +0900	[thread overview]
Message-ID: <20210426090644.2218834-3-hikalium@chromium.org> (raw)
In-Reply-To: <20210426090644.2218834-1-hikalium@chromium.org>

This patch adds definitions that are needed by both host and guest
to implement virtual suspend time injection.
This patch also adds #include <linux/kvm_host.h> in
kernel/time/timekeeping.c to make necesarily functions which will be
introduced in later patches available.

Signed-off-by: Hikaru Nishida <hikalium@chromium.org>
---

 arch/x86/include/uapi/asm/kvm_para.h | 6 ++++++
 kernel/time/timekeeping.c            | 1 +
 2 files changed, 7 insertions(+)

diff --git a/arch/x86/include/uapi/asm/kvm_para.h b/arch/x86/include/uapi/asm/kvm_para.h
index 950afebfba88..13788b01094f 100644
--- a/arch/x86/include/uapi/asm/kvm_para.h
+++ b/arch/x86/include/uapi/asm/kvm_para.h
@@ -33,6 +33,7 @@
 #define KVM_FEATURE_PV_SCHED_YIELD	13
 #define KVM_FEATURE_ASYNC_PF_INT	14
 #define KVM_FEATURE_MSI_EXT_DEST_ID	15
+#define KVM_FEATURE_HOST_SUSPEND_TIME	16
 
 #define KVM_HINTS_REALTIME      0
 
@@ -54,6 +55,7 @@
 #define MSR_KVM_POLL_CONTROL	0x4b564d05
 #define MSR_KVM_ASYNC_PF_INT	0x4b564d06
 #define MSR_KVM_ASYNC_PF_ACK	0x4b564d07
+#define MSR_KVM_HOST_SUSPEND_TIME      0x4b564d08
 
 struct kvm_steal_time {
 	__u64 steal;
@@ -64,6 +66,10 @@ struct kvm_steal_time {
 	__u32 pad[11];
 };
 
+struct kvm_host_suspend_time {
+	__u64   suspend_time_ns;
+};
+
 #define KVM_VCPU_PREEMPTED          (1 << 0)
 #define KVM_VCPU_FLUSH_TLB          (1 << 1)
 
diff --git a/kernel/time/timekeeping.c b/kernel/time/timekeeping.c
index 6aee5768c86f..ff0304de7de9 100644
--- a/kernel/time/timekeeping.c
+++ b/kernel/time/timekeeping.c
@@ -22,6 +22,7 @@
 #include <linux/pvclock_gtod.h>
 #include <linux/compiler.h>
 #include <linux/audit.h>
+#include <linux/kvm_host.h>
 
 #include "tick-internal.h"
 #include "ntp_internal.h"
-- 
2.31.1.498.g6c1eba8ee3d-goog


  parent reply	other threads:[~2021-04-26  9:10 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-26  9:06 [RFC PATCH 0/6] x86/kvm: Virtual suspend time injection support Hikaru Nishida
2021-04-26  9:06 ` [RFC PATCH 1/6] x86/kvm: Reserve KVM_FEATURE_HOST_SUSPEND_TIME and MSR_KVM_HOST_SUSPEND_TIME Hikaru Nishida
2021-04-27 15:12   ` David Edmondson
2021-04-26  9:06 ` Hikaru Nishida [this message]
2021-04-27 15:14   ` [RFC PATCH 2/6] x86/kvm: Add a struct and constants for virtual suspend time injection David Edmondson
2021-04-26  9:06 ` [RFC PATCH 3/6] x86/kvm: Add CONFIG_KVM_VIRT_SUSPEND_TIMING Hikaru Nishida
2021-04-26  9:06 ` [RFC PATCH 4/6] x86/kvm: Add a host side support for virtual suspend time injection Hikaru Nishida
2021-04-27 15:20   ` David Edmondson
2021-04-26  9:06 ` [RFC PATCH 5/6] x86/kvm: Add CONFIG_KVM_VIRT_SUSPEND_TIMING_GUEST Hikaru Nishida
2021-04-26  9:06 ` [RFC PATCH 6/6] x86/kvm: Add a guest side support for virtual suspend time injection Hikaru Nishida
2021-04-26 14:21   ` Thomas Gleixner
2021-04-26 13:15 ` [RFC PATCH 0/6] x86/kvm: Virtual suspend time injection support Maxim Levitsky

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210426090644.2218834-3-hikalium@chromium.org \
    --to=hikalium@chromium.org \
    --cc=bp@alien8.de \
    --cc=hpa@zytor.com \
    --cc=jmattson@google.com \
    --cc=john.stultz@linaro.org \
    --cc=joro@8bytes.org \
    --cc=kvm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=sboyd@kernel.org \
    --cc=seanjc@google.com \
    --cc=suleiman@google.com \
    --cc=tglx@linutronix.de \
    --cc=vkuznets@redhat.com \
    --cc=wanpengli@tencent.com \
    --cc=x86@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).