From mboxrd@z Thu Jan 1 00:00:00 1970 From: Christoffer Dall Subject: Re: [PATCH v4 12/20] genirq: Document vcpu_info usage for percpu_devid interrupts Date: Sat, 21 Oct 2017 16:29:23 +0200 Message-ID: <20171021142923.GA12618@cbox> References: <20171020114939.12554-1-christoffer.dall@linaro.org> <20171020114939.12554-13-christoffer.dall@linaro.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: Christoffer Dall , kvm@vger.kernel.org, Marc Zyngier , linux-arm-kernel@lists.infradead.org, kvmarm@lists.cs.columbia.edu, Shih-Wei Li To: Thomas Gleixner Return-path: Received: from mail-wm0-f65.google.com ([74.125.82.65]:44939 "EHLO mail-wm0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932099AbdJUO3Z (ORCPT ); Sat, 21 Oct 2017 10:29:25 -0400 Received: by mail-wm0-f65.google.com with SMTP id 196so3533542wma.1 for ; Sat, 21 Oct 2017 07:29:25 -0700 (PDT) Content-Disposition: inline In-Reply-To: Sender: kvm-owner@vger.kernel.org List-ID: On Fri, Oct 20, 2017 at 01:56:16PM +0200, Thomas Gleixner wrote: > On Fri, 20 Oct 2017, Christoffer Dall wrote: > > Please Cc lkml when changing genirq core code. > ok, will do so in the future. > > 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. > > I have a hard time to understand how adding the comment allows you to set > VCPU affinity .... > Obviously everything already works without adding the comment, however it is not entirely clear how to use the vcpu_into for percpu_devid interrupts, and this patch aims to make that clear, as it is the first user of irq_set_vcpu_affinity for a percpu_devid interrupt which actually uses the vcpu_info pointer. Would you rather that we did not update the documentation or what do you suggest? Thanks, -Christoffer From mboxrd@z Thu Jan 1 00:00:00 1970 From: cdall@linaro.org (Christoffer Dall) Date: Sat, 21 Oct 2017 16:29:23 +0200 Subject: [PATCH v4 12/20] genirq: Document vcpu_info usage for percpu_devid interrupts In-Reply-To: References: <20171020114939.12554-1-christoffer.dall@linaro.org> <20171020114939.12554-13-christoffer.dall@linaro.org> Message-ID: <20171021142923.GA12618@cbox> To: linux-arm-kernel@lists.infradead.org List-Id: linux-arm-kernel.lists.infradead.org On Fri, Oct 20, 2017 at 01:56:16PM +0200, Thomas Gleixner wrote: > On Fri, 20 Oct 2017, Christoffer Dall wrote: > > Please Cc lkml when changing genirq core code. > ok, will do so in the future. > > 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. > > I have a hard time to understand how adding the comment allows you to set > VCPU affinity .... > Obviously everything already works without adding the comment, however it is not entirely clear how to use the vcpu_into for percpu_devid interrupts, and this patch aims to make that clear, as it is the first user of irq_set_vcpu_affinity for a percpu_devid interrupt which actually uses the vcpu_info pointer. Would you rather that we did not update the documentation or what do you suggest? Thanks, -Christoffer