14 Jan, 2021

1 commit

  • We enable the virtio_ivshmem driver and add
    shared memory region including pci devices in cell file. But we not
    start backend.

    There might be garbage data in "vi_dev->virtio_header", so we need to
    check peer_state to abort the probe earlier.

    Note: patch accepted by Jailhouse Linux repo
    Signed-off-by: Peng Fan

    Peng Fan
     

04 Jan, 2021

1 commit

  • This is the 5.10.4 stable release

    * tag 'v5.10.4': (717 commits)
    Linux 5.10.4
    x86/CPU/AMD: Save AMD NodeId as cpu_die_id
    drm/edid: fix objtool warning in drm_cvt_modes()
    ...

    Signed-off-by: Jason Liu

    Conflicts:
    drivers/gpu/drm/imx/dcss/dcss-plane.c
    drivers/media/i2c/ov5640.c

    Jason Liu
     

30 Dec, 2020

2 commits

  • [ Upstream commit e152d8af4220a05c9797591609151d404866beaa ]

    The "vq" struct is added to the "vdev->vqs" list prematurely. If we
    encounter an error later in the function then the "vq" is freed, but
    since it is still on the list that could lead to a use after free bug.

    Fixes: cbeedb72b97a ("virtio_ring: allocate desc state for split ring separately")
    Reported-by: Robert Buhren
    Reported-by: Felicitas Hetzelt
    Signed-off-by: Dan Carpenter
    Link: https://lore.kernel.org/r/X8pGaG/zkI3jk8mk@mwanda
    Signed-off-by: Michael S. Tsirkin
    Acked-by: Jason Wang
    Signed-off-by: Sasha Levin

    Dan Carpenter
     
  • [ Upstream commit ae93d8ea0fa701e84ab9df0db9fb60ec6c80d7b8 ]

    There is a copy and paste bug in the error handling of this code and
    it uses "ring_dma_addr" three times instead of "device_event_dma_addr"
    and "driver_event_dma_addr".

    Fixes: 1ce9e6055fa0 (" virtio_ring: introduce packed ring support")
    Reported-by: Robert Buhren
    Reported-by: Felicitas Hetzelt
    Signed-off-by: Dan Carpenter
    Link: https://lore.kernel.org/r/X8pGRJlEzyn+04u2@mwanda
    Signed-off-by: Michael S. Tsirkin
    Acked-by: Jason Wang
    Signed-off-by: Sasha Levin

    Dan Carpenter
     

14 Dec, 2020

2 commits


24 Oct, 2020

1 commit

  • Pull virtio updates from Michael Tsirkin:
    "vhost, vdpa, and virtio cleanups and fixes

    A very quiet cycle, no new features"

    * tag 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mst/vhost:
    MAINTAINERS: add URL for virtio-mem
    vhost_vdpa: remove unnecessary spin_lock in vhost_vring_call
    vringh: fix __vringh_iov() when riov and wiov are different
    vdpa/mlx5: Setup driver only if VIRTIO_CONFIG_S_DRIVER_OK
    s390: virtio: PV needs VIRTIO I/O device protection
    virtio: let arch advertise guest's memory access restrictions
    vhost_vdpa: Fix duplicate included kernel.h
    vhost: reduce stack usage in log_used
    virtio-mem: Constify mem_id_table
    virtio_input: Constify id_table
    virtio-balloon: Constify id_table
    vdpa/mlx5: Fix failure to bring link up
    vdpa/mlx5: Make use of a specific 16 bit endianness API

    Linus Torvalds
     

21 Oct, 2020

