From patchwork Fri Oct 20 11:49:31 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christoffer Dall X-Patchwork-Id: 10019975 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 E8AF3602CB for ; Fri, 20 Oct 2017 11:56:00 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id CD21728EC0 for ; Fri, 20 Oct 2017 11:56:00 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id C1D5B28ED0; Fri, 20 Oct 2017 11:56:00 +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=-3.7 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, RCVD_IN_DNSWL_MED, RCVD_IN_SORBS_SPAM 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 4A15528EC0 for ; Fri, 20 Oct 2017 11:56:00 +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=wK9VN6cOvl1BtRe6/PY4jnTNeUIjEL1iNRydBNMf+O0=; b=GdxwUOoQn0F4+R0Hv4IL4e5eba mhUIed+zLuzmjT/Ym0Fizc5Sad9FcswJ1LkBZeV7dz/49/8ygu3YosMZ8OBi0VyvEUDjlAOelzQWH b98Eug/TsZz/PaNh2TPJNgrrCgQLY2oI5j0CtNFN8GeJEOnlRXTTPQJ04wz4POgUvEQ1rPR2oumsn D11Yyw2k7sIbgeJgkwed0QqrmZxnhZYax4V36OKc+R/n8OEGMFdSAtIlZsRg55uuCkCIkrO+ce9CN Ny8BjnMHcrddIvvYaExy5qdh0EKpYUDrzDbqIxNF7az5MLl5vszWXaUkFbfcvheMuS39B4Jv74IoA ybZGLIaw==; 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 1e5Vu4-0006XL-1A; Fri, 20 Oct 2017 11:55:52 +0000 Received: from mail-wm0-x243.google.com ([2a00:1450:400c:c09::243]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1e5Voi-000842-3C for linux-arm-kernel@lists.infradead.org; Fri, 20 Oct 2017 11:50:29 +0000 Received: by mail-wm0-x243.google.com with SMTP id q132so21960436wmd.2 for ; Fri, 20 Oct 2017 04:50:00 -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=ePj/HKiBjoUQPUKGbzeZe/3vtilCidQ21ZkLurLI8ss=; b=Uk9lT5MoWNzgCarmIyeFuU4zNNO3JfuDzZHwkhPRQkeayohTP8F94LMjQM5DGULGgh uAZsbtPf/vKVMJLsCBJo+STw54BEJeXOYWrFP8UpcOpMzg2Ovw42/UcWicVJ++1S5GGo gMkdjZmut9WKuRXfrKxF1w/1LzGueYkRM7iaI= 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=ePj/HKiBjoUQPUKGbzeZe/3vtilCidQ21ZkLurLI8ss=; b=a99OVf9pFyBltgA65D9FgXajen4OTCSSMlOYat4BYuLBYrkISd6X1pVDe4uu3sxDcZ QWq4wyz//Hf5PF2Iy5E5ZQ1VXgaoQ2juRf/xYxEwGoSAFQRPBI+GI/4/fd32hlrNKmgA upTVethf5KWSWBMl+hpV2wEKGY5+vrMaRrbzWnz6iXlLI3ydzjMRvmIKX391zIEeK/qX tRMaV4RSw7PMJQyU1dftE0jjzqbQgiYIhVHzU8ikLIrotd3/+UetYAAN28MAHeF4z05z pUVWrTGpZnR7xpDR/Ftbi70U0Z0+Du0uWUCsryq/fwvrR21HbNe+phtYNCHI02Wad8mF u2rw== X-Gm-Message-State: AMCzsaW/pyp+Nz6uPkj+iCxFOkQ+p+CaUHjsooU35DJQ3Ao9MQabmWzB 9+ZBO3JblLptSJgCoNS0GKxVCg== X-Google-Smtp-Source: ABhQp+S/Kpz/Ac8i0IoI98FVAD51zaAssUOYU66h0AX3Okx64bWfeoXcDEhdW/gg8MQpdxhJ8gL3HQ== X-Received: by 10.80.158.207 with SMTP id a73mr6084645edf.90.1508500199010; Fri, 20 Oct 2017 04:49:59 -0700 (PDT) Received: from localhost.localdomain (xd93dd96b.cust.hiper.dk. [217.61.217.107]) by smtp.gmail.com with ESMTPSA id f53sm872234ede.63.2017.10.20.04.49.57 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 20 Oct 2017 04:49:58 -0700 (PDT) From: Christoffer Dall To: kvmarm@lists.cs.columbia.edu, linux-arm-kernel@lists.infradead.org Subject: [PATCH v4 12/20] genirq: Document vcpu_info usage for percpu_devid interrupts Date: Fri, 20 Oct 2017 13:49:31 +0200 Message-Id: <20171020114939.12554-13-christoffer.dall@linaro.org> X-Mailer: git-send-email 2.14.2 In-Reply-To: <20171020114939.12554-1-christoffer.dall@linaro.org> References: <20171020114939.12554-1-christoffer.dall@linaro.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20171020_045020_657383_E117FD98 X-CRM114-Status: GOOD ( 12.98 ) 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: Marc Zyngier , Christoffer Dall , Thomas Gleixner , Shih-Wei Li , kvm@vger.kernel.org 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 From: Christoffer Dall 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 --- 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 d00132b5c325..38ec7a83bf56 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