Commit Graph

997459 Commits

Author SHA1 Message Date
Bhaskar Chowdhury 8a2dc6af67 sch_red: Fix a typo
s/recalcultion/recalculation/

Signed-off-by: Bhaskar Chowdhury <unixbhaskar@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2021-03-19 11:51:03 -07:00
Linus Torvalds 6bfea141b3 s390 updates for 5.12-rc4
- disable preemption when accessing local per-cpu variables in the new
   counter set driver
 
 - fix by a factor of four increased steal time due to missing
   cputime_to_nsecs() conversion
 
 - fix PCI device structure leak
 -----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCAAdFiEECMNfWEw3SLnmiLkZIg7DeRspbsIFAmBU69MACgkQIg7DeRsp
 bsLyGA/+LXcEa1+WnzbsYFxTdvA/mfpoEXVOCk8VmQPvNSkH6dG+aUvXE41EHsmD
 88yUUEl7ux1+D9YPn2hj2E+ThtYmf1Cv19IyA6wGUa1aemZ0fB3kkXP1MhmtJV2w
 yfo8dvtEaBUcdm/qgy7v/vXZHM7FVTCkxD7pgHG/5M52a2gW+8liteDBxz4Iwi12
 jOxRSRtzxjZNl5ZRwG7nityTpldlEEVwRm9s8y07PLyMADTt7vP35J5OFpUukWfm
 SapXUZ4k2YctzSUue0zT2SWdbSlyEloI8QlzmE2WvYpMLxC6OitMrEwXhggnOnPC
 SXZf8Q9LHGxD0To9yvwqoljKQpJx9jNGA/SL3Iqmf1f1Z25hzijVcPNvDrUkJIbG
 xwzKHrGXjamZH13Sos+yLsvZ5Q5RUg40wK6BPFKdlnaKwC2yRKaAoSliPlmZufJZ
 0c8saNoc8Z9+oQMVS/vg+9cDo/4LF/KF1OZJhkchnBBttNIKyZArkw/RYWVorpGX
 E7vAcgNOWATd5cD0M+0ysEqx285jqNt/hxitezgMlg0mEkebrC/MP/4qW7HfO2XH
 tkR1lE9lOmf5k//y+NRvcz9QTpxjPtC6cpTBi2UlgTnLJ6Ma5EIXKYKqebEkF7JN
 IwCIcRI+GqjeFO9P1psqhO8/DXIqWbGqhJ75hUXfnNVg77uqR5o=
 =F2B0
 -----END PGP SIGNATURE-----

Merge tag 's390-5.12-4' of git://git.kernel.org/pub/scm/linux/kernel/git/s390/linux

Pull s390 updates from Heiko Carstens:

 - disable preemption when accessing local per-cpu variables in the new
   counter set driver

 - fix by a factor of four increased steal time due to missing
   cputime_to_nsecs() conversion

 - fix PCI device structure leak

* tag 's390-5.12-4' of git://git.kernel.org/pub/scm/linux/kernel/git/s390/linux:
  s390/pci: fix leak of PCI device structure
  s390/vtime: fix increased steal time accounting
  s390/cpumf: disable preemption when accessing per-cpu variable
2021-03-19 11:39:28 -07:00
Xin Long 8ff0b1f08e sctp: move sk_route_caps check and set into sctp_outq_flush_transports
The sk's sk_route_caps is set in sctp_packet_config, and later it
only needs to change when traversing the transport_list in a loop,
as the dst might be changed in the tx path.

So move sk_route_caps check and set into sctp_outq_flush_transports
from sctp_packet_transmit. This also fixes a dst leak reported by
Chen Yi:

  https://bugzilla.kernel.org/show_bug.cgi?id=212227

As calling sk_setup_caps() in sctp_packet_transmit may also set the
sk_route_caps for the ctrl sock in a netns. When the netns is being
deleted, the ctrl sock's releasing is later than dst dev's deleting,
which will cause this dev's deleting to hang and dmesg error occurs:

  unregister_netdevice: waiting for xxx to become free. Usage count = 1

Reported-by: Chen Yi <yiche@redhat.com>
Fixes: bcd623d8e9 ("sctp: call sk_setup_caps in sctp_packet_transmit instead")
Signed-off-by: Xin Long <lucien.xin@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2021-03-19 11:34:49 -07:00
Linus Torvalds 278924cb99 Fix workqueue trace event unsafe string reference
After adding a verifier to test all strings printed in trace events
 to make sure they either point to a string on the ring buffer,
 or to read only core kernel memory, it triggered on a workqueue
 trace event. The trace event workqueue_queue_work references
 the allocated name of the workqueue in the output. If the workqueue
 is freed before the trace is read, then the trace will dereference
 freed memory. Update the trace event to use the __string(), __assign_str(),
 and __get_str() helpers to handle such cases.
 -----BEGIN PGP SIGNATURE-----
 
 iIoEABYIADIWIQRRSw7ePDh/lE+zeZMp5XQQmuv6qgUCYFSrChQccm9zdGVkdEBn
 b29kbWlzLm9yZwAKCRAp5XQQmuv6qnJpAP9XZR+/XryjQgTGmaXWeD3n2YdRmR5p
 Foz5nLhURN/+KAEA8fPqLXyBGowl87twYJIFzmYAd0OtLBD3MTrTMenvCQ4=
 =akct
 -----END PGP SIGNATURE-----

Merge tag 'trace-v5.12-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-trace

Pull workqueue tracing fix from Steven Rostedt:
 "Fix workqueue trace event unsafe string reference

  After adding a verifier to test all strings printed in trace events to
  make sure they either point to a string on the ring buffer, or to read
  only core kernel memory, it triggered on a workqueue trace event. The
  trace event workqueue_queue_work references the allocated name of the
  workqueue in the output. If the workqueue is freed before the trace is
  read, then the trace will dereference freed memory.

  Update the trace event to use the __string(), __assign_str(), and
  __get_str() helpers to handle such cases"

* tag 'trace-v5.12-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-trace:
  workqueue/tracing: Copy workqueue name to buffer in trace event
2021-03-19 10:06:30 -07:00
Linus Torvalds ec85720933 Power management fixes for 5.12-rc4
- Revert ACPI PM commit that attempted to improve reboot handling
    on some systems, but it caused other systems to panic() during
    reboot (Josef Bacik).
 
  - Revert PM-runtime commit that attempted to improve the handling
    of suppliers during PM-runtime suspend of a consumer device, but
    it introduced a race condition potentially leading to unexpected
    behavior (Rafael Wysocki).
 -----BEGIN PGP SIGNATURE-----
 
 iQJGBAABCAAwFiEE4fcc61cGeeHD/fCwgsRv/nhiVHEFAmBUx4YSHHJqd0Byand5
 c29ja2kubmV0AAoJEILEb/54YlRxzX4P/2DEYb3+rwy6xEwjdagbDOvlNgnqmMux
 1bWZs+E+WEDEsEQrPgm0LwzR/KReXRYZ2oJUlXv6TnqCqT5QSQZcXtrooxrQo9KK
 0ASaYhHeAwUaw8Sdsle7xR16dLBDimZ8S99l8Cb+qpjlkPSiwRkbxpAPGkWgGJOA
 YV5AgKZOgf5iUQcSj/z3MEELdzINokj8angj19WMLc0i96LDy8WmkZ4KnYYvwQrn
 wo4h/EZbaWQa2/1kfEbF67hoI0rEdDPmteGoFjwtgeHMLwLVrRxseMlD42AQG5YT
 AJ0ATXC2W1/hPLgHsDLUm1eMxGqq6uNjv5xV08K/32wwBWR2oygbYy9X1KRuJ/Ca
 tNMpI5g2Qi8kEBApD22qesJbv36i8YgKg77e1ge6tvQjGpEYKmICZl3YuvJ6K4Hz
 f2O0TCelhPPsLGfCUw9OuOnlZQ1l8n9xPmErDEkdC8v+NLEoWH9MNaIKRKULmM04
 qm25/q0YKlkZt2VutgtMl0Lq+1lfM00jX0JF5Lo6MiE1Ih65hBYaQJKf8Wmb3adG
 iUgDrhtejgJ1/tiVs8DlFYk5kRresWCiJEZ4P2611oKK1cqiKdRj18wFdldLsxxn
 ZDteGkObf6s2qLvHx37koYfxcKlW7uLfDbOq8SNeizdQC5fR+LnGCVRnE9ZoGM4a
 koggpjlTN10X
 =RB5l
 -----END PGP SIGNATURE-----

Merge tag 'pm-5.12-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm

Pull power management fixes from Rafael Wysocki:
 "Revert two problematic commits.

  Specifics:

   - Revert ACPI PM commit that attempted to improve reboot handling on
     some systems, but it caused other systems to panic() during reboot
     (Josef Bacik)

   - Revert PM-runtime commit that attempted to improve the handling of
     suppliers during PM-runtime suspend of a consumer device, but it
     introduced a race condition potentially leading to unexpected
     behavior (Rafael Wysocki)"

