Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp2144746ybl; Thu, 15 Aug 2019 07:14:51 -0700 (PDT) X-Google-Smtp-Source: APXvYqz6zTgHZnt3F7tRTRx3Z8Y0U492C8hNM56idCjH/ZlgBv3bFDYmp1P6WDjk7wlPOR6whnHt X-Received: by 2002:a17:90a:c086:: with SMTP id o6mr2526403pjs.2.1565878491636; Thu, 15 Aug 2019 07:14:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1565878491; cv=none; d=google.com; s=arc-20160816; b=XNb77jTL7lQh/lCcxGG/PtlS+5ZEbLQwZam1B69CQpAqDl/eFDAonrAJXoSjmfVUU0 XhD//D6zxHmcPiIW/U7C+Z2o2ZA9uql3zIsntDjWEBtq7FZrr7jeu9ltb2RZywqsO0EK I2FjE0QUuDAbZH44zzuZoKWszZ9n42zJ6/cGAhUqvNWoEgzEUrhc/ow846RfJkkwh0av eDlA7+qfsnp2dY6/dz3sGYtBzaAi+EwP+3puIPld4S+XgxoTyeyZuvsgf3PvQBzP+1fB l1eA7HmNpU/2mUh8x7dVeAXJFt7uhcjG5tNo8BA+RqX5vQQB2lOA7PKpP9Xzzg/rvjCL hVxw== 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-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=ifnSp5XXX8dgpGEsVJ4gyR3yXUNYTkNO+h+Hvvvbteo=; b=aW0zlb5hJSbZmiZLxPjgSxoWCcJ7htDdAEuDBfbuVCpYJrk0zoMYG0o+Ax1Y/XhO1Q 6BBnFMNUOBxT0Fs3PuWWsl+kZhLDynNKAdVJhplQHOntCcRRqhw/L6q+6TgMwDTH0068 JKQlEiYcZ9bePVUYTCPtmDOqb+bZNpDoQLlsGXFe3D9ieJlDzL//ib9XU/ppQT7ptqPG 4OolDzkue/7JhgcJCOmoKMjz9QE3sWpaFCMI0rHp8DaSEkQpE3hCTXYUqDrFiiFMzokW gGq7wT7PQJjUlInvQsTNaEWwOIHflEag4+thTKFuYvg9atONe1/btU+ui20AdPOE4Luy 9zmQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=v74QQEyp; 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 z20si2011917plo.159.2019.08.15.07.14.35; Thu, 15 Aug 2019 07:14:51 -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=v74QQEyp; 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 S1732818AbfHOOM2 (ORCPT + 99 others); Thu, 15 Aug 2019 10:12:28 -0400 Received: from mail.kernel.org ([198.145.29.99]:51280 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730032AbfHOOM2 (ORCPT ); Thu, 15 Aug 2019 10:12:28 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (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 ECD30206C2; Thu, 15 Aug 2019 14:12:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1565878347; bh=bVo1vM/u9VfDp0fe1xQNLJisI/L3cW+wefdHvp3omfI=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=v74QQEyp1kd/cBRhv3XVRRHs0/beJQVEF3URg6texKvNTDjx0aMl0FYcHyG1WRDJJ fdMVg0lJbOdZEArA6Pp7XFRqQ5p4lWAsa5AFh1iYc2WMA+5D4vvaUFBaG41VizPoMC vHEXVix2+MdDH59pepswh+ZWZl+MSWd12zdFSBIc= Date: Thu, 15 Aug 2019 16:12:25 +0200 From: Greg Kroah-Hartman To: Zhangfei Gao 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: <20190815141225.GC23267@kroah.com> References: <1565775265-21212-1-git-send-email-zhangfei.gao@linaro.org> <1565775265-21212-3-git-send-email-zhangfei.gao@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1565775265-21212-3-git-send-email-zhangfei.gao@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 Wed, Aug 14, 2019 at 05:34:25PM +0800, Zhangfei Gao wrote: > diff --git a/include/uapi/misc/uacce.h b/include/uapi/misc/uacce.h > new file mode 100644 > index 0000000..44a0a5d > --- /dev/null > +++ b/include/uapi/misc/uacce.h > @@ -0,0 +1,44 @@ > +/* SPDX-License-Identifier: GPL-2.0-or-later */ > +#ifndef _UAPIUUACCE_H > +#define _UAPIUUACCE_H > + > +#include > +#include > + > +#define UACCE_CLASS_NAME "uacce" Why is this in a uapi file? > +#define UACCE_DEV_ATTRS "attrs" Same here. > +#define UACCE_CMD_SHARE_SVAS _IO('W', 0) > +#define UACCE_CMD_START _IO('W', 1) > +#define UACCE_CMD_GET_SS_DMA _IOR('W', 2, unsigned long) > + > +/** > + * UACCE Device Attributes: > + * > + * NOIOMMU: the device has no IOMMU support > + * can do share sva, but no map to the dev > + * PASID: the device has IOMMU which support PASID setting > + * can do share sva, mapped to dev per process > + * FAULT_FROM_DEV: the device has IOMMU which can do page fault request > + * no need for share sva, should be used with PASID > + * SVA: full function device > + * SHARE_DOMAIN: no PASID, can do share sva only for one process and the kernel > + */ > +#define UACCE_DEV_NOIOMMU (1 << 0) > +#define UACCE_DEV_PASID (1 << 1) > +#define UACCE_DEV_FAULT_FROM_DEV (1 << 2) > +#define UACCE_DEV_SVA (UACCE_DEV_PASID | UACCE_DEV_FAULT_FROM_DEV) > +#define UACCE_DEV_SHARE_DOMAIN (0) > + > +#define UACCE_API_VER_NOIOMMU_SUBFIX "_noiommu" > + > +#define UACCE_QFR_NA ((unsigned long)-1) > +enum uacce_qfrt { > + UACCE_QFRT_MMIO = 0, /* device mmio region */ > + UACCE_QFRT_DKO, /* device kernel-only */ > + UACCE_QFRT_DUS, /* device user share */ > + UACCE_QFRT_SS, /* static share memory */ > + UACCE_QFRT_MAX, These enums need to be explicitly set, as per the documentation, otherwise they could be messed up when dealing with odd compilers. > +}; > +#define UACCE_QFRT_INVALID UACCE_QFRT_MAX Why not just use INVALID instead of MAX? thanks, greg k-h