|
Message-ID: <b224d88d91a5c45c44e176ea06dea558a8939ccf.camel@intel.com> Date: Thu, 17 Jan 2019 22:16:47 +0000 From: "Edgecombe, Rick P" <rick.p.edgecombe@...el.com> To: "pavel@....cz" <pavel@....cz> CC: "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>, "peterz@...radead.org" <peterz@...radead.org>, "linux-integrity@...r.kernel.org" <linux-integrity@...r.kernel.org>, "ard.biesheuvel@...aro.org" <ard.biesheuvel@...aro.org>, "tglx@...utronix.de" <tglx@...utronix.de>, "linux-mm@...ck.org" <linux-mm@...ck.org>, "nadav.amit@...il.com" <nadav.amit@...il.com>, "dave.hansen@...ux.intel.com" <dave.hansen@...ux.intel.com>, "Dock, Deneen T" <deneen.t.dock@...el.com>, "linux-security-module@...r.kernel.org" <linux-security-module@...r.kernel.org>, "x86@...nel.org" <x86@...nel.org>, "akpm@...ux-foundation.org" <akpm@...ux-foundation.org>, "hpa@...or.com" <hpa@...or.com>, "kristen@...ux.intel.com" <kristen@...ux.intel.com>, "mingo@...hat.com" <mingo@...hat.com>, "linux_dti@...oud.com" <linux_dti@...oud.com>, "luto@...nel.org" <luto@...nel.org>, "will.deacon@....com" <will.deacon@....com>, "bp@...en8.de" <bp@...en8.de>, "kernel-hardening@...ts.openwall.com" <kernel-hardening@...ts.openwall.com>, "rjw@...ysocki.net" <rjw@...ysocki.net> Subject: Re: [PATCH 14/17] mm: Make hibernate handle unmapped pages On Thu, 2019-01-17 at 10:39 +0100, Pavel Machek wrote: > Hi! > > > For architectures with CONFIG_ARCH_HAS_SET_ALIAS, pages can be unmapped > > briefly on the directmap, even when CONFIG_DEBUG_PAGEALLOC is not > > configured. > > So this changes kernel_map_pages and kernel_page_present to be defined when > > CONFIG_ARCH_HAS_SET_ALIAS is defined as well. It also changes places > > (page_alloc.c) where those functions are assumed to only be implemented when > > CONFIG_DEBUG_PAGEALLOC is defined. > > Which architectures are that? > > Should this be merged to the patch where HAS_SET_ALIAS is introduced? We > don't want broken hibernation in between.... Thanks for taking a look. It was added for x86 for patch 13 in this patchset and there was interest expressed for adding for arm64. If you didn't get the whole set and want to see let me know and I can send it. > > > -#ifdef CONFIG_DEBUG_PAGEALLOC > > extern bool _debug_pagealloc_enabled; > > -extern void __kernel_map_pages(struct page *page, int numpages, int > > enable); > > > > static inline bool debug_pagealloc_enabled(void) > > { > > - return _debug_pagealloc_enabled; > > + return IS_ENABLED(CONFIG_DEBUG_PAGEALLOC) && _debug_pagealloc_enabled; > > } > > This will break build AFAICT. _debug_pagealloc_enabled variable does > not exist in !CONFIG_DEBUG_PAGEALLOC case. > > Pavel After adding in the CONFIG_ARCH_HAS_SET_ALIAS condition to the ifdefs in this area it looked a little hard to read to me, so I moved debug_pagealloc_enabled and extern bool _debug_pagealloc_enabled outside to make it easier. I think you are right, the actual non-extern variable can not be there, but the reference here gets optimized out in that case. Just double checked and it builds for both CONFIG_DEBUG_PAGEALLOC=n and CONFIG_DEBUG_PAGEALLOC=y for me. Thanks, Rick
Powered by blists - more mailing lists
Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.