From patchwork Sat Sep 23 00:41:59 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christoffer Dall X-Patchwork-Id: 9967341 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 30E576035E for ; Sat, 23 Sep 2017 00:47:12 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2343D20223 for ; Sat, 23 Sep 2017 00:47:12 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 1812428429; Sat, 23 Sep 2017 00:47:12 +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,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [65.50.211.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 3CB6E20223 for ; Sat, 23 Sep 2017 00:47:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=QhtdwZVO+pd5Jr96Kc5OoGf5swh0J00aZ36UwdlBXhQ=; b=XEB9j0dB511W+G/zRmCbqQTCtY 4N2Mt6YD7zRv1nQTkBx6oHCapVCSVn901SfTqgeRTQ+TzhKv7dDPtcRIsnGPzo3dU6Cjjho1rjL3v +BMLDBesq1JMHJeseKMliajZwvrjU4pac5ChjHoFfMA/k8owtEEVbeN37DJkoGzr5RY9HZZOcocE8 K3eOwP2xyfKM21aikaAEprL2VbfsGE4Wa7JS2Es7GoVLtpX5rREDeDGvjYLilOhe7ydDX3QKPcY5L 5R26l97kvBDrJNZbj4LTyo1XLQD5HG7OaNYZHp1lfUAsA0nkgxY3+9x0frreYiPYKCXYmKb3FRW43 DQBpTrvw==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux)) id 1dvYad-0007nx-0K; Sat, 23 Sep 2017 00:46:39 +0000 Received: from mail-wm0-x22f.google.com ([2a00:1450:400c:c09::22f]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1dvYWp-0003oY-RG for linux-arm-kernel@lists.infradead.org; Sat, 23 Sep 2017 00:42:57 +0000 Received: by mail-wm0-x22f.google.com with SMTP id r74so7646145wme.4 for ; Fri, 22 Sep 2017 17:42:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=e+yDLtJfq2MQT2vomic1Sn0x+SIxJrfa3sBMQ3DKYAw=; b=Uq5ztLNxyr26deAa7ZNL/RPFCHwGnVs/EliRXmXMpj+94l+yrln2nBY9Uxt4kC+QWz qHqFZIsDYb+5AAcVWwMxXfHeCiedIDzr4ozX8wZdyNjPDHN0fbp9lpsRa2eYZwlslqtM 2BZTwvMOUbSQtWzbEs+33+3avulzOMdPdxDfQ= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=e+yDLtJfq2MQT2vomic1Sn0x+SIxJrfa3sBMQ3DKYAw=; b=E3PRiFVDy5N3CufWTSwyFuB7++/jTOprgbaDRxvDOcO7wnBHxBLcVGoKqHFgjRyVpS A9kzRfuMhrRSgfZH8/08Hs8ny0C52HRrKmt5xOBnsZUXS2ADAt6F+zz9NG+eAikNueFY PjdTbcHAvTy36F0g/AZErfd1KlqYApgmZSXSnbi+fWCaavT+4QKRQ6U6wLjh0+ZCrw5E DB1fDZi0Kndc/tHwp3W8eNHBecNb8ZD4okgEGVjLZF3BRIuAz8K1lZNGVqsq/YTmrWeC FfdG2OShqHqIEyI5WT3MV/Be6gRuzvfTprUrsSAmUith3LP2bMRyDIKxeMYsuCGVm6ss ru3A== X-Gm-Message-State: AHPjjUjF/aW2bcMJxwDBJXMWdW3FM7GfAs/0uW3YEVcdF5LGiz7eHFY6 HL+/tlO2Lk/9Q+M5XK9XBAPmmQ== X-Google-Smtp-Source: AOwi7QALhGtFSLKdM+POBswpZWeBLhNGxAD+BehIRKqIhJWXrgfnKdV9tmpGuCK+M9mqVJt9W22u8Q== X-Received: by 10.80.146.178 with SMTP id k47mr6355950eda.197.1506127342047; Fri, 22 Sep 2017 17:42:22 -0700 (PDT) Received: from localhost.localdomain (xd93dd96b.cust.hiper.dk. [217.61.217.107]) by smtp.gmail.com with ESMTPSA id c25sm646085edb.57.2017.09.22.17.42.20 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 22 Sep 2017 17:42:20 -0700 (PDT) From: Christoffer Dall To: kvmarm@lists.cs.columbia.edu, linux-arm-kernel@lists.infradead.org Subject: [PATCH v3 12/20] genirq: Document vcpu_info usage for percpu_devid interrupts Date: Sat, 23 Sep 2017 02:41:59 +0200 Message-Id: <20170923004207.22356-13-cdall@linaro.org> X-Mailer: git-send-email 2.9.0 In-Reply-To: <20170923004207.22356-1-cdall@linaro.org> References: <20170923004207.22356-1-cdall@linaro.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20170922_174244_430425_CD553E9D X-CRM114-Status: GOOD ( 12.90 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Christoffer Dall , kvm@vger.kernel.org, Marc Zyngier , Catalin Marinas , Will Deacon , Thomas Gleixner MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP It is currently unclear how to set the VCPU affinity for a percpu_devid interrupt , since the Linux irq_data structure describes the state for multiple interrupts, one for each physical CPU on the system. Since each such interrupt can be associated with different VCPUs or none at all, associating a single VCPU state with such an interrupt does not capture the necessary semantics. The implementers of irq_set_affinity are the Intel and AMD IOMMUs, and the ARM GIC irqchip. The Intel and AMD callers do not appear to use percpu_devid interrupts, and the ARM GIC implementation only checks the pointer against NULL vs. non-NULL. Therefore, simply update the function documentation to explain the expected use in the context of percpu_devid interrupts, allowing future changes or additions to irqchip implementers to do the right thing. This allows us to set the VCPU affinity for the virtual timer interrupt in KVM/ARM, which is a percpu_devid (PPI) interrupt. Cc: Thomas Gleixner Cc: Marc Zyngier Signed-off-by: Christoffer Dall Acked-by: Marc Zyngier --- kernel/irq/manage.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/kernel/irq/manage.c b/kernel/irq/manage.c index 573dc52..2b2c94f 100644 --- a/kernel/irq/manage.c +++ b/kernel/irq/manage.c @@ -381,7 +381,8 @@ int irq_select_affinity_usr(unsigned int irq) /** * irq_set_vcpu_affinity - Set vcpu affinity for the interrupt * @irq: interrupt number to set affinity - * @vcpu_info: vCPU specific data + * @vcpu_info: vCPU specific data or pointer to a percpu array of vCPU + * specific data for percpu_devid interrupts * * This function uses the vCPU specific data to set the vCPU * affinity for an irq. The vCPU specific data is passed from