4 commits

  • An architecture may restrict host access to guest memory,
    e.g. IBM s390 Secure Execution or AMD SEV.

    Provide a new Kconfig entry the architecture can select,
    CONFIG_ARCH_HAS_RESTRICTED_VIRTIO_MEMORY_ACCESS, when it provides
    the arch_has_restricted_virtio_memory_access callback to advertise
    to VIRTIO common code when the architecture restricts memory access
    from the host.

    The common code can then fail the probe for any device where
    VIRTIO_F_ACCESS_PLATFORM is required, but not set.

    Signed-off-by: Pierre Morel
    Reviewed-by: Cornelia Huck
    Reviewed-by: Halil Pasic
    Link: https://lore.kernel.org/r/1599728030-17085-2-git-send-email-pmorel@linux.ibm.com
    Signed-off-by: Michael S. Tsirkin
    Acked-by: Christian Borntraeger

    Pierre Morel
     
  • mem_id_table is not modified, so make it const to allow the compiler to
    put it in read-only memory.

    Signed-off-by: Rikard Falkeborn
    Link: https://lore.kernel.org/r/20200911203509.26505-4-rikard.falkeborn@gmail.com
    Signed-off-by: Michael S. Tsirkin
    Acked-by: David Hildenbrand

    Rikard Falkeborn
     
  • id_table is not modified, so make it const to allow the compiler to put
    it in read-only memory.

    Signed-off-by: Rikard Falkeborn
    Link: https://lore.kernel.org/r/20200911203509.26505-3-rikard.falkeborn@gmail.com
    Signed-off-by: Michael S. Tsirkin
    Reviewed-by: David Hildenbrand

    Rikard Falkeborn
     
  • id_table is not modified, so make it const to allow the compiler to put
    it in read-only memory.

    Signed-off-by: Rikard Falkeborn
    Link: https://lore.kernel.org/r/20200911203509.26505-2-rikard.falkeborn@gmail.com
    Signed-off-by: Michael S. Tsirkin
    Acked-by: David Hildenbrand

    Rikard Falkeborn
     

17 Oct, 2020

