[PATCH 1/6] drm/fbdev-generic: Always use shadow buffering

2023-03-15 Thread Thomas Zimmermann
Remove all codepaths that implement fbdev output directly on GEM buffers. Always allocate a shadow buffer in system memory and set up deferred I/O for mmap. The fbdev code that operated directly on GEM buffers was used by drivers based on GEM DMA helpers. Those drivers have been migrated to use

[PATCH 4/6] drm/fbdev-generic: Clean up after failed probing

2023-03-15 Thread Thomas Zimmermann
Clean up fbdev and client state if the probe function fails. It used to leak allocated resources. Also reorder the individual steps to simplify cleanup. Signed-off-by: Thomas Zimmermann --- drivers/gpu/drm/drm_fbdev_generic.c | 46 - 1 file changed, 32 insertions(+),

[PATCH 6/6] drm/fbdev-generic: Rename symbols

2023-03-15 Thread Thomas Zimmermann
Rename symbols to match the style of other fbdev-emulation source code. No functional changes. Signed-off-by: Thomas Zimmermann --- drivers/gpu/drm/drm_fbdev_generic.c | 66 ++--- 1 file changed, 33 insertions(+), 33 deletions(-) diff --git

[PATCH 3/6] drm/fb-helper: Export drm_fb_helper_release_info()

2023-03-15 Thread Thomas Zimmermann
Export the fb_info release code as drm_fb_helper_release_info(). Will help with cleaning up failed fbdev probing. Signed-off-by: Thomas Zimmermann --- drivers/gpu/drm/drm_fb_helper.c | 33 - include/drm/drm_fb_helper.h | 5 + 2 files changed, 29

[PATCH 5/6] drm/fb-helper: Consolidate CONFIG_DRM_FBDEV_LEAK_PHYS_SMEM

2023-03-15 Thread Thomas Zimmermann
Consolidate all handling of CONFIG_DRM_FBDEV_LEAK_PHYS_SMEM by making the module parameter optional in drm_fb_helper.c. Without the config option, modules can set smem_start in struct fb_info for internal usage, but not export if to userspace. The address can only be exported by enabling the

[PATCH 0/6] drm/fbdev-generic: Mandatory shadow buffering

2023-03-15 Thread Thomas Zimmermann
After adding fbdev-dma and converting drivers, all users of fbdev-generic require shadow buffering. Make it mandatory and remove all other codepaths. This change greatly simplifies the code for generic fbdev emulation. It will work with any driver that supports GEM's vmap and vunmap. The change

[PATCH 2/6] drm/fbdev-generic: Remove unused prefer_shadow_fbdev flag

2023-03-15 Thread Thomas Zimmermann
Remove the flag prefer_shadow_fbdev from struct drm_mode_config. Drivers set this flag to enable shadow buffering in the generic fbdev emulation. Such shadow buffering is now mandatory, so the flag is unused. Signed-off-by: Thomas Zimmermann --- drivers/gpu/drm/tiny/bochs.c| 1 -

RE: [PATCH net 1/2] virtio_net: fix page_to_skb() miss headroom

