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


Groups > linux.kernel > #1393557

Re: [PATCH v2 2/4] x86, boot: PUD VA support for physical mapping (x86_64)

From Thomas Garnier <thgarnie@google.com>
Newsgroups linux.kernel
Subject Re: [PATCH v2 2/4] x86, boot: PUD VA support for physical mapping (x86_64)
Date 2016-05-03 17:50 +0200
Message-ID <ruKKf-2eW-23@gated-at.bofh.it> (permalink)
References <rutT4-3cr-9@gated-at.bofh.it> <rutT4-3cr-7@gated-at.bofh.it> <ruu2J-3ht-1@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Mon, May 2, 2016 at 2:58 PM, Dave Hansen <dave.hansen@linux.intel.com> wrote:
> On 05/02/2016 02:41 PM, Thomas Garnier wrote:
>> Minor change that allows early boot physical mapping of PUD level virtual
>> addresses. This change prepares usage of different virtual addresses for
>> KASLR memory randomization. It has no impact on default usage.
> ...
>> diff --git a/arch/x86/mm/init_64.c b/arch/x86/mm/init_64.c
>> index 89d9747..6adfbce 100644
>> --- a/arch/x86/mm/init_64.c
>> +++ b/arch/x86/mm/init_64.c
>> @@ -526,10 +526,10 @@ phys_pud_init(pud_t *pud_page, unsigned long addr, unsigned long end,
>>  {
>>       unsigned long pages = 0, next;
>>       unsigned long last_map_addr = end;
>> -     int i = pud_index(addr);
>> +     int i = pud_index((unsigned long)__va(addr));
>>
>>       for (; i < PTRS_PER_PUD; i++, addr = next) {
>> -             pud_t *pud = pud_page + pud_index(addr);
>> +             pud_t *pud = pud_page + pud_index((unsigned long)__va(addr));
>>               pmd_t *pmd;
>>               pgprot_t prot = PAGE_KERNEL;
>
> pud_index() is supposed to take a virtual address.  We were passing a
> physical address in here, and it all just worked because PAGE_OFFSET is
> PUD-aligned.  Now that you are moving PAGE_OFFSET around a bit and not
> PUD-aligning it, this breaks.  Right?
>
> Could you spell this out a bit more the changelog?

Sure, will do on next iteration.

Thanks,
Thomas

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


Thread

[PATCH v2 2/4] x86, boot: PUD VA support for physical mapping (x86_64) Thomas Garnier <thgarnie@google.com> - 2016-05-02 23:50 +0200
  Re: [PATCH v2 2/4] x86, boot: PUD VA support for physical mapping  (x86_64) Dave Hansen <dave.hansen@linux.intel.com> - 2016-05-03 00:00 +0200
    Re: [PATCH v2 2/4] x86, boot: PUD VA support for physical mapping  (x86_64) Baoquan He <bhe@redhat.com> - 2016-05-03 12:10 +0200
      Re: [PATCH v2 2/4] x86, boot: PUD VA support for physical mapping  (x86_64) Dave Hansen <dave.hansen@linux.intel.com> - 2016-05-03 17:20 +0200
    Re: [PATCH v2 2/4] x86, boot: PUD VA support for physical mapping (x86_64) Thomas Garnier <thgarnie@google.com> - 2016-05-03 17:50 +0200

csiph-web