From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752482AbcF2Mcd (ORCPT ); Wed, 29 Jun 2016 08:32:33 -0400 Received: from smtp02.citrix.com ([66.165.176.63]:36037 "EHLO SMTP02.CITRIX.COM" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751978AbcF2Mcc (ORCPT ); Wed, 29 Jun 2016 08:32:32 -0400 X-IronPort-AV: E=Sophos;i="5.26,546,1459814400"; d="scan'208";a="370343973" Subject: Re: [Xen-devel] [PATCH linux 4/8] x86/xen: use xen_vcpu_id mapping when pointing vcpu_info to the shared_info page To: Vitaly Kuznetsov , References: <1467132449-1030-1-git-send-email-vkuznets@redhat.com> <1467132449-1030-5-git-send-email-vkuznets@redhat.com> CC: Juergen Gross , Stefano Stabellini , , , Ingo Molnar , David Vrabel , "H. Peter Anvin" , Boris Ostrovsky , Thomas Gleixner From: David Vrabel Message-ID: <5773BFDA.1090706@citrix.com> Date: Wed, 29 Jun 2016 13:32:26 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Icedove/38.5.0 MIME-Version: 1.0 In-Reply-To: <1467132449-1030-5-git-send-email-vkuznets@redhat.com> Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit X-DLP: MIA2 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 28/06/16 17:47, Vitaly Kuznetsov wrote: > shared_info page has space for 32 vcpu info slots for first 32 vCPUs but > these are the first 32 vCPUs from Xen's perspective and we should map them > accordingly with the newly introduced xen_vcpu_id mapping. > > Signed-off-by: Vitaly Kuznetsov > --- > arch/x86/xen/enlighten.c | 15 ++++++++++----- > 1 file changed, 10 insertions(+), 5 deletions(-) > > diff --git a/arch/x86/xen/enlighten.c b/arch/x86/xen/enlighten.c > index 69f4c0c..1596626 100644 > --- a/arch/x86/xen/enlighten.c > +++ b/arch/x86/xen/enlighten.c > @@ -189,6 +189,7 @@ static void xen_vcpu_setup(int cpu) > struct vcpu_register_vcpu_info info; > int err; > struct vcpu_info *vcpup; > + int xen_cpu = per_cpu(xen_vcpu_id, cpu); I think there should be a static inline int xen_vcpu_nr(int cpu) { return per_cpu(xen_vcpu_id, cpu); } helper function. David