* tag 'pm-5.12-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm:
  Revert "PM: runtime: Update device status before letting suppliers suspend"
  Revert "PM: ACPI: reboot: Use S5 for reboot"
2021-03-19 10:00:10 -07:00
Linus Torvalds 65a1037471 IOMMU Fixes for Linux v5.12-rc3
Including:
 
 	- Three AMD IOMMU patches to fix a boot crash on AMD Stoney
 	  systems and every other AMD IOMMU system booted with
 	  'amd_iommu=off'. This is a v5.11 regression.
 
 	- A Fix for the Tegra IOMMU driver to make sure it detects all
 	  IOMMUs
 -----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCAAdFiEEr9jSbILcajRFYWYyK/BELZcBGuMFAmBUhvoACgkQK/BELZcB
 GuMsWg//ZKqUb2tzOHnlrHk9kUqOZ9tm0e+PQuG3G22VvB7RKR1jhkodVDpAlJwA
 k57S7ij/5r6xTyhpyKvHr2KC0Ms/TEhPflB8Tf0xiG3rKnks0vLETWSBnhgZFblo
 g0hJ/ZeuBElgcy/SJSz1p44+HHBmDEDpFGuv8QuY1fy2vg3MoVvxoYnM1SSToF3m
 xtR2zZ1QE1eRfkq9MNnB1HdYA8PwF4E0ISY5eYFTyX+x56TYSqFkqLcWPX0qqUX1
 AwjPRWjKzw8hOFOecwMdSq3IfT7aupio7QISZ8WfoDz9CPKg2RCpRaovSeyVgPCN
 Gm0uRXoQkjcZCgiIB0wwBsFQKuR6tkhltmqD8qIj2xopa2/uqF0DZ759o3qF7+Cy
 xgGALJNO77+zYeGO5ms9WeiJf3l0AFHolYLPaFxjrp5uKU8BWoGmR+LKZy3MEcmD
 6MAqAF18lr5pYrNsY8t/u6e9yxeQFdqzWKBCH6JIQimNG2HgY0lgcRYXrH9fb41d
 YzLtpY6ZjncMaOOKHMoBc3TOZ2mC4/6jsQdgJSHK+Ji75B9eUrW24k9mvrU91kgj
 Di9pM1ACQeeDN8rEbiQNdiF4AbhIpQktHkHyd0eMfxFl/W/O8StZfODQi7RM94u8
 h43dAIti2bDU+51f7a66QIpjOyQZFcnE9waUAdwneO7Vg6mBiIk=
 =PJvl
 -----END PGP SIGNATURE-----

Merge tag 'iommu-fixes-v5.12-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/joro/iommu

Pull iommu fixes from Joerg Roedel:

 - Three AMD IOMMU patches to fix a boot crash on AMD Stoney systems and
   every other AMD IOMMU system booted with 'amd_iommu=off'.

   This is a v5.11 regression.

 - A Fix for the Tegra IOMMU driver to make sure it detects all IOMMUs

* tag 'iommu-fixes-v5.12-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/joro/iommu:
  iommu/tegra-smmu: Make tegra_smmu_probe_device() to handle all IOMMU phandles
  iommu/amd: Keep track of amd_iommu_irq_remap state
  iommu/amd: Don't call early_amd_iommu_init() when AMD IOMMU is disabled
  iommu/amd: Move Stoney Ridge check to detect_ivrs()
2021-03-19 09:56:04 -07:00
Linus Torvalds 769e155c53 sound fixes for 5.12-rc4
Majority of changes are various ASoC device/platform-specific small
 fixes (including a removal of stale file) while the only common
 change is a clk management fix in ASoC simple-card driver.
 The rest are usual HD-audio quirks.
 -----BEGIN PGP SIGNATURE-----
 
 iQJCBAABCAAsFiEEIXTw5fNLNI7mMiVaLtJE4w1nLE8FAmBUbqgOHHRpd2FpQHN1
 c2UuZGUACgkQLtJE4w1nLE+4yBAAkA6y2fNlWYsQzZeNeWNnZyRdeoi5M0Flqd0q
 PRK6VynM/M0kn2U/PgwhlDgrcNPqmW6AgXAPEEnv5zfwPs9MPXM3B9uJiiIOW6t1
 c0EfS2msnTXx6RAn62ecYJkp6BUVnejAYIgzKiLOBj5/0mNXgnbTfC7PSnfghWca
 ajtq/+l3pr519C4ewJSKZ84ho3S7mEEZdBGkpvaYTVZY09mkoZj1eefuQBp8690d
 n/jTl+gCk8Z3834bhBKgdax2huZmTaMQ2wXsoEHZNPpHr2NfmR0RvPgnNutDA6uJ
 JVM4KBStTxIpgg84D0wXIOvUst4/FcPtaho5UCNqSJ1/xoom+BGV3hTXLSW1SVUT
 /TUZje6hCfl9WyN5lR2S2JIYorTp6yqLQscXPmolkq+vtkLbQa83MybhyTK1w78q
 xMLCezctc3cpFikydelWa39xMUyjd7/PkabhwWoFk50niBIVS119rhH/GqhGIusp
 UU6JyujhoM8JWvywoyHsgV6c+2gDLQVU9k6mrAgMf9hgjRTz2ztCgK4fWccqEGvt
 5retVRVdv0xUxBxLkD9AhZ47ym8udcOLP7NyBl70MHJSm4GuEPUdefPNOGOWqIUr
 0XJfCmvipxJkA4/QwC5j7du8uILMXmjqzvf/LGfhg8Yo4YtQbJSv6mPmCSrtE1JE
 2yz8zTA=
 =kGbc
 -----END PGP SIGNATURE-----

Merge tag 'sound-5.12-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound

Pull sound fixes from Takashi Iwai:
 "The majority of changes are various ASoC device/platform-specific
  small fixes (including a removal of stale file) while the only common
  change is a clk management fix in ASoC simple-card driver.

  The rest are the usual HD-audio quirks"

* tag 'sound-5.12-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound: (44 commits)
  ALSA: usb-audio: Fix unintentional sign extension issue
  ALSA: hda/realtek: fix mute/micmute LEDs for HP 850 G8
  ASoC: dt-bindings: fsl_spdif: Add compatible string for new platforms
  ASoC: rt711: add snd_soc_component remove callback
  ASoC: rt5659: Update MCLK rate in set_sysclk()
  ASoC: simple-card-utils: Do not handle device clock
  ALSA: hda/realtek: fix mute/micmute LEDs for HP 440 G8
  ALSA: hda/realtek: fix mute/micmute LEDs for HP 840 G8
  ALSA: hda/realtek: apply pin quirk for XiaomiNotebook Pro
  ALSA: hda/realtek: Apply headset-mic quirks for Xiaomi Redmibook Air
  ASoC: mediatek: mt8192: fix tdm out data is valid on rising edge
  ALSA: dice: fix null pointer dereference when node is disconnected
  ALSA: hda: generic: Fix the micmute led init state
  ASoC: qcom: lpass-cpu: Fix lpass dai ids parse
  spi: cadence: set cqspi to the driver_data field of struct device
  ASoC: SOF: intel: fix wrong poll bits in dsp power down
  ASoC: codecs: wcd934x: add a sanity check in set channel map
  ASoC: qcom: sdm845: Fix array out of range on rx slim channels
  ASoC: qcom: sdm845: Fix array out of bounds access
  ASoC: remove remnants of sirf prima/atlas audio codec
  ...
2021-03-19 09:53:32 -07:00
Steve French 65af8f0166 cifs: fix allocation size on newly created files
Applications that create and extend and write to a file do not
expect to see 0 allocation size.  When file is extended,
set its allocation size to a plausible value until we have a
chance to query the server for it.  When the file is cached
this will prevent showing an impossible number of allocated
blocks (like 0).  This fixes e.g. xfstests 614 which does

    1) create a file and set its size to 64K
    2) mmap write 64K to the file
    3) stat -c %b for the file (to query the number of allocated blocks)

It was failing because we returned 0 blocks.  Even though we would
return the correct cached file size, we returned an impossible
allocation size.

Signed-off-by: Steve French <stfrench@microsoft.com>
CC: <stable@vger.kernel.org>
Reviewed-by: Aurelien Aptel <aaptel@suse.com>
2021-03-19 11:51:31 -05:00
Jesse Brandeburg f0a03a0268 igb: check timestamp validity
Add a couple of checks to make sure timestamping is on and that the
timestamp value from DMA is valid. This avoids any functional issues
that could come from a misinterpreted time stamp.

One of the functions changed doesn't need a return value added because
there was no value in checking from the calling locations.

While here, fix a couple of reverse christmas tree issues next to
the code being changed.

