diff options
Diffstat (limited to 'kernel/power/snapshot.c')
-rw-r--r-- | kernel/power/snapshot.c | 35 |
1 files changed, 18 insertions, 17 deletions
diff --git a/kernel/power/snapshot.c b/kernel/power/snapshot.c index 6a768e537001..0de28576807d 100644 --- a/kernel/power/snapshot.c +++ b/kernel/power/snapshot.c | |||
@@ -711,9 +711,10 @@ static void mark_nosave_pages(struct memory_bitmap *bm) | |||
711 | list_for_each_entry(region, &nosave_regions, list) { | 711 | list_for_each_entry(region, &nosave_regions, list) { |
712 | unsigned long pfn; | 712 | unsigned long pfn; |
713 | 713 | ||
714 | pr_debug("PM: Marking nosave pages: %016lx - %016lx\n", | 714 | pr_debug("PM: Marking nosave pages: [mem %#010llx-%#010llx]\n", |
715 | region->start_pfn << PAGE_SHIFT, | 715 | (unsigned long long) region->start_pfn << PAGE_SHIFT, |
716 | region->end_pfn << PAGE_SHIFT); | 716 | ((unsigned long long) region->end_pfn << PAGE_SHIFT) |
717 | - 1); | ||
717 | 718 | ||
718 | for (pfn = region->start_pfn; pfn < region->end_pfn; pfn++) | 719 | for (pfn = region->start_pfn; pfn < region->end_pfn; pfn++) |
719 | if (pfn_valid(pfn)) { | 720 | if (pfn_valid(pfn)) { |
@@ -1000,20 +1001,20 @@ static void copy_data_page(unsigned long dst_pfn, unsigned long src_pfn) | |||
1000 | s_page = pfn_to_page(src_pfn); | 1001 | s_page = pfn_to_page(src_pfn); |
1001 | d_page = pfn_to_page(dst_pfn); | 1002 | d_page = pfn_to_page(dst_pfn); |
1002 | if (PageHighMem(s_page)) { | 1003 | if (PageHighMem(s_page)) { |
1003 | src = kmap_atomic(s_page, KM_USER0); | 1004 | src = kmap_atomic(s_page); |
1004 | dst = kmap_atomic(d_page, KM_USER1); | 1005 | dst = kmap_atomic(d_page); |
1005 | do_copy_page(dst, src); | 1006 | do_copy_page(dst, src); |
1006 | kunmap_atomic(dst, KM_USER1); | 1007 | kunmap_atomic(dst); |
1007 | kunmap_atomic(src, KM_USER0); | 1008 | kunmap_atomic(src); |
1008 | } else { | 1009 | } else { |
1009 | if (PageHighMem(d_page)) { | 1010 | if (PageHighMem(d_page)) { |
1010 | /* Page pointed to by src may contain some kernel | 1011 | /* Page pointed to by src may contain some kernel |
1011 | * data modified by kmap_atomic() | 1012 | * data modified by kmap_atomic() |
1012 | */ | 1013 | */ |
1013 | safe_copy_page(buffer, s_page); | 1014 | safe_copy_page(buffer, s_page); |
1014 | dst = kmap_atomic(d_page, KM_USER0); | 1015 | dst = kmap_atomic(d_page); |
1015 | copy_page(dst, buffer); | 1016 | copy_page(dst, buffer); |
1016 | kunmap_atomic(dst, KM_USER0); | 1017 | kunmap_atomic(dst); |
1017 | } else { | 1018 | } else { |
1018 | safe_copy_page(page_address(d_page), s_page); | 1019 | safe_copy_page(page_address(d_page), s_page); |
1019 | } | 1020 | } |
@@ -1728,9 +1729,9 @@ int snapshot_read_next(struct snapshot_handle *handle) | |||
1728 | */ | 1729 | */ |
1729 | void *kaddr; | 1730 | void *kaddr; |
1730 | 1731 | ||
1731 | kaddr = kmap_atomic(page, KM_USER0); | 1732 | kaddr = kmap_atomic(page); |
1732 | copy_page(buffer, kaddr); | 1733 | copy_page(buffer, kaddr); |
1733 | kunmap_atomic(kaddr, KM_USER0); | 1734 | kunmap_atomic(kaddr); |
1734 | handle->buffer = buffer; | 1735 | handle->buffer = buffer; |
1735 | } else { | 1736 | } else { |
1736 | handle->buffer = page_address(page); | 1737 | handle->buffer = page_address(page); |
@@ -2014,9 +2015,9 @@ static void copy_last_highmem_page(void) | |||
2014 | if (last_highmem_page) { | 2015 | if (last_highmem_page) { |
2015 | void *dst; | 2016 | void *dst; |
2016 | 2017 | ||
2017 | dst = kmap_atomic(last_highmem_page, KM_USER0); | 2018 | dst = kmap_atomic(last_highmem_page); |
2018 | copy_page(dst, buffer); | 2019 | copy_page(dst, buffer); |
2019 | kunmap_atomic(dst, KM_USER0); | 2020 | kunmap_atomic(dst); |
2020 | last_highmem_page = NULL; | 2021 | last_highmem_page = NULL; |
2021 | } | 2022 | } |
2022 | } | 2023 | } |
@@ -2309,13 +2310,13 @@ swap_two_pages_data(struct page *p1, struct page *p2, void *buf) | |||
2309 | { | 2310 | { |
2310 | void *kaddr1, *kaddr2; | 2311 | void *kaddr1, *kaddr2; |
2311 | 2312 | ||
2312 | kaddr1 = kmap_atomic(p1, KM_USER0); | 2313 | kaddr1 = kmap_atomic(p1); |
2313 | kaddr2 = kmap_atomic(p2, KM_USER1); | 2314 | kaddr2 = kmap_atomic(p2); |
2314 | copy_page(buf, kaddr1); | 2315 | copy_page(buf, kaddr1); |
2315 | copy_page(kaddr1, kaddr2); | 2316 | copy_page(kaddr1, kaddr2); |
2316 | copy_page(kaddr2, buf); | 2317 | copy_page(kaddr2, buf); |
2317 | kunmap_atomic(kaddr2, KM_USER1); | 2318 | kunmap_atomic(kaddr2); |
2318 | kunmap_atomic(kaddr1, KM_USER0); | 2319 | kunmap_atomic(kaddr1); |
2319 | } | 2320 | } |
2320 | 2321 | ||
2321 | /** | 2322 | /** |