Re: [PATCH] um/asm: Replace "REP; NOP" with PAUSE mnemonic

2025-04-15 Thread David Laight
On Mon, 14 Apr 2025 16:55:57 +0200 Uros Bizjak wrote: > Current minimum required version of binutils is 2.25, > which supports PAUSE instruction mnemonic. > > Replace "REP; NOP" with this proper mnemonic. > > No functional change intended. > > Signed-off-by: Uros Bizjak > Cc: Richard Weinberg

RE: [PATCH v7 01/10] Consolidate IO memcpy/memset into iomap_copy.c

2024-10-06 Thread David Laight
From: Richard Henderson > Sent: 03 October 2024 17:47 > > On 9/30/24 06:23, Julian Vetter wrote: > > +void memset_io(volatile void __iomem *dst, int c, size_t count) > > +{ > > + uintptr_t qc = (u8)c; > > Missed one change to 'long' > > > + > > + qc |= qc << 8; > > + qc |= qc << 16; > > +

RE: [PATCH v3 3/4] string: Allow 2-argument strscpy_pad()

2024-02-10 Thread David Laight
From: Kees Cook > Sent: 07 February 2024 09:19 > > On Wed, Feb 07, 2024 at 12:51:51AM +, Justin Stitt wrote: > > Hi, > > > > On Tue, Feb 06, 2024 at 06:22:18AM -0800, Kees Cook wrote: > > > Similar to strscpy(), update strscpy_pad()'s 3rd argument to be > > > optional when the destination is a

RE: Missing clobber on alternative use on Linux UM 32-bit

2023-11-05 Thread David Laight
From: Nadav Amit > Sent: 04 November 2023 09:41 > > > On Nov 4, 2023, at 11:34 AM, Anton Ivanov > > wrote: > > > > On 04/11/2023 09:25, Nadav Amit wrote: > >> > >> I was reading (again) the x86 C macro of “alternative()” and I was a bit > >> surprised it does clobber the flags (“cc”) as a precau

RE: Arches that don't support PREEMPT

2023-09-20 Thread David Laight
From: Linus Torvalds > Sent: 19 September 2023 18:25 > > On Tue, 19 Sept 2023 at 06:48, John Paul Adrian Glaubitz > wrote: > > > > As Geert poined out, I'm not seeing anything particular problematic with the > > architectures lacking CONFIG_PREEMPT at the moment. This seems to be more > > somethi

RE: [PATCH v4 4/6] treewide: use get_random_u32() when possible

2022-10-08 Thread David Laight
From: Jason A. Donenfeld > Sent: 07 October 2022 19:01 > > The prandom_u32() function has been a deprecated inline wrapper around > get_random_u32() for several releases now, and compiles down to the > exact same code. Replace the deprecated wrapper with a direct call to > the real function. The s

RE: [PATCH v4 2/6] treewide: use prandom_u32_max() when possible

2022-10-08 Thread David Laight
From: Jason A. Donenfeld > Sent: 07 October 2022 19:01 > > Rather than incurring a division or requesting too many random bytes for > the given range, use the prandom_u32_max() function, which only takes > the minimum required bytes from the RNG and avoids divisions. > ... > --- a/lib/cmdline_kun

RE: [PATCH v3 3/5] treewide: use get_random_u32() when possible

2022-10-08 Thread David Laight
From: Jason A. Donenfeld > Sent: 07 October 2022 18:56 ... > > Given these kinds of less mechanical changes, it may make sense to split > > these from the "trivial" conversions in a treewide patch. The chance of > > needing a revert from the simple 1:1 conversions is much lower than the > > need to

RE: [PATCH v3 3/5] treewide: use get_random_u32() when possible

2022-10-07 Thread David Laight
From: Christophe Leroy > Sent: 06 October 2022 18:43 ... > But taking into account that sp must remain 16 bytes aligned, would it > be better to do something like ? > > sp -= prandom_u32_max(PAGE_SIZE >> 4) << 4; That makes me think... If prandom_u32_max() is passed a (constant) power of 2

RE: [PATCH v2 2/2] asm-generic: Add new pci.h and use it

2022-07-19 Thread David Laight
From: Stafford Horne > Sent: 19 July 2022 13:24 > > On Tue, Jul 19, 2022 at 01:55:03PM +0200, Arnd Bergmann wrote: > > On Tue, Jul 19, 2022 at 12:55 PM Stafford Horne wrote: > > > > > diff --git a/drivers/comedi/drivers/comedi_isadma.c > > > b/drivers/comedi/drivers/comedi_isadma.c > > > index 7

RE: [PATCH 1/2] x86/lib: Optimize memchr()

2022-06-01 Thread David Laight
From: Yu-Jen Chang > Sent: 01 June 2022 06:59 > > David Laight 於 2022年5月30日 週一 下午4:10寫道: > > > > From: Yu-Jen Chang > > > Sent: 28 May 2022 09:13 > > > > > > The original assembly version of memchr() is implemented with > > > the byte-wi

RE: [PATCH 1/2] x86/lib: Optimize memchr()

2022-05-30 Thread David Laight
From: Yu-Jen Chang > Sent: 28 May 2022 09:13 > > The original assembly version of memchr() is implemented with > the byte-wise comparing technique, which does not fully > use 64-bits registers in x86_64 CPU. We use word-wide > comparing so that 8 characters can be compared at the same time > on x8