- 10 Sep, 2024 3 commits
-
-
Kris Van Hees authored
In order to create the file at build time, modules.builtin.ranges, that contains the range of addresses for all built-in modules, there needs to be a way to identify what code is compiled into modules. To identify what code is compiled into modules during a kernel build, one can look for the presence of the -DKBUILD_MODFILE and -DKBUILD_MODNAME options in the compile command lines. A simple grep in .*.cmd files for those options is sufficient for this. Unfortunately, these options are only passed when compiling C source files. Various modules also include objects built from assembler source, and these options are not passed in that case. Adding $(modfile_flags) to modkern_aflags (similar to modkern_cflags), and adding $(modname_flags) to a_flags (similar to c_flags) makes it possible to identify which objects are compiled into modules for both C and assembler source files. While KBUILD_MODFILE is sufficient to generate the modules ranges data, KBUILD_MODNAME is passed as well for consistency with the C source code case. Signed-off-by: Kris Van Hees <kris.van.hees@oracle.com> Reviewed-by: Steven Rostedt (Google) <rostedt@goodmis.org> Tested-by: Sam James <sam@gentoo.org> Reviewed-by: Sami Tolvanen <samitolvanen@google.com> Tested-by: Sami Tolvanen <samitolvanen@google.com> Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
-
Nick Desaulniers authored
When building the Linux kernel on an aarch64 macOS based host, if we don't specify a value for ARCH when invoking make, we default to arm and thus multi_v7_defconfig rather than the expected arm64 and arm64's defconfig. This is because subarch.include invokes `uname -m` which on MacOS hosts evaluates to `arm64` but on Linux hosts evaluates to `aarch64`, This allows us to build ARCH=arm64 natively on macOS (as in ARCH need not be specified on an aarch64-based system). Avoid matching arm64 by excluding it from the arm.* sed expression. Signed-off-by: Nick Desaulniers <nick.desaulniers@gmail.com> Suggested-by: Nicolas Schier <nicolas@fjasle.eu> Signed-off-by: Daniel Gomez <da.gomez@samsung.com> Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
-
Masahiro Yamada authored
Add more macros used for removing hash table entries. Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
-
- 09 Sep, 2024 1 commit
-
-
Masahiro Yamada authored
scripts/Makefile.lib is included not only from scripts/Makefile.build but also from scripts/Makefile.{modfinal,package,vmlinux,vmlinux_o}, where DT build rules are not required. Split the DT build rules out to scripts/Makefile.dtbs, and include it only when necessary. While I was here, I added $(DT_TMP_SCHEMA) as a prerequisite of $(multi-dtb-y). Signed-off-by: Masahiro Yamada <masahiroy@kernel.org> Reviewed-by: Rob Herring (Arm) <robh@kernel.org>
-
- 08 Sep, 2024 1 commit
-
-
Masahiro Yamada authored
Flex and Bison are used only for host programs. Move their intermediate target processing from scripts/Makefile.build to scripts/Makefile.host. Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
-
- 07 Sep, 2024 5 commits
-
-
Thomas Weißschuh authored
Various information about modules is compiled into the info sections. For that a dedicated .mod.c file is generated by modpost for each module and then linked into the module. However most of the information in the .mod.c is the same for all modules, internal and external. Split the shared information into a dedicated source file that is compiled once and then linked into all modules. This avoids frequent rebuilds for all .mod.c files when using CONFIG_LOCALVERSION_AUTO because the local version ends up in .mod.c through UTS_RELEASE and VERMAGIC_STRING. The modules are still relinked in this case. The code is also easier to maintain as it's now in a proper source file instead of an inline string literal. Signed-off-by: Thomas Weißschuh <linux@weissschuh.net> Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
-
Masahiro Yamada authored
Commit abe11dde ("ARC: [plat-arcfpga]: Enabling DeviceTree for Angel4 board") changed the default built-in DTB from "skeleton" to "angel4". Commit fd155792 ("ARC: [plat_arcfpga]->[plat_sim]") changed it from "angel4" to "nsim_700". Signed-off-by: Masahiro Yamada <masahiroy@kernel.org> Acked-by: Vineet Gupta <vgupta@kernel.org>
-
Tony Battersby authored
Remove the recently-added dependency on the truncate program for building the kernel. truncate is not available when building the kernel under Yocto. It could be added, but it would be better just to avoid the unnecessary dependency. Fixes: 1472464c ("kbuild: avoid scripts/kallsyms parsing /dev/null") Signed-off-by: Tony Battersby <tonyb@cybernetics.com> Reviewed-by: Nathan Chancellor <nathan@kernel.org> Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
-
Jose Fernandez authored
Add a new debug package to the PKGBUILD for the pacman-pkg target. The debug package includes the non-stripped vmlinux file with debug symbols for kernel debugging and profiling. The file is installed at /usr/src/debug/${pkgbase}, with a symbolic link at /usr/lib/modules/$(uname -r)/build/vmlinux. The debug package is built by default. Signed-off-by: Jose Fernandez <jose.fernandez@linux.dev> Reviewed-by: Peter Jung <ptr1337@cachyos.org> Acked-by: Thomas Weißschuh <linux@weissschuh.net> Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
-
Stephen Brennan authored
There are a few lines in the kbuild-language.rst document which obliquely reference the behavior of config options without prompts. But there is nothing in the obvious location that explicitly calls out that users cannot edit config options unless they have a prompt. Signed-off-by: Stephen Brennan <stephen.s.brennan@oracle.com> Reviewed-by: Nathan Chancellor <nathan@kernel.org> Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
-
- 01 Sep, 2024 23 commits
-
-
Masahiro Yamada authored
Commit 5ce2176b ("genksyms: adjust the output format to modpost") stopped generating *.symversions files. Remove the left-over from the .gitignore file and the 'clean' rule. Signed-off-by: Masahiro Yamada <masahiroy@kernel.org> Reviewed-by: Nathan Chancellor <nathan@kernel.org>
-
Masahiro Yamada authored
With commit cda5f94e ("modpost: avoid using the alias attribute"), only two log levels remain: LOG_WARN and LOG_ERROR. Simplify this by making it a boolean variable. Signed-off-by: Masahiro Yamada <masahiroy@kernel.org> Reviewed-by: Nathan Chancellor <nathan@kernel.org>
-
Masahiro Yamada authored
objtree is defined and exported by the top-level Makefile. I prefer not to override it. There is no need to pass the absolute path of objtree. PKGBUILD can detect it by itself. Signed-off-by: Masahiro Yamada <masahiroy@kernel.org> Acked-by: Thomas Weißschuh <linux@weissschuh.net> Reviewed-by: Nathan Chancellor <nathan@kernel.org> Reviewed-by: Christian Heusel <christian@heusel.eu>
-
Masahiro Yamada authored
All build and package functions share the following commands: export MAKEFLAGS="${KBUILD_MAKEFLAGS}" cd "${objtree}" Factor out the common code. Signed-off-by: Masahiro Yamada <masahiroy@kernel.org> Acked-by: Thomas Weißschuh <linux@weissschuh.net> Reviewed-by: Nathan Chancellor <nathan@kernel.org> Reviewed-by: Christian Heusel <christian@heusel.eu>
-
Jose Fernandez authored
Introduce the PACMAN_EXTRAPACKAGES variable in PKGBUILD to allow users to specify which additional packages are built by the pacman-pkg target. Previously, the api-headers package was always included, and the headers package was included only if CONFIG_MODULES=y. With this change, both headers and api-headers packages are included by default. Users can now control this behavior by setting PACMAN_EXTRAPACKAGES to a space-separated list of desired extra packages or leaving it empty to exclude all. For example, to build only the base package without extras: make pacman-pkg PACMAN_EXTRAPACKAGES="" Signed-off-by: Jose Fernandez <jose.fernandez@linux.dev> Reviewed-by: Peter Jung <ptr1337@cachyos.org> Reviewed-by: Nathan Chancellor <nathan@kernel.org> Tested-by: Nathan Chancellor <nathan@kernel.org> Reviewed-by: Christian Heusel <christian@heusel.eu> Tested-by: Christian Heusel <christian@heusel.eu> Acked-by: Thomas Weißschuh <linux@weissschuh.net> Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
-
Masahiro Yamada authored
This commit improves the section mismatch warning format when there is no suitable symbol name to print. The section mismatch warning prints the reference source in the form of <symbol_name>+<offset> and the reference destination in the form of <symbol_name>. However, there are some corner cases where <symbol_name> becomes "(unknown)", as reported in commit 23dfd914 ("modpost: fix null pointer dereference"). In such cases, it is better to print the symbol address. Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
-
Masahiro Yamada authored
When malloc() fails, there is not much userspace programs can do. xmalloc() is useful to bail out on a memory allocation failure. Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
-
Masahiro Yamada authored
When malloc() or realloc() fails, there is not much userspace programs can do. xmalloc() and xrealloc() are useful to bail out on a memory allocation failure. Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
-
Masahiro Yamada authored
I think x*alloc() functions are cleaner. Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
-
Masahiro Yamada authored
These functions will be useful for other host programs. Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
-
Masahiro Yamada authored
P_SYMBOL is a pseudo property that was previously used for data linking purposes. It is no longer used except for debug prints. Remove it. Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
-
Masahiro Yamada authored
I believe its last usage was in the following code: if (prop == NULL) prop = stack->sym->prop; This code was previously used to print the file name and line number of associated symbols in sym_check_print_recursive(), which was removed by commit 9d0d2660 ("kconfig: recursive checks drop file/lineno"). Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
-
Masahiro Yamada authored
Since commit ca4c74ba ("kconfig: remove P_CHOICE property"), menu_finalize() no longer calls menu_add_symbol(). No function references cur_filename or cur_lineno after yyparse(). Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
-
Masahiro Yamada authored
This reverts the following commits: - 236dec05 ("kconfig: tinyconfig: provide whole choice blocks to avoid warnings") - b0f26972 ("x86/config: Fix warning for 'make ARCH=x86_64 tinyconfig'") Since commit f79dc03f ("kconfig: refactor choice value calculation"), it is no longer necessary to disable the remaining options in choice blocks. Signed-off-by: Masahiro Yamada <masahiroy@kernel.org> Acked-by: Thomas Gleixner <tglx@linutronix.de>
-
Masahiro Yamada authored
Parallel execution is supported by GNU Make: $ make -j<N> modules_install It is questionable to enable multithreading within each zstd process by default. If you still want to do it, you can use the environment variable: $ ZSTD_NBTHREADS=<N> make modules_install Signed-off-by: Masahiro Yamada <masahiroy@kernel.org> Reviewed-by: Nicolas Schier <nicolas@fjasle.eu> Tested-by: Sedat Dilek <sedat.dilek@gmail.com>
-
Laurent Pinchart authored
Commit 3f1b0e1f (".gitignore update") added *.orig and *.rej patterns to .gitignore in v2.6.23. The commit message didn't give a rationale. Later on, commit 1f5d3a6b ("Remove *.rej pattern from .gitignore") removed the *.rej pattern in v2.6.26, on the rationale that *.rej files indicated something went really wrong and should not be ignored. The *.rej files are now shown by `git status`, which helps located conflicts when applying patches and lowers the probability that they will go unnoticed. It is however still easy to overlook the *.orig files which slowly polute the source tree. That's not as big of a deal as not noticing a conflict, but it's still not nice. Drop the *.orig pattern from .gitignore to avoid this and help keep the source tree clean. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> [masahiroy@kernel.org: I do not have a strong opinion about this. Perhaps some people may have a different opinion. If you are someone who wants to ignore *.orig, it is likely you would want to do so across all projects. Then, $XDG_CONFIG_HOME/git/ignore would be more suitable for your needs. gitignore(5) suggests, "Patterns which a user wants Git to ignore in all situations generally go into a file specified by core.excludesFile in the user's ~/.gitconfig". Please note that you cannot do the opposite; if *.orig is ignored by the project's .gitignore, you cannot override the decision because $XDG_CONFIG_HOME/git/ignore has a lower priority. If *.orig is sitting on the fence, I'd leave it to the users. ] Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
-
Masahiro Yamada authored
A long standing issue in the upstream kernel packaging is that the linux-headers package is not cross-compiled. For example, you can cross-build Debian packages for arm64 by running the following command: $ make ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu- bindeb-pkg However, the generated linux-headers-*_arm64.deb is useless because the host programs in it were built for your build machine architecture (likely x86), not arm64. The Debian kernel maintains its own Makefiles to cross-compile host tools without relying on Kbuild. [1] Instead of adding such full custom Makefiles, this commit adds a small piece of code to cross-compile host programs located under the scripts/ directory. A straightforward solution is to pass HOSTCC=${CROSS_COMPILE}gcc, but it would also cross-compile scripts/basic/fixdep, which needs to be native to process the if_changed_dep macro. (This approach may work under some circumstances; you can execute foreign architecture programs with the help of binfmt_misc because Debian systems enable CONFIG_BINFMT_MISC, but it would require installing QEMU and libc for that architecture.) A trick is to use the external module build (KBUILD_EXTMOD=), which does not rebuild scripts/basic/fixdep. ${CC} needs to be able to link userspace programs (CONFIG_CC_CAN_LINK=y). There are known limitations: - GCC plugins It would possible to rebuild GCC plugins for the target architecture by passing HOSTCXX=${CROSS_COMPILE}g++ with necessary packages installed, but gcc on the installed system emits "cc1: error: incompatible gcc/plugin versions". - objtool and resolve_btfids These are built by the tools build system. They are not covered by the current solution. The resulting linux-headers package is broken if CONFIG_OBJTOOL or CONFIG_DEBUG_INFO_BTF is enabled. I only tested this with Debian, but it should work for other package systems as well. [1]: https://salsa.debian.org/kernel-team/linux/-/blob/debian/6.9.9-1/debian/rules.real#L586Signed-off-by: Masahiro Yamada <masahiroy@kernel.org> Reviewed-by: Nicolas Schier <nicolas@fjasle.eu>
-
Masahiro Yamada authored
Exclude directories and files unnecessary for building external modules: - include/config/ (except include/config/{auto.conf,kernel.release}) - scripts/atomic/ - scripts/dtc/ - scripts/kconfig/ - scripts/mod/mk_elfconfig - scripts/package/ - scripts/unifdef - .config - *.o - .*.cmd Avoid copying files twice for the following directories: - include/generated/ - arch/*/include/generated/ Signed-off-by: Masahiro Yamada <masahiroy@kernel.org> Reviewed-by: Nicolas Schier <nicolas@fjasle.eu>
-
Masahiro Yamada authored
Endianness is currently detected on compile-time, but we can defer this until run-time. This change avoids re-executing scripts/mod/mk_elfconfig even if modpost in the linux-headers package needs to be rebuilt for a foreign architecture. Signed-off-by: Masahiro Yamada <masahiroy@kernel.org> Reviewed-by: Nicolas Schier <nicolas@fjasle.eu>
-
Masahiro Yamada authored
HOST_ELFCLASS is output to elfconfig.h, but it is not used in modpost. Signed-off-by: Masahiro Yamada <masahiroy@kernel.org> Reviewed-by: Nicolas Schier <nicolas@fjasle.eu>
-
Linus Torvalds authored
-
git://git.samba.org/sfrench/cifs-2.6Linus Torvalds authored
Pull smb client fixes from Steve French: - copy_file_range fix - two read fixes including read past end of file rc fix and read retry crediting fix - falloc zero range fix * tag 'v6.11-rc5-smb-client-fixes' of git://git.samba.org/sfrench/cifs-2.6: cifs: Fix FALLOC_FL_ZERO_RANGE to preflush buffered part of target region cifs: Fix copy offload to flush destination region netfs, cifs: Fix handling of short DIO read cifs: Fix lack of credit renegotiation on read retry
-
https://github.com/koverstreet/bcachefsLinus Torvalds authored
Push bcachefs fixes from Kent Overstreet: "The data corruption in the buffered write path is troubling; inode lock should not have been able to cause that... - Fix a rare data corruption in the rebalance path, caught as a nonce inconsistency on encrypted filesystems - Revert lockless buffered write path - Mark more errors as autofix" * tag 'bcachefs-2024-08-21' of https://github.com/koverstreet/bcachefs: bcachefs: Mark more errors as autofix bcachefs: Revert lockless buffered IO path bcachefs: Fix bch2_extents_match() false positive bcachefs: Fix failure to return error in data_update_index_update()
-
- 31 Aug, 2024 7 commits
-
-
Kent Overstreet authored
errors that are known to always be safe to fix should be autofix: this should be most errors even at this point, but that will need some thorough review. note that errors are still logged in the superblock, so we'll still know that they happened. Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
-
Kent Overstreet authored
We had a report of data corruption on nixos when building installer images. https://github.com/NixOS/nixpkgs/pull/321055#issuecomment-2184131334 It seems that writes are being dropped, but only when issued by QEMU, and possibly only in snapshot mode. It's undetermined if it's write calls are being dropped or dirty folios. Further testing, via minimizing the original patch to just the change that skips the inode lock on non appends/truncates, reveals that it really is just not taking the inode lock that causes the corruption: it has nothing to do with the other logic changes for preserving write atomicity in corner cases. It's also kernel config dependent: it doesn't reproduce with the minimal kernel config that ktest uses, but it does reproduce with nixos's distro config. Bisection the kernel config initially pointer the finger at page migration or compaction, but it appears that was erroneous; we haven't yet determined what kernel config option actually triggers it. Sadly it appears this will have to be reverted since we're getting too close to release and my plate is full, but we'd _really_ like to fully debug it. My suspicion is that this patch is exposing a preexisting bug - the inode lock actually covers very little in IO paths, and we have a different lock (the pagecache add lock) that guards against races with truncate here. Fixes: 7e64c86c ("bcachefs: Buffered write path now can avoid the inode lock") Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
-
git://git.kernel.org/pub/scm/linux/kernel/git/groeck/linux-stagingLinus Torvalds authored
Pull misc fixes from Guenter Roeck. These are fixes for regressions that Guenther has been reporting, and the maintainers haven't picked up and sent in. With rc6 fairly imminent, I'm taking them directly from Guenter. * 'fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/groeck/linux-staging: apparmor: fix policy_unpack_test on big endian systems Revert "MIPS: csrc-r4k: Apply verification clocksource flags" microblaze: don't treat zero reserved memory regions as error
-
git://git.kernel.org/pub/scm/linux/kernel/git/brgl/linuxLinus Torvalds authored
Pull power sequencing fix from Bartosz Golaszewski: "A follow-up fix for the power sequencing subsystem. It turned out the previous fix for this driver was incomplete and broke the WLAN support on some platforms. This addresses the issue. - set the direction of the wlan-enable GPIO to output after requesting it as-is" * tag 'pwrseq-fixes-for-v6.11-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/brgl/linux: power: sequencing: qcom-wcn: set the wlan-enable GPIO to output
-
Bartosz Golaszewski authored
Commit a9aaf1ff ("power: sequencing: request the WLAN enable GPIO as-is") broke WLAN on boards on which the wlan-enable GPIO enabling the wifi module isn't in output mode by default. We need to set direction to output while retaining the value that was already set to keep the ath module on if it's already started. Fixes: a9aaf1ff ("power: sequencing: request the WLAN enable GPIO as-is") Link: https://lore.kernel.org/r/20240823115500.37280-1-brgl@bgdev.plSigned-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
-
git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usbLinus Torvalds authored
Pull USB fixes from Greg KH: "Here are some small USB fixes for 6.11-rc6. Included in here are: - dwc3 driver fixes for reported issues - MAINTAINER file update, marking a driver as unsupported :( - cdnsp driver fixes - USB gadget driver fix - USB sysfs fix - other tiny fixes - new device ids for usb serial driver All of these have been in linux-next this week with no reported issues" * tag 'usb-6.11-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb: USB: serial: option: add MeiG Smart SRM825L usb: cdnsp: fix for Link TRB with TC usb: dwc3: st: add missing depopulate in probe error path usb: dwc3: st: fix probed platform device ref count on probe error path usb: dwc3: ep0: Don't reset resource alloc flag (including ep0) usb: core: sysfs: Unmerge @usb3_hardware_lpm_attr_group in remove_power_attributes() usb: typec: fsa4480: Relax CHIP_ID check usb: dwc3: xilinx: add missing depopulate in probe error path usb: dwc3: omap: add missing depopulate in probe error path dt-bindings: usb: microchip,usb2514: Fix reference USB device schema usb: gadget: uvc: queue pump work in uvcg_video_enable() cdc-acm: Add DISABLE_ECHO quirk for GE HealthCare UI Controller usb: cdnsp: fix incorrect index in cdnsp_get_hw_deq function usb: dwc3: core: Prevent USB core invalid event buffer address access MAINTAINERS: Mark UVC gadget driver as orphan
-
git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsiLinus Torvalds authored
Pull SCSI fixes from James Bottomley: "Minor fixes only. The sd.c one ignores a sync cache request if format is in progress which can happen if formatting a drive across suspend/resume" * tag 'scsi-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi: scsi: sd: Ignore command SYNCHRONIZE CACHE error if format in progress scsi: aacraid: Fix double-free on probe failure scsi: lpfc: Fix overflow build issue
-