Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp2183488ybv; Fri, 21 Feb 2020 10:28:32 -0800 (PST) X-Google-Smtp-Source: APXvYqyK3+D/A9g2JnHK4caSr30bCEAEhHsd0SunhqW7ZfjnVssrzE1W6BWQoKbzazOIqo7VfmrV X-Received: by 2002:a9d:7602:: with SMTP id k2mr29622632otl.39.1582309712744; Fri, 21 Feb 2020 10:28:32 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1582309712; cv=none; d=google.com; s=arc-20160816; b=DJnQnaVhLwUuPa046WxxICrSel3UlT6BSeNzuACz1j2FFCpp8PraHB9pTWbyWFX32f 9L2ptBeUshg9ndBWN09GYEXIdgqxIgaCZ9woHP/XLxCPtlVFSwVI8YVEq/fYDGuSv0sp ulJMruFKEri+ej/dfRrF9v/t7R2S9xy8e81YVg3P98ww76HdbRqHia6fwoKD5Uz29IlA 1qQ06rJUZe9Y4RBjj3JBMCy0SU7x/GUCkT4uVMroZggQ1DGWJ4KvmnZNO6BnJlFV3E0E 5tgGPhW+OlszjzDfNnTkE80p81QPlR/N4HL4mTqRtiTQd6o+O+vyBEZF66RkF/lUuJw8 Ojlg== 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; bh=+l+qFonj7f23vQK1lgbHd1m+mxJ9Bc4ZwbsX0TJ5N0A=; b=AfRSY+othBpx8ZjVv+vjF3+2BZ0+s/ZjAVqMibEqSB8gh8ZBKlG09HiMxxyVvhM0ng 9ady4SMl0InDk8PnGZ0vsXl1JRsfxU7yVHNX4r3o6RTxYNU5CxFmQWjTpZ0vEXg0QMtY BbC2rXniVUnVd3CtSSk1AtuAwzZ3x8pzLj23LUy+63u3kmcOy6Ro6RijcQk+P5PSZNt1 wtwxs3CJcYJdRgfJ7FamQcThnYwXucqxlySVHp2MJPyQZvLPnw/nJnJx2XOiB0VFRmRw 8Dxn0f6Pv68oVQsWLQ74PFXgzhjMRLqOSYBGPBiXY856KLQc1SvdxlAdFklp42Bn3Oep SD/w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@broadcom.com header.s=google header.b=CaS40LxD; 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; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=broadcom.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id t10si2024162otd.219.2020.02.21.10.28.18; Fri, 21 Feb 2020 10:28:32 -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; dkim=pass header.i=@broadcom.com header.s=google header.b=CaS40LxD; 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; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=broadcom.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729443AbgBUS2H (ORCPT + 99 others); Fri, 21 Feb 2020 13:28:07 -0500 Received: from mail-wm1-f67.google.com ([209.85.128.67]:55507 "EHLO mail-wm1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726066AbgBUS2G (ORCPT ); Fri, 21 Feb 2020 13:28:06 -0500 Received: by mail-wm1-f67.google.com with SMTP id q9so2755938wmj.5 for ; Fri, 21 Feb 2020 10:28:04 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=broadcom.com; s=google; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-transfer-encoding:content-language; bh=+l+qFonj7f23vQK1lgbHd1m+mxJ9Bc4ZwbsX0TJ5N0A=; b=CaS40LxDMt/ExdrwPwyWY3fN1LS8vl8hcd5kz/nwtaebYodzStTnGMe0zFCahsWxOn Um10s9pqVHZXW8yMsepx4FWtH05k5Ak6u7RP4eS6oEwSrKt3a2ZVWQ3T4h7jJypjmdL7 4qlT6Q0Df5pKVD1NMnB4+HRM0RyeUZ6TQkf5A= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding :content-language; bh=+l+qFonj7f23vQK1lgbHd1m+mxJ9Bc4ZwbsX0TJ5N0A=; b=mDM6OyV7kZuyU6chG2CpGqOBxBGKgjnJXzvZEBKaiJBgxLZUJE3fqoii+6bf0HDcX2 wszHdbrRALrVYMe+dvSq03YqLUMstSeVJLuCsG9Y/VDRNTiiusmVV7rhFsrfWa/7HYL8 96+W7ytQLOke4z5d50qldjWkzSMnLQd3xbbK9gJtNAZNdVZuly5M5AsyiiQr/sXKQgJA diimX/Zrp1J/9NnKBQUbMKdjkb9jLccUhHl6jyjI5HtWICKFOPxGVhXLyy1lXyzdKMM2 9kmMaHZl7gdHI7riExdZSjs/1CDpSgqHWwUIem7fSWG4IwjwrPTq6T8L32lukLR5DFsj P87Q== X-Gm-Message-State: APjAAAWQSv9TvCwgQ74j1tQGJBAzu90sggdLeVQwLkP3jKeJGInEK2N/ hE68q8JtroYCTt9Li7e/BjaeeQ== X-Received: by 2002:a7b:c216:: with SMTP id x22mr5287800wmi.51.1582309684109; Fri, 21 Feb 2020 10:28:04 -0800 (PST) Received: from [10.136.13.65] ([192.19.228.250]) by smtp.gmail.com with ESMTPSA id 18sm4953110wmf.1.2020.02.21.10.27.57 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 21 Feb 2020 10:28:02 -0800 (PST) Subject: Re: [PATCH v2 5/7] bcm-vk: add bcm_vk UAPI To: Arnd Bergmann 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 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> From: Scott Branden Message-ID: Date: Fri, 21 Feb 2020 10:27:56 -0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.4.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; 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 On 2020-02-21 12:34 a.m., Arnd Bergmann wrote: > 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. It doesn't utilize any media interfaces.  It is just an offload engine.  Really, it could be offloading anything. There is no infrastructure for other drivers in place that perform such transcoding operations. Perhaps I shouldn't mention it is doing video in this driver. > > Arnd