[PATCH] um: random: Don't initialise hwrng struct with zero

2022-06-23 Thread Christopher Obbard
Initialising the hwrng struct with zeros causes a compile-time sparse warning: $ ARCH=um make -j10 W=1 C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' ... CHECK arch/um/drivers/random.c arch/um/drivers/random.c:31:31: sparse: warning: Using plain integer as NULL pointer Fix the warning by

[PATCH v10 00/41] virtio pci support VIRTIO_F_RING_RESET

2022-06-23 Thread Xuan Zhuo
The virtio spec already supports the virtio queue reset function. This patch set is to add this function to the kernel. The relevant virtio spec information is here: https://github.com/oasis-tcs/virtio-spec/issues/124 https://github.com/oasis-tcs/virtio-spec/issues/139 Also regarding MMIO

[PATCH v10 04/41] virtio_ring: update the document of the virtqueue_detach_unused_buf for queue reset

2022-06-23 Thread Xuan Zhuo
Added documentation for virtqueue_detach_unused_buf, allowing it to be called on queue reset. Signed-off-by: Xuan Zhuo Acked-by: Jason Wang --- drivers/virtio/virtio_ring.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/virtio/virtio_ring.c b/drivers/virtio/virt

[PATCH v10 01/41] remoteproc: rename len of rpoc_vring to num

2022-06-23 Thread Xuan Zhuo
Rename the member len in the structure rpoc_vring to num. And remove 'in bytes' from the comment of it. This is misleading. Because this actually refers to the size of the virtio vring to be created. The unit is not bytes. Signed-off-by: Xuan Zhuo --- drivers/remoteproc/remoteproc_core.c | 4

[PATCH v10 03/41] virtio: struct virtio_config_ops add callbacks for queue_reset

2022-06-23 Thread Xuan Zhuo
reset can be divided into the following four steps (example): 1. transport: notify the device to reset the queue 2. vring: recycle the buffer submitted 3. vring: reset/resize the vring (may re-alloc) 4. transport: mmap vring to device, and enable the queue In order to support queue res

[PATCH v10 05/41] virtio_ring: remove the arg vq of vring_alloc_desc_extra()

2022-06-23 Thread Xuan Zhuo
The parameter vq of vring_alloc_desc_extra() is useless. This patch removes this parameter. Subsequent patches will call this function to avoid passing useless arguments. Signed-off-by: Xuan Zhuo Acked-by: Jason Wang --- drivers/virtio/virtio_ring.c | 7 +++ 1 file changed, 3 insertions(+)

[PATCH v10 02/41] virtio: add helper virtqueue_get_vring_max_size()

2022-06-23 Thread Xuan Zhuo
Record the maximum queue num supported by the device. virtio-net can display the maximum (supported by hardware) ring size in ethtool -g eth0. When the subsequent patch implements vring reset, it can judge whether the ring size passed by the driver is legal based on this. Signed-off-by: Xuan Zhu

[PATCH v10 07/41] virtio_ring: split vring_virtqueue

2022-06-23 Thread Xuan Zhuo
Separate the two inline structures(split and packed) from the structure vring_virtqueue. In this way, we can use these two structures later to pass parameters and retain temporary variables. Signed-off-by: Xuan Zhuo --- drivers/virtio/virtio_ring.c | 122 ++- 1 f

[PATCH v10 06/41] virtio_ring: extract the logic of freeing vring

2022-06-23 Thread Xuan Zhuo
Introduce vring_free() to free the vring of vq. Subsequent patches will use vring_free() alone. Signed-off-by: Xuan Zhuo Acked-by: Jason Wang --- drivers/virtio/virtio_ring.c | 18 +- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/drivers/virtio/virtio_ring.c b/

[PATCH v10 09/41] virtio_ring: split: introduce vring_free_split()

2022-06-23 Thread Xuan Zhuo
Free the structure struct vring_vritqueue_split. Subsequent patches require it. Signed-off-by: Xuan Zhuo --- drivers/virtio/virtio_ring.c | 10 ++ 1 file changed, 10 insertions(+) diff --git a/drivers/virtio/virtio_ring.c b/drivers/virtio/virtio_ring.c index 7bc1eecff7fe..f39282555190

[PATCH v10 10/41] virtio_ring: split: extract the logic of alloc queue

2022-06-23 Thread Xuan Zhuo
Separate the logic of split to create vring queue. This feature is required for subsequent virtuqueue reset vring. Signed-off-by: Xuan Zhuo --- drivers/virtio/virtio_ring.c | 68 ++-- 1 file changed, 42 insertions(+), 26 deletions(-) diff --git a/drivers/virtio/

[PATCH v10 08/41] virtio_ring: introduce virtqueue_init()

2022-06-23 Thread Xuan Zhuo
Separate the logic of virtqueue initialization. This logic is irrelevant to ring layout. This logic can be called independently when implementing resize/reset later. Signed-off-by: Xuan Zhuo --- drivers/virtio/virtio_ring.c | 59 +--- 1 file changed, 28 insertion

