1. 10 11月, 2020 1 次提交
    • A
      firmware: xilinx: fix out-of-bounds access · f3217d6f
      Arnd Bergmann 提交于
      The zynqmp_pm_set_suspend_mode() and zynqmp_pm_get_trustzone_version()
      functions pass values as api_id into zynqmp_pm_invoke_fn
      that are beyond PM_API_MAX, resulting in an out-of-bounds access:
      
      drivers/firmware/xilinx/zynqmp.c: In function 'zynqmp_pm_set_suspend_mode':
      drivers/firmware/xilinx/zynqmp.c:150:24: warning: array subscript 2562 is above array bounds of 'u32[64]' {aka 'unsigned int[64]'} [-Warray-bounds]
        150 |  if (zynqmp_pm_features[api_id] != PM_FEATURE_UNCHECKED)
            |      ~~~~~~~~~~~~~~~~~~^~~~~~~~
      drivers/firmware/xilinx/zynqmp.c:28:12: note: while referencing 'zynqmp_pm_features'
         28 | static u32 zynqmp_pm_features[PM_API_MAX];
            |            ^~~~~~~~~~~~~~~~~~
      
      Replace the resulting undefined behavior with an error return.
      This may break some things that happen to work at the moment
      but seems better than randomly overwriting kernel data.
      
      I assume we need additional fixes for the two functions that now
      return an error.
      
      Fixes: 76582671 ("firmware: xilinx: Add Zynqmp firmware driver")
      Fixes: e178df31 ("firmware: xilinx: Implement ZynqMP power management APIs")
      Signed-off-by: NArnd Bergmann <arnd@arndb.de>
      Link: https://lore.kernel.org/r/20201026155449.3703142-1-arnd@kernel.org
      Cc: stable <stable@vger.kernel.org>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      f3217d6f
  2. 15 10月, 2020 3 次提交
    • H
      fw_cfg: Add support for parisc architecture · 6b698713
      Helge Deller 提交于
      Signed-off-by: NHelge Deller <deller@gmx.de>
      6b698713
    • F
      firmware: arm_scmi: Fix duplicate workqueue name · b9ceca6b
      Florian Fainelli 提交于
      When more than a single SCMI device are present in the system, the
      creation of the notification workqueue with the WQ_SYSFS flag will lead
      to the following sysfs duplicate node warning:
      
       sysfs: cannot create duplicate filename '/devices/virtual/workqueue/scmi_notify'
       CPU: 0 PID: 20 Comm: kworker/0:1 Not tainted 5.9.0-gdf4dd84a3f7d #29
       Hardware name: Broadcom STB (Flattened Device Tree)
       Workqueue: events deferred_probe_work_func
       Backtrace:
         show_stack + 0x20/0x24
         dump_stack + 0xbc/0xe0
         sysfs_warn_dup + 0x70/0x80
         sysfs_create_dir_ns + 0x15c/0x1a4
         kobject_add_internal + 0x140/0x4d0
         kobject_add + 0xc8/0x138
         device_add + 0x1dc/0xc20
         device_register + 0x24/0x28
         workqueue_sysfs_register + 0xe4/0x1f0
         alloc_workqueue + 0x448/0x6ac
         scmi_notification_init + 0x78/0x1dc
         scmi_probe + 0x268/0x4fc
         platform_drv_probe + 0x70/0xc8
         really_probe + 0x184/0x728
         driver_probe_device + 0xa4/0x278
         __device_attach_driver + 0xe8/0x148
         bus_for_each_drv + 0x108/0x158
         __device_attach + 0x190/0x234
         device_initial_probe + 0x1c/0x20
         bus_probe_device + 0xdc/0xec
         deferred_probe_work_func + 0xd4/0x11c
         process_one_work + 0x420/0x8f0
         worker_thread + 0x4fc/0x91c
         kthread + 0x21c/0x22c
         ret_from_fork + 0x14/0x20
       kobject_add_internal failed for scmi_notify with -EEXIST, don't try to
       	register things with the same name in the same directory.
       arm-scmi brcm_scmi@1: SCMI Notifications - Initialization Failed.
       arm-scmi brcm_scmi@1: SCMI Notifications NOT available.
       arm-scmi brcm_scmi@1: SCMI Protocol v1.0 'brcm-scmi:' Firmware version 0x1
      
      Fix this by using dev_name(handle->dev) which guarantees that the name is
      unique and this also helps correlate which notification workqueue corresponds
      to which SCMI device instance.
      
      Link: https://lore.kernel.org/r/20201014021737.287340-1-f.fainelli@gmail.com
      Fixes: bd31b249 ("firmware: arm_scmi: Add notification dispatch and delivery")
      Signed-off-by: NFlorian Fainelli <f.fainelli@gmail.com>
      [sudeep.holla: trimmed backtrace to remove all unwanted hexcodes and timestamps]
      Signed-off-by: NSudeep Holla <sudeep.holla@arm.com>
      b9ceca6b
    • C
      firmware: arm_scmi: Fix locking in notifications · c7821c2d
      Cristian Marussi 提交于
      When a protocol registers its events, the notification core takes care
      to rescan the hashtable of pending event handlers and activate all the
      possibly existent handlers referring to any of the events that are just
      registered by the new protocol. When a pending handler becomes active
      the core requests and enables the corresponding events in the SCMI
      firmware.
      
      If, for whatever reason, the enable fails, such invalid event handler
      must be finally removed and freed. Let us ensure to use the
      scmi_put_active_handler() helper which handles properly the needed
      additional locking.
      
      Failing to properly acquire all the needed mutexes exposes a race that
      leads to the following splat being observed:
      
       WARNING: CPU: 0 PID: 388 at lib/refcount.c:28 refcount_warn_saturate+0xf8/0x148
       Hardware name: ARM LTD ARM Juno Development Platform/ARM Juno Development
       	Platform, BIOS EDK II Jun 30 2020
       pstate: 40000005 (nZcv daif -PAN -UAO BTYPE=--)
       pc : refcount_warn_saturate+0xf8/0x148
       lr : refcount_warn_saturate+0xf8/0x148
       Call trace:
        refcount_warn_saturate+0xf8/0x148
        scmi_put_handler_unlocked.isra.10+0x204/0x208
        scmi_put_handler+0x50/0xa0
        scmi_unregister_notifier+0x1bc/0x240
        scmi_notify_tester_remove+0x4c/0x68 [dummy_scmi_consumer]
        scmi_dev_remove+0x54/0x68
        device_release_driver_internal+0x114/0x1e8
        driver_detach+0x58/0xe8
        bus_remove_driver+0x88/0xe0
        driver_unregister+0x38/0x68
        scmi_driver_unregister+0x1c/0x28
        scmi_drv_exit+0x1c/0xae0 [dummy_scmi_consumer]
        __arm64_sys_delete_module+0x1a4/0x268
        el0_svc_common.constprop.3+0x94/0x178
        do_el0_svc+0x2c/0x98
        el0_sync_handler+0x148/0x1a8
        el0_sync+0x158/0x180
      
      Link: https://lore.kernel.org/r/20201013133109.49821-1-cristian.marussi@arm.com
      Fixes: e7c215f3 ("firmware: arm_scmi: Add notification callbacks-registration")
      Signed-off-by: NCristian Marussi <cristian.marussi@arm.com>
      Signed-off-by: NSudeep Holla <sudeep.holla@arm.com>
      c7821c2d
  3. 14 10月, 2020 1 次提交
    • D
      efi/fake_mem: arrange for a resource entry per efi_fake_mem instance · 88e9a5b7
      Dan Williams 提交于
      In preparation for attaching a platform device per iomem resource teach
      the efi_fake_mem code to create an e820 entry per instance.  Similar to
      E820_TYPE_PRAM, bypass merging resource when the e820 map is sanitized.
      Signed-off-by: NDan Williams <dan.j.williams@intel.com>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Acked-by: NArd Biesheuvel <ardb@kernel.org>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: Ingo Molnar <mingo@redhat.com>
      Cc: Borislav Petkov <bp@alien8.de>
      Cc: "H. Peter Anvin" <hpa@zytor.com>
      Cc: Andy Lutomirski <luto@kernel.org>
      Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
      Cc: Ben Skeggs <bskeggs@redhat.com>
      Cc: Brice Goglin <Brice.Goglin@inria.fr>
      Cc: Catalin Marinas <catalin.marinas@arm.com>
      Cc: Daniel Vetter <daniel@ffwll.ch>
      Cc: Dave Hansen <dave.hansen@linux.intel.com>
      Cc: Dave Jiang <dave.jiang@intel.com>
      Cc: David Airlie <airlied@linux.ie>
      Cc: David Hildenbrand <david@redhat.com>
      Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
      Cc: Ira Weiny <ira.weiny@intel.com>
      Cc: Jason Gunthorpe <jgg@mellanox.com>
      Cc: Jeff Moyer <jmoyer@redhat.com>
      Cc: Jia He <justin.he@arm.com>
      Cc: Joao Martins <joao.m.martins@oracle.com>
      Cc: Jonathan Cameron <Jonathan.Cameron@huawei.com>
      Cc: Michael Ellerman <mpe@ellerman.id.au>
      Cc: Mike Rapoport <rppt@linux.ibm.com>
      Cc: Paul Mackerras <paulus@ozlabs.org>
      Cc: Pavel Tatashin <pasha.tatashin@soleen.com>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
      Cc: Tom Lendacky <thomas.lendacky@amd.com>
      Cc: Vishal Verma <vishal.l.verma@intel.com>
      Cc: Wei Yang <richard.weiyang@linux.alibaba.com>
      Cc: Will Deacon <will@kernel.org>
      Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
      Cc: Bjorn Helgaas <bhelgaas@google.com>
      Cc: Boris Ostrovsky <boris.ostrovsky@oracle.com>
      Cc: Hulk Robot <hulkci@huawei.com>
      Cc: Jason Yan <yanaijie@huawei.com>
      Cc: "Jérôme Glisse" <jglisse@redhat.com>
      Cc: Juergen Gross <jgross@suse.com>
      Cc: kernel test robot <lkp@intel.com>
      Cc: Randy Dunlap <rdunlap@infradead.org>
      Cc: Stefano Stabellini <sstabellini@kernel.org>
      Cc: Vivek Goyal <vgoyal@redhat.com>
      Link: https://lkml.kernel.org/r/159643096068.4062302.11590041070221681669.stgit@dwillia2-desk3.amr.corp.intel.comSigned-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      88e9a5b7
  4. 13 10月, 2020 1 次提交
  5. 12 10月, 2020 2 次提交
  6. 03 10月, 2020 2 次提交
  7. 02 10月, 2020 1 次提交
  8. 30 9月, 2020 7 次提交
  9. 29 9月, 2020 14 次提交
  10. 26 9月, 2020 3 次提交
  11. 22 9月, 2020 1 次提交
  12. 18 9月, 2020 1 次提交
    • T
      firmware: tegra: Enable BPMP support on Tegra234 · 0ebdf116
      Thierry Reding 提交于
      Enable support for the BPMP on Tegra234 to avoid relying on Tegra194
      being enabled to pull in the needed OF device ID table entry.
      
      On simulation platforms the BPMP hasn't booted up yet by the time we
      probe the BPMP driver and the BPMP hasn't had a chance to mark the
      doorbell as ringable by the CCPLEX. This corresponding check in the
      BPMP driver will therefore fail. Work around this by disabling the
      check on simulation platforms.
      Reviewed-by: NJon Hunter <jonathanh@nvidia.com>
      Signed-off-by: NThierry Reding <treding@nvidia.com>
      0ebdf116
  13. 17 9月, 2020 3 次提交