2 commits

  • virtio-mem adds memory in memory block granularity, to be able to remove
    it in the same granularity again later, and to grow slowly on demand.
    This, however, results in quite a lot of resources when adding a lot of
    memory. Resources are effectively stored in a list-based tree. Having a
    lot of resources not only wastes memory, it also makes traversing that
    tree more expensive, and makes /proc/iomem explode in size (e.g.,
    requiring kexec-tools to manually merge resources later when e.g., trying
    to create a kdump header).

    Before this patch, we get (/proc/iomem) when hotplugging 2G via virtio-mem
    on x86-64:
    [...]
    100000000-13fffffff : System RAM
    140000000-33fffffff : virtio0
    140000000-147ffffff : System RAM (virtio_mem)
    148000000-14fffffff : System RAM (virtio_mem)
    150000000-157ffffff : System RAM (virtio_mem)
    158000000-15fffffff : System RAM (virtio_mem)
    160000000-167ffffff : System RAM (virtio_mem)
    168000000-16fffffff : System RAM (virtio_mem)
    170000000-177ffffff : System RAM (virtio_mem)
    178000000-17fffffff : System RAM (virtio_mem)
    180000000-187ffffff : System RAM (virtio_mem)
    188000000-18fffffff : System RAM (virtio_mem)
    190000000-197ffffff : System RAM (virtio_mem)
    198000000-19fffffff : System RAM (virtio_mem)
    1a0000000-1a7ffffff : System RAM (virtio_mem)
    1a8000000-1afffffff : System RAM (virtio_mem)
    1b0000000-1b7ffffff : System RAM (virtio_mem)
    1b8000000-1bfffffff : System RAM (virtio_mem)
    3280000000-32ffffffff : PCI Bus 0000:00

    With this patch, we get (/proc/iomem):
    [...]
    fffc0000-ffffffff : Reserved
    100000000-13fffffff : System RAM
    140000000-33fffffff : virtio0
    140000000-1bfffffff : System RAM (virtio_mem)
    3280000000-32ffffffff : PCI Bus 0000:00

    Of course, with more hotplugged memory, it gets worse. When unplugging
    memory blocks again, try_remove_memory() (via offline_and_remove_memory())
    will properly split the resource up again.

    Signed-off-by: David Hildenbrand
    Signed-off-by: Andrew Morton
    Reviewed-by: Pankaj Gupta
    Cc: Michal Hocko
    Cc: Dan Williams
    Cc: Michael S. Tsirkin
    Cc: Jason Wang
    Cc: Baoquan He
    Cc: Wei Yang
    Cc: Anton Blanchard
    Cc: Ard Biesheuvel
    Cc: Benjamin Herrenschmidt
    Cc: Boris Ostrovsky
    Cc: Christian Borntraeger
    Cc: Dave Jiang
    Cc: Eric Biederman
    Cc: Greg Kroah-Hartman
    Cc: Haiyang Zhang
    Cc: Heiko Carstens
    Cc: Jason Gunthorpe
    Cc: Juergen Gross
    Cc: Julien Grall
    Cc: Kees Cook
    Cc: "K. Y. Srinivasan"
    Cc: Len Brown
    Cc: Leonardo Bras
    Cc: Libor Pechacek
    Cc: Michael Ellerman
    Cc: Nathan Lynch
    Cc: "Oliver O'Halloran"
    Cc: Paul Mackerras
    Cc: Pingfan Liu
    Cc: "Rafael J. Wysocki"
    Cc: Roger Pau Monné
    Cc: Stefano Stabellini
    Cc: Stephen Hemminger
    Cc: Thomas Gleixner
    Cc: Vasily Gorbik
    Cc: Vishal Verma
    Cc: Wei Liu
    Link: https://lkml.kernel.org/r/20200911103459.10306-7-david@redhat.com
    Signed-off-by: Linus Torvalds

    David Hildenbrand
     
  • We soon want to pass flags, e.g., to mark added System RAM resources.
    mergeable. Prepare for that.

    This patch is based on a similar patch by Oscar Salvador:

    https://lkml.kernel.org/r/20190625075227.15193-3-osalvador@suse.de

    Signed-off-by: David Hildenbrand
    Signed-off-by: Andrew Morton
    Reviewed-by: Juergen Gross # Xen related part
    Reviewed-by: Pankaj Gupta
    Acked-by: Wei Liu
    Cc: Michal Hocko
    Cc: Dan Williams
    Cc: Jason Gunthorpe
    Cc: Baoquan He
    Cc: Michael Ellerman
    Cc: Benjamin Herrenschmidt
    Cc: Paul Mackerras
    Cc: "Rafael J. Wysocki"
    Cc: Len Brown
    Cc: Greg Kroah-Hartman
    Cc: Vishal Verma
    Cc: Dave Jiang
    Cc: "K. Y. Srinivasan"
    Cc: Haiyang Zhang
    Cc: Stephen Hemminger
    Cc: Wei Liu
    Cc: Heiko Carstens
    Cc: Vasily Gorbik
    Cc: Christian Borntraeger
    Cc: David Hildenbrand
    Cc: "Michael S. Tsirkin"
    Cc: Jason Wang
    Cc: Boris Ostrovsky
    Cc: Stefano Stabellini
    Cc: "Oliver O'Halloran"
    Cc: Pingfan Liu
    Cc: Nathan Lynch
    Cc: Libor Pechacek
    Cc: Anton Blanchard
    Cc: Leonardo Bras
    Cc: Ard Biesheuvel
    Cc: Eric Biederman
    Cc: Julien Grall
    Cc: Kees Cook
    Cc: Roger Pau Monné
    Cc: Thomas Gleixner
    Cc: Wei Yang
    Link: https://lkml.kernel.org/r/20200911103459.10306-5-david@redhat.com
    Signed-off-by: Linus Torvalds

    David Hildenbrand
     

16 Oct, 2020

