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] [thread-next>] [day] [month] [year] [list]
Message-Id: <1f549637-773a-868c-effd-5614e85aa892@linux.vnet.ibm.com>
Date:   Wed, 5 Jul 2017 09:56:30 +0530
From:   "Aneesh Kumar K.V" <aneesh.kumar@...ux.vnet.ibm.com>
To:     Victor Aoqui <victora@...ibm.com>, linux-kernel@...r.kernel.org,
        linuxppc-dev@...ts.ozlabs.org, mpe@...erman.id.au
Cc:     victora@...ux.vnet.ibm.com
Subject: Re: [PATCH] powerpc/mm: Implemented default_hugepagesz verification
 for powerpc



On Tuesday 04 July 2017 01:35 AM, Victor Aoqui wrote:
> Implemented default hugepage size verification (default_hugepagesz=)
> in order to allow allocation of defined number of pages (hugepages=)
> only for supported hugepage sizes.
> 
> Signed-off-by: Victor Aoqui <victora@...ibm.com>
> ---
>   arch/powerpc/mm/hugetlbpage.c | 15 +++++++++++++++
>   1 file changed, 15 insertions(+)
> 
> diff --git a/arch/powerpc/mm/hugetlbpage.c b/arch/powerpc/mm/hugetlbpage.c
> index a4f33de..464e72e 100644
> --- a/arch/powerpc/mm/hugetlbpage.c
> +++ b/arch/powerpc/mm/hugetlbpage.c
> @@ -797,6 +797,21 @@ static int __init hugepage_setup_sz(char *str)
>   }
>   __setup("hugepagesz=", hugepage_setup_sz);
> 
> +static int __init default_hugepage_setup_sz(char *str)
> +{
> +        unsigned long long size;
> +
> +        size = memparse(str, &str);
> +
> +        if (add_huge_page_size(size) != 0) {
> +                hugetlb_bad_size();
> +                pr_err("Invalid default huge page size specified(%llu)\n", size);
> +        }
> +
> +        return 1;
> +}
> +__setup("default_hugepagesz=", default_hugepage_setup_sz);

isn't that a behavior change in what we have now ? . Right now if size 
specified is not supported, we fallback to HPAGE_SIZE.

mm/hugetlb.c

	if (!size_to_hstate(default_hstate_size)) {
		default_hstate_size = HPAGE_SIZE;
		if (!size_to_hstate(default_hstate_size))
			hugetlb_add_hstate(HUGETLB_PAGE_ORDER);
	}


> +
>   struct kmem_cache *hugepte_cache;
>   static int __init hugetlbpage_init(void)
>   {
> 

Even if we want to do this, this should be done in generic code and 
should not be powerpc specific

-aneesh

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