Re: [PATCH] x86/paravirt: convert simple paravirt functions to asm

2023-03-16 Thread Peter Zijlstra
On Wed, Mar 08, 2023 at 04:42:10PM +0100, Juergen Gross wrote: > +DEFINE_PARAVIRT_ASM(pv_native_irq_disable, "cli", .text); > +DEFINE_PARAVIRT_ASM(pv_native_irq_enable, "sti", .text); > +DEFINE_PARAVIRT_ASM(pv_native_read_cr2, "mov %cr2, %rax", .text); per these v, the above ^ should be in

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

2023-03-16 Thread Jason Wang
On Thu, Mar 16, 2023 at 2:55 AM Feng Liu wrote: > > 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

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

2023-03-16 Thread Jason Wang
On Thu, Mar 16, 2023 at 11:25 AM Shannon Nelson wrote: > > On 3/15/23 12:05 AM, Jason Wang wrote: > > 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 > >> --- > >>

Re: [PATCH v2 1/2] vdpa/mlx5: Extend driver support for new features

2023-03-16 Thread Jason Wang
On Wed, Mar 15, 2023 at 3:28 PM Eli Cohen wrote: > > Extend the possible list for features that can be supported by firmware. > Note that different versions of firmware may or may not support these > features. The driver is made aware of them by querying the firmware. > > While doing this,

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

2023-03-16 Thread Jason Wang
On Thu, Mar 16, 2023 at 11:25 AM Shannon Nelson wrote: > > On 3/15/23 12:05 AM, Jason Wang wrote: > > 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. > >> > >>

Re: [PATCH] x86/paravirt: convert simple paravirt functions to asm

2023-03-16 Thread Juergen Gross via Virtualization
On 16.03.23 21:14, Peter Zijlstra wrote: On Wed, Mar 08, 2023 at 04:42:10PM +0100, Juergen Gross wrote: +DEFINE_PARAVIRT_ASM(pv_native_irq_disable, "cli", .text); +DEFINE_PARAVIRT_ASM(pv_native_irq_enable, "sti", .text); +DEFINE_PARAVIRT_ASM(pv_native_read_cr2, "mov %cr2, %rax", .text); per

Re: [PATCH v2 4/8] vringh: support VA with iotlb

2023-03-16 Thread Jason Wang
On Fri, Mar 17, 2023 at 12:07 AM Stefano Garzarella wrote: > > On Fri, Mar 3, 2023 at 3:39 PM Eugenio Perez Martin > wrote: > > > > On Thu, Mar 2, 2023 at 12:35 PM Stefano Garzarella > > wrote: > > > > > > vDPA supports the possibility to use user VA in the iotlb messages. > > > So, let's add

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

2023-03-16 Thread Jason Wang
On Thu, Mar 16, 2023 at 11:25 AM Shannon Nelson wrote: > > On 3/15/23 12:05 AM, Jason Wang wrote: > > 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

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

2023-03-16 Thread Jason Wang
On Thu, Mar 16, 2023 at 2:55 AM Feng Liu wrote: > > 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

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

2023-03-16 Thread Jason Wang
On Thu, Mar 16, 2023 at 2:55 AM Feng Liu wrote: > > 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

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

2023-03-16 Thread Jason Wang
On Wed, Mar 15, 2023 at 3:28 PM Eli Cohen wrote: > > One can still enable it when creating the vdpa device using vdpa tool by > providing features that include it. > > For example: > $ vdpa dev add name vdpa0 mgmtdev pci/:86:00.2 device_features 0x300cb982b > > Please be aware that this

Re: [PATCH] vdpa/mlx5: Remove debugfs file after device unregister

2023-03-16 Thread Jason Wang
On Sun, Mar 12, 2023 at 4:41 PM Eli Cohen wrote: > > When deleting the vdpa device, the debugfs files need to be removed so > need to remove debugfs after the device has been unregistered. > > This fixes null pointer dereference when someone deletes the device > after debugfs has been populated.

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

