quirks.c 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654
  1. #define pr_fmt(fmt) "efi: " fmt
  2. #include <linux/init.h>
  3. #include <linux/kernel.h>
  4. #include <linux/string.h>
  5. #include <linux/time.h>
  6. #include <linux/types.h>
  7. #include <linux/efi.h>
  8. #include <linux/slab.h>
  9. #include <linux/memblock.h>
  10. #include <linux/bootmem.h>
  11. #include <linux/acpi.h>
  12. #include <linux/dmi.h>
  13. #include <asm/e820/api.h>
  14. #include <asm/efi.h>
  15. #include <asm/uv/uv.h>
  16. #include <asm/cpu_device_id.h>
  17. #define EFI_MIN_RESERVE 5120
  18. #define EFI_DUMMY_GUID \
  19. EFI_GUID(0x4424ac57, 0xbe4b, 0x47dd, 0x9e, 0x97, 0xed, 0x50, 0xf0, 0x9f, 0x92, 0xa9)
  20. #define QUARK_CSH_SIGNATURE 0x5f435348 /* _CSH */
  21. #define QUARK_SECURITY_HEADER_SIZE 0x400
  22. /*
  23. * Header prepended to the standard EFI capsule on Quark systems the are based
  24. * on Intel firmware BSP.
  25. * @csh_signature: Unique identifier to sanity check signed module
  26. * presence ("_CSH").
  27. * @version: Current version of CSH used. Should be one for Quark A0.
  28. * @modulesize: Size of the entire module including the module header
  29. * and payload.
  30. * @security_version_number_index: Index of SVN to use for validation of signed
  31. * module.
  32. * @security_version_number: Used to prevent against roll back of modules.
  33. * @rsvd_module_id: Currently unused for Clanton (Quark).
  34. * @rsvd_module_vendor: Vendor Identifier. For Intel products value is
  35. * 0x00008086.
  36. * @rsvd_date: BCD representation of build date as yyyymmdd, where
  37. * yyyy=4 digit year, mm=1-12, dd=1-31.
  38. * @headersize: Total length of the header including including any
  39. * padding optionally added by the signing tool.
  40. * @hash_algo: What Hash is used in the module signing.
  41. * @cryp_algo: What Crypto is used in the module signing.
  42. * @keysize: Total length of the key data including including any
  43. * padding optionally added by the signing tool.
  44. * @signaturesize: Total length of the signature including including any
  45. * padding optionally added by the signing tool.
  46. * @rsvd_next_header: 32-bit pointer to the next Secure Boot Module in the
  47. * chain, if there is a next header.
  48. * @rsvd: Reserved, padding structure to required size.
  49. *
  50. * See also QuartSecurityHeader_t in
  51. * Quark_EDKII_v1.2.1.1/QuarkPlatformPkg/Include/QuarkBootRom.h
  52. * from https://downloadcenter.intel.com/download/23197/Intel-Quark-SoC-X1000-Board-Support-Package-BSP
  53. */
  54. struct quark_security_header {
  55. u32 csh_signature;
  56. u32 version;
  57. u32 modulesize;
  58. u32 security_version_number_index;
  59. u32 security_version_number;
  60. u32 rsvd_module_id;
  61. u32 rsvd_module_vendor;
  62. u32 rsvd_date;
  63. u32 headersize;
  64. u32 hash_algo;
  65. u32 cryp_algo;
  66. u32 keysize;
  67. u32 signaturesize;
  68. u32 rsvd_next_header;
  69. u32 rsvd[2];
  70. };
  71. static efi_char16_t efi_dummy_name[6] = { 'D', 'U', 'M', 'M', 'Y', 0 };
  72. static bool efi_no_storage_paranoia;
  73. /*
  74. * Some firmware implementations refuse to boot if there's insufficient
  75. * space in the variable store. The implementation of garbage collection
  76. * in some FW versions causes stale (deleted) variables to take up space
  77. * longer than intended and space is only freed once the store becomes
  78. * almost completely full.
  79. *
  80. * Enabling this option disables the space checks in
  81. * efi_query_variable_store() and forces garbage collection.
  82. *
  83. * Only enable this option if deleting EFI variables does not free up
  84. * space in your variable store, e.g. if despite deleting variables
  85. * you're unable to create new ones.
  86. */
  87. static int __init setup_storage_paranoia(char *arg)
  88. {
  89. efi_no_storage_paranoia = true;
  90. return 0;
  91. }
  92. early_param("efi_no_storage_paranoia", setup_storage_paranoia);
  93. /*
  94. * Deleting the dummy variable which kicks off garbage collection
  95. */
  96. void efi_delete_dummy_variable(void)
  97. {
  98. efi.set_variable(efi_dummy_name, &EFI_DUMMY_GUID,
  99. EFI_VARIABLE_NON_VOLATILE |
  100. EFI_VARIABLE_BOOTSERVICE_ACCESS |
  101. EFI_VARIABLE_RUNTIME_ACCESS,
  102. 0, NULL);
  103. }
  104. /*
  105. * In the nonblocking case we do not attempt to perform garbage
  106. * collection if we do not have enough free space. Rather, we do the
  107. * bare minimum check and give up immediately if the available space
  108. * is below EFI_MIN_RESERVE.
  109. *
  110. * This function is intended to be small and simple because it is
  111. * invoked from crash handler paths.
  112. */
  113. static efi_status_t
  114. query_variable_store_nonblocking(u32 attributes, unsigned long size)
  115. {
  116. efi_status_t status;
  117. u64 storage_size, remaining_size, max_size;
  118. status = efi.query_variable_info_nonblocking(attributes, &storage_size,
  119. &remaining_size,
  120. &max_size);
  121. if (status != EFI_SUCCESS)
  122. return status;
  123. if (remaining_size - size < EFI_MIN_RESERVE)
  124. return EFI_OUT_OF_RESOURCES;
  125. return EFI_SUCCESS;
  126. }
  127. /*
  128. * Some firmware implementations refuse to boot if there's insufficient space
  129. * in the variable store. Ensure that we never use more than a safe limit.
  130. *
  131. * Return EFI_SUCCESS if it is safe to write 'size' bytes to the variable
  132. * store.
  133. */
  134. efi_status_t efi_query_variable_store(u32 attributes, unsigned long size,
  135. bool nonblocking)
  136. {
  137. efi_status_t status;
  138. u64 storage_size, remaining_size, max_size;
  139. if (!(attributes & EFI_VARIABLE_NON_VOLATILE))
  140. return 0;
  141. if (nonblocking)
  142. return query_variable_store_nonblocking(attributes, size);
  143. status = efi.query_variable_info(attributes, &storage_size,
  144. &remaining_size, &max_size);
  145. if (status != EFI_SUCCESS)
  146. return status;
  147. /*
  148. * We account for that by refusing the write if permitting it would
  149. * reduce the available space to under 5KB. This figure was provided by
  150. * Samsung, so should be safe.
  151. */
  152. if ((remaining_size - size < EFI_MIN_RESERVE) &&
  153. !efi_no_storage_paranoia) {
  154. /*
  155. * Triggering garbage collection may require that the firmware
  156. * generate a real EFI_OUT_OF_RESOURCES error. We can force
  157. * that by attempting to use more space than is available.
  158. */
  159. unsigned long dummy_size = remaining_size + 1024;
  160. void *dummy = kzalloc(dummy_size, GFP_ATOMIC);
  161. if (!dummy)
  162. return EFI_OUT_OF_RESOURCES;
  163. status = efi.set_variable(efi_dummy_name, &EFI_DUMMY_GUID,
  164. EFI_VARIABLE_NON_VOLATILE |
  165. EFI_VARIABLE_BOOTSERVICE_ACCESS |
  166. EFI_VARIABLE_RUNTIME_ACCESS,
  167. dummy_size, dummy);
  168. if (status == EFI_SUCCESS) {
  169. /*
  170. * This should have failed, so if it didn't make sure
  171. * that we delete it...
  172. */
  173. efi_delete_dummy_variable();
  174. }
  175. kfree(dummy);
  176. /*
  177. * The runtime code may now have triggered a garbage collection
  178. * run, so check the variable info again
  179. */
  180. status = efi.query_variable_info(attributes, &storage_size,
  181. &remaining_size, &max_size);
  182. if (status != EFI_SUCCESS)
  183. return status;
  184. /*
  185. * There still isn't enough room, so return an error
  186. */
  187. if (remaining_size - size < EFI_MIN_RESERVE)
  188. return EFI_OUT_OF_RESOURCES;
  189. }
  190. return EFI_SUCCESS;
  191. }
  192. EXPORT_SYMBOL_GPL(efi_query_variable_store);
  193. /*
  194. * The UEFI specification makes it clear that the operating system is
  195. * free to do whatever it wants with boot services code after
  196. * ExitBootServices() has been called. Ignoring this recommendation a
  197. * significant bunch of EFI implementations continue calling into boot
  198. * services code (SetVirtualAddressMap). In order to work around such
  199. * buggy implementations we reserve boot services region during EFI
  200. * init and make sure it stays executable. Then, after
  201. * SetVirtualAddressMap(), it is discarded.
  202. *
  203. * However, some boot services regions contain data that is required
  204. * by drivers, so we need to track which memory ranges can never be
  205. * freed. This is done by tagging those regions with the
  206. * EFI_MEMORY_RUNTIME attribute.
  207. *
  208. * Any driver that wants to mark a region as reserved must use
  209. * efi_mem_reserve() which will insert a new EFI memory descriptor
  210. * into efi.memmap (splitting existing regions if necessary) and tag
  211. * it with EFI_MEMORY_RUNTIME.
  212. */
  213. void __init efi_arch_mem_reserve(phys_addr_t addr, u64 size)
  214. {
  215. phys_addr_t new_phys, new_size;
  216. struct efi_mem_range mr;
  217. efi_memory_desc_t md;
  218. int num_entries;
  219. void *new;
  220. if (efi_mem_desc_lookup(addr, &md)) {
  221. pr_err("Failed to lookup EFI memory descriptor for %pa\n", &addr);
  222. return;
  223. }
  224. if (addr + size > md.phys_addr + (md.num_pages << EFI_PAGE_SHIFT)) {
  225. pr_err("Region spans EFI memory descriptors, %pa\n", &addr);
  226. return;
  227. }
  228. /* No need to reserve regions that will never be freed. */
  229. if (md.attribute & EFI_MEMORY_RUNTIME)
  230. return;
  231. size += addr % EFI_PAGE_SIZE;
  232. size = round_up(size, EFI_PAGE_SIZE);
  233. addr = round_down(addr, EFI_PAGE_SIZE);
  234. mr.range.start = addr;
  235. mr.range.end = addr + size - 1;
  236. mr.attribute = md.attribute | EFI_MEMORY_RUNTIME;
  237. num_entries = efi_memmap_split_count(&md, &mr.range);
  238. num_entries += efi.memmap.nr_map;
  239. new_size = efi.memmap.desc_size * num_entries;
  240. new_phys = efi_memmap_alloc(num_entries);
  241. if (!new_phys) {
  242. pr_err("Could not allocate boot services memmap\n");
  243. return;
  244. }
  245. new = early_memremap(new_phys, new_size);
  246. if (!new) {
  247. pr_err("Failed to map new boot services memmap\n");
  248. return;
  249. }
  250. efi_memmap_insert(&efi.memmap, new, &mr);
  251. early_memunmap(new, new_size);
  252. efi_memmap_install(new_phys, num_entries);
  253. }
  254. /*
  255. * Helper function for efi_reserve_boot_services() to figure out if we
  256. * can free regions in efi_free_boot_services().
  257. *
  258. * Use this function to ensure we do not free regions owned by somebody
  259. * else. We must only reserve (and then free) regions:
  260. *
  261. * - Not within any part of the kernel
  262. * - Not the BIOS reserved area (E820_TYPE_RESERVED, E820_TYPE_NVS, etc)
  263. */
  264. static bool can_free_region(u64 start, u64 size)
  265. {
  266. if (start + size > __pa_symbol(_text) && start <= __pa_symbol(_end))
  267. return false;
  268. if (!e820__mapped_all(start, start+size, E820_TYPE_RAM))
  269. return false;
  270. return true;
  271. }
  272. void __init efi_reserve_boot_services(void)
  273. {
  274. efi_memory_desc_t *md;
  275. for_each_efi_memory_desc(md) {
  276. u64 start = md->phys_addr;
  277. u64 size = md->num_pages << EFI_PAGE_SHIFT;
  278. bool already_reserved;
  279. if (md->type != EFI_BOOT_SERVICES_CODE &&
  280. md->type != EFI_BOOT_SERVICES_DATA)
  281. continue;
  282. already_reserved = memblock_is_region_reserved(start, size);
  283. /*
  284. * Because the following memblock_reserve() is paired
  285. * with free_bootmem_late() for this region in
  286. * efi_free_boot_services(), we must be extremely
  287. * careful not to reserve, and subsequently free,
  288. * critical regions of memory (like the kernel image) or
  289. * those regions that somebody else has already
  290. * reserved.
  291. *
  292. * A good example of a critical region that must not be
  293. * freed is page zero (first 4Kb of memory), which may
  294. * contain boot services code/data but is marked
  295. * E820_TYPE_RESERVED by trim_bios_range().
  296. */
  297. if (!already_reserved) {
  298. memblock_reserve(start, size);
  299. /*
  300. * If we are the first to reserve the region, no
  301. * one else cares about it. We own it and can
  302. * free it later.
  303. */
  304. if (can_free_region(start, size))
  305. continue;
  306. }
  307. /*
  308. * We don't own the region. We must not free it.
  309. *
  310. * Setting this bit for a boot services region really
  311. * doesn't make sense as far as the firmware is
  312. * concerned, but it does provide us with a way to tag
  313. * those regions that must not be paired with
  314. * free_bootmem_late().
  315. */
  316. md->attribute |= EFI_MEMORY_RUNTIME;
  317. }
  318. }
  319. void __init efi_free_boot_services(void)
  320. {
  321. phys_addr_t new_phys, new_size;
  322. efi_memory_desc_t *md;
  323. int num_entries = 0;
  324. void *new, *new_md;
  325. for_each_efi_memory_desc(md) {
  326. unsigned long long start = md->phys_addr;
  327. unsigned long long size = md->num_pages << EFI_PAGE_SHIFT;
  328. size_t rm_size;
  329. if (md->type != EFI_BOOT_SERVICES_CODE &&
  330. md->type != EFI_BOOT_SERVICES_DATA) {
  331. num_entries++;
  332. continue;
  333. }
  334. /* Do not free, someone else owns it: */
  335. if (md->attribute & EFI_MEMORY_RUNTIME) {
  336. num_entries++;
  337. continue;
  338. }
  339. /*
  340. * Nasty quirk: if all sub-1MB memory is used for boot
  341. * services, we can get here without having allocated the
  342. * real mode trampoline. It's too late to hand boot services
  343. * memory back to the memblock allocator, so instead
  344. * try to manually allocate the trampoline if needed.
  345. *
  346. * I've seen this on a Dell XPS 13 9350 with firmware
  347. * 1.4.4 with SGX enabled booting Linux via Fedora 24's
  348. * grub2-efi on a hard disk. (And no, I don't know why
  349. * this happened, but Linux should still try to boot rather
  350. * panicing early.)
  351. */
  352. rm_size = real_mode_size_needed();
  353. if (rm_size && (start + rm_size) < (1<<20) && size >= rm_size) {
  354. set_real_mode_mem(start, rm_size);
  355. start += rm_size;
  356. size -= rm_size;
  357. }
  358. free_bootmem_late(start, size);
  359. }
  360. if (!num_entries)
  361. return;
  362. new_size = efi.memmap.desc_size * num_entries;
  363. new_phys = efi_memmap_alloc(num_entries);
  364. if (!new_phys) {
  365. pr_err("Failed to allocate new EFI memmap\n");
  366. return;
  367. }
  368. new = memremap(new_phys, new_size, MEMREMAP_WB);
  369. if (!new) {
  370. pr_err("Failed to map new EFI memmap\n");
  371. return;
  372. }
  373. /*
  374. * Build a new EFI memmap that excludes any boot services
  375. * regions that are not tagged EFI_MEMORY_RUNTIME, since those
  376. * regions have now been freed.
  377. */
  378. new_md = new;
  379. for_each_efi_memory_desc(md) {
  380. if (!(md->attribute & EFI_MEMORY_RUNTIME) &&
  381. (md->type == EFI_BOOT_SERVICES_CODE ||
  382. md->type == EFI_BOOT_SERVICES_DATA))
  383. continue;
  384. memcpy(new_md, md, efi.memmap.desc_size);
  385. new_md += efi.memmap.desc_size;
  386. }
  387. memunmap(new);
  388. if (efi_memmap_install(new_phys, num_entries)) {
  389. pr_err("Could not install new EFI memmap\n");
  390. return;
  391. }
  392. }
  393. /*
  394. * A number of config table entries get remapped to virtual addresses
  395. * after entering EFI virtual mode. However, the kexec kernel requires
  396. * their physical addresses therefore we pass them via setup_data and
  397. * correct those entries to their respective physical addresses here.
  398. *
  399. * Currently only handles smbios which is necessary for some firmware
  400. * implementation.
  401. */
  402. int __init efi_reuse_config(u64 tables, int nr_tables)
  403. {
  404. int i, sz, ret = 0;
  405. void *p, *tablep;
  406. struct efi_setup_data *data;
  407. if (!efi_setup)
  408. return 0;
  409. if (!efi_enabled(EFI_64BIT))
  410. return 0;
  411. data = early_memremap(efi_setup, sizeof(*data));
  412. if (!data) {
  413. ret = -ENOMEM;
  414. goto out;
  415. }
  416. if (!data->smbios)
  417. goto out_memremap;
  418. sz = sizeof(efi_config_table_64_t);
  419. p = tablep = early_memremap(tables, nr_tables * sz);
  420. if (!p) {
  421. pr_err("Could not map Configuration table!\n");
  422. ret = -ENOMEM;
  423. goto out_memremap;
  424. }
  425. for (i = 0; i < efi.systab->nr_tables; i++) {
  426. efi_guid_t guid;
  427. guid = ((efi_config_table_64_t *)p)->guid;
  428. if (!efi_guidcmp(guid, SMBIOS_TABLE_GUID))
  429. ((efi_config_table_64_t *)p)->table = data->smbios;
  430. p += sz;
  431. }
  432. early_memunmap(tablep, nr_tables * sz);
  433. out_memremap:
  434. early_memunmap(data, sizeof(*data));
  435. out:
  436. return ret;
  437. }
  438. static const struct dmi_system_id sgi_uv1_dmi[] = {
  439. { NULL, "SGI UV1",
  440. { DMI_MATCH(DMI_PRODUCT_NAME, "Stoutland Platform"),
  441. DMI_MATCH(DMI_PRODUCT_VERSION, "1.0"),
  442. DMI_MATCH(DMI_BIOS_VENDOR, "SGI.COM"),
  443. }
  444. },
  445. { } /* NULL entry stops DMI scanning */
  446. };
  447. void __init efi_apply_memmap_quirks(void)
  448. {
  449. /*
  450. * Once setup is done earlier, unmap the EFI memory map on mismatched
  451. * firmware/kernel architectures since there is no support for runtime
  452. * services.
  453. */
  454. if (!efi_runtime_supported()) {
  455. pr_info("Setup done, disabling due to 32/64-bit mismatch\n");
  456. efi_memmap_unmap();
  457. }
  458. /* UV2+ BIOS has a fix for this issue. UV1 still needs the quirk. */
  459. if (dmi_check_system(sgi_uv1_dmi))
  460. set_bit(EFI_OLD_MEMMAP, &efi.flags);
  461. }
  462. /*
  463. * For most modern platforms the preferred method of powering off is via
  464. * ACPI. However, there are some that are known to require the use of
  465. * EFI runtime services and for which ACPI does not work at all.
  466. *
  467. * Using EFI is a last resort, to be used only if no other option
  468. * exists.
  469. */
  470. bool efi_reboot_required(void)
  471. {
  472. if (!acpi_gbl_reduced_hardware)
  473. return false;
  474. efi_reboot_quirk_mode = EFI_RESET_WARM;
  475. return true;
  476. }
  477. bool efi_poweroff_required(void)
  478. {
  479. return acpi_gbl_reduced_hardware || acpi_no_s5;
  480. }
  481. #ifdef CONFIG_EFI_CAPSULE_QUIRK_QUARK_CSH
  482. static int qrk_capsule_setup_info(struct capsule_info *cap_info, void **pkbuff,
  483. size_t hdr_bytes)
  484. {
  485. struct quark_security_header *csh = *pkbuff;
  486. /* Only process data block that is larger than the security header */
  487. if (hdr_bytes < sizeof(struct quark_security_header))
  488. return 0;
  489. if (csh->csh_signature != QUARK_CSH_SIGNATURE ||
  490. csh->headersize != QUARK_SECURITY_HEADER_SIZE)
  491. return 1;
  492. /* Only process data block if EFI header is included */
  493. if (hdr_bytes < QUARK_SECURITY_HEADER_SIZE +
  494. sizeof(efi_capsule_header_t))
  495. return 0;
  496. pr_debug("Quark security header detected\n");
  497. if (csh->rsvd_next_header != 0) {
  498. pr_err("multiple Quark security headers not supported\n");
  499. return -EINVAL;
  500. }
  501. *pkbuff += csh->headersize;
  502. cap_info->total_size = csh->headersize;
  503. /*
  504. * Update the first page pointer to skip over the CSH header.
  505. */
  506. cap_info->phys[0] += csh->headersize;
  507. /*
  508. * cap_info->capsule should point at a virtual mapping of the entire
  509. * capsule, starting at the capsule header. Our image has the Quark
  510. * security header prepended, so we cannot rely on the default vmap()
  511. * mapping created by the generic capsule code.
  512. * Given that the Quark firmware does not appear to care about the
  513. * virtual mapping, let's just point cap_info->capsule at our copy
  514. * of the capsule header.
  515. */
  516. cap_info->capsule = &cap_info->header;
  517. return 1;
  518. }
  519. #define ICPU(family, model, quirk_handler) \
  520. { X86_VENDOR_INTEL, family, model, X86_FEATURE_ANY, \
  521. (unsigned long)&quirk_handler }
  522. static const struct x86_cpu_id efi_capsule_quirk_ids[] = {
  523. ICPU(5, 9, qrk_capsule_setup_info), /* Intel Quark X1000 */
  524. { }
  525. };
  526. int efi_capsule_setup_info(struct capsule_info *cap_info, void *kbuff,
  527. size_t hdr_bytes)
  528. {
  529. int (*quirk_handler)(struct capsule_info *, void **, size_t);
  530. const struct x86_cpu_id *id;
  531. int ret;
  532. if (hdr_bytes < sizeof(efi_capsule_header_t))
  533. return 0;
  534. cap_info->total_size = 0;
  535. id = x86_match_cpu(efi_capsule_quirk_ids);
  536. if (id) {
  537. /*
  538. * The quirk handler is supposed to return
  539. * - a value > 0 if the setup should continue, after advancing
  540. * kbuff as needed
  541. * - 0 if not enough hdr_bytes are available yet
  542. * - a negative error code otherwise
  543. */
  544. quirk_handler = (typeof(quirk_handler))id->driver_data;
  545. ret = quirk_handler(cap_info, &kbuff, hdr_bytes);
  546. if (ret <= 0)
  547. return ret;
  548. }
  549. memcpy(&cap_info->header, kbuff, sizeof(cap_info->header));
  550. cap_info->total_size += cap_info->header.imagesize;
  551. return __efi_capsule_setup_info(cap_info);
  552. }
  553. #endif