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: 10029377 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 1A2AE602D6 for ; Fri, 27 Oct 2017 08:36:37 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 08A7028F55 for ; Fri, 27 Oct 2017 08:36:37 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id EFDCE28F5C; Fri, 27 Oct 2017 08:36:36 +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=-6.5 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,RCVD_IN_DNSWL_HI,RCVD_IN_SORBS_SPAM autolearn=unavailable version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 79FD628F55 for ; Fri, 27 Oct 2017 08:36:36 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752412AbdJ0IgU (ORCPT ); Fri, 27 Oct 2017 04:36:20 -0400 Received: from mail-lf0-f66.google.com ([209.85.215.66]:47711 "EHLO mail-lf0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752380AbdJ0IgF (ORCPT ); Fri, 27 Oct 2017 04:36:05 -0400 Received: by mail-lf0-f66.google.com with SMTP id k40so6541403lfi.4 for ; Fri, 27 Oct 2017 01:36:04 -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=euTOGWr+ulf+SwR/84t+uNCTY8Qk+NYbNc561QVhDFYMDDSCWUkM2OdPSXTIOL2cM5 veMkAeRGFXtkvPR7JV6atHPVxPmGQB1XomPDtqfK20q2cBFWAD8K5B7FjZlZ2K9xC1zr GX1yNtNKsAmstlbyLwY+YEk0s5cCN1cgw468zRlNNHPhYNqgYS25kf5mX2Dggbb8TSWG iEkljEHTT8bdY5d6z0B5lSrg0pacT3C2tvmQFxVZH5uSB9juCm98jcMxVT3PAWIvMxr6 iyl8CqqdLZpjal0g7wTzm98FOM2kSVVlcN3Onj5IKgL92jxk1WXYPr2eZVYStWZEnb6S e41A== X-Gm-Message-State: AMCzsaWZlrm5iD1usjnn/YHWv87sT3j5SZxnWfrF0+E1jKz0uDcMWS9E AazkCjdDOF5vLePE8LN61WWhMg== 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 Cc: Marc Zyngier , Eric Auger , kvm@vger.kernel.org, Catalin Marinas , Will Deacon , Christoffer Dall , linux-kernel@vger.kernel.org, Thomas Gleixner 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> Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.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