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]
Date:   Wed, 26 Oct 2022 11:24:41 +0200
From:   Borislav Petkov <bp@...en8.de>
To:     Juergen Gross <jgross@...e.com>
Cc:     linux-kernel@...r.kernel.org, x86@...nel.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 v4 05/16] x86/mtrr: split MTRR specific handling from
 cache dis/enabling

On Tue, Oct 04, 2022 at 10:10:12AM +0200, Juergen Gross wrote:
> @@ -764,11 +779,8 @@ void cache_disable(void) __acquires(cache_disable_lock)
>  	count_vm_tlb_event(NR_TLB_LOCAL_FLUSH_ALL);
>  	flush_tlb_local();
>  
> -	/* Save MTRR state */
> -	rdmsr(MSR_MTRRdefType, deftype_lo, deftype_hi);
> -
> -	/* Disable MTRRs, and set the default type to uncached */
> -	mtrr_wrmsr(MSR_MTRRdefType, deftype_lo & ~0xcff, deftype_hi);
> +	if (boot_cpu_has(X86_FEATURE_MTRR))

check_for_deprecated_apis: Warning: arch/x86/kernel/cpu/mtrr/generic.c:782: Do not use boot_cpu_has() - use cpu_feature_enabled() instead.

> +		mtrr_disable();
>  
>  	/* Again, only flush caches if we have to. */
>  	if (!static_cpu_has(X86_FEATURE_SELFSNOOP))
> @@ -781,8 +793,8 @@ void cache_enable(void) __releases(cache_disable_lock)
>  	count_vm_tlb_event(NR_TLB_LOCAL_FLUSH_ALL);
>  	flush_tlb_local();
>  
> -	/* Intel (P6) standard MTRRs */
> -	mtrr_wrmsr(MSR_MTRRdefType, deftype_lo, deftype_hi);
> +	if (boot_cpu_has(X86_FEATURE_MTRR))

Ditto.

-- 
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