From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752370AbcF1R3A (ORCPT ); Tue, 28 Jun 2016 13:29:00 -0400 Received: from smtp.citrix.com ([66.165.176.89]:53555 "EHLO SMTP.CITRIX.COM" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751068AbcF1R26 (ORCPT ); Tue, 28 Jun 2016 13:28:58 -0400 X-IronPort-AV: E=Sophos;i="5.26,542,1459814400"; d="scan'208";a="363280983" Subject: Re: [Xen-devel] [PATCH linux 2/8] xen: introduce xen_vcpu_id mapping To: Vitaly Kuznetsov , References: <1467132449-1030-1-git-send-email-vkuznets@redhat.com> <1467132449-1030-3-git-send-email-vkuznets@redhat.com> CC: Juergen Gross , Stefano Stabellini , , , Julien Grall , Ingo Molnar , "David Vrabel" , "H. Peter Anvin" , "Boris Ostrovsky" , Thomas Gleixner From: Andrew Cooper Message-ID: Date: Tue, 28 Jun 2016 18:28:31 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Icedove/45.1.0 MIME-Version: 1.0 In-Reply-To: <1467132449-1030-3-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: > @@ -1808,6 +1822,8 @@ static int xen_hvm_cpu_notify(struct notifier_block *self, unsigned long action, > int cpu = (long)hcpu; > switch (action) { > case CPU_UP_PREPARE: > + /* vLAPIC_ID == Xen's vCPU_ID * 2 for HVM guests */ > + per_cpu(xen_vcpu_id, cpu) = cpu_physical_id(cpu) / 2; Please do not assume or propagate this brokenness. It is incorrect in the general case, and I will be fixing in the hypervisor in due course. Always read the APIC_ID from the LAPIC, per regular hardware. ~Andrew