Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp4067330pxb; Mon, 1 Feb 2021 11:29:46 -0800 (PST) X-Google-Smtp-Source: ABdhPJwTLnYqRiB7MRz/3oRzSlWtqE/FCPJxW5S6Tphv2J/F51D6U7qnzsrNui/n2MuMQE2uiDWu X-Received: by 2002:a17:906:2e0d:: with SMTP id n13mr18994615eji.554.1612207785987; Mon, 01 Feb 2021 11:29:45 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1612207785; cv=none; d=google.com; s=arc-20160816; b=WHdIyRgHHgsiISVudoEh974oHaVJSljJ3j67gSMAnM6bAiozxDO6vk6M7ikhaiYJ/K tE76iNErlGxXQlL4/k8xCsLJtHDN/yKM2yiyqUimIA6n0EbdEMBIyNVz81RH0mlbKM9k uRf4E4+jAcPDRepr0nj+CK1Vt2cyOZMJgCm4UVk+RyX/kJeneY5NqkGiQ1xixg4unYkZ 9H9EAb1Ici6TpBcvm8jF5CXXMEaWgumuNEh5MxbeT2Y5D2AwWvfcH2PqArAa7t4QiE/k OAkfJZ5TCAYQ04AHT1LQu5103smjhE6i/G7+e7BUDal4BjRrzQdMVXEIZKW57A8VhzJZ 8zhw== 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=2vEtv7YVc+nJ1b60jdwsmLxlg8eJ3NZ37ACoRVUyl8M=; b=YC2RRdF+l3m6KbLyYPW7wcIqLXrgEtHW3gUOSXDG9nRNNXaB/JFzuJAodtMU2o3jAU Y5S/luRO7sy9JvJu8EhXKDQmPWD+U65iJQq+nDo1pHJR5doTiXwZtX1wtGBw5IV8DAsQ KiBSNzckpzJC9ehLQN0XUI+j0ZIfg0Uiml57dMV+bA+vRCqX1baXAjPUlotqI3ryzjKE D+OVH1PyEL/22MfvDsdl4Qw44hNsy3vCMnCavphrTj1khT36nsTK27fGJHRFctvjZGqF ckxLEvkVrXkmHlmYz774CoILgVoioA/QS/I4sr23tV9eByWMMJ7CSwtrOlBO+f9KIyx9 tnAQ== 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 e20si3229945ejy.605.2021.02.01.11.29.21; Mon, 01 Feb 2021 11:29:45 -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 S231209AbhBAT15 (ORCPT + 99 others); Mon, 1 Feb 2021 14:27:57 -0500 Received: from mga01.intel.com ([192.55.52.88]:57606 "EHLO mga01.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229555AbhBAT14 (ORCPT ); Mon, 1 Feb 2021 14:27:56 -0500 IronPort-SDR: 91DOs/c9+6ccIrtarMfJpO2kpUbYKL87kd+lqibePMcI/By7ZPUU9cFWHbB5DrsGGizdzBGfxD HbJijmptH1Xw== X-IronPort-AV: E=McAfee;i="6000,8403,9882"; a="199641575" X-IronPort-AV: E=Sophos;i="5.79,393,1602572400"; d="scan'208";a="199641575" Received: from orsmga003.jf.intel.com ([10.7.209.27]) by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 01 Feb 2021 11:27:10 -0800 IronPort-SDR: Ar5npZIlmRyHOQSbD4WFo7BWVfXRSQKlTGiCVd73BlEHcqRFpJZVT35dVyiUYoiQkJZUvgY63t /fFyaLde9z+Q== X-IronPort-AV: E=Sophos;i="5.79,393,1602572400"; d="scan'208";a="355891726" Received: from jambrizm-mobl1.amr.corp.intel.com (HELO intel.com) ([10.252.133.15]) by orsmga003-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 01 Feb 2021 11:27:09 -0800 Date: Mon, 1 Feb 2021 11:27:08 -0800 From: Ben Widawsky To: Konrad Rzeszutek Wilk 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 09/14] cxl/mem: Add a "RAW" send command Message-ID: <20210201192708.5cvyecbcdrwx77de@intel.com> References: <20210130002438.1872527-1-ben.widawsky@intel.com> <20210130002438.1872527-10-ben.widawsky@intel.com> <20210201182400.GK197521@fedora> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210201182400.GK197521@fedora> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 21-02-01 13:24:00, Konrad Rzeszutek Wilk wrote: > On Fri, Jan 29, 2021 at 04:24:33PM -0800, Ben Widawsky wrote: > > The CXL memory device send interface will have a number of supported > > commands. The raw command is not such a command. Raw commands allow > > userspace to send a specified opcode to the underlying hardware and > > bypass all driver checks on the command. This is useful for a couple of > > usecases, mainly: > > 1. Undocumented vendor specific hardware commands > > 2. Prototyping new hardware commands not yet supported by the driver > > This sounds like a recipe for .. > > In case you really really want this may I recommend you do two things: > > - Wrap this whole thing with #ifdef > CONFIG_CXL_DEBUG_THIS_WILL_DESTROY_YOUR_LIFE > > (or something equivalant to make it clear this should never be > enabled in production kernels). > > - Add a nice big fat printk in dmesg telling the user that they > are creating a unstable parallel universe that will lead to their > blood pressure going sky-high, or perhaps something more professional > sounding. > > - Rethink this. Do you really really want to encourage vendors > to use this raw API instead of them using the proper APIs? Again, the ideal is proper APIs. Barring that they get a WARN, and a taint if they use the raw commands. > > > > > While this all sounds very powerful it comes with a couple of caveats: > > 1. Bug reports using raw commands will not get the same level of > > attention as bug reports using supported commands (via taint). > > 2. Supported commands will be rejected by the RAW command. > > > > With this comes new debugfs knob to allow full access to your toes with > > your weapon of choice. > > Problem is that debugfs is no longer "debug" but is enabled in > production kernel. I don't see this as my problem. Again, they've been WARNed and tainted. If they want to do this, that's their business. They will be asked to reproduce without RAW if they file a bug report.