From mboxrd@z Thu Jan 1 00:00:00 1970 From: Radim =?utf-8?B?S3LEjW3DocWZ?= Subject: Re: [PATCH] x86:kvm:hyperv: make VP_INDEX managed by userspace Date: Fri, 16 Jun 2017 18:03:27 +0200 Message-ID: <20170616160326.GB5980@potion> References: <20170616151621.21590-1-rkagan@virtuozzo.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: kvm@vger.kernel.org, Paolo Bonzini , Evgeny Yakovlev , "Denis V . Lunev" , Eduardo Habkost , Igor Mammedov To: Roman Kagan Return-path: Received: from mx1.redhat.com ([209.132.183.28]:39536 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750798AbdFPQDb (ORCPT ); Fri, 16 Jun 2017 12:03:31 -0400 Content-Disposition: inline In-Reply-To: <20170616151621.21590-1-rkagan@virtuozzo.com> Sender: kvm-owner@vger.kernel.org List-ID: 2017-06-16 18:16+0300, Roman Kagan: > Hyper-V identifies vCPUs by Virtual Processor Index, which can be > queried via HV_X64_MSR_VP_INDEX msr. It is defined by the spec as a > sequential number which can't exceed the maximum number of vCPUs per VM. > APIC ids can be sparse and thus aren't a valid replacement for VP > indices. > > Current KVM uses its internal vcpu index as VP_INDEX. However, to make > it predictable and persistent across VM migrations, the userspace has to > control the value of VP_INDEX. > > This patch achieves that, by storing vp_index explicitly on vcpu, and > allowing HV_X64_MSR_VP_INDEX to be set from the host side. For > compatibility it's initialized to KVM vcpu index. Also a few variables > are renamed to make clear distinction betweed this Hyper-V vp_index and > KVM vcpu_id (== APIC id). > > Signed-off-by: Roman Kagan > --- Please add a kvm capability, so userspace doesn't trigger the unhandled wrmsr messages when detecting this feature. Thanks.