From patchwork Tue Jun 7 16:48:37 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Julien Grall X-Patchwork-Id: 69559 Delivered-To: patch@linaro.org Received: by 10.140.106.246 with SMTP id e109csp2075554qgf; Tue, 7 Jun 2016 09:50:30 -0700 (PDT) X-Received: by 10.31.199.6 with SMTP id x6mr183336vkf.17.1465318218705; Tue, 07 Jun 2016 09:50:18 -0700 (PDT) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org. [192.237.175.120]) by mx.google.com with ESMTPS id u125si6886981vkf.183.2016.06.07.09.50.18 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 07 Jun 2016 09:50:18 -0700 (PDT) Received-SPF: neutral (google.com: 192.237.175.120 is neither permitted nor denied by best guess record for domain of xen-devel-bounces@lists.xen.org) client-ip=192.237.175.120; Authentication-Results: mx.google.com; spf=neutral (google.com: 192.237.175.120 is neither permitted nor denied by best guess record for domain of xen-devel-bounces@lists.xen.org) smtp.mailfrom=xen-devel-bounces@lists.xen.org Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bAKBV-0000IM-Uc; Tue, 07 Jun 2016 16:48:57 +0000 Received: from mail6.bemta5.messagelabs.com ([195.245.231.135]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bAKBV-0000Hk-5w for xen-devel@lists.xen.org; Tue, 07 Jun 2016 16:48:57 +0000 Received: from [85.158.139.211] by server-10.bemta-5.messagelabs.com id EF/FF-11369-8FAF6575; Tue, 07 Jun 2016 16:48:56 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFrrOLMWRWlGSWpSXmKPExsVysyfVTffHr7B wgwMtjBZLPi5mcWD0OLr7N1MAYxRrZl5SfkUCa8b1r42MBQf4Km4vu8TewHiSu4uRi0NIYAOj xK1//cwQzmlGic5Vp4EcTg42AU2JO58/MYHYIgLSEtc+X2YEKWIWmMcocWbhTnaQhLBAuMSL3 a9Zuhg5OFgEVCV+/Y4GCfMKOEv8WNTNCmJLCMhJnDw2GczmFHCRePn8JQuILQRU86BhF/MERu 4FjAyrGDWKU4vKUot0DY30kooy0zNKchMzc3QNDUz1clOLixPTU3MSk4r1kvNzNzECPcwABDs Y+2Y5H2KU5GBSEuV9+i0sXIgvKT+lMiOxOCO+qDQntfgQowwHh5IE76ufQDnBotT01Iq0zBxg qMGkJTh4lER4s94BpXmLCxJzizPTIVKnGBWlxHl1QBICIImM0jy4Nlh4X2KUlRLmZQQ6RIinI LUoN7MEVf4VozgHo5IwrwfIdp7MvBK46a+AFjMBLWb5Cra4JBEhJdXAaHyQs0L7QJP9nljWPN Mdyvz2O83EjT0PLG1YXclcdneOunX40t0CMdcWLo0876Kkpu7S2XCHd/9F/YlbCjrYskNsFQ1 yPDn8FD7bpG8OPlvf/Lklbd7NqOTDjg4XX24SOZbY4ppkmeiad7rIbP7vMNu+r4f3rs7mnmn5 5PtX19k3Z1Sb/qxWYinOSDTUYi4qTgQAQlzbrWoCAAA= X-Env-Sender: julien.grall@arm.com X-Msg-Ref: server-9.tower-206.messagelabs.com!1465318135!43758889!1 X-Originating-IP: [217.140.101.70] X-SpamReason: No, hits=0.0 required=7.0 tests= X-StarScan-Received: X-StarScan-Version: 8.46; banners=-,-,- X-VirusChecked: Checked Received: (qmail 22703 invoked from network); 7 Jun 2016 16:48:55 -0000 Received: from foss.arm.com (HELO foss.arm.com) (217.140.101.70) by server-9.tower-206.messagelabs.com with SMTP; 7 Jun 2016 16:48:55 -0000 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id BF2FAF; Tue, 7 Jun 2016 09:49:29 -0700 (PDT) Received: from e108454-lin.cambridge.arm.com (e108454-lin.cambridge.arm.com [10.1.215.28]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 12C533F246; Tue, 7 Jun 2016 09:48:53 -0700 (PDT) From: Julien Grall To: xen-devel@lists.xen.org Date: Tue, 7 Jun 2016 17:48:37 +0100 Message-Id: <1465318123-3090-3-git-send-email-julien.grall@arm.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1465318123-3090-1-git-send-email-julien.grall@arm.com> References: <1465318123-3090-1-git-send-email-julien.grall@arm.com> Cc: sstabellini@kernel.org, wei.chen@arm.com, steve.capper@arm.com, Julien Grall , shannon.zhao@linaro.org, shankerd@codeaurora.org Subject: [Xen-devel] [RFC 2/8] xen/arm: gic: Do not configure affinity for guest IRQ during routing 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" The affinity of a guest IRQ is set every time the guest enable it (see vgic_enable_irqs). It is not necessary to set the affinity when the IRQ is routed to the guest because Xen will never receive the IRQ until it hass been enabled by the guest. Signed-off-by: Julien grall --- xen/arch/arm/gic.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/xen/arch/arm/gic.c b/xen/arch/arm/gic.c index 8a1087b..f25381f 100644 --- a/xen/arch/arm/gic.c +++ b/xen/arch/arm/gic.c @@ -97,17 +97,13 @@ void gic_restore_state(struct vcpu *v) } /* - * needs to be called with a valid cpu_mask, ie each cpu in the mask has - * already called gic_cpu_init * - desc.lock must be held * - arch.type must be valid (i.e != IRQ_TYPE_INVALID) */ static void gic_set_irq_properties(struct irq_desc *desc, - const cpumask_t *cpu_mask, unsigned int priority) { gic_hw_ops->set_irq_properties(desc, priority); - desc->handler->set_affinity(desc, cpu_mask); } /* Program the GIC to route an interrupt to the host (i.e. Xen) @@ -123,7 +119,9 @@ void gic_route_irq_to_xen(struct irq_desc *desc, const cpumask_t *cpu_mask, desc->handler = gic_hw_ops->gic_host_irq_type; - gic_set_irq_properties(desc, cpu_mask, priority); + desc->handler->set_affinity(desc, cpu_mask); + + gic_set_irq_properties(desc, priority); } /* Program the GIC to route an interrupt to a guest @@ -155,7 +153,7 @@ int gic_route_irq_to_guest(struct domain *d, unsigned int virq, desc->handler = gic_hw_ops->gic_guest_irq_type; set_bit(_IRQ_GUEST, &desc->status); - gic_set_irq_properties(desc, cpumask_of(v_target->processor), priority); + gic_set_irq_properties(desc, priority); p->desc = desc; res = 0;