Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1636312

Re: [PATCH v3 2/2] x86_64/kexec: Use PUD level 1GB page for identity mapping if available

From Xunlei Pang <xpang@redhat.com>
Newsgroups linux.kernel
Subject Re: [PATCH v3 2/2] x86_64/kexec: Use PUD level 1GB page for identity mapping if available
Date 2017-05-05 13:00 +0200
Message-ID <tDJ7Q-CE-13@gated-at.bofh.it> (permalink)
References <tDe41-54j-3@gated-at.bofh.it> <tDe41-54j-1@gated-at.bofh.it> <tDFnz-6yA-5@gated-at.bofh.it> <tDG0h-75x-9@gated-at.bofh.it> <tDHIJ-8ec-11@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On 05/05/2017 at 05:20 PM, Ingo Molnar wrote:
> * Xunlei Pang <xpang@redhat.com> wrote:
>
>> On 05/05/2017 at 02:52 PM, Ingo Molnar wrote:
>>> * Xunlei Pang <xlpang@redhat.com> 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.

boot/compressed/pagetable.c  also uses kernel_ident_mapping_init() for kaslr, at the moment
we don't have "direct_gbpages" definition or X86_FEATURE_GBPAGES feature detection.

I thought that we can change the other call sites when found really needed.

Regards,
Xunlei

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH v3 2/2] x86_64/kexec: Use PUD level 1GB page for identity mapping if available Xunlei Pang <xlpang@redhat.com> - 2017-05-04 03:50 +0200
  Re: [PATCH v3 2/2] x86_64/kexec: Use PUD level 1GB page for identity  mapping if available Ingo Molnar <mingo@kernel.org> - 2017-05-05 09:00 +0200
    Re: [PATCH v3 2/2] x86_64/kexec: Use PUD level 1GB page for identity  mapping if available Xunlei Pang <xpang@redhat.com> - 2017-05-05 09:40 +0200
      Re: [PATCH v3 2/2] x86_64/kexec: Use PUD level 1GB page for identity  mapping if available Ingo Molnar <mingo@kernel.org> - 2017-05-05 11:30 +0200
        Re: [PATCH v3 2/2] x86_64/kexec: Use PUD level 1GB page for identity  mapping if available Xunlei Pang <xpang@redhat.com> - 2017-05-05 13:00 +0200
          Re: [PATCH v3 2/2] x86_64/kexec: Use PUD level 1GB page for identity  mapping if available Ingo Molnar <mingo@kernel.org> - 2017-05-08 08:30 +0200
            Re: [PATCH v3 2/2] x86_64/kexec: Use PUD level 1GB page for identity  mapping if available Xunlei Pang <xpang@redhat.com> - 2017-05-08 09:30 +0200
  [tip:x86/urgent] x86/kexec/64: Use gbpages for identity mappings if  available tip-bot for Xunlei Pang <tipbot@zytor.com> - 2017-05-08 10:20 +0200

csiph-web