1 commit

  • Pull drm updates from Dave Airlie:
    "Not a major amount of change, the i915 trees got split into display
    and gt trees to better facilitate higher level review, and there's a
    major refactoring of i915 GEM locking to use more core kernel concepts
    (like ww-mutexes). msm gets per-process pagetables, older AMD SI cards
    get DC support, nouveau got a bump in displayport support with common
    code extraction from i915.

    Outside of drm this contains a couple of patches for hexint
    moduleparams which you've acked, and a virtio common code tree that
    you should also get via it's regular path.

    New driver:
    - Cadence MHDP8546 DisplayPort bridge driver

    core:
    - cross-driver scatterlist cleanups
    - devm_drm conversions
    - remove drm_dev_init
    - devm_drm_dev_alloc conversion

    ttm:
    - lots of refactoring and cleanups

    bridges:
    - chained bridge support in more drivers

    panel:
    - misc new panels

    scheduler:
    - cleanup priority levels

    displayport:
    - refactor i915 code into helpers for nouveau

    i915:
    - split into display and GT trees
    - WW locking refactoring in GEM
    - execbuf2 extension mechanism
    - syncobj timeline support
    - GEN 12 HOBL display powersaving
    - Rocket Lake display additions
    - Disable FBC on Tigerlake
    - Tigerlake Type-C + DP improvements
    - Hotplug interrupt refactoring

    amdgpu:
    - Sienna Cichlid updates
    - Navy Flounder updates
    - DCE6 (SI) support for DC
    - Plane rotation enabled
    - TMZ state info ioctl
    - PCIe DPC recovery support
    - DC interrupt handling refactor
    - OLED panel fixes

    amdkfd:
    - add SMI events for thermal throttling
    - SMI interface events ioctl update
    - process eviction counters

    radeon:
    - move to dma_ for allocations
    - expose sclk via sysfs

    msm:
    - DSI support for sm8150/sm8250
    - per-process GPU pagetable support
    - Displayport support

    mediatek:
    - move HDMI phy driver to PHY
    - convert mtk-dpi to bridge API
    - disable mt2701 tmds

    tegra:
    - bridge support

    exynos:
    - misc cleanups

    vc4:
    - dual display cleanups

    ast:
    - cleanups

    gma500:
    - conversion to GPIOd API

    hisilicon:
    - misc reworks

    ingenic:
    - clock handling and format improvements

    mcde:
    - DSI support

    mgag200:
    - desktop g200 support

    mxsfb:
    - i.MX7 + i.MX8M
    - alpha plane support

    panfrost:
    - devfreq support
    - amlogic SoC support

    ps8640:
    - EDID from eDP retrieval

    tidss:
    - AM65xx YUV workaround

    virtio:
    - virtio-gpu exported resources

    rcar-du:
    - R8A7742, R8A774E1 and R8A77961 support
    - YUV planar format fixes
    - non-visible plane handling
    - VSP device reference count fix
    - Kconfig fix to avoid displaying disabled options in .config"

    * tag 'drm-next-2020-10-15' of git://anongit.freedesktop.org/drm/drm: (1494 commits)
    drm/ingenic: Fix bad revert
    drm/amdgpu: Fix invalid number of character '{' in amdgpu_acpi_init
    drm/amdgpu: Remove warning for virtual_display
    drm/amdgpu: kfd_initialized can be static
    drm/amd/pm: setup APU dpm clock table in SMU HW initialization
    drm/amdgpu: prevent spurious warning
    drm/amdgpu/swsmu: fix ARC build errors
    drm/amd/display: Fix OPTC_DATA_FORMAT programming
    drm/amd/display: Don't allow pstate if no support in blank
    drm/panfrost: increase readl_relaxed_poll_timeout values
    MAINTAINERS: Update entry for st7703 driver after the rename
    Revert "gpu/drm: ingenic: Add option to mmap GEM buffers cached"
    drm/amd/display: HDMI remote sink need mode validation for Linux
    drm/amd/display: Change to correct unit on audio rate
    drm/amd/display: Avoid set zero in the requested clk
    drm/amdgpu: align frag_end to covered address space
    drm/amdgpu: fix NULL pointer dereference for Renoir
    drm/vmwgfx: fix regression in thp code due to ttm init refactor.
    drm/amdgpu/swsmu: add interrupt work handler for smu11 parts
    drm/amdgpu/swsmu: add interrupt work function
    ...

    Linus Torvalds
     

14 Oct, 2020

1 commit

  • When introducing virtio-mem, the semantics of ZONE_MOVABLE were rather
    unclear, which is why we special-cased ZONE_MOVABLE such that partially
    plugged blocks would never end up in ZONE_MOVABLE.

    Now that the semantics are much clearer (and will be documented in a
    follow-up patch including the new virtio-mem behavior), let's allow to
    online partially plugged memory blocks to ZONE_MOVABLE and also consider
    memory blocks that were onlined to ZONE_MOVABLE when unplugging memory.
    While unplugged memory pages are, in general, unmovable, they can be
    skipped when offlining memory.

    virtio-mem only unplugs fairly big chunks (in the megabyte range) and
    rather tries to shrink the memory region than randomly choosing memory.
    In theory, if all other pages in the movable zone would be movable,
    virtio-mem would only shrink that zone and not create any kind of
    fragmentation.

    In the future, we might want to remember the zone again and use the
    information when (un)plugging memory. For now, let's keep it simple.

    Note: Support for defragmentation is planned, to deal with fragmentation
    after unplug due to memory chunks within memory blocks that could not get
    unplugged before (e.g., somebody pinning pages within ZONE_MOVABLE for a
    longer time).

    Signed-off-by: David Hildenbrand
    Signed-off-by: Andrew Morton
    Cc: Michal Hocko
    Cc: Michael S. Tsirkin
    Cc: Jason Wang
    Cc: Mike Kravetz
    Cc: Pankaj Gupta
    Cc: Baoquan He
    Cc: Mike Rapoport
    Cc: Qian Cai
    Link: http://lkml.kernel.org/r/20200816125333.7434-6-david@redhat.com
    Signed-off-by: Linus Torvalds

    David Hildenbrand
     

