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
| ||
|
Date: Thu, 18 Feb 2016 11:19:42 +0100 From: Ingo Molnar <mingo@...nel.org> To: Peter Zijlstra <peterz@...radead.org> Cc: Tony Luck <tony.luck@...el.com>, linux-kernel@...r.kernel.org, Thomas Gleixner <tglx@...utronix.de>, "H. Peter Anvin" <hpa@...or.com>, Borislav Petkov <bp@...en8.de>, Linus Torvalds <torvalds@...ux-foundation.org>, Andrew Morton <akpm@...ux-foundation.org> Subject: Re: [PATCH v11 3/4] x86, mce: Add __mcsafe_copy() * Peter Zijlstra <peterz@...radead.org> wrote: > On Thu, Feb 18, 2016 at 09:21:07AM +0100, Ingo Molnar wrote: > > > > * Tony Luck <tony.luck@...el.com> wrote: > > > > > Make use of the EXTABLE_FAULT exception table entries. This routine > > > returns a structure to indicate the result of the copy: > > > > So the series looks good to me, but I have some (mostly readability) comments that > > went beyond what I usually fix up manually: > > > > > struct mcsafe_ret { > > > u64 trapnr; > > > u64 remain; > > > }; > > > > > +struct mcsafe_ret { > > > + u64 trapnr; > > > + u64 remain; > > > +}; > > > > Yeah, so please change this to something like: > > > > struct mcsafe_ret { > > u64 trap_nr; > > u64 bytes_left; > > }; > > > > this makes it crystal clear what the fields are about and what their unit is. > > Readability is king and modern consoles are wide enough, no need to abbreviate > > excessively. > > I prefer to use my modern console width to display multiple columns of > text, instead of wasting it to display mostly whitespace. Therefore I > still very much prefer ~80 char wide code. This naming won't hurt the col80 limit. > > Also, I'd suggest we postfix the new mcsafe functions with '_mcsafe', not > > prefix them. Special properties of memcpy routines are usually postfixes - > > such as _nocache(), _toio(), etc. > > I think the whole notion of mcsafe here is 'wrong'. This copy variant simply > reports the kind of trap that happened (#PF or #MC) and could arguably be > extended to include more types if the hardware were to generate more. What would a better name be? memcpy_ret() or so? Thanks, Ingo
Powered by blists - more mailing lists