diff options
author | Zhang, Yanmin <yanmin_zhang@linux.intel.com> | 2010-04-19 22:13:58 -0400 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2010-04-20 02:08:28 -0400 |
commit | dcf46b9443ad48a227a61713adea001228925adf (patch) | |
tree | 1055614c98e8f6584e40fc4ca73ad611b5a77530 /arch/x86/kvm/x86.c | |
parent | a1645ce12adb6c9cc9e19d7695466204e3f017fe (diff) |
perf & kvm: Clean up some of the guest profiling callback API details
Fix some build bug and programming style issues:
- use valid C
- fix up various style details
Signed-off-by: Zhang Yanmin <yanmin_zhang@linux.intel.com>
Cc: Avi Kivity <avi@redhat.com>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Sheng Yang <sheng@linux.intel.com>
Cc: Marcelo Tosatti <mtosatti@redhat.com>
Cc: oerg Roedel <joro@8bytes.org>
Cc: Jes Sorensen <Jes.Sorensen@redhat.com>
Cc: Gleb Natapov <gleb@redhat.com>
Cc: Zachary Amsden <zamsden@redhat.com>
Cc: zhiteng.huang@intel.com
Cc: tim.c.chen@intel.com
Cc: Arnaldo Carvalho de Melo <acme@infradead.org>
LKML-Reference: <1271729638.2078.624.camel@ymzhang.sh.intel.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'arch/x86/kvm/x86.c')
-rw-r--r-- | arch/x86/kvm/x86.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c index c3a33b2bb169..21b9b6aa3e88 100644 --- a/arch/x86/kvm/x86.c +++ b/arch/x86/kvm/x86.c | |||
@@ -3776,16 +3776,20 @@ static int kvm_is_in_guest(void) | |||
3776 | static int kvm_is_user_mode(void) | 3776 | static int kvm_is_user_mode(void) |
3777 | { | 3777 | { |
3778 | int user_mode = 3; | 3778 | int user_mode = 3; |
3779 | |||
3779 | if (percpu_read(current_vcpu)) | 3780 | if (percpu_read(current_vcpu)) |
3780 | user_mode = kvm_x86_ops->get_cpl(percpu_read(current_vcpu)); | 3781 | user_mode = kvm_x86_ops->get_cpl(percpu_read(current_vcpu)); |
3782 | |||
3781 | return user_mode != 0; | 3783 | return user_mode != 0; |
3782 | } | 3784 | } |
3783 | 3785 | ||
3784 | static unsigned long kvm_get_guest_ip(void) | 3786 | static unsigned long kvm_get_guest_ip(void) |
3785 | { | 3787 | { |
3786 | unsigned long ip = 0; | 3788 | unsigned long ip = 0; |
3789 | |||
3787 | if (percpu_read(current_vcpu)) | 3790 | if (percpu_read(current_vcpu)) |
3788 | ip = kvm_rip_read(percpu_read(current_vcpu)); | 3791 | ip = kvm_rip_read(percpu_read(current_vcpu)); |
3792 | |||
3789 | return ip; | 3793 | return ip; |
3790 | } | 3794 | } |
3791 | 3795 | ||