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: 117304 Delivered-To: patch@linaro.org Received: by 10.140.22.164 with SMTP id 33csp501364qgn; Fri, 27 Oct 2017 01:36:24 -0700 (PDT) X-Google-Smtp-Source: ABhQp+Q899RBPg5HyV2Z2HKrlDbr5Acy0GACNvA5avCfpejBfF5mNbDNwERUx5IgZLR9djaexZEU X-Received: by 10.99.165.25 with SMTP id n25mr5130117pgf.294.1509093383913; Fri, 27 Oct 2017 01:36:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1509093383; cv=none; d=google.com; s=arc-20160816; b=HYtqo5/L9Cm/iFInzxAm/AG+ODEuOCQnj4nN05o7I+H+SZAgaLvbqWG0soT4jyge2N k5f+g7ebPQMGM0e5cY1Uih6FgwwO7BX915la2jyS8X5+3Ktgv52l+y1XYLM4sI1+RUHB t/qlcEVfXbQ06+YYkkmA2wrVveJP3AfzZMyxARNFPONGJmTbFBOBKrIjLsrvOTqLsAxM KzvZlm36saY4k17saQ4QSz5/s/xGS7mgWVQUef9HBvAH35RYoR+0QepLLc466BOmTODf BDtqEwK4vbT4/AesithPB5JkomyHmS6aQWwnZq3sMuaFyw1gcQZBCvZCEsPG1Xcrp9W5 f1aA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature:arc-authentication-results; bh=7bPdlK62Kv4ag92XsXImgCS8M4jbKgYwXq44T6evuxg=; b=A/CryYhsWxMKFWixhX1mVQElBB4hoozylpo9ZZqGC39Qw+FL2vnz0zRQCdVbcJTktw Ky4zgHKBd733kkiokqAt5M/ZCHxhtA7tW8DKc3GpS6IVQ6IhixElr/q67u1Jv2a5kyna W9iFhbVj3dd6koYpPisXJlyJ4/h3hOTyf5I54zQu8CxJzS1GwJVSL4P5j10wh4OUwia1 TNoZq0zjmy+B+NJMei3ZyJ+bvxnD6bClrMm4q0K02IXmMERoNr+QRswv01dpbJ+cvZWH 7Y1E1TcPkF5ZsW/Jd5YHQ+UbSZiMPTR0ZARKImYKNpJhw4ywlrrG3c1MxSYnBvjza/mr SGWQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=ILKIcM+1; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id x12si4571608pgq.380.2017.10.27.01.36.23; Fri, 27 Oct 2017 01:36:23 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=ILKIcM+1; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752429AbdJ0IgV (ORCPT + 27 others); Fri, 27 Oct 2017 04:36:21 -0400 Received: from mail-lf0-f66.google.com ([209.85.215.66]:55006 "EHLO mail-lf0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752400AbdJ0IgF (ORCPT ); Fri, 27 Oct 2017 04:36:05 -0400 Received: by mail-lf0-f66.google.com with SMTP id a2so6516383lfh.11 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=SXJGimqWvk5GpRHCJpwGrByYU+M14JHhA/fq/lhtbe5a8jL2NF4Bkh5cL/u0MsT/7P Xou/DNL18IWNb3EioXMY9AmzGaIBDpZeOfQoPiEgONqnYwBZlrxoZwyT72FXWUw+avf5 jZFTR/M5OotoH/SMZCcZ5wbgkxt7gG9lHgmFxh1CWKRIHZEt3KY1OP+bNeNB0qMaNHpT Lm2rNX7lRm9DncUXTuUw/3+9nbprMJZRLv4fSfVdyay6Pm1h7KRumDcHKCgRPlDkxrqc 45ctu/h8d6x05K62oUuYARVcLr0igUNtzVmWlo4zpT1iZtuY43k7e/1fMst0ahY5IO2p K9Fg== X-Gm-Message-State: AMCzsaVFq9Ho/+sm8Mtjv96/nh+4tcd+9Lg/Q92u8FO70YvAGMsypwbS sLKDu9u0lGKLs5kpMtspowhPyQ== 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: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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(-) -- 2.7.4 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