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: <Y+dpJ5BY1gI9jaI2@zn.tnic>
Date:   Sat, 11 Feb 2023 11:08:39 +0100
From:   Borislav Petkov <bp@...en8.de>
To:     Juergen Gross <jgross@...e.com>
Cc:     linux-kernel@...r.kernel.org, x86@...nel.org,
        lists@...dbynature.de, mikelley@...rosoft.com,
        torvalds@...ux-foundation.org,
        Thomas Gleixner <tglx@...utronix.de>,
        Ingo Molnar <mingo@...hat.com>,
        Dave Hansen <dave.hansen@...ux.intel.com>,
        "H. Peter Anvin" <hpa@...or.com>
Subject: Re: [PATCH v2 1/8] x86/mtrr: split off physical address size
 calculation

On Thu, Feb 09, 2023 at 08:22:13AM +0100, Juergen Gross wrote:
> @@ -654,42 +638,54 @@ void __init mtrr_bp_init(void)
>  			    (boot_cpu_data.x86_stepping == 0x3 ||
>  			     boot_cpu_data.x86_stepping == 0x4))
>  				phys_addr = 36;
> -
> -			size_or_mask = SIZE_OR_MASK_BITS(phys_addr);
> -			size_and_mask = ~size_or_mask & 0xfffff00000ULL;
>  		} else if (boot_cpu_data.x86_vendor == X86_VENDOR_CENTAUR &&
>  			   boot_cpu_data.x86 == 6) {
>  			/*
>  			 * VIA C* family have Intel style MTRRs,
>  			 * but don't support PAE
>  			 */
> -			size_or_mask = SIZE_OR_MASK_BITS(32);
> -			size_and_mask = 0;
>  			phys_addr = 32;
>  		}
> +	}
> +
> +	size_or_mask = ~((1ULL << ((phys_addr) - PAGE_SHIFT)) - 1);

Too many brackets because you've taken the macro and put in the argument
directly.

In any case, reviewing patches which do code movement *and* changes in
the same diff is always unnecessarily nasty. Please do the mechanical
code movement only - cleanups come ontop.

Thx.

-- 
Regards/Gruss,
    Boris.

https://people.kernel.org/tglx/notes-about-netiquette

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