lkml.org 
[lkml]   [2017]   [Dec]   [13]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH v8 1/4] KVM: X86: Add vCPU running/preempted state
From
Date
On 13.12.2017 02:33, Wanpeng Li wrote:
> From: Wanpeng Li <wanpeng.li@hotmail.com>
>
> This patch reuses the preempted field in kvm_steal_time, and will export
> the vcpu running/pre-empted information to the guest from host. This will
> enable guest to intelligently send ipi to running vcpus and set flag for
> pre-empted vcpus. This will prevent waiting for vcpus that are not running.
>
> Cc: Paolo Bonzini <pbonzini@redhat.com>
> Cc: Radim Krčmář <rkrcmar@redhat.com>
> Cc: Peter Zijlstra <peterz@infradead.org>
> Signed-off-by: Wanpeng Li <wanpeng.li@hotmail.com>
> ---
> arch/x86/include/uapi/asm/kvm_para.h | 3 +++
> arch/x86/kernel/kvm.c | 2 +-
> arch/x86/kvm/x86.c | 4 ++--
> 3 files changed, 6 insertions(+), 3 deletions(-)
>
> diff --git a/arch/x86/include/uapi/asm/kvm_para.h b/arch/x86/include/uapi/asm/kvm_para.h
> index 09cc064..763b692 100644
> --- a/arch/x86/include/uapi/asm/kvm_para.h
> +++ b/arch/x86/include/uapi/asm/kvm_para.h
> @@ -51,6 +51,9 @@ struct kvm_steal_time {
> __u32 pad[11];
> };
>
> +#define KVM_VCPU_NOT_PREEMPTED (0 << 0)
> +#define KVM_VCPU_PREEMPTED (1 << 0)

Is it really helpful to have two flags?

Just use KVM_VCPU_PREEMPTED and clear that one in record_steal_time()


--

Thanks,

David / dhildenb

\
 
 \ /
  Last update: 2017-12-13 11:20    [W:0.096 / U:0.144 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site