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

Signed-off-by: Ge Song <[email protected]>
Cc: Ard Biesheuvel <[email protected]>
Cc: Matt Fleming <[email protected]>
Cc: [email protected]
Cc: [email protected]
---
 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 [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to