Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp1909158pxj; Wed, 19 May 2021 17:25:02 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxkW57Pwszcrxy2Bdibv2gmuDyUvZcH+/etFaLXKwXOZjk0Z034QWgxj/z8nSz7/ay8eYuY X-Received: by 2002:a92:50c:: with SMTP id q12mr1966829ile.166.1621470302471; Wed, 19 May 2021 17:25:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1621470302; cv=none; d=google.com; s=arc-20160816; b=rA7DAkB9nwZnNJcGKC89rFebqZDP+HjugVDMLYrWd5fi+MoL3AM6eM0hiI9GvxN/PC SfPL0f3IaCvnQobRLMOq1ClwBgfdFjWZjHp+65FQo0+MMTqFPS1VydT4+ZdgiJAabv9V Z3R61SBz22i5OK8Mguuhy+x/r2DUm0Qc3/ev528hBNrPspz055sGEcYDQNLk8OQovht/ SLZFuc4qFMR3n62QvKQt9InOvmlq3dbCTv74MV7OTDJtBIFSfxsKWiq1gcUp+IgD4kHN asqJxT4UkOMGUE4CuBTJleHX9rYT4LlCUw7oNHbmWToADi85RbqMPLpUJOL4apJryDIW /qBw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=oOGPCygeGm574jrl8IBVZpfRYMLEqBwpFNqsk8f8+tI=; b=p9+im8VdSvA8OmWwmQt/HiRBgkocr4xc0mDtbl49tcfARXGamRktV4Fc2bghjQW8LO Ky2ZZPrLb+nbVELT/WoSRHcePu5SRXsRNBEMutUhBQE1g0msK3MLfWYqMe7ZuJiSy2bq 5gmpmpa2ZgOxIfKV7FhOYFtgPAlmgxQ3IGnU6nVU39/9/RKtB15zdvVg0oUTK79UWLLM YuerYcNqOOKy0aGF8bdaMf5+3Vccw0xgEPNjdQZL7Mx0XqBHvR6jf9NbxoGn2G5x6H0Y HRsAlEdiJTShjyN22zFA8zfRiuSVrWFRZwVePglX559Advy2uns5cIJV6mheDUAB4e1b s/MQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel-com.20150623.gappssmtp.com header.s=20150623 header.b=qMKqlCPa; 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 x7si954760jat.98.2021.05.19.17.24.48; Wed, 19 May 2021 17:25:02 -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; dkim=pass header.i=@intel-com.20150623.gappssmtp.com header.s=20150623 header.b=qMKqlCPa; 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 S229525AbhETAZe (ORCPT + 99 others); Wed, 19 May 2021 20:25:34 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35724 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229598AbhETAZd (ORCPT ); Wed, 19 May 2021 20:25:33 -0400 Received: from mail-ed1-x532.google.com (mail-ed1-x532.google.com [IPv6:2a00:1450:4864:20::532]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 61E92C06175F for ; Wed, 19 May 2021 17:24:13 -0700 (PDT) Received: by mail-ed1-x532.google.com with SMTP id t3so17335171edc.7 for ; Wed, 19 May 2021 17:24:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=intel-com.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=oOGPCygeGm574jrl8IBVZpfRYMLEqBwpFNqsk8f8+tI=; b=qMKqlCPaMAWpZHfXzZKHA7jX+XfwqBNpHw+03AyLdOAletf5oJRmg2TJv3hhgI51g/ EkMIcNh7Gk6bLCivWMSTaVnTXwkGRLeDMlLbL5wL1fbM3W6MYEs3nKQMBCsOKOOEexJr oLeJBLcvx/4b5FSQgMRb87KcIexbJX+PL3vqUQQley4r+bCAPNY4T4qY13B5JZW4mCjs I9EESq+GEU2VAmAvoiaN2LAevH+uHo1Eu3WviuUUvL3qVyPzV02MSPttu6SHjTYJqNn+ Ez45/K348f5szv7SyEiWjezNjv/qnqAkIJlqDzW8ybdjeq0g8JmgYGUe4t4GhgDyFyd2 sEzQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=oOGPCygeGm574jrl8IBVZpfRYMLEqBwpFNqsk8f8+tI=; b=RQcuLhsYKACxmYWC+8LTNI8/Xpvp2fJ17/VCfciXtYH4L3YWRbaqI4T+SNckFsY1gE 4lF3OyTYpButksa73K4QGRysMSEied4F5TyHeo/FdkXUY4+yaXM/uGEEssopb61gPBxl z/66pRkmtCtmSUaH8heJtoI9Rk9ojegZfbZvl1xkNFRfGLm7aJ6WBP3MrjoSx9xZt75U u1SiIGD2iUTivCtvp+iH+aH0D/iAzhPlXFLdaOwl/kIqVrGBKOmo0krASGsAWXGiJKAT wYcMKyRfd0Gy6z+jGQCtDYGxMCziNSGL35zvHsY0xQTnV4/134HVpy6WJ2XmjIG/poYv Nr+Q== X-Gm-Message-State: AOAM5313ruWp5oSa+q1PFBZCpfXakl2YVc1naQ4pxm3GkfL2JkafuTF1 qgIxZrCyY4Qu7Em0JiQWV1DoLHKvNiOlvpW5sVNL9g== X-Received: by 2002:a05:6402:128f:: with SMTP id w15mr1939034edv.354.1621470251888; Wed, 19 May 2021 17:24:11 -0700 (PDT) MIME-Version: 1.0 References: <20210506223654.1310516-1-ira.weiny@intel.com> In-Reply-To: <20210506223654.1310516-1-ira.weiny@intel.com> From: Dan Williams Date: Wed, 19 May 2021 17:24:01 -0700 Message-ID: Subject: Re: [PATCH 0/4] Map register blocks individually To: "Weiny, Ira" Cc: Ben Widawsky , Alison Schofield , Vishal Verma , Jonathan Cameron , linux-cxl@vger.kernel.org, Linux Kernel Mailing List Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, May 6, 2021 at 3:37 PM wrote: > > From: Ira Weiny > > User space will want to map some register blocks. The motivation is not to allow userspace access. The motivation is a bug fix for hardware implementations that mix component and device registers into the same BAR and the fact that the driver stack has independent mapping implementations for those 2 cases. It is a happy side-effect that this also allows finer grained pci-mmap exclusion. > Currently BARs are mapped in > their entirety and pointers to the register blocks are created into those > mappings. This will prevent mappings from user space. > > This series has 3 clean up patches followed by a patch to mapping the register > blocks individually. > > 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 probe stage creates list of register maps which is then iterated to map > the individual register blocks. > > Ira Weiny (4): > cxl/mem: Fully decode device capability header > cxl/mem: Reserve all device regions at once > cxl/mem: Introduce cxl_decode_register_block() > cxl/mem: Map registers based on capabilities > > drivers/cxl/core.c | 84 ++++++++++++++++++++------ > drivers/cxl/cxl.h | 34 +++++++++-- > drivers/cxl/pci.c | 147 +++++++++++++++++++++++++++++++++++---------- > 3 files changed, 211 insertions(+), 54 deletions(-) > > -- > 2.28.0.rc0.12.gb6a658bd00c9 >