1. 24 Jun, 2022 3 commits
    • Ravi Bangoria's avatar
      perf header: Pass "cpu" pmu name while printing caps · 2a12bef4
      Ravi Bangoria authored
      Avoid unnecessary conditional code to check if pmu name is NULL
      or not by passing "cpu" pmu name to the printing function.
      Reviewed-by: default avatarKan Liang <kan.liang@linux.intel.com>
      Signed-off-by: default avatarRavi Bangoria <ravi.bangoria@amd.com>
      Acked-by: default avatarNamhyung Kim <namhyung@kernel.org>
      Cc: Ananth Narayan <ananth.narayan@amd.com>
      Cc: Andi Kleen <ak@linux.intel.com>
      Cc: Borislav Petkov <bp@alien8.de>
      Cc: Ian Rogers <irogers@google.com>
      Cc: Ingo Molnar <mingo@redhat.com>
      Cc: James Clark <james.clark@arm.com>
      Cc: Jiri Olsa <jolsa@kernel.org>
      Cc: Kim Phillips <kim.phillips@amd.com>
      Cc: Leo Yan <leo.yan@linaro.org>
      Cc: Mark Rutland <mark.rutland@arm.com>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Robert Richter <rrichter@amd.com>
      Cc: Sandipan Das <sandipan.das@amd.com>
      Cc: Santosh Shukla <santosh.shukla@amd.com>
      Cc: Stephane Eranian <eranian@google.com>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: like.xu.linux@gmail.com
      Cc: x86@kernel.org
      Link: https://lore.kernel.org/r/20220604044519.594-4-ravi.bangoria@amd.comSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      2a12bef4
    • Ravi Bangoria's avatar
      perf pmu: Parse pmu caps sysfs only once · 3339ec44
      Ravi Bangoria authored
      In addition to returning nr_caps, cache it locally in struct perf_pmu.
      
      Similarly, cache status of whether caps sysfs has already been parsed
      or not. These will help to avoid parsing sysfs every time the function
      gets called.
      Reviewed-by: default avatarKan Liang <kan.liang@linux.intel.com>
      Signed-off-by: default avatarRavi Bangoria <ravi.bangoria@amd.com>
      Acked-by: default avatarNamhyung Kim <namhyung@kernel.org>
      Cc: Ananth Narayan <ananth.narayan@amd.com>
      Cc: Andi Kleen <ak@linux.intel.com>
      Cc: Borislav Petkov <bp@alien8.de>
      Cc: Ian Rogers <irogers@google.com>
      Cc: Ingo Molnar <mingo@redhat.com>
      Cc: James Clark <james.clark@arm.com>
      Cc: Jiri Olsa <jolsa@kernel.org>
      Cc: Kim Phillips <kim.phillips@amd.com>
      Cc: Leo Yan <leo.yan@linaro.org>
      Cc: Mark Rutland <mark.rutland@arm.com>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Robert Richter <rrichter@amd.com>
      Cc: Sandipan Das <sandipan.das@amd.com>
      Cc: Santosh Shukla <santosh.shukla@amd.com>
      Cc: Stephane Eranian <eranian@google.com>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: like.xu.linux@gmail.com
      Cc: x86@kernel.org
      Link: https://lore.kernel.org/r/20220604044519.594-3-ravi.bangoria@amd.comSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      3339ec44
    • Ravi Bangoria's avatar
      perf record ibs: Warn about sampling period skew · 9ab95b0b
      Ravi Bangoria authored
      Samples without an L3 miss are discarded and counter is reset with
      random value (between 1-15 for fetch PMU and 1-127 for op PMU) when IBS
      L3 miss filtering is enabled. This causes a sampling period skew but
      there is no way to reconstruct aggregated sampling period. So print a
      warning at perf record if user sets l3missonly=1.
      
      Ex:
      
        # perf record -c 10000 -C 0 -e ibs_op/l3missonly=1/
        WARNING: Hw internally resets sampling period when L3 Miss Filtering is enabled
        and tagged operation does not cause L3 Miss. This causes sampling period skew.
      Signed-off-by: default avatarRavi Bangoria <ravi.bangoria@amd.com>
      Acked-by: default avatarIan Rogers <irogers@google.com>
      Acked-by: default avatarNamhyung Kim <namhyung@kernel.org>
      Cc: Ananth Narayan <ananth.narayan@amd.com>
      Cc: Andi Kleen <ak@linux.intel.com>
      Cc: Borislav Petkov <bp@alien8.de>
      Cc: James Clark <james.clark@arm.com>
      Cc: Jiri Olsa <jolsa@kernel.org>
      Cc: Kan Liang <kan.liang@linux.intel.com>
      Cc: Kim Phillips <kim.phillips@amd.com>
      Cc: Leo Yan <leo.yan@linaro.org>
      Cc: Mark Rutland <mark.rutland@arm.com>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Robert Richter <rrichter@amd.com>
      Cc: Sandipan Das <sandipan.das@amd.com>
      Cc: Santosh Shukla <santosh.shukla@amd.com>
      Cc: Stephane Eranian <eranian@google.com>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: like.xu.linux@gmail.com
      Cc: x86@kernel.org
      Link: http://lore.kernel.org/lkml/20220604044519.594-2-ravi.bangoria@amd.comSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      9ab95b0b
  2. 23 Jun, 2022 18 commits
  3. 22 Jun, 2022 7 commits
  4. 21 Jun, 2022 12 commits
    • Anatolii Gerasymenko's avatar
      ice: ethtool: Prohibit improper channel config for DCB · a632b2a4
      Anatolii Gerasymenko authored
      Do not allow setting less channels, than Traffic Classes there are
      via ethtool. There must be at least one channel per Traffic Class.
      
      If you set less channels, than Traffic Classes there are, then during
      ice_vsi_rebuild there would be allocated only the requested amount
      of tx/rx rings in ice_vsi_alloc_arrays. But later in ice_vsi_setup_q_map
      there would be requested at least one channel per Traffic Class. This
      results in setting num_rxq > alloc_rxq and num_txq > alloc_txq.
      Later, there would be a NULL pointer dereference in
      ice_vsi_map_rings_to_vectors, because we go beyond of rx_rings or
      tx_rings arrays.
      
      Change ice_set_channels() to return error if you try to allocate less
      channels, than Traffic Classes there are.
      Change ice_vsi_setup_q_map() and ice_vsi_setup_q_map_mqprio() to return
      status code instead of void.
      Add error handling for ice_vsi_setup_q_map() and
      ice_vsi_setup_q_map_mqprio() in ice_vsi_init() and ice_vsi_cfg_tc().
      
      [53753.889983] INFO: Flow control is disabled for this traffic class (0) on this vsi.
      [53763.984862] BUG: unable to handle kernel NULL pointer dereference at 0000000000000028
      [53763.992915] PGD 14b45f5067 P4D 0
      [53763.996444] Oops: 0002 [#1] SMP NOPTI
      [53764.000312] CPU: 12 PID: 30661 Comm: ethtool Kdump: loaded Tainted: GOE    --------- -  - 4.18.0-240.el8.x86_64 #1
      [53764.011825] Hardware name: Intel Corporation WilsonCity/WilsonCity, BIOS WLYDCRB1.SYS.0020.P21.2012150710 12/15/2020
      [53764.022584] RIP: 0010:ice_vsi_map_rings_to_vectors+0x7e/0x120 [ice]
      [53764.029089] Code: 41 0d 0f b7 b7 12 05 00 00 0f b6 d0 44 29 de 44 0f b7 c6 44 01 c2 41 39 d0 7d 2d 4c 8b 47 28 44 0f b7 ce 83 c6 01 4f 8b 04 c8 <49> 89 48 28 4                           c 8b 89 b8 01 00 00 4d 89 08 4c 89 81 b8 01 00 00 44
      [53764.048379] RSP: 0018:ff550dd88ea47b20 EFLAGS: 00010206
      [53764.053884] RAX: 0000000000000002 RBX: 0000000000000004 RCX: ff385ea42fa4a018
      [53764.061301] RDX: 0000000000000006 RSI: 0000000000000005 RDI: ff385e9baeedd018
      [53764.068717] RBP: 0000000000000010 R08: 0000000000000000 R09: 0000000000000004
      [53764.076133] R10: 0000000000000002 R11: 0000000000000004 R12: 0000000000000000
      [53764.083553] R13: 0000000000000000 R14: ff385e658fdd9000 R15: ff385e9baeedd018
      [53764.090976] FS:  000014872c5b5740(0000) GS:ff385e847f100000(0000) knlGS:0000000000000000
      [53764.099362] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
      [53764.105409] CR2: 0000000000000028 CR3: 0000000a820fa002 CR4: 0000000000761ee0
      [53764.112851] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
      [53764.120301] DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
      [53764.127747] PKRU: 55555554
      [53764.130781] Call Trace:
      [53764.133564]  ice_vsi_rebuild+0x611/0x870 [ice]
      [53764.138341]  ice_vsi_recfg_qs+0x94/0x100 [ice]
      [53764.143116]  ice_set_channels+0x1a8/0x3e0 [ice]
      [53764.147975]  ethtool_set_channels+0x14e/0x240
      [53764.152667]  dev_ethtool+0xd74/0x2a10
      [53764.156665]  ? __mod_lruvec_state+0x44/0x110
      [53764.161280]  ? __mod_lruvec_state+0x44/0x110
      [53764.165893]  ? page_add_file_rmap+0x15/0x170
      [53764.170518]  ? inet_ioctl+0xd1/0x220
      [53764.174445]  ? netdev_run_todo+0x5e/0x290
      [53764.178808]  dev_ioctl+0xb5/0x550
      [53764.182485]  sock_do_ioctl+0xa0/0x140
      [53764.186512]  sock_ioctl+0x1a8/0x300
      [53764.190367]  ? selinux_file_ioctl+0x161/0x200
      [53764.195090]  do_vfs_ioctl+0xa4/0x640
      [53764.199035]  ksys_ioctl+0x60/0x90
      [53764.202722]  __x64_sys_ioctl+0x16/0x20
      [53764.206845]  do_syscall_64+0x5b/0x1a0
      [53764.210887]  entry_SYSCALL_64_after_hwframe+0x65/0xca
      
      Fixes: 87324e74 ("ice: Implement ethtool ops for channels")
      Signed-off-by: default avatarAnatolii Gerasymenko <anatolii.gerasymenko@intel.com>
      Tested-by: Gurucharan <gurucharanx.g@intel.com> (A Contingent worker at Intel)
      Signed-off-by: default avatarTony Nguyen <anthony.l.nguyen@intel.com>
      a632b2a4
    • Anatolii Gerasymenko's avatar
      ice: ethtool: advertise 1000M speeds properly · c3d184c8
      Anatolii Gerasymenko authored
      In current implementation ice_update_phy_type enables all link modes
      for selected speed. This approach doesn't work for 1000M speeds,
      because both copper (1000baseT) and optical (1000baseX) standards
      cannot be enabled at once.
      
      Fix this, by adding the function `ice_set_phy_type_from_speed()`
      for 1000M speeds.
      
      Fixes: 48cb27f2 ("ice: Implement handlers for ethtool PHY/link operations")
      Signed-off-by: default avatarAnatolii Gerasymenko <anatolii.gerasymenko@intel.com>
      Tested-by: Gurucharan <gurucharanx.g@intel.com> (A Contingent worker at Intel)
      Signed-off-by: default avatarTony Nguyen <anthony.l.nguyen@intel.com>
      c3d184c8
    • Wojciech Drewek's avatar
      ice: Fix switchdev rules book keeping · 3578dc90
      Wojciech Drewek authored
      Adding two filters with same matching criteria ends up with
      one rule in hardware with act = ICE_FWD_TO_VSI_LIST.
      In order to remove them properly we have to keep the
      information about vsi handle which is used in VSI bitmap
      (ice_adv_fltr_mgmt_list_entry::vsi_list_info::vsi_map).
      
      Fixes: 0d08a441 ("ice: ndo_setup_tc implementation for PF")
      Reported-by: default avatarSridhar Samudrala <sridhar.samudrala@intel.com>
      Signed-off-by: default avatarWojciech Drewek <wojciech.drewek@intel.com>
      Tested-by: default avatarSandeep Penigalapati <sandeep.penigalapati@intel.com>
      Signed-off-by: default avatarTony Nguyen <anthony.l.nguyen@intel.com>
      3578dc90
    • Marcin Szycik's avatar
      ice: ignore protocol field in GTP offload · d4ea6f63
      Marcin Szycik authored
      Commit 34a89775 ("ice: Add support for inner etype in switchdev")
      added the ability to match on inner ethertype. A side effect of that change
      is that it is now impossible to add some filters for protocols which do not
      contain inner ethtype field. tc requires the protocol field to be specified
      when providing certain other options, e.g. src_ip. This is a problem in
      case of GTP - when user wants to specify e.g. src_ip, they also need to
      specify protocol in tc command (otherwise tc fails with: Illegal "src_ip").
      Because GTP is a tunnel, the protocol field is treated as inner protocol.
      GTP does not contain inner ethtype field and the filter cannot be added.
      
      To fix this, ignore the ethertype field in case of GTP filters.
      
      Fixes: 9a225f81 ("ice: Support GTP-U and GTP-C offload in switchdev")
      Signed-off-by: default avatarMarcin Szycik <marcin.szycik@linux.intel.com>
      Tested-by: default avatarSandeep Penigalapati <sandeep.penigalapati@intel.com>
      Signed-off-by: default avatarTony Nguyen <anthony.l.nguyen@intel.com>
      d4ea6f63
    • Linus Torvalds's avatar
      Merge tag 'efi-urgent-for-v5.19-1' of git://git.kernel.org/pub/scm/linux/kernel/git/efi/efi · ca1fdab7
      Linus Torvalds authored
      Pull EFI fixes from Ard Biesheuvel:
      
       - remove pointless include of asm/efi.h, which does not exist on ia64
      
       - fix DXE service marshalling prototype for mixed mode
      
      * tag 'efi-urgent-for-v5.19-1' of git://git.kernel.org/pub/scm/linux/kernel/git/efi/efi:
        efi/x86: libstub: Fix typo in __efi64_argmap* name
        efi: sysfb_efi: remove unnecessary <asm/efi.h> include
      ca1fdab7
    • Linus Torvalds's avatar
      Merge tag 'certs-20220621' of git://git.kernel.org/pub/scm/linux/kernel/git/dhowells/linux-fs · 0273fd42
      Linus Torvalds authored
      Pull signature checking selftest from David Howells:
       "The signature checking code, as used by module signing, kexec, etc.,
        is non-FIPS compliant as there is no selftest.
      
        For a kernel to be FIPS-compliant, signature checking would have to be
        tested before being used, and the box would need to panic if it's not
        available (probably reasonable as simply disabling signature checking
        would prevent you from loading any driver modules).
      
        Deal with this by adding a minimal test.
      
        This is split into two patches: the first moves load_certificate_list()
        to the same place as the X.509 code to make it more accessible
        internally; the second adds a selftest"
      
      * tag 'certs-20220621' of git://git.kernel.org/pub/scm/linux/kernel/git/dhowells/linux-fs:
        certs: Add FIPS selftests
        certs: Move load_certificate_list() to be with the asymmetric keys code
      0273fd42
    • Linus Torvalds's avatar
      Merge tag 'for-5.19-rc3-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/kdave/linux · ff872b76
      Linus Torvalds authored
      Pull btrfs fixes from David Sterba:
      
       - print more error messages for invalid mount option values
      
       - prevent remount with v1 space cache for subpage filesystem
      
       - fix hang during unmount when block group reclaim task is running
      
      * tag 'for-5.19-rc3-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/kdave/linux:
        btrfs: add error messages to all unrecognized mount options
        btrfs: prevent remounting to v1 space cache for subpage mount
        btrfs: fix hang during unmount when block group reclaim task is running
      ff872b76
    • David Howells's avatar
      afs: Fix dynamic root getattr · cb78d1b5
      David Howells authored
      The recent patch to make afs_getattr consult the server didn't account
      for the pseudo-inodes employed by the dynamic root-type afs superblock
      not having a volume or a server to access, and thus an oops occurs if
      such a directory is stat'd.
      
      Fix this by checking to see if the vnode->volume pointer actually points
      anywhere before following it in afs_getattr().
      
      This can be tested by stat'ing a directory in /afs.  It may be
      sufficient just to do "ls /afs" and the oops looks something like:
      
              BUG: kernel NULL pointer dereference, address: 0000000000000020
              ...
              RIP: 0010:afs_getattr+0x8b/0x14b
              ...
              Call Trace:
               <TASK>
               vfs_statx+0x79/0xf5
               vfs_fstatat+0x49/0x62
      
      Fixes: 2aeb8c86 ("afs: Fix afs_getattr() to refetch file status if callback break occurred")
      Reported-by: default avatarMarc Dionne <marc.dionne@auristor.com>
      Signed-off-by: default avatarDavid Howells <dhowells@redhat.com>
      Reviewed-by: default avatarMarc Dionne <marc.dionne@auristor.com>
      Tested-by: default avatarMarc Dionne <marc.dionne@auristor.com>
      cc: linux-afs@lists.infradead.org
      Link: https://lore.kernel.org/r/165408450783.1031787.7941404776393751186.stgit@warthog.procyon.org.uk/Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      cb78d1b5
    • Evgeniy Baskov's avatar
      efi/x86: libstub: Fix typo in __efi64_argmap* name · aa6d1ed1
      Evgeniy Baskov authored
      The actual name of the DXE services function used
      is set_memory_space_attributes(), not set_memory_space_descriptor().
      
      Change EFI mixed mode helper macro name to match the function name.
      
      Fixes: 31f1a0ed ("efi/x86: libstub: Make DXE calls mixed mode safe")
      Signed-off-by: default avatarEvgeniy Baskov <baskov@ispras.ru>
      Signed-off-by: default avatarArd Biesheuvel <ardb@kernel.org>
      aa6d1ed1
    • Javier Martinez Canillas's avatar
      efi: sysfb_efi: remove unnecessary <asm/efi.h> include · 34705a57
      Javier Martinez Canillas authored
      Nothing defined in the header is used by drivers/firmware/efi/sysfb_efi.c
      but also, including it can lead to build errors when built on arches that
      don't have an asm/efi.h header file.
      
      This can happen for example if a driver that is built when COMPILE_TEST is
      enabled selects the SYSFB symbol, e.g. on powerpc with allyesconfig:
      
      drivers/firmware/efi/sysfb_efi.c:29:10: fatal error: asm/efi.h: No such file or directory
         29 | #include <asm/efi.h>
            |          ^~~~~~~~~~~
      Reported-by: default avatarStephen Rothwell <sfr@canb.auug.org.au>
      Signed-off-by: default avatarJavier Martinez Canillas <javierm@redhat.com>
      Signed-off-by: default avatarArd Biesheuvel <ardb@kernel.org>
      34705a57
    • David Howells's avatar
      certs: Add FIPS selftests · 3cde3174
      David Howells authored
      Add some selftests for signature checking when FIPS mode is enabled.  These
      need to be done before we start actually using the signature checking for
      things and must panic the kernel upon failure.
      
      Note that the tests must not check the blacklist lest this provide a way to
      prevent a kernel from booting by installing a hash of a test key in the
      appropriate UEFI table.
      Reported-by: default avatarSimo Sorce <simo@redhat.com>
      Signed-off-by: default avatarDavid Howells <dhowells@redhat.com>
      Reviewed-by: default avatarSimo Sorce <simo@redhat.com>
      Reviewed-by: default avatarHerbert Xu <herbert@gondor.apana.org.au>
      cc: keyrings@vger.kernel.org
      cc: linux-crypto@vger.kernel.org
      Link: https://lore.kernel.org/r/165515742832.1554877.2073456606206090838.stgit@warthog.procyon.org.uk/
      3cde3174
    • David Howells's avatar
      certs: Move load_certificate_list() to be with the asymmetric keys code · 60050ffe
      David Howells authored
      Move load_certificate_list(), which loads a series of binary X.509
      certificates from a blob and inserts them as keys into a keyring, to be
      with the asymmetric keys code that it drives.
      
      This makes it easier to add FIPS selftest code in which we need to load up
      a private keyring for the tests to use.
      Signed-off-by: default avatarDavid Howells <dhowells@redhat.com>
      Reviewed-by: default avatarSimo Sorce <simo@redhat.com>
      Reviewed-by: default avatarHerbert Xu <herbert@gondor.apana.org.au>
      cc: keyrings@vger.kernel.org
      cc: linux-crypto@vger.kernel.org
      Link: https://lore.kernel.org/r/165515742145.1554877.13488098107542537203.stgit@warthog.procyon.org.uk/
      60050ffe