login
Login
/
Register
Search
Search this site:
Forums
News
Blogs
Features
Site
Home
»
Mailing list archives
»
linux-kernel
»
2007
»
August
»
22
Re: [RFC][PATCH -mm 4/4] Hibernation: Use temporary page tables for kernel text mapping on x86_64
view
thread
Previous message: [
thread
] [
date
] [
author
]
Next message: [
thread
] [
date
] [
author
]
[view in full thread]
From: Pavel Machek
Subject:
Re: [RFC][PATCH -mm 4/4] Hibernation: Use temporary page tables for kernel text mapping on x86_64
Date: Wednesday, August 22, 2007 - 1:29 am
Hi!
quoted text
> Use temporary page tables for the kernel text mapping during hibernation restore > on x86_64. > > Without the patch, the original boot kernel's page tables that represent the > kernel text mapping are used while the core of the image kernel is being > restored. However, in principle, if the boot kernel is not identical to the > image kernel, the location of these page tables in the image kernel need not be > the same, so we should create a safe copy of the kernel text mapping prior to > restoring the core of the image kernel.
quoted text
> @@ -190,25 +190,42 @@ static int res_phys_pud_init(pud_t *pud, > return 0; > } > > +static int res_kernel_text_pud_init(pud_t *pud, unsigned long start) > +{ > + pmd_t *pmd; > + unsigned long paddr; > + > + pmd = (pmd_t *)get_safe_page(GFP_ATOMIC); > + if (!pmd) > + return -ENOMEM; > + set_pud(pud + pud_index(start), __pud(__pa(pmd) | _KERNPG_TABLE)); > + for (paddr = 0; paddr < KERNEL_TEXT_SIZE; pmd++, paddr += PMD_SIZE) { > + unsigned long pe; > + > + pe = __PAGE_KERNEL_LARGE_EXEC | _PAGE_GLOBAL | paddr; > + pe &= __supported_pte_mask; > + set_pmd(pmd, __pmd(pe)); > + } > + > + return 0; > +} > + > static int set_up_temporary_mappings(void) > { > unsigned long start, end, next; > + pud_t *pud; > int error; > > temp_level4_pgt = (pgd_t *)get_safe_page(GFP_ATOMIC); > if (!temp_level4_pgt) > return -ENOMEM; > > - /* It is safe to reuse the original kernel mapping */ > - set_pgd(temp_level4_pgt + pgd_index(__START_KERNEL_map), > - init_level4_pgt[pgd_index(__START_KERNEL_map)]); > - > /* Set up the direct mapping from scratch */ > start = (unsigned long)pfn_to_kaddr(0); > end = (unsigned long)pfn_to_kaddr(end_pfn); > > for (; start < end; start = next) { > - pud_t *pud = (pud_t *)get_safe_page(GFP_ATOMIC); > + pud = (pud_t *)get_safe_page(GFP_ATOMIC); > if (!pud) > return -ENOMEM;
I believe we leak temp_level4_pgt here.
quoted text
> + /* Set up the kernel text mapping from scratch */ > + pud = (pud_t *)get_safe_page(GFP_ATOMIC); > + if (!pud) > + return -ENOMEM;
...and some more memory here :-(. Pavel -- (english)
http://www.livejournal.com/~pavelmachek
(cesky, pictures)
http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
-
unsubscribe notice
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to
majordomo@vger.kernel.org
More majordomo info at
http://vger.kernel.org/majordomo-info.html
Please read the FAQ at
http://www.tux.org/lkml/
Previous message: [
thread
] [
date
] [
author
]
Next message: [
thread
] [
date
] [
author
]
Messages in current thread:
[RFC][PATCH -mm 0/4] Hibernation: Arbitrary boot kernel su ...
, Rafael J. Wysocki
, (Wed Aug 22, 1:15 am)
[RFC][PATCH -mm 1/4] Hibernation: Arbitrary boot kernel su ...
, Rafael J. Wysocki
, (Wed Aug 22, 1:17 am)
[RFC][PATCH -mm 2/4] Hibernation: Arbitrary boot kernel su ...
, Rafael J. Wysocki
, (Wed Aug 22, 1:19 am)
[RFC][PATCH -mm 3/4] Hibernation: Pass CR3 in the image he ...
, Rafael J. Wysocki
, (Wed Aug 22, 1:20 am)
[RFC][PATCH -mm 4/4] Hibernation: Use temporary page table ...
, Rafael J. Wysocki
, (Wed Aug 22, 1:21 am)
Re: [RFC][PATCH -mm 1/4] Hibernation: Arbitrary boot kerne ...
, Pavel Machek
, (Wed Aug 22, 1:25 am)
Re: [RFC][PATCH -mm 2/4] Hibernation: Arbitrary boot kerne ...
, Pavel Machek
, (Wed Aug 22, 1:26 am)
Re: [RFC][PATCH -mm 3/4] Hibernation: Pass CR3 in the imag ...
, Pavel Machek
, (Wed Aug 22, 1:28 am)
Re: [RFC][PATCH -mm 4/4] Hibernation: Use temporary page t ...
, Pavel Machek
, (Wed Aug 22, 1:29 am)
Re: [RFC][PATCH -mm 4/4] Hibernation: Use temporary page t ...
, Rafael J. Wysocki
, (Wed Aug 22, 9:16 am)
Re: [RFC][PATCH -mm 3/4] Hibernation: Pass CR3 in the imag ...
, Rafael J. Wysocki
, (Wed Aug 22, 9:17 am)
Re: [linux-pm] Re: [RFC][PATCH -mm 3/4] Hibernation: Pass ...
, Rafael J. Wysocki
, (Wed Aug 22, 1:49 pm)
Re: [RFC][PATCH -mm 4/4] Hibernation: Use temporary page t ...
, Pavel Machek
, (Fri Aug 24, 1:31 am)
Re: [linux-pm] Re: [RFC][PATCH -mm 3/4] Hibernation: Pass ...
, Pavel Machek
, (Fri Aug 24, 2:02 am)
Re: [linux-pm] Re: [RFC][PATCH -mm 3/4] Hibernation: Pass ...
, Rafael J. Wysocki
, (Fri Aug 24, 2:24 pm)
Navigation
Mailing list archives
Recent posts
Popular discussions
linux-kernel
:
Mel Gorman
Re: [PATCH 1/4] vmstat: remove zone->lock from walk_zones_in_node
Guenter Roeck
Re: [lm-sensors] Location for thermal drivers
David Woodhouse
Re: RFC: Moving firmware blobs out of the kernel.
Siddha, Suresh B
Re: [PATCH 2.6.21 review I] [11/25] x86: default to physical mode on hotplug CPU k...
Peter Zijlstra
Re: [patch 4/6] mm: merge populate and nopage into fault (fixes nonlinear)
git-commits-head
:
Linux Kernel Mailing List
[MIPS] Fix potential latency problem due to non-atomic cpu_wait.
Linux Kernel Mailing List
USB: rename USB_SPEED_VARIABLE to USB_SPEED_WIRELESS
Linux Kernel Mailing List
lib/vsprintf.c: fix bug omitting minus sign of numbers (module_param)
Linux Kernel Mailing List
[Bluetooth] Initiate authentication during connection establishment
Linux Kernel Mailing List
[POWERPC] 4xx: Add ppc40x_defconfig
linux-netdev
:
MERCEDES
Your mail id has won 950,000.00 in the MERCEDES Benz Online Promo.for claims send:
David Miller
Re: [PATCH] xen/netfront: do not mark packets of length < MSS as GSO
David Miller
Re: skb_segment() questions
Shan Wei
[RFC PATCH net-next 2/5]IPv6:netfilter: Send an ICMPv6 "Fragment Reassembly Timeou...
Stanislaw Gruszka
[PATCH 1/4] bnx2x: use smp_mb() to keep ordering of read write operations
git
:
Nicolas Sebrecht
git-svn died of signal 11 (was "3 failures on test t9100 (svn)")
Junio C Hamano
Re: [PATCH 2/2] Add url.<base>.pushInsteadOf: URL rewriting for push only
Martin Langhoff
Re: [PATCH] GIT commit statistics.
Alexandre Julliard
[PATCH] gitweb: Put back shortlog instead of graphiclog in the project list.
Josh Triplett
[PATCH 2/2] Add url.<base>.pushInsteadOf: URL rewriting for push only
openbsd-misc
:
Taisto Qvist XX
Re: AMD GEODE LX-800 just works with kernel from install42.iso and kernelpanics wi...
Nico Meijer
Re: gOS Develop Kit with VIA pc-1 Processor Platform VIA C7-D
Andreas Bihlmaier
Re: jetway board sensors (Fintek F71805F)
admin
Drive a 2009 car from R799p/m
Antti Harri
Re: how to create a sha256 hash
Colocation donated by:
Syndicate