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: <a936a943-9d8f-7e3c-af38-1c99ae176e1f@intel.com>
Date:   Wed, 27 Jan 2021 15:41:05 -0800
From:   Dave Hansen <dave.hansen@...el.com>
To:     Saravanan D <saravanand@...com>, x86@...nel.org,
        dave.hansen@...ux.intel.com, luto@...nel.org, peterz@...radead.org
Cc:     linux-kernel@...r.kernel.org, kernel-team@...com
Subject: Re: [PATCH V3] x86/mm: Tracking linear mapping split events

On 1/27/21 2:50 PM, Saravanan D wrote:
> +#if defined(__x86_64__)

We don't use __x86_64__ in the kernel.  This should be CONFIG_X86.

> +#if defined(CONFIG_X86_64) || defined(CONFIG_X86_PAE)
> +	"direct_map_2M_splits",
> +#else
> +	"direct_map_4M_splits",
> +#endif
> +	"direct_map_1G_splits",
> +#endif

These #ifdefs are hideous, and repeated.

I'd rather have no 32-bit support than expose us to this ugliness.
Worst case, the 32-bit non-PAE folks (i.e. almost nobody in the world)
can just live with seeing "2M" when the mappings are really 4M.  Or, you
*could* name these after the page table levels:

	direct_map_pmd_splits
	direct_map_pud_splits

or the level from the bottom where the split occurred:

	direct_map_level2_splits
	direct_map_level3_splits

That has the bonus of being usable on other architectures.

Oh, and 1G splits aren't possible on non-PAE 32-bit.  There are only 2
levels: 4M and 4k, which would make what you have above:

> +#if defined(CONFIG_X86_64) || defined(CONFIG_X86_PAE)
> +	"direct_map_2M_splits",
> +	"direct_map_1G_splits",
> +#else
> +	"direct_map_4M_splits",
> +#endif

I don't think there's ever a 1G/4M case.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