Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp4220249pxb; Mon, 1 Feb 2021 16:13:22 -0800 (PST) X-Google-Smtp-Source: ABdhPJxrFfcdU3qN1PW6/dyoiZdVjZu6sOYSZrHMYExuGukP533CtPjiOTAlyIKtmEYI8sznro3J X-Received: by 2002:a17:906:37c1:: with SMTP id o1mr12892284ejc.488.1612224802395; Mon, 01 Feb 2021 16:13:22 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1612224802; cv=none; d=google.com; s=arc-20160816; b=r9J0fK6gS8JcrGi8nHVpT5vrXNrUt6wEnEVHfKWnvhKJPlDcZqG5ZKcr5WFOCdkQD1 ZvvVkLogod6S05Xb0LGjRb4tbf+2PiymFrZVQ0qofk5n1BUg4u4r7Hhu81GxpRRWqp0l LqYhF+K9bmkNeLebhL6/JRWas1qPFGejDe8/ZrJ5UW+iDkGYuE8xzydfPQ7x6L5Y8kit XRxEecXOOQqS4T+sa6QM9ld+gl2PSgxCo2UIaCKyyTIXuoofjXJzmL3fjbmGV8fKkKc0 BDVo+E1pKChlQnwUwtXq31P8QvltPQ4Gd4XjlnO/EhVRlup+SQ+/SHbRvB1FNd0Xo3gf vjrA== 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=VYG7aeceocoqZUOgJh9lgTT7xmobKmEy/bHMhqKV2CM=; b=H1b+EQHDC/3wMO6P4o5SwE94iztoZGpeuF1BTgu/jMnVFZUPvz0G4fF4YPiIrbND95 viLBSzXjBRzSguiOzgc4Hsj4+B8cfirHgLSkklOMxraIQqVKf8+n6Hz65C24cRmwfp0B MIifRJSe9LKEHxxM6tR1m9ZHXuW97cPSswAfLRAQ6ioPLaf56xMtfenRVweCWLe8tl+r NZrDSGekaCx9OTnU7qsqsBQri6vBt/GrZUvSxSN1OvDxtUwYC+VvrPBjntk5/s0aGQPf V9kIDD8LEV8wRV15e5FfUKIAvAg3fAlUTSrM0d0el9OAGldaaeBN2KA67kF+Qs6MZhNK QUPA== 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 p12si5212372ejz.196.2021.02.01.16.12.35; Mon, 01 Feb 2021 16:13:22 -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 S231313AbhBBAMK (ORCPT + 99 others); Mon, 1 Feb 2021 19:12:10 -0500 Received: from mga05.intel.com ([192.55.52.43]:42310 "EHLO mga05.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230000AbhBBAMK (ORCPT ); Mon, 1 Feb 2021 19:12:10 -0500 IronPort-SDR: PyJHAgQg4fiWg8qKhrkazx/iFCm1f0t4ZZls8B2wzuXatFaO4p8t8nEaEyK8pYUO8E7f6r7HsF nA9Qa5neIb2A== X-IronPort-AV: E=McAfee;i="6000,8403,9882"; a="265604696" X-IronPort-AV: E=Sophos;i="5.79,393,1602572400"; d="scan'208";a="265604696" Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by fmsmga105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 01 Feb 2021 16:11:26 -0800 IronPort-SDR: VzCZkMjvd6oUv7MNieUe2e7I+dES0FyqOvVWnfelSzqiIeNsGRdJQJu2QgfUS1x1onWe/SB/dx QzU9THSVHXcg== X-IronPort-AV: E=Sophos;i="5.79,393,1602572400"; d="scan'208";a="405945596" Received: from jambrizm-mobl1.amr.corp.intel.com (HELO intel.com) ([10.252.133.15]) by fmsmga004-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 01 Feb 2021 16:11:25 -0800 Date: Mon, 1 Feb 2021 16:11:20 -0800 From: Ben Widawsky To: David Rientjes 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 Message-ID: <20210202001120.vr6mos7ylnbqytxh@intel.com> 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> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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)