login
Login
/
Register
Search
Search this site:
Forums
News
Blogs
Features
Site
Home
»
Mailing list archives
»
linux-kernel
»
2007
»
August
»
24
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: Friday, August 24, 2007 - 1:31 am
On Wed 2007-08-22 18:16:05, Rafael J. Wysocki wrote:
quoted text
> On Wednesday, 22 August 2007 10:29, Pavel Machek wrote: > > Hi! > > > > > 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. > > > > > > > @@ -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. > > > > > + /* 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 :-(. > > No, these pages will be freed by swsusp_free(), thanks to the get_safe_page(). > > I'm not _that_ careless. ;-)
Ok, ACK. -- (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
Create content
Mailing list archives
Recent posts
Popular discussions
linux-kernel
:
Trent Waddington
Re: Gaming Interface
Takashi Iwai
Re: [PATCH] usb: usbmixer error path fix
Pekka Enberg
Re: latest -git: suspend: unable to handle kernel paging request (was Re: no_conso...
Dan Carpenter
Re: [patch] dma-debug: off by one issue
Jeremy Fitzhardinge
Re: [patch 1/6] Re-enable VDSO by default with PARAVIRT
git
:
Stephen R. van den Berg
Re: [RFC] origin link for cherry-pick and revert
Christian Stimming
git-gui: Fix broken revert confirmation.
Junio C Hamano
Re: git-svnimport
Mark Burton
Re: [PATCH] builtin-branch: highlight current remote branches with an asterisk
Johannes Schindelin
Re: [PATCH] Fix approxidate("never") to always return 0
linux-netdev
:
Nick Piggin
Re: Kernel WARNING: at net/core/dev.c:1330 __netif_schedule+0x2c/0x98()
Daniel Lezcano
getsockopt(TCP_DEFER_ACCEPT) value change
David Miller
Re: 2.6.27.18: bnx2/tg3: BUG: "scheduling while atomic" trying to ifenslave a seco...
Ingo Molnar
Re: [regression] nf_iterate(), BUG: unable to handle kernel NULL pointer dereference
Gerrit Renker
[PATCH 37/37] dccp: Debugging functions for feature negotiation
git-commits-head
:
Linux Kernel Mailing List
ath9k_htc: Allocate URBs properly
Linux Kernel Mailing List
bnx2x: Fan failure mechanism on additional design
Linux Kernel Mailing List
cpumask: make irq_set_affinity() take a const struct cpumask
Linux Kernel Mailing List
ARM: 5670/1: bcmring: add default configuration for bcmring arch
Linux Kernel Mailing List
ahci: Workaround HW bug for SB600/700 SATA controller PMP support
openbsd-misc
:
Christophe Rioux
Implementation example of snmp
Ryan McBride
Re: Packets Per Second Limit?
Nick Holland
Re: booting openbsd on eee without cd-rom
Marco Peereboom
Re: Singularity OS
Ryan Corder
Re: 3ware hardware raid support?
Colocation donated by:
Syndicate