Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp1526261pxj; Fri, 21 May 2021 17:13:09 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwtqZ53Z8OIOXCX8n+D+oBmnEPm77CWuQgQvNEQisogcXVO/6jlT96+IzciL0SBGNFI1w9g X-Received: by 2002:a17:906:bb0e:: with SMTP id jz14mr12423877ejb.285.1621642388973; Fri, 21 May 2021 17:13:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1621642388; cv=none; d=google.com; s=arc-20160816; b=KseYlSNNTwa2ab6KhVDevp/vKQMZNVBnFfeOzeqb8OG1qfL4NSn1HEneXfZLHLopPr 0sb3oz0H04uo1C5Z/r9f/LPA5b5tnCgizUn8kd9C2NM5TGPq4+9ExZq6TxfZ2CsAEyGk J4KhKO79KB3NHnzAf35B+odZytq19UDpH4IqzRIFKBRWDsJOUHDIb62gF9H5OBBdYh1O 44lb7puddQepWxYJINsvSjDjlcpAck7ZrTru9hLQWmVwlyZ7RVocTA4R1mPaNh5qxPdM qeR+uXsJO1uPuXE4+jHErl4gUCh2H/f1y5aYoZ8xG3C2kENlnNydVxjbUOtyheon5/tJ u/cw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:ironport-sdr:ironport-sdr; bh=7vgFG8/ByhnCVQwtrz8MTKJ7G94XSx36awnsCbvWbqA=; b=nrvIagOQypHjb8hM06c0kEn9GN2ThtJ7v9WKY7ReD/34Y1cX+4tB0wDSPwELXhuAd7 RrHIbijzhAdbCxLslbM5Ydsedo35E8DzX/HEYpHTByNAgXeEeKGEYZJ0t+4XYd7RCneh ppDBaSXVldY7vIw58s3l58CXdWnBdeHzSdAxoG+zgzsldymzesisw/InVwldW1vbTuGW MMqIyTt83Wdz7fcPIkkM/CvlHOtVwjoSxcjWccSVZLq0MLOfyTDgv9I4LC5IU1ywmlE9 WAatvVEcPImWNb0OLi5s8tTZVKleh6CkZPMQWAF2Bz9j7dDBXys4DlPCz2X3V7AHpE9I 5ZHA== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id a10si5972731edq.515.2021.05.21.17.12.45; Fri, 21 May 2021 17:13:08 -0700 (PDT) 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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230190AbhEVANU (ORCPT + 99 others); Fri, 21 May 2021 20:13:20 -0400 Received: from mga05.intel.com ([192.55.52.43]:23457 "EHLO mga05.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230120AbhEVANT (ORCPT ); Fri, 21 May 2021 20:13:19 -0400 IronPort-SDR: U/DvaTTMC/aIpWbNRRdGXjspbGSVfnrgeQauWN5rjIcL+Q80tjcre3Zqxcn78rUIZweif/LKRV TyImZFBGyEKg== X-IronPort-AV: E=McAfee;i="6200,9189,9991"; a="287140637" X-IronPort-AV: E=Sophos;i="5.82,319,1613462400"; d="scan'208";a="287140637" Received: from orsmga001.jf.intel.com ([10.7.209.18]) by fmsmga105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 21 May 2021 17:11:55 -0700 IronPort-SDR: t0Az3X5fX0ugNGFpjrBkPyh2zyWIiLtN7ZFR73H57ANLffZm03TuJ5IOh7zYia+nJRn1PVQmAb VFS3dHCp2Q2Q== X-IronPort-AV: E=Sophos;i="5.82,319,1613462400"; d="scan'208";a="474751184" Received: from iweiny-desk2.sc.intel.com (HELO localhost) ([10.3.52.147]) by orsmga001-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 21 May 2021 17:11:55 -0700 From: ira.weiny@intel.com To: Ben Widawsky , Dan Williams Cc: Ira Weiny , Alison Schofield , Vishal Verma , Jonathan Cameron , linux-cxl@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v2 0/5] Map register blocks individually Date: Fri, 21 May 2021 17:11:49 -0700 Message-Id: <20210522001154.2680157-1-ira.weiny@intel.com> X-Mailer: git-send-email 2.28.0.rc0.12.gb6a658bd00c9 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Ira Weiny Changes for v2: Incorporate feedback from Dan Ensure memory blocks are individually reserved as well as mapped Remove pci device management in favor of lower level device management Drop version checking Reorder patches Update commit messages Some hardware implementations mix component and device registers into the same BAR and the driver stack is going to have independent mapping implementations for those 2 cases. Furthermore, it will be nice to have finer grained mappings should user space want to map some register blocks. Unfortunately, the information for the register blocks is contained inside the BARs themselves. Which means the BAR must be mapped, probed, and unmapped prior to the registers being mapped individually. The series starts by introducing the helper function cxl_decode_register_block(). Then breaks out region reservation and register mapping. Separates mapping the registers into a probe stage and mapping stage. The probe stage creates list of register blocks which is then iterated to map the individual register blocks. Once mapping is performed in 2 steps the pci device management is removed and the resource reservation can be done per register block as well. Finally, the mapping the HDM decoder register block is added. Ben Widawsky (1): cxl: Add HDM decoder capbilities Ira Weiny (4): cxl/mem: Introduce cxl_decode_register_block() cxl/mem: Reserve all device regions at once cxl/mem: Map registers based on capabilities cxl/mem: Reserve individual register block regions drivers/cxl/core.c | 182 +++++++++++++++++++++++++++++++++++++++++---- drivers/cxl/cxl.h | 98 +++++++++++++++++++++--- drivers/cxl/pci.c | 168 ++++++++++++++++++++++++++++++++--------- drivers/cxl/pci.h | 1 + 4 files changed, 388 insertions(+), 61 deletions(-) -- 2.28.0.rc0.12.gb6a658bd00c9