16 Sep, 2020

1 commit


10 Sep, 2020

2 commits

  • On MMIO a new set of registers is defined for finding SHM
    regions. Add their definitions and use them to find the region.

    Signed-off-by: Sebastien Boeuf
    Cc: kvm@vger.kernel.org
    Cc: virtualization@lists.linux-foundation.org
    Cc: "Michael S. Tsirkin"
    Signed-off-by: Miklos Szeredi

    Sebastien Boeuf
     
  • On PCI the shm regions are found using capability entries;
    find a region by searching for the capability.

    Signed-off-by: Sebastien Boeuf
    Signed-off-by: Dr. David Alan Gilbert
    Signed-off-by: kbuild test robot
    Acked-by: Michael S. Tsirkin
    Cc: kvm@vger.kernel.org
    Cc: virtualization@lists.linux-foundation.org
    Cc: "Michael S. Tsirkin"
    Signed-off-by: Miklos Szeredi

    Sebastien Boeuf
     

19 Aug, 2020

1 commit


18 Aug, 2020

2 commits

  • Sam needs 5.9-rc1 to have dev_err_probe in to merge some patches.

    Signed-off-by: Maxime Ripard

    Maxime Ripard
     
  • This change adds a new flavor of dma-bufs that can be used by virtio
    drivers to share exported objects. A virtio dma-buf can be queried by
    virtio drivers to obtain the UUID which identifies the underlying
    exported object.

    Signed-off-by: David Stevens
    Acked-by: Michael S. Tsirkin
    Link: http://patchwork.freedesktop.org/patch/msgid/20200818071343.3461203-2-stevensd@chromium.org
    Signed-off-by: Gerd Hoffmann

    David Stevens
     

15 Aug, 2020

1 commit

  • The ioreadX() helpers have inconsistent interface. On some architectures
    void *__iomem address argument is a pointer to const, on some not.

    Implementations of ioreadX() do not modify the memory under the address so
    they can be converted to a "const" version for const-safety and
    consistency among architectures.

    Signed-off-by: Krzysztof Kozlowski
    Signed-off-by: Andrew Morton
    Reviewed-by: Geert Uytterhoeven
    Cc: Allen Hubbe
    Cc: Arnd Bergmann
    Cc: Benjamin Herrenschmidt
    Cc: Dave Jiang
    Cc: "David S. Miller"
    Cc: Geert Uytterhoeven
    Cc: Helge Deller
    Cc: Ivan Kokshaysky
    Cc: Jakub Kicinski
    Cc: "James E.J. Bottomley"
    Cc: Jason Wang
    Cc: Jon Mason
    Cc: Kalle Valo
    Cc: Matt Turner
    Cc: Michael Ellerman
    Cc: "Michael S. Tsirkin"
    Cc: Paul Mackerras
    Cc: Richard Henderson
    Cc: Rich Felker
    Cc: Yoshinori Sato
    Link: http://lkml.kernel.org/r/20200709072837.5869-5-krzk@kernel.org
    Signed-off-by: Linus Torvalds

    Krzysztof Kozlowski
     

12 Aug, 2020