Fixes: f56e7bba22 ("igb: Pull timestamp from fragment before adding it to skb")
Fixes: 9cbc948b5a ("igb: add XDP support")
Signed-off-by: Jesse Brandeburg <jesse.brandeburg@intel.com>
Tested-by: Dave Switzer <david.switzer@intel.com>
Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
2021-03-19 08:47:46 -07:00
Tom Seewald a75519a848 igb: Fix duplicate include guard
The include guard "_E1000_HW_H_" is used by two separate header files in
two different drivers (e1000/e1000_hw.h and igb/e1000_hw.h). Using the
same include guard macro in more than one header file may cause
unexpected behavior from the compiler. Fix this by renaming the
duplicate guard in the igb driver.

Fixes: 9d5c824399 ("igb: PCI-Express 82575 Gigabit Ethernet driver")
Signed-off-by: Tom Seewald <tseewald@gmail.com>
Reviewed-by: Jesse Brandeburg <jesse.brandeburg@intel.com>
Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
2021-03-19 08:47:46 -07:00
Tom Seewald 896ea5dab2 e1000e: Fix duplicate include guard
The include guard "_E1000_HW_H_" is used by header files in three
different drivers (e1000/e1000_hw.h, e1000e/hw.h, and igb/e1000_hw.h).
Using the same include guard macro in more than one header file may
cause unexpected behavior from the compiler. Fix the duplicate include
guard in the e1000e driver by renaming it.

Fixes: bc7f75fa97 ("[E1000E]: New pci-express e1000 driver (currently for ICH9 devices only)")
Signed-off-by: Tom Seewald <tseewald@gmail.com>
Tested-by: Dvora Fuxbrumer <dvorax.fuxbrumer@linux.intel.com>
Acked-by: Sasha Neftin <sasha.neftin@intel.com>
Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
2021-03-19 08:47:46 -07:00
Rafael J. Wysocki 49cb71a77c Merge branch 'pm-core'
* pm-core:
  Revert "PM: runtime: Update device status before letting suppliers suspend"
