lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date:	Mon, 02 Mar 2015 17:37:11 -0700
From:	Toshi Kani <toshi.kani@...com>
To:	Dave Hansen <dave.hansen@...el.com>
Cc:	akpm@...ux-foundation.org, hpa@...or.com, tglx@...utronix.de,
	mingo@...hat.com, arnd@...db.de, linux-mm@...ck.org,
	x86@...nel.org, linux-kernel@...r.kernel.org, Elliott@...com
Subject: Re: [PATCH v2 5/7] x86, mm: Support huge KVA mappings on x86

On Tue, 2015-02-10 at 16:10 -0700, Toshi Kani wrote:
> On Tue, 2015-02-10 at 15:13 -0700, Toshi Kani wrote:
> > On Tue, 2015-02-10 at 12:51 -0800, Dave Hansen wrote:
> > > On 02/10/2015 12:42 PM, Toshi Kani wrote:
> > > > On Tue, 2015-02-10 at 10:59 -0800, Dave Hansen wrote:
> > > >> On 02/09/2015 02:45 PM, Toshi Kani wrote:
> > > >>> Implement huge KVA mapping interfaces on x86.  Select
> > > >>> HAVE_ARCH_HUGE_VMAP when X86_64 or X86_32 with X86_PAE is set.
> > > >>> Without X86_PAE set, the X86_32 kernel has the 2-level page
> > > >>> tables and cannot provide the huge KVA mappings.
> > > >>
> > > >> Not that it's a big deal, but what's the limitation with the 2-level
> > > >> page tables on 32-bit?  We have a 4MB large page size available there
> > > >> and we already use it for the kernel linear mapping.
> > > > 
> > > > ioremap() calls arch-neutral ioremap_page_range() to set up I/O mappings
> > > > with PTEs.  This patch-set enables ioremap_page_range() to set up PUD &
> > > > PMD mappings.  With 2-level page table, I do not think this PUD/PMD
> > > > mapping code works unless we add some special code.
> > > 
> > > What actually breaks, though?
> > > 
> > > Can't you just disable the pud code via ioremap_pud_enabled()?
> > 
> > That's what v1 did, and I found in testing that the PMD mapping code did
> > not work when PAE was unset.  I think we need special handling similar
> > to one_md_table_init(), which returns pgd as pmd in case of non-PAE.
> > ioremap_page_range() does not have such handling and I thought it would
> > not be worth adding it.
> 
> Actually pud_alloc() and pmd_alloc() should carry pgd in this case...  I
> will look into the problem to see why it did not work when PAE was
> unset.

I have looked at this case, 32bit without PAE, and confirmed that it set
pgd properly.  crash can translate an address with the mapping as well.
However, there is something missing in the code that the kernel cannot
access to a page with the mapping (page fault).  I tried TLB flush, but
it did not help, either.  Since this config can unlikely be benefited by
this feature, I will have to continue to disable this case.  I hope that
is OK.  

Thanks,
-Toshi

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