Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp1630066ybv; Fri, 21 Feb 2020 00:36:52 -0800 (PST) X-Google-Smtp-Source: APXvYqxHSK5v5tAPtE8hOK5G/UcrNHyJGZm8zs6D1ojtIgl/X1KqwG+zONdtu5vFSsdfLiWTFA8N X-Received: by 2002:a9d:6b17:: with SMTP id g23mr27644497otp.139.1582274212819; Fri, 21 Feb 2020 00:36:52 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1582274212; cv=none; d=google.com; s=arc-20160816; b=h/FVhEUjAOnxkEfHsynqrbbmS9g0k7DrzTjYzrf0w0dD2nArOz23+lmSj/WkiYRQbi Mj2+g61ntCvFe6f/pAc7REJKzVMsM6ciO9TAFtJ9cDKhvq+XNw/KpcoaDGifRLBdAy9u 7MZ2rKHXtvjIw/1HtxOPEyVtmoKhS4WyrLtyrp5jKaprm3h7E+59SQJwd3/Lk81JTcbQ YJstPrRC1uC08Dps9iOYiDyy7DTIwYX/Z18VS0vBrhP6S83js8+33cYkdDuvolU3aqkX Kop5+nE35azzxWd2Fp2/N6p3ywqE7w1D6wTgeWb8Q9x2UKR9pAbgWDSfiQIDUGWPOmYP oC6w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version; bh=UjY+kSftfBUHiLiLXP9hEGzHIjvT/Fl3QgVhZnPx6GY=; b=Cc/3Hy8/9XsId9CbCgcfYT4LIvhargGkA6H8qtGZ0WXjDipKfD+zWiah9ndiEKDmUp +M4XbhS4tNr1p/R1rgHUiFQPbxhs8vrKDGVV2+//ryoppCrh7pDG6BDBxqhhOpJu4DQQ b/wWOsa5ahrcyK5upj5PxF0LAHnN0PRRQ7gx0S4t109Ua5nG1Ongs8K8PdivWB05TqGg y8H6BN9MFaeYup21zW51fozg76u2rRxquwXwdldsLRzJ4DFhG0ynkYn2vqFx8dLjQ94y TIioJ82hpuuF1f4dtn5kn/2gzcxSETra1GLXYR8mSSWi6z/YBTHg0Pi5EKTH6UPz5jm9 TwNg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id a92si1043744otc.294.2020.02.21.00.36.40; Fri, 21 Feb 2020 00:36:52 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732535AbgBUIfP (ORCPT + 99 others); Fri, 21 Feb 2020 03:35:15 -0500 Received: from mout.kundenserver.de ([212.227.126.134]:57359 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729703AbgBUIfN (ORCPT ); Fri, 21 Feb 2020 03:35:13 -0500 Received: from mail-qt1-f174.google.com ([209.85.160.174]) by mrelayeu.kundenserver.de (mreue011 [212.227.15.129]) with ESMTPSA (Nemesis) id 1Mbzdn-1ja00W1B5r-00dSWR; Fri, 21 Feb 2020 09:35:11 +0100 Received: by mail-qt1-f174.google.com with SMTP id d9so707892qte.12; Fri, 21 Feb 2020 00:35:10 -0800 (PST) X-Gm-Message-State: APjAAAXTd9Yo3qP11M/nKjS1oclRFXGQK78xdiuVvehz0Bo4Sf1yDBRR kmGtcWFBJ46Pu/ZGhnxTz+ATQpXD3hLnj1bABS4= X-Received: by 2002:ac8:1977:: with SMTP id g52mr29831842qtk.18.1582274109872; Fri, 21 Feb 2020 00:35:09 -0800 (PST) MIME-Version: 1.0 References: <20200220004825.23372-1-scott.branden@broadcom.com> <20200220004825.23372-6-scott.branden@broadcom.com> <20200220075045.GB3261162@kroah.com> <030219dc-539a-a2db-5ab2-1de7336a811c@broadcom.com> In-Reply-To: <030219dc-539a-a2db-5ab2-1de7336a811c@broadcom.com> From: Arnd Bergmann Date: Fri, 21 Feb 2020 09:34:53 +0100 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH v2 5/7] bcm-vk: add bcm_vk UAPI To: Scott Branden Cc: Greg Kroah-Hartman , Luis Chamberlain , David Brown , Alexander Viro , Shuah Khan , Bjorn Andersson , Shuah Khan , "Rafael J . Wysocki" , "linux-kernel@vger.kernel.org" , linux-arm-msm , Linux FS-devel Mailing List , BCM Kernel Feedback , Olof Johansson , Andrew Morton , Dan Carpenter , Colin Ian King , Kees Cook , Takashi Iwai , "open list:KERNEL SELFTEST FRAMEWORK" , Andy Gross Content-Type: text/plain; charset="UTF-8" X-Provags-ID: V03:K1:uKsCb7o+WwoRn2H66DIerL3UeOyZ5PMu17VhbxdEL4me0biPjB6 o7WZmnQ0rrYrtZccp+dGHRstPYT/AL1SEm/3IYCsEAqVHCgMbQ4ksER5Jxxky8Jnoh51X2G /JnrA6gQfGsmJj8e1K4e9enaF7zgs4g/BCYaMmvJ3m+rCoMGhz2lndHIOExjZ86K2oepGhd JtCJNVmjLyn1iCoVpAc5w== X-Spam-Flag: NO X-UI-Out-Filterresults: notjunk:1;V03:K0:Vx6+2EQVCCk=:3nyhniYPMKUTdjUW1WlS1X dizBB8ISTpfxLCiIjgNUDM13W0KZ67gyO2bh1Md9wdY/kVxGvwYn5gX55onS553yW1D/SV+Ic chWqDqJSktTofpps+FghQQa1v46eU7cKssNfN8Yc5x0PxCWaq+Dn/qfZO9DsbuQ8gyxIGaYZX vGVVHjT0SaIwbZR8VtUba1pNnpuJshQeY6oNsIEsbUL2lRa2xJZnzvD88GlgA5zM5Om437HEy gOaK0KA9PdAzgJOOWU90JqA1J6yt4lf74KKOKl1vCuAK94O3hnFO4F3R5G4SACx4G7udFL8ex GA7RPATiwpR4N1jVm2OiTuYBtfHBhc5GTADdJ5FvuoPhcku9U/0rb7kUh22ttL6NtwCWXZuAk tXw1kO4kCzWlqYg+iiTw8R4YCq46iHwDp/DUZk5OALtRfeEhaLhzi3F/xL8N1/gxCXoWTKA6g 6PpoBgcNI7fvKOcpty/X070DM/shiGQidrOO7rshPTPihkdG3cZS0zqwqq8mR96G2CYmYGPw6 i9vo7npjwiZczbygEsU+NPQc5JqzPcfnJ6Eagw8FfOhKBlLUUIof6oR45sX8I6NHqevSwKJCd 4zcIVZ72l9Rq3yCMGY2sF0QJ/od3s04YZePgn/NksbpSbt1QLDCMweHqD6LI1q543KzCsvfp9 bOpMBR7BXHdKcJ2lgZYXS5IiWXGGv6LiBx0GbTliLojyx0it0vRXHgAagHJx/HKaHdXGB/XJS NCA/yU0Pz+mb4mur480nqWi9BBWKph6RjCG4AG3QPdqHVluVN0h5FBMeycbQlbjO2/APQUko5 6umjBaVTqYwERcD6UZfHWF1CEOUkqNWlmw+YmOH0ZTKghgBdMU= Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Feb 21, 2020 at 2:16 AM Scott Branden wrote: > >> +struct vk_access { > >> + __u8 barno; /* BAR number to use */ > >> + __u8 type; /* Type of access */ > >> +#define VK_ACCESS_READ 0 > >> +#define VK_ACCESS_WRITE 1 > >> + __u32 len; /* length of data */ > > Horrible padding issues, are you sure this all works properly? > Haven't had any issues. > > > >> + __u64 offset; /* offset in BAR */ > >> + __u32 *data; /* where to read/write data to */ > > Are you _SURE_ you want a pointer here? How do you handle the compat > > issues with 32/64 user/kernel space? > Don't care about 32-bit user space for this driver. > I don't think there isn't even enough memory in such systems for the > number of streams of video buffers needed for transcoding. > This driver is only used in high end 64-bit x86 servers. Please see Documentation/core-api/ioctl.rst All ioctl interfaces should be written in a portable way that works with compat user space and avoids all padding in order to not leak kernel data into user space. If the driver is passing video buffers for transcoding, shouldn't the driver use the existing drivers/media interfaces for that? If it needs features that are not present there, they can probably be added. Arnd