2021-03-19 16:38:45 +01:00
Rafael J. Wysocki 0cab893f40 Revert "PM: runtime: Update device status before letting suppliers suspend"
Revert commit 44cc89f764 ("PM: runtime: Update device status
before letting suppliers suspend") that introduced a race condition
into __rpm_callback() which allowed a concurrent rpm_resume() to
run and resume the device prematurely after its status had been
changed to RPM_SUSPENDED by __rpm_callback().

Fixes: 44cc89f764 ("PM: runtime: Update device status before letting suppliers suspend")
Link: https://lore.kernel.org/linux-pm/24dfb6fc-5d54-6ee2-9195-26428b7ecf8a@intel.com/
Reported-by: Adrian Hunter <adrian.hunter@intel.com>
Cc: 4.10+ <stable@vger.kernel.org> # 4.10+
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Reviewed-by: Ulf Hansson <ulf.hansson@linaro.org>
2021-03-19 16:35:47 +01:00
Ingo Molnar 429257a430 Another couple of EFI fixes for v5.12-rc:
- anothing missing RT_PROP table related fix, to ensure that the efivarfs
   pseudo filesystem fails gracefully if variable services are unsupported
 - use the correct alignment for literal EFI GUIDs
 - fix a use after unmap issue in the memreserve code
 -----BEGIN PGP SIGNATURE-----
 
 iQGzBAABCgAdFiEE+9lifEBpyUIVN1cpw08iOZLZjyQFAmBUSNkACgkQw08iOZLZ
 jyS6lgv+PVVOOm4JJiU0bXP5Nld6fbALMS4xoCpb8/tl5P836BXP39t47nTVBfph
 2gP27rlODTexNfqYKiQigdtB2+YGkWU5ySmeW8mTwXDxVrDVBCJw/4vSmxIeerUW
 FxPkqL/tlI4++4xwUVsXP1+a48Zkdg8vUl1kPCRdwruFZE5Puz5xQIUvsfZwx6nT
 A9ukWvJ71cpae76tvFdMcBUimUbBj0ZYpnNZYbc+La3fPqud9N71g4b7nDngLg4y
 2z/V1XNcY+J9KNJvRHVWZAsxRpG2Kgmy0fun1a6H7IccRNzg7Jxl0gGcNdODFJ7c
 H02SaFwHDHHfjp4GkecoeQ5pi6YcpF5oAnvjLdEhAsHrULz6a6lXHL1xF3ksz48A
 Af2P+qw2+d4kcsRAO3wz1dX51+5B84ICqma8lERvER2xl2yhDdq2e4cfo4bXu9Oy
 6sUXXFxpPGjnCII8E5kC0NCD2BtXEEgK/M+8vBoralRxZI6QucwgNrhNovRUU904
 LJM1rw1q
 =a7TN
 -----END PGP SIGNATURE-----

Merge tag 'efi-urgent-for-v5.12-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/efi/efi into efi/urgent

Pull EFI fixes from Ard Biesheuvel:

 "- another missing RT_PROP table related fix, to ensure that the efivarfs
    pseudo filesystem fails gracefully if variable services are unsupported
  - use the correct alignment for literal EFI GUIDs
  - fix a use after unmap issue in the memreserve code"

Signed-off-by: Ingo Molnar <mingo@kernel.org>
2021-03-19 14:23:46 +01:00
Jens Axboe d38b4d2894 nvme fixes for 5.12
- fix tag allocation for keep alive
  - fix a unit mismatch for the Write Zeroes limits
  - various TCP transport fixes (Sagi Grimberg, Elad Grupi)
  - fix iosqes and iocqes validation for discovery controllers (Sagi Grimberg)
 -----BEGIN PGP SIGNATURE-----
 
 iQI/BAABCgApFiEEgdbnc3r/njty3Iq9D55TZVIEUYMFAmBUTswLHGhjaEBsc3Qu
 ZGUACgkQD55TZVIEUYOV+A//WjY6AqLVYvaJsSQ8TOg1M1XjUrE1XzmgqBBBN3/m
 7RPtbIhsI3iZRiauCGbdSRhJfJEMqdeJLEOjpq83toBgCe8Jh0eLgw7ZBqYu6N5Q
 d7HGlXHb/QTxarAAkVZbAEusnBXDqfVXJiJEe0jgSqiuS2+Y0AGufA65cH+1MbNg
 r0u4lvO5hO4Z+DMQVOCxzLsHYHszeZNULMpgQWu8yi89BbNwr2SMx9a9TX1PITPm
 thYCeXRAY9yp4UDE9dMvfCgxWPZfEyyYAK+7vt0vWxpnEWE9chijPY+fjb23mhf0
 VTBmr4RmptetkLOyTnfp11f8bGCmPQgbOJC/DjwQoC/aZ+TAzgj9ot0c4zsRE23o
 U1WoEB9RRO/UOndam0DkZK8ClretF/sIIxydO0nCrlFILPgvDddXweIO/DiLs8rM
 NsQV95GtT3TjyWNwtyN4ThKbunk/4TmUVftvgz7soE0hPobLNmPQlXs+HrLcn7U7
 92CwQzy+WzRKuM6Wfnjt/6R3702XCBaBkF2mJdnX5EKlqp+OdCIOCdVxBAyMUAUA
 6BPVt0An4MCaAcfqXBh+Irf0HKV4veMLQT0egi1o33eLZBFBgomU3ugKzUykPP0V
 fHUfVe5sccvOdwOfOVV8vgNc1Pe+wNVcybyaemlHkv2lzZJPDnUd96Oi7av6NcOR
 CPQ=
 =cE+0
 -----END PGP SIGNATURE-----

Merge tag 'nvme-5.12-20210319' of git://git.infradead.org/nvme into block-5.12

Pull NVMe updates from Christoph:

"nvme fixes for 5.12

 - fix tag allocation for keep alive
 - fix a unit mismatch for the Write Zeroes limits
 - various TCP transport fixes (Sagi Grimberg, Elad Grupi)
 - fix iosqes and iocqes validation for discovery controllers (Sagi Grimberg)"

* tag 'nvme-5.12-20210319' of git://git.infradead.org/nvme:
  nvmet-tcp: fix kmap leak when data digest in use
  nvmet: don't check iosqes,iocqes for discovery controllers
  nvme-rdma: fix possible hang when failing to set io queues
  nvme-tcp: fix possible hang when failing to set io queues
  nvme-tcp: fix misuse of __smp_processor_id with preemption enabled
  nvme-tcp: fix a NULL deref when receiving a 0-length r2t PDU
  nvme: fix Write Zeroes limitations
  nvme: allocate the keep alive request using BLK_MQ_REQ_NOWAIT
  nvme: merge nvme_keep_alive into nvme_keep_alive_work
  nvme-fabrics: only reserve a single tag
2021-03-19 06:40:47 -06:00
Peter Zijlstra 38c9358737 static_call: Fix static_call_update() sanity check
Sites that match init_section_contains() get marked as INIT. For
built-in code init_sections contains both __init and __exit text. OTOH
kernel_text_address() only explicitly includes __init text (and there
are no __exit text markers).

Match what jump_label already does and ignore the warning for INIT
sites. Also see the excellent changelog for commit: 8f35eaa5f2
("jump_label: Don't warn on __exit jump entries")

Fixes: 9183c3f9ed ("static_call: Add inline static call infrastructure")
Reported-by: Sumit Garg <sumit.garg@linaro.org>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Acked-by: Jarkko Sakkinen <jarkko@kernel.org>
Tested-by: Sumit Garg <sumit.garg@linaro.org>
Link: https://lkml.kernel.org/r/20210318113610.739542434@infradead.org
2021-03-19 13:16:44 +01:00
Peter Zijlstra 698bacefe9 static_call: Align static_call_is_init() patching condition
The intent is to avoid writing init code after init (because the text
might have been freed). The code is needlessly different between
jump_label and static_call and not obviously correct.

The existing code relies on the fact that the module loader clears the
init layout, such that within_module_init() always fails, while
jump_label relies on the module state which is more obvious and
matches the kernel logic.

Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Acked-by: Jarkko Sakkinen <jarkko@kernel.org>
Tested-by: Sumit Garg <sumit.garg@linaro.org>
Link: https://lkml.kernel.org/r/20210318113610.636651340@infradead.org
2021-03-19 13:16:44 +01:00
Peter Zijlstra 68b1eddd42 static_call: Fix static_call_set_init()
It turns out that static_call_set_init() does not preserve the other
flags; IOW. it clears TAIL if it was set.

Fixes: 9183c3f9ed ("static_call: Add inline static call infrastructure")
Reported-by: Sumit Garg <sumit.garg@linaro.org>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Acked-by: Jarkko Sakkinen <jarkko@kernel.org>
Tested-by: Sumit Garg <sumit.garg@linaro.org>
Link: https://lkml.kernel.org/r/20210318113610.519406371@infradead.org
2021-03-19 13:16:44 +01:00
Thomas Gleixner a501b048a9 x86/ioapic: Ignore IRQ2 again
Vitaly ran into an issue with hotplugging CPU0 on an Amazon instance where
the matrix allocator claimed to be out of vectors. He analyzed it down to
the point that IRQ2, the PIC cascade interrupt, which is supposed to be not
ever routed to the IO/APIC ended up having an interrupt vector assigned
which got moved during unplug of CPU0.

The underlying issue is that IRQ2 for various reasons (see commit
af174783b9 ("x86: I/O APIC: Never configure IRQ2" for details) is treated
as a reserved system vector by the vector core code and is not accounted as
a regular vector. The Amazon BIOS has an routing entry of pin2 to IRQ2
which causes the IO/APIC setup to claim that interrupt which is granted by
the vector domain because there is no sanity check. As a consequence the
allocation counter of CPU0 underflows which causes a subsequent unplug to
fail with:

  [ ... ] CPU 0 has 4294967295 vectors, 589 available. Cannot disable CPU

There is another sanity check missing in the matrix allocator, but the
underlying root cause is that the IO/APIC code lost the IRQ2 ignore logic
during the conversion to irqdomains.

For almost 6 years nobody complained about this wreckage, which might
indicate that this requirement could be lifted, but for any system which
actually has a PIC IRQ2 is unusable by design so any routing entry has no
effect and the interrupt cannot be connected to a device anyway.

Due to that and due to history biased paranoia reasons restore the IRQ2
ignore logic and treat it as non existent despite a routing entry claiming
otherwise.

Fixes: d32932d02e ("x86/irq: Convert IOAPIC to use hierarchical irqdomain interfaces")
Reported-by: Vitaly Kuznetsov <vkuznets@redhat.com>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Tested-by: Vitaly Kuznetsov <vkuznets@redhat.com>
Cc: stable@vger.kernel.org
Link: https://lore.kernel.org/r/20210318192819.636943062@linutronix.de
2021-03-19 12:43:41 +01:00
Emanuele Giuseppe Esposito 9ce3746d64 documentation/kvm: additional explanations on KVM_SET_BOOT_CPU_ID
The ioctl KVM_SET_BOOT_CPU_ID fails when called after vcpu creation.
Add this explanation in the documentation.

Signed-off-by: Emanuele Giuseppe Esposito <eesposit@redhat.com>
Message-Id: <20210319091650.11967-1-eesposit@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2021-03-19 05:31:32 -04:00
Ard Biesheuvel fb98cc0b3a efi: use 32-bit alignment for efi_guid_t literals
Commit 494c704f9a ("efi: Use 32-bit alignment for efi_guid_t") updated
the type definition of efi_guid_t to ensure that it always appears
sufficiently aligned (the UEFI spec is ambiguous about this, but given
the fact that its EFI_GUID type is defined in terms of a struct carrying
a uint32_t, the natural alignment is definitely >= 32 bits).

However, we missed the EFI_GUID() macro which is used to instantiate
efi_guid_t literals: that macro is still based on the guid_t type,
which does not have a minimum alignment at all. This results in warnings
such as

  In file included from drivers/firmware/efi/mokvar-table.c:35:
  include/linux/efi.h:1093:34: warning: passing 1-byte aligned argument to
      4-byte aligned parameter 2 of 'get_var' may result in an unaligned pointer
      access [-Walign-mismatch]
          status = get_var(L"SecureBoot", &EFI_GLOBAL_VARIABLE_GUID, NULL, &size,
                                          ^
  include/linux/efi.h:1101:24: warning: passing 1-byte aligned argument to
      4-byte aligned parameter 2 of 'get_var' may result in an unaligned pointer
      access [-Walign-mismatch]
          get_var(L"SetupMode", &EFI_GLOBAL_VARIABLE_GUID, NULL, &size, &setupmode);

The distinction only matters on CPUs that do not support misaligned loads
fully, but 32-bit ARM's load-multiple instructions fall into that category,
and these are likely to be emitted by the compiler that built the firmware
for loading word-aligned 128-bit GUIDs from memory

So re-implement the initializer in terms of our own efi_guid_t type, so that
the alignment becomes a property of the literal's type.

Fixes: 494c704f9a ("efi: Use 32-bit alignment for efi_guid_t")
Reported-by: Nathan Chancellor <nathan@kernel.org>
Reviewed-by: Nick Desaulniers <ndesaulniers@google.com>
Reviewed-by: Nathan Chancellor <nathan@kernel.org>
Tested-by: Nathan Chancellor <nathan@kernel.org>
Link: https://github.com/ClangBuiltLinux/linux/issues/1327
Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
2021-03-19 07:44:28 +01:00
Lv Yunlong 9ceee7d084 firmware/efi: Fix a use after bug in efi_mem_reserve_persistent
In the for loop in efi_mem_reserve_persistent(), prsv = rsv->next
use the unmapped rsv. Use the unmapped pages will cause segment
fault.

Fixes: 18df7577ad ("efi/memreserve: deal with memreserve entries in unmapped memory")
Signed-off-by: Lv Yunlong <lyl2019@mail.ustc.edu.cn>
Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
2021-03-19 07:44:27 +01:00
Aurelien Aptel af3ef3b103 cifs: warn and fail if trying to use rootfs without the config option
If CONFIG_CIFS_ROOT is not set, rootfs mount option is invalid

Signed-off-by: Aurelien Aptel <aaptel@suse.com>
CC: <stable@vger.kernel.org> # v5.11
Signed-off-by: Steve French <stfrench@microsoft.com>
2021-03-19 00:50:58 -05:00
Liu xuzhi 403dba003d fs/cifs/: fix misspellings using codespell tool
A typo is found out by codespell tool in 251th lines of cifs_swn.c:

$ codespell ./fs/cifs/
./cifs_swn.c:251: funciton  ==> function

Fix a typo found by codespell.

Signed-off-by: Liu xuzhi <liu.xuzhi@zte.com.cn>
Signed-off-by: Steve French <stfrench@microsoft.com>
2021-03-19 00:37:51 -05:00
Ondrej Mosnacek ee5de60a08 selinuxfs: unify policy load error reporting
Let's drop the pr_err()s from sel_make_policy_nodes() and just add one
pr_warn_ratelimited() call to the sel_make_policy_nodes() error path in
sel_write_load().

Changing from error to warning makes sense, since after 02a52c5c8c
("selinux: move policy commit after updating selinuxfs"), this error
path no longer leads to a broken selinuxfs tree (it's just kept in the
original state and policy load is aborted).

I also added _ratelimited to be consistent with the other prtin in the
same function (it's probably not necessary, but can't really hurt...
there are likely more important error messages to be printed when
filesystem entry creation starts erroring out).

Suggested-by: Paul Moore <paul@paul-moore.com>
Signed-off-by: Ondrej Mosnacek <omosnace@redhat.com>
Signed-off-by: Paul Moore <paul@paul-moore.com>
2021-03-18 23:26:59 -04:00
Ondrej Mosnacek 6406887a12 selinux: fix variable scope issue in live sidtab conversion
Commit 02a52c5c8c ("selinux: move policy commit after updating
selinuxfs") moved the selinux_policy_commit() call out of
security_load_policy() into sel_write_load(), which caused a subtle yet
rather serious bug.

The problem is that security_load_policy() passes a reference to the
convert_params local variable to sidtab_convert(), which stores it in
the sidtab, where it may be accessed until the policy is swapped over
and RCU synchronized. Before 02a52c5c8c, selinux_policy_commit() was
called directly from security_load_policy(), so the convert_params
pointer remained valid all the way until the old sidtab was destroyed,
but now that's no longer the case and calls to sidtab_context_to_sid()
on the old sidtab after security_load_policy() returns may cause invalid
memory accesses.

This can be easily triggered using the stress test from commit
ee1a84fdfe ("selinux: overhaul sidtab to fix bug and improve
performance"):
```
function rand_cat() {
	echo $(( $RANDOM % 1024 ))
}

function do_work() {
	while true; do
		echo -n "system_u:system_r:kernel_t:s0:c$(rand_cat),c$(rand_cat)" \
			>/sys/fs/selinux/context 2>/dev/null || true
	done
}

do_work >/dev/null &
do_work >/dev/null &
do_work >/dev/null &

while load_policy; do echo -n .; sleep 0.1; done

kill %1
kill %2
kill %3
```

Fix this by allocating the temporary sidtab convert structures
dynamically and passing them among the
selinux_policy_{load,cancel,commit} functions.

Fixes: 02a52c5c8c ("selinux: move policy commit after updating selinuxfs")
Cc: stable@vger.kernel.org
Tested-by: Tyler Hicks <tyhicks@linux.microsoft.com>
Reviewed-by: Tyler Hicks <tyhicks@linux.microsoft.com>
Signed-off-by: Ondrej Mosnacek <omosnace@redhat.com>
[PM: merge fuzz in security.h and services.c]
Signed-off-by: Paul Moore <paul@paul-moore.com>
2021-03-18 23:23:46 -04:00
Ondrej Mosnacek 519dad3bcd selinux: don't log MAC_POLICY_LOAD record on failed policy load
If sel_make_policy_nodes() fails, we should jump to 'out', not 'out1',
as the latter would incorrectly log an MAC_POLICY_LOAD audit record,
even though the policy hasn't actually been reloaded. The 'out1' jump
label now becomes unused and can be removed.

Fixes: 02a52c5c8c ("selinux: move policy commit after updating selinuxfs")
Cc: stable@vger.kernel.org
Signed-off-by: Ondrej Mosnacek <omosnace@redhat.com>
Signed-off-by: Paul Moore <paul@paul-moore.com>
2021-03-18 23:13:04 -04:00
Johan Hovold c79a707072 net: cdc-phonet: fix data-interface release on probe failure
Set the disconnected flag before releasing the data interface in case
netdev registration fails to avoid having the disconnect callback try to
deregister the never registered netdev (and trigger a WARN_ON()).

Fixes: 87cf65601e ("USB host CDC Phonet network interface driver")
Signed-off-by: Johan Hovold <johan@kernel.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
2021-03-18 19:45:37 -07:00
David S. Miller 84f4aced67 Merge git://git.kernel.org/pub/scm/linux/kernel/git/pablo/nf
Pablo Neira Ayuso says:

====================
Netfilter fixes for net

1) Several patches to testore use of memory barriers instead of RCU to
   ensure consistent access to ruleset, from Mark Tomlinson.

2) Fix dump of expectation via ctnetlink, from Florian Westphal.

3) GRE helper works for IPv6, from Ludovic Senecaux.

4) Set error on unsupported flowtable flags.

5) Use delayed instead of deferrable workqueue in the flowtable,
   from Yinjun Zhang.

