Forum | Documentation | Website | Blog

Skip to content
Snippets Groups Projects
  1. Jan 06, 2022
    • Oleksandr Tyshchenko's avatar
      arm/xen: Read extended regions from DT and init Xen resource · b2371587
      Oleksandr Tyshchenko authored
      
      This patch implements arch_xen_unpopulated_init() on Arm where
      the extended regions (if any) are gathered from DT and inserted
      into specific Xen resource to be used as unused address space
      for Xen scratch pages by unpopulated-alloc code.
      
      The extended region (safe range) is a region of guest physical
      address space which is unused and could be safely used to create
      grant/foreign mappings instead of wasting real RAM pages from
      the domain memory for establishing these mappings.
      
      The extended regions are chosen by the hypervisor at the domain
      creation time and advertised to it via "reg" property under
      hypervisor node in the guest device-tree. As region 0 is reserved
      for grant table space (always present), the indexes for extended
      regions are 1...N.
      
      If arch_xen_unpopulated_init() fails for some reason the default
      behaviour will be restored (allocate xenballooned pages).
      
      This patch also removes XEN_UNPOPULATED_ALLOC dependency on x86.
      
      Signed-off-by: default avatarOleksandr Tyshchenko <oleksandr_tyshchenko@epam.com>
      Reviewed-by: default avatarStefano Stabellini <sstabellini@kernel.org>
      Link: https://lore.kernel.org/r/1639080336-26573-6-git-send-email-olekstysh@gmail.com
      
      
      Signed-off-by: default avatarJuergen Gross <jgross@suse.com>
      b2371587
    • Oleksandr Tyshchenko's avatar
      xen/unpopulated-alloc: Add mechanism to use Xen resource · d1a928ea
      Oleksandr Tyshchenko authored
      
      The main reason of this change is that unpopulated-alloc
      code cannot be used in its current form on Arm, but there
      is a desire to reuse it to avoid wasting real RAM pages
      for the grant/foreign mappings.
      
      The problem is that system "iomem_resource" is used for
      the address space allocation, but the really unallocated
      space can't be figured out precisely by the domain on Arm
      without hypervisor involvement. For example, not all device
      I/O regions are known by the time domain starts creating
      grant/foreign mappings. And following the advise from
      "iomem_resource" we might end up reusing these regions by
      a mistake. So, the hypervisor which maintains the P2M for
      the domain is in the best position to provide unused regions
      of guest physical address space which could be safely used
      to create grant/foreign mappings.
      
      Introduce new helper arch_xen_unpopulated_init() which purpose
      is to create specific Xen resource based on the memory regions
      provided by the hypervisor to be used as unused space for Xen
      scratch pages. If arch doesn't define arch_xen_unpopulated_init()
      the default "iomem_resource" will be used.
      
      Update the arguments list of allocate_resource() in fill_list()
      to always allocate a region from the hotpluggable range
      (maximum possible addressable physical memory range for which
      the linear mapping could be created). If arch doesn't define
      arch_get_mappable_range() the default range (0,-1) will be used.
      
      The behaviour on x86 won't be changed by current patch as both
      arch_xen_unpopulated_init() and arch_get_mappable_range()
      are not implemented for it.
      
      Also fallback to allocate xenballooned pages (balloon out RAM
      pages) if we do not have any suitable resource to work with
      (target_resource is invalid) and as the result we won't be able
      to provide unpopulated pages on a request.
      
      Signed-off-by: default avatarOleksandr Tyshchenko <oleksandr_tyshchenko@epam.com>
      Reviewed-by: default avatarStefano Stabellini <sstabellini@kernel.org>
      Link: https://lore.kernel.org/r/1639080336-26573-5-git-send-email-olekstysh@gmail.com
      
      
      Signed-off-by: default avatarJuergen Gross <jgross@suse.com>
      d1a928ea
    • Oleksandr Tyshchenko's avatar
      xen/balloon: Bring alloc(free)_xenballooned_pages helpers back · 9dd060af
      Oleksandr Tyshchenko authored
      This patch rolls back some of the changes introduced by commit
      121f2fac
      
       "xen/balloon: rename alloc/free_xenballooned_pages"
      in order to make possible to still allocate xenballooned pages
      if CONFIG_XEN_UNPOPULATED_ALLOC is enabled.
      
      On Arm the unpopulated pages will be allocated on top of extended
      regions provided by Xen via device-tree (the subsequent patches
      will add required bits to support unpopulated-alloc feature on Arm).
      The problem is that extended regions feature has been introduced
      into Xen quite recently (during 4.16 release cycle). So this
      effectively means that Linux must only use unpopulated-alloc on Arm
      if it is running on "new Xen" which advertises these regions.
      But, it will only be known after parsing the "hypervisor" node
      at boot time, so before doing that we cannot assume anything.
      
      In order to keep working if CONFIG_XEN_UNPOPULATED_ALLOC is enabled
      and the extended regions are not advertised (Linux is running on
      "old Xen", etc) we need the fallback to alloc_xenballooned_pages().
      
      This way we wouldn't reduce the amount of memory usable (wasting
      RAM pages) for any of the external mappings anymore (and eliminate
      XSA-300) with "new Xen", but would be still functional ballooning
      out RAM pages with "old Xen".
      
      Also rename alloc(free)_xenballooned_pages to xen_alloc(free)_ballooned_pages
      and make xen_alloc(free)_unpopulated_pages static inline in xen.h
      if CONFIG_XEN_UNPOPULATED_ALLOC is disabled.
      
      Signed-off-by: default avatarOleksandr Tyshchenko <oleksandr_tyshchenko@epam.com>
      Reviewed-by: default avatarStefano Stabellini <sstabellini@kernel.org>
      Link: https://lore.kernel.org/r/1639080336-26573-4-git-send-email-olekstysh@gmail.com
      
      
      Signed-off-by: default avatarJuergen Gross <jgross@suse.com>
      9dd060af
    • Oleksandr Tyshchenko's avatar
      arm/xen: Switch to use gnttab_setup_auto_xlat_frames() for DT · 5e1cdb8e
      Oleksandr Tyshchenko authored
      Read the start address of the grant table space from DT
      (region 0).
      
      This patch mostly restores behaviour before commit 3cf4095d
      
      
      ("arm/xen: Use xen_xlate_map_ballooned_pages to setup grant table")
      but trying not to break the ACPI support added after that commit.
      So the patch touches DT part only and leaves the ACPI part with
      xen_xlate_map_ballooned_pages(). Also in order to make a code more
      resilient use a fallback to xen_xlate_map_ballooned_pages() if grant
      table region wasn't found.
      
      This is a preparation for using Xen extended region feature
      where unused regions of guest physical address space (provided
      by the hypervisor) will be used to create grant/foreign/whatever
      mappings instead of wasting real RAM pages from the domain memory
      for establishing these mappings.
      
      The immediate benefit of this change:
      - Avoid superpage shattering in Xen P2M when establishing
        stage-2 mapping (GFN <-> MFN) for the grant table space
      - Avoid wasting real RAM pages (reducing the amount of memory
        usuable) for mapping grant table space
      - The grant table space is always mapped at the exact
        same place (region 0 is reserved for the grant table)
      
      Signed-off-by: default avatarOleksandr Tyshchenko <oleksandr_tyshchenko@epam.com>
      Reviewed-by: default avatarStefano Stabellini <sstabellini@kernel.org>
      Link: https://lore.kernel.org/r/1639080336-26573-3-git-send-email-olekstysh@gmail.com
      
      
      Signed-off-by: default avatarJuergen Gross <jgross@suse.com>
      5e1cdb8e
    • Oleksandr Tyshchenko's avatar
      xen/unpopulated-alloc: Drop check for virt_addr_valid() in fill_list() · fbf3a5c3
      Oleksandr Tyshchenko authored
      
      If memremap_pages() succeeds the range is guaranteed to have proper page
      table, there is no need for an additional virt_addr_valid() check.
      
      Signed-off-by: default avatarOleksandr Tyshchenko <oleksandr_tyshchenko@epam.com>
      Reviewed-by: default avatarBoris Ostrovsky <boris.ostrovsky@oracle.com>
      Link: https://lore.kernel.org/r/1639080336-26573-2-git-send-email-olekstysh@gmail.com
      
      
      Signed-off-by: default avatarJuergen Gross <jgross@suse.com>
      fbf3a5c3
    • Jan Beulich's avatar
      xen/x86: obtain upper 32 bits of video frame buffer address for Dom0 · 335e4dd6
      Jan Beulich authored
      
      The hypervisor has been supplying this information for a couple of major
      releases. Make use of it. The need to set a flag in the capabilities
      field also points out that the prior setting of that field from the
      hypervisor interface's gbl_caps one was wrong, so that code gets deleted
      (there's also no equivalent of this in native boot code).
      
      Signed-off-by: default avatarJan Beulich <jbeulich@suse.com>
      Reviewed-by: default avatarBoris Ostrovsky <boris.ostrovsky@oracle.com>
      
      Link: https://lore.kernel.org/r/a3df8bf3-d044-b7bb-3383-cd5239d6d4af@suse.com
      
      
      Signed-off-by: default avatarJuergen Gross <jgross@suse.com>
      335e4dd6
    • Oleksandr Andrushchenko's avatar
      xen/gntdev: fix unmap notification order · ce2f46f3
      Oleksandr Andrushchenko authored
      
      While working with Xen's libxenvchan library I have faced an issue with
      unmap notifications sent in wrong order if both UNMAP_NOTIFY_SEND_EVENT
      and UNMAP_NOTIFY_CLEAR_BYTE were requested: first we send an event channel
      notification and then clear the notification byte which renders in the below
      inconsistency (cli_live is the byte which was requested to be cleared on unmap):
      
      [  444.514243] gntdev_put_map UNMAP_NOTIFY_SEND_EVENT map->notify.event 6
      libxenvchan_is_open cli_live 1
      [  444.515239] __unmap_grant_pages UNMAP_NOTIFY_CLEAR_BYTE at 14
      
      Thus it is not possible to reliably implement the checks like
      - wait for the notification (UNMAP_NOTIFY_SEND_EVENT)
      - check the variable (UNMAP_NOTIFY_CLEAR_BYTE)
      because it is possible that the variable gets checked before it is cleared
      by the kernel.
      
      To fix that we need to re-order the notifications, so the variable is first
      gets cleared and then the event channel notification is sent.
      With this fix I can see the correct order of execution:
      
      [   54.522611] __unmap_grant_pages UNMAP_NOTIFY_CLEAR_BYTE at 14
      [   54.537966] gntdev_put_map UNMAP_NOTIFY_SEND_EVENT map->notify.event 6
      libxenvchan_is_open cli_live 0
      
      Cc: stable@vger.kernel.org
      Signed-off-by: default avatarOleksandr Andrushchenko <oleksandr_andrushchenko@epam.com>
      Reviewed-by: default avatarBoris Ostrovsky <boris.ostrovsky@oracle.com>
      Link: https://lore.kernel.org/r/20211210092817.580718-1-andr2000@gmail.com
      
      
      Signed-off-by: default avatarJuergen Gross <jgross@suse.com>
      ce2f46f3
  2. Jan 02, 2022
  3. Jan 01, 2022
  4. Dec 31, 2021
  5. Dec 30, 2021
    • Linus Torvalds's avatar
      Merge tag 'drm-fixes-2021-12-31' of git://anongit.freedesktop.org/drm/drm · 4f3d93c6
      Linus Torvalds authored
      Pull drm fixes from Dave Airlie:
       "This is a bit bigger than I'd like, however it has two weeks of amdgpu
        fixes in it, since they missed last week, which was very small.
      
        The nouveau regression is probably the biggest fix in here, and it
        needs to go into 5.15 as well, two i915 fixes, and then a scattering
        of amdgpu fixes. The biggest fix in there is for a fencing NULL
        pointer dereference, the rest are pretty minor.
      
        For the misc team, I've pulled the two misc fixes manually since I'm
        not sure what is happening at this time of year!
      
        The amdgpu maintainers have the outstanding runpm regression to fix
        still, they are just working through the last bits of it now.
      
        Summary:
      
        nouveau:
         - fencing regression fix
      
        i915:
         - Fix possible uninitialized variable
         - Fix composite fence seqno icrement on each fence creation
      
        amdgpu:
         - Fencing fix
         - XGMI fix
         - VCN regression fix
         - IP discovery regression fixes
         - Fix runpm documentation
         - Suspend/resume fixes
         - Yellow Carp display fixes
         - MCLK power management fix
         - dma-buf fix"
      
      * tag 'drm-fixes-2021-12-31' of git://anongit.freedesktop.org/drm/drm:
        drm/amd/display: Changed pipe split policy to allow for multi-display pipe split
        drm/amd/display: Fix USB4 null pointer dereference in update_psp_stream_config
        drm/amd/display: Set optimize_pwr_state for DCN31
        drm/amd/display: Send s0i2_rdy in stream_count == 0 optimization
        drm/amd/display: Added power down for DCN10
        drm/amd/display: fix B0 TMDS deepcolor no dislay issue
        drm/amdgpu: no DC support for headless chips
        drm/amdgpu: put SMU into proper state on runpm suspending for BOCO capable platform
        drm/amdgpu: always reset the asic in suspend (v2)
        drm/amd/pm: skip setting gfx cgpg in the s0ix suspend-resume
        drm/i915: Increment composite fence seqno
        drm/i915: Fix possible uninitialized variable in parallel extension
        drm/amdgpu: fix runpm documentation
        drm/nouveau: wait for the exclusive fence after the shared ones v2
        drm/amdgpu: add support for IP discovery gc_info table v2
        drm/amdgpu: When the VCN(1.0) block is suspended, powergating is explicitly enabled
        drm/amd/pm: Fix xgmi link control on aldebaran
        drm/amdgpu: introduce new amdgpu_fence object to indicate the job embedded fence
        drm/amdgpu: fix dropped backing store handling in amdgpu_dma_buf_move_notify
      4f3d93c6
    • Dave Airlie's avatar
      Merge branch 'drm-misc-fixes' of ssh://git.freedesktop.org/git/drm/drm-misc into drm-fixes · ce9b333c
      Dave Airlie authored
      
      This merges two fixes that haven't been sent to me yet, but I wanted to get in.
      
      One amdgpu fix, but one nouveau regression fixer.
      
      Signed-off-by: default avatarDave Airlie <airlied@redhat.com>
      ce9b333c
    • Christian Brauner's avatar
      fs/mount_setattr: always cleanup mount_kattr · 012e3322
      Christian Brauner authored
      Make sure that finish_mount_kattr() is called after mount_kattr was
      succesfully built in both the success and failure case to prevent
      leaking any references we took when we built it.  We returned early if
      path lookup failed thereby risking to leak an additional reference we
      took when building mount_kattr when an idmapped mount was requested.
      
      Cc: linux-fsdevel@vger.kernel.org
      Cc: stable@vger.kernel.org
      Fixes: 9caccd41
      
       ("fs: introduce MOUNT_ATTR_IDMAP")
      Signed-off-by: default avatarChristian Brauner <christian.brauner@ubuntu.com>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      012e3322
    • Linus Torvalds's avatar
      Merge tag 'net-5.16-rc8' of git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net · 74c78b42
      Linus Torvalds authored
      Pull networking fixes from Jakub Kicinski:
       "Including fixes from.. Santa?
      
        No regressions on our radar at this point. The igc problem fixed here
        was the last one I was tracking but it was broken in previous
        releases, anyway. Mostly driver fixes and a couple of largish SMC
        fixes.
      
        Current release - regressions:
      
         - xsk: initialise xskb free_list_node, fixup for a -rc7 fix
      
        Current release - new code bugs:
      
         - mlx5: handful of minor fixes:
      
         - use first online CPU instead of hard coded CPU
      
         - fix some error handling paths in 'mlx5e_tc_add_fdb_flow()'
      
         - fix skb memory leak when TC classifier action offloads are disabled
      
         - fix memory leak with rules with internal OvS port
      
        Previous releases - regressions:
      
         - igc: do not enable crosstimestamping for i225-V models
      
        Previous releases - always broken:
      
         - udp: use datalen to cap ipv6 udp max gso segments
      
         - fix use-after-free in tw_timer_handler due to early free of stats
      
         - smc: fix kernel panic caused by race of smc_sock
      
         - smc: don't send CDC/LLC message if link not ready, avoid timeouts
      
         - sctp: use call_rcu to free endpoint, avoid UAF in sock diag
      
         - bridge: mcast: add and enforce query interval minimum
      
         - usb: pegasus: do not drop long Ethernet frames
      
         - mlx5e: fix ICOSQ recovery flow for XSK
      
         - nfc: uapi: use kernel size_t to fix user-space builds"
      
      * tag 'net-5.16-rc8' of git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net: (47 commits)
        fsl/fman: Fix missing put_device() call in fman_port_probe
        selftests: net: using ping6 for IPv6 in udpgro_fwd.sh
        Documentation: fix outdated interpretation of ip_no_pmtu_disc
        net/ncsi: check for error return from call to nla_put_u32
        net: bridge: mcast: fix br_multicast_ctx_vlan_global_disabled helper
        net: fix use-after-free in tw_timer_handler
        selftests: net: Fix a typo in udpgro_fwd.sh
        selftests/net: udpgso_bench_tx: fix dst ip argument
        net: bridge: mcast: add and enforce startup query interval minimum
        net: bridge: mcast: add and enforce query interval minimum
        ipv6: raw: check passed optlen before reading
        xsk: Initialise xskb free_list_node
        net/mlx5e: Fix wrong features assignment in case of error
        net/mlx5e: TC, Fix memory leak with rules with internal port
        ionic: Initialize the 'lif->dbid_inuse' bitmap
        igc: Fix TX timestamp support for non-MSI-X platforms
        igc: Do not enable crosstimestamping for i225-V models
        net/smc: fix kernel panic caused by race of smc_sock
        net/smc: don't send CDC/LLC message if link not ready
        NFC: st21nfca: Fix memory leak in device probe and remove
        ...
      74c78b42
    • Linus Torvalds's avatar
      Merge tag 'char-misc-5.16' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc · 9bad743e
      Linus Torvalds authored
      Pull char/misc fixes from Greg KH:
       "Here are two misc driver fixes for 5.16-final:
      
         - binder accounting fix to resolve reported problem
      
         - nitro_enclaves fix for mmap assert warning output
      
        Both of these have been for over a week with no reported issues"
      
      * tag 'char-misc-5.16' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc:
        nitro_enclaves: Use get_user_pages_unlocked() call to handle mmap assert
        binder: fix async_free_space accounting for empty parcels
      9bad743e
    • Linus Torvalds's avatar
      Merge tag 'usb-5.16' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb · 2d40060b
      Linus Torvalds authored
      Pull USB fixes from Greg KH:
       "Here are some small USB driver fixes for 5.16 to resolve some reported
        problems:
      
         - mtu3 driver fixes
      
         - typec ucsi driver fix
      
         - xhci driver quirk added
      
         - usb gadget f_fs fix for reported crash
      
        All of these have been in linux-next for a while with no reported
        problems"
      
      * tag 'usb-5.16' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb:
        usb: typec: ucsi: Only check the contract if there is a connection
        xhci: Fresco FL1100 controller should not have BROKEN_MSI quirk set.
        usb: mtu3: set interval of FS intr and isoc endpoint
        usb: mtu3: fix list_head check warning
        usb: mtu3: add memory barrier before set GPD's HWO
        usb: mtu3: fix interval value for intr and isoc
        usb: gadget: f_fs: Clear ffs_eventfd in ffs_data_clear.
      2d40060b
    • Miaoqian Lin's avatar
      fsl/fman: Fix missing put_device() call in fman_port_probe · bf2b09fe
      Miaoqian Lin authored
      The reference taken by 'of_find_device_by_node()' must be released when
      not needed anymore.
      Add the corresponding 'put_device()' in the and error handling paths.
      
      Fixes: 18a6c85f
      
       ("fsl/fman: Add FMan Port Support")
      Signed-off-by: default avatarMiaoqian Lin <linmq006@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      bf2b09fe
    • Jianguo Wu's avatar
      selftests: net: using ping6 for IPv6 in udpgro_fwd.sh · 8b3170e0
      Jianguo Wu authored
      udpgro_fwd.sh output following message:
        ping: 2001:db8:1::100: Address family for hostname not supported
      
      Using ping6 when pinging IPv6 addresses.
      
      Fixes: a062260a
      
       ("selftests: net: add UDP GRO forwarding self-tests")
      Signed-off-by: default avatarJianguo Wu <wujianguo@chinatelecom.cn>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      8b3170e0
    • xu xin's avatar
      Documentation: fix outdated interpretation of ip_no_pmtu_disc · be1c5b53
      xu xin authored
      The updating way of pmtu has changed, but documentation is still in the
      old way. So this patch updates the interpretation of ip_no_pmtu_disc and
      min_pmtu.
      
      See commit 28d35bcd
      
       ("net: ipv4: don't let PMTU updates increase
      route MTU")
      
      Reported-by: default avatarZeal Robot <zealci@zte.com.cn>
      Signed-off-by: default avatarxu xin <xu.xin16@zte.com.cn>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      be1c5b53
  6. Dec 29, 2021