linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [tip: efi/core] efi: capsule: use atomic kmap for transient sglist mappings
@ 2020-12-10 11:49 tip-bot2 for Ard Biesheuvel
  0 siblings, 0 replies; only message in thread
From: tip-bot2 for Ard Biesheuvel @ 2020-12-10 11:49 UTC (permalink / raw)
  To: linux-tip-commits; +Cc: Ard Biesheuvel, x86, linux-kernel

The following commit has been merged into the efi/core branch of tip:

Commit-ID:     91c1c092f27da4164d55ca81e0a483108f8a3235
Gitweb:        https://git.kernel.org/tip/91c1c092f27da4164d55ca81e0a483108f8a3235
Author:        Ard Biesheuvel <ardb@kernel.org>
AuthorDate:    Mon, 07 Dec 2020 17:33:33 +01:00
Committer:     Ard Biesheuvel <ardb@kernel.org>
CommitterDate: Mon, 07 Dec 2020 19:31:43 +01:00

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: Ard Biesheuvel <ardb@kernel.org>
---
 drivers/firmware/efi/capsule.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/firmware/efi/capsule.c b/drivers/firmware/efi/capsule.c
index 598b780..43f6fe7 100644
--- a/drivers/firmware/efi/capsule.c
+++ b/drivers/firmware/efi/capsule.c
@@ -244,7 +244,7 @@ int efi_capsule_update(efi_capsule_header_t *capsule, phys_addr_t *pages)
 	for (i = 0; i < sg_count; i++) {
 		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++) {
 			u64 sz = min_t(u64, imagesize,
@@ -265,7 +265,7 @@ int efi_capsule_update(efi_capsule_header_t *capsule, phys_addr_t *pages)
 		else
 			sglist[j].data = page_to_phys(sg_pages[i + 1]);
 
-		kunmap(sg_pages[i]);
+		kunmap_atomic(sglist);
 	}
 
 	mutex_lock(&capsule_mutex);

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2020-12-10 11:52 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-12-10 11:49 [tip: efi/core] efi: capsule: use atomic kmap for transient sglist mappings tip-bot2 for Ard Biesheuvel

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).