From patchwork Fri Oct 27 08:34:33 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christoffer Dall X-Patchwork-Id: 10029411 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 75918602D6 for ; Fri, 27 Oct 2017 08:39:37 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 62EAD2851A for ; Fri, 27 Oct 2017 08:39:37 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 5791D285A4; Fri, 27 Oct 2017 08:39:37 +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 D0EB62851A for ; Fri, 27 Oct 2017 08:39:36 +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=hW63uCdz0SDvexm7oXKbuzjTL11sMRgUSHd4o8C/+ks=; b=Bg103shaEKXrFdBTINL3nmV7Uh Wcc2k/t2zCCPUgPKxxswGBPIA7AJy4wq2yFXvQDTxcoOs+Vd+PZCcwLqJiHXN2Py/fvF4uaKTZIFI WCa1zo/63dxcsPiaEXpnnUK4Ff0+NokA/kSw6pqg0OT4TMDOUFD+YEiub1rQ1FnnFa1ZBkIyaqErT UgWKV+95YOxuJDaJMkx+VPkRJckFpNU2bhIG1b0ngI7KhC3LfuLvqylvVGL44rvD5SDkvF6TiUvKX fqjOMVr51T71rylolnObsYu8IUzJk+cL14XBfYnxO75U8dlSOOI88c8vQFcOLPfjAKTe20UVOdH3t B6bfH3mg==; 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 1e80Ay-0002JG-5l; Fri, 27 Oct 2017 08:39:36 +0000 Received: from mail-lf0-x242.google.com ([2a00:1450:4010:c07::242]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1e807s-0000TF-Ui for linux-arm-kernel@lists.infradead.org; Fri, 27 Oct 2017 08:37:25 +0000 Received: by mail-lf0-x242.google.com with SMTP id w21so6553950lfc.6 for ; Fri, 27 Oct 2017 01:36:05 -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=7bPdlK62Kv4ag92XsXImgCS8M4jbKgYwXq44T6evuxg=; b=ILKIcM+1sIHjq4CVRGu4rCpI7M+BULr6l8xa2NNo2XTl5BeXsHYVxE2ycBlMO0ubCW mntuH2E3eYn3jErRpRmYFBZi887FaJO+rz7DOR0keJXWjg2Q8De5U+zW+bR0u0ZIFPsn s04+hPqDAOJTuVL+EsE1tbSwXvGDnz8S7CX8A= 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=7bPdlK62Kv4ag92XsXImgCS8M4jbKgYwXq44T6evuxg=; b=q78ujU7Dz8KYHqFYfCCYzVvkOTCHyw9+e6Ke7VhJjdyTdy/q9WUP5/P9tGQ1/9gWOL yhVotdivi+jNe7/KgoDVRwLPjV4nOihJQnhGlwFe+cUCjbiWhOBGFDIh+Q0KwmHMS0/N NUAUGkbP70uxB72nhnOkol1ExSvytJop3PMeGKVHGK8Ws1SK8gZZyMIP1fGXpe2I0Tby zw1gfirOkdHITQmKYvOEq04e5tggn+JWJqs+d6pYloP3gqIkZDKRaNR++WjYT/BivWsm Qy1THi3gi/DFDaEkYz0XUk7FImmLXkit5o5MAiqdVW+6ULu6nB22BfvT7zAPCAfbjvuV pghw== X-Gm-Message-State: AMCzsaVqJBjf2JPppUrlAIpi+KW0/ovnQOwlcJOUk15dBW9g9H06fGT4 /VjPz7BYgLxBUHYmU+41PwFe/A== X-Google-Smtp-Source: ABhQp+RDue0GFOo3el635p1wjuynU9m3WaCB3ZUIZ/nK9l2XE0PJ+9U6ZSS9hzSS504K62tMRtCoXQ== X-Received: by 10.46.80.83 with SMTP id v19mr10474875ljd.101.1509093364139; Fri, 27 Oct 2017 01:36:04 -0700 (PDT) Received: from localhost.localdomain (212.27.17.163.bredband.3.dk. [212.27.17.163]) by smtp.gmail.com with ESMTPSA id d204sm1471957lfe.73.2017.10.27.01.35.59 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 27 Oct 2017 01:36:03 -0700 (PDT) From: Christoffer Dall To: kvmarm@lists.cs.columbia.edu, linux-arm-kernel@lists.infradead.org Subject: [PATCH v5 12/20] genirq: Document vcpu_info usage for percpu_devid interrupts Date: Fri, 27 Oct 2017 10:34:33 +0200 Message-Id: <1509093281-15225-13-git-send-email-cdall@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1509093281-15225-1-git-send-email-cdall@linaro.org> References: <1509093281-15225-1-git-send-email-cdall@linaro.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20171027_013625_991727_75FFF94C X-CRM114-Status: GOOD ( 13.17 ) 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 , linux-kernel@vger.kernel.org, Eric Auger , 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 documents the use of the vcpu_info parameter for percpu_devid interrupts when setting the VCPU affinity for the virtual timer interrupt in KVM/ARM. Cc: linux-kernel@vger.kernel.org Cc: Thomas Gleixner Acked-by: Marc Zyngier Signed-off-by: Christoffer Dall --- 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 d00132b..38ec7a8 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