From mboxrd@z Thu Jan 1 00:00:00 1970 Return-path: Received: from mail-wm0-x241.google.com ([2a00:1450:400c:c09::241]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1d6ZQE-0007iA-TC for kexec@lists.infradead.org; Fri, 05 May 2017 09:21:12 +0000 Received: by mail-wm0-x241.google.com with SMTP id y10so112389wmh.0 for ; Fri, 05 May 2017 02:20:50 -0700 (PDT) Date: Fri, 5 May 2017 11:20:46 +0200 From: Ingo Molnar Subject: Re: [PATCH v3 2/2] x86_64/kexec: Use PUD level 1GB page for identity mapping if available Message-ID: <20170505092046.2qu72pdherfxjmec@gmail.com> References: <1493862171-8799-1-git-send-email-xlpang@redhat.com> <1493862171-8799-2-git-send-email-xlpang@redhat.com> <20170505065253.s5yv7c2cxgfcf4i3@gmail.com> <590C2A96.3090106@redhat.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <590C2A96.3090106@redhat.com> List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "kexec" Errors-To: kexec-bounces+dwmw2=infradead.org@lists.infradead.org To: xlpang@redhat.com Cc: Yinghai Lu , x86@kernel.org, kexec@lists.infradead.org, linux-kernel@vger.kernel.org, Borislav Petkov , Eric Biederman , Andy Lutomirski , "H. Peter Anvin" , akpm@linux-foundation.org, Dave Young , Thomas Gleixner * Xunlei Pang wrote: > On 05/05/2017 at 02:52 PM, Ingo Molnar wrote: > > * Xunlei Pang wrote: > > > >> @@ -122,6 +122,10 @@ static int init_pgtable(struct kimage *image, unsigned long start_pgtable) > >> > >> level4p = (pgd_t *)__va(start_pgtable); > >> clear_page(level4p); > >> + > >> + if (direct_gbpages) > >> + info.direct_gbpages = true; > > No, this should be keyed off the CPU feature (X86_FEATURE_GBPAGES) automatically, > > not set blindly! AFAICS this patch will crash kexec on any CPU that does not > > support gbpages. > > It should be fine, probe_page_size_mask() already takes care of this: > if (direct_gbpages && boot_cpu_has(X86_FEATURE_GBPAGES)) { > printk(KERN_INFO "Using GB pages for direct mapping\n"); > page_size_mask |= 1 << PG_LEVEL_1G; > } else { > direct_gbpages = 0; > } > > So if X86_FEATURE_GBPAGES is not supported, direct_gbpages will be set to 0. So why is the introduction of the info.direct_gbpages flag necessary? AFAICS it just duplicates the kernel's direct_gbpages flag. One outcome is that hibernation won't use gbpages, which is silly. Thanks, Ingo _______________________________________________ kexec mailing list kexec@lists.infradead.org http://lists.infradead.org/mailman/listinfo/kexec