[PATCH 2/2] efi/capsule-loader: Request a contiguous virtual space for capsules

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Use the start address of the contiguous virtual space to pass to efi
runtime service UpdateCapsule()

Signed-off-by: Ge Song <ge.song@xxxxxxxxxxxxxxxx>
Cc: Ard Biesheuvel <ard.biesheuvel@xxxxxxxxxx>
Cc: Matt Fleming <matt@xxxxxxxxxxxxxxxxxxx>
Cc: linux-efi@xxxxxxxxxxxxxxx
Cc: linux-kernel@xxxxxxxxxxxxxxx
---
 drivers/firmware/efi/capsule-loader.c | 11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)

diff --git a/drivers/firmware/efi/capsule-loader.c b/drivers/firmware/efi/capsule-loader.c
index cbc3526953d5..efa4cce374d3 100644
--- a/drivers/firmware/efi/capsule-loader.c
+++ b/drivers/firmware/efi/capsule-loader.c
@@ -102,8 +102,17 @@ int __weak efi_capsule_setup_info(struct capsule_info *cap_info, void *kbuff,
 static ssize_t efi_capsule_submit_update(struct capsule_info *cap_info)
 {
 	int ret;
+	void *vm_cap_hdr;
+
+	/* Request a contiguous virtual space */
+	vm_cap_hdr = vmap(cap_info->pages, cap_info->index,
+					VM_MAP, PAGE_KERNEL);
+	if (!vm_cap_hdr)
+		return -ENOMEM;
+
+	ret = efi_capsule_update(vm_cap_hdr, cap_info->pages);
+		vunmap(vm_cap_hdr);
 
-	ret = efi_capsule_update(&cap_info->header, cap_info->pages);
 	if (ret) {
 		pr_err("capsule update failed\n");
 		return ret;
-- 
2.7.4


--
To unsubscribe from this list: send the line "unsubscribe linux-efi" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux