diff mbox

[v3,2/9] KVM-HDR Add constant to represent KVM MSRs enabled bit

Message ID 1309361388-30163-3-git-send-email-glommer@redhat.com (mailing list archive)
State New, archived
Headers show

Commit Message

Glauber Costa June 29, 2011, 3:29 p.m. UTC
This patch is simple, put in a different commit so it can be more easily
shared between guest and hypervisor. It just defines a named constant
to indicate the enable bit for KVM-specific MSRs.

Signed-off-by: Glauber Costa <glommer@redhat.com>
CC: Rik van Riel <riel@redhat.com>
CC: Jeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com>
CC: Peter Zijlstra <peterz@infradead.org>
CC: Avi Kivity <avi@redhat.com>
CC: Anthony Liguori <aliguori@us.ibm.com>
CC: Eric B Munson <emunson@mgebm.net>
---
 arch/x86/include/asm/kvm_para.h |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

Comments

Eric B Munson June 29, 2011, 9:56 p.m. UTC | #1
On Wed, 29 Jun 2011, Glauber Costa wrote:

> This patch is simple, put in a different commit so it can be more easily
> shared between guest and hypervisor. It just defines a named constant
> to indicate the enable bit for KVM-specific MSRs.
> 
> Signed-off-by: Glauber Costa <glommer@redhat.com>
> CC: Rik van Riel <riel@redhat.com>
> CC: Jeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com>
> CC: Peter Zijlstra <peterz@infradead.org>
> CC: Avi Kivity <avi@redhat.com>
> CC: Anthony Liguori <aliguori@us.ibm.com>
> CC: Eric B Munson <emunson@mgebm.net>

My mail provider seems to have dropped patch 1 of the series so I can't reply
directly to it, please add my Tested-by there as well.

Tested-by: Eric B Munson <emunson@mgebm.net>
Avi Kivity June 30, 2011, 8:31 a.m. UTC | #2
On 06/30/2011 12:56 AM, Eric B Munson wrote:
> My mail provider seems to have dropped patch 1 of the series so I can't reply
> directly to it, please add my Tested-by there as well.

How did you test it then?
Eric B Munson June 30, 2011, 12:59 p.m. UTC | #3
On Thu, 30 Jun 2011, Avi Kivity wrote:

> On 06/30/2011 12:56 AM, Eric B Munson wrote:
> >My mail provider seems to have dropped patch 1 of the series so I can't reply
> >directly to it, please add my Tested-by there as well.
> 
> How did you test it then?
> 

I built host and guest kernels with the patches and pinned a while(1) and the
CPU thread from qemu to CPU 2 on the host.  I then started the same while(1)
process in guest and verified that I see ~50% steal time reported.

I then built 2.6.39 (just the code I had present) on the guest and time it
while it was competing with the while(1) on the host for CPU time.  Next I
built the guest kernel with STEAL_TIME=N and reran the kernel compile to make
sure that there weren't any huge variations in performace.

Eric
Eric B Munson June 30, 2011, 2:13 p.m. UTC | #4
On Thu, 30 Jun 2011, Glauber Costa wrote:

> On 06/30/2011 09:59 AM, Eric B Munson wrote:
> >On Thu, 30 Jun 2011, Avi Kivity wrote:
> >
> >>On 06/30/2011 12:56 AM, Eric B Munson wrote:
> >>>My mail provider seems to have dropped patch 1 of the series so I can't reply
> >>>directly to it, please add my Tested-by there as well.
> >>
> >>How did you test it then?
> >>
> >
> >I built host and guest kernels with the patches and pinned a while(1) and the
> >CPU thread from qemu to CPU 2 on the host.  I then started the same while(1)
> >process in guest and verified that I see ~50% steal time reported.
> >
> >I then built 2.6.39 (just the code I had present) on the guest and time it
> >while it was competing with the while(1) on the host for CPU time.  Next I
> >built the guest kernel with STEAL_TIME=N and reran the kernel compile to make
> >sure that there weren't any huge variations in performace.
> >
> >Eric
> I think what Avi means is, it won't even compile without PATCH 1/9.
> If you don't have it, how could you test it ?
> 

It made it to several lkml archives.
diff mbox

Patch

diff --git a/arch/x86/include/asm/kvm_para.h b/arch/x86/include/asm/kvm_para.h
index a427bf7..d6cd79b 100644
--- a/arch/x86/include/asm/kvm_para.h
+++ b/arch/x86/include/asm/kvm_para.h
@@ -30,6 +30,7 @@ 
 #define MSR_KVM_WALL_CLOCK  0x11
 #define MSR_KVM_SYSTEM_TIME 0x12
 
+#define KVM_MSR_ENABLED 1
 /* Custom MSRs falls in the range 0x4b564d00-0x4b564dff */
 #define MSR_KVM_WALL_CLOCK_NEW  0x4b564d00
 #define MSR_KVM_SYSTEM_TIME_NEW 0x4b564d01