Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp4221971pxb; Mon, 1 Feb 2021 16:16:41 -0800 (PST) X-Google-Smtp-Source: ABdhPJwMWykdT+UXwku0ptNfxq2rYfof+O+NgGmJvZ9gQnJZ8iqtf8uV+4RaXgF4Vt69MYWqUEna X-Received: by 2002:a17:906:c1d9:: with SMTP id bw25mr19901581ejb.452.1612225001226; Mon, 01 Feb 2021 16:16:41 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1612225001; cv=none; d=google.com; s=arc-20160816; b=hfoSNUZCjm/8jRlye8hSGwnX8bIMto7wMwdVxnD+S4zSKKnJRnS13wv9VJ+gr3HTHe lo/4NrQlmodRANcd7wzAPykpa0FvOdZmalWmxsMHCVBhXslq/I6mQJ7QzA/gzM9PdbU4 DHpmUbqxPZ//5Mjv/5eNU+ziJSMHpnJ+ybE/gDrHagtuCChqNzumyBFc5q+Uxb28xcBE ykBjSRWpL97YYcS1L1N/4QTvF2dxTxT14Lqf7EJqckQdqWFfIEK9+TewsW0gnhte8KIy QSJFPAjCHz+Za9jniGEpzGxAbNoH0yHmEpja5k/+KhUNj2oIOosJeomugMwJsj3bRmaM rurg== 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=KFucjoYJAjrzKJvfbUSDRADl/xduzdtfqGtMS5D6hPY=; b=DzCw5njcPxHxacvdgZ1qtMHYlIvgwKbwzDS3rlF2Xj4Wc/LMSYYeFyyvMhMN46j6mz FgcMVWrKrm7NjTmRmtx3hTuyZ5dQ0e/AOufxJXXeqDWGlcNpr7v2kMCJQSXFOHLc33Vo eexcyEv4QzRcluCYmlL5l2cvd2XuiOIZEjxVhGpYu17fNs6H9afkphCj9JhpWvPk7Trn KfPSmpjwuT2Jk0kYpmsi4qizMyBm5bskW9mzG94i7J8MZtlz/OjBPkP7H3ZZsEj0kYXF j6dXhyMzeaupFQTLAwRY/l9dlbbjn/J20Riiklb2lBeLKccWhbnYU8cVi2IbqWqX3BZ9 1nzw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel-com.20150623.gappssmtp.com header.s=20150623 header.b=V6v5HElp; 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 p12si5212372ejz.196.2021.02.01.16.16.16; Mon, 01 Feb 2021 16:16:41 -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=@intel-com.20150623.gappssmtp.com header.s=20150623 header.b=V6v5HElp; 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 S231270AbhBBAPQ (ORCPT + 99 others); Mon, 1 Feb 2021 19:15:16 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41840 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231124AbhBBAPP (ORCPT ); Mon, 1 Feb 2021 19:15:15 -0500 Received: from mail-ed1-x533.google.com (mail-ed1-x533.google.com [IPv6:2a00:1450:4864:20::533]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E6B87C06174A for ; Mon, 1 Feb 2021 16:14:34 -0800 (PST) Received: by mail-ed1-x533.google.com with SMTP id c2so20939873edr.11 for ; Mon, 01 Feb 2021 16:14:34 -0800 (PST) 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=KFucjoYJAjrzKJvfbUSDRADl/xduzdtfqGtMS5D6hPY=; b=V6v5HElpTGs/PZ0hdhIcdtSp2EM0VozT5sHt9rLv77z3b28pRg+Qbs8IyZCLk6ECOf T2rc3N59flLmzclde2mw4fIu7s+KK3p+SooKJi5A/NHgOpMRwRQUF5/uDSs+UGbcippf LcTMMrZHOFNuPBuGj4O+Kgzmkrdlu9Vp5Sd1Y/GYt0l0j+cnQ0jmx5kHYMFZigrv2CJj i8fYM3neYCcC41JrRupSAzKkUUgJbt7+35wu/9UT0i5uhmcTs/3peaXxQ8JhocLuJWSt +LGTicj+zZbNiMkHgBYLsXU+6xsXwNJw2KXgeqW2k/VDMP+7XoAUM6mO6sqs9dxFf7Et 0bgw== 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=KFucjoYJAjrzKJvfbUSDRADl/xduzdtfqGtMS5D6hPY=; b=E/iYq9v1KNDjHbdTTgTLmRnnMRINI3DRBXa4GOSTJf2dncVKWpCucX4zpC/0V/GVru XO9E+VoZ4FzxPg/G9JXrCxsfWraqsyThpLTQy9NXuaPFHfYiT9LnZB773hPJ3/5mqM1f EQ1VtKDha5KRfXk+nSHTd1r0YCX9KGo0cIqnt1Gu3jp6xXKF1ozucrx6oFyHxz2AsetK AikWgtDVdT/11gdwinpvRqCv5PfEHeNwZLfwJ4IaYchMkktGT6HdCsvSZaOuVOBakLVM OSfrr+g8rWnXg83i2K89pFDAX2iVUNdO2VegJ2jnJsRNtNUGwqIB2ZjMS85U55pF5xCw +Vfw== X-Gm-Message-State: AOAM530B7fZAiylaE/KXqT941j+2G57VHQJqqYQsxDZd7GY7mtf86WMs 3R345N3ago0u/HPds/jrI0gwW3SekYd/1Shygbe11A== X-Received: by 2002:a50:f19a:: with SMTP id x26mr12208716edl.354.1612224873669; Mon, 01 Feb 2021 16:14:33 -0800 (PST) MIME-Version: 1.0 References: <32f33dd-97a-8b1c-d488-e5198a3d7748@google.com> <20210201215857.ud5cpg7hbxj2j5bx@intel.com> <20210201222859.lzw3gvxuqebukvr6@intel.com> <20210201223314.qh24uxd7ajdppgfl@intel.com> <20210201225052.vrrvuxrsgmddjzbb@intel.com> <79b98f60-151b-6c80-65c3-91a37699d121@google.com> <20210201231718.2hwaqgn2f7kc7usw@intel.com> <20210202001120.vr6mos7ylnbqytxh@intel.com> In-Reply-To: <20210202001120.vr6mos7ylnbqytxh@intel.com> From: Dan Williams Date: Mon, 1 Feb 2021 16:14:31 -0800 Message-ID: Subject: Re: [PATCH 03/14] cxl/mem: Find device capabilities To: Ben Widawsky Cc: David Rientjes , linux-cxl@vger.kernel.org, Linux ACPI , Linux Kernel Mailing List , linux-nvdimm , Linux PCI , Bjorn Helgaas , Chris Browy , Christoph Hellwig , Ira Weiny , Jon Masters , Jonathan Cameron , Rafael Wysocki , Randy Dunlap , Vishal Verma , daniel.lll@alibaba-inc.com, "John Groves (jgroves)" , "Kelley, Sean V" Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Feb 1, 2021 at 4:11 PM Ben Widawsky wrote: > > On 21-02-01 15:58:09, David Rientjes wrote: > > On Mon, 1 Feb 2021, Ben Widawsky wrote: > > > > > > 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. > > > > > > Well, I wouldn't hold your breath (it would be an errata in this case anyway). > > > My preference would be to just allow allow mailbox payload size to be 2^31 and > > > not deal with this. > > > > > > My question was how strongly do you feel it's an error that should prevent > > > binding. > > > > > > > I don't have an objection to binding, but doesn't this require that the > > check in cxl_validate_cmd_from_user() guarantees send_cmd->size_in cannot > > be greater than 1MB? > > You're correct. I'd need to add: > cxlm->mbox.payload_size = > min_t(size_t, 1 << CXL_GET_FIELD(cap, CXLDEV_MB_CAP_PAYLOAD_SIZE), 1<<20) nit, use the existing SZ_1M define.