1. 13 May, 2021 6 commits
    • Linus Torvalds's avatar
      Merge branch 'resizex' (patches from Maciej) · adc12a74
      Linus Torvalds authored
      Merge VT_RESIZEX fixes from Maciej Rozycki:
       "I got to the bottom of the issue with VT_RESIZEX recently discussed
        and came up with this small patch series, fixing an additional issue
        that I originally thought might be broken VGA hardware emulation with
        my laptop, which however turned out to be intertwined with the
        original problem and also a regression introduced somewhat later.
      
        The fix for that because the first patch, and then to make backporting
        feasible I had to put a revert of the offending change from last
        September next, followed by a proper fix for the framebuffer issue
        that change had tried to address.
      
        See individual change descriptions for details.
      
        These have been verified with true VGA hardware (a Trident TVGA8900
        ISA video adapter) using various combinations of `svgatextmode' and
        `setfont' command invocations to change both the VT size and the font
        size, and also switching between the text console and X11, both by
        starting/stopping the X server and by switching between VTs.
      
        All this to ensure bringing the behaviour of VGA text console back to
        correct operation as it used to be with Linux 2.6.18"
      
      * emailed patches from Maciej W. Rozycki <macro@orcam.me.uk>:
        vt: Fix character height handling with VT_RESIZEX
        vt_ioctl: Revert VT_RESIZEX parameter handling removal
        vgacon: Record video mode changes with VT_RESIZEX
      adc12a74
    • Maciej W. Rozycki's avatar
      vt: Fix character height handling with VT_RESIZEX · 860dafa9
      Maciej W. Rozycki authored
      Restore the original intent of the VT_RESIZEX ioctl's `v_clin' parameter
      which is the number of pixel rows per character (cell) rather than the
      height of the font used.
      
      For framebuffer devices the two values are always the same, because the
      former is inferred from the latter one.  For VGA used as a true text
      mode device these two parameters are independent from each other: the
      number of pixel rows per character is set in the CRT controller, while
      font height is in fact hardwired to 32 pixel rows and fonts of heights
      below that value are handled by padding their data with blanks when
      loaded to hardware for use by the character generator.  One can change
      the setting in the CRT controller and it will update the screen contents
      accordingly regardless of the font loaded.
      
      The `v_clin' parameter is used by the `vgacon' driver to set the height
      of the character cell and then the cursor position within.  Make the
      parameter explicit then, by defining a new `vc_cell_height' struct
      member of `vc_data', set it instead of `vc_font.height' from `v_clin' in
      the VT_RESIZEX ioctl, and then use it throughout the `vgacon' driver
      except where actual font data is accessed which as noted above is
      independent from the CRTC setting.
      
      This way the framebuffer console driver is free to ignore the `v_clin'
      parameter as irrelevant, as it always should have, avoiding any issues
      attempts to give the parameter a meaning there could have caused, such
      as one that has led to commit 988d0763 ("vt_ioctl: make VT_RESIZEX
      behave like VT_RESIZE"):
      
       "syzbot is reporting UAF/OOB read at bit_putcs()/soft_cursor() [1][2],
        for vt_resizex() from ioctl(VT_RESIZEX) allows setting font height
        larger than actual font height calculated by con_font_set() from
        ioctl(PIO_FONT). Since fbcon_set_font() from con_font_set() allocates
        minimal amount of memory based on actual font height calculated by
        con_font_set(), use of vt_resizex() can cause UAF/OOB read for font
        data."
      
      The problem first appeared around Linux 2.5.66 which predates our repo
      history, but the origin could be identified with the old MIPS/Linux repo
      also at: <git://git.kernel.org/pub/scm/linux/kernel/git/ralf/linux.git>
      as commit 9736a3546de7 ("Merge with Linux 2.5.66."), where VT_RESIZEX
      code in `vt_ioctl' was updated as follows:
      
       		if (clin)
      -			video_font_height = clin;
      +			vc->vc_font.height = clin;
      
      making the parameter apply to framebuffer devices as well, perhaps due
      to the use of "font" in the name of the original `video_font_height'
      variable.  Use "cell" in the new struct member then to avoid ambiguity.
      
      References:
      
      [1] https://syzkaller.appspot.com/bug?id=32577e96d88447ded2d3b76d71254fb855245837
      [2] https://syzkaller.appspot.com/bug?id=6b8355d27b2b94fb5cedf4655e3a59162d9e48e3Signed-off-by: default avatarMaciej W. Rozycki <macro@orcam.me.uk>
      Fixes: 1da177e4 ("Linux-2.6.12-rc2")
      Cc: stable@vger.kernel.org # v2.6.12+
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      860dafa9
    • Maciej W. Rozycki's avatar
      vt_ioctl: Revert VT_RESIZEX parameter handling removal · a90c275e
      Maciej W. Rozycki authored
      Revert the removal of code handling extra VT_RESIZEX ioctl's parameters
      beyond those that VT_RESIZE supports, fixing a functional regression
      causing `svgatextmode' not to resize the VT anymore.
      
      As a consequence of the reverted change when the video adapter is
      reprogrammed from the original say 80x25 text mode using a 9x16
      character cell (720x400 pixel resolution) to say 80x37 text mode and the
      same character cell (720x592 pixel resolution), the VT geometry does not
      get updated and only upper two thirds of the screen are used for the VT,
      and the lower part remains blank.  The proportions change according to
      text mode geometries chosen.
      
      Revert the change verbatim then, bringing back previous VT resizing.
      Signed-off-by: default avatarMaciej W. Rozycki <macro@orcam.me.uk>
      Fixes: 988d0763 ("vt_ioctl: make VT_RESIZEX behave like VT_RESIZE")
      Cc: stable@vger.kernel.org # v5.10+
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      a90c275e
    • Maciej W. Rozycki's avatar
      vgacon: Record video mode changes with VT_RESIZEX · d4d0ad57
      Maciej W. Rozycki authored
      Fix an issue with VGA console font size changes made after the initial
      video text mode has been changed with a user tool like `svgatextmode'
      calling the VT_RESIZEX ioctl.  As it stands in that case the original
      screen geometry continues being used to validate further VT resizing.
      
      Consequently when the video adapter is firstly reprogrammed from the
      original say 80x25 text mode using a 9x16 character cell (720x400 pixel
      resolution) to say 80x37 text mode and the same character cell (720x592
      pixel resolution), and secondly the CRTC character cell updated to 9x8
      (by loading a suitable font with the KD_FONT_OP_SET request of the
      KDFONTOP ioctl), the VT geometry does not get further updated from 80x37
      and only upper half of the screen is used for the VT, with the lower
      half showing rubbish corresponding to whatever happens to be there in
      the video memory that maps to that part of the screen.  Of course the
      proportions change according to text mode geometries and font sizes
      chosen.
      
      Address the problem then, by updating the text mode geometry defaults
      rather than checking against them whenever the VT is resized via a user
      ioctl.
      Signed-off-by: default avatarMaciej W. Rozycki <macro@orcam.me.uk>
      Fixes: e400b6ec ("vt/vgacon: Check if screen resize request comes from userspace")
      Cc: stable@vger.kernel.org # v2.6.24+
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      d4d0ad57
    • Linus Torvalds's avatar
      Merge tag 'hwmon-for-v5.13-rc2' of... · d1e7c13a
      Linus Torvalds authored
      Merge tag 'hwmon-for-v5.13-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/groeck/linux-staging
      
      Pull hwmon fixes from Guenter Roeck:
       "Fix bugs/regressions in adm9240, ltc2992, pmbus/fsp-3y, and occ
        drivers, plus a minor cleanup in the corsair-psu driver"
      
      * tag 'hwmon-for-v5.13-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/groeck/linux-staging:
        hwmon: (adm9240) Fix writes into inX_max attributes
        hwmon: (ltc2992) Put fwnode in error case during ->probe()
        hwmon: (pmbus/fsp-3y) Fix FSP-3Y YH-5151E non-compliant vout encoding
        hwmon: (occ) Fix poll rate limiting
        hwmon: (corsair-psu) Remove unneeded semicolons
      d1e7c13a
    • Guenter Roeck's avatar
      hwmon: (adm9240) Fix writes into inX_max attributes · 3b5169c2
      Guenter Roeck authored
      When converting the driver to use the devm_hwmon_device_register_with_info
      API, the wrong register was selected when writing into inX_max attributes.
      Fix it.
      
      Fixes: 124b7e34 ("hwmon: (adm9240) Convert to devm_hwmon_device_register_with_info API")
      Reported-by: default avatarChris Packham <Chris.Packham@alliedtelesis.co.nz>
      Tested-by: default avatarChris Packham <chris.packham@alliedtelesis.co.nz>
      Signed-off-by: default avatarGuenter Roeck <linux@roeck-us.net>
      3b5169c2
  2. 12 May, 2021 8 commits
  3. 11 May, 2021 8 commits
  4. 10 May, 2021 18 commits
    • Linus Torvalds's avatar
      Merge tag 'perf-tools-fixes-for-v5.13-2021-05-10' of... · 1140ab59
      Linus Torvalds authored
      Merge tag 'perf-tools-fixes-for-v5.13-2021-05-10' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux
      
      Pull perf tools fixes from Arnaldo Carvalho de Melo:
      
       - Fix swapping of cpu_map and stat_config records.
      
       - Fix dynamic libbpf linking.
      
       - Disallow -c and -F option at the same time in 'perf record'.
      
       - Update headers with the kernel originals.
      
       - Silence warning for JSON ArchStd files.
      
       - Fix a build error on arm64 with clang.
      
      * tag 'perf-tools-fixes-for-v5.13-2021-05-10' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux:
        tools headers UAPI: Sync perf_event.h with the kernel sources
        tools headers cpufeatures: Sync with the kernel sources
        tools include UAPI powerpc: Sync errno.h with the kernel headers
        tools arch: Update arch/x86/lib/mem{cpy,set}_64.S copies used in 'perf bench mem memcpy'
        tools headers UAPI: Sync linux/prctl.h with the kernel sources
        tools headers UAPI: Sync files changed by landlock, quotactl_path and mount_settattr new syscalls
        perf tools: Fix a build error on arm64 with clang
        tools headers kvm: Sync kvm headers with the kernel sources
        tools headers UAPI: Sync linux/kvm.h with the kernel sources
        perf tools: Fix dynamic libbpf link
        perf session: Fix swapping of cpu_map and stat_config records
        perf jevents: Silence warning for ArchStd files
        perf record: Disallow -c and -F option at the same time
        tools arch x86: Sync the msr-index.h copy with the kernel sources
        tools headers UAPI: Sync drm/i915_drm.h with the kernel sources
        tools headers UAPI: Update tools's copy of drm.h headers
      1140ab59
    • Randy Dunlap's avatar
      Documentation: drop optional BOMs · 9e255e2b
      Randy Dunlap authored
      A few of the Documentation .rst files begin with a Unicode
      byte order mark (BOM). The BOM may signify endianess for
      16-bit or 32-bit encodings or indicate that the text stream
      is indeed Unicode. We don't need it for either of those uses.
      It may also interfere with (confuse) some software.
      
      Since we don't need it and its use is optional, just delete
      the uses of it in Documentation/.
      
      https://en.wikipedia.org/wiki/Byte_order_markSigned-off-by: default avatarRandy Dunlap <rdunlap@infradead.org>
      Reviewed-by: default avatarMatthew Wilcox (Oracle) <willy@infradead.org>
      Reviewed-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      Cc: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
      Link: https://lore.kernel.org/r/20210506231907.14359-1-rdunlap@infradead.orgSigned-off-by: default avatarJonathan Corbet <corbet@lwn.net>
      9e255e2b
    • Wan Jiabing's avatar
      docs/zh_CN: Remove obsolete translation file · bf9e262f
      Wan Jiabing authored
      This translation file was replaced by
         Documentation/translations/zh_CN/admin-guide/security-bugs.rst
      which was created in commit 2d153571 ("docs/zh_CN: Add
      zh_CN/admin-guide/security-bugs.rst").
      This is a translation left over from history. Remove it.
      Signed-off-by: default avatarWan Jiabing <wanjiabing@vivo.com>
      Acked-by: default avatarWu XiangCheng <bobwxc@email.cn>
      Link: https://lore.kernel.org/r/20210508030741.82655-1-wanjiabing@vivo.comSigned-off-by: default avatarJonathan Corbet <corbet@lwn.net>
      bf9e262f
    • Linus Torvalds's avatar
      Merge tag 'for-5.13-rc1-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/kdave/linux · 142b507f
      Linus Torvalds authored
      Pull btrfs fixes from David Sterba:
       "First batch of various fixes, here's a list of notable ones:
      
         - fix unmountable seed device after fstrim
      
         - fix silent data loss in zoned mode due to ordered extent splitting
      
         - fix race leading to unpersisted data and metadata on fsync
      
         - fix deadlock when cloning inline extents and using qgroups"
      
      * tag 'for-5.13-rc1-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/kdave/linux:
        btrfs: initialize return variable in cleanup_free_space_cache_v1
        btrfs: zoned: sanity check zone type
        btrfs: fix unmountable seed device after fstrim
        btrfs: fix deadlock when cloning inline extents and using qgroups
        btrfs: fix race leading to unpersisted data and metadata on fsync
        btrfs: do not consider send context as valid when trying to flush qgroups
        btrfs: zoned: fix silent data loss after failure splitting ordered extent
      142b507f
    • Linus Torvalds's avatar
      Merge tag 'for-linus' of git://git.kernel.org/pub/scm/virt/kvm/kvm · 0aa099a3
      Linus Torvalds authored
      Pull kvm fixes from Paolo Bonzini:
      
       - Lots of bug fixes.
      
       - Fix virtualization of RDPID
      
       - Virtualization of DR6_BUS_LOCK, which on bare metal is new to this
         release
      
       - More nested virtualization migration fixes (nSVM and eVMCS)
      
       - Fix for KVM guest hibernation
      
       - Fix for warning in SEV-ES SRCU usage
      
       - Block KVM from loading on AMD machines with 5-level page tables, due
         to the APM not mentioning how host CR4.LA57 exactly impacts the
         guest.
      
      * tag 'for-linus' of git://git.kernel.org/pub/scm/virt/kvm/kvm: (48 commits)
        KVM: SVM: Move GHCB unmapping to fix RCU warning
        KVM: SVM: Invert user pointer casting in SEV {en,de}crypt helpers
        kvm: Cap halt polling at kvm->max_halt_poll_ns
        tools/kvm_stat: Fix documentation typo
        KVM: x86: Prevent deadlock against tk_core.seq
        KVM: x86: Cancel pvclock_gtod_work on module removal
        KVM: x86: Prevent KVM SVM from loading on kernels with 5-level paging
        KVM: X86: Expose bus lock debug exception to guest
        KVM: X86: Add support for the emulation of DR6_BUS_LOCK bit
        KVM: PPC: Book3S HV: Fix conversion to gfn-based MMU notifier callbacks
        KVM: x86: Hide RDTSCP and RDPID if MSR_TSC_AUX probing failed
        KVM: x86: Tie Intel and AMD behavior for MSR_TSC_AUX to guest CPU model
        KVM: x86: Move uret MSR slot management to common x86
        KVM: x86: Export the number of uret MSRs to vendor modules
        KVM: VMX: Disable loading of TSX_CTRL MSR the more conventional way
        KVM: VMX: Use common x86's uret MSR list as the one true list
        KVM: VMX: Use flag to indicate "active" uret MSRs instead of sorting list
        KVM: VMX: Configure list of user return MSRs at module init
        KVM: x86: Add support for RDPID without RDTSCP
        KVM: SVM: Probe and load MSR_TSC_AUX regardless of RDTSCP support in host
        ...
      0aa099a3
    • Andy Shevchenko's avatar
      hwmon: (ltc2992) Put fwnode in error case during ->probe() · 8370e5b0
      Andy Shevchenko authored
      In each iteration fwnode_for_each_available_child_node() bumps a reference
      counting of a loop variable followed by dropping in on a next iteration,
      
      Since in error case the loop is broken, we have to drop a reference count
      by ourselves. Do it for port_fwnode in error case during ->probe().
      
      Fixes: b0bd407e ("hwmon: (ltc2992) Add support")
      Cc: Alexandru Tachici <alexandru.tachici@analog.com>
      Signed-off-by: default avatarAndy Shevchenko <andy.shevchenko@gmail.com>
      Link: https://lore.kernel.org/r/20210510100136.3303142-1-andy.shevchenko@gmail.comSigned-off-by: default avatarGuenter Roeck <linux@roeck-us.net>
      8370e5b0
    • Václav Kubernát's avatar
      hwmon: (pmbus/fsp-3y) Fix FSP-3Y YH-5151E non-compliant vout encoding · 2d101db3
      Václav Kubernát authored
      I didn't properly test the driver for YH-5151E, so it was completely
      broken. Firstly, the log/real mapping was incorrect in one case.
      Secondly, PMBus specifies that output voltages should be in the linear16
      encoding. However, the YH-5151E is non-compliant and uses linear11.
      YM-2151E isn't affected by this. Fix this by converting the values
      inside the read functions. linear16 gets the exponent from the VOUT_MODE
      command. The device doesn't support it, so I have to manually supply the
      value for it.
      
      Both supported devices have now been tested to report correct vout
      values.
      
      Fixes: 1734b413 ("hwmon: Add driver for fsp-3y PSUs and PDUs")
      Signed-off-by: default avatarVáclav Kubernát <kubernat@cesnet.cz>
      Link: https://lore.kernel.org/r/20210429075337.110502-1-kubernat@cesnet.czSigned-off-by: default avatarGuenter Roeck <linux@roeck-us.net>
      2d101db3
    • Eddie James's avatar
      hwmon: (occ) Fix poll rate limiting · 5216dff2
      Eddie James authored
      The poll rate limiter time was initialized at zero. This breaks the
      comparison in time_after if jiffies is large. Switch to storing the
      next update time rather than the previous time, and initialize the
      time when the device is probed.
      
      Fixes: c10e753d ("hwmon (occ): Add sensor types and versions")
      Signed-off-by: default avatarEddie James <eajames@linux.ibm.com>
      Link: https://lore.kernel.org/r/20210429151336.18980-1-eajames@linux.ibm.comSigned-off-by: default avatarGuenter Roeck <linux@roeck-us.net>
      5216dff2
    • Wan Jiabing's avatar
      hwmon: (corsair-psu) Remove unneeded semicolons · 726c945a
      Wan Jiabing authored
      Fix the following coccicheck warning:
      
      ./drivers/hwmon/corsair-psu.c:379:2-3: Unneeded semicolon
      
      Remove unneeded semicolons.
      Signed-off-by: default avatarWan Jiabing <wanjiabing@vivo.com>
      Link: https://lore.kernel.org/r/20210427044219.7799-1-wanjiabing@vivo.comSigned-off-by: default avatarGuenter Roeck <linux@roeck-us.net>
      726c945a
    • Arnaldo Carvalho de Melo's avatar
      tools headers UAPI: Sync perf_event.h with the kernel sources · 71d7924b
      Arnaldo Carvalho de Melo authored
      To pick up the changes in:
      
        2b26f0aa ("perf: Support only inheriting events if cloned with CLONE_THREAD")
        2e498d0a ("perf: Add support for event removal on exec")
        547b6098 ("perf: aux: Add flags for the buffer format")
        55bcf6ef ("perf: Extend PERF_TYPE_HARDWARE and PERF_TYPE_HW_CACHE")
        7dde5176 ("perf: aux: Add CoreSight PMU buffer formats")
        97ba62b2 ("perf: Add support for SIGTRAP on perf events")
        d0d1dd62 ("perf core: Add PERF_COUNT_SW_CGROUP_SWITCHES event")
      
      Also change the expected sizeof(struct perf_event_attr) from 120 to 128 due to
      fields being added for the SIGTRAP changes.
      
      Addressing this perf build warning:
      
        Warning: Kernel ABI header at 'tools/include/uapi/linux/perf_event.h' differs from latest version at 'include/uapi/linux/perf_event.h'
        diff -u tools/include/uapi/linux/perf_event.h include/uapi/linux/perf_event.h
      
      Cc: Kan Liang <kan.liang@linux.intel.com>
      Cc: Marco Elver <elver@google.com>
      Cc: Mathieu Poirier <mathieu.poirier@linaro.org>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Suzuki K Poulose <suzuki.poulose@arm.com>
      Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      71d7924b
    • Arnaldo Carvalho de Melo's avatar
      tools headers cpufeatures: Sync with the kernel sources · 6faf64f5
      Arnaldo Carvalho de Melo authored
      To pick the changes from:
      
        4e629211 ("x86/paravirt: Add new features for paravirt patching")
        a161545a ("x86/cpufeatures: Enumerate Intel Hybrid Technology feature bit")
        a89dfde3 ("x86: Remove dynamic NOP selection")
        b8921dcc ("x86/cpufeatures: Add SGX1 and SGX2 sub-features")
        f21d4d3b ("x86/cpufeatures: Enumerate #DB for bus lock detection")
        f333374e ("x86/cpufeatures: Add the Virtual SPEC_CTRL feature")
      
      This only causes these perf files to be rebuilt:
      
        CC       /tmp/build/perf/bench/mem-memcpy-x86-64-asm.o
        CC       /tmp/build/perf/bench/mem-memset-x86-64-asm.o
      
      And addresses this perf build warning:
      
        Warning: Kernel ABI header at 'tools/arch/x86/include/asm/cpufeatures.h' differs from latest version at 'arch/x86/include/asm/cpufeatures.h'
        diff -u tools/arch/x86/include/asm/cpufeatures.h arch/x86/include/asm/cpufeatures.h
      
      Cc: Babu Moger <babu.moger@amd.com>
      Cc: Borislav Petkov <bp@suse.de>
      Cc: Fenghua Yu <fenghua.yu@intel.com>
      Cc: Juergen Gross <jgross@suse.com>
      Cc: Paolo Bonzini <pbonzini@redhat.com>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Ricardo Neri <ricardo.neri-calderon@linux.intel.com>
      Cc: Sean Christopherson <seanjc@google.com>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      6faf64f5
    • Arnaldo Carvalho de Melo's avatar
      tools include UAPI powerpc: Sync errno.h with the kernel headers · 39163293
      Arnaldo Carvalho de Melo authored
      To pick the change in:
      
        7de21e67 ("powerpc: fix EDEADLOCK redefinition error in uapi/asm/errno.h")
      
      That will make the errno number -> string tables to pick this change on powerpc.
      
      Silencing this perf build warning:
      
        Warning: Kernel ABI header at 'tools/arch/powerpc/include/uapi/asm/errno.h' differs from latest version at 'arch/powerpc/include/uapi/asm/errno.h'
        diff -u tools/arch/powerpc/include/uapi/asm/errno.h arch/powerpc/include/uapi/asm/errno.h
      
      Cc: Michael Ellerman <mpe@ellerman.id.au>
      Cc: Tony Ambardar <tony.ambardar@gmail.com>
      Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      39163293
    • Arnaldo Carvalho de Melo's avatar
      tools arch: Update arch/x86/lib/mem{cpy,set}_64.S copies used in 'perf bench mem memcpy' · fb24e308
      Arnaldo Carvalho de Melo authored
      To bring in the change made in this cset:
      
       5e21a3ec ("x86/alternative: Merge include files")
      
      This just silences these perf tools build warnings, no change in the tools:
      
        Warning: Kernel ABI header at 'tools/arch/x86/lib/memcpy_64.S' differs from latest version at 'arch/x86/lib/memcpy_64.S'
        diff -u tools/arch/x86/lib/memcpy_64.S arch/x86/lib/memcpy_64.S
        Warning: Kernel ABI header at 'tools/arch/x86/lib/memset_64.S' differs from latest version at 'arch/x86/lib/memset_64.S'
        diff -u tools/arch/x86/lib/memset_64.S arch/x86/lib/memset_64.S
      
      Cc: Borislav Petkov <bp@suse.de>
      Cc: Juergen Gross <jgross@suse.com>
      Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      fb24e308
    • Arnaldo Carvalho de Melo's avatar
      tools headers UAPI: Sync linux/prctl.h with the kernel sources · 5a80ee42
      Arnaldo Carvalho de Melo authored
      To pick a new prctl introduced in:
      
        20169862 ("arm64: Introduce prctl(PR_PAC_{SET,GET}_ENABLED_KEYS)")
      
      That results in
      
        $ grep prctl tools/perf/trace/beauty/*.sh
        tools/perf/trace/beauty/prctl_option.sh:printf "static const char *prctl_options[] = {\n"
        tools/perf/trace/beauty/prctl_option.sh:egrep $regex ${header_dir}/prctl.h | grep -v PR_SET_PTRACER | \
        tools/perf/trace/beauty/prctl_option.sh:printf "static const char *prctl_set_mm_options[] = {\n"
        tools/perf/trace/beauty/prctl_option.sh:egrep $regex ${header_dir}/prctl.h | \
        tools/perf/trace/beauty/x86_arch_prctl.sh:prctl_arch_header=${x86_header_dir}/prctl.h
        tools/perf/trace/beauty/x86_arch_prctl.sh:	printf "#define x86_arch_prctl_codes_%d_offset %s\n" $idx $first_entry
        tools/perf/trace/beauty/x86_arch_prctl.sh:	printf "static const char *x86_arch_prctl_codes_%d[] = {\n" $idx
        tools/perf/trace/beauty/x86_arch_prctl.sh:	egrep -q $regex ${prctl_arch_header} && \
        tools/perf/trace/beauty/x86_arch_prctl.sh:	(egrep $regex ${prctl_arch_header} | \
        $ tools/perf/trace/beauty/prctl_option.sh > before
        $ cp include/uapi/linux/prctl.h tools/include/uapi/linux/prctl.h
        $ tools/perf/trace/beauty/prctl_option.sh > after
        $ diff -u before after
        --- before	2021-05-09 10:06:10.064559675 -0300
        +++ after	2021-05-09 10:06:21.319791396 -0300
        @@ -54,6 +54,8 @@
         	[57] = "SET_IO_FLUSHER",
         	[58] = "GET_IO_FLUSHER",
         	[59] = "SET_SYSCALL_USER_DISPATCH",
        +	[60] = "PAC_SET_ENABLED_KEYS",
        +	[61] = "PAC_GET_ENABLED_KEYS",
         };
         static const char *prctl_set_mm_options[] = {
         	[1] = "START_CODE",
        $
      
      Now users can do:
      
        # perf trace -e syscalls:sys_enter_prctl --filter "option==PAC_GET_ENABLED_KEYS"
      ^C#
        # trace -v -e syscalls:sys_enter_prctl --filter "option==PAC_GET_ENABLED_KEYS"
        New filter for syscalls:sys_enter_prctl: (option==0x3d) && (common_pid != 5519 && common_pid != 3404)
      ^C#
      
      And also when prctl appears in a session, its options will be
      translated to the string.
      
      Cc: Catalin Marinas <catalin.marinas@arm.com>
      Cc: Peter Collingbourne <pcc@google.com>
      Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      5a80ee42
    • Arnaldo Carvalho de Melo's avatar
      tools headers UAPI: Sync files changed by landlock, quotactl_path and mount_settattr new syscalls · f8bcb061
      Arnaldo Carvalho de Melo authored
      To pick the changes in these csets:
      
        a49f4f81 ("arch: Wire up Landlock syscalls")
        2a186721 ("fs: add mount_setattr()")
        fa8b9007 ("quota: wire up quotactl_path")
      
      That silences these perf build warnings and add support for those new
      syscalls in tools such as 'perf trace'.
      
      For instance, this is now possible:
      
        # ~acme/bin/perf trace -v -e landlock*
        event qualifier tracepoint filter: (common_pid != 129365 && common_pid != 3502) && (id == 444 || id == 445 || id == 446)
        ^C#
      
      That is tha filter expression attached to the raw_syscalls:sys_{enter,exit}
      tracepoints.
      
        $ grep landlock tools/perf/arch/x86/entry/syscalls/syscall_64.tbl
        444	common	landlock_create_ruleset	sys_landlock_create_ruleset
        445	common	landlock_add_rule	sys_landlock_add_rule
        446	common	landlock_restrict_self	sys_landlock_restrict_self
        $
      
      This addresses these perf build warnings:
      
        Warning: Kernel ABI header at 'tools/include/uapi/asm-generic/unistd.h' differs from latest version at 'include/uapi/asm-generic/unistd.h'
        diff -u tools/include/uapi/asm-generic/unistd.h include/uapi/asm-generic/unistd.h
        Warning: Kernel ABI header at 'tools/perf/arch/x86/entry/syscalls/syscall_64.tbl' differs from latest version at 'arch/x86/entry/syscalls/syscall_64.tbl'
        diff -u tools/perf/arch/x86/entry/syscalls/syscall_64.tbl arch/x86/entry/syscalls/syscall_64.tbl
        Warning: Kernel ABI header at 'tools/perf/arch/powerpc/entry/syscalls/syscall.tbl' differs from latest version at 'arch/powerpc/kernel/syscalls/syscall.tbl'
        diff -u tools/perf/arch/powerpc/entry/syscalls/syscall.tbl arch/powerpc/kernel/syscalls/syscall.tbl
        Warning: Kernel ABI header at 'tools/perf/arch/s390/entry/syscalls/syscall.tbl' differs from latest version at 'arch/s390/kernel/syscalls/syscall.tbl'
        diff -u tools/perf/arch/s390/entry/syscalls/syscall.tbl arch/s390/kernel/syscalls/syscall.tbl
        Warning: Kernel ABI header at 'tools/perf/arch/mips/entry/syscalls/syscall_n64.tbl' differs from latest version at 'arch/mips/kernel/syscalls/syscall_n64.tbl'
        diff -u tools/perf/arch/mips/entry/syscalls/syscall_n64.tbl arch/mips/kernel/syscalls/syscall_n64.tbl
      
      Cc: Christian Brauner <christian.brauner@ubuntu.com>
      Cc: James Morris <jamorris@linux.microsoft.com>
      Cc: Jan Kara <jack@suse.cz>
      Cc: Mickaël Salaün <mic@linux.microsoft.com>
      Cc: Sascha Hauer <s.hauer@pengutronix.de>
      Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      f8bcb061
    • Masami Hiramatsu's avatar
      perf tools: Fix a build error on arm64 with clang · a00b7e39
      Masami Hiramatsu authored
      Since clang's -Wmissing-field-initializers warns if a data
      structure is initialized with a signle NULL as below,
      
       ----
       tools/perf $ make CC=clang LLVM=1
       ...
       arch/arm64/util/kvm-stat.c:74:9: error: missing field 'ops' initializer [-Werror,-Wmissing-field-initializers]
               { NULL },
                      ^
       1 error generated.
       ----
      
      add another field initializer expressly as same as other
      arch's kvm-stat.c code.
      Signed-off-by: default avatarMasami Hiramatsu <mhiramat@kernel.org>
      Cc: Anders Roxell <anders.roxell@linaro.org>
      Cc: Leo Yan <leo.yan@linaro.org>
      Cc: Sergey Senozhatsky <sergey.senozhatsky@gmail.com>
      Link: http://lore.kernel.org/lkml/162037767540.94840.15758657049033010518.stgit@devnote2Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      a00b7e39
    • Arnaldo Carvalho de Melo's avatar
      tools headers kvm: Sync kvm headers with the kernel sources · b35629bc
      Arnaldo Carvalho de Melo authored
      To pick the changes in:
      
        3c0c2ad1 ("KVM: VMX: Add basic handling of VM-Exit from SGX enclave")
      
      None of them trigger any changes in tooling, this time this is just to silence
      these perf build warnings:
      
        Warning: Kernel ABI header at 'tools/arch/x86/include/uapi/asm/vmx.h' differs from latest version at 'arch/x86/include/uapi/asm/vmx.h'
        diff -u tools/arch/x86/include/uapi/asm/vmx.h arch/x86/include/uapi/asm/vmx.h
      
      Cc: Paolo Bonzini <pbonzini@redhat.com>
      Cc: Sean Christopherson <seanjc@google.com>
      Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      b35629bc
    • Arnaldo Carvalho de Melo's avatar
      tools headers UAPI: Sync linux/kvm.h with the kernel sources · 0d943d5f
      Arnaldo Carvalho de Melo authored
      To pick the changes in:
      
        15fb7de1 ("KVM: SVM: Add KVM_SEV_RECEIVE_UPDATE_DATA command")
        3bf72569 ("KVM: arm64: Add support for the KVM PTP service")
        4cfdd47d ("KVM: SVM: Add KVM_SEV SEND_START command")
        54526d1f ("KVM: x86: Support KVM VMs sharing SEV context")
        5569e2e7 ("KVM: SVM: Add support for KVM_SEV_SEND_CANCEL command")
        8b13c364 ("KVM: introduce KVM_CAP_SET_GUEST_DEBUG2")
        af43cbbf ("KVM: SVM: Add support for KVM_SEV_RECEIVE_START command")
        d3d1af85 ("KVM: SVM: Add KVM_SEND_UPDATE_DATA command")
        fe7e9488 ("KVM: x86: Add capability to grant VM access to privileged SGX attribute")
      
      That don't cause any change in tooling as it doesn't introduce any new
      ioctl.
      
        $ grep kvm tools/perf/trace/beauty/*.sh
        tools/perf/trace/beauty/kvm_ioctl.sh:printf "static const char *kvm_ioctl_cmds[] = {\n"
        tools/perf/trace/beauty/kvm_ioctl.sh:egrep $regex ${header_dir}/kvm.h	| \
        $
        $ tools/perf/trace/beauty/kvm_ioctl.sh > before
        $ cp include/uapi/linux/kvm.h tools/include/uapi/linux/kvm.h
        $ tools/perf/trace/beauty/kvm_ioctl.sh > after
        $ diff -u before after
        $
      
      This silences this perf build warning:
      
        Warning: Kernel ABI header at 'tools/include/uapi/linux/kvm.h' differs from latest version at 'include/uapi/linux/kvm.h'
        diff -u tools/include/uapi/linux/kvm.h include/uapi/linux/kvm.h
      
      Cc: Brijesh Singh <brijesh.singh@amd.com>
      Cc: Jianyong Wu <jianyong.wu@arm.com>
      Cc: Marc Zyngier <maz@kernel.org>
      Cc: Nathan Tempelman <natet@google.com>
      Cc: Paolo Bonzini <pbonzini@redhat.com>
      Cc: Sean Christopherson <seanjc@google.com>
      Cc: Steve Rutherford <srutherford@google.com>
      Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      0d943d5f