Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp4312322ybl; Tue, 20 Aug 2019 10:01:01 -0700 (PDT) X-Google-Smtp-Source: APXvYqynBBGEAg1v29NX1hhTQdrhFjN/K+NgMAvVR7bBvUM0hETuxCZw7kAhdvhrmi3/MDrcbWXH X-Received: by 2002:a17:902:6b88:: with SMTP id p8mr28250780plk.95.1566320461406; Tue, 20 Aug 2019 10:01:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1566320461; cv=none; d=google.com; s=arc-20160816; b=FSmVyO0iq0UNL8d6xKFBjpFq5qe4qEt9EwYXacdbVw+MeoN/OYqdm03N4RH+tgILfL n4NZnikMcj3YXiSuy7M4AH7HXSjyQgMTkg9YygAxCHWicnUDAsKQixtmxX2w0Ps834J3 jjn6hrVuPN7aY4SA2eJ+wP4mzXS2EYHaTiIMAvfnMhDZi3qkmV54f8N0l6WJDndrKtvB Qvb0AbAVYCsDhzdPQ774i4ftN3qI3RJru3lMnD1cMdEY6xuCv2kJlXWyIHzmak+7pNlu Y8V78czlloqXK25wyn/ba28UCk/15Y4JPzD67apDcXnRIGMFASYubcCI8uJiiRd1uBIr 6jWw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-transfer-encoding:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=7jxpqM/PXbIciPxIUhpHKkeW4u+puzp5NGBzCuVFkvE=; b=dCHqoSEHZ7DKW3gAuZ4mR6lg30w4CTHZUTduw1Y+A2+hX5UKbCUEed8xFDJzXKbvt4 R0tgjm81NoCHmZ/+xLU4ZyTfwrEgSo6dI7ATMtrRHi6LJ8sMlzR4fHhdCh7TaJg92gXY Dzx2e5kCGemCe8rXwqms1GpO5ohDk2OVzYPq6T9jnxxgyYwqGgnLPJfEdehjMHnzgcXn EMT3sLeXnQp3BsEbZSJpAuaJHMeLIehFIvrwjEfsfQMC1zx9awTj0oM9U4jrvx6SvFbS GQjslzP5lz4Ve2rRqu2B7GZsaoG0cml9VVN8GlNFn6pdv437Nt+KTgXPo5I5ufEbMf4X Jfgg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=nVh96cBm; 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 o18si12286775pgv.494.2019.08.20.10.00.45; Tue, 20 Aug 2019 10:01:01 -0700 (PDT) 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=@kernel.org header.s=default header.b=nVh96cBm; 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 S1730319AbfHTQ7s (ORCPT + 99 others); Tue, 20 Aug 2019 12:59:48 -0400 Received: from mail.kernel.org ([198.145.29.99]:39444 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726981AbfHTQ7s (ORCPT ); Tue, 20 Aug 2019 12:59:48 -0400 Received: from localhost (wsip-184-188-36-2.sd.sd.cox.net [184.188.36.2]) (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 B216A230F2; Tue, 20 Aug 2019 16:59:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1566320387; bh=ik14s5ncZPpawrYkN/QPJAA/kazm4JWFagMR3npL3hs=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=nVh96cBmW+tGmEb8bxsgXsaSScx3Asg+kpT9Vi7Qrrx2ZEQqBizZiMZEsr0+8tGDO PfiwpnrM1CtgUmD4KX1fIEgrQl5JLyUHd3KwXC3MsJsD59hL0D/bkTzRxWIJ349SEY WH759tWdk1iftouLk+OGPZtEi+GduwMzDdUnucP8= Date: Tue, 20 Aug 2019 09:59:47 -0700 From: Greg Kroah-Hartman To: zhangfei Cc: Arnd Bergmann , linux-accelerators@lists.ozlabs.org, linux-kernel@vger.kernel.org, Kenneth Lee , Zaibo Xu , Zhou Wang Subject: Re: [PATCH 2/2] uacce: add uacce module Message-ID: <20190820165947.GC3736@kroah.com> References: <1565775265-21212-1-git-send-email-zhangfei.gao@linaro.org> <1565775265-21212-3-git-send-email-zhangfei.gao@linaro.org> <20190815141351.GD23267@kroah.com> <6daab785-a8f9-684e-eb71-7a81604d3bb0@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <6daab785-a8f9-684e-eb71-7a81604d3bb0@linaro.org> User-Agent: Mutt/1.12.1 (2019-06-15) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Aug 20, 2019 at 09:08:55PM +0800, zhangfei wrote: > > > On 2019/8/15 下午10:13, Greg Kroah-Hartman wrote: > > On Wed, Aug 14, 2019 at 05:34:25PM +0800, Zhangfei Gao wrote: > > > +int uacce_register(struct uacce *uacce) > > > +{ > > > + int ret; > > > + > > > + if (!uacce->pdev) { > > > + pr_debug("uacce parent device not set\n"); > > > + return -ENODEV; > > > + } > > > + > > > + if (uacce->flags & UACCE_DEV_NOIOMMU) { > > > + add_taint(TAINT_CRAP, LOCKDEP_STILL_OK); > > > + dev_warn(uacce->pdev, > > > + "Register to noiommu mode, which export kernel data to user space and may vulnerable to attack"); > > > + } > > THat is odd, why even offer this feature then if it is a major issue? > UACCE_DEV_NOIOMMU maybe confusing here. > > In this mode, app use ioctl to get dma_handle from dma_alloc_coherent. That's odd, why not use the other default apis to do that? > It does not matter iommu is enabled or not. > In case iommu is disabled, it maybe dangerous to kernel, so we added warning here, is it required? You should use the other documentated apis for this, don't create your own. thanks, greg k-h