1 commit

  • Pull virtio updates from Michael Tsirkin:

    - IRQ bypass support for vdpa and IFC

    - MLX5 vdpa driver

    - Endianness fixes for virtio drivers

    - Misc other fixes

    * tag 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mst/vhost: (71 commits)
    vdpa/mlx5: fix up endian-ness for mtu
    vdpa: Fix pointer math bug in vdpasim_get_config()
    vdpa/mlx5: Fix pointer math in mlx5_vdpa_get_config()
    vdpa/mlx5: fix memory allocation failure checks
    vdpa/mlx5: Fix uninitialised variable in core/mr.c
    vdpa_sim: init iommu lock
    virtio_config: fix up warnings on parisc
    vdpa/mlx5: Add VDPA driver for supported mlx5 devices
    vdpa/mlx5: Add shared memory registration code
    vdpa/mlx5: Add support library for mlx5 VDPA implementation
    vdpa/mlx5: Add hardware descriptive header file
    vdpa: Modify get_vq_state() to return error code
    net/vdpa: Use struct for set/get vq state
    vdpa: remove hard coded virtq num
    vdpasim: support batch updating
    vhost-vdpa: support IOTLB batching hints
    vhost-vdpa: support get/set backend features
    vhost: generialize backend features setting/getting
    vhost-vdpa: refine ioctl pre-processing
    vDPA: dont change vq irq after DRIVER_OK
    ...

    Linus Torvalds
     

05 Aug, 2020

8 commits

  • Fix the comment of virtio_pci_find_capability() by adding missing comment
    for the last parameter: bars.

    Fixes: 59a5b0f7bf74 ("virtio-pci: alloc only resources actually used.")
    Signed-off-by: Liao Pingfang
    Signed-off-by: Yi Wang
    Link: https://lore.kernel.org/r/1596455545-43556-1-git-send-email-wang.yi59@zte.com.cn
    Signed-off-by: Michael S. Tsirkin
    Acked-by: Jason Wang

    Liao Pingfang
     
  • The loop may exist if vq->broken is true,
    virtqueue_get_buf_ctx_packed or virtqueue_get_buf_ctx_split
    will return NULL, so virtnet_poll will reschedule napi to
    receive packet, it will lead cpu usage(si) to 100%.

    call trace as below:
    virtnet_poll
    virtnet_receive
    virtqueue_get_buf_ctx
    virtqueue_get_buf_ctx_packed
    virtqueue_get_buf_ctx_split
    virtqueue_napi_complete
    virtqueue_poll //return true
    virtqueue_napi_schedule //it will reschedule napi

    to fix this, return false if vq is broken in virtqueue_poll.

    Signed-off-by: Mao Wenan
    Acked-by: Michael S. Tsirkin
    Link: https://lore.kernel.org/r/1596354249-96204-1-git-send-email-wenan.mao@linux.alibaba.com
    Signed-off-by: Michael S. Tsirkin
    Acked-by: Jason Wang

    Mao Wenan
     
  • Virtio mem is modern-only. Use LE accessors for config space.

    Signed-off-by: Michael S. Tsirkin

    Michael S. Tsirkin
     
  • Virtio input is modern-only. Use LE accessors for config space.

    Signed-off-by: Michael S. Tsirkin

    Michael S. Tsirkin
     
  • Balloon is LE, it's cleaner to access it as such directly.

    Signed-off-by: Michael S. Tsirkin

    Michael S. Tsirkin
     
  • We normally expect vdpa to use the modern interface.
    However for consistency, let's use same APIs as vhost
    for legacy guests.

    Signed-off-by: Michael S. Tsirkin

    Michael S. Tsirkin
     
  • balloon uses virtio32_to_cpu instead of cpu_to_virtio32
    to convert a native endian number to virtio.
    No practical difference but makes sparse warn.
    Fix it up.

    Signed-off-by: Michael S. Tsirkin
    Reviewed-by: Cornelia Huck
    Acked-by: David Hildenbrand
    Reviewed-by: Cornelia Huck

    Michael S. Tsirkin
     
  • Pull uninitialized_var() macro removal from Kees Cook:
    "This is long overdue, and has hidden too many bugs over the years. The
    series has several "by hand" fixes, and then a trivial treewide
    replacement.

    - Clean up non-trivial uses of uninitialized_var()

    - Update documentation and checkpatch for uninitialized_var() removal

    - Treewide removal of uninitialized_var()"

    * tag 'uninit-macro-v5.9-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/kees/linux:
    compiler: Remove uninitialized_var() macro
    treewide: Remove uninitialized_var() usage
    checkpatch: Remove awareness of uninitialized_var() macro
    mm/debug_vm_pgtable: Remove uninitialized_var() usage
    f2fs: Eliminate usage of uninitialized_var() macro
    media: sur40: Remove uninitialized_var() usage
    KVM: PPC: Book3S PR: Remove uninitialized_var() usage
    clk: spear: Remove uninitialized_var() usage
    clk: st: Remove uninitialized_var() usage
    spi: davinci: Remove uninitialized_var() usage
    ide: Remove uninitialized_var() usage
    rtlwifi: rtl8192cu: Remove uninitialized_var() usage
    b43: Remove uninitialized_var() usage
    drbd: Remove uninitialized_var() usage
    x86/mm/numa: Remove uninitialized_var() usage
    docs: deprecated.rst: Add uninitialized_var()

    Linus Torvalds
     

