Received: by 2002:a05:6a10:6006:0:0:0:0 with SMTP id w6csp965694pxa; Thu, 27 Aug 2020 23:02:37 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxD6Q8I4vo7hX41DpBFpF3rJ+JBMtfWReFgA3EIvxDb4hzgayBR0e3w+2vG/Utgo1zt2Uox X-Received: by 2002:a17:906:600f:: with SMTP id o15mr127266ejj.529.1598594557409; Thu, 27 Aug 2020 23:02:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1598594557; cv=none; d=google.com; s=arc-20160816; b=CS+KPVBEPa1v1O/lpWc0bIv9kMhPjQD0+ktlnckq3O7gmj8HYHT3B6RKRpNLIJm49R BmRwXt2Zk+9U3lx8t+bxdW42O3Q7TSnRGnvpCALhqDTY16OZncakN4w/Jftnytb6YiBU H/iAoVsgphGl24ifC9QPwEM6jS9pM/No1ZQQeVHkXlG5+EpBMQXx+4lM6URu6vq9c5Xa ZCSKscuwRnNCDg0wdoMSDXQKCxGtUGS/64LWRHf5bBZiCcxLsABZUgMq7HFfwO1EaB0n jBhMW4++MV5R8cAErgt4W8+2CdBswtWTfWUZzc9qGamhXHjtXYi7Er5g+C7dAnEUdz1U F7IQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=PV+Nje+4hh5Kf0aRfoSE4ymBliqnQcznwALAFd+yMgA=; b=Y8drVbBmEb0QIcf7DpuNWE9fLWIc5GdFxt/Z3r8Z1qwyrFwftNeAlhqP1x/rPmekis feF8pMdVx1+d60chSvQaZ4YnMsjVS59NW/cfqUBnCijCTzDhtaMbKn3E9S/p5Jv5KRLq 1QV9WrjQEz0puIXCKlt80D1pC3UpbkiUhGakVj8ju0Ef9IdqOP6YExLQBVOvg7miVB1P 9KwS0z/kG/0uSKjfjTzwfon/i7MzKlcoY0UAnOoIRhcUoiMYoMs1TfkWBCXfKqVDk+D+ ZTix8dozLdvATHDBRHTr0ZBZM4oEVIQvLrv+QDJzui9nWf0MubiWifnP/65ufEwOtd/G YWlw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=Lzwddw+Q; 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=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id ch3si2811674edb.282.2020.08.27.23.02.14; Thu, 27 Aug 2020 23:02:37 -0700 (PDT) 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=@kernel.org header.s=default header.b=Lzwddw+Q; 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=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726791AbgH1GBc (ORCPT + 99 others); Fri, 28 Aug 2020 02:01:32 -0400 Received: from mail.kernel.org ([198.145.29.99]:54226 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725849AbgH1GBb (ORCPT ); Fri, 28 Aug 2020 02:01:31 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 8C44220791; Fri, 28 Aug 2020 06:01:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1598594491; bh=BUfH8WfAunZhF8fDtPUaM+v2rLlSiXdp/dFdKzj/AuE=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=Lzwddw+QutyLPhpntRMPv0eTIEG3GvvQomBWL+4KVVVkJatqq3srm5gw3MpqJMDWt AZ9AssC4WQqVePCrOZ//hxANF6oGy0bAYqZubQyUMvSOMcA0XKuFsLm+VJbmb3Af4w HNiN6edWKP91sRb1YaAJIn5y8UoylQQFJrXLC21E= Date: Fri, 28 Aug 2020 08:01:27 +0200 From: Greg KH To: Iouri Tarassov Cc: Sasha Levin , kys@microsoft.com, haiyangz@microsoft.com, sthemmin@microsoft.com, wei.liu@kernel.org, iourit@microsoft.com, linux-kernel@vger.kernel.org, linux-hyperv@vger.kernel.org Subject: Re: [PATCH 1/4] drivers: hv: dxgkrnl: core code Message-ID: <20200828060127.GA56396@kroah.com> References: <20200814123856.3880009-1-sashal@kernel.org> <20200814123856.3880009-2-sashal@kernel.org> <20200814125528.GA56456@kroah.com> <58011269-e910-b3e4-2a3c-552b08c90574@linux.microsoft.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <58011269-e910-b3e4-2a3c-552b08c90574@linux.microsoft.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Aug 27, 2020 at 04:29:59PM -0700, Iouri Tarassov wrote: > On 8/14/2020 5:55 AM, Greg KH wrote: > > On Fri, Aug 14, 2020 at 08:38:53AM -0400, Sasha Levin wrote: > > > Add support for a Hyper-V based vGPU implementation that exposes the > > > DirectX API to Linux userspace. > > > > Signed-off-by: Sasha Levin > > > > Better, but what is this mess: > > > > > +#define ISERROR(ret) (ret < 0) > > The VM bus messages return the NTSTATUS error code from the host. NTSTATUS > is integer and the positive values indicate success. > The success error code needs to be returned by IOCTLs to the DxCore > applications. The ISERROR() macro is used in places where the NTSTATUS > success code could be returned from a function. "if (ret)" cannot be used. I > will add a comment to the macro in the next patch. No, please just "open code" this, there is no need for a macro that is actually more characters than the original test. > > > +#define DXGKDEBUG 1 > > > +/* #define USEPRINTK 1 */ > > > + > > > +#ifndef DXGKDEBUG > > > +#define TRACE_DEBUG(...) > > > +#define TRACE_DEFINE(...) > > > +#define TRACE_FUNC_ENTER(...) > > > +#define TRACE_FUNC_EXIT(...) > > > > No, please do not to custom "trace" printk messages, that is what ftrace > > is for, no individual driver should ever need to do that. > > > > Just use the normal dev_*() calls for error messages and the like, do > > not try to come up with a custom tracing framework for one tiny > > individual driver. If every driver in kernel did that, we would have a > > nightmare... > I understand the concern. This will be fixed later when we learn and pick > the final tracing technology for the driver. When is "later"? We don't want to review something that you do not think is ready to be merged, do it now so we don't trip over things that you know you want to fix up. > The current implementation > allows the hardware vendors to quickly identify issues without learning > about ftrace. They just need to enable the WSL debug console and mount > debugfs. Hardware vendors who know Linux already know about ftrace, don't make people have to read up and learn about custom ways to debug just-your-tiny-individual-driver. Instead follow the customs and ways the _WHOLE_ kernel works, that is just polite, don't you think? thanks, greg k-h