mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: kbuild test robot <lkp@intel.com>
To: Hans de Goede <hdegoede@redhat.com>
Cc: kbuild-all@01.org, Ard Biesheuvel <ard.biesheuvel@linaro.org>,
	"Luis R . Rodriguez" <mcgrof@kernel.org>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Thomas Gleixner <tglx@linutronix.de>,
	Ingo Molnar <mingo@redhat.com>, "H . Peter Anvin" <hpa@zytor.com>,
	Hans de Goede <hdegoede@redhat.com>,
	linux-kernel@vger.kernel.org, Peter Jones <pjones@redhat.com>,
	Dave Olsthoorn <dave@bewaar.me>,
	x86@kernel.org, linux-efi@vger.kernel.org
Subject: Re: [PATCH 2/2] efi: Add embedded peripheral firmware support
Date: Sun, 1 Apr 2018 08:19:28 +0800	[thread overview]
Message-ID: <201804010823.wf4PHVTJ%fengguang.wu@intel.com> (raw)
In-Reply-To: <20180331121944.8618-2-hdegoede@redhat.com>

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

Hi Hans,

I love your patch! Yet something to improve:

[auto build test ERROR on linus/master]
[also build test ERROR on v4.16-rc7]
[cannot apply to next-20180329]
[if your patch is applied to the wrong git tree, please drop us a note to help improve the system]

url:    https://github.com/0day-ci/linux/commits/Hans-de-Goede/efi-Export-boot-services-code-and-data-as-debugfs-blobs/20180401-062627
config: arm64-defconfig (attached as .config)
compiler: aarch64-linux-gnu-gcc (Debian 7.2.0-11) 7.2.0
reproduce:
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # save the attached .config to linux build tree
        make.cross ARCH=arm64 

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

   drivers/firmware/efi/embedded-firmware.c: In function 'efi_check_md_for_embedded_firmware':
>> drivers/firmware/efi/embedded-firmware.c:125:8: error: implicit declaration of function 'memremap'; did you mean 'memset_p'? [-Werror=implicit-function-declaration]
     mem = memremap(md->phys_addr, size, MEMREMAP_WB);
           ^~~~~~~~
           memset_p
>> drivers/firmware/efi/embedded-firmware.c:125:38: error: 'MEMREMAP_WB' undeclared (first use in this function)
     mem = memremap(md->phys_addr, size, MEMREMAP_WB);
                                         ^~~~~~~~~~~
   drivers/firmware/efi/embedded-firmware.c:125:38: note: each undeclared identifier is reported only once for each function it appears in
>> drivers/firmware/efi/embedded-firmware.c:142:2: error: implicit declaration of function 'memunmap'; did you mean 'memcmp'? [-Werror=implicit-function-declaration]
     memunmap(mem);
     ^~~~~~~~
     memcmp
   drivers/firmware/efi/embedded-firmware.c: In function 'efi_get_embedded_fw':
>> drivers/firmware/efi/embedded-firmware.c:222:9: error: implicit declaration of function 'vmalloc'; did you mean 'd_alloc'? [-Werror=implicit-function-declaration]
      buf = vmalloc(fw->length);
            ^~~~~~~
            d_alloc
>> drivers/firmware/efi/embedded-firmware.c:222:7: warning: assignment makes pointer from integer without a cast [-Wint-conversion]
      buf = vmalloc(fw->length);
          ^
   cc1: some warnings being treated as errors