04 Aug, 2020

2 commits


30 Jul, 2020

3 commits

  • As noted in:
    https://www.kernel.org/doc/Documentation/kbuild/kconfig-language.txt
    "select should be used with care. select will force a symbol to a
    value without visiting the dependencies."
    Config VIRTIO_MEM should not select CONTIG_ALLOC directly.
    Otherwise it will cause an error:
    https://bugzilla.kernel.org/show_bug.cgi?id=208245

    Signed-off-by: Weilong Chen
    Link: https://lore.kernel.org/r/20200619080333.194753-1-chenweilong@huawei.com
    Acked-by: Randy Dunlap # build-tested
    Signed-off-by: Michael S. Tsirkin
    Acked-by: Jason Wang
    Acked-by: David Hildenbrand

    Weilong Chen
     
  • free cmd id is read using virtio endian, spec says all fields
    in balloon are LE. Fix it up.

    Fixes: 86a559787e6f ("virtio-balloon: VIRTIO_BALLOON_F_FREE_PAGE_HINT")
    Cc: stable@vger.kernel.org
    Signed-off-by: Michael S. Tsirkin
    Acked-by: Jason Wang
    Reviewed-by: Wei Wang
    Acked-by: David Hildenbrand

    Michael S. Tsirkin
     
  • The poison_val field in the virtio_balloon_config is treated as a
    little-endian field by the host. Since we are currently only having to deal
    with a single byte poison value this isn't a problem, however if the value
    should ever expand it would cause byte ordering issues. Document that in
    the code so that we know that if the value should ever expand we need to
    byte swap the value on big-endian architectures.

    Signed-off-by: Alexander Duyck
    Link: https://lore.kernel.org/r/20200713203539.17140.71425.stgit@localhost.localdomain
    Signed-off-by: Michael S. Tsirkin
    Acked-by: David Hildenbrand

    Alexander Duyck
     

25 Jul, 2020

1 commit

  • …lgaas/pci into master

    Pull PCI fixes from Bjorn Helgaas:

    - Reject invalid IRQ 0 command line argument for virtio_mmio because
    IRQ 0 now generates warnings (Bjorn Helgaas)

    - Revert "PCI/PM: Assume ports without DLL Link Active train links in
    100 ms", which broke nouveau (Bjorn Helgaas)

    * tag 'pci-v5.8-fixes-2' of git://git.kernel.org/pub/scm/linux/kernel/git/helgaas/pci:
    Revert "PCI/PM: Assume ports without DLL Link Active train links in 100 ms"
    virtio-mmio: Reject invalid IRQ 0 command line argument

    Linus Torvalds
     

22 Jul, 2020

1 commit

  • The "virtio_mmio.device=" command line argument allows a user to specify
    the size, address, and IRQ of a virtio device. Previously the only
    requirement for the IRQ was that it be an unsigned integer.

    Zero is an unsigned integer but an invalid IRQ number, and after
    a85a6c86c25be ("driver core: platform: Clarify that IRQ 0 is invalid"),
    attempts to use IRQ 0 cause warnings.

    If the user specifies IRQ 0, return failure instead of registering a device
    with IRQ 0.

    Fixes: a85a6c86c25be ("driver core: platform: Clarify that IRQ 0 is invalid")
    Signed-off-by: Bjorn Helgaas
    Acked-by: Jason Wang
    Acked-by: Michael S. Tsirkin

    Bjorn Helgaas
     

