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


Groups > linux.kernel > #1630318

Re: [tip:x86/mm] x86: Convert the rest of the code to support p4d_t

From "Kirill A. Shutemov" <kirill@shutemov.name>
Newsgroups linux.kernel
Subject Re: [tip:x86/mm] x86: Convert the rest of the code to support p4d_t
Date 2017-04-25 11:10 +0200
Message-ID <tA4DT-2H8-3@gated-at.bofh.it> (permalink)
References (2 earlier) <tzvPQ-4qm-5@gated-at.bofh.it> <tzPvc-118-19@gated-at.bofh.it> <tzRdD-29v-13@gated-at.bofh.it> <tzX9n-6aR-11@gated-at.bofh.it> <tA2iK-148-25@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Tue, Apr 25, 2017 at 08:38:42AM +0200, Ingo Molnar wrote:
> 
> * Kirill A. Shutemov <kirill.shutemov@linux.intel.com> wrote:
> 
> > On Mon, Apr 24, 2017 at 11:42:34AM -0700, Dan Williams wrote:
> > > >
> > > > I cannot reproduce the issue.
> > > >
> > > > Could you share your kernel kernel config?
> > > 
> > > Kernel config available here:
> > > https://gist.github.com/djbw/2b99a014396cca9f4406586573be98c0
> > 
> > Patch below should help. Please check.
> > 
> > diff --git a/arch/x86/mm/init_64.c b/arch/x86/mm/init_64.c
> > index a242139df8fe..745e5e183169 100644
> > --- a/arch/x86/mm/init_64.c
> > +++ b/arch/x86/mm/init_64.c
> > @@ -962,7 +962,7 @@ remove_pud_table(pud_t *pud_start, unsigned long addr, unsigned long end,
> >  			continue;
> >  		}
> >  
> > -		pmd_base = (pmd_t *)pud_page_vaddr(*pud);
> > +		pmd_base = pmd_offset(pud, 0);
> >  		remove_pmd_table(pmd_base, addr, next, direct);
> >  		free_pmd_table(pmd_base, pud);
> >  	}
> > @@ -988,7 +988,7 @@ remove_p4d_table(p4d_t *p4d_start, unsigned long addr, unsigned long end,
> >  
> >  		BUILD_BUG_ON(p4d_large(*p4d));
> >  
> > -		pud_base = (pud_t *)p4d_page_vaddr(*p4d);
> > +		pud_base = pud_offset(p4d, 0);
> >  		remove_pud_table(pud_base, addr, next, direct);
> >  		free_pud_table(pud_base, p4d);
> >  	}
> > @@ -1013,7 +1013,7 @@ remove_pagetable(unsigned long start, unsigned long end, bool direct)
> >  		if (!pgd_present(*pgd))
> >  			continue;
> >  
> > -		p4d = (p4d_t *)pgd_page_vaddr(*pgd);
> > +		p4d = p4d_offset(pgd, 0);
> >  		remove_p4d_table(p4d, addr, next, direct);
> >  	}
> 
> Type casts are dangerous, chapter 378. I missed them when applying the patches.
> 
> Could you please double-check all other type casts introduced by the 5-level 
> paging patches, to make sure it's all using natural type conversions?

I looked though at the rest of (p4d_t) and (p4d_t *) casts and they look
okay: under pgd_none()/!pgd_preset() or within #if PTRS_PER_P4d > 1.

I'll prepare proper patch.

-- 
 Kirill A. Shutemov

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


Thread

Re: [tip:x86/mm] x86: Convert the rest of the code to support p4d_t Dan Williams <dan.j.williams@intel.com> - 2017-04-23 22:00 +0200
  Re: [tip:x86/mm] x86: Convert the rest of the code to support p4d_t "Kirill A. Shutemov" <kirill@shutemov.name> - 2017-04-24 19:00 +0200
    Re: [tip:x86/mm] x86: Convert the rest of the code to support p4d_t Dan Williams <dan.j.williams@intel.com> - 2017-04-24 20:50 +0200
      Re: [tip:x86/mm] x86: Convert the rest of the code to support p4d_t "Kirill A. Shutemov" <kirill.shutemov@linux.intel.com> - 2017-04-25 03:10 +0200
        Re: [tip:x86/mm] x86: Convert the rest of the code to support p4d_t Ingo Molnar <mingo@kernel.org> - 2017-04-25 08:40 +0200
          Re: [tip:x86/mm] x86: Convert the rest of the code to support p4d_t "Kirill A. Shutemov" <kirill@shutemov.name> - 2017-04-25 11:10 +0200

csiph-web