Skip to contentSkip to conversation

hv_sock: fix ARM64 support

PATCH Applied Hamza Mahfooz 5 participants 6 messages Apr 28 – Apr 30

Subsystems (6)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 hv_sock: fix ARM64 support

VMBUS ring buffers must be page aligned. Therefore, the current value of 24K presents a challenge on ARM64 kernels (with 64K pages). So, use VMBUS_RING_SIZE() to ensure they are always aligned and large enough to hold all of the relevant data.

Fixes 77ffe33363c0 ("hv_sock: use HV_HYP_PAGE_SIZE for Hyper-V communication")
---
 net/vmw_vsock/hyperv_transport.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
net/vmw_vsock/hyperv_transport.c +2 -2
index 069386a74557..40f09b23efa3 100644
@@ -375,10 +375,10 @@ static void hvs_open_connection(struct vmbus_channel *chan)
 	} else {
 		sndbuf = max_t(int, sk->sk_sndbuf, RINGBUFFER_HVS_SND_SIZE);
 		sndbuf = min_t(int, sndbuf, RINGBUFFER_HVS_MAX_SIZE);
-		sndbuf = ALIGN(sndbuf, HV_HYP_PAGE_SIZE);
+		sndbuf = VMBUS_RING_SIZE(sndbuf);
 		rcvbuf = max_t(int, sk->sk_rcvbuf, RINGBUFFER_HVS_RCV_SIZE);
 		rcvbuf = min_t(int, rcvbuf, RINGBUFFER_HVS_MAX_SIZE);
-		rcvbuf = ALIGN(rcvbuf, HV_HYP_PAGE_SIZE);
+		rcvbuf = VMBUS_RING_SIZE(rcvbuf);
 	}
 
 	chan->max_pkt_size = HVS_MAX_PKT_SIZE;
Signature · 1 line
2.54.0
maintainer Acked-by on v1 1/1
#1 lore raw

No version number in the subject?

Please next time follow https://docs.kernel.org/process/submitting-patches.html#subject-line

Common tags might include a version descriptor if the multiple versions of the patch have been sent out in response to comments (i.e., “v1, v2, v3”), or “RFC” to indicate a request for comments.

Quoted 5 lines · Hamza Mahfooz

VMBUS ring buffers must be page aligned. Therefore, the current value of 24K presents a challenge on ARM64 kernels (with 64K pages). So, use VMBUS_RING_SIZE() to ensure they are always aligned and large enough to hold all of the relevant data.

Quoted 8 lines
Fixes 77ffe33363c0 ("hv_sock: use HV_HYP_PAGE_SIZE for Hyper-V communication")

---
net/vmw_vsock/hyperv_transport.c | 4 ++--

1 file changed, 2 insertions(+), 2 deletions(-)
Quoted 21 lines
net/vmw_vsock/hyperv_transport.c +2 -2
index 069386a74557..40f09b23efa3 100644
@@ -375,10 +375,10 @@ static void hvs_open_connection(struct vmbus_channel *chan)
 	} else {
 		sndbuf = max_t(int, sk->sk_sndbuf, RINGBUFFER_HVS_SND_SIZE);
 		sndbuf = min_t(int, sndbuf, RINGBUFFER_HVS_MAX_SIZE);
-		sndbuf = ALIGN(sndbuf, HV_HYP_PAGE_SIZE);
+		sndbuf = VMBUS_RING_SIZE(sndbuf);
 		rcvbuf = max_t(int, sk->sk_rcvbuf, RINGBUFFER_HVS_RCV_SIZE);
 		rcvbuf = min_t(int, rcvbuf, RINGBUFFER_HVS_MAX_SIZE);
-		rcvbuf = ALIGN(rcvbuf, HV_HYP_PAGE_SIZE);
+		rcvbuf = VMBUS_RING_SIZE(rcvbuf);
 	}
 
 	chan->max_pkt_size = HVS_MAX_PKT_SIZE;
Signature · 1 line
2.54.0
#2 lore raw
Quoted 1 line · Stefano Garzarella

No version number in the subject?

I generally on increment the version number if I make changes to the code itself I did try to change the subject prefix to "PATCH RESEND" but it appears something is off about my config that prevented from going through.

Quoted 47 lines

Please next time follow
https://docs.kernel.org/process/submitting-patches.html#subject-line