6) Fix spurious EEXIST in case of add-after-delete flowtable in
   the same batch.
====================

Signed-off-by: David S. Miller <davem@davemloft.net>
2021-03-18 19:19:06 -07:00
Linus Torvalds 8b12a62a4e drm fixes for 5.12-rc4
ttm:
 - Make ttm_bo_unpin() not wraparound on too many unpins.
 
 omap:
 - Fix coccicheck warning in omap.
 
 amdgpu:
 - DCN 3.0 gamma fixes
 - DCN 2.1 corrupt screen fix
 
 i915:
 - Workaround async flip + VT-d frame corruption on HSW/BDW
 - Fix NMI watchdog crash due to uninitialized OA buffer use on gen12+
 
 nouveau:
 - workaround oops with bo syncing
 -----BEGIN PGP SIGNATURE-----
 
 iQIcBAABAgAGBQJgU/RHAAoJEAx081l5xIa+ydgP/0Z/SrTj5MItgYmaBveXzTvR
 88qfdSnBXtvblcfYPCyI4hk2OKeHV26ktsQj0yi74ad6bZGXx7XZrliHIy1Of2jX
 4wP2f5J3gstj2BIEKEf7lvtR3mSwItt1V8V5mOrkCqWB2g6AusY/0KhEOjJzkJ+K
 xRYeqJFwqAa3dGi437r6P5mtqbohMcDeamOSlTLu0slOssjmKGfCZd5fAZhAk3q9
 hNWppNKGJyRXfSYoPHhqxuUr70W1mxp3/PfmZ4W/Jz9/jFt5zj5Erlds5tvYFJ4D
 c/PcOOI19CwPVFgeUfF/gq7J/FMHzo7E4Vj43Y9hzZsN/oDiF6/RMifggdjuCc0b
 uIx0IaUivpDUAb93O5BhWl/ZnYu166Cb//RgW8pF9KxInbOgvQuKyCwCcAQ115v+
 zZLbE41Hjvh4iojXoetfZ5qik3uuAQaISMQakfZ0YRpi57gt/MYX2/y9jjJnqfOa
 SvTsNlZstOj/04jXGG+ZubODb9GV2EeFsVy0ByVJyjTTKJL+ILelbazTksIQpYXv
 XNZ0KdGQwEHmCZU/s5TcE1/VAIfKUKoejjXjyYsdJPbIFMX3/16K7bPbW6GZLlC/
 w7fEXJ07ow79dVFAoy+irdwDqpGuTtP4uRk5R/MfCN+Avgw67VK0VxdsvoPuk9zq
 S6N+/DDHeQLztvbf86O4
 =r/pg
 -----END PGP SIGNATURE-----

Merge tag 'drm-fixes-2021-03-19' of git://anongit.freedesktop.org/drm/drm

Pull drm fixes from Dave Airlie:
 "Regular fixes pull, pretty small set of fixes, a couple of i915 and
  amdgpu, one ttm, one nouveau and one omap. Probably smaller than usual
  for this time, so we'll see if something pops up next week or if this
  will continue to stay small.

  Summary:

  ttm:
   - Make ttm_bo_unpin() not wraparound on too many unpins

  omap:
   - Fix coccicheck warning in omap

  amdgpu:
   - DCN 3.0 gamma fixes
   - DCN 2.1 corrupt screen fix

  i915:
   - Workaround async flip + VT-d frame corruption on HSW/BDW
   - Fix NMI watchdog crash due to uninitialized OA buffer use on gen12+

  nouveau:
   - workaround oops with bo syncing"

* tag 'drm-fixes-2021-03-19' of git://anongit.freedesktop.org/drm/drm:
  nouveau: Skip unvailable ttm page entries
  drm/amd/display: Remove MPC gamut remap logic for DCN30
  drm/amd/display: Correct algorithm for reversed gamma
  drm/omap: dsi: fix unsigned expression compared with zero
  i915/perf: Start hrtimer only if sampling the OA buffer
  drm/i915: Workaround async flip + VT-d corruption on HSW/BDW
  drm/amd/display: Copy over soc values before bounding box creation
  drm/ttm: make ttm_bo_unpin more defensive
