Commit 91c1c092 authored by Ard Biesheuvel's avatar Ard Biesheuvel

efi: capsule: use atomic kmap for transient sglist mappings

Don't use the heavy-weight kmap() API to create short-lived mappings
of the scatter-gather list entries that are released as soon as the
entries are written. Instead, use kmap_atomic(), which is more suited
to this purpose.
Signed-off-by: default avatarArd Biesheuvel <ardb@kernel.org>
parent b283477d
...@@ -244,7 +244,7 @@ int efi_capsule_update(efi_capsule_header_t *capsule, phys_addr_t *pages) ...@@ -244,7 +244,7 @@ int efi_capsule_update(efi_capsule_header_t *capsule, phys_addr_t *pages)
for (i = 0; i < sg_count; i++) { for (i = 0; i < sg_count; i++) {
efi_capsule_block_desc_t *sglist; efi_capsule_block_desc_t *sglist;
sglist = kmap(sg_pages[i]); sglist = kmap_atomic(sg_pages[i]);
for (j = 0; j < SGLIST_PER_PAGE && count > 0; j++) { for (j = 0; j < SGLIST_PER_PAGE && count > 0; j++) {
u64 sz = min_t(u64, imagesize, u64 sz = min_t(u64, imagesize,
...@@ -265,7 +265,7 @@ int efi_capsule_update(efi_capsule_header_t *capsule, phys_addr_t *pages) ...@@ -265,7 +265,7 @@ int efi_capsule_update(efi_capsule_header_t *capsule, phys_addr_t *pages)
else else
sglist[j].data = page_to_phys(sg_pages[i + 1]); sglist[j].data = page_to_phys(sg_pages[i + 1]);
kunmap(sg_pages[i]); kunmap_atomic(sglist);
} }
mutex_lock(&capsule_mutex); mutex_lock(&capsule_mutex);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment