From: "Nikunj A. Dadhania" <nikunj@linux.vnet.ibm.com>
To: mtosatti@redhat.com, avi@redhat.com
Cc: raghukt@linux.vnet.ibm.com, alex.shi@intel.com,
kvm@vger.kernel.org, stefano.stabellini@eu.citrix.com,
peterz@infradead.org, hpa@zytor.com, vsrivatsa@gmail.com,
mingo@elte.hu
Subject: [PATCH v4 8/8] KVM-doc: Add paravirt tlb flush document
Date: Tue, 21 Aug 2012 16:58:11 +0530 [thread overview]
Message-ID: <20120821112804.3512.7480.stgit@abhimanyu> (raw)
In-Reply-To: <20120821112346.3512.99814.stgit@abhimanyu.in.ibm.com>
Signed-off-by: Nikunj A. Dadhania <nikunj@linux.vnet.ibm.com>
---
Documentation/virtual/kvm/msr.txt | 4 ++
Documentation/virtual/kvm/paravirt-tlb-flush.txt | 53 ++++++++++++++++++++++
2 files changed, 57 insertions(+), 0 deletions(-)
create mode 100644 Documentation/virtual/kvm/paravirt-tlb-flush.txt
diff --git a/Documentation/virtual/kvm/msr.txt b/Documentation/virtual/kvm/msr.txt
index 7304710..92a6af6 100644
--- a/Documentation/virtual/kvm/msr.txt
+++ b/Documentation/virtual/kvm/msr.txt
@@ -256,3 +256,7 @@ MSR_KVM_EOI_EN: 0x4b564d04
guest must both read the least significant bit in the memory area and
clear it using a single CPU instruction, such as test and clear, or
compare and exchange.
+
+MSR_KVM_VCPU_STATE: 0x4b564d05
+
+Refer: Documentation/virtual/kvm/paravirt-tlb-flush.txt
diff --git a/Documentation/virtual/kvm/paravirt-tlb-flush.txt b/Documentation/virtual/kvm/paravirt-tlb-flush.txt
new file mode 100644
index 0000000..0eaabd7
--- /dev/null
+++ b/Documentation/virtual/kvm/paravirt-tlb-flush.txt
@@ -0,0 +1,53 @@
+KVM - Paravirt TLB Flush
+Nikunj A Dadhania <nikunj@linux.vnet.ibm.com>, IBM, 2012
+========================================================
+
+Remote flushing api's does a busy wait which is fine in bare-metal
+scenario. But with-in the guest, the vcpus might have been pre-empted
+or blocked. In this scenario, the initator vcpu would end up
+busy-waiting for a long amount of time.
+
+This would require to have information of guest running/not-running
+within the guest to take a decision. The following MSR introduces vcpu
+running state information.
+
+Using this MSR we have implemented para-virt flush tlbs making sure
+that it does not wait for vcpus that are not-running. And TLB flushing
+for them is deferred, which is done on guest enter.
+
+MSR_KVM_VCPU_STATE: 0x4b564d04
+
+ data: 64-byte alignment physical address of a memory area which must be
+ in guest RAM, plus an enable bit in bit 0. This memory is expected to
+ hold a copy of the following structure:
+
+ struct kvm_steal_time {
+ __u64 state;
+ __u32 pad[14];
+ }
+
+ whose data will be filled in by the hypervisor/guest. Only one
+ write, or registration, is needed for each VCPU. The interval
+ between updates of this structure is arbitrary and
+ implementation-dependent. The hypervisor may update this
+ structure at any time it sees fit until anything with bit0 ==
+ 0 is written to it. Guest is required to make sure this
+ structure is initialized to zero.
+
+ This would enable a VCPU to know running status of sibling
+ VCPUs. The information can further be used to determine if an
+ IPI needs to be send to the non-running VCPU and wait for them
+ unnecessarily. For e.g. flush_tlb_others_ipi.
+
+ Fields have the following meanings:
+
+ state: has bit following fields:
+
+ Bit 0 - vcpu running state. Hypervisor would set vcpu
+ running/not running. Value 1 meaning the vcpu
+ is running and value 0 means vcpu is
+ pre-empted out.
+
+ Bit 1 - hypervisor should flush tlb is set during
+ guest enter/exit
+
next prev parent reply other threads:[~2012-08-21 11:28 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-08-21 11:25 [PATCH v4 0/8] KVM paravirt remote flush tlb Nikunj A. Dadhania
2012-08-21 11:26 ` [PATCH v4 1/8] mm, x86: Add HAVE_RCU_TABLE_FREE support Nikunj A. Dadhania
2012-08-21 11:26 ` [PATCH v4 2/8] mm: Add missing TLB invalidate to RCU page-table freeing Nikunj A. Dadhania
2012-08-21 11:26 ` [PATCH v4 3/8] KVM Guest: Add VCPU running/pre-empted state for guest Nikunj A. Dadhania
2012-08-23 9:36 ` Marcelo Tosatti
2012-08-24 5:39 ` Nikunj A Dadhania
2012-08-24 15:02 ` Marcelo Tosatti
2012-08-27 4:24 ` Nikunj A Dadhania
2012-08-21 11:26 ` [PATCH v4 4/8] KVM-HV: " Nikunj A. Dadhania
2012-08-23 11:46 ` Marcelo Tosatti
2012-08-24 5:19 ` Nikunj A Dadhania
2012-08-24 15:02 ` Marcelo Tosatti
2012-08-21 11:27 ` [PATCH v4 5/8] KVM Guest: Add paravirt kvm_flush_tlb_others Nikunj A. Dadhania
2012-08-21 11:27 ` [PATCH v4 6/8] KVM-HV: Add flush_on_enter before guest enter Nikunj A. Dadhania
2012-08-21 11:27 ` [PATCH v4 7/8] Enable HAVE_RCU_TABLE_FREE for kvm when PARAVIRT_TLB_FLUSH is enabled Nikunj A. Dadhania
2012-08-21 11:28 ` Nikunj A. Dadhania [this message]
2012-08-23 11:48 ` [PATCH v4 0/8] KVM paravirt remote flush tlb Marcelo Tosatti
2012-09-03 14:33 ` Avi Kivity
2012-09-03 15:27 ` Avi Kivity
2012-09-04 1:30 ` Nikunj A Dadhania
2012-09-04 7:51 ` Avi Kivity
2012-09-04 8:08 ` Nikunj A Dadhania
2012-09-04 10:37 ` Avi Kivity
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=20120821112804.3512.7480.stgit@abhimanyu \
--to=nikunj@linux.vnet.ibm.com \
--cc=alex.shi@intel.com \
--cc=avi@redhat.com \
--cc=hpa@zytor.com \
--cc=kvm@vger.kernel.org \
--cc=mingo@elte.hu \
--cc=mtosatti@redhat.com \
--cc=peterz@infradead.org \
--cc=raghukt@linux.vnet.ibm.com \
--cc=stefano.stabellini@eu.citrix.com \
--cc=vsrivatsa@gmail.com \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.