From patchwork Mon Feb 1 15:16:25 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jonathan Cameron X-Patchwork-Id: 374273 Delivered-To: patch@linaro.org Received: by 2002:a02:b18a:0:0:0:0:0 with SMTP id t10csp1391116jah; Mon, 1 Feb 2021 07:25:17 -0800 (PST) X-Google-Smtp-Source: ABdhPJzFy77J85IIu3wJ0SzDxH2mSVOF6E5GTrbhKObeV7dxPSOepxpgQx8h7lV8dWlfbCx215A3 X-Received: by 2002:a25:b8c7:: with SMTP id g7mr26217228ybm.432.1612193116951; Mon, 01 Feb 2021 07:25:16 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1612193116; cv=none; d=google.com; s=arc-20160816; b=X9BhEPlZtLF3adg105boUQ7GC7HkcMw/pckWU3XYEAjwriFfBEKJOmm/lAB84XImFH kAhYqetblFqLEWQkdut2YK7b/VT0FlbgGAZBufn9Kk0hot2nzTa1YggO/n5kbO6UXsmI x00WxduEBirbxqhBM1++drUn/LlpGb1uJLPOOAJsX33huIDlDln+u6DTOT2p5AwIEDuN 9qheIjZcppZfk36mgErLEtcGUqWoivjvxEonbdnMs5IiE7tYuaCC0OZtQd9IMumBr4Zc 55unuj1XW8loQ0rQrotuR1yhKnNjloMDF91ZRTVIRHjcwgtYj0Y2/hqa8wBtmkB4LblG zA7w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:message-id:date:subject:to:from; bh=1QHIpnmZ1XAyQ9yXPsYkvXqljYpTc12ed29AVelgdf8=; b=k4yd9lBWisRnNizVpaEOtgG7LNls2duqX1sTBjLJcwMxeAH+hlfzktI9B0HFnSDZZh b2FNLWwoYAi1Y6OnaIMBNBskzBGvYPcbuj3ME9Mp9sAH2T64l68zR6a1qsitZv9Mn47G 9asS872KbWAL5DYr7cTIECM79gUIUTX5t1HXOEKMX7ugwSdwMiNY6tBdNx2LNC5vqYit cN6wU2S/n9GP235GDcD8/JvHYszTIrqEweEmrEKXUlZrKqoAlpyulTlnRSl1gJmAA5fl jtnwQdRxDDKVnzOkHaM7z95bNxPSE9169e+vtz+FzCYjAvkVth+XqfA3zo4hMzkx1pGG tySw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org" Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id x4si18432661ybt.319.2021.02.01.07.25.16 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 01 Feb 2021 07:25:16 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org" Received: from localhost ([::1]:46216 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1l6b4l-0001m0-Vr for patch@linaro.org; Mon, 01 Feb 2021 10:25:16 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:36166) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l6azw-0003Ho-ER for qemu-devel@nongnu.org; Mon, 01 Feb 2021 10:20:21 -0500 Received: from frasgout.his.huawei.com ([185.176.79.56]:2082) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l6azl-0002sh-2y for qemu-devel@nongnu.org; Mon, 01 Feb 2021 10:20:16 -0500 Received: from fraeml701-chm.china.huawei.com (unknown [172.18.147.226]) by frasgout.his.huawei.com (SkyGuard) with ESMTP id 4DTs214B40z67g2G; Mon, 1 Feb 2021 23:15:05 +0800 (CST) Received: from lhreml710-chm.china.huawei.com (10.201.108.61) by fraeml701-chm.china.huawei.com (10.206.15.50) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2106.2; Mon, 1 Feb 2021 16:19:40 +0100 Received: from lhrphicprd00229.huawei.com (10.123.41.22) by lhreml710-chm.china.huawei.com (10.201.108.61) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2106.2; Mon, 1 Feb 2021 15:19:40 +0000 From: Jonathan Cameron To: Subject: [RFC PATCH 0/4] hw/cxl/ + /hw/pci/: PCI DOE + CXL CDAT emulation Date: Mon, 1 Feb 2021 23:16:25 +0800 Message-ID: <20210201151629.29656-1-Jonathan.Cameron@huawei.com> X-Mailer: git-send-email 2.19.1 MIME-Version: 1.0 X-Originating-IP: [10.123.41.22] X-ClientProxiedBy: lhreml751-chm.china.huawei.com (10.201.108.201) To lhreml710-chm.china.huawei.com (10.201.108.61) X-CFilter-Loop: Reflected Received-SPF: pass client-ip=185.176.79.56; envelope-from=jonathan.cameron@huawei.com; helo=frasgout.his.huawei.com X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Thomas Huth , Ben Widawsky , "Michael S . Tsirkin" , Jonathan Cameron , Vishal Verma , f.fangjian@huawei.com, Chris Browy , f4bug@amsat.org, linuxarm@openeuler.org, jcm@redhat.com, Prashant V Agarwal , Igor Mammedov , Dan Williams Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" Whilst I know others are working on an implementation of at least some of this, a desire to work on the kernel user of this required an implementation so I threw this together in the meantime and am sending it out on the basis that it may be of use to others. As it is an RFC I have been lazy on some cleanup and error handling. Will fix that in a future version if we decide to take this forwards. Based on Ben's cxl-2.0v3 branch from https://gitlab.com/bwidawsk/qemu Possible I've picked an unstable branch so this may or may not currently apply :) I'll rebase on Ben's next version when avaialble. Jonathan Cameron (4): include/standard-headers/linux/pci_regs: temp hack to add necessary DOE definitions. hw/pci/pcie_doe: Introduce utility functions for PCIe DOE hw/cxl/cxl-cdat: Initial CDAT implementation for use by CXL devices hw/mem/cxl_type3: Enabled DOE mailbox for access to CDAT hw/cxl/cxl-cdat.c | 252 +++++++++++++++++++++ hw/cxl/meson.build | 1 + hw/mem/cxl_type3.c | 49 ++++- hw/pci/meson.build | 2 +- hw/pci/pcie_doe.c | 257 ++++++++++++++++++++++ include/hw/cxl/cxl.h | 1 + include/hw/cxl/cxl_cdat.h | 101 +++++++++ include/hw/pci/doe.h | 40 ++++ include/hw/pci/pci_ids.h | 2 + include/standard-headers/linux/pci_regs.h | 33 ++- 10 files changed, 734 insertions(+), 4 deletions(-) create mode 100644 hw/cxl/cxl-cdat.c create mode 100644 hw/pci/pcie_doe.c create mode 100644 include/hw/cxl/cxl_cdat.h create mode 100644 include/hw/pci/doe.h -- 2.19.1