Received: by 2002:a05:6a10:2785:0:0:0:0 with SMTP id ia5csp508054pxb; Thu, 14 Jan 2021 11:08:31 -0800 (PST) X-Google-Smtp-Source: ABdhPJysMMNuY4TLETzYpT8PfppQ9PDAd7GUBMn48KouBS6wO3+IL9sEKyI6/ypKOv9FdROf85PV X-Received: by 2002:a05:6402:4382:: with SMTP id o2mr6969157edc.371.1610651311531; Thu, 14 Jan 2021 11:08:31 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1610651311; cv=none; d=google.com; s=arc-20160816; b=IlfYIlKGUS51EhtaSPfd5/K3Lwl2mQNp7TQWcKhepn4GZ2+jG756xFKCn6F7IImA0j VCJE5+XBQYfWusQuIFylc/oAamX3N7abzCdwVkYowVOFq4tZY1f2BiwFk+Y2FSk0dgSX /ju4wD25Yl+W8WnPpHNADPrxWHLe15bhqgkdQ1gCDSFvvciYtLJ0la5mZsC1jKkkZxib Lh5Lq3wRRRKfSBPFbdXnOsvOgqNt+/uBZg450q4eVC3VxybhPZhbXQ4xSBxkLA0YUstV +bnzRhYpn0e7Zc6ola37/XoRHsQF/TJ8E+I5veNUmGGYADe+71zyNLB6CDUl7DIs6ib9 OKqA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:ironport-sdr :ironport-sdr; bh=E0ps6NTkI+X7ZbAii+02frvBsZdlqv2YB0eFeT94Z4I=; b=OiqAi3Zw3qE8NR6uAFUSS2ej0obr30HUIp9/NB9a/xXzdXETWWBy8mzEsOkrfKTzam bKT09qb/+edNZ9S7v1YSQYH9Nm2EAmd/OKPkz5qDkch3oo786aizmuaZTeUdZo1za7wO yX9wc/ogey7RbZMxCbCfZ62DQBWetqEJme8N/sP42iRGLH2FmZzaaZQ8qP89d8ugZfC6 n7GLQM4+hv2TrvKPDaucjkTvD7bACasdPN5pupGOopQ6wCsqjh9H5CcQp+zBk4pVu7U7 8WgdHXPQykqKMrAckwg8MipNu6tsjAIR5pbj7cWuB401GX5+FL9GghYRMNUIEl312RUR GvpQ== 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 g24si3053808edh.82.2021.01.14.11.08.07; Thu, 14 Jan 2021 11:08:31 -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; 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 S1729866AbhANTFL (ORCPT + 99 others); Thu, 14 Jan 2021 14:05:11 -0500 Received: from mga17.intel.com ([192.55.52.151]:49586 "EHLO mga17.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728813AbhANTFL (ORCPT ); Thu, 14 Jan 2021 14:05:11 -0500 IronPort-SDR: kksxgN36eAdwWvLlFYCwNIUyxyr0epWQLZlM+M5PWJNkch3InjVq8qFJKBC+xMJxgMpc0zHuHp DsX/YQrx588w== X-IronPort-AV: E=McAfee;i="6000,8403,9864"; a="158199869" X-IronPort-AV: E=Sophos;i="5.79,347,1602572400"; d="scan'208";a="158199869" Received: from orsmga008.jf.intel.com ([10.7.209.65]) by fmsmga107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 14 Jan 2021 11:04:28 -0800 IronPort-SDR: RVMlgzAllMO97D6rxUMR104YFghec33pshXFLgKHCzfbi7LgAPPWxpq54DcbkDu9g8DmaCYp/K OMhtqo8LV1cw== X-IronPort-AV: E=Sophos;i="5.79,347,1602572400"; d="scan'208";a="382373646" Received: from jdquesad-mobl1.amr.corp.intel.com (HELO intel.com) ([10.252.128.180]) by orsmga008-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 14 Jan 2021 11:04:27 -0800 Date: Thu, 14 Jan 2021 11:04:25 -0800 From: Ben Widawsky To: Jonathan Cameron Cc: linux-cxl@vger.kernel.org, linux-kernel@vger.kernel.org, linux-pci@vger.kernel.org, linux-acpi@vger.kernel.org, Ira Weiny , Dan Williams , Vishal Verma , "Kelley, Sean V" , Rafael Wysocki , Bjorn Helgaas , Jon Masters , Chris Browy , Randy Dunlap , Christoph Hellwig , daniel.lll@alibaba-inc.com Subject: Re: [RFC PATCH v3 14/16] cxl/mem: Use CEL for enabling commands Message-ID: <20210114190425.rxupmrjm3jfjorj4@intel.com> References: <20210111225121.820014-1-ben.widawsky@intel.com> <20210111225121.820014-16-ben.widawsky@intel.com> <20210114180211.00007852@Huawei.com> <20210114181340.fgybdchzfxiiqwhr@intel.com> <20210114183217.0000154c@Huawei.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210114183217.0000154c@Huawei.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 21-01-14 18:32:17, Jonathan Cameron wrote: > On Thu, 14 Jan 2021 10:13:40 -0800 > Ben Widawsky wrote: > > > On 21-01-14 18:02:11, Jonathan Cameron wrote: > > > On Mon, 11 Jan 2021 14:51:19 -0800 > > > Ben Widawsky wrote: > > > > > > > The Command Effects Log (CEL) is specified in the CXL 2.0 specification. > > > > The CEL is one of two types of logs, the other being vendor specific. > > > > They are distinguished in hardware/spec via UUID. The CEL is immediately > > > > useful for 2 things: > > > > 1. Determine which optional commands are supported by the CXL device. > > > > 2. Enumerate any vendor specific commands > > > > > > > > The CEL can be used by the driver to determine which commands are > > > > available in the hardware (though it isn't, yet). That set of commands > > > > might itself be a subset of commands which are available to be used via > > > > CXL_MEM_SEND_COMMAND IOCTL. > > > > > > > > Prior to this, all commands that the driver exposed were explicitly > > > > enabled. After this, only those commands that are found in the CEL are > > > > enabled. > > > > > > > > Signed-off-by: Ben Widawsky > > > > > > This patch made me wonder if the model for the command in quite right. > > > I think it would end up simpler with a pair of payload pointers for send > > > and receive (that can be equal when it makes sense). > > > > > > A few other things inline. > > > > > > Jonathan > > > > I'll address the others separately, but could you elaborate on this? I'm not > > sure I follow your meaning. > > Further down in the review.. > " > The fact that you end up bypassing the payload transfer stuff in mbox_cmd > rather suggests it's not a particularly good model. + it keeps confusing > me. > > While the hardware uses a single region for the payload, there is nothing > saying the code has to work that way. Why not have separate payload_in and > payload_out pointers? Occasionally you might set them to the same buffer, but > elsewhere you could avoid the direct memcpy()s you are doing around the > send_cmd(). > > " > > Jonathan > > Ah I was confused if that was a separate statement. Can you specify the function prototype you're hoping for (or modification to the structure)? I really like the lowest level function to simply model the hardware. I get to write the 8 steps out and clearly implement them. I personally don't think it's so awkward, but again, give me something more specific and I'll consider it.