2021-03-18 17:57:34 -07:00
Tobias Klausmann e94c55b8e0 nouveau: Skip unvailable ttm page entries
Starting with commit f295c8cfec
("drm/nouveau: fix dma syncing warning with debugging on.")
the following oops occures:

   BUG: kernel NULL pointer dereference, address: 0000000000000000
   #PF: supervisor read access in kernel mode
   #PF: error_code(0x0000) - not-present page
   PGD 0 P4D 0
   Oops: 0000 [#1] PREEMPT SMP PTI
   CPU: 6 PID: 1013 Comm: Xorg.bin Tainted: G E     5.11.0-desktop-rc0+ #2
   Hardware name: Acer Aspire VN7-593G/Pluto_KLS, BIOS V1.11 08/01/2018
   RIP: 0010:nouveau_bo_sync_for_device+0x40/0xb0 [nouveau]
   Call Trace:
    nouveau_bo_validate+0x5d/0x80 [nouveau]
    nouveau_gem_ioctl_pushbuf+0x662/0x1120 [nouveau]
    ? nouveau_gem_ioctl_new+0xf0/0xf0 [nouveau]
    drm_ioctl_kernel+0xa6/0xf0 [drm]
    drm_ioctl+0x1f4/0x3a0 [drm]
    ? nouveau_gem_ioctl_new+0xf0/0xf0 [nouveau]
    nouveau_drm_ioctl+0x50/0xa0 [nouveau]
    __x64_sys_ioctl+0x7e/0xb0
    do_syscall_64+0x33/0x80
    entry_SYSCALL_64_after_hwframe+0x44/0xae
   ---[ end trace ccfb1e7f4064374f ]---
   RIP: 0010:nouveau_bo_sync_for_device+0x40/0xb0 [nouveau]

The underlying problem is not introduced by the commit, yet it uncovered the
underlying issue. The cited commit relies on valid pages. This is not given for
due to some bugs. For now, just warn and work around the issue by just ignoring
the bad ttm objects.
Below is some debug info gathered while debugging this issue:

nouveau 0000:01:00.0: DRM: ttm_dma->num_pages: 2048
nouveau 0000:01:00.0: DRM: ttm_dma->pages is NULL
nouveau 0000:01:00.0: DRM: ttm_dma: 00000000e96058e7
nouveau 0000:01:00.0: DRM: ttm_dma->page_flags:
nouveau 0000:01:00.0: DRM: ttm_dma:   Populated: 1
nouveau 0000:01:00.0: DRM: ttm_dma:   No Retry: 0
nouveau 0000:01:00.0: DRM: ttm_dma:   SG: 256
nouveau 0000:01:00.0: DRM: ttm_dma:   Zero Alloc: 0
nouveau 0000:01:00.0: DRM: ttm_dma:   Swapped: 0

Signed-off-by: Tobias Klausmann <tobias.klausmann@freenet.de>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20210313222159.3346-1-tobias.klausmann@freenet.de
2021-03-19 10:38:31 +10:00
Dave Airlie 0677170bcf Merge tag 'drm-intel-fixes-2021-03-18' of git://anongit.freedesktop.org/drm/drm-intel into drm-fixes
drm/i915 fixes for v5.12-rc4:
- Workaround async flip + VT-d frame corruption on HSW/BDW
- Fix NMI watchdog crash due to uninitialized OA buffer use on gen12+

Signed-off-by: Dave Airlie <airlied@redhat.com>
From: Jani Nikula <jani.nikula@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/87blbg8y5t.fsf@intel.com
2021-03-19 10:33:32 +10:00
Dave Airlie a97fdabcf2 Merge tag 'amd-drm-fixes-5.12-2021-03-18' of https://gitlab.freedesktop.org/agd5f/linux into drm-fixes
amdgpu:
- DCN 3.0 gamma fixes
- DCN 2.1 corrupt screen fix

Signed-off-by: Dave Airlie <airlied@redhat.com>
From: Alex Deucher <alexander.deucher@amd.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20210318042858.3810-1-alexander.deucher@amd.com
2021-03-19 10:31:58 +10:00
Dave Airlie db3f0d8ee9 drm-misc-fixes for v5.12-rc4:
- Make ttm_bo_unpin() not wraparound on too many unpins.
 - Fix coccicheck warning in omap.
 -----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCgAdFiEEuXvWqAysSYEJGuVH/lWMcqZwE8MFAmBTOoMACgkQ/lWMcqZw
 E8Pvtw/9F4jV0usTNR8DEhQ1bas1EiQFQGuCQjatmfwLiNcamIsoqQKOdBnPxiBc
 kkFvmwM583L9dAwinMn51xLI4N1rV0vyUJQufFkhunEpwL5MyEkXxmzrcuYvQiZw
 9+sc4VN7FC+FiLf1CWlMpIRyHd7kn84FSiPOGC7vnETxJQdPklK+4TGX48t8GYxW
 h1klfYHl82ISRbDon6lGpbqXmWBK+UwREWQXFCdnK07e9RsVqnYX65iBloAwIIra
 jmJ9q6qg89yRr1aXxGqnWTJyIRO0hsfELCFaK3Ds/WMqoxIhhdK06b0VAJLeJiut
 iOYAh1UI0oUJTZ1PS0zWT3y2oIJiycrmbJ+0ynqBVAGidh6/UvwIu75n6vwsK+iu
 yyPlrwQyMYTuUYhVNiZaiSCkrg3/+V7+PLeCL04UiOilYkyGwXvOUoQf0Bu8s1bO
 0qzB4VGapCFOgsW3/rUDKFURVOfe29pt4Iz+OP4pd/kONwlK5y2cwwtqqCGfxLY7
 a6uvPMCk0uTd1ywaOdJhJnzaMwBy4XTgP9flocypbQhW0AIRpKEM4KvIMdswPmvE
 NopT0DzksQ3iSnobnihLwL/2SgwARQSV8m2QsRy9r6tyHX285F1FWQG7MS0fnutU
 dO+k+9bRxwDPNuTGwT3D1CEO9RHmW4hABrsB+Pc0PixjZo4sOmI=
 =h0OV
 -----END PGP SIGNATURE-----

Merge tag 'drm-misc-fixes-2021-03-18' of git://anongit.freedesktop.org/drm/drm-misc into drm-fixes

drm-misc-fixes for v5.12-rc4:
- Make ttm_bo_unpin() not wraparound on too many unpins.
- Fix coccicheck warning in omap.

Signed-off-by: Dave Airlie <airlied@redhat.com>

From: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/a0e13bbb-6ba6-ff24-4db8-0e02e605de18@linux.intel.com
2021-03-19 10:21:48 +10:00
Jiri Bohac 6c015a2256 net: check all name nodes in __dev_alloc_name
__dev_alloc_name(), when supplied with a name containing '%d',
will search for the first available device number to generate a
unique device name.

Since commit ff92741270 ("net:
introduce name_node struct to be used in hashlist") network
devices may have alternate names.  __dev_alloc_name() does take
these alternate names into account, possibly generating a name
that is already taken and failing with -ENFILE as a result.

This demonstrates the bug:

    # rmmod dummy 2>/dev/null
    # ip link property add dev lo altname dummy0
    # modprobe dummy numdummies=1
    modprobe: ERROR: could not insert 'dummy': Too many open files in system

Instead of creating a device named dummy1, modprobe fails.

Fix this by checking all the names in the d->name_node list, not just d->name.

Signed-off-by: Jiri Bohac <jbohac@suse.cz>
Fixes: ff92741270 ("net: introduce name_node struct to be used in hashlist")
Reviewed-by: Jiri Pirko <jiri@nvidia.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2021-03-18 14:40:53 -07:00
Christophe Leroy 600cc3c9c6 net: marvell: Remove reference to CONFIG_MV64X60
Commit 92c8c16f34 ("powerpc/embedded6xx: Remove C2K board support")
removed last selector of CONFIG_MV64X60.

As it is not a user selectable config item, all references to it
are stale. Remove them.

Signed-off-by: Christophe Leroy <christophe.leroy@csgroup.eu>
Signed-off-by: David S. Miller <davem@davemloft.net>
2021-03-18 14:19:39 -07:00
David S. Miller 6f7c7e22a2 Merge branch 'octeontx2-fixes'
Hariprasad Kelam says:

====================
octeontx2: miscellaneous fixes

This series of patches fixes various issues related to NPC MCAM entry
management, debugfs, devlink, CGX LMAC mapping, RSS config etc

Change-log:
v2:
Fixed below review comments
	- corrected Fixed tag syntax with 12 digits SHA1
          and providing space between SHA1 and subject line
	- remove code improvement patch
	- make commit description more clear
====================

Signed-off-by: David S. Miller <davem@davemloft.net>
2021-03-18 14:12:42 -07:00
Subbaraya Sundeep 8c16cb0304 octeontx2-af: Fix uninitialized variable warning
Initialize l4_key_offset variable to fix uninitialized
variable compiler warning.

Fixes: b9b7421a01 ("octeontx2-af: Support ESP/AH RSS hashing")
Signed-off-by: Subbaraya Sundeep <sbhatta@marvell.com>
Signed-off-by: Hariprasad Kelam <hkelam@marvell.com>
Signed-off-by: Sunil Kovvuri Goutham <sgoutham@marvell.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2021-03-18 14:12:42 -07:00
Hariprasad Kelam 64451b9830 octeontx2-af: fix infinite loop in unmapping NPC counter
unmapping npc counter works in a way by traversing all mcam
entries to find which mcam rule is associated with counter.
But loop cursor variable 'entry' is not incremented before
checking next mcam entry which resulting in infinite loop.

This in turn hogs the kworker thread forever and no other
mbox message is processed by AF driver after that.
Fix this by updating entry value before checking next
mcam entry.

Fixes: a958dd59f9 ("octeontx2-af: Map or unmap NPC MCAM entry and counter")
Signed-off-by: Hariprasad Kelam <hkelam@marvell.com>
Signed-off-by: Sunil Kovvuri Goutham <sgoutham@marvell.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2021-03-18 14:12:42 -07:00
Geetha sowjanya f12098ce9b octeontx2-pf: Clear RSS enable flag on interace down
RSS configuration can not be get/set when interface is in down state
as they required mbox communication. RSS enable flag status
is used for set/get configuration. Current code do not clear the
RSS enable flag on interface down which lead to mbox error while
trying to set/get RSS configuration.

Fixes: 85069e95e5 ("octeontx2-pf: Receive side scaling support")
Signed-off-by: Geetha sowjanya <gakula@marvell.com>
Signed-off-by: Hariprasad Kelam <hkelam@marvell.com>
Signed-off-by: Sunil Kovvuri Goutham <sgoutham@marvell.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2021-03-18 14:12:42 -07:00
Geetha sowjanya ae2619dd4f octeontx2-af: Fix irq free in rvu teardown
Current devlink code try to free already freed irqs as the
irq_allocate flag is not cleared after free leading to kernel
crash while removing rvu driver. The patch fixes the irq free
sequence and clears the irq_allocate flag on free.

Fixes: 7304ac4567 ("octeontx2-af: Add mailbox IRQ and msg handlers")
Signed-off-by: Geetha sowjanya <gakula@marvell.com>
Signed-off-by: Hariprasad Kelam <hkelam@marvell.com>
Signed-off-by: Sunil Kovvuri Goutham <sgoutham@marvell.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2021-03-18 14:12:42 -07:00
Subbaraya Sundeep 2978878729 octeontx2-af: Return correct CGX RX fifo size
CGX receive buffer size is a constant value and
cannot be read from CGX0 block always since
CGX0 may not enabled everytime. Hence return CGX
receive buffer size from first enabled CGX block
instead of CGX0.

Fixes: 6e54e1c539 ("octeontx2-af: cn10K: MTU configuration")
Signed-off-by: Subbaraya Sundeep <sbhatta@marvell.com>
Signed-off-by: Hariprasad Kelam <hkelam@marvell.com>
Signed-off-by: Sunil Kovvuri Goutham <sgoutham@marvell.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2021-03-18 14:12:42 -07:00
Subbaraya Sundeep ce86c2a531 octeontx2-af: Remove TOS field from MKEX TX
The MKEX profile describes what packet fields need to be extracted from
the input packet and how to place those packet fields in the output key
for MCAM matching.  The MKEX profile can be in a way where higher layer
packet fields can overwrite lower layer packet fields in output MCAM
Key.
Hence MKEX profile is always ensured that there are no overlaps between
any of the layers. But the commit 42006910b5
("octeontx2-af: cleanup KPU config data") introduced TX TOS field which
overlaps with DMAC in MCAM key.
This led to AF driver returning error when TX rule is installed with
DMAC as match criteria since DMAC gets overwritten and cannot be
supported. This patch fixes the issue by removing TOS field from MKEX TX
profile.

Fixes: 42006910b5 ("octeontx2-af: cleanup KPU config data")
Signed-off-by: Subbaraya Sundeep <sbhatta@marvell.com>
Signed-off-by: Hariprasad Kelam <hkelam@marvell.com>
Signed-off-by: Sunil Kovvuri Goutham <sgoutham@marvell.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2021-03-18 14:12:42 -07:00
Rakesh Babu f788409714 octeontx2-af: Formatting debugfs entry rsrc_alloc.
With the existing rsrc_alloc's format, there is misalignment for the
pcifunc entries whose VF's index is a double digit. This patch fixes
this.

    pcifunc     NPA         NIX0        NIX1        SSO GROUP   SSOWS
    TIM         CPT0        CPT1        REE0        REE1
    PF0:VF0     8           5
    PF0:VF1     9                       3
    PF0:VF10    18          10
    PF0:VF11    19                      8
    PF0:VF12    20          11
    PF0:VF13    21                      9
    PF0:VF14    22          12
    PF0:VF15    23                      10
    PF1         0           0

Fixes: 23205e6d06 ("octeontx2-af: Dump current resource provisioning status")
Signed-off-by: Rakesh Babu <rsaladi2@marvell.com>
Signed-off-by: Hariprasad Kelam <hkelam@marvell.com>
Signed-off-by: Sunil Kovvuri Goutham <sgoutham@marvell.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2021-03-18 14:12:42 -07:00
Subbaraya Sundeep f41b2d67d7 octeontx2-pf: Do not modify number of rules
In the ETHTOOL_GRXCLSRLALL ioctl ethtool uses
below structure to read number of rules from the driver.

    struct ethtool_rxnfc {
            __u32                           cmd;
            __u32                           flow_type;
            __u64                           data;
            struct ethtool_rx_flow_spec     fs;
            union {
                    __u32                   rule_cnt;
                    __u32                   rss_context;
            };
            __u32                           rule_locs[0];
    };

Driver must not modify rule_cnt member. But currently driver
modifies it by modifying rss_context. Hence fix it by using a
local variable.

Fixes: 81a4362016 ("octeontx2-pf: Add RSS multi group support")
Signed-off-by: Subbaraya Sundeep <sbhatta@marvell.com>
Signed-off-by: Hariprasad Kelam <hkelam@marvell.com>
Signed-off-by: Sunil Kovvuri Goutham <sgoutham@marvell.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2021-03-18 14:12:41 -07:00
Linus Torvalds 81aa0968b7 for-5.12-rc3-tag
-----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCgAdFiEE8rQSAMVO+zA4DBdWxWXV+ddtWDsFAmBTeBsACgkQxWXV+ddt
 WDtwcBAAoto5Pbc3Lvt0aha3qn9q/Ms9lNU3YIwTjqXV3lIRKksWCS7kQmWlFmLz
 dILhdRBg1iWVh8qbeqpL5su7yNJduypsY/ImJroukb/BzwQViFRDGy5qIc56qLH2
 OVTx4LQ0zdqVdD86Qj0mt9ilSjgXYN+J53IUjsSSyJIpgt3vVcfjCYSkFO8zBiMH
 eliRtYShzJHkjEwVWLZRzk76oTnFQEC28IdYJ4y95mYl2wCABfTU2ylSeVDTtc6O
 x+fNMHHRmde2nbsHc+0eMm7rYLXuzvyx/tY17u6A6iwEQLGjE4rXOVZ7kA93WgAd
 YTXhM/B+YFfirNh029Av/MJP+2t9YBEODAHl1tnOdM0mfvXkpimaW0jvUEhi5f6I
 ZGu5FytscsgjyUK827WL7bZKO8WMzTLQvB3ryZ9UcrHm3QbZ7xGdoBE2L86p4Euw
 LiXUALdOWeYjFKSW9WWKrtQBtdjlLQYqJt+hL0ifaGlnfoi2G+DQeKtL9ZAKH5Cu
 gcjDUewnJtYPLyDOCRjQPFcts/MD5o81qMLeEwshmZT/bNMD9JOGEppCxBWGWSCx
 dYGq04Wib/dN710i5jB1XbJboBmT2SZDyBeiKTpCXs5mECBU00uWkkO98oId1YS3
 wHu9qyGUOi2g88V27jH593/JstUYn6zyxJYIZX84mzcxOqZlKuo=
 =auMP
 -----END PGP SIGNATURE-----

Merge tag 'for-5.12-rc3-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/kdave/linux

Pull btrfs fixes from David Sterba:
 "There are still regressions being found and fixed in the zoned mode
  and subpage code, the rest are fixes for bugs reported by users.

  Regressions:

   - subpage block support:
      - readahead works on the proper block size
      - fix last page zeroing

   - zoned mode:
      - linked list corruption for tree log

  Fixes:

   - qgroup leak after falloc failure

   - tree mod log and backref resolving:
      - extent buffer cloning race when resolving backrefs
      - pin deleted leaves with active tree mod log users

   - drop debugging flag from slab cache"

* tag 'for-5.12-rc3-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/kdave/linux:
  btrfs: always pin deleted leaves when there are active tree mod log users
  btrfs: fix race when cloning extent buffer during rewind of an old root
  btrfs: fix slab cache flags for free space tree bitmap
  btrfs: subpage: make readahead work properly
  btrfs: subpage: fix wild pointer access during metadata read failure
  btrfs: zoned: fix linked list corruption after log root tree allocation failure
  btrfs: fix qgroup data rsv leak caused by falloc failure
  btrfs: track qgroup released data in own variable in insert_prealloc_file_extent
  btrfs: fix wrong offset to zero out range beyond i_size
2021-03-18 13:38:42 -07:00
Linus Torvalds dc0337999d VFIO fixes for v5.12-rc4
- Fix 32-bit issue with new unmap-all flag (Steve Sistare)
 
  - Various Kconfig changes for better coverage (Jason Gunthorpe)
 
  - Fix to batch pinning support (Daniel Jordan)
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v2.0.14 (GNU/Linux)
 
 iQIcBAABAgAGBQJgU6PRAAoJECObm247sIsixAQP/RQCvHD4W7jmgrb7ksucE7Hz
 KaJaJzbonayUCdI5e1W4x4j8BhiclIAJXz+kMbjltN4AqASkKVIBzIlBmDt4nsJ/
 AMCN7A1EOmPpG1xX6TpTXxfdw/7VjSRtFk/S8mv0N0NIRdZwue4SBbZd/oXkk7NF
 vBSsJkVn/nCGrEu1+vb/Ld5T8fecni99slyTaN/WYlEVqIJtTDEZhvPwMrIqNOcu
 n2UDMrifuUqXmbOKtCRhwPIwpOzEx8E1vNHAWHu3S8KOhdj7g6QXyWij2EmBD0hs
 rKU+uVnH/KImNVGHnwVqbPrlCxUcBV/RXKAA2XxN6VQiiLYAvhbHISVTtVHt21rQ
 pwJGcOyOeBmt+FrVw3cLwtkn3y87Nrg6gpQlrw3k3dyuYIUVThlUlBADzpmX0ZM5
 40BYpWPsrqdvPQxZzY6ccAvkn838ZTNPDSPac5nnQOJgeYnxR+cWKzKeL4bggJxm
 kYhoIIQETnbJeUZQYOP4FT8ltJPJkhaMTHYSdKrCvkYhN2Eq3+Wi+gLiMbeEpM+d
 6IUH+ZwHfH8DGQGUBfpt6AuKNu5vnUppHAu/xpoXJxl2ITyKHDoXypuEHsD+DRro
 4CmS74+ma932WHYc+wwqnKRjyUFlwaDbqmIV7vv54dHRkhMSfGDVbWybCosGNodL
 NJNR1uFmuVgcyKpcWinq
 =C+4w
 -----END PGP SIGNATURE-----

Merge tag 'vfio-v5.12-rc4' of git://github.com/awilliam/linux-vfio

Pull VFIO fixes from Alex Williamson:

 - Fix 32-bit issue with new unmap-all flag (Steve Sistare)

 - Various Kconfig changes for better coverage (Jason Gunthorpe)

 - Fix to batch pinning support (Daniel Jordan)

* tag 'vfio-v5.12-rc4' of git://github.com/awilliam/linux-vfio:
  vfio/type1: fix vaddr_get_pfns() return in vfio_pin_page_external()
  vfio: Depend on MMU
  ARM: amba: Allow some ARM_AMBA users to compile with COMPILE_TEST
  vfio-platform: Add COMPILE_TEST to VFIO_PLATFORM
  vfio: IOMMU_API should be selected
  vfio/type1: fix unmap all on ILP32
2021-03-18 12:37:05 -07:00
Linus Torvalds c73891c922 Changes for 5.12-rc3:
- Fix quota accounting on creat() when id mapping is enabled.
  - Actually reclaim dirty quota inodes when mount fails.
  - Typo fixes for documentation.
  - Restrict both bulkstat calls on idmapped/namespaced mounts.
 -----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCgAdFiEEUzaAxoMeQq6m2jMV+H93GTRKtOsFAmBPgosACgkQ+H93GTRK
 tOvUxRAAnseftovKcY/0DxuVyaqM+9MCOTSZ7vJ/buhRyyXOWjrpI/2IU8arJlc9
 iY2Qc15djBKywGneQI1KHEErsU8PhfUIgqF1R9uwkoOqNgCBQ+nj23VHnLvS19XL
 0J8f+V3udi4Hxl7iToRs1ZjzIvsiwkZHaEqs37MtG4ZxOn3u2OV5c9pMD+sOvLMU
 iJjkaAoikYFynHCndW+egLvwmcoJnnfl57cgj238twMN3oXDG2QDumJ6XbaKUfg9
 7wZNbRNRzq9w9OMaABKWMljHT8MVLXPYavhdJ76GZhujJcD6vdJZJ8+vvtUtk4JT
 0Z0YTsOoAeU1BjDcJH9g+wkQWFOj2Jme/TjhIPmz4KeQi65Ir+mlTfF47GGJySti
 YjRL/kTv5V5OvGsUmeMHQ2Y/Wt5YksdgtP9wQzzx7Lcv17SVgFbJ+nYbv05WMpke
 UUxYhoAWcfsC/kmOllpBbZTyisjAv7hjmiLpGiQteR5RY1DE8PtH532Y5jz08huM
 veHfqpa4rLUEACRl1Qg+gTeTd3dg/gTpVANIp0HWkpzP/V8I+OvrJxNZFEBcOHK4
 WzZXSwG2tSAIi1hMuzB75q5qmUQTND3QOX6u1uzUBU+KMl/U16SJJbGkWrwx7Ko2
 hucFDvCmcW6lgMgY41R56mM0Sy5TMgXqaSdZtiykE0yytT2hl+8=
 =MQhY
 -----END PGP SIGNATURE-----

Merge tag 'xfs-5.12-fixes-3' of git://git.kernel.org/pub/scm/fs/xfs/xfs-linux

Pull xfs fixes from Darrick Wong:
 "A couple of minor corrections for the new idmapping functionality, and
  a fix for a theoretical hang that could occur if we decide to abort a
  mount after dirtying the quota inodes.

  Summary:

   - Fix quota accounting on creat() when id mapping is enabled

   - Actually reclaim dirty quota inodes when mount fails

   - Typo fixes for documentation

   - Restrict both bulkstat calls on idmapped/namespaced mounts"

* tag 'xfs-5.12-fixes-3' of git://git.kernel.org/pub/scm/fs/xfs/xfs-linux:
  xfs: also reject BULKSTAT_SINGLE in a mount user namespace
  docs: ABI: Fix the spelling oustanding to outstanding in the file sysfs-fs-xfs
  xfs: force log and push AIL to clear pinned inodes when aborting mount
  xfs: fix quota accounting when a mount is idmapped
2021-03-18 12:32:51 -07:00
Mian Yousaf Kaukab 804741ac7b netsec: restore phy power state after controller reset
Since commit 8e850f25b5 ("net: socionext: Stop PHY before resetting
netsec") netsec_netdev_init() power downs phy before resetting the
controller. However, the state is not restored once the reset is
complete. As a result it is not possible to bring up network on a
platform with Broadcom BCM5482 phy.

Fix the issue by restoring phy power state after controller reset is
complete.

Fixes: 8e850f25b5 ("net: socionext: Stop PHY before resetting netsec")
Cc: stable@vger.kernel.org
Signed-off-by: Mian Yousaf Kaukab <ykaukab@suse.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
2021-03-18 11:22:04 -07:00
Linus Torvalds bf152b0b41 virtio: fixes, cleanups
Some fixes and cleanups all over the place.
 
 Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
 -----BEGIN PGP SIGNATURE-----
 
 iQFDBAABCAAtFiEEXQn9CHHI+FuUyooNKB8NuNKNVGkFAmBTl5oPHG1zdEByZWRo
 YXQuY29tAAoJECgfDbjSjVRpTjQIAMvBc1dElNT1wmEkALeR3GRG+e1FcNdvhJaC
 hjK23b7xuHDkX4/yyqui7bgvZTkYE5WuUU/Jq6eAOR1k3n9o6u3nV1px+ntRi4OJ
 dmFiXlqOgkgvCfRwIqJk68eyURIhw4vdswMn0DZGMbFubh9vUw6H4CGye6pNxqPu
 ZhyGMYCQKguxs3+KWtHEkjcEdZbkxkxB9G7yA0jXhGmeMDVfGbRiucJWwwRutgrs
 lI2uf1vI0A9qGi4kQlTLO2Qv2b9CRbFZyT1zPuqtZER2PKRLOwFuNTMUueYcaWfW
 8XAM0R7mMZ1IDPgL181D+98Jk8eDQVcwVdVYOFWT9RpBdhtTel0=
 =3fwV
 -----END PGP SIGNATURE-----

Merge tag 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mst/vhost

Pull virtio fixes from Michael Tsirkin:
 "Some fixes and cleanups all over the place"

* tag 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mst/vhost:
  vhost-vdpa: set v->config_ctx to NULL if eventfd_ctx_fdget() fails
  vhost-vdpa: fix use-after-free of v->config_ctx
  vhost: Fix vhost_vq_reset()
  vhost_vdpa: fix the missing irq_bypass_unregister_producer() invocation
  vdpa_sim: Skip typecasting from void*
  virtio: remove export for virtio_config_{enable, disable}
  virtio-mmio: Use to_virtio_mmio_device() to simply code
  vdpa: set the virtqueue num during register
2021-03-18 11:20:35 -07:00