[PATCH v10 11/41] virtio_ring: split: extract the logic of alloc state and extra

2022-06-23 Thread Xuan Zhuo
Separate the logic of creating desc_state, desc_extra, and subsequent patches will call it independently. Since only the structure vring is passed into __vring_new_virtqueue(), when creating the function vring_alloc_state_extra_split(), we prefer to use vring_virtqueue_split as a parameter, and it

[PATCH v10 12/41] virtio_ring: split: extract the logic of attach vring

2022-06-23 Thread Xuan Zhuo
Separate the logic of attach vring, subsequent patches will call it separately. Since the "struct vring_virtqueue_split split" is created on the stack and has been initialized to 0. So using split->queue_dma_addr/split->queue_size_in_bytes assignment for queue_dma_addr/queue_size_in_bytes can keep

[PATCH v10 13/41] virtio_ring: split: extract the logic of vring init

2022-06-23 Thread Xuan Zhuo
Separate the logic of initializing vring, and subsequent patches will call it separately. This function completes the variable initialization of split vring. It together with the logic of atatch constitutes the initialization of vring. Signed-off-by: Xuan Zhuo --- drivers/virtio/virtio_ring.c |

[PATCH v10 14/41] virtio_ring: split: introduce virtqueue_reinit_split()

2022-06-23 Thread Xuan Zhuo
Introduce a function to initialize vq without allocating new ring, desc_state, desc_extra. Subsequent patches will call this function after reset vq to reinitialize vq. Signed-off-by: Xuan Zhuo Acked-by: Jason Wang --- drivers/virtio/virtio_ring.c | 19 +++ 1 file changed, 19 i

[PATCH v10 15/41] virtio_ring: split: reserve vring_align, may_reduce_num

2022-06-23 Thread Xuan Zhuo
In vring_create_virtqueue_split() save vring_align, may_reduce_num to structure vring_virtqueue_split. Used to create a new vring when implementing resize . Signed-off-by: Xuan Zhuo --- drivers/virtio/virtio_ring.c | 9 + 1 file changed, 9 insertions(+) diff --git a/drivers/virtio/virti

[PATCH v10 17/41] virtio_ring: packed: introduce vring_free_packed

2022-06-23 Thread Xuan Zhuo
Free the structure struct vring_vritqueue_packed. Subsequent patches require it. Signed-off-by: Xuan Zhuo --- drivers/virtio/virtio_ring.c | 21 + 1 file changed, 21 insertions(+) diff --git a/drivers/virtio/virtio_ring.c b/drivers/virtio/virtio_ring.c index 1ba00e73d601..a

[PATCH v10 16/41] virtio_ring: split: introduce virtqueue_resize_split()

2022-06-23 Thread Xuan Zhuo
virtio ring split supports resize. Only after the new vring is successfully allocated based on the new num, we will release the old vring. In any case, an error is returned, indicating that the vring still points to the old vring. In the case of an error, re-initialize(virtqueue_reinit_split()) t

[PATCH v10 18/41] virtio_ring: packed: extract the logic of alloc queue

2022-06-23 Thread Xuan Zhuo
Separate the logic of packed to create vring queue. For the convenience of passing parameters, add a structure vring_packed. This feature is required for subsequent virtuqueue reset vring. Signed-off-by: Xuan Zhuo --- drivers/virtio/virtio_ring.c | 80 +++- 1 fi

[PATCH v10 20/41] virtio_ring: packed: extract the logic of attach vring

2022-06-23 Thread Xuan Zhuo
Separate the logic of attach vring, the subsequent patch will call it separately. Signed-off-by: Xuan Zhuo --- drivers/virtio/virtio_ring.c | 29 + 1 file changed, 17 insertions(+), 12 deletions(-) diff --git a/drivers/virtio/virtio_ring.c b/drivers/virtio/virtio_rin

[PATCH v10 19/41] virtio_ring: packed: extract the logic of alloc state and extra

2022-06-23 Thread Xuan Zhuo
Separate the logic for alloc desc_state and desc_extra, which will be called separately by subsequent patches. Use struct vring_packed to pass desc_state, desc_extra. Signed-off-by: Xuan Zhuo --- drivers/virtio/virtio_ring.c | 48 +--- 1 file changed, 34 insertio

[PATCH v10 21/41] virtio_ring: packed: extract the logic of vring init

2022-06-23 Thread Xuan Zhuo
Separate the logic of initializing vring, and subsequent patches will call it separately. This function completes the variable initialization of packed vring. It together with the logic of atatch constitutes the initialization of vring. Signed-off-by: Xuan Zhuo --- drivers/virtio/virtio_ring.c

[PATCH v10 22/41] virtio_ring: packed: introduce virtqueue_reinit_packed()