2023-03-16 Thread Jason Wang
On Thu, Mar 16, 2023 at 11:25 AM Shannon Nelson wrote: > > On 3/15/23 12:05 AM, Jason Wang wrote: > > 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

Re: [PATCH v2 2/8] vhost-vdpa: use bind_mm/unbind_mm device callbacks

2023-03-16 Thread Stefano Garzarella
On Tue, Mar 14, 2023 at 11:48:33AM +0800, Jason Wang wrote: On Thu, Mar 2, 2023 at 7:34 PM Stefano Garzarella wrote: When the user call VHOST_SET_OWNER ioctl and the vDPA device has `use_va` set to true, let's call the bind_mm callback. In this way we can bind the device to the user address

Re: [PATCH v2 7/8] vdpa_sim: replace the spinlock with a mutex to protect the state

2023-03-16 Thread Stefano Garzarella
On Tue, Mar 14, 2023 at 01:31:25PM +0800, Jason Wang wrote: On Tue, Mar 14, 2023 at 1:29 PM Jason Wang wrote: On Thu, Mar 2, 2023 at 7:35 PM Stefano Garzarella wrote: > > The spinlock we use to protect the state of the simulator is sometimes > held for a long time (for example, when devices

Re: [PATCH v2 4/8] vringh: support VA with iotlb

2023-03-16 Thread Stefano Garzarella
On Tue, Mar 14, 2023 at 12:53:57PM +0800, Jason Wang wrote: On Thu, Mar 2, 2023 at 7:35 PM Stefano Garzarella wrote: vDPA supports the possibility to use user VA in the iotlb messages. So, let's add support for user VA in vringh to use it in the vDPA simulators. Signed-off-by: Stefano

Re: [PATCH v3 08/11] vdpa: Add eventfd for the vdpa callback

2023-03-16 Thread Jason Wang
在 2023/2/28 17:41, Xie Yongji 写道: Add eventfd for the vdpa callback so that user can signal it directly instead of running the callback. It will be used for vhost-vdpa case. Signed-off-by: Xie Yongji --- drivers/vhost/vdpa.c | 2 ++ drivers/virtio/virtio_vdpa.c | 1 +

Re: [PATCH v3 09/11] vduse: Signal interrupt's eventfd directly in vhost-vdpa case

2023-03-16 Thread Jason Wang
On Tue, Feb 28, 2023 at 5:42 PM Xie Yongji wrote: > > Now the vdpa callback will associate an eventfd in > vhost-vdpa case. I'd suggest avoiding mentioning drivers since vDPA parents should not know which vDPA driver is bound. We could say "signal vq trigger eventfd directly if possible"? With

Re: [PATCH v3 08/11] vdpa: Add eventfd for the vdpa callback

2023-03-16 Thread Jason Wang
On Thu, Mar 16, 2023 at 5:25 PM Jason Wang wrote: > > > 在 2023/2/28 17:41, Xie Yongji 写道: > > Add eventfd for the vdpa callback so that user > > can signal it directly instead of running the > > callback. It will be used for vhost-vdpa case. > > > > Signed-off-by: Xie Yongji > > --- > >

Re: [PATCH v2 1/8] vdpa: add bind_mm/unbind_mm callbacks

2023-03-16 Thread Stefano Garzarella
On Tue, Mar 14, 2023 at 11:39:42AM +0800, Jason Wang wrote: On Thu, Mar 2, 2023 at 7:34 PM Stefano Garzarella wrote: These new optional callbacks is used to bind/unbind the device to a specific address space so the vDPA framework can use VA when these callbacks are implemented. Suggested-by:

Re: [PATCH v3 05/11] vduse: Support automatic irq callback affinity

2023-03-16 Thread Jason Wang
在 2023/2/28 17:41, Xie Yongji 写道: This brings current interrupt affinity spreading mechanism to vduse device. We will make use of group_cpus_evenly() to create an irq callback affinity mask for each virtqueue of vduse device. Then we will spread IRQs between CPUs in the affinity mask, in a

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

2023-03-16 Thread Stefano Garzarella
On Thu, Mar 16, 2023 at 10:13:39AM +0100, Fabio M. De Francesco wrote: On giovedì 2 marzo 2023 12:34:16 CET Stefano Garzarella wrote: kmap_atomic() is deprecated in favor of kmap_local_page(). With kmap_local_page() the mappings are per thread, CPU local, can take page-faults, and can be

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

2023-03-16 Thread Stefano Garzarella
On Wed, Mar 15, 2023 at 10:12 PM 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 v2 8/8] vdpa_sim: add support for user VA