17 Jul, 2020

1 commit

  • Using uninitialized_var() is dangerous as it papers over real bugs[1]
    (or can in the future), and suppresses unrelated compiler warnings
    (e.g. "unused variable"). If the compiler thinks it is uninitialized,
    either simply initialize the variable or make compiler changes.

    In preparation for removing[2] the[3] macro[4], remove all remaining
    needless uses with the following script:

    git grep '\buninitialized_var\b' | cut -d: -f1 | sort -u | \
    xargs perl -pi -e \
    's/\buninitialized_var\(([^\)]+)\)/\1/g;
    s:\s*/\* (GCC be quiet|to make compiler happy) \*/$::g;'

    drivers/video/fbdev/riva/riva_hw.c was manually tweaked to avoid
    pathological white-space.

    No outstanding warnings were found building allmodconfig with GCC 9.3.0
    for x86_64, i386, arm64, arm, powerpc, powerpc64le, s390x, mips, sparc64,
    alpha, and m68k.

    [1] https://lore.kernel.org/lkml/20200603174714.192027-1-glider@google.com/
    [2] https://lore.kernel.org/lkml/CA+55aFw+Vbj0i=1TGqCR5vQkCzWJ0QxK6CernOU6eedsudAixw@mail.gmail.com/
    [3] https://lore.kernel.org/lkml/CA+55aFwgbgqhbp1fkxvRKEpzyR5J8n1vKT1VZdz9knmPuXhOeg@mail.gmail.com/
    [4] https://lore.kernel.org/lkml/CA+55aFz2500WfbKXAx8s67wrm9=yVJu65TpLgN_ybYNv0VEOKA@mail.gmail.com/

    Reviewed-by: Leon Romanovsky # drivers/infiniband and mlx4/mlx5
    Acked-by: Jason Gunthorpe # IB
    Acked-by: Kalle Valo # wireless drivers
    Reviewed-by: Chao Yu # erofs
    Signed-off-by: Kees Cook

    Kees Cook
     

23 Jun, 2020

1 commit

  • Virtio-mem managed memory is always detected and added by the virtio-mem
    driver, never using something like the firmware-provided memory map.
    This is the case after an ordinary system reboot, and has to be guaranteed
    after kexec. Especially, virtio-mem added memory resources can contain
    inaccessible parts ("unblocked memory blocks"), blindly forwarding them
    to a kexec kernel is dangerous, as unplugged memory will get accessed
    (esp. written).

    Let's use the new way of adding special driver-managed memory introduced
    in commit 7b7b27214bba ("mm/memory_hotplug: introduce
    add_memory_driver_managed()").

    This will result in no entries in /sys/firmware/memmap ("raw firmware-
    provided memory map"), the memory resource will be flagged
    IORESOURCE_MEM_DRIVER_MANAGED (esp., kexec_file_load() will not place
    kexec images on this memory), and it is exposed as "System RAM
    (virtio_mem)" in /proc/iomem, so esp. kexec-tools can properly handle it.

    Example /proc/iomem before this change:
    [...]
    140000000-333ffffff : virtio0
    140000000-147ffffff : System RAM
    334000000-533ffffff : virtio1
    338000000-33fffffff : System RAM
    340000000-347ffffff : System RAM
    348000000-34fffffff : System RAM
    [...]

    Example /proc/iomem after this change:
    [...]
    140000000-333ffffff : virtio0
    140000000-147ffffff : System RAM (virtio_mem)
    334000000-533ffffff : virtio1
    338000000-33fffffff : System RAM (virtio_mem)
    340000000-347ffffff : System RAM (virtio_mem)
    348000000-34fffffff : System RAM (virtio_mem)
    [...]

    Cc: "Michael S. Tsirkin"
    Cc: Pankaj Gupta
    Cc: teawater
    Fixes: 5f1f79bbc9e26 ("virtio-mem: Paravirtualized memory hotplug")
    Signed-off-by: David Hildenbrand
    Link: https://lore.kernel.org/r/20200611093518.5737-1-david@redhat.com
    Signed-off-by: Michael S. Tsirkin
    Reviewed-by: Pankaj Gupta

    David Hildenbrand