Linux Media Controller development
 help / color / mirror / Atom feed
From: kbuild test robot <lkp@intel.com>
To: Benjamin Gaignard <benjamin.gaignard@linaro.org>
Cc: kbuild-all@01.org, linux-media@vger.kernel.org,
	linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org,
	daniel.vetter@ffwll.ch, robdclark@gmail.com, treding@nvidia.com,
	sumit.semwal@linaro.org, tom.cooksey@arm.com,
	daniel.stone@collabora.com,
	linux-security-module@vger.kernel.org,
	xiaoquan.li@vivantecorp.com, tom.gall@linaro.org,
	linaro-mm-sig@lists.linaro.org,
	Benjamin Gaignard <benjamin.gaignard@linaro.org>
Subject: Re: [PATCH v4 1/2] create SMAF module
Date: Tue, 6 Oct 2015 06:02:32 +0800	[thread overview]
Message-ID: <201510060648.96DHLHGg%fengguang.wu@intel.com> (raw)
In-Reply-To: <1444039898-7927-2-git-send-email-benjamin.gaignard@linaro.org>

[-- Attachment #1: Type: text/plain, Size: 5016 bytes --]

Hi Benjamin,

[auto build test ERROR on v4.3-rc4 -- if it's inappropriate base, please ignore]

config: s390-allmodconfig (attached as .config)
reproduce:
        wget https://git.kernel.org/cgit/linux/kernel/git/wfg/lkp-tests.git/plain/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # save the attached .config to linux build tree
        make.cross ARCH=s390 

All error/warnings (new ones prefixed by >>):

   In file included from arch/s390/include/asm/elf.h:130:0,
                    from include/linux/elf.h:4,
                    from include/linux/module.h:15,
                    from drivers/smaf/smaf-core.c:16:
   drivers/smaf/smaf-core.c: In function 'smaf_unsecure_handle':
>> arch/s390/include/asm/mmu_context.h:33:41: error: expected identifier before 'do'
    #define destroy_context(mm)             do { } while (0)
                                            ^
>> drivers/smaf/smaf-core.c:136:23: note: in expansion of macro 'destroy_context'
     if (smaf_dev.secure->destroy_context(handle->secure_ctx))
                          ^

vim +/destroy_context +136 drivers/smaf/smaf-core.c

    10	#include <linux/dma-buf.h>
    11	#include <linux/dma-mapping.h>
    12	#include <linux/fs.h>
    13	#include <linux/ioctl.h>
    14	#include <linux/list_sort.h>
    15	#include <linux/miscdevice.h>
  > 16	#include <linux/module.h>
    17	#include <linux/slab.h>
    18	#include <linux/smaf.h>
    19	#include <linux/smaf-allocator.h>
    20	#include <linux/smaf-secure.h>
    21	#include <linux/uaccess.h>
    22	
    23	struct smaf_handle {
    24		struct dma_buf *dmabuf;
    25		struct smaf_allocator *allocator;
    26		struct dma_buf *db_alloc;
    27		size_t length;
    28		unsigned int flags;
    29		int fd;
    30		bool is_secure;
    31		void *secure_ctx;
    32	};
    33	
    34	/**
    35	 * struct smaf_device - smaf device node private data
    36	 * @misc_dev:	the misc device
    37	 * @head:	list of allocator
    38	 * @lock:	list and secure pointer mutex
    39	 * @secure:	pointer to secure functions helpers
    40	 */
    41	struct smaf_device {
    42		struct miscdevice misc_dev;
    43		struct list_head head;
    44		/* list and secure pointer lock*/
    45		struct mutex lock;
    46		struct smaf_secure *secure;
    47	};
    48	
    49	static struct smaf_device smaf_dev;
    50	
    51	/**
    52	 * smaf_allow_cpu_access return true if CPU can access to memory
    53	 * if their is no secure module associated to SMAF assume that CPU can get
    54	 * access to the memory.
    55	 */
    56	static bool smaf_allow_cpu_access(struct smaf_handle *handle,
    57					  unsigned long flags)
    58	{
    59		if (!handle->is_secure)
    60			return true;
    61	
    62		if (!smaf_dev.secure)
    63			return true;
    64	
    65		if (!smaf_dev.secure->allow_cpu_access)
    66			return true;
    67	
    68		return smaf_dev.secure->allow_cpu_access(handle->secure_ctx, flags);
    69	}
    70	
    71	static int smaf_grant_access(struct smaf_handle *handle, struct device *dev,
    72				     dma_addr_t addr, size_t size,
    73				     enum dma_data_direction dir)
    74	{
    75		if (!handle->is_secure)
    76			return 0;
    77	
    78		if (!smaf_dev.secure)
    79			return -EINVAL;
    80	
    81		if (!smaf_dev.secure->grant_access)
    82			return -EINVAL;
    83	
    84		return smaf_dev.secure->grant_access(handle->secure_ctx,
    85						     dev, addr, size, dir);
    86	}
    87	
    88	static void smaf_revoke_access(struct smaf_handle *handle, struct device *dev,
    89				       dma_addr_t addr, size_t size,
    90				       enum dma_data_direction dir)
    91	{
    92		if (!handle->is_secure)
    93			return;
    94	
    95		if (!smaf_dev.secure)
    96			return;
    97	
    98		if (!smaf_dev.secure->revoke_access)
    99			return;
   100	
   101		smaf_dev.secure->revoke_access(handle->secure_ctx,
   102					       dev, addr, size, dir);
   103	}
   104	
   105	static int smaf_secure_handle(struct smaf_handle *handle)
   106	{
   107		if (handle->is_secure)
   108			return 0;
   109	
   110		if (!smaf_dev.secure)
   111			return -EINVAL;
   112	
   113		if (!smaf_dev.secure->create_context)
   114			return -EINVAL;
   115	
   116		handle->secure_ctx = smaf_dev.secure->create_context();
   117	
   118		if (!handle->secure_ctx)
   119			return -EINVAL;
   120	
   121		handle->is_secure = true;
   122		return 0;
   123	}
   124	
   125	static int smaf_unsecure_handle(struct smaf_handle *handle)
   126	{
   127		if (!handle->is_secure)
   128			return 0;
   129	
   130		if (!smaf_dev.secure)
   131			return -EINVAL;
   132	
   133		if (!smaf_dev.secure->destroy_context)
   134			return -EINVAL;
   135	
 > 136		if (smaf_dev.secure->destroy_context(handle->secure_ctx))
   137			return -EINVAL;
   138	
   139		handle->secure_ctx = NULL;

---
0-DAY kernel test infrastructure                Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all                   Intel Corporation

[-- Attachment #2: .config.gz --]
[-- Type: application/octet-stream, Size: 38491 bytes --]

  reply	other threads:[~2015-10-05 22:03 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-10-05 10:11 [PATCH v4 0/2] RFC: Secure Memory Allocation Framework Benjamin Gaignard
2015-10-05 10:11 ` [PATCH v4 1/2] create SMAF module Benjamin Gaignard
2015-10-05 22:02   ` kbuild test robot [this message]
2015-10-06  1:58   ` Laura Abbott
2015-10-06  8:56     ` Benjamin Gaignard
2015-10-05 10:11 ` [PATCH v4 2/2] SMAF: add CMA allocator Benjamin Gaignard
2015-10-05 10:50   ` [RFC PATCH] SMAF: smaf_cma can be static kbuild test robot
2015-10-05 10:50   ` [PATCH v4 2/2] SMAF: add CMA allocator kbuild test robot
2015-10-05 11:50   ` kbuild test robot
2015-10-06  2:07 ` [PATCH v4 0/2] RFC: Secure Memory Allocation Framework Laura Abbott
2015-10-06  7:03   ` Benjamin Gaignard

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=201510060648.96DHLHGg%fengguang.wu@intel.com \
    --to=lkp@intel.com \
    --cc=benjamin.gaignard@linaro.org \
    --cc=daniel.stone@collabora.com \
    --cc=daniel.vetter@ffwll.ch \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=kbuild-all@01.org \
    --cc=linaro-mm-sig@lists.linaro.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-media@vger.kernel.org \
    --cc=linux-security-module@vger.kernel.org \
    --cc=robdclark@gmail.com \
    --cc=sumit.semwal@linaro.org \
    --cc=tom.cooksey@arm.com \
    --cc=tom.gall@linaro.org \
    --cc=treding@nvidia.com \
    --cc=xiaoquan.li@vivantecorp.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox