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: <8098a229-e853-12fc-c8e8-d5e2cb4436a2@intel.com>
Date:   Tue, 12 Mar 2019 16:43:25 -0700
From:   Dave Hansen <dave.hansen@...el.com>
To:     Fenghua Yu <fenghua.yu@...el.com>,
        Thomas Gleixner <tglx@...utronix.de>,
        Ingo Molnar <mingo@...hat.com>, H Peter Anvin <hpa@...or.com>,
        Paolo Bonzini <pbonzini@...hat.com>,
        Ashok Raj <ashok.raj@...el.com>,
        Peter Zijlstra <peterz@...radead.org>,
        Xiaoyao Li <xiaoyao.li@...el.com>,
        Michael Chan <michael.chan@...adcom.com>,
        Ravi V Shankar <ravi.v.shankar@...el.com>
Cc:     linux-kernel <linux-kernel@...r.kernel.org>, x86 <x86@...nel.org>,
        linux-wireless@...r.kernel.org, netdev@...r.kernel.org,
        kvm@...r.kernel.org
Subject: Re: [PATCH v5 12/18] x86/split_lock: Enable #AC for split lock by
 default

On 3/12/19 4:00 PM, Fenghua Yu wrote:
> Split locked access locks bus and degradates overall memory access

Either "split locked accesses lock" or "A split lock access locks".

s/degradates/degrades/

> performance. When split lock detection feature is enumerated, we want to

		   ^ the

Also, you need to go back and remove all the "we"'s.  Our friendly x86
maintainers prefer phrasing this like:

	 When split lock detection feature is enumerated, enable the 	
	feature...

> enable the feature by default to find any split lock issue and then fix
> the issue.

Generally, the changelogs here are passable but pretty rough.  They have
a ton of issues like this and I'm sure they can be improved.  I'm sure
that with some love an attention they can be brought up to the highest
standards.

> +#define DISABLE_SPLIT_LOCK_DETECT 0
> +#define ENABLE_SPLIT_LOCK_DETECT  1

These are a bit overkill, but oh well.

> +static int split_lock_detect_val;
> +
>  /*
>   * Just in case our CPU detection goes bad, or you have a weird system,
>   * allow a way to override the automatic disabling of MPX.
> @@ -161,10 +166,35 @@ static bool bad_spectre_microcode(struct cpuinfo_x86 *c)
>  	return false;
>  }
>  
> +static u32 new_sp_test_ctl_val(u32 test_ctl_val)
> +{
> +	/* Change the split lock setting. */
> +	if (split_lock_detect_val == DISABLE_SPLIT_LOCK_DETECT)
> +		test_ctl_val &= ~TEST_CTL_ENABLE_SPLIT_LOCK_DETECT;
> +	else
> +		test_ctl_val |= TEST_CTL_ENABLE_SPLIT_LOCK_DETECT;
> +
> +	return test_ctl_val;
> +}
> +
> +static void init_split_lock_detect(struct cpuinfo_x86 *c)
> +{
> +	if (cpu_has(c, X86_FEATURE_SPLIT_LOCK_DETECT)) {
> +		u32 l, h;
> +
> +		rdmsr(MSR_TEST_CTL, l, h);
> +		l = new_sp_test_ctl_val(l);
> +		wrmsr(MSR_TEST_CTL, l, h);
> +		pr_info_once("#AC for split lock is enabled\n");
> +	}
> +}

Please make sure you've removed all the "#AC for split lock"
nomenclature in these patches.  It's acronym nonsense and there's no
reason to be so oblique.  Just say "split lock detection enabled".  This
also needs a proper prefix, like "x86/intel:".  Look around for examples.


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