Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp763222pxk; Thu, 3 Sep 2020 11:56:53 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy6X1pNOIQH7+mupVOPT00QtOdIMA5hLLhmA6VAaP+RYUBJRoqFQt/sRzylqxJ+YkUsgscV X-Received: by 2002:a17:906:d8bc:: with SMTP id qc28mr3734130ejb.490.1599159413769; Thu, 03 Sep 2020 11:56:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1599159413; cv=none; d=google.com; s=arc-20160816; b=dbInQojgEd6xoE21aXnlYrkelcIua2g79+pEyl/JcSNRVhbDQSqCceLZkdDbKsuXFQ fXQbJjP2AtbZzzaneGQeJtYgwkqs7sxyDuCzSLX/fki9b4ldVv7g2x1/JC1hb9G6hpTR qx5P8iyJdHaf7KfxmxrSbC/tR4JAQnjb3E6HFj+HhJ9bpD15b2CP8U+oHVqCypFFbJX/ Rzzh9bnvTXsSOlB2Uls/WY+afmPQpMGriclI4rgxNDe+oK3dhFrKvk4NvQeQFP4RRXwN lcnWK2CH5eRSatQ7L1o/pkOa0cwUpVnJvGaR76/c/3n+IfMXX92mLyqNlfMXWdnc753f n4UQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-language :content-transfer-encoding:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dkim-signature:dkim-filter; bh=8xhM8jGePlugAVfDZrVZ6mcs+yU+1QsE8K/2rdY/HpE=; b=oJjOsffHWExVK56irlAkwXNjgqfpcvFAwLG7b3Blg/5+QWazB8fbmxxYIJCy5/GPqF M5H74N0ljSQzVyLZz3rc3zyLLopVia6Ao5ceLImsBYyEjPudA/N5KbTfkIrzPwKAYCIX ggRDweER3SB+pDT0q1Onz19BRcIRpVXtDhRiaaSzUW/iv0DOxdVOAC0V4FmDQsiWiNOQ cGnsf65he9cDU0mN38TForvKORsyqH5U7TzS057uwhKnMEM0p83uklcDa3kUHGZJn71P HjdzskibGjZlg40JypkFfv1rF2vijHH5zPy7RNnFdLTafIJ6SG5ZwzbZNcduaHPXN4zh mV6w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux.microsoft.com header.s=default header.b=lClAnmBS; 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=NONE sp=NONE dis=NONE) header.from=linux.microsoft.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id y14si2181442edi.27.2020.09.03.11.56.30; Thu, 03 Sep 2020 11:56:53 -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=@linux.microsoft.com header.s=default header.b=lClAnmBS; 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=NONE sp=NONE dis=NONE) header.from=linux.microsoft.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729197AbgICSzT (ORCPT + 99 others); Thu, 3 Sep 2020 14:55:19 -0400 Received: from linux.microsoft.com ([13.77.154.182]:49486 "EHLO linux.microsoft.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729167AbgICSzR (ORCPT ); Thu, 3 Sep 2020 14:55:17 -0400 Received: from [192.168.1.17] (50-47-107-221.evrt.wa.frontiernet.net [50.47.107.221]) by linux.microsoft.com (Postfix) with ESMTPSA id 9A96E20B7178; Thu, 3 Sep 2020 11:55:16 -0700 (PDT) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com 9A96E20B7178 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.microsoft.com; s=default; t=1599159316; bh=8xhM8jGePlugAVfDZrVZ6mcs+yU+1QsE8K/2rdY/HpE=; h=Subject:To:Cc:References:From:Date:In-Reply-To:From; b=lClAnmBSVvGfF+CmDdsCfTe8NQ6eXsmcDHykjYZcB9L82hXYeHzfG+dv9KnLzIf+o RGlRYIWmFMiuCetQeRpWwuvxFSkrb/FYALOyp0eVFDPH+sKWRQns59MvgE8AGOVvc3 eh9PhAqxAkn+NxzOoYvsdhs/3tDJzx9c9o7exED4= Subject: Re: [PATCH 1/4] drivers: hv: dxgkrnl: core code To: Greg KH 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, spronovo@microsoft.com References: <20200814123856.3880009-1-sashal@kernel.org> <20200814123856.3880009-2-sashal@kernel.org> <20200814130406.GC56456@kroah.com> <20200828061257.GB56396@kroah.com> From: Iouri Tarassov Message-ID: Date: Thu, 3 Sep 2020 11:55:16 -0700 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:68.0) Gecko/20100101 Thunderbird/68.12.0 MIME-Version: 1.0 In-Reply-To: <20200828061257.GB56396@kroah.com> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 8bit Content-Language: en-US Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Greg, I appreciate your comments and working to address them. On 8/27/2020 11:12 PM, Greg KH wrote: > As for "matching names", why does that matter? Who sees both names at > the same time? > > > > > > > endian issues? > > > > > > If not, why are these bit fields? > > This matches the definition on the Windows side. Windows only works on > > little endian platforms. > > But Linux works on both, so you need to properly document/handle this somehow. This driver works only in a Linux container in conjunction with the Windows host. The structure definitions are? the same on the host and the container. The driver will not be enabled or work on platforms, where Windows does not run. > > > > > > > > +struct d3dkmt_destroydevice { > > > > + struct d3dkmthandle device; > > > > +}; > > > > > > Again, single entity structures? > > > > > > Are you trying to pass around "handles" and cast them backwards? > > > > > > If so, great, but then use the real kernel structures for that like > > > 'struct device' if these are actually devices. > > > > > Again. The structure matches the definition on the Windows side to avoid > > confusion. > > Who is confused here? We accept naming conventions that do not match > the normal Linux style when they are referring to external sources of > the data. Examples of this are USB device field names, and other > hardware specifications that are public. You aren't sharing code with a > Windows system, so please follow the Linux coding style rules, as you > want Linux developers to be helping you maintain this code, not > developers who have ever read code from other operating systems. > > So please follow the rule of, "unless these fields and structures are > publically defined somewhere, use Linux naming rules", like all of the > rest of us do. > The d3dkmt* structures, like d3dkmt_destroydevice are publicly documented on MSDN (https://docs.microsoft.com/en-us/windows-hardware/drivers/ddi/d3dkmthk/ns-d3dkmthk-_d3dkmt_destroydevice). I am using the same definitions in the driver, so it is easy to find the corresponding definition and description of the structure. I have no problem to change the names, but I think using the same public definition will help the driver maintainers. Thanks Iouri