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: <BC2AFFA3-9972-4370-945D-6CCF43F0448E@vmware.com>
Date:   Sun, 21 Jul 2019 20:21:11 +0000
From:   Nadav Amit <namit@...are.com>
To:     Dave Hansen <dave.hansen@...el.com>
CC:     Andy Lutomirski <luto@...nel.org>,
        Dave Hansen <dave.hansen@...ux.intel.com>,
        "x86@...nel.org" <x86@...nel.org>,
        "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
        Peter Zijlstra <peterz@...radead.org>,
        Thomas Gleixner <tglx@...utronix.de>,
        Ingo Molnar <mingo@...hat.com>
Subject: Re: [PATCH v3 5/9] x86/mm/tlb: Privatize cpu_tlbstate

> On Jul 19, 2019, at 11:38 AM, Dave Hansen <dave.hansen@...el.com> wrote:
> 
> On 7/18/19 5:58 PM, Nadav Amit wrote:
>> +struct tlb_state_shared {
>> +	/*
>> +	 * We can be in one of several states:
>> +	 *
>> +	 *  - Actively using an mm.  Our CPU's bit will be set in
>> +	 *    mm_cpumask(loaded_mm) and is_lazy == false;
>> +	 *
>> +	 *  - Not using a real mm.  loaded_mm == &init_mm.  Our CPU's bit
>> +	 *    will not be set in mm_cpumask(&init_mm) and is_lazy == false.
>> +	 *
>> +	 *  - Lazily using a real mm.  loaded_mm != &init_mm, our bit
>> +	 *    is set in mm_cpumask(loaded_mm), but is_lazy == true.
>> +	 *    We're heuristically guessing that the CR3 load we
>> +	 *    skipped more than makes up for the overhead added by
>> +	 *    lazy mode.
>> +	 */
>> +	bool is_lazy;
>> +};
>> +DECLARE_PER_CPU_SHARED_ALIGNED(struct tlb_state_shared, cpu_tlbstate_shared);
> 
> Could we get a comment about what "shared" means and why we need shared
> state?
> 
> Should we change 'tlb_state' to 'tlb_state_private’?

I don’t feel strongly about either one. I perferred the one that is likely
to cause fewer changes and potential conflicts. Anyhow, I would add a better
comment as you asked for.

So it is really up to you.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