vim +125 drivers/firmware/efi/embedded-firmware.c

   109	
   110	/*
   111	 * Note the efi_check_for_embedded_firmwares() code currently makes the
   112	 * following 2 assumptions. This may needs to be revisited if embedded firmware
   113	 * is found where this is not true:
   114	 * 1) The firmware is only found in EFI_BOOT_SERVICES_CODE memory segments
   115	 * 2) The firmware always starts at an offset which is a multiple of 8 bytes
   116	 */
   117	static int __init efi_check_md_for_embedded_firmware(
   118		efi_memory_desc_t *md, const struct embedded_fw_desc *desc)
   119	{
   120		u64 i, size;
   121		u32 crc;
   122		u8 *mem;
   123	
   124		size = md->num_pages << EFI_PAGE_SHIFT;
 > 125		mem = memremap(md->phys_addr, size, MEMREMAP_WB);
   126		if (!mem) {
   127			pr_err("Error mapping EFI mem at %#llx\n", md->phys_addr);
   128			return -ENOMEM;
   129		}
   130	
   131		size -= desc->length;
   132		for (i = 0; i < size; i += 8) {
   133			if (*((u64 *)(mem + i)) != *((u64 *)desc->prefix))
   134				continue;
   135	
   136			/* Seed with ~0, invert to match crc32 userspace utility */
   137			crc = ~crc32(~0, mem + i, desc->length);
   138			if (crc == desc->crc)
   139				break;
   140		}
   141	
 > 142		memunmap(mem);
   143	
   144		if (i >= size)
   145			return -ENOENT;
   146	
   147		pr_info("Found EFI embedded fw '%s' crc %08x\n", desc->name, desc->crc);
   148	
   149		if (found_fw_count >= MAX_EMBEDDED_FIRMWARES) {
   150			pr_err("Error already have %d embedded firmwares\n",
   151			       MAX_EMBEDDED_FIRMWARES);
   152			return -ENOSPC;
   153		}
   154	
   155		found_fw[found_fw_count].data =
   156			memremap(md->phys_addr + i, desc->length, MEMREMAP_WB);
   157		if (!found_fw[found_fw_count].data) {
   158			pr_err("Error mapping embedded firmware\n");
   159			return -ENOMEM;
   160		}
   161	
   162		found_fw[found_fw_count].name = desc->name;
   163		found_fw[found_fw_count].length = desc->length;
   164		found_fw_count++;
   165	
   166		/* Note md points to *unmapped* memory after this!!! */
   167		efi_mem_reserve(md->phys_addr + i, desc->length);
   168		return 0;
   169	}
   170	
   171	void __init efi_check_for_embedded_firmwares(void)
   172	{
   173		const struct embedded_fw_desc *fw_desc;
   174		const struct dmi_system_id *dmi_id;
   175		efi_memory_desc_t *md;
   176		int i, r;
   177	
   178		dmi_id = dmi_first_match(embedded_fw_table);
   179		if (!dmi_id)
   180			return;
   181	
   182		fw_desc = dmi_id->driver_data;
   183		for (i = 0; fw_desc[i].length; i++) {
   184			for_each_efi_memory_desc(md) {
   185				if (md->type != EFI_BOOT_SERVICES_CODE)
   186					continue;
   187	
   188				r = efi_check_md_for_embedded_firmware(md, &fw_desc[i]);
   189				if (r == 0) {
   190					/*
   191					 * On success efi_mem_reserve() has been called
   192					 * installing a new memmap, so our pointers
   193					 * are invalid now and we MUST break the loop.
   194					 */
   195					break;
   196				}
   197			}
   198		}
   199	}
   200	
   201	int efi_get_embedded_fw(const char *name, void **data, size_t *size,
   202				size_t msize)
   203	{
   204		struct embedded_fw *fw = NULL;
   205		void *buf = *data;
   206		int i;
   207	
   208		for (i = 0; i < found_fw_count; i++) {
   209			if (strcmp(name, found_fw[i].name) == 0) {
   210				fw = &found_fw[i];
   211				break;
   212			}
   213		}
   214	
   215		if (!fw)
   216			return -ENOENT;
   217	
   218		if (msize && msize < fw->length)
   219			return -EFBIG;
   220	
   221		if (!buf) {
 > 222			buf = vmalloc(fw->length);

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

[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 37834 bytes --]

  reply	other threads:[~2018-04-01  0:19 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-03-31 12:19 [PATCH 1/2] efi: Export boot-services code and data as debugfs-blobs Hans de Goede
2018-03-31 12:19 ` [PATCH 2/2] efi: Add embedded peripheral firmware support Hans de Goede
2018-04-01  0:19   ` kbuild test robot [this message]
2018-04-01  0:22   ` kbuild test robot
2018-04-02 23:23   ` Luis R. Rodriguez
2018-04-03  8:33     ` Hans de Goede
2018-04-03 18:07       ` Lukas Wunner
2018-04-03 18:58         ` Luis R. Rodriguez
2018-04-04 17:18           ` Peter Jones
2018-04-04 20:25             ` Hans de Goede
2018-04-05  0:28               ` Ard Biesheuvel
2018-04-05  5:43             ` Lukas Wunner
2018-04-06 14:08               ` Luis R. Rodriguez
2018-04-06 14:14                 ` Ard Biesheuvel
2018-04-06 14:28                   ` Ard Biesheuvel
2018-04-07  9:51                 ` Lukas Wunner
2018-04-07 11:13                 ` Hans de Goede
2018-04-06 14:16               ` Peter Jones
2018-04-03 18:47       ` Luis R. Rodriguez
2018-04-05 13:54         ` Hans de Goede
2018-04-03 19:53   ` Peter Jones
2018-04-05 11:51     ` Hans de Goede
2018-03-31 14:10 ` [PATCH 1/2] efi: Export boot-services code and data as debugfs-blobs Greg Kroah-Hartman
2018-03-31 16:57   ` Hans de Goede
2018-04-01  0:12 ` kbuild test robot
2018-04-01  0:12 ` [RFC PATCH] efi: debugfs_blob[] can be static kbuild test robot

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=201804010823.wf4PHVTJ%fengguang.wu@intel.com \
    --to=lkp@intel.com \
    --cc=ard.biesheuvel@linaro.org \
    --cc=dave@bewaar.me \
    --cc=gregkh@linuxfoundation.org \
    --cc=hdegoede@redhat.com \
    --cc=hpa@zytor.com \
    --cc=kbuild-all@01.org \
    --cc=linux-efi@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mcgrof@kernel.org \
    --cc=mingo@redhat.com \
    --cc=pjones@redhat.com \
    --cc=tglx@linutronix.de \
    --cc=x86@kernel.org \
    /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

Powered by JetHome