2023-03-15 Thread John Fastabend
Xuan Zhuo wrote: > Because headroom is not passed to page_to_skb(), this causes the shinfo > exceeds the range. Then the frags of shinfo are changed by other process. > > [ 157.724634] stack segment: [#1] PREEMPT SMP NOPTI > [ 157.725358] CPU: 3 PID: 679 Comm: xdp_pass_user_f Tainted: G

RE: [PATCH net 2/2] virtio_net: free xdp shinfo frags when build_skb_from_xdp_buff() fails

2023-03-15 Thread John Fastabend
Xuan Zhuo wrote: > build_skb_from_xdp_buff() may return NULL, on this > scene we need to free the frags of xdp shinfo. > > Fixes: fab89bafa95b ("virtio-net: support multi-buffer xdp") > Signed-off-by: Xuan Zhuo > --- > drivers/net/virtio_net.c | 5 - > 1 file changed, 4 insertions(+), 1

[PATCH v2 0/3] virtio_ring: Clean up code for virtio ring and pci

2023-03-15 Thread Feng Liu via Virtualization
This patch series performs a clean up of the code in virtio_ring and virtio_pci, modifying it to conform with the Linux kernel coding style guidance [1]. The modifications ensure the code easy to read and understand. This small series does few short cleanups in the code. Patch-1 Allow non power

[PATCH v2 1/3] virtio_ring: Allow non power of 2 sizes for packed virtqueue

2023-03-15 Thread Feng Liu via Virtualization
According to the Virtio Specification, the Queue Size parameter of a virtqueue corresponds to the maximum number of descriptors in that queue, and it does not have to be a power of 2 for packed virtqueues. However, the virtio_pci_modern driver enforced a power of 2 check for virtqueue sizes, which

[PATCH v2 3/3] virtio_ring: Use const to annotate read-only pointer params

2023-03-15 Thread Feng Liu via Virtualization
Add const to make the read-only pointer parameters clear, similar to many existing functions. Use `container_of_const` to implement `to_vvq`, which ensures the const-ness of read-only parameters and avoids accidental modification of their members. Signed-off-by: Feng Liu Reviewed-by: Jiri Pirko

[PATCH v2 2/3] virtio_ring: Avoid using inline for small functions

2023-03-15 Thread Feng Liu via Virtualization
Remove the inline keyword, according to kernel coding style [1], defining inline functions is not necessary for samll functions. It is verified with GCC 12.2.0, the generated code with/without inline is the same. Additionally tested with kernel pktgen and iperf, and verified the result, pps of

Re: [PATCH vhost v2 06/12] virtio_ring: split-indirect: support premapped

2023-03-15 Thread Jason Wang
On Wed, Mar 15, 2023 at 2:06 PM Xuan Zhuo wrote: > > On Wed, 15 Mar 2023 12:47:29 +0800, Jason Wang wrote: > > On Tue, Mar 14, 2023 at 5:17 PM Xuan Zhuo > > wrote: > > > > > > On Tue, 14 Mar 2023 15:57:06 +0800, Jason Wang > > > wrote: > > > > On Wed, Mar 8, 2023 at 2:44 PM Xuan Zhuo > > >

Re: [PATCH vhost v2 06/12] virtio_ring: split-indirect: support premapped

2023-03-15 Thread Xuan Zhuo
On Thu, 16 Mar 2023 10:49:54 +0800, Jason Wang wrote: > On Wed, Mar 15, 2023 at 2:06 PM Xuan Zhuo wrote: > > > > On Wed, 15 Mar 2023 12:47:29 +0800, Jason Wang wrote: > > > On Tue, Mar 14, 2023 at 5:17 PM Xuan Zhuo > > > wrote: > > > > > > > > On Tue, 14 Mar 2023 15:57:06 +0800, Jason Wang

Re: [PATCH v2 3/8] vringh: replace kmap_atomic() with kmap_local_page()

2023-03-15 Thread Jason Wang
On Thu, Mar 16, 2023 at 5:12 AM Fabio M. De Francesco wrote: > > On martedì 14 marzo 2023 04:56:08 CET Jason Wang wrote: > > On Thu, Mar 2, 2023 at 7:34 PM Stefano Garzarella > wrote: > > > kmap_atomic() is deprecated in favor of kmap_local_page(). > > > > It's better to mention the commit or

Re: [PATCH v3 03/11] vdpa: Add set_irq_affinity callback in vdpa_config_ops

2023-03-15 Thread Jason Wang
On Tue, Feb 28, 2023 at 5:42 PM Xie Yongji wrote: > > This introduces set_irq_affinity callback in > vdpa_config_ops so that vdpa device driver can > get the interrupt affinity hint from the virtio > device driver. The interrupt affinity hint would > be needed by the interrupt affinity spreading

Re: [PATCH v3 02/11] vdpa: Add set/get_vq_affinity callbacks in vdpa_config_ops

2023-03-15 Thread Jason Wang
在 2023/2/28 17:41, Xie Yongji 写道: This introduces set/get_vq_affinity callbacks in vdpa_config_ops to support interrupt affinity management for vdpa device drivers. Signed-off-by: Xie Yongji Acked-by: Jason Wang --- drivers/virtio/virtio_vdpa.c | 28

Re: [PATCH vhost v2 06/12] virtio_ring: split-indirect: support premapped

2023-03-15 Thread Xuan Zhuo
On Wed, 15 Mar 2023 12:47:29 +0800, Jason Wang wrote: > On Tue, Mar 14, 2023 at 5:17 PM Xuan Zhuo wrote: > > > > On Tue, 14 Mar 2023 15:57:06 +0800, Jason Wang wrote: > > > On Wed, Mar 8, 2023 at 2:44 PM Xuan Zhuo > > > wrote: > > > > > > > > virtio core only supports virtual addresses, dma

Re: [PATCH 1/2] vdpa/mlx5: Make VIRTIO_NET_F_MRG_RXBUF off by default

2023-03-15 Thread Si-Wei Liu
On 3/14/2023 7:09 PM, Parav Pandit wrote: From: Si-Wei Liu Sent: Tuesday, March 14, 2023 3:29 PM If user supplied feature bits and device doesn’t support some of the feature bits -> add command fails. If user supplied feature bits, than use only the feature bits. Do not OR user supplied

Re: [PATCH RFC v2 virtio 2/7] pds_vdpa: get vdpa management info

2023-03-15 Thread Jason Wang
On Thu, Mar 9, 2023 at 9:31 AM Shannon Nelson wrote: > > Find the vDPA management information from the DSC in order to > advertise it to the vdpa subsystem. > > Signed-off-by: Shannon Nelson > --- > drivers/vdpa/pds/Makefile| 3 +- > drivers/vdpa/pds/aux_drv.c | 13 >

Re: [PATCH RFC v2 virtio 3/7] pds_vdpa: virtio bar setup for vdpa

2023-03-15 Thread Jason Wang
On Thu, Mar 9, 2023 at 9:31 AM Shannon Nelson wrote: > > The PDS vDPA device has a virtio BAR for describing itself, and > the pds_vdpa driver needs to access it. Here we copy liberally > from the existing drivers/virtio/virtio_pci_modern_dev.c as it > has what we need, but we need to modify it

Re: [PATCH RFC v2 virtio 4/7] pds_vdpa: add vdpa config client commands

2023-03-15 Thread Jason Wang
On Thu, Mar 9, 2023 at 9:31 AM Shannon Nelson wrote: > > These are the adminq commands that will be needed for > setting up and using the vDPA device. It's better to explain under which case the driver should use adminq, I see some functions overlap with common configuration capability. More

Re: [PATCH RFC v2 virtio 7/7] pds_vdpa: pds_vdps.rst and Kconfig

2023-03-15 Thread Jason Wang
On Thu, Mar 9, 2023 at 9:31 AM Shannon Nelson wrote: > > Add the documentation and Kconfig entry for pds_vdpa driver. > > Signed-off-by: Shannon Nelson > --- > .../ethernet/pensando/pds_vdpa.rst| 84 +++ > MAINTAINERS | 4 + >

Re: [PATCH RFC v2 virtio 5/7] pds_vdpa: add support for vdpa and vdpamgmt interfaces

2023-03-15 Thread Jason Wang
On Thu, Mar 9, 2023 at 9:31 AM Shannon Nelson wrote: > > This is the vDPA device support, where we advertise that we can > support the virtio queues and deal with the configuration work > through the pds_core's adminq. > > Signed-off-by: Shannon Nelson > --- > drivers/vdpa/pds/aux_drv.c | 15

Re: [PATCH v3 07/38] drm: handle HAS_IOPORT dependencies

2023-03-15 Thread Jani Nikula
On Tue, 14 Mar 2023, Niklas Schnelle wrote: > In a future patch HAS_IOPORT=n will result in inb()/outb() and friends > not being declared. We thus need to add HAS_IOPORT as dependency for > those drivers using them. In the bochs driver there is optional MMIO > support detected at runtime, warn if