2023-03-16 Thread Stefano Garzarella
On Tue, Mar 14, 2023 at 01:36:13PM +0800, Jason Wang wrote: On Thu, Mar 2, 2023 at 7:35 PM Stefano Garzarella wrote: The new "use_va" module parameter (default: false) is used in vdpa_alloc_device() to inform the vDPA framework that the device supports VA. vringh is initialized to use VA

Re: [PATCH v3 01/11] lib/group_cpus: Export group_cpus_evenly()

2023-03-16 Thread Jason Wang
On Tue, Feb 28, 2023 at 5:42 PM Xie Yongji wrote: > > Export group_cpus_evenly() so that some modules > can make use of it to group CPUs evenly according > to NUMA and CPU locality. > > Signed-off-by: Xie Yongji Acked-by: Jason Wang Thanks > --- > lib/group_cpus.c | 1 + > 1 file changed, 1

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

2023-03-16 Thread Thomas Zimmermann
Hi Am 16.03.23 um 03:16 schrieb Zack Rusin: On Wed, 2023-03-15 at 17:14 +0100, Thomas Zimmermann wrote: 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

Re: [PATCH v2 2/8] vhost-vdpa: use bind_mm/unbind_mm device callbacks

2023-03-16 Thread Stefano Garzarella
On Thu, Mar 16, 2023 at 9:31 AM Stefano Garzarella wrote: > > On Tue, Mar 14, 2023 at 11:48:33AM +0800, Jason Wang wrote: > >On Thu, Mar 2, 2023 at 7:34 PM Stefano Garzarella > >wrote: > >> > >> When the user call VHOST_SET_OWNER ioctl and the vDPA device > >> has `use_va` set to true, let's

[RFC PATCH 28/28] sock: Remove ->sendpage*() in favour of sendmsg(MSG_SPLICE_PAGES)

2023-03-16 Thread David Howells
[!] Note: This is a work in progress. At the moment, some things won't build if this patch is applied. nvme, kcm, smc, tls. Remove ->sendpage() and ->sendpage_locked(). sendmsg() with MSG_SPLICE_PAGES should be used instead. This allows multiple pages and multipage folios to be passed

Re: [PATCH v2 4/8] vringh: support VA with iotlb

2023-03-16 Thread Stefano Garzarella
On Fri, Mar 3, 2023 at 3:39 PM Eugenio Perez Martin wrote: > > On Thu, Mar 2, 2023 at 12:35 PM Stefano Garzarella > wrote: > > > > vDPA supports the possibility to use user VA in the iotlb messages. > > So, let's add support for user VA in vringh to use it in the vDPA > > simulators. > > > >

Re: [PATCH] x86/paravirt: convert simple paravirt functions to asm

2023-03-16 Thread Borislav Petkov
On Wed, Mar 08, 2023 at 04:42:10PM +0100, Juergen Gross wrote: > All functions referenced via __PV_IS_CALLEE_SAVE() need to be assembler > functions, as those functions calls are hidden from gcc. In case the > kernel is compiled with "-fzero-call-used-regs" the compiler will > clobber caller-saved