Received: by 2002:a05:6a10:16a7:0:0:0:0 with SMTP id gp39csp551991pxb; Thu, 12 Nov 2020 10:06:07 -0800 (PST) X-Google-Smtp-Source: ABdhPJxvIyp5CnsITmvd4WdOJpI6iSZpAFP4qkzxr9JwUrCkrspF2rSuP7nVFuf508IjeW5vPZ86 X-Received: by 2002:a05:6402:30b5:: with SMTP id df21mr1109418edb.146.1605204367187; Thu, 12 Nov 2020 10:06:07 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1605204367; cv=none; d=google.com; s=arc-20160816; b=uWYL6HkHu1GeQ1ePji0Jiiyy4SR0uJcjakNHwGpkvBKoom0DvngplZwqOQRg/p9kFv Gy044BWWWt29UjdrJ/EoY1IOF3NQ3QMx/CkARYxw06DLB7ojS1/SJqPNEMx2OQJ/Pp3F 5cRtPb1vDPtCF74QYie9/p4cuX8HTge3qlnJ1j5IU5B69VNOy2NBJCXze7RRJwj3bHp5 S8ig55fiIdioUoDiyjWaN7b37Y7sDuL2wuKtzEz2rvG69/Y62sSAQFUyF9nYe3xf5Ugq 7Rz1WbqNDtegLqk4Q1oD9QQLoBBqzk8MVpiZSjRouudXKfhykix85o9i3K7dQxSEJTTt oPKg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:references:in-reply-to:message-id:date:subject :cc:to:from:dkim-signature; bh=7Iwq81/ZizVGm2kC+pKo9T7IH4Mak+r/1h3RzCF8CAk=; b=iqRX5dVm2XnHnvk0eDMccmpcjKhryn3v7ju7b6k2ys+9P71JfdpFYCWdHoKgPZehX/ PaxHFivPx9uAAWh8olCkWWMDCHUPnXK/JOL2tceAH9KC5j3VCApIfeBpizPaLf+XORrs 0s81435q+93rc1iB5VDxJx+TsQ5YGXJ4hUPp9nWapceOFnkmMN8YR970CWUD6bBcASvU DtThZB4oJwJ/eRtSnELEyFQeTaAf3BvjzS39Y1uHQBA+MCsjBg24oD8r6l2puDdcNx7U hFyZmkWst5/XO3KlCW4u2dOLvzCHuGr45SwHVEtkOGehuMSAPc622NR9QM+yqYPEuzAC jnOQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@broadcom.com header.s=google header.b=fcoh7Gha; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=broadcom.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id a5si4548022edq.470.2020.11.12.10.05.36; Thu, 12 Nov 2020 10:06:06 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@broadcom.com header.s=google header.b=fcoh7Gha; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=broadcom.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726203AbgKLR7G (ORCPT + 99 others); Thu, 12 Nov 2020 12:59:06 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35086 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725966AbgKLR7G (ORCPT ); Thu, 12 Nov 2020 12:59:06 -0500 Received: from mail-pf1-x441.google.com (mail-pf1-x441.google.com [IPv6:2607:f8b0:4864:20::441]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3C601C0613D1 for ; Thu, 12 Nov 2020 09:59:06 -0800 (PST) Received: by mail-pf1-x441.google.com with SMTP id c20so5242936pfr.8 for ; Thu, 12 Nov 2020 09:59:06 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=broadcom.com; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=7Iwq81/ZizVGm2kC+pKo9T7IH4Mak+r/1h3RzCF8CAk=; b=fcoh7GhapQuHRUIWvUMunt4/brC/tIO5iVyPBjO1iF5dPgadvPqBsLAdE0flpgnMzX LhfeGvECQIKaJu0z/Xt7rHJ6e+gVTj111ewLETM+TxCuOpUiccFYCEzii/F98+nWzPng +QcKideToA3FUvOCdKk8ZYWy9r12vjDO3QdxQ= 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=7Iwq81/ZizVGm2kC+pKo9T7IH4Mak+r/1h3RzCF8CAk=; b=MTqrmNWvaBrec1/dFX/oLD36Sbw+cG5roYE0WxteCSZb7NfRs3evQsymtaoElX+u/q pTnHK7qI7rCt3sz4TfIfJk6b7R1H7i5af3R+6ycP5lkvhXkW43hC1VLYjVlPmWNQkhLB CdSAmIto1GseaezIhMob0w+dtHDeX/6lvewrSvntx5uVa4l3fMLY67VYo+4MLWx65oVq VfBPAwhUU4R1U+CQgLfMwrx8Sspn0NCCzzTKEzPLn33XDPNlmgxmUgWEwXnhYlEnvz4L GBPAgT/7i9oYzvl0NZI9eJBJYHzTEkEnSrXsFR9T+CE6AFO+l+wfXVoHO59IpgSYgeYH riNg== X-Gm-Message-State: AOAM531VDdEoV7hGMiFrcHWSAXa8LJsEs20yFROsmW0Xmbqfw63RpmRS BfaAf8zAgwb8kQcTGoVAIii5gg== X-Received: by 2002:a65:4483:: with SMTP id l3mr575455pgq.96.1605203945461; Thu, 12 Nov 2020 09:59:05 -0800 (PST) Received: from rahul_yocto_ubuntu18.ibn.broadcom.net ([192.19.234.250]) by smtp.gmail.com with ESMTPSA id r6sm7237894pjd.39.2020.11.12.09.59.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 12 Nov 2020 09:59:04 -0800 (PST) From: Vikas Gupta To: eric.auger@redhat.com, alex.williamson@redhat.com, cohuck@redhat.com, kvm@vger.kernel.org, linux-kernel@vger.kernel.org Cc: vikram.prakash@broadcom.com, srinath.mannam@broadcom.com, Vikas Gupta Subject: [RFC, v1 0/3] msi support for platform devices Date: Thu, 12 Nov 2020 23:28:49 +0530 Message-Id: <20201112175852.21572-1-vikas.gupta@broadcom.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20201105060257.35269-1-vikas.gupta@broadcom.com> References: <20201105060257.35269-1-vikas.gupta@broadcom.com> Content-Type: multipart/signed; protocol="application/pkcs7-signature"; micalg=sha-256; boundary="000000000000fe76cb05b3ecaa43" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --000000000000fe76cb05b3ecaa43 This RFC adds support for MSI for platform devices. a) MSI(s) is/are added in addition to the normal interrupts. b) The vendor specific MSI configuration can be done using callbacks which is implemented as msi module. c) Adds a msi handling module for the Broadcom platform devices. Changes from: ------------- v0 to v1: i) Removed MSI device flag VFIO_DEVICE_FLAGS_MSI. ii) Add MSI(s) at the end of the irq list of platform IRQs. MSI(s) with first entry of MSI block has count and flag information. IRQ list: Allocation for IRQs + MSIs are allocated as below Example: if there are 'n' IRQs and 'k' MSIs ------------------------------------------------------- |IRQ-0|IRQ-1|....|IRQ-n|MSI-0|MSI-1|MSI-2|......|MSI-k| ------------------------------------------------------- MSI-0 will have count=k set and flags set accordingly. Vikas Gupta (3): vfio/platform: add support for msi vfio/platform: change cleanup order vfio/platform: add Broadcom msi module drivers/vfio/platform/Kconfig | 1 + drivers/vfio/platform/Makefile | 1 + drivers/vfio/platform/msi/Kconfig | 9 + drivers/vfio/platform/msi/Makefile | 2 + .../vfio/platform/msi/vfio_platform_bcmplt.c | 74 ++++++ drivers/vfio/platform/vfio_platform_common.c | 86 ++++++- drivers/vfio/platform/vfio_platform_irq.c | 238 +++++++++++++++++- drivers/vfio/platform/vfio_platform_private.h | 23 ++ 8 files changed, 419 insertions(+), 15 deletions(-) create mode 100644 drivers/vfio/platform/msi/Kconfig create mode 100644 drivers/vfio/platform/msi/Makefile create mode 100644 drivers/vfio/platform/msi/vfio_platform_bcmplt.c -- 2.17.1 --000000000000fe76cb05b3ecaa43 Content-Type: application/pkcs7-signature; name="smime.p7s" Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="smime.p7s" Content-Description: S/MIME Cryptographic Signature MIIQPwYJKoZIhvcNAQcCoIIQMDCCECwCAQExDzANBglghkgBZQMEAgEFADALBgkqhkiG9w0BBwGg gg2UMIIE6DCCA9CgAwIBAgIOSBtqCRO9gCTKXSLwFPMwDQYJKoZIhvcNAQELBQAwTDEgMB4GA1UE CxMXR2xvYmFsU2lnbiBSb290IENBIC0gUjMxEzARBgNVBAoTCkdsb2JhbFNpZ24xEzARBgNVBAMT Ckdsb2JhbFNpZ24wHhcNMTYwNjE1MDAwMDAwWhcNMjQwNjE1MDAwMDAwWjBdMQswCQYDVQQGEwJC RTEZMBcGA1UEChMQR2xvYmFsU2lnbiBudi1zYTEzMDEGA1UEAxMqR2xvYmFsU2lnbiBQZXJzb25h bFNpZ24gMiBDQSAtIFNIQTI1NiAtIEczMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA tpZok2X9LAHsYqMNVL+Ly6RDkaKar7GD8rVtb9nw6tzPFnvXGeOEA4X5xh9wjx9sScVpGR5wkTg1 fgJIXTlrGESmaqXIdPRd9YQ+Yx9xRIIIPu3Jp/bpbiZBKYDJSbr/2Xago7sb9nnfSyjTSnucUcIP ZVChn6hKneVGBI2DT9yyyD3PmCEJmEzA8Y96qT83JmVH2GaPSSbCw0C+Zj1s/zqtKUbwE5zh8uuZ p4vC019QbaIOb8cGlzgvTqGORwK0gwDYpOO6QQdg5d03WvIHwTunnJdoLrfvqUg2vOlpqJmqR+nH 9lHS+bEstsVJtZieU1Pa+3LzfA/4cT7XA/pnwwIDAQABo4IBtTCCAbEwDgYDVR0PAQH/BAQDAgEG MGoGA1UdJQRjMGEGCCs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