treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 234Based on 1 normalized pattern(s): this program is free software you can redistribute it and or modify it under the terms of th
treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 234Based on 1 normalized pattern(s): this program is free software you can redistribute it and or modify it under the terms of the gnu general public license version 2 as published by the free software foundation this program is distributed in the hope that it will be useful but without any warranty without even the implied warranty of merchantability or fitness for a particular purpose see the gnu general public license for more details you should have received a copy of the gnu general public license along with this program if not see http www gnu org licensesextracted by the scancode license scanner the SPDX license identifier GPL-2.0-onlyhas been chosen to replace the boilerplate/reference in 503 file(s).Signed-off-by: Thomas Gleixner <tglx@linutronix.de>Reviewed-by: Alexios Zavras <alexios.zavras@intel.com>Reviewed-by: Allison Randal <allison@lohutok.net>Reviewed-by: Enrico Weigelt <info@metux.net>Cc: linux-spdx@vger.kernel.orgLink: https://lkml.kernel.org/r/20190602204653.811534538@linutronix.deSigned-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
show more ...
treewide: Add SPDX license identifier - Makefile/KconfigAdd SPDX license identifiers to all Make/Kconfig files which: - Have no license information of any formThese files fall under the project
treewide: Add SPDX license identifier - Makefile/KconfigAdd SPDX license identifiers to all Make/Kconfig files which: - Have no license information of any formThese files fall under the project license, GPL v2 only. The resulting SPDXlicense identifier is: GPL-2.0-onlySigned-off-by: Thomas Gleixner <tglx@linutronix.de>Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
nios2: memset: use the right constraint modifier for the %4 output operandDepending on the size of the area to be memset'ed, the nios2 memset implementationeither uses a naive loop (for buffers sm
nios2: memset: use the right constraint modifier for the %4 output operandDepending on the size of the area to be memset'ed, the nios2 memset implementationeither uses a naive loop (for buffers smaller or equal than 8 bytes) or a more optimizedimplementation (for buffers larger than 8 bytes). This implementation does 4-byte storesrather than 1-byte stores to speed up memset.However, we discovered that on our nios2 platform, memset() was not properly setting thebuffer to the expected value. A memset of 0xff would not set the entire buffer to 0xff, but to:0xff 0x00 0xff 0x00 0xff 0x00 0xff 0x00 ...Which is obviously incorrect. Our investigation has revealed that the problem lies in theincorrect constraints used in the inline assembly.The following piece of assembly, from the nios2 memset implementation, is supposed tocreate a 4-byte value that repeats 4 times the 1-byte pattern passed as memset argument:/* fill8 %3, %5 (c & 0xff) */" slli %4, %5, 8\n"" or %4, %4, %5\n"" slli %3, %4, 16\n"" or %3, %3, %4\n"However, depending on the compiler and optimization level, this code might be compiled as:34: 280a923a slli r5,r5,838: 294ab03a or r5,r5,r53c: 2808943a slli r4,r5,1640: 2148b03a or r4,r4,r5This is wrong because r5 gets used both for %5 and %4, which leads to the final patternstored in r4 to be 0xff00ff00 rather than the expected 0xffffffff.%4 is defined with the "=r" constraint, i.e as an output operand. However, as explained inhttp://www.ethernut.de/en/documents/arm-inline-asm.html, this does not prevent gcc fromusing the same register for an output operand (%4) and input operand (%5). By using theconstraint modifier '&', we indicate that the register should be used for output only. With thischange, we get the following assembly output:34: 2810923a slli r8,r5,838: 4150b03a or r8,r8,r53c: 400e943a slli r7,r8,1640: 3a0eb03a or r7,r7,r8Which correctly produces the 0xffffffff pattern when 0xff is passed as the memset() pattern.It is worth mentioning the observed consequence of this bug: we were hitting the kernelBUG() in mm/bootmem.c:__free() that verifies when marking a page as free that it waspreviously marked as occupied (i.e that the bit was set to 1). The entire bootmem bitmap isset to 0xff bit via a memset() during the bootmem initialization. The bootmem_free() call rightafter the initialization was finding some bits to be set to 0, which didn't make sense since thebitmap has just been memset'ed to 0xff. Except that due to the bug explained above, thebitmap was in fact initialized to 0xff00ff00.Thanks to Marek Vasut for his help and feedback.Signed-off-by: Romain Perier <romain.perier@free-electrons.com>Acked-by: Marek Vasut <marex@denx.de>Acked-by: Ley Foon Tan <lftan@altera.com>
nios2: Remove unnecessary #ifdef guards__HAVE_ARCH_MEMMOVE and __HAVE_ARCH_MEMSET are unconditionally definedfor nios2, so there is no need to protect the function definitions ofmemmove() and mem
nios2: Remove unnecessary #ifdef guards__HAVE_ARCH_MEMMOVE and __HAVE_ARCH_MEMSET are unconditionally definedfor nios2, so there is no need to protect the function definitions ofmemmove() and memset().Signed-off-by: Tobias Klauser <tklauser@distanz.ch>Acked-by: Ley Foon Tan <lftan@altera.com>
nios2: Build infrastructureThis patch adds Makefile and Kconfig files required for building anios2 kernel.Signed-off-by: Ley Foon Tan <lftan@altera.com>
nios2: Time keepingAdd time keeping code for nios2.Signed-off-by: Ley Foon Tan <lftan@altera.com>Reviewed-by: Thomas Gleixner <tglx@linutronix.de>
nios2: Library functionsAdd optimised library functions for nios2.Signed-off-by: Ley Foon Tan <lftan@altera.com>