Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp4189940pxb; Mon, 1 Feb 2021 15:13:12 -0800 (PST) X-Google-Smtp-Source: ABdhPJymvs8O24SMb4epZCcfb8H6swG3vQlJxgbSRhalPVATQV8qppqPMnn0mx4Mh6wGih4ViSMJ X-Received: by 2002:a17:906:547:: with SMTP id k7mr3769013eja.273.1612221191765; Mon, 01 Feb 2021 15:13:11 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1612221191; cv=none; d=google.com; s=arc-20160816; b=MbKztJ6PYaG1fErdY5cyuDannJZmVEKg+PHOGp5v1vn8DQwGEKDEjRvS1jXTpL5bZi tj3QfP4n+VnIvL8gfe3AxAmf0aS0f0ot3QkOxunqsvI9n//vrbPG5D2uHqpx07Ki6cYU dtDT8AJqXbLCnc4peq45GRpfbKt+WavmsG9BnqezpLxZ8taPQW1LavM69KDmCcQRQf5G RD8l29joHf+pl/X+BaWl99qjKW2FsuaTjqWaUToirnj/fGBFsgzeaX+mWbzQOxHuHoy+ 266XGpqh4LKvL0waP3aWJctxpxPI2hiV7sOAds/FlnLB8h8Gt9Ci4m2eljIFoWOXvfnf a7EA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:references:message-id:in-reply-to :subject:cc:to:from:date:dkim-signature; bh=3HKABxm2JWW8yXh6Ffuihg4FZgaqjfZi+45jOX+PQQI=; b=uT7vKQp6l0Wk/HFwplBu/FXkEQHYCw1EwtCbgueo8JxzzpR8yJJAKNrb3JNHWvjRx4 dxMXysdXb82T6uczxvRXCt3XsdERvsgptvYDxOtXjBSmbsq6sEV0KylHzoGLLqZtOGyo TKwNFX2PXbuU7PPzqBZvkUzGsO0azt8rcFvvjpxrZzV8pyyvO5nzyUYs7taHANM9RUgn PW1Y3IM8EOjthKu7upx3K5XczL1LqI4ziO0GqkPiNbnPNlYmc5IMyGtVO8eQCIdffO17 MuGPZfCLmOfaTOuTGq49OcxE758mtI/P8C6pg+axMgR6+dRXFeCG0CPhOt4k5klhBV3w yRsA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=CcU5cvGU; 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=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id f7si14140600edd.343.2021.02.01.15.12.47; Mon, 01 Feb 2021 15:13:11 -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; dkim=pass header.i=@google.com header.s=20161025 header.b=CcU5cvGU; 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=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230002AbhBAXKa (ORCPT + 99 others); Mon, 1 Feb 2021 18:10:30 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56254 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230013AbhBAXK2 (ORCPT ); Mon, 1 Feb 2021 18:10:28 -0500 Received: from mail-pj1-x1034.google.com (mail-pj1-x1034.google.com [IPv6:2607:f8b0:4864:20::1034]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CFBD6C0613ED for ; Mon, 1 Feb 2021 15:09:47 -0800 (PST) Received: by mail-pj1-x1034.google.com with SMTP id z9so722804pjl.5 for ; Mon, 01 Feb 2021 15:09:47 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=date:from:to:cc:subject:in-reply-to:message-id:references :mime-version; bh=3HKABxm2JWW8yXh6Ffuihg4FZgaqjfZi+45jOX+PQQI=; b=CcU5cvGUtNpEhVt6Zcu4H5EeWpk+/H7fNLUyevjipbJe31ZbS4kC70stdBy+qRxQuX bQGTv/PsDN4g+kKCAXTRJfbaPcAtLtu2g2G7PO0ZEND64tDUuXyPxUHFrUWJ66sQXEKP y3nKIvO2CMT9m1Olk6z3pOtYMHnAFGKkus3f9QjH3SfZp3FRkqDGNKcVfBUjYt90JoV5 PdCs3Zv1/l93Y4WGYJkTJfGuv2R5x64VDgt169TQMxHy81iven1IoQp9Pa1PwE/KPrFi owifCbIqzF5y9eiPUjgAXKU14kbZ4PlsribJAgzQV9UBoTMLxogxbFT1vqrRtcyn+Nxm BmMw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:in-reply-to:message-id :references:mime-version; bh=3HKABxm2JWW8yXh6Ffuihg4FZgaqjfZi+45jOX+PQQI=; b=QtCvWxH3dDgG7VWlDYdbdOM1TE1UunmvvZwpZ//1P9Ju61xZ8djnBHURI2tnEGvJw3 2EITrv1XExb8zj9Csbsy9zalQxOr0geFpUNV1tdFbKlu+xmbvsYV2IZ4Zw6R870AvooZ v+bBPoLap91OmEsT6XBDxR02OhnNKdG84jJHAWHxO82QECF+GSlMwMJ4p1gBU9Y04iB9 ItJJ8l8GZ35kbycIU4fqxGd+GljOPOZwdXgnpZtUZPmViZaTFXlz4hfbH3riq5gPVhfd O2cIV1HCnPes4QdNBTKOBa8MEodX1ZQnpzpZVol2tIMXAN7417dFRIKEuRBqoKswIzP5 x9IA== X-Gm-Message-State: AOAM531WdnrYIWAnHPF6nnu+KW725nrEM/IsEAUCLk0WuWpBj5EWDSPO WHL86sovzaMdi+pXbSH90vL2ew== X-Received: by 2002:a17:902:70c6:b029:df:d62a:8c69 with SMTP id l6-20020a17090270c6b02900dfd62a8c69mr19315852plt.20.1612220986962; Mon, 01 Feb 2021 15:09:46 -0800 (PST) Received: from [2620:15c:17:3:4a0f:cfff:fe51:6667] ([2620:15c:17:3:4a0f:cfff:fe51:6667]) by smtp.gmail.com with ESMTPSA id j4sm13872905pfa.131.2021.02.01.15.09.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 01 Feb 2021 15:09:46 -0800 (PST) Date: Mon, 1 Feb 2021 15:09:45 -0800 (PST) From: David Rientjes To: Ben Widawsky cc: linux-cxl@vger.kernel.org, linux-acpi@vger.kernel.org, linux-kernel@vger.kernel.org, linux-nvdimm@lists.01.org, linux-pci@vger.kernel.org, Bjorn Helgaas , Chris Browy , Christoph Hellwig , Dan Williams , Ira Weiny , Jon Masters , Jonathan Cameron , Rafael Wysocki , Randy Dunlap , Vishal Verma , daniel.lll@alibaba-inc.com, "John Groves (jgroves)" , "Kelley, Sean V" Subject: Re: [PATCH 03/14] cxl/mem: Find device capabilities In-Reply-To: <20210201225052.vrrvuxrsgmddjzbb@intel.com> Message-ID: <79b98f60-151b-6c80-65c3-91a37699d121@google.com> References: <20210130002438.1872527-1-ben.widawsky@intel.com> <20210130002438.1872527-4-ben.widawsky@intel.com> <234711bf-c03f-9aca-e0b5-ca677add3ea@google.com> <20210201165352.wi7tzpnd4ymxlms4@intel.com> <32f33dd-97a-8b1c-d488-e5198a3d7748@google.com> <20210201215857.ud5cpg7hbxj2j5bx@intel.com> <20210201222859.lzw3gvxuqebukvr6@intel.com> <20210201223314.qh24uxd7ajdppgfl@intel.com> <20210201225052.vrrvuxrsgmddjzbb@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, 1 Feb 2021, Ben Widawsky wrote: > > I think that's what 8.2.8.4.3 says, no? And then 8.2.8.4.5 says you > > can use up to Payload Size. That's why my recommendation was to enforce > > this in cxl_mem_setup_mailbox() up front. > > Yeah. I asked our spec people to update 8.2.8.4.5 to make it clearer. I'd argue > the intent is how you describe it, but the implementation isn't. > > My argument was silly anyway because if you specify greater than 1M as your > payload, you will get EINVAL at the ioctl. > > The value of how it works today is the driver will at least bind and allow you > to interact with it. > > How strongly do you feel about this? > I haven't seen the update to 8.2.8.4.5 to know yet :) You make a good point of at least being able to interact with the driver. I think you could argue that if the driver binds, then the payload size is accepted, in which case it would be strange to get an EINVAL when using the ioctl with anything >1MB. Concern was that if we mask off the reserved bits from the command register that we could be masking part of the payload size that is being passed if the accepted max is >1MB. Idea was to avoid any possibility of this inconsistency. If this is being checked for ioctl, seems like it's checking reserved bits. But maybe I should just wait for the spec update.