2022-06-23 Thread Xuan Zhuo
Introduce a function to initialize vq without allocating new ring, desc_state, desc_extra. Subsequent patches will call this function after reset vq to reinitialize vq. Signed-off-by: Xuan Zhuo --- drivers/virtio/virtio_ring.c | 21 + 1 file changed, 21 insertions(+) diff -

[PATCH v10 23/41] virtio_ring: packed: introduce virtqueue_resize_packed()

2022-06-23 Thread Xuan Zhuo
virtio ring packed supports resize. Only after the new vring is successfully allocated based on the new num, we will release the old vring. In any case, an error is returned, indicating that the vring still points to the old vring. In the case of an error, re-initialize(by virtqueue_reinit_packed

[PATCH v10 24/41] virtio_ring: introduce virtqueue_resize()

2022-06-23 Thread Xuan Zhuo
Introduce virtqueue_resize() to implement the resize of vring. Based on these, the driver can dynamically adjust the size of the vring. For example: ethtool -G. virtqueue_resize() implements resize based on the vq reset function. In case of failure to allocate a new vring, it will give up resize a

[PATCH v10 26/41] virtio: queue_reset: add VIRTIO_F_RING_RESET

2022-06-23 Thread Xuan Zhuo
Added VIRTIO_F_RING_RESET, it came from here https://github.com/oasis-tcs/virtio-spec/issues/124 https://github.com/oasis-tcs/virtio-spec/issues/139 This feature indicates that the driver can reset a queue individually. Signed-off-by: Xuan Zhuo Acked-by: Jason Wang --- include/uapi/linux/virt

[PATCH v10 25/41] virtio_pci: struct virtio_pci_common_cfg add queue_notify_data

2022-06-23 Thread Xuan Zhuo
Add queue_notify_data in struct virtio_pci_common_cfg, which comes from here https://github.com/oasis-tcs/virtio-spec/issues/89 For not breaks uABI, add a new struct virtio_pci_common_cfg_notify. Since I want to add queue_reset after queue_notify_data, I submitted this patch first. Signed-off-by

[PATCH v10 27/41] virtio: allow to unbreak/break virtqueue individually

2022-06-23 Thread Xuan Zhuo
This patch allows the new introduced __virtqueue_break()/__virtqueue_unbreak() to break/unbreak the virtqueue. Signed-off-by: Xuan Zhuo --- drivers/virtio/virtio_ring.c | 24 include/linux/virtio.h | 3 +++ 2 files changed, 27 insertions(+) diff --git a/drivers/v

[PATCH v10 28/41] virtio_pci: update struct virtio_pci_common_cfg

2022-06-23 Thread Xuan Zhuo
Add queue_reset in virtio_pci_common_cfg. For not breaks uABI, add a new struct virtio_pci_common_cfg_reset. https://github.com/oasis-tcs/virtio-spec/issues/124 https://github.com/oasis-tcs/virtio-spec/issues/139 Signed-off-by: Xuan Zhuo --- include/uapi/linux/virtio_pci.h | 7 +++ 1 fil

[PATCH v10 29/41] virtio_pci: introduce helper to get/set queue reset

2022-06-23 Thread Xuan Zhuo
Introduce new helpers to implement queue reset and get queue reset status. https://github.com/oasis-tcs/virtio-spec/issues/124 https://github.com/oasis-tcs/virtio-spec/issues/139 Signed-off-by: Xuan Zhuo --- drivers/virtio/virtio_pci_modern_dev.c | 39 ++ include/linux

[PATCH v10 30/41] virtio_pci: extract the logic of active vq for modern pci

2022-06-23 Thread Xuan Zhuo
Introduce vp_active_vq() to configure vring to backend after vq attach vring. And configure vq vector if necessary. Signed-off-by: Xuan Zhuo Acked-by: Jason Wang --- drivers/virtio/virtio_pci_modern.c | 46 ++ 1 file changed, 28 insertions(+), 18 deletions(-) diff -

[PATCH v10 31/41] virtio_pci: support VIRTIO_F_RING_RESET

2022-06-23 Thread Xuan Zhuo
This patch implements virtio pci support for QUEUE RESET. Performing reset on a queue is divided into these steps: 1. notify the device to reset the queue 2. recycle the buffer submitted 3. reset the vring (may re-alloc) 4. mmap vring to device, and enable the queue This patch implements vir

[PATCH v10 32/41] virtio: find_vqs() add arg sizes

2022-06-23 Thread Xuan Zhuo
find_vqs() adds a new parameter sizes to specify the size of each vq vring. NULL as sizes means that all queues in find_vqs() use the maximum size. A value in the array is 0, which means that the corresponding queue uses the maximum size. In the split scenario, the meaning of size is the largest

[PATCH v10 34/41] virtio_mmio: support the arg sizes of find_vqs()

2022-06-23 Thread Xuan Zhuo
Virtio MMIO support the new parameter sizes of find_vqs(). Signed-off-by: Xuan Zhuo Acked-by: Jason Wang --- drivers/virtio/virtio_mmio.c | 8 ++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/drivers/virtio/virtio_mmio.c b/drivers/virtio/virtio_mmio.c index 2020391c0f9f..8

[PATCH v10 33/41] virtio_pci: support the arg sizes of find_vqs()

2022-06-23 Thread Xuan Zhuo
Virtio PCI supports new parameter sizes of find_vqs(). Signed-off-by: Xuan Zhuo Acked-by: Jason Wang --- drivers/virtio/virtio_pci_common.c | 18 ++ drivers/virtio/virtio_pci_common.h | 1 + drivers/virtio/virtio_pci_legacy.c | 6 +- drivers/virtio/virtio_pci_modern.c | 10

[PATCH v10 35/41] virtio: add helper virtio_find_vqs_ctx_size()

2022-06-23 Thread Xuan Zhuo
Introduce helper virtio_find_vqs_ctx_size() to call find_vqs and specify the maximum size of each vq ring. Signed-off-by: Xuan Zhuo Acked-by: Jason Wang --- include/linux/virtio_config.h | 12 1 file changed, 12 insertions(+) diff --git a/include/linux/virtio_config.h b/include/li

[PATCH v10 36/41] virtio_net: set the default max ring size by find_vqs()

2022-06-23 Thread Xuan Zhuo
Use virtio_find_vqs_ctx_size() to specify the maximum ring size of tx, rx at the same time. | rx/tx ring size --- speed == UNKNOWN or < 10G| 1024 speed < 40G | 4096 speed >= 40G | 8192 Call virtnet_update_se

[PATCH v10 37/41] virtio_net: get ringparam by virtqueue_get_vring_max_size()

2022-06-23 Thread Xuan Zhuo
Use virtqueue_get_vring_max_size() in virtnet_get_ringparam() to set tx,rx_max_pending. Signed-off-by: Xuan Zhuo Acked-by: Jason Wang --- drivers/net/virtio_net.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/net/virtio_net.c b/drivers/net/virtio_net.c inde

[PATCH v10 38/41] virtio_net: split free_unused_bufs()

2022-06-23 Thread Xuan Zhuo
This patch separates two functions for freeing sq buf and rq buf from free_unused_bufs(). When supporting the enable/disable tx/rq queue in the future, it is necessary to support separate recovery of a sq buf or a rq buf. Signed-off-by: Xuan Zhuo Acked-by: Jason Wang --- drivers/net/virtio_net

[PATCH v10 39/41] virtio_net: support rx queue resize

2022-06-23 Thread Xuan Zhuo
This patch implements the resize function of the rx queues. Based on this function, it is possible to modify the ring num of the queue. Signed-off-by: Xuan Zhuo --- drivers/net/virtio_net.c | 22 ++ 1 file changed, 22 insertions(+) diff --git a/drivers/net/virtio_net.c b/dri

[PATCH v10 40/41] virtio_net: support tx queue resize

2022-06-23 Thread Xuan Zhuo
This patch implements the resize function of the tx queues. Based on this function, it is possible to modify the ring num of the queue. Signed-off-by: Xuan Zhuo --- drivers/net/virtio_net.c | 48 1 file changed, 48 insertions(+) diff --git a/drivers/net/

[PATCH v10 41/41] virtio_net: support set_ringparam

2022-06-23 Thread Xuan Zhuo
Support set_ringparam based on virtio queue reset. Users can use ethtool -G eth0 to modify the ring size of virtio-net. Signed-off-by: Xuan Zhuo Acked-by: Jason Wang --- drivers/net/virtio_net.c | 48 1 file changed, 48 insertions(+) diff --git a/driv

[PATCH V4 00/26] mm/mmap: Drop __SXXX/__PXXX macros from across platforms

2022-06-23 Thread Anshuman Khandual
__SXXX/__PXXX macros is an unnecessary abstraction layer in creating the generic protection_map[] array which is used for vm_get_page_prot(). This abstraction layer can be avoided, if the platforms just define the array protection_map[] for all possible vm_flags access permission combinations and a

[PATCH V4 01/26] mm/mmap: Build protect protection_map[] with __P000

2022-06-23 Thread Anshuman Khandual
Build protect generic protection_map[] array with __P000, so that it can be moved inside all the platforms one after the other. Otherwise there will be build failures during this process. CONFIG_ARCH_HAS_VM_GET_PAGE_PROT cannot be used for this purpose as only certain platforms enable this config n

[PATCH V4 02/26] mm/mmap: Define DECLARE_VM_GET_PAGE_PROT

2022-06-23 Thread Anshuman Khandual
This just converts the generic vm_get_page_prot() implementation into a new macro i.e DECLARE_VM_GET_PAGE_PROT which later can be used across platforms when enabling them with ARCH_HAS_VM_GET_PAGE_PROT. This does not create any functional change. Cc: Andrew Morton Cc: linux...@kvack.org Cc: linux

[PATCH V4 03/26] powerpc/mm: Move protection_map[] inside the platform

2022-06-23 Thread Anshuman Khandual
This moves protection_map[] inside the platform and while here, also enable ARCH_HAS_VM_GET_PAGE_PROT on 32 bit platforms via DECLARE_VM_GET_PAGE_PROT. Cc: Michael Ellerman Cc: Paul Mackerras Cc: Nicholas Piggin Cc: linuxppc-...@lists.ozlabs.org Cc: linux-ker...@vger.kernel.org Signed-off-by: A

[PATCH V4 04/26] sparc/mm: Move protection_map[] inside the platform

2022-06-23 Thread Anshuman Khandual
This moves protection_map[] inside the platform and while here, also enable ARCH_HAS_VM_GET_PAGE_PROT on 32 bit platforms via DECLARE_VM_GET_PAGE_PROT. Cc: "David S. Miller" Cc: sparcli...@vger.kernel.org Cc: linux-ker...@vger.kernel.org Signed-off-by: Anshuman Khandual --- arch/sparc/Kconfig

[PATCH V4 05/26] arm64/mm: Move protection_map[] inside the platform

2022-06-23 Thread Anshuman Khandual
This moves protection_map[] inside the platform and makes it a static. Cc: Catalin Marinas Cc: Will Deacon Cc: linux-arm-ker...@lists.infradead.org Cc: linux-ker...@vger.kernel.org Signed-off-by: Anshuman Khandual --- arch/arm64/include/asm/pgtable-prot.h | 18 -- arch/arm64/mm

[PATCH V4 06/26] x86/mm: Move protection_map[] inside the platform

2022-06-23 Thread Anshuman Khandual
This moves protection_map[] inside the platform and makes it a static. This also defines a helper function add_encrypt_protection_map() that can update the protection_map[] array with pgprot_encrypted(). Cc: Thomas Gleixner Cc: Ingo Molnar Cc: x...@kernel.org Cc: linux-ker...@vger.kernel.org Sig

[PATCH V4 07/26] mm/mmap: Build protect protection_map[] with ARCH_HAS_VM_GET_PAGE_PROT

2022-06-23 Thread Anshuman Khandual
protection_map[] has already been moved inside those platforms which enable ARCH_HAS_VM_GET_PAGE_PROT. Hence generic protection_map[] array now can be protected with CONFIG_ARCH_HAS_VM_GET_PAGE_PROT intead of __P000. Cc: Andrew Morton Cc: linux...@kvack.org Cc: linux-ker...@vger.kernel.org Signed

[PATCH V4 08/26] microblaze/mm: Enable ARCH_HAS_VM_GET_PAGE_PROT

2022-06-23 Thread Anshuman Khandual
This enables ARCH_HAS_VM_GET_PAGE_PROT on the platform and exports standard vm_get_page_prot() implementation via DECLARE_VM_GET_PAGE_PROT, which looks up a private and static protection_map[] array. Subsequently all __SXXX and __PXXX macros can be dropped which are no longer needed. Cc: Michal Si

[PATCH V4 09/26] loongarch/mm: Enable ARCH_HAS_VM_GET_PAGE_PROT

2022-06-23 Thread Anshuman Khandual
This enables ARCH_HAS_VM_GET_PAGE_PROT on the platform and exports standard vm_get_page_prot() implementation via DECLARE_VM_GET_PAGE_PROT, which looks up a private and static protection_map[] array. Subsequently all __SXXX and __PXXX macros can be dropped which are no longer needed. Cc: Huacai Ch

[PATCH V4 10/26] openrisc/mm: Enable ARCH_HAS_VM_GET_PAGE_PROT

2022-06-23 Thread Anshuman Khandual
This enables ARCH_HAS_VM_GET_PAGE_PROT on the platform and exports standard vm_get_page_prot() implementation via DECLARE_VM_GET_PAGE_PROT, which looks up a private and static protection_map[] array. Subsequently all __SXXX and __PXXX macros can be dropped which are no longer needed. Cc: Jonas Bon

[PATCH V4 11/26] extensa/mm: Enable ARCH_HAS_VM_GET_PAGE_PROT

2022-06-23 Thread Anshuman Khandual
This enables ARCH_HAS_VM_GET_PAGE_PROT on the platform and exports standard vm_get_page_prot() implementation via DECLARE_VM_GET_PAGE_PROT, which looks up a private and static protection_map[] array. Subsequently all __SXXX and __PXXX macros can be dropped which are no longer needed. Cc: Chris Zan

[PATCH V4 12/26] hexagon/mm: Enable ARCH_HAS_VM_GET_PAGE_PROT

2022-06-23 Thread Anshuman Khandual
This enables ARCH_HAS_VM_GET_PAGE_PROT on the platform and exports standard vm_get_page_prot() implementation via DECLARE_VM_GET_PAGE_PROT, which looks up a private and static protection_map[] array. Subsequently all __SXXX and __PXXX macros can be dropped which are no longer needed. Cc: Brian Cai

[PATCH V4 13/26] parisc/mm: Enable ARCH_HAS_VM_GET_PAGE_PROT

2022-06-23 Thread Anshuman Khandual
This enables ARCH_HAS_VM_GET_PAGE_PROT on the platform and exports standard vm_get_page_prot() implementation via DECLARE_VM_GET_PAGE_PROT, which looks up a private and static protection_map[] array. Subsequently all __SXXX and __PXXX macros can be dropped which are no longer needed. Cc: "James E.

[PATCH V4 14/26] alpha/mm: Enable ARCH_HAS_VM_GET_PAGE_PROT

2022-06-23 Thread Anshuman Khandual
This enables ARCH_HAS_VM_GET_PAGE_PROT on the platform and exports standard vm_get_page_prot() implementation via DECLARE_VM_GET_PAGE_PROT, which looks up a private and static protection_map[] array. Subsequently all __SXXX and __PXXX macros can be dropped which are no longer needed. Cc: Richard H

[PATCH V4 15/26] nios2/mm: Enable ARCH_HAS_VM_GET_PAGE_PROT

2022-06-23 Thread Anshuman Khandual
This enables ARCH_HAS_VM_GET_PAGE_PROT on the platform and exports standard vm_get_page_prot() implementation via DECLARE_VM_GET_PAGE_PROT, which looks up a private and static protection_map[] array. Subsequently all __SXXX and __PXXX macros can be dropped which are no longer needed. Cc: Dinh Nguy

[PATCH V4 16/26] riscv/mm: Enable ARCH_HAS_VM_GET_PAGE_PROT

2022-06-23 Thread Anshuman Khandual
This enables ARCH_HAS_VM_GET_PAGE_PROT on the platform and exports standard vm_get_page_prot() implementation via DECLARE_VM_GET_PAGE_PROT, which looks up a private and static protection_map[] array. Subsequently all __SXXX and __PXXX macros can be dropped which are no longer needed. Cc: Paul Walm

[PATCH V4 17/26] csky/mm: Enable ARCH_HAS_VM_GET_PAGE_PROT

2022-06-23 Thread Anshuman Khandual
This enables ARCH_HAS_VM_GET_PAGE_PROT on the platform and exports standard vm_get_page_prot() implementation via DECLARE_VM_GET_PAGE_PROT, which looks up a private and static protection_map[] array. Subsequently all __SXXX and __PXXX macros can be dropped which are no longer needed. Cc: Geert Uyt

[PATCH V4 18/26] s390/mm: Enable ARCH_HAS_VM_GET_PAGE_PROT

2022-06-23 Thread Anshuman Khandual
This enables ARCH_HAS_VM_GET_PAGE_PROT on the platform and exports standard vm_get_page_prot() implementation via DECLARE_VM_GET_PAGE_PROT, which looks up a private and static protection_map[] array. Subsequently all __SXXX and __PXXX macros can be dropped which are no longer needed. Cc: Heiko Car

[PATCH V4 19/26] ia64/mm: Enable ARCH_HAS_VM_GET_PAGE_PROT

2022-06-23 Thread Anshuman Khandual
This enables ARCH_HAS_VM_GET_PAGE_PROT on the platform and exports standard vm_get_page_prot() implementation via DECLARE_VM_GET_PAGE_PROT, which looks up a private and static protection_map[] array. Subsequently all __SXXX and __PXXX macros can be dropped which are no longer needed. Cc: linux-i..

[PATCH V4 20/26] mips/mm: Enable ARCH_HAS_VM_GET_PAGE_PROT

2022-06-23 Thread Anshuman Khandual
This enables ARCH_HAS_VM_GET_PAGE_PROT on the platform and exports standard vm_get_page_prot() implementation via DECLARE_VM_GET_PAGE_PROT, which looks up a private and static protection_map[] array. Subsequently all __SXXX and __PXXX macros can be dropped which are no longer needed. Cc: Thomas Bo

[PATCH V4 21/26] m68k/mm: Enable ARCH_HAS_VM_GET_PAGE_PROT

2022-06-23 Thread Anshuman Khandual
This enables ARCH_HAS_VM_GET_PAGE_PROT on the platform and exports standard vm_get_page_prot() implementation via DECLARE_VM_GET_PAGE_PROT, which looks up a private and static protection_map[] array. Subsequently all __SXXX and __PXXX macros can be dropped which are no longer needed. Cc: Thomas Bo

[PATCH V4 22/26] arc/mm: Enable ARCH_HAS_VM_GET_PAGE_PROT

2022-06-23 Thread Anshuman Khandual
This enables ARCH_HAS_VM_GET_PAGE_PROT on the platform and exports standard vm_get_page_prot() implementation via DECLARE_VM_GET_PAGE_PROT, which looks up a private and static protection_map[] array. Subsequently all __SXXX and __PXXX macros can be dropped which are no longer needed. Cc: Vineet Gu

[PATCH V4 23/26] arm/mm: Enable ARCH_HAS_VM_GET_PAGE_PROT

2022-06-23 Thread Anshuman Khandual
This enables ARCH_HAS_VM_GET_PAGE_PROT on the platform and exports standard vm_get_page_prot() implementation via DECLARE_VM_GET_PAGE_PROT, which looks up a private and static protection_map[] array. Subsequently all __SXXX and __PXXX macros can be dropped which are no longer needed. Cc: Russell K

[PATCH V4 24/26] um/mm: Enable ARCH_HAS_VM_GET_PAGE_PROT

2022-06-23 Thread Anshuman Khandual
This enables ARCH_HAS_VM_GET_PAGE_PROT on the platform and exports standard vm_get_page_prot() implementation via DECLARE_VM_GET_PAGE_PROT, which looks up a private and static protection_map[] array. Subsequently all __SXXX and __PXXX macros can be dropped which are no longer needed. Cc: Jeff Dike

[PATCH V4 25/26] sh/mm: Enable ARCH_HAS_VM_GET_PAGE_PROT

2022-06-23 Thread Anshuman Khandual
This enables ARCH_HAS_VM_GET_PAGE_PROT on the platform and exports standard vm_get_page_prot() implementation via DECLARE_VM_GET_PAGE_PROT, which looks up a private and static protection_map[] array. Subsequently all __SXXX and __PXXX macros can be dropped which are no longer needed. Cc: Yoshinori

[PATCH V4 26/26] mm/mmap: Drop ARCH_HAS_VM_GET_PAGE_PROT

2022-06-23 Thread Anshuman Khandual
Now all the platforms enable ARCH_HAS_GET_PAGE_PROT. They define and export own vm_get_page_prot() whether custom or standard DECLARE_VM_GET_PAGE_PROT. Hence there is no need for default generic fallback for vm_get_page_prot(). Just drop this fallback and also ARCH_HAS_GET_PAGE_PROT mechanism. Cc:

Re: [PATCH V4 01/26] mm/mmap: Build protect protection_map[] with __P000

2022-06-23 Thread Christoph Hellwig
Looks good: Reviewed-by: Christoph Hellwig ___ linux-um mailing list linux-um@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-um

Re: [PATCH V4 02/26] mm/mmap: Define DECLARE_VM_GET_PAGE_PROT

2022-06-23 Thread Christoph Hellwig
On Fri, Jun 24, 2022 at 10:13:15AM +0530, Anshuman Khandual wrote: > This just converts the generic vm_get_page_prot() implementation into a new > macro i.e DECLARE_VM_GET_PAGE_PROT which later can be used across platforms > when enabling them with ARCH_HAS_VM_GET_PAGE_PROT. This does not create an

Re: [PATCH V4 06/26] x86/mm: Move protection_map[] inside the platform

2022-06-23 Thread Christoph Hellwig
Looks good: Reviewed-by: Christoph Hellwig ___ linux-um mailing list linux-um@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-um

Re: [PATCH V4 16/26] riscv/mm: Enable ARCH_HAS_VM_GET_PAGE_PROT

2022-06-23 Thread Christoph Hellwig
On Fri, Jun 24, 2022 at 10:13:29AM +0530, Anshuman Khandual wrote: index d466ec670e1f..f976580500b1 100644 > --- a/arch/riscv/mm/init.c > +++ b/arch/riscv/mm/init.c > @@ -288,6 +288,26 @@ static pmd_t __maybe_unused early_dtb_pmd[PTRS_PER_PMD] > __initdata __aligned(PAG > #define early_pg_dir

Re: [PATCH V4 26/26] mm/mmap: Drop ARCH_HAS_VM_GET_PAGE_PROT

2022-06-23 Thread Christoph Hellwig
Looks good: Reviewed-by: Christoph Hellwig ___ linux-um mailing list linux-um@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-um

Re: [PATCH V4 00/26] mm/mmap: Drop __SXXX/__PXXX macros from across platforms

2022-06-23 Thread Christoph Hellwig
On Fri, Jun 24, 2022 at 10:13:13AM +0530, Anshuman Khandual wrote: > vm_get_page_prot(), in order for it to be reused on platforms that do not > require custom implementation. Finally, ARCH_HAS_VM_GET_PAGE_PROT can just > be dropped, as all platforms now define and export vm_get_page_prot(), via >

Re: [PATCH V4 03/26] powerpc/mm: Move protection_map[] inside the platform

2022-06-23 Thread Christophe Leroy
Le 24/06/2022 à 06:43, Anshuman Khandual a écrit : > This moves protection_map[] inside the platform and while here, also enable > ARCH_HAS_VM_GET_PAGE_PROT on 32 bit platforms via DECLARE_VM_GET_PAGE_PROT. Not only 32 bit platforms, also nohash 64 (aka book3e/64) > > Cc: Michael Ellerman > C

Re: [PATCH V4 00/26] mm/mmap: Drop __SXXX/__PXXX macros from across platforms

2022-06-23 Thread Anshuman Khandual
On 6/24/22 10:42, Christoph Hellwig wrote: > On Fri, Jun 24, 2022 at 10:13:13AM +0530, Anshuman Khandual wrote: >> vm_get_page_prot(), in order for it to be reused on platforms that do not >> require custom implementation. Finally, ARCH_HAS_VM_GET_PAGE_PROT can just >> be dropped, as all platfor

Re: [PATCH V4 00/26] mm/mmap: Drop __SXXX/__PXXX macros from across platforms

2022-06-23 Thread Christoph Hellwig
On Fri, Jun 24, 2022 at 10:50:33AM +0530, Anshuman Khandual wrote: > > On most architectures this should be const now, only very few ever > > modify it. > > Will make it a 'static const pgprot_t protection_map[16] __ro_after_init' > on platforms that do not change the protection_map[] even during

Re: [PATCH V4 07/26] mm/mmap: Build protect protection_map[] with ARCH_HAS_VM_GET_PAGE_PROT

2022-06-23 Thread Christophe Leroy
Le 24/06/2022 à 06:43, Anshuman Khandual a écrit : > protection_map[] has already been moved inside those platforms which enable Usually "already" means before your series. Your series is the one that moves protection_map[] so I would have just said "Now that protection_map[] has been moved in

Re: [PATCH V4 03/26] powerpc/mm: Move protection_map[] inside the platform

2022-06-23 Thread Anshuman Khandual
On 6/24/22 10:48, Christophe Leroy wrote: > > > Le 24/06/2022 à 06:43, Anshuman Khandual a écrit : >> This moves protection_map[] inside the platform and while here, also enable >> ARCH_HAS_VM_GET_PAGE_PROT on 32 bit platforms via DECLARE_VM_GET_PAGE_PROT. > > Not only 32 bit platforms, also n

Re: [PATCH V4 08/26] microblaze/mm: Enable ARCH_HAS_VM_GET_PAGE_PROT

2022-06-23 Thread Christophe Leroy
Le 24/06/2022 à 06:43, Anshuman Khandual a écrit : > This enables ARCH_HAS_VM_GET_PAGE_PROT on the platform and exports standard > vm_get_page_prot() implementation via DECLARE_VM_GET_PAGE_PROT, which looks > up a private and static protection_map[] array. Subsequently all __SXXX and > __PXXX mac

Re: [PATCH V4 02/26] mm/mmap: Define DECLARE_VM_GET_PAGE_PROT

2022-06-23 Thread Christophe Leroy
Le 24/06/2022 à 06:43, Anshuman Khandual a écrit : > This just converts the generic vm_get_page_prot() implementation into a new > macro i.e DECLARE_VM_GET_PAGE_PROT which later can be used across platforms > when enabling them with ARCH_HAS_VM_GET_PAGE_PROT. This does not create any > functional

Re: [PATCH V4 26/26] mm/mmap: Drop ARCH_HAS_VM_GET_PAGE_PROT

2022-06-23 Thread Christophe Leroy
Le 24/06/2022 à 06:43, Anshuman Khandual a écrit : > Now all the platforms enable ARCH_HAS_GET_PAGE_PROT. They define and export > own vm_get_page_prot() whether custom or standard DECLARE_VM_GET_PAGE_PROT. > Hence there is no need for default generic fallback for vm_get_page_prot(). > Just drop

Re: [PATCH V4 07/26] mm/mmap: Build protect protection_map[] with ARCH_HAS_VM_GET_PAGE_PROT

2022-06-23 Thread Anshuman Khandual
On 6/24/22 10:52, Christophe Leroy wrote: > > > Le 24/06/2022 à 06:43, Anshuman Khandual a écrit : >> protection_map[] has already been moved inside those platforms which enable > > Usually "already" means before your series. > > Your series is the one that moves protection_map[] so I would h

Re: [PATCH V4 02/26] mm/mmap: Define DECLARE_VM_GET_PAGE_PROT

2022-06-23 Thread Anshuman Khandual
On 6/24/22 10:39, Christoph Hellwig wrote: > On Fri, Jun 24, 2022 at 10:13:15AM +0530, Anshuman Khandual wrote: >> This just converts the generic vm_get_page_prot() implementation into a new >> macro i.e DECLARE_VM_GET_PAGE_PROT which later can be used across platforms >> when enabling them with

Re: [PATCH V4 02/26] mm/mmap: Define DECLARE_VM_GET_PAGE_PROT

2022-06-23 Thread Anshuman Khandual
On 6/24/22 10:58, Christophe Leroy wrote: > > Le 24/06/2022 à 06:43, Anshuman Khandual a écrit : >> This just converts the generic vm_get_page_prot() implementation into a new >> macro i.e DECLARE_VM_GET_PAGE_PROT which later can be used across platforms >> when enabling them with ARCH_HAS_VM_GE