Re: [PATCH 1/4] drivers: hv: dxgkrnl: core code

Greg KH
2020-09-03T19:32:13Z

On Thu, Sep 03, 2020 at 11:55:16AM -0700, Iouri Tarassov wrote:
> 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.

That's fine, you can create your structures in a way that works no
matter what endian is in use, in very simple ways. Don't rely on
bit fields like this in a structure to actually work the way you think
they work (hint, compilers hate them and do horrible things with them
usually...)

So do it that way please, especially for when you are passing things
across the user/kernel boundry. It's much simpler and easier to do it
right now, than to have to fix it up later.

thanks,

greg k-h