1. 25 Mar, 2020 3 commits
  2. 04 Mar, 2020 3 commits
    • Suman Anna's avatar
      bus: ti-sysc: Add support for PRUSS SYSC type · b2745d92
      Suman Anna authored
      The PRU-ICSS present on AM33xx/AM43xx/AM57xx has a very unique
      SYSCFG register. The register follows the OMAP4-style SYSC_TYPE3
      for Master Standby and Slave Idle, but also has two additional
      unique fields - STANDBY_INIT and SUB_MWAIT. The STANDBY_INIT is
      a control bit that is used to initiate a Standby sequence (when
      set) and trigger a MStandby request to the SoC's PRCM module. This
      same bit is also used to enable the OCP master ports (when cleared)
      to allow the PRU cores to access any peripherals or memory beyond
      the PRU subsystem. The SUB_MWAIT is a ready status field for the
      external access.
      
      Add support for this SYSC type. The STANDBY_INIT has to be set
      during suspend, without which it results in a hang in the resume
      sequence on AM33xx/AM43xx boards and requires a board reset to
      come out of the hang. Any PRU applications requiring external
      access are supposed to clear the STANDBY_INIT bit. Note that
      the PRUSS context is lost during a suspend sequence because the
      PRUSS module is reset and/or disabled.
      Signed-off-by: default avatarSuman Anna <s-anna@ti.com>
      Signed-off-by: default avatarRoger Quadros <rogerq@ti.com>
      [tony@atomide.com: updated quirk define number and to use -ENODEV]
      Signed-off-by: default avatarTony Lindgren <tony@atomide.com>
      b2745d92
    • Roger Quadros's avatar
      dt-bindings: bus: ti-sysc: Add support for PRUSS SYSC type · 4d0dd380
      Roger Quadros authored
      The PRUSS module has a SYSCFG which is unique. The SYSCFG
      has two additional unique fields called STANDBY_INIT and
      SUB_MWAIT in addition to regular IDLE_MODE and STANDBY_MODE
      fields. Add the bindings for this new sysc type.
      
      Cc: Rob Herring <robh+dt@kernel.org>
      Signed-off-by: default avatarRoger Quadros <rogerq@ti.com>
      Signed-off-by: default avatarSuman Anna <s-anna@ti.com>
      Acked-by: default avatarRob Herring <robh@kernel.org>
      Signed-off-by: default avatarTony Lindgren <tony@atomide.com>
      4d0dd380
    • Tony Lindgren's avatar
      bus: ti-sysc: Detect EDMA and set quirk flags for tptc · 25bfaaa7
      Tony Lindgren authored
      In order to probe EDMA with ti-sysc interconnect target module and with
      device tree data, we need to properly detect EDMA and set the flags for
      SYSC_QUIRK_SWSUP_SIDLE | SYSC_QUIRK_SWSUP_MSTANDBY for tptc.
      
      We have these flags currently set for am4 and dra7, but not for am335x.
      Let's set them for all the SoCs as the tptc module should behave the
      same for all of them. It's likely that am335x was never tested to idle
      EDMA tptc.
      
      Cc: Peter Ujfalusi <peter.ujfalusi@ti.com>
      Signed-off-by: default avatarTony Lindgren <tony@atomide.com>
      25bfaaa7
  3. 03 Mar, 2020 2 commits
  4. 01 Mar, 2020 5 commits
  5. 29 Feb, 2020 4 commits
    • Dan Carpenter's avatar
      ext4: potential crash on allocation error in ext4_alloc_flex_bg_array() · 37b0b6b8
      Dan Carpenter authored
      If sbi->s_flex_groups_allocated is zero and the first allocation fails
      then this code will crash.  The problem is that "i--" will set "i" to
      -1 but when we compare "i >= sbi->s_flex_groups_allocated" then the -1
      is type promoted to unsigned and becomes UINT_MAX.  Since UINT_MAX
      is more than zero, the condition is true so we call kvfree(new_groups[-1]).
      The loop will carry on freeing invalid memory until it crashes.
      
      Fixes: 7c990728 ("ext4: fix potential race between s_flex_groups online resizing and access")
      Reviewed-by: default avatarSuraj Jitindar Singh <surajjs@amazon.com>
      Signed-off-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
      Cc: stable@kernel.org
      Link: https://lore.kernel.org/r/20200228092142.7irbc44yaz3by7nb@kili.mountainSigned-off-by: default avatarTheodore Ts'o <tytso@mit.edu>
      37b0b6b8
    • Wolfram Sang's avatar
      macintosh: therm_windtunnel: fix regression when instantiating devices · 38b17afb
      Wolfram Sang authored
      Removing attach_adapter from this driver caused a regression for at
      least some machines. Those machines had the sensors described in their
      DT, too, so they didn't need manual creation of the sensor devices. The
      old code worked, though, because manual creation came first. Creation of
      DT devices then failed later and caused error logs, but the sensors
      worked nonetheless because of the manually created devices.
      
      When removing attach_adaper, manual creation now comes later and loses
      the race. The sensor devices were already registered via DT, yet with
      another binding, so the driver could not be bound to it.
      
      This fix refactors the code to remove the race and only manually creates
      devices if there are no DT nodes present. Also, the DT binding is updated
      to match both, the DT and manually created devices. Because we don't
      know which device creation will be used at runtime, the code to start
      the kthread is moved to do_probe() which will be called by both methods.
      
      Fixes: 3e7bed52 ("macintosh: therm_windtunnel: drop using attach_adapter")
      Link: https://bugzilla.kernel.org/show_bug.cgi?id=201723Reported-by: default avatarErhard Furtner <erhard_f@mailbox.org>
      Tested-by: default avatarErhard Furtner <erhard_f@mailbox.org>
      Acked-by: Michael Ellerman <mpe@ellerman.id.au> (powerpc)
      Signed-off-by: default avatarWolfram Sang <wsa@the-dreams.de>
      Cc: stable@kernel.org # v4.19+
      38b17afb
    • Qian Cai's avatar
      jbd2: fix data races at struct journal_head · 6c5d9112
      Qian Cai authored
      journal_head::b_transaction and journal_head::b_next_transaction could
      be accessed concurrently as noticed by KCSAN,
      
       LTP: starting fsync04
       /dev/zero: Can't open blockdev
       EXT4-fs (loop0): mounting ext3 file system using the ext4 subsystem
       EXT4-fs (loop0): mounted filesystem with ordered data mode. Opts: (null)
       ==================================================================
       BUG: KCSAN: data-race in __jbd2_journal_refile_buffer [jbd2] / jbd2_write_access_granted [jbd2]
      
       write to 0xffff99f9b1bd0e30 of 8 bytes by task 25721 on cpu 70:
        __jbd2_journal_refile_buffer+0xdd/0x210 [jbd2]
        __jbd2_journal_refile_buffer at fs/jbd2/transaction.c:2569
        jbd2_journal_commit_transaction+0x2d15/0x3f20 [jbd2]
        (inlined by) jbd2_journal_commit_transaction at fs/jbd2/commit.c:1034
        kjournald2+0x13b/0x450 [jbd2]
        kthread+0x1cd/0x1f0
        ret_from_fork+0x27/0x50
      
       read to 0xffff99f9b1bd0e30 of 8 bytes by task 25724 on cpu 68:
        jbd2_write_access_granted+0x1b2/0x250 [jbd2]
        jbd2_write_access_granted at fs/jbd2/transaction.c:1155
        jbd2_journal_get_write_access+0x2c/0x60 [jbd2]
        __ext4_journal_get_write_access+0x50/0x90 [ext4]
        ext4_mb_mark_diskspace_used+0x158/0x620 [ext4]
        ext4_mb_new_blocks+0x54f/0xca0 [ext4]
        ext4_ind_map_blocks+0xc79/0x1b40 [ext4]
        ext4_map_blocks+0x3b4/0x950 [ext4]
        _ext4_get_block+0xfc/0x270 [ext4]
        ext4_get_block+0x3b/0x50 [ext4]
        __block_write_begin_int+0x22e/0xae0
        __block_write_begin+0x39/0x50
        ext4_write_begin+0x388/0xb50 [ext4]
        generic_perform_write+0x15d/0x290
        ext4_buffered_write_iter+0x11f/0x210 [ext4]
        ext4_file_write_iter+0xce/0x9e0 [ext4]
        new_sync_write+0x29c/0x3b0
        __vfs_write+0x92/0xa0
        vfs_write+0x103/0x260
        ksys_write+0x9d/0x130
        __x64_sys_write+0x4c/0x60
        do_syscall_64+0x91/0xb05
        entry_SYSCALL_64_after_hwframe+0x49/0xbe
      
       5 locks held by fsync04/25724:
        #0: ffff99f9911093f8 (sb_writers#13){.+.+}, at: vfs_write+0x21c/0x260
        #1: ffff99f9db4c0348 (&sb->s_type->i_mutex_key#15){+.+.}, at: ext4_buffered_write_iter+0x65/0x210 [ext4]
        #2: ffff99f5e7dfcf58 (jbd2_handle){++++}, at: start_this_handle+0x1c1/0x9d0 [jbd2]
        #3: ffff99f9db4c0168 (&ei->i_data_sem){++++}, at: ext4_map_blocks+0x176/0x950 [ext4]
        #4: ffffffff99086b40 (rcu_read_lock){....}, at: jbd2_write_access_granted+0x4e/0x250 [jbd2]
       irq event stamp: 1407125
       hardirqs last  enabled at (1407125): [<ffffffff980da9b7>] __find_get_block+0x107/0x790
       hardirqs last disabled at (1407124): [<ffffffff980da8f9>] __find_get_block+0x49/0x790
       softirqs last  enabled at (1405528): [<ffffffff98a0034c>] __do_softirq+0x34c/0x57c
       softirqs last disabled at (1405521): [<ffffffff97cc67a2>] irq_exit+0xa2/0xc0
      
       Reported by Kernel Concurrency Sanitizer on:
       CPU: 68 PID: 25724 Comm: fsync04 Tainted: G L 5.6.0-rc2-next-20200221+ #7
       Hardware name: HPE ProLiant DL385 Gen10/ProLiant DL385 Gen10, BIOS A40 07/10/2019
      
      The plain reads are outside of jh->b_state_lock critical section which result
      in data races. Fix them by adding pairs of READ|WRITE_ONCE().
      Reviewed-by: default avatarJan Kara <jack@suse.cz>
      Signed-off-by: default avatarQian Cai <cai@lca.pw>
      Link: https://lore.kernel.org/r/20200222043111.2227-1-cai@lca.pwSigned-off-by: default avatarTheodore Ts'o <tytso@mit.edu>
      6c5d9112
    • Linus Torvalds's avatar
      Merge tag 'scsi-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi · 7557c1b3
      Linus Torvalds authored
      Pull SCSI fixes from James Bottomley:
       "Four small fixes.
      
        Three are in drivers for fairly obvious bugs. The fourth is a set of
        regressions introduced by the compat_ioctl changes because some of the
        compat updates wrongly replaced .ioctl instead of .compat_ioctl"
      
      * tag 'scsi-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi:
        scsi: compat_ioctl: cdrom: Replace .ioctl with .compat_ioctl in four appropriate places
        scsi: zfcp: fix wrong data and display format of SFP+ temperature
        scsi: sd_sbc: Fix sd_zbc_report_zones()
        scsi: libfc: free response frame from GPN_ID
      7557c1b3
  6. 28 Feb, 2020 22 commits
    • Linus Torvalds's avatar
      Merge tag 'pci-v5.6-fixes-2' of git://git.kernel.org/pub/scm/linux/kernel/git/helgaas/pci · 29795de0
      Linus Torvalds authored
      Pull PCI fixes from Bjorn Helgaas:
      
       - Fix build issue on 32-bit ARM with old compilers (Marek Szyprowski)
      
       - Update MAINTAINERS for recent Cadence driver file move (Lukas
         Bulwahn)
      
      * tag 'pci-v5.6-fixes-2' of git://git.kernel.org/pub/scm/linux/kernel/git/helgaas/pci:
        MAINTAINERS: Correct Cadence PCI driver path
        PCI: brcmstb: Fix build on 32bit ARM platforms with older compilers
      29795de0
    • Linus Torvalds's avatar
      Merge tag 'block-5.6-2020-02-28' of git://git.kernel.dk/linux-block · 2edc78b9
      Linus Torvalds authored
      Pull block fixes from Jens Axboe:
      
       - Passthrough insertion fix (Ming)
      
       - Kill off some unused arguments (John)
      
       - blktrace RCU fix (Jan)
      
       - Dead fields removal for null_blk (Dongli)
      
       - NVMe polled IO fix (Bijan)
      
      * tag 'block-5.6-2020-02-28' of git://git.kernel.dk/linux-block:
        nvme-pci: Hold cq_poll_lock while completing CQEs
        blk-mq: Remove some unused function arguments
        null_blk: remove unused fields in 'nullb_cmd'
        blktrace: Protect q->blk_trace with RCU
        blk-mq: insert passthrough request into hctx->dispatch directly
      2edc78b9
    • Linus Torvalds's avatar
      Merge tag 'io_uring-5.6-2020-02-28' of git://git.kernel.dk/linux-block · 74dea5d9
      Linus Torvalds authored
      Pull io_uring fixes from Jens Axboe:
      
       - Fix for a race with IOPOLL used with SQPOLL (Xiaoguang)
      
       - Only show ->fdinfo if procfs is enabled (Tobias)
      
       - Fix for a chain with multiple personalities in the SQEs
      
       - Fix for a missing free of personality idr on exit
      
       - Removal of the spin-for-work optimization
      
       - Fix for next work lookup on request completion
      
       - Fix for non-vec read/write result progation in case of links
      
       - Fix for a fileset references on switch
      
       - Fix for a recvmsg/sendmsg 32-bit compatability mode
      
      * tag 'io_uring-5.6-2020-02-28' of git://git.kernel.dk/linux-block:
        io_uring: fix 32-bit compatability with sendmsg/recvmsg
        io_uring: define and set show_fdinfo only if procfs is enabled
        io_uring: drop file set ref put/get on switch
        io_uring: import_single_range() returns 0/-ERROR
        io_uring: pick up link work on submit reference drop
        io-wq: ensure work->task_pid is cleared on init
        io-wq: remove spin-for-work optimization
        io_uring: fix poll_list race for SETUP_IOPOLL|SETUP_SQPOLL
        io_uring: fix personality idr leak
        io_uring: handle multiple personalities in link chains
      74dea5d9
    • Jens Axboe's avatar
      Merge branch 'nvme-5.6-rc4' of git://git.infradead.org/nvme into block-5.6 · 5b8ea58b
      Jens Axboe authored
      Pull NVMe fix from Keith.
      
      * 'nvme-5.6-rc4' of git://git.infradead.org/nvme:
        nvme-pci: Hold cq_poll_lock while completing CQEs
      5b8ea58b
    • Linus Torvalds's avatar
      Merge tag 'acpi-5.6-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm · c60c0402
      Linus Torvalds authored
      Pull ACPI fixes from Rafael Wysocki:
       "Fix a couple of configuration issues in the ACPI watchdog (WDAT)
        driver (Mika Westerberg) and make it possible to disable that driver
        at boot time in case it still does not work as expected (Jean
        Delvare)"
      
      * tag 'acpi-5.6-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm:
        ACPI: watchdog: Set default timeout in probe
        ACPI: watchdog: Fix gas->access_width usage
        ACPICA: Introduce ACPI_ACCESS_BYTE_WIDTH() macro
        ACPI: watchdog: Allow disabling WDAT at boot
      c60c0402
    • Linus Torvalds's avatar
      Merge tag 'pm-5.6-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm · 36428598
      Linus Torvalds authored
      Pull power management fixes from Rafael Wysocki:
       "Fix a recent cpufreq initialization regression (Rafael Wysocki),
        revert a devfreq commit that made incompatible changes and broke user
        land on some systems (Orson Zhai), drop a stale reference to a
        document that has gone away recently (Jonathan Neuschäfer), and fix a
        typo in a hibernation code comment (Alexandre Belloni)"
      
      * tag 'pm-5.6-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm:
        cpufreq: Fix policy initialization for internal governor drivers
        Revert "PM / devfreq: Modify the device name as devfreq(X) for sysfs"
        PM / hibernate: fix typo "reserverd_size" -> "reserved_size"
        Documentation: power: Drop reference to interface.rst
      36428598
    • Linus Torvalds's avatar
      Merge tag 'zonefs-5.6-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/dlemoal/zonefs · bfeb4f99
      Linus Torvalds authored
      Pull zonefs fixes from Damien Le Moal:
       "Two fixes in here:
      
         - Revert the initial decision to silently ignore IOCB_NOWAIT for
           asynchronous direct IOs to sequential zone files. Instead, return
           an error to the user to signal that the feature is not supported
           (from Christoph)
      
         - A fix to zonefs Kconfig to select FS_IOMAP to avoid build failures
           if no other file system already selected this option (from
           Johannes)"
      
      * tag 'zonefs-5.6-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/dlemoal/zonefs:
        zonefs: select FS_IOMAP
        zonefs: fix IOCB_NOWAIT handling
      bfeb4f99
    • Paolo Bonzini's avatar
      Merge tag 'kvmarm-fixes-5.6-1' of... · e951445f
      Paolo Bonzini authored
      Merge tag 'kvmarm-fixes-5.6-1' of git://git.kernel.org/pub/scm/linux/kernel/git/kvmarm/kvmarm into HEAD
      
      KVM/arm fixes for 5.6, take #1
      
      - Fix compilation on 32bit
      - Move  VHE guest entry/exit into the VHE-specific entry code
      - Make sure all functions called by the non-VHE HYP code is tagged as __always_inline
      e951445f
    • Erwan Velu's avatar
      kvm: x86: Limit the number of "kvm: disabled by bios" messages · ef935c25
      Erwan Velu authored
      In older version of systemd(219), at boot time, udevadm is called with :
      	/usr/bin/udevadm trigger --type=devices --action=add"
      
      This program generates an echo "add" in /sys/devices/system/cpu/cpu<x>/uevent,
      leading to the "kvm: disabled by bios" message in case of your Bios disabled
      the virtualization extensions.
      
      On a modern system running up to 256 CPU threads, this pollutes the Kernel logs.
      
      This patch offers to ratelimit this message to avoid any userspace program triggering
      this uevent printing this message too often.
      
      This patch is only a workaround but greatly reduce the pollution without
      breaking the current behavior of printing a message if some try to instantiate
      KVM on a system that doesn't support it.
      
      Note that recent versions of systemd (>239) do not have trigger this behavior.
      
      This patch will be useful at least for some using older systemd with recent Kernels.
      Signed-off-by: default avatarErwan Velu <e.velu@criteo.com>
      Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
      ef935c25
    • Rafael J. Wysocki's avatar
      Merge branches 'pm-sleep' and 'pm-devfreq' · 189c6967
      Rafael J. Wysocki authored
      * pm-sleep:
        PM / hibernate: fix typo "reserverd_size" -> "reserved_size"
        Documentation: power: Drop reference to interface.rst
      
      * pm-devfreq:
        Revert "PM / devfreq: Modify the device name as devfreq(X) for sysfs"
      189c6967
    • Paolo Bonzini's avatar
      KVM: x86: avoid useless copy of cpufreq policy · aaec7c03
      Paolo Bonzini authored
      struct cpufreq_policy is quite big and it is not a good idea
      to allocate one on the stack.  Just use cpufreq_cpu_get and
      cpufreq_cpu_put which is even simpler.
      Reported-by: default avatarChristoph Hellwig <hch@lst.de>
      Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
      aaec7c03
    • Paolo Bonzini's avatar
      KVM: allow disabling -Werror · 4f337faf
      Paolo Bonzini authored
      Restrict -Werror to well-tested configurations and allow disabling it
      via Kconfig.
      Reported-by: default avatarChristoph Hellwig <hch@lst.de>
      Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
      4f337faf
    • Valdis Klētnieks's avatar
      KVM: x86: allow compiling as non-module with W=1 · 575b255c
      Valdis Klētnieks authored
      Compile error with CONFIG_KVM_INTEL=y and W=1:
      
        CC      arch/x86/kvm/vmx/vmx.o
      arch/x86/kvm/vmx/vmx.c:68:32: error: 'vmx_cpu_id' defined but not used [-Werror=unused-const-variable=]
         68 | static const struct x86_cpu_id vmx_cpu_id[] = {
            |                                ^~~~~~~~~~
      cc1: all warnings being treated as errors
      
      When building with =y, the MODULE_DEVICE_TABLE macro doesn't generate a
      reference to the structure (or any code at all).  This makes W=1 compiles
      unhappy.
      
      Wrap both in a #ifdef to avoid the issue.
      Signed-off-by: default avatarValdis Kletnieks <valdis.kletnieks@vt.edu>
      [Do the same for CONFIG_KVM_AMD. - Paolo]
      Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
      575b255c
    • Wanpeng Li's avatar
      KVM: Pre-allocate 1 cpumask variable per cpu for both pv tlb and pv ipis · 8a9442f4
      Wanpeng Li authored
      Nick Desaulniers Reported:
      
        When building with:
        $ make CC=clang arch/x86/ CFLAGS=-Wframe-larger-than=1000
        The following warning is observed:
        arch/x86/kernel/kvm.c:494:13: warning: stack frame size of 1064 bytes in
        function 'kvm_send_ipi_mask_allbutself' [-Wframe-larger-than=]
        static void kvm_send_ipi_mask_allbutself(const struct cpumask *mask, int
        vector)
                    ^
        Debugging with:
        https://github.com/ClangBuiltLinux/frame-larger-than
        via:
        $ python3 frame_larger_than.py arch/x86/kernel/kvm.o \
          kvm_send_ipi_mask_allbutself
        points to the stack allocated `struct cpumask newmask` in
        `kvm_send_ipi_mask_allbutself`. The size of a `struct cpumask` is
        potentially large, as it's CONFIG_NR_CPUS divided by BITS_PER_LONG for
        the target architecture. CONFIG_NR_CPUS for X86_64 can be as high as
        8192, making a single instance of a `struct cpumask` 1024 B.
      
      This patch fixes it by pre-allocate 1 cpumask variable per cpu and use it for
      both pv tlb and pv ipis..
      Reported-by: default avatarNick Desaulniers <ndesaulniers@google.com>
      Acked-by: default avatarNick Desaulniers <ndesaulniers@google.com>
      Reviewed-by: default avatarVitaly Kuznetsov <vkuznets@redhat.com>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Nick Desaulniers <ndesaulniers@google.com>
      Signed-off-by: default avatarWanpeng Li <wanpengli@tencent.com>
      Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
      8a9442f4
    • Wanpeng Li's avatar
      KVM: Introduce pv check helpers · a262bca3
      Wanpeng Li authored
      Introduce some pv check helpers for consistency.
      Suggested-by: default avatarVitaly Kuznetsov <vkuznets@redhat.com>
      Reviewed-by: default avatarKonrad Rzeszutek Wilk <konrad.wilk@oracle.com>
      Signed-off-by: default avatarWanpeng Li <wanpengli@tencent.com>
      Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
      a262bca3
    • Christian Borntraeger's avatar
      KVM: let declaration of kvm_get_running_vcpus match implementation · fcd07f9a
      Christian Borntraeger authored
      Sparse notices that declaration and implementation do not match:
      arch/s390/kvm/../../../virt/kvm/kvm_main.c:4435:17: warning: incorrect type in return expression (different address spaces)
      arch/s390/kvm/../../../virt/kvm/kvm_main.c:4435:17:    expected struct kvm_vcpu [noderef] <asn:3> **
      arch/s390/kvm/../../../virt/kvm/kvm_main.c:4435:17:    got struct kvm_vcpu *[noderef] <asn:3> *
      Signed-off-by: default avatarChristian Borntraeger <borntraeger@de.ibm.com>
      Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
      fcd07f9a
    • Paolo Bonzini's avatar
      KVM: SVM: allocate AVIC data structures based on kvm_amd module parameter · 7943f4ac
      Paolo Bonzini authored
      Even if APICv is disabled at startup, the backing page and ir_list need
      to be initialized in case they are needed later.  The only case in
      which this can be skipped is for userspace irqchip, and that must be
      done because avic_init_backing_page dereferences vcpu->arch.apic
      (which is NULL for userspace irqchip).
      
      Tested-by: rmuncrief@humanavance.com
      Fixes: https://bugzilla.kernel.org/show_bug.cgi?id=206579Reviewed-by: default avatarMiaohe Lin <linmiaohe@huawei.com>
      Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
      7943f4ac
    • John Garry's avatar
      bus: hisi_lpc: Fixup IO ports addresses to avoid use-after-free in host removal · a6dd255b
      John Garry authored
      Some released ACPI FW for Huawei boards describes incorrect the port IO
      address range for child devices, in that it tells us the IO port max range
      is 0x3fff for each child device, which is not correct. The address range
      should be [e4:e8) or similar. With this incorrect upper range, the child
      device IO port resources overlap.
      
      As such, the kernel thinks that the LPC host serial device is a child of
      the IPMI device:
      
      root@(none)$ more /proc/ioports
      [...]
      00ffc0e3-00ffffff : hisi-lpc-ipmi.0.auto
        00ffc0e3-00ffc0e3 : ipmi_si
        00ffc0e4-00ffc0e4 : ipmi_si
        00ffc0e5-00ffc0e5 : ipmi_si
        00ffc2f7-00ffffff : serial8250.1.auto
          00ffc2f7-00ffc2fe : serial
      root@(none)$
      
      They should both be siblings. Note that these are logical PIO addresses,
      which have a direct mapping from the FW IO port ranges.
      
      This shows up as a real issue when we enable CONFIG_KASAN and
      CONFIG_DEBUG_TEST_DRIVER_REMOVE - we see use-after-free warnings in the
      host removal path:
      
      ==================================================================
      BUG: KASAN: use-after-free in release_resource+0x38/0xc8
      Read of size 8 at addr ffff0026accdbc38 by task swapper/0/1
      
      CPU: 2 PID: 1 Comm: swapper/0 Not tainted 5.5.0-rc6-00001-g68e186e77b5c-dirty #1593
      Hardware name: Huawei Taishan 2180 /D03, BIOS Hisilicon D03 IT20 Nemo 2.0 RC0 03/30/2018
      Call trace:
      dump_backtrace+0x0/0x290
      show_stack+0x14/0x20
      dump_stack+0xf0/0x14c
      print_address_description.isra.9+0x6c/0x3b8
      __kasan_report+0x12c/0x23c
      kasan_report+0xc/0x18
      __asan_load8+0x94/0xb8
      release_resource+0x38/0xc8
      platform_device_del.part.10+0x80/0xe0
      platform_device_unregister+0x20/0x38
      hisi_lpc_acpi_remove_subdev+0x10/0x20
      device_for_each_child+0xc8/0x128
      hisi_lpc_acpi_remove+0x4c/0xa8
      hisi_lpc_remove+0xbc/0xc0
      platform_drv_remove+0x3c/0x68
      really_probe+0x174/0x548
      driver_probe_device+0x7c/0x148
      device_driver_attach+0x94/0xa0
      __driver_attach+0xa4/0x110
      bus_for_each_dev+0xe8/0x158
      driver_attach+0x30/0x40
      bus_add_driver+0x234/0x2f0
      driver_register+0xbc/0x1d0
      __platform_driver_register+0x7c/0x88
      hisi_lpc_driver_init+0x18/0x20
      do_one_initcall+0xb4/0x258
      kernel_init_freeable+0x248/0x2c0
      kernel_init+0x10/0x118
      ret_from_fork+0x10/0x1c
      
      ...
      
      The issue here is that the kernel created an incorrect parent-child
      resource dependency between two devices, and references the false parent
      node when deleting the second child device, when it had been deleted
      already.
      
      Fix up the child device resources from FW to create proper IO port
      resource relationships for broken FW.
      
      With this, the IO port layout looks more healthy:
      
      root@(none)$ more /proc/ioports
      [...]
      00ffc0e3-00ffc0e7 : hisi-lpc-ipmi.0.auto
        00ffc0e3-00ffc0e3 : ipmi_si
        00ffc0e4-00ffc0e4 : ipmi_si
        00ffc0e5-00ffc0e5 : ipmi_si
      00ffc2f7-00ffc2ff : serial8250.1.auto
        00ffc2f7-00ffc2fe : serial
      Signed-off-by: default avatarJohn Garry <john.garry@huawei.com>
      Signed-off-by: default avatarWei Xu <xuwei5@hisilicon.com>
      a6dd255b
    • Linus Torvalds's avatar
      Merge tag 'drm-fixes-2020-02-28' of git://anongit.freedesktop.org/drm/drm · 45d0b75b
      Linus Torvalds authored
      Pull drm fixes from Dave Airlie:
       "Just some fixes for this week: amdgpu, radeon and i915.
      
        The main i915 one is a regression Gen7 (Ivybridge/Haswell), this moves
        them back from trying to use the full-ppgtt support to the aliasing
        version it used to use due to gpu hangs. Otherwise it's pretty quiet.
      
        amdgpu:
         - Drop DRIVER_USE_AGP
         - Fix memory leak in GPU reset
         - Resume fix for raven
      
        radeon:
         - Drop DRIVER_USE_AGP
      
        i915:
         - downgrade gen7 back to aliasing-ppgtt to avoid GPU hangs
         - shrinker fix
         - pmu leak and double free fixes
         - gvt user after free and virtual display reset fixes
         - randconfig build fix"
      
      * tag 'drm-fixes-2020-02-28' of git://anongit.freedesktop.org/drm/drm:
        drm/radeon: Inline drm_get_pci_dev
        drm/amdgpu: Drop DRIVER_USE_AGP
        drm/i915: Avoid recursing onto active vma from the shrinker
        drm/i915/pmu: Avoid using globals for PMU events
        drm/i915/pmu: Avoid using globals for CPU hotplug state
        drm/i915/gtt: Downgrade gen7 (ivb, byt, hsw) back to aliasing-ppgtt
        drm/i915: fix header test with GCOV
        amdgpu/gmc_v9: save/restore sdpif regs during S3
        drm/amdgpu: fix memory leak during TDR test(v2)
        drm/i915/gvt: Fix orphan vgpu dmabuf_objs' lifetime
        drm/i915/gvt: Separate display reset from ALL_ENGINES reset
      45d0b75b
    • Dave Airlie's avatar
      Merge tag 'drm-intel-fixes-2020-02-27' of... · f091bf39
      Dave Airlie authored
      Merge tag 'drm-intel-fixes-2020-02-27' of git://anongit.freedesktop.org/drm/drm-intel into drm-fixes
      
      drm/i915 fixes for v5.6-rc4:
      - downgrade gen7 back to aliasing-ppgtt to avoid GPU hangs
      - shrinker fix
      - pmu leak and double free fixes
      - gvt user after free and virtual display reset fixes
      - randconfig build fix
      Signed-off-by: default avatarDave Airlie <airlied@redhat.com>
      
      From: Jani Nikula <jani.nikula@intel.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/874kvcsh00.fsf@intel.com
      f091bf39
    • Dave Airlie's avatar
      Merge tag 'amd-drm-fixes-5.6-2020-02-26' of... · e180af19
      Dave Airlie authored
      Merge tag 'amd-drm-fixes-5.6-2020-02-26' of git://people.freedesktop.org/~agd5f/linux into drm-fixes
      
      amd-drm-fixes-5.6-2020-02-26:
      
      amdgpu:
      - Drop DRIVER_USE_AGP
      - Fix memory leak in GPU reset
      - Resume fix for raven
      
      radeon:
      - Drop DRIVER_USE_AGP
      Signed-off-by: default avatarDave Airlie <airlied@redhat.com>
      From: Alex Deucher <alexdeucher@gmail.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20200227034106.3912-1-alexander.deucher@amd.com
      e180af19
    • Linus Torvalds's avatar
      Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net · 7058b837
      Linus Torvalds authored
      Pull networking fixes from David Miller:
      
       1) Fix leak in nl80211 AP start where we leak the ACL memory, from
          Johannes Berg.
      
       2) Fix double mutex unlock in mac80211, from Andrei Otcheretianski.
      
       3) Fix RCU stall in ipset, from Jozsef Kadlecsik.
      
       4) Fix devlink locking in devlink_dpipe_table_register, from Madhuparna
          Bhowmik.
      
       5) Fix race causing TX hang in ll_temac, from Esben Haabendal.
      
       6) Stale eth hdr pointer in br_dev_xmit(), from Nikolay Aleksandrov.
      
       7) Fix TX hash calculation bounds checking wrt. tc rules, from Amritha
          Nambiar.
      
       8) Size netlink responses properly in schedule action code to take into
          consideration TCA_ACT_FLAGS. From Jiri Pirko.
      
       9) Fix firmware paths for mscc PHY driver, from Antoine Tenart.
      
      10) Don't register stmmac notifier multiple times, from Aaro Koskinen.
      
      11) Various rmnet bug fixes, from Taehee Yoo.
      
      12) Fix vsock deadlock in vsock transport release, from Stefano
          Garzarella.
      
      * git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net: (61 commits)
        net: dsa: mv88e6xxx: Fix masking of egress port
        mlxsw: pci: Wait longer before accessing the device after reset
        sfc: fix timestamp reconstruction at 16-bit rollover points
        vsock: fix potential deadlock in transport->release()
        unix: It's CONFIG_PROC_FS not CONFIG_PROCFS
        net: rmnet: fix packet forwarding in rmnet bridge mode
        net: rmnet: fix bridge mode bugs
        net: rmnet: use upper/lower device infrastructure
        net: rmnet: do not allow to change mux id if mux id is duplicated
        net: rmnet: remove rcu_read_lock in rmnet_force_unassociate_device()
        net: rmnet: fix suspicious RCU usage
        net: rmnet: fix NULL pointer dereference in rmnet_changelink()
        net: rmnet: fix NULL pointer dereference in rmnet_newlink()
        net: phy: marvell: don't interpret PHY status unless resolved
        mlx5: register lag notifier for init network namespace only
        unix: define and set show_fdinfo only if procfs is enabled
        hinic: fix a bug of rss configuration
        hinic: fix a bug of setting hw_ioctxt
        hinic: fix a irq affinity bug
        net/smc: check for valid ib_client_data
        ...
      7058b837
  7. 27 Feb, 2020 1 commit