public inbox for linux-next@vger.kernel.org 
 help / color / mirror / Atom feed
* linux-next: manual merge of the vhost tree with Linus' tree
@ 2013-05-09  2:04 Stephen Rothwell
  0 siblings, 0 replies; 12+ messages in thread
From: Stephen Rothwell @ 2013-05-09  2:04 UTC (permalink / raw)
  To: Michael S. Tsirkin; +Cc: linux-next, linux-kernel, Rusty Russell

[-- Attachment #1: Type: text/plain, Size: 515 bytes --]

Hi Michael,

Today's linux-next merge of the vhost tree got a conflict in
drivers/vhost/test.c between commit 73640c991e2f ("tools/virtio: fix
build for 3.8") from Linus' tree and commit 30954cbc5818 ("vhost-test:
fix up test module after API change") from the vhost tree.

I fixed it up (the former was a superset of the latter for the
conflicting area, so I used that) and can carry the fix as necessary (no
action is required).

-- 
Cheers,
Stephen Rothwell                    sfr@canb•auug.org.au

[-- Attachment #2: Type: application/pgp-signature, Size: 836 bytes --]

^ permalink raw reply	[flat|nested] 12+ messages in thread

* linux-next: manual merge of the vhost tree with Linus' tree
@ 2015-07-08  1:43 Stephen Rothwell
  0 siblings, 0 replies; 12+ messages in thread
From: Stephen Rothwell @ 2015-07-08  1:43 UTC (permalink / raw)
  To: Michael S. Tsirkin; +Cc: linux-next, linux-kernel, Gerd Hoffmann

[-- Attachment #1: Type: text/plain, Size: 1366 bytes --]

Hi Michael,

Today's linux-next merge of the vhost tree got a conflict in:

  MAINTAINERS

between commit:

  4ad6ee91aa9f ("Add MAINTAINERS entry for virtio-gpu")

from Linus' tree and commit:

  f2dbda3b4fc2 ("MAINTAINERS: separate section for s390 virtio drivers")

from the vhost tree.

I fixed it up (see below) and can carry the fix as necessary (no action
is required).

-- 
Cheers,
Stephen Rothwell                    sfr@canb•auug.org.au

diff --cc MAINTAINERS
index d558d280fdc1,fbef7d0a4dd5..000000000000
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@@ -10895,15 -10570,15 +10894,24 @@@ F:	drivers/block/virtio_blk.
  F:	include/linux/virtio_*.h
  F:	include/uapi/linux/virtio_*.h
  
+ VIRTIO DRIVERS FOR S390
+ M:	Christian Borntraeger <borntraeger@de•ibm.com>
+ M:	Cornelia Huck <cornelia.huck@de•ibm.com>
+ L:	linux-s390@vger•kernel.org
+ L:	virtualization@lists•linux-foundation.org
+ L:	kvm@vger•kernel.org
+ S:	Supported
+ F:	drivers/s390/virtio/
+ 
 +VIRTIO GPU DRIVER
 +M:	David Airlie <airlied@linux•ie>
 +M:	Gerd Hoffmann <kraxel@redhat•com>
 +L:	dri-devel@lists•freedesktop.org
 +L:	virtualization@lists•linux-foundation.org
 +S:	Maintained
 +F:	drivers/gpu/drm/virtio/
 +F:	include/uapi/linux/virtio_gpu.h
 +
  VIRTIO HOST (VHOST)
  M:	"Michael S. Tsirkin" <mst@redhat•com>
  L:	kvm@vger•kernel.org

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

^ permalink raw reply	[flat|nested] 12+ messages in thread

* linux-next: manual merge of the vhost tree with Linus' tree
@ 2015-07-24  3:59 Stephen Rothwell
  0 siblings, 0 replies; 12+ messages in thread
From: Stephen Rothwell @ 2015-07-24  3:59 UTC (permalink / raw)
  To: Michael S. Tsirkin; +Cc: linux-next, linux-kernel, Igor Mammedov

Hi Michael,

Today's linux-next merge of the vhost tree got a conflict in:

  drivers/vhost/vhost.c

between commit:

  4de7255f7d2b ("vhost: extend memory regions allocation to vmalloc")

from Linus' tree and commit:

  a4883f62470c ("vhost: extend memory regions allocation to vmalloc")

from the vhost tree.

These are two slightly different versions of the same patch.  I used
the version from Linus' tree.  Please clean your tree up.

-- 
Cheers,
Stephen Rothwell                    sfr@canb•auug.org.au

^ permalink raw reply	[flat|nested] 12+ messages in thread

* linux-next: manual merge of the vhost tree with Linus' tree
@ 2019-01-03  1:39 Stephen Rothwell
  0 siblings, 0 replies; 12+ messages in thread
From: Stephen Rothwell @ 2019-01-03  1:39 UTC (permalink / raw)
  To: Michael S. Tsirkin
  Cc: Linux Next Mailing List, Linux Kernel Mailing List, Tiwei Bie,
	David S. Miller

[-- Attachment #1: Type: text/plain, Size: 2467 bytes --]

Hi all,

Today's linux-next merge of the vhost tree got a conflict in:

  drivers/virtio/virtio_ring.c

between commit:

  138fd2514863 ("virtio_ring: add _split suffix for split ring functions")
and various other commits

from Linus' tree and commit:

  7f86a211fabe ("virtio: use dependent_ptr_mb")

from the vhost tree.

I fixed it up (I think, basically I added the changes form the latter
to the _split and _packed versions of the function - see below) and can
carry the fix as necessary. This is now fixed as far as linux-next is
concerned, but any non trivial conflicts should be mentioned to your
upstream maintainer when your tree is submitted for merging.  You may
also want to consider cooperating with the maintainer of the
conflicting tree to minimise any particularly complex conflicts.

-- 
Cheers,
Stephen Rothwell

diff --git a/drivers/virtio/virtio_ring.c b/drivers/virtio/virtio_ring.c
index cd7e755484e3..982e1ed4ecdf 100644
--- a/drivers/virtio/virtio_ring.c
+++ b/drivers/virtio/virtio_ring.c
@@ -676,6 +676,7 @@ static void *virtqueue_get_buf_ctx_split(struct virtqueue *_vq,
 	void *ret;
 	unsigned int i;
 	u16 last_used;
+	bool more;
 
 	START_USE(vq);
 
@@ -684,14 +685,15 @@ static void *virtqueue_get_buf_ctx_split(struct virtqueue *_vq,
 		return NULL;
 	}
 
-	if (!more_used_split(vq)) {
+	more = more_used_split(vq);
+	if (!more) {
 		pr_debug("No more buffers in queue\n");
 		END_USE(vq);
 		return NULL;
 	}
 
 	/* Only get used array entries after they have been exposed by host. */
-	virtio_rmb(vq->weak_barriers);
+	vq = dependent_ptr_mb(vq, more);
 
 	last_used = (vq->last_used_idx & (vq->split.vring.num - 1));
 	i = virtio32_to_cpu(_vq->vdev,
@@ -1340,6 +1342,7 @@ static void *virtqueue_get_buf_ctx_packed(struct virtqueue *_vq,
 	struct vring_virtqueue *vq = to_vvq(_vq);
 	u16 last_used, id;
 	void *ret;
+	bool more;
 
 	START_USE(vq);
 
@@ -1348,14 +1351,15 @@ static void *virtqueue_get_buf_ctx_packed(struct virtqueue *_vq,
 		return NULL;
 	}
 
-	if (!more_used_packed(vq)) {
+	more = more_used_packed(vq);
+	if (!more) {
 		pr_debug("No more buffers in queue\n");
 		END_USE(vq);
 		return NULL;
 	}
 
 	/* Only get used elements after they have been exposed by host. */
-	virtio_rmb(vq->weak_barriers);
+	vq = dependent_ptr_mb(vq, more);
 
 	last_used = vq->last_used_idx;
 	id = le16_to_cpu(vq->packed.vring.desc[last_used].id);

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

^ permalink raw reply related	[flat|nested] 12+ messages in thread

* linux-next: manual merge of the vhost tree with Linus' tree
@ 2019-12-04  3:00 Stephen Rothwell
  2019-12-09  0:40 ` Stephen Rothwell
  0 siblings, 1 reply; 12+ messages in thread
From: Stephen Rothwell @ 2019-12-04  3:00 UTC (permalink / raw)
  To: Michael S. Tsirkin
  Cc: Linux Next Mailing List, Linux Kernel Mailing List,
	Grygorii Strashko, David S. Miller

[-- Attachment #1: Type: text/plain, Size: 2637 bytes --]

Hi all,

Today's linux-next merge of the vhost tree got a conflict in:

  drivers/net/ethernet/ti/cpsw.c

between commit:

  c5013ac1dd0e ("net: ethernet: ti: cpsw: move set of common functions in cpsw_priv")

from Linus' tree and commit:

  29fd1db09264 ("netdev: pass the stuck queue to the timeout handler")

from the vhost tree.

I fixed it up (the code has been moved, so I applied the following merge
fix patch) and can carry the fix as necessary. This is now fixed as far as
linux-next is concerned, but any non trivial conflicts should be mentioned
to your upstream maintainer when your tree is submitted for merging.
You may also want to consider cooperating with the maintainer of the
conflicting tree to minimise any particularly complex conflicts.

From: Stephen Rothwell <sfr@canb•auug.org.au>
Date: Wed, 4 Dec 2019 13:55:43 +1100
Subject: [PATCH] netdev: fix up for "pass the stuck queue to the timeout
 handler"

cpsw_ndo_tx_timeout() was moved

Signed-off-by: Stephen Rothwell <sfr@canb•auug.org.au>
---
 drivers/net/ethernet/ti/cpsw_priv.c | 2 +-
 drivers/net/ethernet/ti/cpsw_priv.h | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/net/ethernet/ti/cpsw_priv.c b/drivers/net/ethernet/ti/cpsw_priv.c
index b833cc1d188c..4205c52ea86b 100644
--- a/drivers/net/ethernet/ti/cpsw_priv.c
+++ b/drivers/net/ethernet/ti/cpsw_priv.c
@@ -272,7 +272,7 @@ void soft_reset(const char *module, void __iomem *reg)
 	WARN(readl_relaxed(reg) & 1, "failed to soft-reset %s\n", module);
 }
 
-void cpsw_ndo_tx_timeout(struct net_device *ndev)
+void cpsw_ndo_tx_timeout(struct net_device *ndev, unsigned int txqueue)
 {
 	struct cpsw_priv *priv = netdev_priv(ndev);
 	struct cpsw_common *cpsw = priv->cpsw;
diff --git a/drivers/net/ethernet/ti/cpsw_priv.h b/drivers/net/ethernet/ti/cpsw_priv.h
index bc726356a72c..b8d7b924ee3d 100644
--- a/drivers/net/ethernet/ti/cpsw_priv.h
+++ b/drivers/net/ethernet/ti/cpsw_priv.h
@@ -449,7 +449,7 @@ int cpsw_rx_poll(struct napi_struct *napi_rx, int budget);
 void cpsw_rx_vlan_encap(struct sk_buff *skb);
 void soft_reset(const char *module, void __iomem *reg);
 void cpsw_set_slave_mac(struct cpsw_slave *slave, struct cpsw_priv *priv);
-void cpsw_ndo_tx_timeout(struct net_device *ndev);
+void cpsw_ndo_tx_timeout(struct net_device *ndev, unsigned int txqueue);
 int cpsw_need_resplit(struct cpsw_common *cpsw);
 int cpsw_ndo_ioctl(struct net_device *dev, struct ifreq *req, int cmd);
 int cpsw_ndo_set_tx_maxrate(struct net_device *ndev, int queue, u32 rate);
-- 
2.24.0

-- 
Cheers,
Stephen Rothwell

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

^ permalink raw reply related	[flat|nested] 12+ messages in thread

* Re: linux-next: manual merge of the vhost tree with Linus' tree
  2019-12-04  3:00 Stephen Rothwell
@ 2019-12-09  0:40 ` Stephen Rothwell
  0 siblings, 0 replies; 12+ messages in thread
From: Stephen Rothwell @ 2019-12-09  0:40 UTC (permalink / raw)
  To: Michael S. Tsirkin
  Cc: Linux Next Mailing List, Linux Kernel Mailing List,
	Grygorii Strashko, David S. Miller

[-- Attachment #1: Type: text/plain, Size: 2888 bytes --]

Hi Michael,

On Wed, 4 Dec 2019 14:00:52 +1100 Stephen Rothwell <sfr@canb•auug.org.au> wrote:
>
> Today's linux-next merge of the vhost tree got a conflict in:
> 
>   drivers/net/ethernet/ti/cpsw.c
> 
> between commit:
> 
>   c5013ac1dd0e ("net: ethernet: ti: cpsw: move set of common functions in cpsw_priv")
> 
> from Linus' tree and commit:
> 
>   29fd1db09264 ("netdev: pass the stuck queue to the timeout handler")
> 
> from the vhost tree.
> 
> I fixed it up (the code has been moved, so I applied the following merge
> fix patch) and can carry the fix as necessary. This is now fixed as far as
> linux-next is concerned, but any non trivial conflicts should be mentioned
> to your upstream maintainer when your tree is submitted for merging.
> You may also want to consider cooperating with the maintainer of the
> conflicting tree to minimise any particularly complex conflicts.
> 
> From: Stephen Rothwell <sfr@canb•auug.org.au>
> Date: Wed, 4 Dec 2019 13:55:43 +1100
> Subject: [PATCH] netdev: fix up for "pass the stuck queue to the timeout
>  handler"
> 
> cpsw_ndo_tx_timeout() was moved
> 
> Signed-off-by: Stephen Rothwell <sfr@canb•auug.org.au>
> ---
>  drivers/net/ethernet/ti/cpsw_priv.c | 2 +-
>  drivers/net/ethernet/ti/cpsw_priv.h | 2 +-
>  2 files changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/net/ethernet/ti/cpsw_priv.c b/drivers/net/ethernet/ti/cpsw_priv.c
> index b833cc1d188c..4205c52ea86b 100644
> --- a/drivers/net/ethernet/ti/cpsw_priv.c
> +++ b/drivers/net/ethernet/ti/cpsw_priv.c
> @@ -272,7 +272,7 @@ void soft_reset(const char *module, void __iomem *reg)
>  	WARN(readl_relaxed(reg) & 1, "failed to soft-reset %s\n", module);
>  }
>  
> -void cpsw_ndo_tx_timeout(struct net_device *ndev)
> +void cpsw_ndo_tx_timeout(struct net_device *ndev, unsigned int txqueue)
>  {
>  	struct cpsw_priv *priv = netdev_priv(ndev);
>  	struct cpsw_common *cpsw = priv->cpsw;
> diff --git a/drivers/net/ethernet/ti/cpsw_priv.h b/drivers/net/ethernet/ti/cpsw_priv.h
> index bc726356a72c..b8d7b924ee3d 100644
> --- a/drivers/net/ethernet/ti/cpsw_priv.h
> +++ b/drivers/net/ethernet/ti/cpsw_priv.h
> @@ -449,7 +449,7 @@ int cpsw_rx_poll(struct napi_struct *napi_rx, int budget);
>  void cpsw_rx_vlan_encap(struct sk_buff *skb);
>  void soft_reset(const char *module, void __iomem *reg);
>  void cpsw_set_slave_mac(struct cpsw_slave *slave, struct cpsw_priv *priv);
> -void cpsw_ndo_tx_timeout(struct net_device *ndev);
> +void cpsw_ndo_tx_timeout(struct net_device *ndev, unsigned int txqueue);
>  int cpsw_need_resplit(struct cpsw_common *cpsw);
>  int cpsw_ndo_ioctl(struct net_device *dev, struct ifreq *req, int cmd);
>  int cpsw_ndo_set_tx_maxrate(struct net_device *ndev, int queue, u32 rate);
> -- 
> 2.24.0

I still need the above merge fix up.
-- 
Cheers,
Stephen Rothwell

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

^ permalink raw reply	[flat|nested] 12+ messages in thread

* linux-next: manual merge of the vhost tree with Linus' tree
@ 2021-09-06  2:28 Stephen Rothwell
  2021-09-06  2:56 ` Yongji Xie
  0 siblings, 1 reply; 12+ messages in thread
From: Stephen Rothwell @ 2021-09-06  2:28 UTC (permalink / raw)
  To: Michael S. Tsirkin
  Cc: Linux Kernel Mailing List, Linux Next Mailing List,
	Thomas Gleixner, Xie Yongji

[-- Attachment #1: Type: text/plain, Size: 780 bytes --]

Hi all,

Today's linux-next merge of the vhost tree got a conflict in:

  fs/eventfd.c

between commit:

  b542e383d8c0 ("eventfd: Make signal recursion protection a task bit")

from Linus' tree and commit:

  0afdb2abbff3 ("eventfd: Export eventfd_wake_count to modules")

from the vhost tree.

I fixed it up (I removed eventfd_wake_count as I could not see any added
use for it) and can carry the fix as necessary. This is now fixed as
far as linux-next is concerned, but any non trivial conflicts should be
mentioned to your upstream maintainer when your tree is submitted for
merging.  You may also want to consider cooperating with the maintainer
of the conflicting tree to minimise any particularly complex conflicts.

-- 
Cheers,
Stephen Rothwell

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: linux-next: manual merge of the vhost tree with Linus' tree
  2021-09-06  2:28 Stephen Rothwell
@ 2021-09-06  2:56 ` Yongji Xie
  0 siblings, 0 replies; 12+ messages in thread
From: Yongji Xie @ 2021-09-06  2:56 UTC (permalink / raw)
  To: Stephen Rothwell
  Cc: Michael S. Tsirkin, Linux Kernel Mailing List,
	Linux Next Mailing List, Thomas Gleixner

On Mon, Sep 6, 2021 at 10:28 AM Stephen Rothwell <sfr@canb•auug.org.au> wrote:
>
> Hi all,
>
> Today's linux-next merge of the vhost tree got a conflict in:
>
>   fs/eventfd.c
>
> between commit:
>
>   b542e383d8c0 ("eventfd: Make signal recursion protection a task bit")
>
> from Linus' tree and commit:
>
>   0afdb2abbff3 ("eventfd: Export eventfd_wake_count to modules")
>
> from the vhost tree.
>
> I fixed it up (I removed eventfd_wake_count as I could not see any added
> use for it) and can carry the fix as necessary. This is now fixed as
> far as linux-next is concerned, but any non trivial conflicts should be
> mentioned to your upstream maintainer when your tree is submitted for
> merging.  You may also want to consider cooperating with the maintainer
> of the conflicting tree to minimise any particularly complex conflicts.
>

Yes, I think we can safely remove the commit 0afdb2abbff3 ("eventfd:
Export eventfd_wake_count to modules") after the commit b542e383d8c0
applied.

Thanks,
Yongji

^ permalink raw reply	[flat|nested] 12+ messages in thread

* linux-next: manual merge of the vhost tree with Linus' tree
@ 2022-12-19 23:05 Stephen Rothwell
  0 siblings, 0 replies; 12+ messages in thread
From: Stephen Rothwell @ 2022-12-19 23:05 UTC (permalink / raw)
  To: Michael S. Tsirkin
  Cc: Al Viro, Bobby Eshleman, Linux Kernel Mailing List,
	Linux Next Mailing List

[-- Attachment #1: Type: text/plain, Size: 2267 bytes --]

Hi all,

Today's linux-next merge of the vhost tree got a conflict in:

  drivers/vhost/vsock.c

between commit:

  de4eda9de2d9 ("use less confusing names for iov_iter direction initializers")

from Linus' tree and commit:

  101cf89e8d08 ("virtio/vsock: replace virtio_vsock_pkt with sk_buff")

from the vhost tree.

I fixed it up (see below) and can carry the fix as necessary. This
is now fixed as far as linux-next is concerned, but any non trivial
conflicts should be mentioned to your upstream maintainer when your tree
is submitted for merging.  You may also want to consider cooperating
with the maintainer of the conflicting tree to minimise any particularly
complex conflicts.

-- 
Cheers,
Stephen Rothwell

diff --cc drivers/vhost/vsock.c
index cd6f7776013a,830bc823addc..000000000000
--- a/drivers/vhost/vsock.c
+++ b/drivers/vhost/vsock.c
@@@ -165,8 -157,9 +157,9 @@@ vhost_transport_do_send_pkt(struct vhos
  			break;
  		}
  
 -		iov_iter_init(&iov_iter, READ, &vq->iov[out], in, iov_len);
 +		iov_iter_init(&iov_iter, ITER_DEST, &vq->iov[out], in, iov_len);
- 		payload_len = pkt->len - pkt->off;
+ 		payload_len = skb->len;
+ 		hdr = virtio_vsock_hdr(skb);
  
  		/* If the packet is greater than the space available in the
  		 * buffer, we split it using multiple buffers.
@@@ -366,18 -340,21 +340,22 @@@ vhost_vsock_alloc_skb(struct vhost_virt
  		return NULL;
  	}
  
- 	pkt = kzalloc(sizeof(*pkt), GFP_KERNEL);
- 	if (!pkt)
+ 	len = iov_length(vq->iov, out);
+ 
+ 	/* len contains both payload and hdr */
+ 	skb = virtio_vsock_alloc_skb(len, GFP_KERNEL);
+ 	if (!skb)
  		return NULL;
  
 -	iov_iter_init(&iov_iter, WRITE, vq->iov, out, len);
 +	len = iov_length(vq->iov, out);
 +	iov_iter_init(&iov_iter, ITER_SOURCE, vq->iov, out, len);
  
- 	nbytes = copy_from_iter(&pkt->hdr, sizeof(pkt->hdr), &iov_iter);
- 	if (nbytes != sizeof(pkt->hdr)) {
+ 	hdr = virtio_vsock_hdr(skb);
+ 	nbytes = copy_from_iter(hdr, sizeof(*hdr), &iov_iter);
+ 	if (nbytes != sizeof(*hdr)) {
  		vq_err(vq, "Expected %zu bytes for pkt->hdr, got %zu bytes\n",
- 		       sizeof(pkt->hdr), nbytes);
- 		kfree(pkt);
+ 		       sizeof(*hdr), nbytes);
+ 		kfree_skb(skb);
  		return NULL;
  	}
  

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

^ permalink raw reply	[flat|nested] 12+ messages in thread

* linux-next: manual merge of the vhost tree with Linus' tree
@ 2025-11-17  5:51 Stephen Rothwell
  2025-11-17  6:29 ` Stephen Rothwell
  2025-11-17 15:21 ` Jonathan Corbet
  0 siblings, 2 replies; 12+ messages in thread
From: Stephen Rothwell @ 2025-11-17  5:51 UTC (permalink / raw)
  To: Michael S. Tsirkin, Jonathan Corbet
  Cc: Linux Kernel Mailing List, Linux Next Mailing List

[-- Attachment #1: Type: text/plain, Size: 6923 bytes --]

Hi all,

Today's linux-next merge of the vhost tree got a conflict in:

  scripts/lib/kdoc/kdoc_parser.py

between commit:

  77e3c875f0a8 ("docs: kdoc: split struct-member rewriting out of dump_struct()")

from Linus' tree (and maybe some others) and commit:

  67ae57499e77 ("virtio: clean up features qword/dword terms")

from the vhost tree.

I fixed it up (see below) and can carry the fix as necessary. This
is now fixed as far as linux-next is concerned, but any non trivial
conflicts should be mentioned to your upstream maintainer when your tree
is submitted for merging.  You may also want to consider cooperating
with the maintainer of the conflicting tree to minimise any particularly
complex conflicts.

-- 
Cheers,
Stephen Rothwell

diff --cc scripts/lib/kdoc/kdoc_parser.py
index f7dbb0868367,5d629aebc8f0..000000000000
--- a/scripts/lib/kdoc/kdoc_parser.py
+++ b/scripts/lib/kdoc/kdoc_parser.py
@@@ -72,133 -74,6 +72,134 @@@ doc_begin_func = KernRe(str(doc_com) 
                          r'(?:[-:].*)?$',		# description (not captured)
                          cache = False)
  
 +#
 +# Here begins a long set of transformations to turn structure member prefixes
 +# and macro invocations into something we can parse and generate kdoc for.
 +#
 +struct_args_pattern = r'([^,)]+)'
 +
 +struct_xforms = [
 +    # Strip attributes
 +    (KernRe(r"__attribute__\s*\(\([a-z0-9,_\*\s\(\)]*\)\)", flags=re.I | re.S, cache=False), ' '),
 +    (KernRe(r'\s*__aligned\s*\([^;]*\)', re.S), ' '),
 +    (KernRe(r'\s*__counted_by\s*\([^;]*\)', re.S), ' '),
 +    (KernRe(r'\s*__counted_by_(le|be)\s*\([^;]*\)', re.S), ' '),
 +    (KernRe(r'\s*__packed\s*', re.S), ' '),
 +    (KernRe(r'\s*CRYPTO_MINALIGN_ATTR', re.S), ' '),
 +    (KernRe(r'\s*____cacheline_aligned_in_smp', re.S), ' '),
 +    (KernRe(r'\s*____cacheline_aligned', re.S), ' '),
 +    (KernRe(r'\s*__cacheline_group_(begin|end)\([^\)]+\);'), ''),
 +    #
 +    # Unwrap struct_group macros based on this definition:
 +    # __struct_group(TAG, NAME, ATTRS, MEMBERS...)
 +    # which has variants like: struct_group(NAME, MEMBERS...)
 +    # Only MEMBERS arguments require documentation.
 +    #
 +    # Parsing them happens on two steps:
 +    #
 +    # 1. drop struct group arguments that aren't at MEMBERS,
 +    #    storing them as STRUCT_GROUP(MEMBERS)
 +    #
 +    # 2. remove STRUCT_GROUP() ancillary macro.
 +    #
 +    # The original logic used to remove STRUCT_GROUP() using an
 +    # advanced regex:
 +    #
 +    #   \bSTRUCT_GROUP(\(((?:(?>[^)(]+)|(?1))*)\))[^;]*;
 +    #
 +    # with two patterns that are incompatible with
 +    # Python re module, as it has:
 +    #
 +    #   - a recursive pattern: (?1)
 +    #   - an atomic grouping: (?>...)
 +    #
 +    # I tried a simpler version: but it didn't work either:
 +    #   \bSTRUCT_GROUP\(([^\)]+)\)[^;]*;
 +    #
 +    # As it doesn't properly match the end parenthesis on some cases.
 +    #
 +    # So, a better solution was crafted: there's now a NestedMatch
 +    # class that ensures that delimiters after a search are properly
 +    # matched. So, the implementation to drop STRUCT_GROUP() will be
 +    # handled in separate.
 +    #
 +    (KernRe(r'\bstruct_group\s*\(([^,]*,)', re.S), r'STRUCT_GROUP('),
 +    (KernRe(r'\bstruct_group_attr\s*\(([^,]*,){2}', re.S), r'STRUCT_GROUP('),
 +    (KernRe(r'\bstruct_group_tagged\s*\(([^,]*),([^,]*),', re.S), r'struct \1 \2; STRUCT_GROUP('),
 +    (KernRe(r'\b__struct_group\s*\(([^,]*,){3}', re.S), r'STRUCT_GROUP('),
 +    #
 +    # Replace macros
 +    #
 +    # TODO: use NestedMatch for FOO($1, $2, ...) matches
 +    #
 +    # it is better to also move those to the NestedMatch logic,
 +    # to ensure that parenthesis will be properly matched.
 +    #
 +    (KernRe(r'__ETHTOOL_DECLARE_LINK_MODE_MASK\s*\(([^\)]+)\)', re.S),
 +     r'DECLARE_BITMAP(\1, __ETHTOOL_LINK_MODE_MASK_NBITS)'),
 +    (KernRe(r'DECLARE_PHY_INTERFACE_MASK\s*\(([^\)]+)\)', re.S),
 +     r'DECLARE_BITMAP(\1, PHY_INTERFACE_MODE_MAX)'),
 +    (KernRe(r'DECLARE_BITMAP\s*\(' + struct_args_pattern + r',\s*' + struct_args_pattern + r'\)',
 +            re.S), r'unsigned long \1[BITS_TO_LONGS(\2)]'),
 +    (KernRe(r'DECLARE_HASHTABLE\s*\(' + struct_args_pattern + r',\s*' + struct_args_pattern + r'\)',
 +            re.S), r'unsigned long \1[1 << ((\2) - 1)]'),
 +    (KernRe(r'DECLARE_KFIFO\s*\(' + struct_args_pattern + r',\s*' + struct_args_pattern +
 +            r',\s*' + struct_args_pattern + r'\)', re.S), r'\2 *\1'),
 +    (KernRe(r'DECLARE_KFIFO_PTR\s*\(' + struct_args_pattern + r',\s*' +
 +            struct_args_pattern + r'\)', re.S), r'\2 *\1'),
 +    (KernRe(r'(?:__)?DECLARE_FLEX_ARRAY\s*\(' + struct_args_pattern + r',\s*' +
 +            struct_args_pattern + r'\)', re.S), r'\1 \2[]'),
 +    (KernRe(r'DEFINE_DMA_UNMAP_ADDR\s*\(' + struct_args_pattern + r'\)', re.S), r'dma_addr_t \1'),
 +    (KernRe(r'DEFINE_DMA_UNMAP_LEN\s*\(' + struct_args_pattern + r'\)', re.S), r'__u32 \1'),
++    (KernRe(r'VIRTIO_DECLARE_FEATURES\s*\(' + args_pattern + r'\)', re.S), r'u64 \1; u64 \1_array[VIRTIO_FEATURES_QWORDS]'),
 +]
 +#
 +# Regexes here are guaranteed to have the end limiter matching
 +# the start delimiter. Yet, right now, only one replace group
 +# is allowed.
 +#
 +struct_nested_prefixes = [
 +    (re.compile(r'\bSTRUCT_GROUP\('), r'\1'),
 +]
 +
 +#
 +# Transforms for function prototypes
 +#
 +function_xforms  = [
 +    (KernRe(r"^static +"), ""),
 +    (KernRe(r"^extern +"), ""),
 +    (KernRe(r"^asmlinkage +"), ""),
 +    (KernRe(r"^inline +"), ""),
 +    (KernRe(r"^__inline__ +"), ""),
 +    (KernRe(r"^__inline +"), ""),
 +    (KernRe(r"^__always_inline +"), ""),
 +    (KernRe(r"^noinline +"), ""),
 +    (KernRe(r"^__FORTIFY_INLINE +"), ""),
 +    (KernRe(r"__init +"), ""),
 +    (KernRe(r"__init_or_module +"), ""),
 +    (KernRe(r"__deprecated +"), ""),
 +    (KernRe(r"__flatten +"), ""),
 +    (KernRe(r"__meminit +"), ""),
 +    (KernRe(r"__must_check +"), ""),
 +    (KernRe(r"__weak +"), ""),
 +    (KernRe(r"__sched +"), ""),
 +    (KernRe(r"_noprof"), ""),
 +    (KernRe(r"__printf\s*\(\s*\d*\s*,\s*\d*\s*\) +"), ""),
 +    (KernRe(r"__(?:re)?alloc_size\s*\(\s*\d+\s*(?:,\s*\d+\s*)?\) +"), ""),
 +    (KernRe(r"__diagnose_as\s*\(\s*\S+\s*(?:,\s*\d+\s*)*\) +"), ""),
 +    (KernRe(r"DECL_BUCKET_PARAMS\s*\(\s*(\S+)\s*,\s*(\S+)\s*\)"), r"\1, \2"),
 +    (KernRe(r"__attribute_const__ +"), ""),
 +    (KernRe(r"__attribute__\s*\(\((?:[\w\s]+(?:\([^)]*\))?\s*,?)+\)\)\s+"), ""),
 +]
 +
 +#
 +# Apply a set of transforms to a block of text.
 +#
 +def apply_transforms(xforms, text):
 +    for search, subst in xforms:
 +        text = search.sub(subst, text)
 +    return text
 +
  #
  # A little helper to get rid of excess white space
  #

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: linux-next: manual merge of the vhost tree with Linus' tree
  2025-11-17  5:51 Stephen Rothwell
@ 2025-11-17  6:29 ` Stephen Rothwell
  2025-11-17 15:21 ` Jonathan Corbet
  1 sibling, 0 replies; 12+ messages in thread
From: Stephen Rothwell @ 2025-11-17  6:29 UTC (permalink / raw)
  To: Michael S. Tsirkin, Jonathan Corbet
  Cc: Linux Kernel Mailing List, Linux Next Mailing List

[-- Attachment #1: Type: text/plain, Size: 588 bytes --]

Hi all,

On Mon, 17 Nov 2025 16:51:18 +1100 Stephen Rothwell <sfr@canb•auug.org.au> wrote:
>
>  +    (KernRe(r'DEFINE_DMA_UNMAP_ADDR\s*\(' + struct_args_pattern + r'\)', re.S), r'dma_addr_t \1'),
>  +    (KernRe(r'DEFINE_DMA_UNMAP_LEN\s*\(' + struct_args_pattern + r'\)', re.S), r'__u32 \1'),
> ++    (KernRe(r'VIRTIO_DECLARE_FEATURES\s*\(' + args_pattern + r'\)', re.S), r'u64 \1; u64 \1_array[VIRTIO_FEATURES_QWORDS]'),
                                                  ^^^^
oops, I will fix that up (should be "struct_args_pattern" I assume.

-- 
Cheers,
Stephen Rothwell

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: linux-next: manual merge of the vhost tree with Linus' tree
  2025-11-17  5:51 Stephen Rothwell
  2025-11-17  6:29 ` Stephen Rothwell
@ 2025-11-17 15:21 ` Jonathan Corbet
  1 sibling, 0 replies; 12+ messages in thread
From: Jonathan Corbet @ 2025-11-17 15:21 UTC (permalink / raw)
  To: Stephen Rothwell, Michael S. Tsirkin
  Cc: Linux Kernel Mailing List, Linux Next Mailing List

Stephen Rothwell <sfr@canb•auug.org.au> writes:

> Hi all,
>
> Today's linux-next merge of the vhost tree got a conflict in:
>
>   scripts/lib/kdoc/kdoc_parser.py
>
> between commit:
>
>   77e3c875f0a8 ("docs: kdoc: split struct-member rewriting out of dump_struct()")
>
> from Linus' tree (and maybe some others) and commit:
>
>   67ae57499e77 ("virtio: clean up features qword/dword terms")
>
> from the vhost tree.

Sigh ... I would really rather not have random trees reaching into the
kerneldoc machinery, especially during a time when said machinery is
under heavy modification.

It looks like v4 takes that hunk out?  I would be glad to carry a
corresponding fix through docs.

Thanks,

jon

^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2025-11-17 15:21 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-01-03  1:39 linux-next: manual merge of the vhost tree with Linus' tree Stephen Rothwell
  -- strict thread matches above, loose matches on Subject: below --
2025-11-17  5:51 Stephen Rothwell
2025-11-17  6:29 ` Stephen Rothwell
2025-11-17 15:21 ` Jonathan Corbet
2022-12-19 23:05 Stephen Rothwell
2021-09-06  2:28 Stephen Rothwell
2021-09-06  2:56 ` Yongji Xie
2019-12-04  3:00 Stephen Rothwell
2019-12-09  0:40 ` Stephen Rothwell
2015-07-24  3:59 Stephen Rothwell
2015-07-08  1:43 Stephen Rothwell
2013-05-09  2:04 Stephen Rothwell

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox