14 Jan, 2021

5 commits

  • In order to debug critical domain and device power issues, it may be
    necessary to disallow certain idle states at runtime. Enable a vendor
    hook to check if a domain idle state is allowed for powering down the
    domain.

    Bug: 175718935
    Signed-off-by: Lina Iyer
    Change-Id: I403c0c7d272439fb338bbf54a346861559385047

    Lina Iyer
     
  • IOMMU_SYS_CACHE_ONLY_NWA allows buffers for non-coherent devices
    to be mapped with the correct memory attributes so that the buffers
    can be cached in the system cache, with a no write allocate cache policy.
    However, this property is only usable by drivers that invoke the
    IOMMU API directly; it is not usable by drivers that use the DMA API.

    Thus, introduce DMA_ATTR_SYS_CACHE_ONLY_NWA, so that drivers for
    non-coherent devices that use the DMA API can use it to specify if
    they want a buffer to be cached in the system cache.

    Bug: 176778547
    Change-Id: Ic812a1fb144a58deb4279c2bf121fc6cc4c3b208
    Signed-off-by: Isaac J. Manjarres

    Isaac J. Manjarres
     
  • IOMMU_SYS_CACHE_ONLY allows buffers for non-coherent devices
    to be mapped with the correct memory attributes so that the buffers
    can be cached in the system cache. However, this property
    is only usable by drivers that invoke the IOMMU API directly;
    it is not usable by drivers that use the DMA API.

    Thus, introduce DMA_ATTR_SYS_CACHE_ONLY, so that drivers for
    non-coherent devices that use the DMA API can use it to specify if
    they want a buffer to be cached in the system cache.

    Bug: 176778547
    Change-Id: I849d7a3f36b689afd2f6ee400507223fd6395158
    Signed-off-by: Isaac J. Manjarres

    Isaac J. Manjarres
     
  • Non-coherent devices on systems that support a system or
    last level cache may want to request that allocations be
    cached in the system cache. For memory that is allocated
    by the kernel, and used for DMA with devices, the memory
    attributes used for CPU access should match the memory
    attributes that will be used for device access.

    The memory attributes that need to be programmed into
    the MAIR for system cache usage are:

    0xf4 - Normal memory, outer write back read/write allocate,
    inner non-cacheable.

    There is currently no support for this memory attribute for
    CPU mappings, so add it.

    Bug: 176778547
    Change-Id: I3abc7becd408f20ac5499cbbe3c6c6f53f784107
    Signed-off-by: Isaac J. Manjarres

    Isaac J. Manjarres
     
  • Add following vendor hooks in ftrace oops path to allow
    vendor modules to get ftrace buffer data.

    1) android_vh_ftrace_oops_enter
    2) android_vh_ftrace_size_check
    3) android_vh_ftrace_format_check
    4) android_vh_ftrace_dump_buffer
    5) android_vh_ftrace_oops_exit

    Ftrace dump on oops can be controlled with kernel command
    line parameter ftrace_dump_on_oops.

    Bug: 177387994
    Change-Id: I898026bfc3e5c5c5ab1eaa0e86a019a6a720408e
    Signed-off-by: Prateek Sood
    Signed-off-by: Mukesh Ojha

    Prateek Sood
     

13 Jan, 2021

14 commits

  • Changes in 5.10.7
    i40e: Fix Error I40E_AQ_RC_EINVAL when removing VFs
    iavf: fix double-release of rtnl_lock
    net/sched: sch_taprio: ensure to reset/destroy all child qdiscs
    net: mvpp2: Add TCAM entry to drop flow control pause frames
    net: mvpp2: prs: fix PPPoE with ipv6 packet parse
    net: systemport: set dev->max_mtu to UMAC_MAX_MTU_SIZE
    ethernet: ucc_geth: fix use-after-free in ucc_geth_remove()
    ethernet: ucc_geth: set dev->max_mtu to 1518
    ionic: account for vlan tag len in rx buffer len
    atm: idt77252: call pci_disable_device() on error path
    net: mvpp2: Fix GoP port 3 Networking Complex Control configurations
    net: stmmac: dwmac-meson8b: ignore the second clock input
    ibmvnic: fix login buffer memory leak
    ibmvnic: continue fatal error reset after passive init
    net: ethernet: mvneta: Fix error handling in mvneta_probe
    qede: fix offload for IPIP tunnel packets
    virtio_net: Fix recursive call to cpus_read_lock()
    net/ncsi: Use real net-device for response handler
    net: ethernet: Fix memleak in ethoc_probe
    net-sysfs: take the rtnl lock when storing xps_cpus
    net-sysfs: take the rtnl lock when accessing xps_cpus_map and num_tc
    net-sysfs: take the rtnl lock when storing xps_rxqs
    net-sysfs: take the rtnl lock when accessing xps_rxqs_map and num_tc
    net: ethernet: ti: cpts: fix ethtool output when no ptp_clock registered
    tun: fix return value when the number of iovs exceeds MAX_SKB_FRAGS
    e1000e: Only run S0ix flows if shutdown succeeded
    e1000e: bump up timeout to wait when ME un-configures ULP mode
    Revert "e1000e: disable s0ix entry and exit flows for ME systems"
    e1000e: Export S0ix flags to ethtool
    bnxt_en: Check TQM rings for maximum supported value.
    net: mvpp2: fix pkt coalescing int-threshold configuration
    bnxt_en: Fix AER recovery.
    ipv4: Ignore ECN bits for fib lookups in fib_compute_spec_dst()
    net: sched: prevent invalid Scell_log shift count
    net: hns: fix return value check in __lb_other_process()
    erspan: fix version 1 check in gre_parse_header()
    net: hdlc_ppp: Fix issues when mod_timer is called while timer is running
    bareudp: set NETIF_F_LLTX flag
    bareudp: Fix use of incorrect min_headroom size
    vhost_net: fix ubuf refcount incorrectly when sendmsg fails
    r8169: work around power-saving bug on some chip versions
    net: dsa: lantiq_gswip: Enable GSWIP_MII_CFG_EN also for internal PHYs
    net: dsa: lantiq_gswip: Fix GSWIP_MII_CFG(p) register access
    CDC-NCM: remove "connected" log message
    ibmvnic: fix: NULL pointer dereference.
    net: usb: qmi_wwan: add Quectel EM160R-GL
    selftests: mlxsw: Set headroom size of correct port
    stmmac: intel: Add PCI IDs for TGL-H platform
    selftests/vm: fix building protection keys test
    block: add debugfs stanza for QUEUE_FLAG_NOWAIT
    workqueue: Kick a worker based on the actual activation of delayed works
    scsi: ufs: Fix wrong print message in dev_err()
    scsi: ufs-pci: Fix restore from S4 for Intel controllers
    scsi: ufs-pci: Ensure UFS device is in PowerDown mode for suspend-to-disk ->poweroff()
    scsi: ufs-pci: Fix recovery from hibernate exit errors for Intel controllers
    scsi: ufs-pci: Enable UFSHCD_CAP_RPM_AUTOSUSPEND for Intel controllers
    scsi: block: Introduce BLK_MQ_REQ_PM
    scsi: ide: Do not set the RQF_PREEMPT flag for sense requests
    scsi: ide: Mark power management requests with RQF_PM instead of RQF_PREEMPT
    scsi: scsi_transport_spi: Set RQF_PM for domain validation commands
    scsi: core: Only process PM requests if rpm_status != RPM_ACTIVE
    local64.h: make mandatory
    lib/genalloc: fix the overflow when size is too big
    depmod: handle the case of /sbin/depmod without /sbin in PATH
    scsi: ufs: Clear UAC for FFU and RPMB LUNs
    kbuild: don't hardcode depmod path
    Bluetooth: revert: hci_h5: close serdev device and free hu in h5_close
    scsi: block: Remove RQF_PREEMPT and BLK_MQ_REQ_PREEMPT
    scsi: block: Do not accept any requests while suspended
    crypto: ecdh - avoid buffer overflow in ecdh_set_secret()
    crypto: asym_tpm: correct zero out potential secrets
    powerpc: Handle .text.{hot,unlikely}.* in linker script
    Staging: comedi: Return -EFAULT if copy_to_user() fails
    staging: mt7621-dma: Fix a resource leak in an error handling path
    usb: gadget: enable super speed plus
    USB: cdc-acm: blacklist another IR Droid device
    USB: cdc-wdm: Fix use after free in service_outstanding_interrupt().
    usb: typec: intel_pmc_mux: Configure HPD first for HPD+IRQ request
    usb: dwc3: meson-g12a: disable clk on error handling path in probe
    usb: dwc3: gadget: Restart DWC3 gadget when enabling pullup
    usb: dwc3: gadget: Clear wait flag on dequeue
    usb: dwc3: ulpi: Use VStsDone to detect PHY regs access completion
    usb: dwc3: ulpi: Replace CPU-based busyloop with Protocol-based one
    usb: dwc3: ulpi: Fix USB2.0 HS/FS/LS PHY suspend regression
    usb: chipidea: ci_hdrc_imx: add missing put_device() call in usbmisc_get_init_data()
    USB: xhci: fix U1/U2 handling for hardware with XHCI_INTEL_HOST quirk set
    usb: usbip: vhci_hcd: protect shift size
    usb: uas: Add PNY USB Portable SSD to unusual_uas
    USB: serial: iuu_phoenix: fix DMA from stack
    USB: serial: option: add LongSung M5710 module support
    USB: serial: option: add Quectel EM160R-GL
    USB: yurex: fix control-URB timeout handling
    USB: usblp: fix DMA to stack
    ALSA: usb-audio: Fix UBSAN warnings for MIDI jacks
    usb: gadget: select CONFIG_CRC32
    USB: Gadget: dummy-hcd: Fix shift-out-of-bounds bug
    usb: gadget: f_uac2: reset wMaxPacketSize
    usb: gadget: function: printer: Fix a memory leak for interface descriptor
    usb: gadget: u_ether: Fix MTU size mismatch with RX packet size
    USB: gadget: legacy: fix return error code in acm_ms_bind()
    usb: gadget: Fix spinlock lockup on usb_function_deactivate
    usb: gadget: configfs: Preserve function ordering after bind failure
    usb: gadget: configfs: Fix use-after-free issue with udc_name
    USB: serial: keyspan_pda: remove unused variable
    hwmon: (amd_energy) fix allocation of hwmon_channel_info config
    mm: make wait_on_page_writeback() wait for multiple pending writebacks
    x86/mm: Fix leak of pmd ptlock
    KVM: x86/mmu: Use -1 to flag an undefined spte in get_mmio_spte()
    KVM: x86/mmu: Get root level from walkers when retrieving MMIO SPTE
    kvm: check tlbs_dirty directly
    KVM: x86/mmu: Ensure TDP MMU roots are freed after yield
    x86/resctrl: Use an IPI instead of task_work_add() to update PQR_ASSOC MSR
    x86/resctrl: Don't move a task to the same resource group
    blk-iocost: fix NULL iocg deref from racing against initialization
    ALSA: hda/via: Fix runtime PM for Clevo W35xSS
    ALSA: hda/conexant: add a new hda codec CX11970
    ALSA: hda/realtek - Fix speaker volume control on Lenovo C940
    ALSA: hda/realtek: Add mute LED quirk for more HP laptops
    ALSA: hda/realtek: Enable mute and micmute LED on HP EliteBook 850 G7
    ALSA: hda/realtek: Add two "Intel Reference board" SSID in the ALC256.
    iommu/vt-d: Move intel_iommu info from struct intel_svm to struct intel_svm_dev
    btrfs: qgroup: don't try to wait flushing if we're already holding a transaction
    btrfs: send: fix wrong file path when there is an inode with a pending rmdir
    Revert "device property: Keep secondary firmware node secondary by type"
    dmabuf: fix use-after-free of dmabuf's file->f_inode
    arm64: link with -z norelro for LLD or aarch64-elf
    drm/i915: clear the shadow batch
    drm/i915: clear the gpu reloc batch
    bcache: fix typo from SUUP to SUPP in features.h
    bcache: check unsupported feature sets for bcache register
    bcache: introduce BCH_FEATURE_INCOMPAT_LOG_LARGE_BUCKET_SIZE for large bucket
    net/mlx5e: Fix SWP offsets when vlan inserted by driver
    ARM: dts: OMAP3: disable AES on N950/N9
    netfilter: x_tables: Update remaining dereference to RCU
    netfilter: ipset: fix shift-out-of-bounds in htable_bits()
    netfilter: xt_RATEEST: reject non-null terminated string from userspace
    netfilter: nft_dynset: report EOPNOTSUPP on missing set feature
    dmaengine: idxd: off by one in cleanup code
    x86/mtrr: Correct the range check before performing MTRR type lookups
    KVM: x86: fix shift out of bounds reported by UBSAN
    xsk: Fix memory leak for failed bind
    rtlwifi: rise completion at the last step of firmware callback
    scsi: target: Fix XCOPY NAA identifier lookup
    Linux 5.10.7

    Signed-off-by: Greg Kroah-Hartman
    Change-Id: I1a7c195af35831fe362b027fe013c0c7e4dc20ea

    Greg Kroah-Hartman
     
  • Changes in 5.10.6
    Revert "drm/amd/display: Fix memory leaks in S3 resume"
    Revert "mtd: spinand: Fix OOB read"
    rtc: pcf2127: move watchdog initialisation to a separate function
    rtc: pcf2127: only use watchdog when explicitly available
    dt-bindings: rtc: add reset-source property
    kdev_t: always inline major/minor helper functions
    Bluetooth: Fix attempting to set RPA timeout when unsupported
    ALSA: hda/realtek - Modify Dell platform name
    ALSA: hda/hdmi: Fix incorrect mutex unlock in silent_stream_disable()
    drm/i915/tgl: Fix Combo PHY DPLL fractional divider for 38.4MHz ref clock
    scsi: ufs: Allow an error return value from ->device_reset()
    scsi: ufs: Re-enable WriteBooster after device reset
    RDMA/core: remove use of dma_virt_ops
    RDMA/siw,rxe: Make emulated devices virtual in the device tree
    fuse: fix bad inode
    perf: Break deadlock involving exec_update_mutex
    rwsem: Implement down_read_killable_nested
    rwsem: Implement down_read_interruptible
    exec: Transform exec_update_mutex into a rw_semaphore
    mwifiex: Fix possible buffer overflows in mwifiex_cmd_802_11_ad_hoc_start
    Linux 5.10.6

    Signed-off-by: Greg Kroah-Hartman
    Change-Id: Id4c57a151a1e8f2162163d2337b6055f04edbe9b

    Greg Kroah-Hartman
     
  • Fix an issue for non-GKI builds found by the 0-day test bot:

    kernel/sched/fair.c: In function 'select_task_rq_fair':
    >> kernel/sched/fair.c:6766:6: error: implicit declaration of function
    'trace_android_rvh_select_task_rq_fair_enabled';
    did you mean 'trace_android_rvh_select_task_rq_fair'?
    6766 | if (trace_android_rvh_select_task_rq_fair_enabled())
    | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    | trace_android_rvh_select_task_rq_fair
    cc1: some warnings being treated as errors

    Reported-by: kernel test robot
    Fixes: c7ba09ce6aa5 ("ANDROID: sched/fair: Sync task util for strf hook")
    Signed-off-by: Todd Kjos
    Change-Id: I1b15b9ada83dc5b2678cef3910a7aedc0d19f174

    Todd Kjos
     
  • Since the sugov traces were added in kernel/sched/cpufreq_schedutil.c,
    move it from power.h to sched.h.
    And move the tracepoint to where the change happens.

    Bug: 174488007
    Test: build pass and boot to home
    Signed-off-by: Jimmy Shiu
    Change-Id: Ibe18f04773c28be84db3619b1a4253bf08f0e289
    Signed-off-by: Will McVicker

    Jimmy Shiu
     
  • There is currently support for non-coherent devices to use the system
    cache for their buffers by mapping the buffer with the IOMMU_SYS_CACHE_ONLY
    protection flag. The IOMMU_SYS_CACHE_ONLY_FLAG maps the buffers with
    a RW-allocate cache policy by default.

    There are usecases that do not benefit from having a RW allocate policy,
    but instead benefit from a no write allocate (NWA) policy, while using
    the system cache.

    Thus, add support for mapping memory with the attributes required
    for it to be cached in the system cached, with a NWA policy:

    MAIR: 0xe4: inner non-cacheable, outer write-back read allocate.

    Bug: 176778547
    Change-Id: I6d2700a19f0f2e61905b3d36b15f60db3ae59b73
    Signed-off-by: Isaac J. Manjarres

    Isaac J. Manjarres
     
  • commit b16671e8f493e3df40b1fb0dff4078f391c5099a upstream.

    When large bucket feature was added, BCH_FEATURE_INCOMPAT_LARGE_BUCKET
    was introduced into the incompat feature set. It used bucket_size_hi
    (which was added at the tail of struct cache_sb_disk) to extend current
    16bit bucket size to 32bit with existing bucket_size in struct
    cache_sb_disk.

    This is not a good idea, there are two obvious problems,
    - Bucket size is always value power of 2, if store log2(bucket size) in
    existing bucket_size of struct cache_sb_disk, it is unnecessary to add
    bucket_size_hi.
    - Macro csum_set() assumes d[SB_JOURNAL_BUCKETS] is the last member in
    struct cache_sb_disk, bucket_size_hi was added after d[] which makes
    csum_set calculate an unexpected super block checksum.

    To fix the above problems, this patch introduces a new incompat feature
    bit BCH_FEATURE_INCOMPAT_LOG_LARGE_BUCKET_SIZE, when this bit is set, it
    means bucket_size in struct cache_sb_disk stores the order of power-of-2
    bucket size value. When user specifies a bucket size larger than 32768
    sectors, BCH_FEATURE_INCOMPAT_LOG_LARGE_BUCKET_SIZE will be set to
    incompat feature set, and bucket_size stores log2(bucket size) more
    than store the real bucket size value.

    The obsoleted BCH_FEATURE_INCOMPAT_LARGE_BUCKET won't be used anymore,
    it is renamed to BCH_FEATURE_INCOMPAT_OBSO_LARGE_BUCKET and still only
    recognized by kernel driver for legacy compatible purpose. The previous
    bucket_size_hi is renmaed to obso_bucket_size_hi in struct cache_sb_disk
    and not used in bcache-tools anymore.

    For cache device created with BCH_FEATURE_INCOMPAT_LARGE_BUCKET feature,
    bcache-tools and kernel driver still recognize the feature string and
    display it as "obso_large_bucket".

    With this change, the unnecessary extra space extend of bcache on-disk
    super block can be avoided, and csum_set() may generate expected check
    sum as well.

    Fixes: ffa470327572 ("bcache: add bucket_size_hi into struct cache_sb_disk for large bucket")
    Signed-off-by: Coly Li
    Cc: stable@vger.kernel.org # 5.9+
    Signed-off-by: Jens Axboe
    Signed-off-by: Greg Kroah-Hartman

    Coly Li
     
  • commit 9ad9f45b3b91162b33abfe175ae75ab65718dbf5 upstream.

    'struct intel_svm' is shared by all devices bound to a give process,
    but records only a single pointer to a 'struct intel_iommu'. Consequently,
    cache invalidations may only be applied to a single DMAR unit, and are
    erroneously skipped for the other devices.

    In preparation for fixing this, rework the structures so that the iommu
    pointer resides in 'struct intel_svm_dev', allowing 'struct intel_svm'
    to track them in its device list.

    Fixes: 1c4f88b7f1f9 ("iommu/vt-d: Shared virtual address in scalable mode")
    Cc: Lu Baolu
    Cc: Jacob Pan
    Cc: Raj Ashok
    Cc: David Woodhouse
    Reported-by: Guo Kaijie
    Reported-by: Xin Zeng
    Signed-off-by: Guo Kaijie
    Signed-off-by: Xin Zeng
    Signed-off-by: Liu Yi L
    Tested-by: Guo Kaijie
    Cc: stable@vger.kernel.org # v5.0+
    Acked-by: Lu Baolu
    Link: https://lore.kernel.org/r/1609949037-25291-2-git-send-email-yi.l.liu@intel.com
    Signed-off-by: Will Deacon
    Signed-off-by: Greg Kroah-Hartman

    Liu Yi L
     
  • [ Upstream commit 52abca64fd9410ea6c9a3a74eab25663b403d7da ]

    blk_queue_enter() accepts BLK_MQ_REQ_PM requests independent of the runtime
    power management state. Now that SCSI domain validation no longer depends
    on this behavior, modify the behavior of blk_queue_enter() as follows:

    - Do not accept any requests while suspended.

    - Only process power management requests while suspending or resuming.

    Submitting BLK_MQ_REQ_PM requests to a device that is runtime suspended
    causes runtime-suspended devices not to resume as they should. The request
    which should cause a runtime resume instead gets issued directly, without
    resuming the device first. Of course the device can't handle it properly,
    the I/O fails, and the device remains suspended.

    The problem is fixed by checking that the queue's runtime-PM status isn't
    RPM_SUSPENDED before allowing a request to be issued, and queuing a
    runtime-resume request if it is. In particular, the inline
    blk_pm_request_resume() routine is renamed blk_pm_resume_queue() and the
    code is unified by merging the surrounding checks into the routine. If the
    queue isn't set up for runtime PM, or there currently is no restriction on
    allowed requests, the request is allowed. Likewise if the BLK_MQ_REQ_PM
    flag is set and the status isn't RPM_SUSPENDED. Otherwise a runtime resume
    is queued and the request is blocked until conditions are more suitable.

    [ bvanassche: modified commit message and removed Cc: stable because
    without the previous patches from this series this patch would break
    parallel SCSI domain validation + introduced queue_rpm_status() ]

    Link: https://lore.kernel.org/r/20201209052951.16136-9-bvanassche@acm.org
    Cc: Jens Axboe
    Cc: Christoph Hellwig
    Cc: Hannes Reinecke
    Cc: Can Guo
    Cc: Stanley Chu
    Cc: Ming Lei
    Cc: Rafael J. Wysocki
    Reported-and-tested-by: Martin Kepplinger
    Reviewed-by: Hannes Reinecke
    Reviewed-by: Can Guo
    Signed-off-by: Alan Stern
    Signed-off-by: Bart Van Assche
    Signed-off-by: Martin K. Petersen
    Signed-off-by: Sasha Levin

    Alan Stern
     
  • [ Upstream commit a4d34da715e3cb7e0741fe603dcd511bed067e00 ]

    Remove flag RQF_PREEMPT and BLK_MQ_REQ_PREEMPT since these are no longer
    used by any kernel code.

    Link: https://lore.kernel.org/r/20201209052951.16136-8-bvanassche@acm.org
    Cc: Can Guo
    Cc: Stanley Chu
    Cc: Alan Stern
    Cc: Ming Lei
    Cc: Rafael J. Wysocki
    Cc: Martin Kepplinger
    Reviewed-by: Christoph Hellwig
    Reviewed-by: Hannes Reinecke
    Reviewed-by: Jens Axboe
    Reviewed-by: Can Guo
    Signed-off-by: Bart Van Assche
    Signed-off-by: Martin K. Petersen
    Signed-off-by: Sasha Levin

    Bart Van Assche
     
  • [ Upstream commit 87dbc209ea04645fd2351981f09eff5d23f8e2e9 ]

    Make mandatory in include/asm-generic/Kbuild and
    remove all arch/*/include/asm/local64.h arch-specific files since they
    only #include .

    This fixes build errors on arch/c6x/ and arch/nios2/ for
    block/blk-iocost.c.

    Build-tested on 21 of 25 arch-es. (tools problems on the others)

    Yes, we could even rename to
    and change all #includes to use
    instead.

    Link: https://lkml.kernel.org/r/20201227024446.17018-1-rdunlap@infradead.org
    Signed-off-by: Randy Dunlap
    Suggested-by: Christoph Hellwig
    Reviewed-by: Masahiro Yamada
    Cc: Jens Axboe
    Cc: Ley Foon Tan
    Cc: Mark Salter
    Cc: Aurelien Jacquiot
    Cc: Peter Zijlstra
    Cc: Arnd Bergmann
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds
    Signed-off-by: Sasha Levin

    Randy Dunlap
     
  • [ Upstream commit 0854bcdcdec26aecdc92c303816f349ee1fba2bc ]

    Introduce the BLK_MQ_REQ_PM flag. This flag makes the request allocation
    functions set RQF_PM. This is the first step towards removing
    BLK_MQ_REQ_PREEMPT.

    Link: https://lore.kernel.org/r/20201209052951.16136-3-bvanassche@acm.org
    Cc: Alan Stern
    Cc: Stanley Chu
    Cc: Ming Lei
    Cc: Rafael J. Wysocki
    Cc: Can Guo
    Reviewed-by: Christoph Hellwig
    Reviewed-by: Hannes Reinecke
    Reviewed-by: Jens Axboe
    Reviewed-by: Can Guo
    Signed-off-by: Bart Van Assche
    Signed-off-by: Martin K. Petersen
    Signed-off-by: Sasha Levin

    Bart Van Assche
     
  • [ Upstream commit bd1248f1ddbc48b0c30565fce897a3b6423313b8 ]

    Check Scell_log shift size in red_check_params() and modify all callers
    of red_check_params() to pass Scell_log.

    This prevents a shift out-of-bounds as detected by UBSAN:
    UBSAN: shift-out-of-bounds in ./include/net/red.h:252:22
    shift exponent 72 is too large for 32-bit type 'int'

    Fixes: 8afa10cbe281 ("net_sched: red: Avoid illegal values")
    Signed-off-by: Randy Dunlap
    Reported-by: syzbot+97c5bd9cc81eca63d36e@syzkaller.appspotmail.com
    Cc: Nogah Frankel
    Cc: Jamal Hadi Salim
    Cc: Cong Wang
    Cc: Jiri Pirko
    Cc: netdev@vger.kernel.org
    Cc: "David S. Miller"
    Cc: Jakub Kicinski
    Signed-off-by: David S. Miller
    Signed-off-by: Greg Kroah-Hartman

    Randy Dunlap
     
  • Memory hotplugging is allowed only for multiples of section sizes.
    Section size could be huge (ex. 1GB for arm64 targets) thus limiting
    to add/remove lower chunks of memory. This patch allows drivers to add
    memory of subsection sizes which are then added to memblock. This does
    not create a separate memblock device nodes for newly added subsections
    until the whole of the memblock section is added.

    Bug: 170460867
    Change-Id: I15749b5320340cba4d526e7ddb26a9cd6029c690
    Signed-off-by: Sudarshan Rajagopalan

    Sudarshan Rajagopalan
     
  • There are out of tree drivers which need IOMMU_SYS_CACHE_ONLY
    to be able to cache their data buffers in the system cache,
    so restore it.

    Bug: 176778547
    Change-Id: Ic632a6f5951f9917e6006088b065fdbaf4e1b374
    Signed-off-by: Isaac J. Manjarres

    Isaac J. Manjarres
     

12 Jan, 2021

3 commits

  • Add support for IOMMU drivers to have their own map_sg() callbacks.
    This completes the path for having iommu_map_sg() invoke an IOMMU
    driver's map_sg() callback, which can then invoke the io-pgtable
    map_sg() callback with the entire scatter-gather list, so that it
    can be processed entirely in the io-pgtable layer.

    For IOMMU drivers that do not provide a callback, the default
    implementation of iterating through the scatter-gather list, while
    calling iommu_map() will be used.

    Bug: 176779203
    Link: https://lore.kernel.org/linux-iommu/1610376862-927-1-git-send-email-isaacm@codeaurora.org/T/#t
    Change-Id: I3d5a8a9e8648649d8dcdda3fa1df41d72f87a528
    Signed-off-by: Isaac J. Manjarres
    Tested-by: Sai Prakash Ranjan

    Isaac J. Manjarres
     
  • While mapping a scatter-gather list, iommu_map_sg() calls
    into the IOMMU driver through an indirect call, which can
    call into the io-pgtable code through another indirect call.

    This sequence of going through the IOMMU core code, the IOMMU
    driver, and finally the io-pgtable code, occurs for every
    element in the scatter-gather list, in the worse case, which
    is not optimal.

    Introduce a map_sg callback in the io-pgtable ops so that
    IOMMU drivers can invoke it with the complete scatter-gather
    list, so that it can be processed within the io-pgtable
    code entirely, reducing the number of indirect calls, and
    boosting overall iommu_map_sg() performance.

    Bug: 176779203
    Link: https://lore.kernel.org/linux-iommu/1610376862-927-1-git-send-email-isaacm@codeaurora.org/T/#t
    Change-Id: I4b2088dd08eb97dcd94a6c6968082a3c4395351a
    Signed-off-by: Isaac J. Manjarres
    Tested-by: Sai Prakash Ranjan

    Isaac J. Manjarres
     
  • Add register read/write operations tracing support.
    ftrace events helps to trace register read and write
    location details of memory mapped IO registers.
    These trace logs helps to debug un clocked access
    of peripherals.

    Bug: 169045115
    Change-Id: I849bf75b84c24c8f3e9d2e8fba34a10ddcf4aaca
    Signed-off-by: Prasad Sodagudi

    Prasad Sodagudi
     

10 Jan, 2021

1 commit

  • Changes in 5.10.5
    net/sched: sch_taprio: reset child qdiscs before freeing them
    mptcp: fix security context on server socket
    ethtool: fix error paths in ethnl_set_channels()
    ethtool: fix string set id check
    md/raid10: initialize r10_bio->read_slot before use.
    drm/amd/display: Add get_dig_frontend implementation for DCEx
    io_uring: close a small race gap for files cancel
    jffs2: Allow setting rp_size to zero during remounting
    jffs2: Fix NULL pointer dereference in rp_size fs option parsing
    spi: dw-bt1: Fix undefined devm_mux_control_get symbol
    opp: fix memory leak in _allocate_opp_table
    opp: Call the missing clk_put() on error
    scsi: block: Fix a race in the runtime power management code
    mm/hugetlb: fix deadlock in hugetlb_cow error path
    mm: memmap defer init doesn't work as expected
    lib/zlib: fix inflating zlib streams on s390
    io_uring: don't assume mm is constant across submits
    io_uring: use bottom half safe lock for fixed file data
    io_uring: add a helper for setting a ref node
    io_uring: fix io_sqe_files_unregister() hangs
    uapi: move constants from to
    tools headers UAPI: Sync linux/const.h with the kernel headers
    cgroup: Fix memory leak when parsing multiple source parameters
    zlib: move EXPORT_SYMBOL() and MODULE_LICENSE() out of dfltcc_syms.c
    scsi: cxgb4i: Fix TLS dependency
    Bluetooth: hci_h5: close serdev device and free hu in h5_close
    fbcon: Disable accelerated scrolling
    reiserfs: add check for an invalid ih_entry_count
    misc: vmw_vmci: fix kernel info-leak by initializing dbells in vmci_ctx_get_chkpt_doorbells()
    media: gp8psk: initialize stats at power control logic
    f2fs: fix shift-out-of-bounds in sanity_check_raw_super()
    ALSA: seq: Use bool for snd_seq_queue internal flags
    ALSA: rawmidi: Access runtime->avail always in spinlock
    bfs: don't use WARNING: string when it's just info.
    ext4: check for invalid block size early when mounting a file system
    fcntl: Fix potential deadlock in send_sig{io, urg}()
    io_uring: check kthread stopped flag when sq thread is unparked
    rtc: sun6i: Fix memleak in sun6i_rtc_clk_init
    module: set MODULE_STATE_GOING state when a module fails to load
    quota: Don't overflow quota file offsets
    rtc: pl031: fix resource leak in pl031_probe
    powerpc: sysdev: add missing iounmap() on error in mpic_msgr_probe()
    i3c master: fix missing destroy_workqueue() on error in i3c_master_register
    NFSv4: Fix a pNFS layout related use-after-free race when freeing the inode
    f2fs: avoid race condition for shrinker count
    f2fs: fix race of pending_pages in decompression
    module: delay kobject uevent until after module init call
    powerpc/64: irq replay remove decrementer overflow check
    fs/namespace.c: WARN if mnt_count has become negative
    watchdog: rti-wdt: fix reference leak in rti_wdt_probe
    um: random: Register random as hwrng-core device
    um: ubd: Submit all data segments atomically
    NFSv4.2: Don't error when exiting early on a READ_PLUS buffer overflow
    ceph: fix inode refcount leak when ceph_fill_inode on non-I_NEW inode fails
    drm/amd/display: updated wm table for Renoir
    tick/sched: Remove bogus boot "safety" check
    s390: always clear kernel stack backchain before calling functions
    io_uring: remove racy overflow list fast checks
    ALSA: pcm: Clear the full allocated memory at hw_params
    dm verity: skip verity work if I/O error when system is shutting down
    ext4: avoid s_mb_prefetch to be zero in individual scenarios
    device-dax: Fix range release
    Linux 5.10.5

    Signed-off-by: Greg Kroah-Hartman
    Change-Id: I2b481bfac06bafdef2cf3cc1ac2c2a4ddf9913dc

    Greg Kroah-Hartman
     

09 Jan, 2021

7 commits

  • [ Upstream commit f7cfd871ae0c5008d94b6f66834e7845caa93c15 ]

    Recently syzbot reported[0] that there is a deadlock amongst the users
    of exec_update_mutex. The problematic lock ordering found by lockdep
    was:

    perf_event_open (exec_update_mutex -> ovl_i_mutex)
    chown (ovl_i_mutex -> sb_writes)
    sendfile (sb_writes -> p->lock)
    by reading from a proc file and writing to overlayfs
    proc_pid_syscall (p->lock -> exec_update_mutex)

    While looking at possible solutions it occured to me that all of the
    users and possible users involved only wanted to state of the given
    process to remain the same. They are all readers. The only writer is
    exec.

    There is no reason for readers to block on each other. So fix
    this deadlock by transforming exec_update_mutex into a rw_semaphore
    named exec_update_lock that only exec takes for writing.

    Cc: Jann Horn
    Cc: Vasiliy Kulikov
    Cc: Al Viro
    Cc: Bernd Edlinger
    Cc: Oleg Nesterov
    Cc: Christopher Yeoh
    Cc: Cyrill Gorcunov
    Cc: Sargun Dhillon
    Cc: Christian Brauner
    Cc: Arnd Bergmann
    Cc: Peter Zijlstra
    Cc: Ingo Molnar
    Cc: Arnaldo Carvalho de Melo
    Fixes: eea9673250db ("exec: Add exec_update_mutex to replace cred_guard_mutex")
    [0] https://lkml.kernel.org/r/00000000000063640c05ade8e3de@google.com
    Reported-by: syzbot+db9cdf3dd1f64252c6ef@syzkaller.appspotmail.com
    Link: https://lkml.kernel.org/r/87ft4mbqen.fsf@x220.int.ebiederm.org
    Signed-off-by: Eric W. Biederman
    Signed-off-by: Sasha Levin

    Eric W. Biederman
     
  • [ Upstream commit 31784cff7ee073b34d6eddabb95e3be2880a425c ]

    In preparation for converting exec_update_mutex to a rwsem so that
    multiple readers can execute in parallel and not deadlock, add
    down_read_interruptible. This is needed for perf_event_open to be
    converted (with no semantic changes) from working on a mutex to
    wroking on a rwsem.

    Signed-off-by: Eric W. Biederman
    Signed-off-by: Peter Zijlstra (Intel)
    Link: https://lkml.kernel.org/r/87k0tybqfy.fsf@x220.int.ebiederm.org
    Signed-off-by: Sasha Levin

    Eric W. Biederman
     
  • [ Upstream commit 0f9368b5bf6db0c04afc5454b1be79022a681615 ]

    In preparation for converting exec_update_mutex to a rwsem so that
    multiple readers can execute in parallel and not deadlock, add
    down_read_killable_nested. This is needed so that kcmp_lock
    can be converted from working on a mutexes to working on rw_semaphores.

    Signed-off-by: Eric W. Biederman
    Signed-off-by: Peter Zijlstra (Intel)
    Link: https://lkml.kernel.org/r/87o8jabqh3.fsf@x220.int.ebiederm.org
    Signed-off-by: Sasha Levin

    Eric W. Biederman
     
  • [ Upstream commit 5a7a9e038b032137ae9c45d5429f18a2ffdf7d42 ]

    Use the ib_dma_* helpers to skip the DMA translation instead. This
    removes the last user if dma_virt_ops and keeps the weird layering
    violation inside the RDMA core instead of burderning the DMA mapping
    subsystems with it. This also means the software RDMA drivers now don't
    have to mess with DMA parameters that are not relevant to them at all, and
    that in the future we can use PCI P2P transfers even for software RDMA, as
    there is no first fake layer of DMA mapping that the P2P DMA support.

    Link: https://lore.kernel.org/r/20201106181941.1878556-8-hch@lst.de
    Signed-off-by: Christoph Hellwig
    Tested-by: Mike Marciniszyn
    Signed-off-by: Jason Gunthorpe
    Signed-off-by: Sasha Levin

    Christoph Hellwig
     
  • commit aa8c7db494d0a83ecae583aa193f1134ef25d506 upstream.

    Silly GCC doesn't always inline these trivial functions.

    Fixes the following warning:

    arch/x86/kernel/sys_ia32.o: warning: objtool: cp_stat64()+0xd8: call to new_encode_dev() with UACCESS enabled

    Link: https://lkml.kernel.org/r/984353b44a4484d86ba9f73884b7306232e25e30.1608737428.git.jpoimboe@redhat.com
    Signed-off-by: Josh Poimboeuf
    Reported-by: Randy Dunlap
    Acked-by: Randy Dunlap [build-tested]
    Cc: Peter Zijlstra
    Cc: Greg Kroah-Hartman
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds
    Signed-off-by: Greg Kroah-Hartman

    Josh Poimboeuf
     
  • Only kill a task with a negative ADJ score if there are no tasks with
    non-negative ADJ scores. Otherwise, kill the task with the most
    badness points whose ADJ score is also positive, if such a suitable
    task exists.

    Bug: 173837271
    Signed-off-by: Chris Goldsworthy
    Change-Id: I70fe48a3eeb853085bb1acfb422f88cd36d1f14d

    Chris Goldsworthy
     
  • "flags" is added to the vendor hook parameter so that the module can know
    the event type of task enqueue/dequeue.

    Bug: 176917922

    Signed-off-by: Park Bumgyu
    Change-Id: I7cc60908e301d75393bdf84861878a94de80d683

    Park Bumgyu
     

08 Jan, 2021

6 commits

  • Add vendors hooks for to facilitate various scheduler value adds.

    Bug: 176077958
    Change-Id: I5d488ae78ce05f81e6c73b69c56128b065647fec
    Signed-off-by: Shaleen Agrawal

    Shaleen Agrawal
     
  • Use scs_alloc() to allocate also IRQ and SDEI shadow stacks instead of
    using statically allocated stacks.

    Bug: 169781940
    Change-Id: If3f38d603a7c1e8ebcf1e8655b70fa6bfde7c48d
    (cherry picked from commit ac20ffbb0279aae7be48567fb734eae7d050769e)
    Signed-off-by: Sami Tolvanen
    Acked-by: Will Deacon
    Link: https://lore.kernel.org/r/20201130233442.2562064-3-samitolvanen@google.com
    [will: Move CONFIG_SHADOW_CALL_STACK check into init_irq_scs()]
    Signed-off-by: Will Deacon

    Sami Tolvanen
     
  • The kernel currently uses kmem_cache to allocate shadow call stacks,
    which means an overflows may not be immediately detected and can
    potentially result in another task's shadow stack to be overwritten.

    This change switches SCS to use virtually mapped shadow stacks for
    tasks, which increases shadow stack size to a full page and provides
    more robust overflow detection, similarly to VMAP_STACK.

    Bug: 169781940
    Change-Id: I92c8f5706c11e4bf45b071e4f302a65502faa1e1
    (cherry picked from commit a2abe7cbd8fe2db5ff386c968e2273d9dc6c468d)
    Signed-off-by: Sami Tolvanen
    Acked-by: Will Deacon
    Link: https://lore.kernel.org/r/20201130233442.2562064-2-samitolvanen@google.com
    Signed-off-by: Will Deacon

    Sami Tolvanen
     
  • At present, EAS gets disabled when on ASYM Capacity systems
    if all BIG or Little CPUs gets hot-plugged. Instead of disabling
    EAS by default, add trace hook and let vendor decide if EAS should
    be disabled or not.

    Bug: 176964092
    Change-Id: I583272cc89d44f3e3a4b1c43e3f75d731092ebf6
    Signed-off-by: Satya Durga Srinivasu Prabhala

    Satya Durga Srinivasu Prabhala
     
  • A task can migrate either while it is waking or while it
    is running via load balancer. Print the task status
    i.e running or not in sched_migrate_task. This helps in
    counting the different types of migrations without relying
    on other trace events.

    Bug: 176709810
    Change-Id: Ib473f9ccdc78003bb1f5d2dc24354f2db7a684f5
    Signed-off-by: Pavankumar Kondeti
    Signed-off-by: Satya Durga Srinivasu Prabhala

    Pavankumar Kondeti
     
  • When the sum of the utilization of CPUs in a power domain is zero,
    return the energy as 0 without doing any computations.

    Acked-by: Quentin Perret
    Reviewed-by: Dietmar Eggemann
    Signed-off-by: Pavankumar Kondeti
    Signed-off-by: Rafael J. Wysocki

    (cherry picked from commit 9cc7e96aa846f9086431d6c2d33ff9ab42d72b2d)
    Bug: 173981595
    Signed-off-by: Pavankumar Kondeti
    Change-Id: I9b1a83d210c30a8a86da26f94ac0c2f855d2ed10

    Pavankumar Kondeti
     

07 Jan, 2021

4 commits

  • Add vendor hook tracepoints to track when cpu util gets
    updated and when freq is choosen.

    Bug: 174488007
    Signed-off-by: Saravana Kannan
    Signed-off-by: Rohit Gupta
    Signed-off-by: Jonathan Avila
    Signed-off-by: Jimmy Shiu
    Change-Id: Ibb22fd0337a2539820a05b1e6b54b09aeaebd040
    Signed-off-by: Will McVicker

    Jimmy Shiu
     
  • Free the pages parallely for a task that receives SIGKILL, from ULMK
    process, using the oom_reaper. This freeing of pages will help to give
    the pages to buddy system well advance.

    Add the boot param, reap_mem_when_killed_by=, that configures the
    process name, the kill signal to a process from which makes its memory
    reaped by oom reaper.

    As an example, when reap_mem_when_killed_by=lmkd, then all the processes
    that receives the kill signal from lmkd is added to oom reaper.

    Not initializing this param makes this feature disabled.

    Change-Id: I21adb95de5e380a80d7eb0b87d9b5b553f52e28a
    Bug: 171763461
    Signed-off-by: Charan Teja Reddy
    Signed-off-by: Isaac J. Manjarres

    Charan Teja Reddy
     
  • * aosp/upstream-f2fs-stable-linux-5.10.y:
    fs-verity: move structs needed for file signing to UAPI header
    fs-verity: rename "file measurement" to "file digest"
    fs-verity: rename fsverity_signed_digest to fsverity_formatted_digest
    fs-verity: remove filenames from file comments
    fscrypt: allow deleting files with unsupported encryption policy
    fscrypt: unexport fscrypt_get_encryption_info()
    fscrypt: move fscrypt_require_key() to fscrypt_private.h
    fscrypt: move body of fscrypt_prepare_setattr() out-of-line
    fscrypt: introduce fscrypt_prepare_readdir()
    ext4: don't call fscrypt_get_encryption_info() from dx_show_leaf()
    ubifs: remove ubifs_dir_open()
    f2fs: remove f2fs_dir_open()
    ext4: remove ext4_dir_open()
    fscrypt: simplify master key locking
    fscrypt: remove unnecessary calls to fscrypt_require_key()
    ubifs: prevent creating duplicate encrypted filenames
    f2fs: prevent creating duplicate encrypted filenames
    ext4: prevent creating duplicate encrypted filenames
    fscrypt: add fscrypt_is_nokey_name()
    fscrypt: remove kernel-internal constants from UAPI header

    Conflicts:
    fs/crypto/hooks.c

    Bug: 174873661
    Signed-off-by: Jaegeuk Kim
    Change-Id: Id56d42fc959242524628752223e9d773a2c8681c

    Jaegeuk Kim
     
  • Export get_page_owner symbol for loadable vendor
    modules.

    Bug: 176277889
    Change-Id: Iea0a8022e542d1223caf4a742a888647828ca7cc
    Signed-off-by: Vijayanand Jitta

    Vijayanand Jitta