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: 9967307 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 62763602CB for ; Sat, 23 Sep 2017 00:42:32 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5591B29590 for ; Sat, 23 Sep 2017 00:42:32 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 4A779299C6; Sat, 23 Sep 2017 00:42:32 +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=-7.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, RCVD_IN_DNSWL_HI autolearn=ham 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 C061229590 for ; Sat, 23 Sep 2017 00:42:31 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752591AbdIWAm1 (ORCPT ); Fri, 22 Sep 2017 20:42:27 -0400 Received: from mail-wm0-f42.google.com ([74.125.82.42]:45662 "EHLO mail-wm0-f42.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752588AbdIWAmX (ORCPT ); Fri, 22 Sep 2017 20:42:23 -0400 Received: by mail-wm0-f42.google.com with SMTP id q124so7623326wmb.0 for ; Fri, 22 Sep 2017 17:42:22 -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=eLGuEbs21/g+f/bkT9cXBxPtzcUlFyRISD/qatrI8CccqZXis493g++5+hTOPmGhSS QxgcDcfNueR5yahwkrVxSIq2bgtExBDKjnX6hU83/i4H/G+Y55yshVKuT/wxATrLt/AP gmyqjMH65zUOsuPjPaRbTNVrF5l1S5HnOezaKY9UEBTteEfytEO0NF+yYTl8ZvgN0gbe /Ds+kJBnSqcehN7koxFDr6nJrCHCA5uKNu9hVPxg0F7rvsTX40qRJXa5wPs5zQMJ7PyW fUx6h/y5Vlf5sIfLyx8GpJVm3/C+QLjPSU4tHg9SqpFGsJEYcWi4n70gCeuLjWjGufRH 8maw== X-Gm-Message-State: AHPjjUhwtauePSAQ1O6BV5ii42DEisKRxXzIVoYIhRNL+WUZXJUldybp R2tzh/Vb6c/zqrVsprTv+yVrsrZG5JI= 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 Cc: kvm@vger.kernel.org, Marc Zyngier , Will Deacon , Catalin Marinas , Christoffer Dall , Thomas Gleixner 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> 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 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