Received: by 2002:ab2:4a89:0:b0:1f4:a8b6:6e69 with SMTP id w9csp318183lqj; Wed, 10 Apr 2024 11:16:11 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXp3BxOic8kzw+r8hgQeeBKLQCMtItFQhecgkMC6Otf3TAHdaM83vogpf0L6K5fS5ZpiByxUQGArBKOGFlIEOlnJnFl6lhFu37b0BoqQg== X-Google-Smtp-Source: AGHT+IFu3FBo9qBfkKzHqKuu9GQuqUqtwu6Y8vJ1Q/gmwCCpZKZpe4syvODLvjYDJlZIoZyFoIx8 X-Received: by 2002:a05:651c:505:b0:2d8:3fbb:df69 with SMTP id o5-20020a05651c050500b002d83fbbdf69mr2830017ljp.11.1712772971104; Wed, 10 Apr 2024 11:16:11 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1712772971; cv=pass; d=google.com; s=arc-20160816; b=qNWTKZNW8IwVXUBn/JqqUcrpkTZBufjPDrbpAMdlHHOQQCWTnJ5tbzqCdWkWjkHXk4 wg9oAn8f/7lxD3LH6DRphcz4/jKxv28+y1RkXG3j086pdRNIoLGE3//rnbE4LQIbVgO8 wBRSaVS48FH3ovbnYL8BtIZQA6OeJFiJ3Rn5MqKHklJUAx7Csav5Z4Uc1jzMD3vDFlwp uEvAwTa7+tF1mBjoBVwNd36HE6EJh90R1pY9K2zj7xUAvOKGEbP3MAqmE45pjVvOoVIG GVyaSy8YTPFb9AAsdMjjfz3xO4ICZOdDA+CzrRFdc6CBUbFYbBLOWWEdHP26HBNtFHtf QG0A== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date:dkim-signature; bh=o16X1rfJZYCsVwmqCSZbX9rL/ojX0/2bBaHTAeyz4rs=; fh=gVOaIIhWuDDe/ygQbN3vypMcOYr5FOCRyM6FilwIiLY=; b=khwdW7DrSJll04oxZqXutQOQi/7XcsEYVnrHSjrDYw2oWVcNHWvTlPyxO6nBqG4wn0 hWNUl6wTHcry5Nxd3VxyiGHnxfzy9zFbm4IOeyASZswogHtooB1KQxwmnK9L9OfxF1TT iEuqQHeZw+n2iHiGYC0PsBwRBaRuU+krFpzXuav3pGQ28kdnp7Dr+GucPeO2DsYbAnGA piyTG4JqKaAxIzRbDhBoyftZmyqLh2B0/vmuBWL7nqQnPrOfHRpPZaqthTa1BSfrGZ0Q pOMU8fksAwHgiREbXUwXqt1hFi9CBA9fm1MtNxR2TSaH1EN8lCN4Yns0DDm1x2MM8rL1 RXxQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=l5kT48PE; arc=pass (i=1 spf=pass spfdomain=intel.com dkim=pass dkdomain=intel.com dmarc=pass fromdomain=intel.com); spf=pass (google.com: domain of linux-kernel+bounces-139178-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-139178-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id v5-20020a509545000000b0056e12cf74dasi5909041eda.254.2024.04.10.11.16.11 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 10 Apr 2024 11:16:11 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-139178-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=l5kT48PE; arc=pass (i=1 spf=pass spfdomain=intel.com dkim=pass dkdomain=intel.com dmarc=pass fromdomain=intel.com); spf=pass (google.com: domain of linux-kernel+bounces-139178-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-139178-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id A32B61F2291C for ; Wed, 10 Apr 2024 18:16:10 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 1632E180A87; Wed, 10 Apr 2024 18:15:39 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="l5kT48PE" Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.11]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 4BC4F1802C9; Wed, 10 Apr 2024 18:15:34 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=192.198.163.11 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712772938; cv=none; b=RQw1+B6xaNQt+MdyOVBBhoBc71s57UpSxUfLP7xPgCGxRSO7DZmq3SnXfGTwimHTsIBdzF9iQA43WLgj4Bq1NKaSyRJjZEKpfiopjd+t5pjkf5JL0aIvjvrtmppKNYE2sLLKkRQTwD7NsLYcowsd0ewmKOsRd+IwDbOZSw0Qi+M= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712772938; c=relaxed/simple; bh=f8a/TLwsLee1zdQDc56/1tetJJOm12AaYUksCA+5quQ=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=F3uHZaIzInQOoZVgAH1NL6WdPn/gzR9zDrkvBuXZe6OWrYVteQxbxKYRdQttET1USm+2Tu6Eh+5dFtjoSplU3ltJPxv2GwZaGU0pGJBELGg5s+Dbs59Fv+3xNurjcdZd7sg0PcP4gNV/GZPwG7Q65LtPztf1dCX+/YaJWrNHJi0= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=intel.com; spf=pass smtp.mailfrom=intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=l5kT48PE; arc=none smtp.client-ip=192.198.163.11 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=intel.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=intel.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1712772935; x=1744308935; h=date:from:to:cc:subject:message-id:references: mime-version:in-reply-to; bh=f8a/TLwsLee1zdQDc56/1tetJJOm12AaYUksCA+5quQ=; b=l5kT48PEFSzMc84ohP762sEtE2L7iB7euMTsJe/psGLuimzNjWDoHaee TlZ83QlMVkxAuCzWZNzlXwLh+tEidjH5Z2lm6OydmHh6ETzrLiB7MoeeM kxjTxo3fJglsrbYoK+uDvwnnIFTiIegXW4LO2OPIHDO/rpndWDxp7Lfsj NUKZi/1PJqWe+wODSh827sW4Bd+v1O3p1vXjQoiAVhHVtCZA4go8XZ5yy KQUZmxTEVTRCDkViUiWJI6/tyUBoprXenAwy5GlZyjQefGCINBqbcxWaZ 0/zkYvXC0Rpj8nnr1rV16m7ljOTqGZ+SfSchUai3V2BQ/QS3J05DrLRCT g==; X-CSE-ConnectionGUID: keUz0/w5Qmaf6deUCocCTQ== X-CSE-MsgGUID: SwNsv0N3SJCFZ2oxhTyZpw== X-IronPort-AV: E=McAfee;i="6600,9927,11039"; a="18759298" X-IronPort-AV: E=Sophos;i="6.07,191,1708416000"; d="scan'208";a="18759298" Received: from orviesa001.jf.intel.com ([10.64.159.141]) by fmvoesa105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 10 Apr 2024 11:15:34 -0700 X-CSE-ConnectionGUID: jZZoytjVS6mnXiysOWcfNg== X-CSE-MsgGUID: GAuSsfWBRg2/hfigVtzpKw== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.07,191,1708416000"; d="scan'208";a="58070512" Received: from aschofie-mobl2.amr.corp.intel.com (HELO aschofie-mobl2) ([10.255.230.146]) by smtpauth.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 10 Apr 2024 11:15:34 -0700 Date: Wed, 10 Apr 2024 11:15:32 -0700 From: Alison Schofield To: ira.weiny@intel.com Cc: Dave Jiang , Fan Ni , Jonathan Cameron , Navneet Singh , Dan Williams , Davidlohr Bueso , Vishal Verma , linux-btrfs@vger.kernel.org, linux-cxl@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 01/26] cxl/mbox: Flag support for Dynamic Capacity Devices (DCD) Message-ID: References: <20240324-dcd-type2-upstream-v1-0-b7b00d623625@intel.com> <20240324-dcd-type2-upstream-v1-1-b7b00d623625@intel.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20240324-dcd-type2-upstream-v1-1-b7b00d623625@intel.com> On Sun, Mar 24, 2024 at 04:18:04PM -0700, Ira Weiny wrote: > From: Navneet Singh > > Per the CXL 3.1 specification software must check the Command Effects > Log (CEL) to know if a device supports dynamic capacity (DC). If the > device does support DC the specifics of the DC Regions (0-7) are read > through the mailbox. Do I need to know this 'If the device...' piece to understand this patch? I like that below you say 'Subsequent patches will...' That seems enough to set the scene. > > Flag DC Device (DCD) commands in a device if they are supported. Why be vague w 'Flag'. How about 'Add a bitmap of DCD enabled commands to the driver device state structure.' > Subsequent patches will key off these bits to configure DCD. > > Signed-off-by: Navneet Singh > Co-developed-by: Ira Weiny > Signed-off-by: Ira Weiny > --- > Changes for v1 > [iweiny: update to latest master] > [iweiny: update commit message] > [iweiny: Based on the fix: > https://lore.kernel.org/all/20230903-cxl-cel-fix-v1-1-e260c9467be3@intel.com/ > [jonathan: remove unneeded format change] > [jonathan: don't split security code in mbox.c] > --- > drivers/cxl/core/mbox.c | 33 +++++++++++++++++++++++++++++++++ > drivers/cxl/cxlmem.h | 15 +++++++++++++++ > 2 files changed, 48 insertions(+) > snip > /* Device enabled poison commands */ > enum poison_cmd_enabled_bits { > CXL_POISON_ENABLED_LIST, > @@ -454,6 +463,7 @@ struct cxl_dev_state { > * (CXL 2.0 8.2.9.5.1.1 Identify Memory Device) > * @mbox_mutex: Mutex to synchronize mailbox access. > * @firmware_version: Firmware version for the memory device. > + * @dcd_cmds: List of DCD commands implemented by memory device > * @enabled_cmds: Hardware commands found enabled in CEL. > * @exclusive_cmds: Commands that are kernel-internal only It's not a 'List' it's a bitmap. How about mimicing 'enabled_cmds' description: * @dcd_cmds: DCD commands found enabled in CEL > * @total_bytes: sum of all possible capacities > @@ -481,6 +491,7 @@ struct cxl_memdev_state { > size_t lsa_size; > struct mutex mbox_mutex; /* Protects device mailbox and firmware */ > char firmware_version[0x10]; > + DECLARE_BITMAP(dcd_cmds, CXL_DCD_ENABLED_MAX); > DECLARE_BITMAP(enabled_cmds, CXL_MEM_COMMAND_ID_MAX); > DECLARE_BITMAP(exclusive_cmds, CXL_MEM_COMMAND_ID_MAX); > u64 total_bytes; > @@ -551,6 +562,10 @@ enum cxl_opcode { > CXL_MBOX_OP_UNLOCK = 0x4503, > CXL_MBOX_OP_FREEZE_SECURITY = 0x4504, > CXL_MBOX_OP_PASSPHRASE_SECURE_ERASE = 0x4505, > + CXL_MBOX_OP_GET_DC_CONFIG = 0x4800, > + CXL_MBOX_OP_GET_DC_EXTENT_LIST = 0x4801, > + CXL_MBOX_OP_ADD_DC_RESPONSE = 0x4802, > + CXL_MBOX_OP_RELEASE_DC = 0x4803, > CXL_MBOX_OP_MAX = 0x10000 > }; > > > -- > 2.44.0 >