Common tags might include a version descriptor if the multiple versions
of the patch have been sent out in response to comments (i.e., “v1, v2,
v3”), or “RFC” to indicate a request for comments.

Quoted 5 lines · Hamza Mahfooz

VMBUS ring buffers must be page aligned. Therefore, the current value of 24K presents a challenge on ARM64 kernels (with 64K pages). So, use VMBUS_RING_SIZE() to ensure they are always aligned and large enough to hold all of the relevant data.

Quoted 8 lines
Fixes 77ffe33363c0 ("hv_sock: use HV_HYP_PAGE_SIZE for Hyper-V communication")

---
net/vmw_vsock/hyperv_transport.c | 4 ++--

1 file changed, 2 insertions(+), 2 deletions(-)
Quoted 21 lines
net/vmw_vsock/hyperv_transport.c +2 -2
index 069386a74557..40f09b23efa3 100644
@@ -375,10 +375,10 @@ static void hvs_open_connection(struct vmbus_channel *chan)
 	} else {
 		sndbuf = max_t(int, sk->sk_sndbuf, RINGBUFFER_HVS_SND_SIZE);
 		sndbuf = min_t(int, sndbuf, RINGBUFFER_HVS_MAX_SIZE);
-		sndbuf = ALIGN(sndbuf, HV_HYP_PAGE_SIZE);
+		sndbuf = VMBUS_RING_SIZE(sndbuf);
 		rcvbuf = max_t(int, sk->sk_rcvbuf, RINGBUFFER_HVS_RCV_SIZE);
 		rcvbuf = min_t(int, rcvbuf, RINGBUFFER_HVS_MAX_SIZE);
-		rcvbuf = ALIGN(rcvbuf, HV_HYP_PAGE_SIZE);
+		rcvbuf = VMBUS_RING_SIZE(rcvbuf);
 	}
 
 	chan->max_pkt_size = HVS_MAX_PKT_SIZE;
Signature · 1 line
2.54.0
maintainer
#3 lore raw
In reply to Hamza Mahfooz
Quoted 3 lines

From: Hamza Mahfooz <[email protected]>
Sent: Tuesday, April 28, 2026 5:54 AM
Subject: [PATCH] hv_sock: fix ARM64 support

Typically, for a change to net/, you'd want to add a "net" or "net-next" after the "PATCH", i.e.

[PATCH net]
or
[PATCH net v2]

See "Documentation/process/maintainer-netdev.rst"

maintainer
#4 lore raw
Quoted 11 lines · On Tue, 28 Apr 2026 21:24:59 +0000 Dexuan Cui wrote:
Quoted 2 lines

Sent: Tuesday, April 28, 2026 5:54 AM
Subject: [PATCH] hv_sock: fix ARM64 support

Typically, for a change to net/, you'd want to add a "net" or "net-next" after the "PATCH", i.e.

[PATCH net]
or
[PATCH net v2]

See "Documentation/process/maintainer-netdev.rst"

Speaking of Documentation/process/maintainer-netdev.rst:

Reviewer guidance
-----------------
[...]
Reviewers are highly encouraged to do more in-depth review of submissions and not focus exclusively on process issues, trivial or subjective matters like code formatting, tags etc.

See: https://www.kernel.org/doc/html/next/process/maintainer-netdev.html#reviewer-guidance

#5 lore raw
In reply to Hamza Mahfooz
This patch was applied to netdev/net.git (main) by Jakub Kicinski <[email protected]>:

Hello:

This patch was applied to netdev/net.git (main)
by Jakub Kicinski <[email protected]>:

Quoted 5 lines · On Tue, 28 Apr 2026 08:53:39 -0400 you wrote:

VMBUS ring buffers must be page aligned. Therefore, the current value of 24K presents a challenge on ARM64 kernels (with 64K pages). So, use VMBUS_RING_SIZE() to ensure they are always aligned and large enough to hold all of the relevant data.

Quoted 7 lines
Fixes 77ffe33363c0 ("hv_sock: use HV_HYP_PAGE_SIZE for Hyper-V communication")

[...]

Here is the summary with links:
- hv_sock: fix ARM64 support

    https://git.kernel.org/netdev/net/c/b31681206e3f

You are awesome, thank you!

Signature · 2 lines
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html