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: <20230804075504.MxYvbNle@linutronix.de>
Date:   Fri, 4 Aug 2023 09:55:04 +0200
From:   Sebastian Andrzej Siewior <bigeasy@...utronix.de>
To:     Sohil Mehta <sohil.mehta@...el.com>
Cc:     linux-kernel@...r.kernel.org, x86@...nel.org,
        "H. Peter Anvin" <hpa@...or.com>, Borislav Petkov <bp@...en8.de>,
        Dave Hansen <dave.hansen@...ux.intel.com>,
        Ingo Molnar <mingo@...hat.com>,
        Thomas Gleixner <tglx@...utronix.de>
Subject: Re: [PATCH] x86/microcode: Remove microcode_mutex.

On 2023-08-03 14:15:13 [-0700], Sohil Mehta wrote:
> Nit: The full stop at the end is not needed.
> 
> On 8/3/2023 1:32 AM, Sebastian Andrzej Siewior wrote:
> > microcode_mutex is only used by reload_store().  It has a comment saying
> > "to synchronize with each other". This probably means the sysfs
> > interface vs the legacy interface which was removed in commit
> > 181b6f40e9ea8 ("x86/microcode: Rip out the OLD_INTERFACE").
> > 
> 
> There is also commit b6f86689d5b7 ("x86/microcode: Rip out the subsys
> interface gunk") which last year removed another usage of microcode_mutex.

Okay.

> > The sysfs interface does not need additional synchronisation vs itself
> > because it is provided as kernfs_ops::mutex which is acquired in
> > kernfs_fop_write_iter().
> > 
> > Remove superfluous microcode_mutex.
> 
> I agree, the current usage does look unnecessary.
> 
> Maybe reword the commit message to say that after these two Rip outs
> there are no of *other* usages of microcode_mutex to synchronize with?

Okay.

> > Signed-off-by: Sebastian Andrzej Siewior <bigeasy@...utronix.de>
> > ---
> > This poped up as "defined but not used" on RT builds without
> > CONFIG_MICROCODE_LATE_LOADING enabled.
> 
> This issue has been raised a couple of times recently but the
> justification has been deemed insufficient since it can't be reproduced
> with a .config file.

The PREEMPT_RT's implementation of struct mutex is different which makes
it easier for the compiler to spot an used mutex. The !RT's
implementation has list_head pointing to the mutex as part of
MUTEX_INIT which marks the variable as used.

> See:
> https://lore.kernel.org/lkml/20230324114720.1756466-1-john.ogness@linutronix.de/
> 
> and
> 
> https://lore.kernel.org/lkml/20230522062713.427998-1-christian.gmeiner@gmail.com/
> 
> However, your current justification of not needing the mutex itself
> seems reasonable to me.

So everyone tried to move it but me…

…
> The code changes look fine to me.
> 
> You can also add below to the patch.

Will do.

Sebastian

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