From patchwork Tue Jun 28 16:47:26 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vitaly Kuznetsov X-Patchwork-Id: 9203621 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 61F036075F for ; Tue, 28 Jun 2016 16:49:34 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 539F1285FD for ; Tue, 28 Jun 2016 16:49:34 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 48A7C2860E; Tue, 28 Jun 2016 16:49:34 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.2 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id F2906285FD for ; Tue, 28 Jun 2016 16:49:33 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bHwAw-0003ie-VD; Tue, 28 Jun 2016 16:47:50 +0000 Received: from mail6.bemta6.messagelabs.com ([85.158.143.247]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bHwAv-0003hr-T8 for xen-devel@lists.xenproject.org; Tue, 28 Jun 2016 16:47:49 +0000 Received: from [85.158.143.35] by server-3.bemta-6.messagelabs.com id 6E/AB-22092-53AA2775; Tue, 28 Jun 2016 16:47:49 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFnrMLMWRWlGSWpSXmKPExsVysWW7jK7JqqJ wg6m7jCy+b5nM5MDocfjDFZYAxijWzLyk/IoE1owJV7ewFJwVqJg7/Rt7A+MN3i5GLg4hgV1M Ens3f2XpYuQEco4wSjR3+4PYbAI6Et+fnmIGsUUElCTurZrMBNLALDCFWeLzxu2sIAlhAV+JJ QenM4HYLAKqEv+bP7GB2LwCThJTbjWBNXMKOEt8bt/GDrHASeLEinlgNRIC2hLPL0xmBxkqId DHKHFwZSvTBEaeBYwMqxjVi1OLylKLdI30kooy0zNKchMzc3QNDcz0clOLixPTU3MSk4r1kvN zNzECPc8ABDsYl/11OsQoycGkJMr7rbcoXIgvKT+lMiOxOCO+qDQntfgQowwHh5IEr/RKoJxg UWp6akVaZg4wBGHSEhw8SiK8z1YApXmLCxJzizPTIVKnGBWlxHnPgyQEQBIZpXlwbbCwv8QoK yXMywh0iBBPQWpRbmYJqvwrRnEORiVh3gcgU3gy80rgpr8CWswEtJi1Oh9kcUkiQkqqgTF5i5 zbyQx2sdB27fnGDvorXjK9nJ8ll3dU232B5WQfQ5P/vepazNHna1MLBJV6hIUfhgebmu8+nJ5 x/97GyP8bvKrElvJ5PTjhPKWIq2x7pPdhdYmv20MZaqTmNuueNxact/bN+6yZblJJOX29Jeqz 3i4oq+4/qPx1zxNBJ6PmZsdnnvNklFiKMxINtZiLihMBu3a/k3YCAAA= X-Env-Sender: vkuznets@redhat.com X-Msg-Ref: server-2.tower-21.messagelabs.com!1467132467!7409626!1 X-Originating-IP: [209.132.183.28] X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: VHJ1c3RlZCBJUDogMjA5LjEzMi4xODMuMjggPT4gNTQwNjQ=\n X-StarScan-Received: X-StarScan-Version: 8.46; banners=-,-,- X-VirusChecked: Checked Received: (qmail 55326 invoked from network); 28 Jun 2016 16:47:48 -0000 Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by server-2.tower-21.messagelabs.com with DHE-RSA-AES256-GCM-SHA384 encrypted SMTP; 28 Jun 2016 16:47:48 -0000 Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id AD23BA70C; Tue, 28 Jun 2016 16:47:45 +0000 (UTC) Received: from vitty.brq.redhat.com (vitty.brq.redhat.com [10.34.26.3]) by int-mx11.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u5SGlUIA004662; Tue, 28 Jun 2016 12:47:43 -0400 From: Vitaly Kuznetsov To: xen-devel@lists.xenproject.org Date: Tue, 28 Jun 2016 18:47:26 +0200 Message-Id: <1467132449-1030-6-git-send-email-vkuznets@redhat.com> In-Reply-To: <1467132449-1030-1-git-send-email-vkuznets@redhat.com> References: <1467132449-1030-1-git-send-email-vkuznets@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.24 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.29]); Tue, 28 Jun 2016 16:47:46 +0000 (UTC) Cc: Juergen Gross , Stefano Stabellini , x86@kernel.org, linux-kernel@vger.kernel.org, Julien Grall , Ingo Molnar , David Vrabel , "H. Peter Anvin" , Boris Ostrovsky , Thomas Gleixner Subject: [Xen-devel] [PATCH linux 5/8] xen/events: use xen_vcpu_id mapping in events_base X-BeenThere: xen-devel@lists.xen.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: xen-devel-bounces@lists.xen.org Sender: "Xen-devel" X-Virus-Scanned: ClamAV using ClamSMTP EVTCHNOP_bind_ipi and EVTCHNOP_bind_virq pass vCPU id as a parameter and Xen's idea of vCPU id should be used. Use the newly introduced xen_vcpu_id mapping to convert it from Linux's id. Signed-off-by: Vitaly Kuznetsov --- drivers/xen/events/events_base.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/drivers/xen/events/events_base.c b/drivers/xen/events/events_base.c index 71d49a9..73b8b65 100644 --- a/drivers/xen/events/events_base.c +++ b/drivers/xen/events/events_base.c @@ -895,7 +895,7 @@ static int bind_ipi_to_irq(unsigned int ipi, unsigned int cpu) irq_set_chip_and_handler_name(irq, &xen_percpu_chip, handle_percpu_irq, "ipi"); - bind_ipi.vcpu = cpu; + bind_ipi.vcpu = per_cpu(xen_vcpu_id, cpu); if (HYPERVISOR_event_channel_op(EVTCHNOP_bind_ipi, &bind_ipi) != 0) BUG(); @@ -991,7 +991,7 @@ int bind_virq_to_irq(unsigned int virq, unsigned int cpu, bool percpu) handle_edge_irq, "virq"); bind_virq.virq = virq; - bind_virq.vcpu = cpu; + bind_virq.vcpu = per_cpu(xen_vcpu_id, cpu); ret = HYPERVISOR_event_channel_op(EVTCHNOP_bind_virq, &bind_virq); if (ret == 0) @@ -1318,7 +1318,7 @@ static int rebind_irq_to_cpu(unsigned irq, unsigned tcpu) /* Send future instances of this interrupt to other vcpu. */ bind_vcpu.port = evtchn; - bind_vcpu.vcpu = tcpu; + bind_vcpu.vcpu = per_cpu(xen_vcpu_id, tcpu); /* * Mask the event while changing the VCPU binding to prevent @@ -1458,7 +1458,7 @@ static void restore_cpu_virqs(unsigned int cpu) /* Get a new binding from Xen. */ bind_virq.virq = virq; - bind_virq.vcpu = cpu; + bind_virq.vcpu = per_cpu(xen_vcpu_id, cpu); if (HYPERVISOR_event_channel_op(EVTCHNOP_bind_virq, &bind_virq) != 0) BUG(); @@ -1482,7 +1482,7 @@ static void restore_cpu_ipis(unsigned int cpu) BUG_ON(ipi_from_irq(irq) != ipi); /* Get a new binding from Xen. */ - bind_ipi.vcpu = cpu; + bind_ipi.vcpu = per_cpu(xen_vcpu_id, cpu); if (HYPERVISOR_event_channel_op(EVTCHNOP_bind_ipi, &bind_ipi) != 0) BUG();