1. Feb 16, 2024
    • Linus Torvalds's avatar
      Merge tag 'for-linus-6.8a-rc5-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/xen/tip · cc9c4f0b
      Linus Torvalds authored
      Pull xen fixes from Juergen Gross:
       "Fixes and simple cleanups:
      
         - use a proper flexible array instead of a one-element array in order
           to avoid array-bounds sanitizer errors
      
         - add NULL pointer checks after allocating memory
      
         - use memdup_array_user() instead of open-coding it
      
         - fix a rare race condition in Xen event channel allocation code
      
         - make struct bus_type instances const
      
         - make kerneldoc inline comments match reality"
      
      * tag 'for-linus-6.8a-rc5-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/xen/tip:
        xen/events: close evtchn after mapping cleanup
        xen/gntalloc: Replace UAPI 1-element array
        xen: balloon: make balloon_subsys const
        xen: pcpu: make xen_pcpu_subsys const
        xen/privcmd: Use memdup_array_user() in alloc_ioreq()
        x86/xen: Add some null pointer checking to smp.c
        xen/xenbus: document will_handle argument for xenbus_watch_path()
      cc9c4f0b
    • Linus Torvalds's avatar
      update workarounds for gcc "asm goto" issue · 68fb3ca0
      Linus Torvalds authored
      In commit 4356e9f8 ("work around gcc bugs with 'asm goto' with
      outputs") I did the gcc workaround unconditionally, because the cause of
      the bad code generation wasn't entirely clear.
      
      In the meantime, Jakub Jelinek debugged the issue, and has come up with
      a fix in gcc [2], which also got backported to the still maintained
      branches of gcc-11, gcc-12 and gcc-13.
      
      Note that while the fix technically wasn't in the original gcc-14
      branch, Jakub says:
      
       "while it is true that no GCC 14 snapshots until today (or whenever the
        fix will be committed) have the fix, for GCC trunk it is up to the
        distros to use the latest snapshot if they use it at all and would
        allow better testing of the kernel code without the workaround, so
        that if there are other issues they won't be discovered years later.
        Most userland code doesn't actually use asm goto with outputs..."
      
      so we will consider gcc-14 to be fixed - if somebody is using gcc
      snapshots of the gcc-14 before the ...
      68fb3ca0
    • Linus Torvalds's avatar
      Merge tag 'devicetree-fixes-for-6.8-1' of git://git.kernel.org/pub/scm/linux/kernel/git/robh/linux · 339e2fca
      Linus Torvalds authored
      Pull devicetree fixes from Rob Herring:
      
       - Improve devlink dependency parsing for DT graphs
      
       - Fix devlink handling of io-channels dependencies
      
       - Fix PCI addressing in marvell,prestera example
      
       - A few schema fixes for property constraints
      
       - Improve performance of DT unprobed devices kselftest
      
       - Fix regression in DT_SCHEMA_FILES handling
      
       - Fix compile error in unittest for !OF_DYNAMIC
      
      * tag 'devicetree-fixes-for-6.8-1' of git://git.kernel.org/pub/scm/linux/kernel/git/robh/linux:
        dt-bindings: ufs: samsung,exynos-ufs: Add size constraints on "samsung,sysreg"
        of: property: Add in-ports/out-ports support to of_graph_get_port_parent()
        of: property: Improve finding the supplier of a remote-endpoint property
        of: property: Improve finding the consumer of a remote-endpoint property
        net: marvell,prestera: Fix example PCI bus addressing
        of: unittest: Fix compile in the non-dynamic case
        of: property: fix typo in io-channels
        dt-bindings: tpm: Drop type from "resets"
        dt-bindings: display: nxp,tda998x: Fix 'audio-ports' constraints
        dt-bindings: xilinx: replace Piyush Mehta maintainership
        kselftest: dt: Stop relying on dirname to improve performance
        dt-bindings: don't anchor DT_SCHEMA_FILES to bindings directory
      339e2fca
    • Linus Torvalds's avatar
      Merge tag 'spi-fix-v6.8-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi · a00cf198
      Linus Torvalds authored
      Pull spi fixes from Mark Brown:
       "A smallish collection of fixes for SPI, all driver specific, plus one
        device ID addition for a new Intel part.
      
        The ppc4xx isn't routinely covered by most of the automated testing so
        there were some errors that were missed in some of the recent API
        conversions, otherwise there's nothing super remarkable here"
      
      * tag 'spi-fix-v6.8-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi:
        spi-mxs: Fix chipselect glitch
        spi: intel-pci: Add support for Lunar Lake-M SPI serial flash
        spi: omap2-mcspi: Revert FIFO support without DMA
        spi: ppc4xx: Drop write-only variable
        spi: ppc4xx: Fix fallout from rename in struct spi_bitbang
        spi: ppc4xx: Fix fallout from include cleanup
        spi: spi-ppc4xx: include missing platform_device.h
        spi: imx: fix the burst length at DMA mode and CPU mode
      a00cf198
    • Linus Torvalds's avatar
      Merge tag 'regmap-fix-v6.8-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regmap · 2c460834
      Linus Torvalds authored
      Pull regmap test fixes from Mark Brown:
       "Guenter runs a lot of KUnit tests so noticed that there were a couple
        of the regmap tests, including the newly added noinc test, which could
        show spurious failures due to the use of randomly generated test
        values. These changes handle the randomly generated data properly"
      
      * tag 'regmap-fix-v6.8-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regmap:
        regmap: kunit: Ensure that changed bytes are actually different
        regmap: kunit: fix raw noinc write test wrapping
      2c460834
    • Linus Torvalds's avatar
      Merge tag 'hid-for-linus-2024021501' of git://git.kernel.org/pub/scm/linux/kernel/git/hid/hid · 9207fe75
      Linus Torvalds authored
      Pull HID fixes from Jiri Kosina:
      
       - fix for 'MSC_SERIAL = 0' corner case handling in wacom driver (Jason
         Gerecke)
      
       - ACPI S3 suspend/resume fix for intel-ish-hid (Even Xu)
      
       - race condition fix preventing Wacom driver from losing events shortly
         after initialization (Jason Gerecke)
      
       - fix preventing certain Logitech HID++ devices from spamming kernel
         log (Oleksandr Natalenko)
      
      * tag 'hid-for-linus-2024021501' of git://git.kernel.org/pub/scm/linux/kernel/git/hid/hid:
        HID: wacom: generic: Avoid reporting a serial of '0' to userspace
        HID: Intel-ish-hid: Ishtp: Fix sensor reads after ACPI S3 suspend
        HID: multitouch: Add required quirk for Synaptics 0xcddc device
        HID: wacom: Do not register input devices until after hid_hw_start
        HID: logitech-hidpp: Do not flood kernel log
      9207fe75
  2. Feb 15, 2024
  3. Feb 14, 2024
    • Filipe Manana's avatar
      btrfs: don't refill whole delayed refs block reserve when starting transaction · 2f6397e4
      Filipe Manana authored
      Since commit 28270e25
      
       ("btrfs: always reserve space for delayed refs
      when starting transaction") we started not only to reserve metadata space
      for the delayed refs a caller of btrfs_start_transaction() might generate
      but also to try to fully refill the delayed refs block reserve, because
      there are several case where we generate delayed refs and haven't reserved
      space for them, relying on the global block reserve. Relying too much on
      the global block reserve is not always safe, and can result in hitting
      -ENOSPC during transaction commits or worst, in rare cases, being unable
      to mount a filesystem that needs to do orphan cleanup or anything that
      requires modifying the filesystem during mount, and has no more
      unallocated space and the metadata space is nearly full. This was
      explained in detail in that commit's change log.
      
      However the gap between the reserved amount and the size of the delayed
      refs block reserve can be huge, so attempting to reserve space for such
      a gap can result in allocating many metadata block groups that end up
      not being used. After a recent patch, with the subject:
      
        "btrfs: add new unused block groups to the list of unused block groups"
      
      We started to add new block groups that are unused to the list of unused
      block groups, to avoid having them around for a very long time in case
      they are never used, because a block group is only added to the list of
      unused block groups when we deallocate the last extent or when mounting
      the filesystem and the block group has 0 bytes used. This is not a problem
      introduced by the commit mentioned earlier, it always existed as our
      metadata space reservations are, most of the time, pessimistic and end up
      not using all the space they reserved, so we can occasionally end up with
      one or two unused metadata block groups for a long period. However after
      that commit mentioned earlier, we are just more pessimistic in the
      metadata space reservations when starting a transaction and therefore the
      issue is more likely to happen.
      
      This however is not always enough because we might create unused metadata
      block groups when reserving metadata space at a high rate if there's
      always a gap in the delayed refs block reserve and the cleaner kthread
      isn't triggered often enough or is busy with other work (running delayed
      iputs, cleaning deleted roots, etc), not to mention the block group's
      allocated space is only usable for a new block group after the transaction
      used to remove it is committed.
      
      A user reported that he's getting a lot of allocated metadata block groups
      but the usage percentage of metadata space was very low compared to the
      total allocated space, specially after running a series of block group
      relocations.
      
      So for now stop trying to refill the gap in the delayed refs block reserve
      and reserve space only for the delayed refs we are expected to generate
      when starting a transaction.
      
      CC: stable@vger.kernel.org # 6.7+
      Reported-by: default avatarIvan Shapovalov <intelfx@intelfx.name>
      Link: https://lore.kernel.org/linux-btrfs/9cdbf0ca9cdda1b4c84e15e548af7d7f9f926382.camel@intelfx.name/
      Link: https://lore.kernel.org/linux-btrfs/CAL3q7H6802ayLHUJFztzZAVzBLJAGdFx=6FHNNy87+obZXXZpQ@mail.gmail.com/
      
      
      Tested-by: default avatarIvan Shapovalov <intelfx@intelfx.name>
      Reported-by: default avatarHeddxh <g311571057@gmail.com>
      Link: https://lore.kernel.org/linux-btrfs/CAE93xANEby6RezOD=zcofENYZOT-wpYygJyauyUAZkLv6XVFOA@mail.gmail.com/
      
      
      Reviewed-by: default avatarJosef Bacik <josef@toxicpanda.com>
      Signed-off-by: default avatarFilipe Manana <fdmanana@suse.com>
      Signed-off-by: default avatarDavid Sterba <dsterba@suse.com>
      2f6397e4
    • Filipe Manana's avatar
      btrfs: zoned: fix chunk map leak when loading block group zone info · 88e81a67
      Filipe Manana authored
      At btrfs_load_block_group_zone_info() we never drop a reference on the
      chunk map we have looked up, therefore leaking a reference on it. So
      add the missing btrfs_free_chunk_map() at the end of the function.
      
      Fixes: 7dc66abb
      
       ("btrfs: use a dedicated data structure for chunk maps")
      Reported-by: default avatarJohannes Thumshirn <johannes.thumshirn@wdc.com>
      Reviewed-by: default avatarJohannes Thumshirn <johannes.thumshirn@wdc.com>
      Tested-by: default avatarJohannes Thumshirn <johannes.thumshirn@wdc.com>
      Reviewed-by: default avatarAnand Jain <anand.jain@oracle.com>
      Signed-off-by: default avatarFilipe Manana <fdmanana@suse.com>
      Reviewed-by: default avatarDavid Sterba <dsterba@suse.com>
      Signed-off-by: default avatarDavid Sterba <dsterba@suse.com>
      88e81a67
    • Filipe Manana's avatar
      btrfs: reject encoded write if inode has nodatasum flag set · 1bd96c92
      Filipe Manana authored
      
      
      Currently we allow an encoded write against inodes that have the NODATASUM
      flag set, either because they are NOCOW files or they were created while
      the filesystem was mounted with "-o nodatasum". This results in having
      compressed extents without corresponding checksums, which is a filesystem
      inconsistency reported by 'btrfs check'.
      
      For example, running btrfs/281 with MOUNT_OPTIONS="-o nodatacow" triggers
      this and 'btrfs check' errors out with:
      
         [1/7] checking root items
         [2/7] checking extents
         [3/7] checking free space tree
         [4/7] checking fs roots
         root 256 inode 257 errors 1040, bad file extent, some csum missing
         root 256 inode 258 errors 1040, bad file extent, some csum missing
         ERROR: errors found in fs roots
         (...)
      
      So reject encoded writes if the target inode has NODATASUM set.
      
      CC: stable@vger.kernel.org # 6.1+
      Reviewed-by: default avatarJohannes Thumshirn <johannes.thumshirn@wdc.com>
      Signed-off-by: default avatarFilipe Manana <fdmanana@suse.com>
      Reviewed-by: default avatarDavid Sterba <dsterba@suse.com>
      Signed-off-by: default avatarDavid Sterba <dsterba@suse.com>
      1bd96c92
    • Filipe Manana's avatar
      btrfs: don't reserve space for checksums when writing to nocow files · feefe1f4
      Filipe Manana authored
      
      
      Currently when doing a write to a file we always reserve metadata space
      for inserting data checksums. However we don't need to do it if we have
      a nodatacow file (-o nodatacow mount option or chattr +C) or if checksums
      are disabled (-o nodatasum mount option), as in that case we are only
      adding unnecessary pressure to metadata reservations.
      
      For example on x86_64, with the default node size of 16K, a 4K buffered
      write into a nodatacow file is reserving 655360 bytes of metadata space,
      as it's accounting for checksums. After this change, which stops reserving
      space for checksums if we have a nodatacow file or checksums are disabled,
      we only need to reserve 393216 bytes of metadata.
      
      CC: stable@vger.kernel.org # 6.1+
      Signed-off-by: default avatarFilipe Manana <fdmanana@suse.com>
      Reviewed-by: default avatarDavid Sterba <dsterba@suse.com>
      Signed-off-by: default avatarDavid Sterba <dsterba@suse.com>
      feefe1f4
    • Linus Torvalds's avatar
      Merge tag 'trace-tools-v6.8-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/trace/linux-trace · 7e90b5c2
      Linus Torvalds authored
      Pull tracing tooling fixes from Steven Rostedt:
       "RTLA:
      
         - rtla tools are exiting with a positive value when usage() is
           called. Make them return 0 if the usage was called via -h/--help
      
         - the -P priority sets the sched priority for rtla workload. When the
           SCHED_OTHER scheduler is selected, it sets the rt_priority instead
           of the nice parameter. Setting the nice value is the correct thing,
           so fix it
      
         - rtla is failing to compile with clang due to unsupported options
           from gcc. Adjusting the compiler/linker options makes clang work
           properly
      
         - Remove the sched_getattr() unused function on utils.c
      
         - Fixes for variable initialization and size, reported by clang
      
        Verification:
      
         - rv is failing to compile with clang due to unsupported options from
           gcc. Adjusting the compiler/linker options makes clang work
           properly
      
         - Fix an uninitialized variable on in_kernel.c reported by clang"
      
      * tag 'trace-tools-v6.8-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/trace/linux-trace:
        tools/rtla: Exit with EXIT_SUCCESS when help is invoked
        tools/rtla: Replace setting prio with nice for SCHED_OTHER
        tools/rv: Fix curr_reactor uninitialized variable
        tools/rv: Fix Makefile compiler options for clang
        tools/rtla: Remove unused sched_getattr() function
        tools/rtla: Fix clang warning about mount_point var size
        tools/rtla: Fix uninitialized bucket/data->bucket_size warning
        tools/rtla: Fix Makefile compiler options for clang
      7e90b5c2
    • Rob Herring's avatar
      dt-bindings: ufs: samsung,exynos-ufs: Add size constraints on "samsung,sysreg" · 4e06ec07
      Rob Herring authored
      
      
      The 'phandle-array' type is a bit ambiguous. It can be either just an
      array of phandles or an array of phandles plus args. "samsung,sysreg" is
      the latter and needs to be constrained to a single entry with a phandle and
      offset.
      
      Reviewed-by: default avatarKrzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
      Link: https://lore.kernel.org/r/20240124190733.1554314-1-robh@kernel.org
      
      
      Signed-off-by: default avatarRob Herring <robh@kernel.org>
      4e06ec07
  4. Feb 13, 2024
  5. Feb 12, 2024
    • Linus Torvalds's avatar
      Merge tag 'vfs-6.8-rc5.fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/vfs/vfs · 716f4aaa
      Linus Torvalds authored
      Pull vfs fixes from Christian Brauner:
      
       - Fix performance regression introduced by moving the security
         permission hook out of do_clone_file_range() and into its caller
         vfs_clone_file_range().
      
         This causes the security hook to be called in situation were it
         wasn't called before as the fast permission checks were left in
         do_clone_file_range().
      
         Fix this by merging the two implementations back together and
         restoring the old ordering: fast permission checks first, expensive
         ones later.
      
       - Tweak mount_setattr() permission checking so that mount properties on
         the real rootfs can be changed.
      
         When we added mount_setattr() we added additional checks compared to
         legacy mount(2). If the mount had a parent then verify that the
         caller and the mount namespace the mount is attached to match and if
         not make sure that it's an anonymous mount.
      
         But the real rootfs falls into neither category. It is neither an
         anoymous mount because it is obviously attached to the initial mount
         namespace but it also obviously doesn't have a parent mount. So that
         means legacy mount(2) allows changing mount properties on the real
         rootfs but mount_setattr(2) blocks this. This causes regressions (See
         the commit for details).
      
         Fix this by relaxing the check. If the mount has a parent or if it
         isn't a detached mount, verify that the mount namespaces of the
         caller and the mount are the same. Technically, we could probably
         write this even simpler and check that the mount namespaces match if
         it isn't a detached mount. But the slightly longer check makes it
         clearer what conditions one needs to think about.
      
      * tag 'vfs-6.8-rc5.fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/vfs/vfs:
        fs: relax mount_setattr() permission checks
        remap_range: merge do_clone_file_range() into vfs_clone_file_range()
      716f4aaa
    • Mark Brown's avatar
      regmap: kunit: Ensure that changed bytes are actually different · 2f0dbb24
      Mark Brown authored
      
      
      During the cache sync test we verify that values we expect to have been
      written only to the cache do not appear in the hardware. This works most
      of the time but since we randomly generate both the original and new values
      there is a low probability that these values may actually be the same.
      Wrap get_random_bytes() to ensure that the values are different, there
      are other tests which should have similar verification that we actually
      changed something.
      
      While we're at it refactor the test to use three changed values rather
      than attempting to use one of them twice, that just complicates checking
      that our new values are actually new.
      
      We use random generation to try to avoid data dependencies in the tests.
      
      Reported-by: default avatarGuenter Roeck <linux@roeck-us.net>
      Reviewed-by: default avatarGuenter Roeck <linux@roeck-us.net>
      Tested-by: default avatarGuenter Roeck <linux@roeck-us.net>
      Signed-off-by: default avatarMark Brown <broonie@kernel.org>
      Link: https://msgid.link/r/20240211-regmap-kunit-random-change-v3-1-e387a9ea4468@kernel.org
      
      
      Signed-off-by: default avatarMark Brown <broonie@kernel.org>
      2f0dbb24
    • Mika Westerberg's avatar
      spi: intel-pci: Add support for Lunar Lake-M SPI serial flash · 8f44e380
      Mika Westerberg authored
      
      
      Add Intel Lunar Lake-M PCI ID to the driver list of supported devices.
      This is the same controller found in previous generations.
      
      Signed-off-by: default avatarMika Westerberg <mika.westerberg@linux.intel.com>
      Link: https://msgid.link/r/20240212082027.2462849-1-mika.westerberg@linux.intel.com
      
      
      Signed-off-by: default avatarMark Brown <broonie@kernel.org>
      8f44e380
    • Vaishnav Achath's avatar
      spi: omap2-mcspi: Revert FIFO support without DMA · e56c671c
      Vaishnav Achath authored
      MCSPI controller have few limitations regarding the transaction
      size when the FIFO buffer is enabled and the WCNT feature is used
      to find the end of word, in this case if WCNT is not a multiple of
      the FIFO Almost Empty Level (AEL), then the FIFO empty event is not
      generated correctly. In addition to this limitation, few other unknown
      sequence of events that causes the FIFO empty status to not reflect the
      exact status were found when FIFO is being used without DMA enabled
      during extended testing in AM65x platform. Till the exact root cause
      is found and fixed, revert the FIFO support without DMA.
      
      See J721E Technical Reference Manual (SPRUI1C), section 12.1.5
      for further details: http://www.ti.com/lit/pdf/spruil1
      
      This reverts commit 75223bbe
      
       ("spi: omap2-mcspi: Add FIFO support
      without DMA")
      
      Signed-off-by: default avatarVaishnav Achath <vaishnav.a@ti.com>
      Link: https://msgid.link/r/20240212120049.438495-1-vaishnav.a@ti.com
      
      
      Signed-off-by: default avatarMark Brown <broonie@kernel.org>
      e56c671c
    • John Kacur's avatar
      tools/rtla: Exit with EXIT_SUCCESS when help is invoked · b5f31936
      John Kacur authored
      Fix rtla so that the following commands exit with 0 when help is invoked
      
      rtla osnoise top -h
      rtla osnoise hist -h
      rtla timerlat top -h
      rtla timerlat hist -h
      
      Link: https://lore.kernel.org/linux-trace-devel/20240203001607.69703-1-jkacur@redhat.com
      
      Cc: stable@vger.kernel.org
      Fixes: 1eeb6328
      
       ("rtla/timerlat: Add timerlat hist mode")
      Signed-off-by: default avatarJohn Kacur <jkacur@redhat.com>
      Signed-off-by: default avatarDaniel Bristot de Oliveira <bristot@kernel.org>
      b5f31936
    • limingming3's avatar
      tools/rtla: Replace setting prio with nice for SCHED_OTHER · 14f08c97
      limingming3 authored
      Since the sched_priority for SCHED_OTHER is always 0, it makes no
      sence to set it.
      Setting nice for SCHED_OTHER seems more meaningful.
      
      Link: https://lkml.kernel.org/r/20240207065142.1753909-1-limingming3@lixiang.com
      
      Cc: stable@vger.kernel.org
      Fixes: b1696371
      
       ("rtla: Helper functions for rtla")
      Signed-off-by: default avatarlimingming3 <limingming3@lixiang.com>
      Signed-off-by: default avatarDaniel Bristot de Oliveira <bristot@kernel.org>
      14f08c97
    • Daniel Bristot de Oliveira's avatar
      tools/rv: Fix curr_reactor uninitialized variable · 61ec586b
      Daniel Bristot de Oliveira authored
      clang is reporting:
      
      $ make HOSTCC=clang CC=clang LLVM_IAS=1
      
      clang -O -g -DVERSION=\"6.8.0-rc3\" -flto=auto -fexceptions
      	-fstack-protector-strong -fasynchronous-unwind-tables
      	-fstack-clash-protection  -Wall -Werror=format-security
      	-Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS
      	$(pkg-config --cflags libtracefs)  -I include
      	-c -o src/in_kernel.o src/in_kernel.c
      [...]
      
      src/in_kernel.c:227:6: warning: variable 'curr_reactor' is used uninitialized whenever 'if' condition is true [-Wsometimes-uninitialized]
        227 |         if (!end)
            |             ^~~~
      src/in_kernel.c:242:9: note: uninitialized use occurs here
        242 |         return curr_reactor;
            |                ^~~~~~~~~~~~
      src/in_kernel.c:227:2: note: remove the 'if' if its condition is always false
        227 |         if (!end)
            |         ^~~~~~~~~
        228 |                 goto out_free;
            |                 ~~~~~~~~~~~~~
      src/in_kernel.c:221:6: warning: variable 'curr_reactor' is used uninitialized whenever 'if' condition is true [-Wsometimes-uninitialized]
        221 |         if (!start)
            |             ^~~~~~
      src/in_kernel.c:242:9: note: uninitialized use occurs here
        242 |         return curr_reactor;
            |                ^~~~~~~~~~~~
      src/in_kernel.c:221:2: note: remove the 'if' if its condition is always false
        221 |         if (!start)
            |         ^~~~~~~~~~~
        222 |                 goto out_free;
            |                 ~~~~~~~~~~~~~
      src/in_kernel.c:215:20: note: initialize the variable 'curr_reactor' to silence this warning
        215 |         char *curr_reactor;
            |                           ^
            |                            = NULL
      2 warnings generated.
      
      Which is correct. Setting curr_reactor to NULL avoids the problem.
      
      Link: https://lkml.kernel.org/r/3a35551149e5ee0cb0950035afcb8082c3b5d05b.1707217097.git.bristot@kernel.org
      
      Cc: stable@vger.kernel.org
      Cc: Masami Hiramatsu <mhiramat@kernel.org>
      Cc: Nathan Chancellor <nathan@kernel.org>
      Cc: Nick Desaulniers <ndesaulniers@google.com>
      Cc: Bill Wendling <morbo@google.com>
      Cc: Justin Stitt <justinstitt@google.com>
      Cc: Donald Zickus <dzickus@redhat.com>
      Fixes: 6d60f896
      
       ("tools/rv: Add in-kernel monitor interface")
      Signed-off-by: default avatarDaniel Bristot de Oliveira <bristot@kernel.org>
      61ec586b
    • Daniel Bristot de Oliveira's avatar
      tools/rv: Fix Makefile compiler options for clang · f9b2c871
      Daniel Bristot de Oliveira authored
      The following errors are showing up when compiling rv with clang:
      
       $ make HOSTCC=clang CC=clang LLVM_IAS=1
       [...]
        clang -O -g -DVERSION=\"6.8.0-rc1\" -flto=auto -ffat-lto-objects
        -fexceptions -fstack-protector-strong -fasynchronous-unwind-tables
        -fstack-clash-protection  -Wall -Werror=format-security
        -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS
        -Wno-maybe-uninitialized $(pkg-config --cflags libtracefs)
        -I include   -c -o src/utils.o src/utils.c
        clang: warning: optimization flag '-ffat-lto-objects' is not supported [-Wignored-optimization-argument]
        warning: unknown warning option '-Wno-maybe-uninitialized'; did you mean '-Wno-uninitialized'? [-Wunknown-warning-option]
        1 warning generated.
      
        clang -o rv -ggdb  src/in_kernel.o src/rv.o src/trace.o src/utils.o $(pkg-config --libs libtracefs)
        src/in_kernel.o: file not recognized: file format not recognized
        clang: error: linker command failed with exit code 1 (use -v to see invocation)
        make: *** [Makefile:110: rv] Error 1
      
      Solve these issues by:
        - removing -ffat-lto-objects and -Wno-maybe-uninitialized if using clang
        - informing the linker about -flto=auto
      
      Link: https://lkml.kernel.org/r/ed94a8ddc2ca8c8ef663cfb7ae9dd196c4a66b33.1707217097.git.bristot@kernel.org
      
      Cc: stable@vger.kernel.org
      Cc: Masami Hiramatsu <mhiramat@kernel.org>
      Cc: Nathan Chancellor <nathan@kernel.org>
      Cc: Nick Desaulniers <ndesaulniers@google.com>
      Cc: Bill Wendling <morbo@google.com>
      Cc: Justin Stitt <justinstitt@google.com>
      Fixes: 4bc4b131
      
       ("rv: Add rv tool")
      Suggested-by: default avatarDonald Zickus <dzickus@redhat.com>
      Signed-off-by: default avatarDaniel Bristot de Oliveira <bristot@kernel.org>
      f9b2c871