diff mbox series

net/af_iucv: fix virtual vs physical address confusion

Message ID 20240215080500.2616848-1-agordeev@linux.ibm.com (mailing list archive)
State Accepted
Commit 9eda38dc9150c260ae74edd2e1fe2e2b6fc62cee
Delegated to: Netdev Maintainers
Headers show
Series net/af_iucv: fix virtual vs physical address confusion | expand

Checks

Context Check Description
netdev/series_format warning Single patches do not need cover letters; Target tree name not specified in the subject
netdev/tree_selection success Guessed tree name to be net-next
netdev/ynl success Generated files up to date; no warnings/errors; no diff in generated;
netdev/fixes_present success Fixes tag not required for -next series
netdev/header_inline success No static functions without inline keyword in header files
netdev/build_32bit success Errors and warnings before: 8 this patch: 8
netdev/build_tools success No tools touched, skip
netdev/cc_maintainers warning 3 maintainers not CCed: pabeni@redhat.com kuba@kernel.org edumazet@google.com
netdev/build_clang success Errors and warnings before: 8 this patch: 8
netdev/verify_signedoff success Signed-off-by tag matches author and committer
netdev/deprecated_api success None detected
netdev/check_selftest success No net selftest shell script
netdev/verify_fixes success No Fixes tag
netdev/build_allmodconfig_warn success Errors and warnings before: 8 this patch: 8
netdev/checkpatch warning WARNING: line length of 95 exceeds 80 columns
netdev/build_clang_rust success No Rust files in patch. Skipping build
netdev/kdoc success Errors and warnings before: 0 this patch: 0
netdev/source_inline success Was 0 now: 0
netdev/contest success net-next-2024-02-16--06-00 (tests: 1443)

Commit Message

Alexander Gordeev Feb. 15, 2024, 8:05 a.m. UTC
Fix virtual vs physical address confusion. This does not fix a bug
since virtual and physical address spaces are currently the same.

Signed-off-by: Alexander Gordeev <agordeev@linux.ibm.com>
---
 net/iucv/af_iucv.c | 10 ++++------
 1 file changed, 4 insertions(+), 6 deletions(-)

Comments

Alexandra Winter Feb. 15, 2024, 1:36 p.m. UTC | #1
On 15.02.24 09:05, Alexander Gordeev wrote:
> Fix virtual vs physical address confusion. This does not fix a bug
> since virtual and physical address spaces are currently the same.
> 
> Signed-off-by: Alexander Gordeev <agordeev@linux.ibm.com>
> ---
>  net/iucv/af_iucv.c | 10 ++++------
>  1 file changed, 4 insertions(+), 6 deletions(-)
> 
> diff --git a/net/iucv/af_iucv.c b/net/iucv/af_iucv.c
> index 498a0c35b7bb..4aa1c72e6c49 100644
> --- a/net/iucv/af_iucv.c
> +++ b/net/iucv/af_iucv.c
> @@ -1060,13 +1060,12 @@ static int iucv_sock_sendmsg(struct socket *sock, struct msghdr *msg,
>  			int i;
>  
>  			/* skip iucv_array lying in the headroom */
> -			iba[0].address = (u32)(addr_t)skb->data;
> +			iba[0].address = (u32)virt_to_phys(skb->data);
>  			iba[0].length = (u32)skb_headlen(skb);
>  			for (i = 0; i < skb_shinfo(skb)->nr_frags; i++) {
>  				skb_frag_t *frag = &skb_shinfo(skb)->frags[i];
>  
> -				iba[i + 1].address =
> -					(u32)(addr_t)skb_frag_address(frag);
> +				iba[i + 1].address = (u32)virt_to_phys(skb_frag_address(frag));
>  				iba[i + 1].length = (u32)skb_frag_size(frag);
>  			}
>  			err = pr_iucv->message_send(iucv->path, &txmsg,
> @@ -1162,13 +1161,12 @@ static void iucv_process_message(struct sock *sk, struct sk_buff *skb,
>  			struct iucv_array *iba = (struct iucv_array *)skb->head;
>  			int i;
>  
> -			iba[0].address = (u32)(addr_t)skb->data;
> +			iba[0].address = (u32)virt_to_phys(skb->data);
>  			iba[0].length = (u32)skb_headlen(skb);
>  			for (i = 0; i < skb_shinfo(skb)->nr_frags; i++) {
>  				skb_frag_t *frag = &skb_shinfo(skb)->frags[i];
>  
> -				iba[i + 1].address =
> -					(u32)(addr_t)skb_frag_address(frag);
> +				iba[i + 1].address = (u32)virt_to_phys(skb_frag_address(frag));
>  				iba[i + 1].length = (u32)skb_frag_size(frag);
>  			}
>  			rc = pr_iucv->message_receive(path, msg,


Reviewed-by: Alexandra Winter <wintera@linux.ibm.com>

I would have preferred to do all the translations in __iucv_* functions in iucv.c,
but I understand that for __iucv_message_receive() this would mean significant changes.
Jakub Kicinski Feb. 21, 2024, 10:31 p.m. UTC | #2
On Thu, 15 Feb 2024 14:36:57 +0100 Alexandra Winter wrote:
> I would have preferred to do all the translations in __iucv_* functions in iucv.c,
> but I understand that for __iucv_message_receive() this would mean significant changes. 

FWIW we're assuming this is going via the s390 tree.
Please let us know if you prefer networking to pick it up.
Alexandra Winter Feb. 22, 2024, 2:41 p.m. UTC | #3
On 21.02.24 23:31, Jakub Kicinski wrote:
> On Thu, 15 Feb 2024 14:36:57 +0100 Alexandra Winter wrote:
>> I would have preferred to do all the translations in __iucv_* functions in iucv.c,
>> but I understand that for __iucv_message_receive() this would mean significant changes. 
> 
> FWIW we're assuming this is going via the s390 tree.
> Please let us know if you prefer networking to pick it up.
> 

Hello Jakub and maintainers,

please take this patch via net-next, as it belongs to the net/iucv module.
Please excuse that it was not flagged with [PATCH net-next]

Kind regards
Alexandra
Jakub Kicinski Feb. 23, 2024, 2:29 a.m. UTC | #4
On Thu, 22 Feb 2024 15:41:23 +0100 Alexandra Winter wrote:
> > FWIW we're assuming this is going via the s390 tree.
> > Please let us know if you prefer networking to pick it up.
> 
> Hello Jakub and maintainers,
> 
> please take this patch via net-next, as it belongs to the net/iucv module.
> Please excuse that it was not flagged with [PATCH net-next]

Done! Hopefully nobody screams at us for the use of virt_to_phys() :)
patchwork-bot+netdevbpf@kernel.org Feb. 23, 2024, 2:40 a.m. UTC | #5
Hello:

This patch was applied to netdev/net-next.git (main)
by Jakub Kicinski <kuba@kernel.org>:

On Thu, 15 Feb 2024 09:05:00 +0100 you wrote:
> Fix virtual vs physical address confusion. This does not fix a bug
> since virtual and physical address spaces are currently the same.
> 
> Signed-off-by: Alexander Gordeev <agordeev@linux.ibm.com>
> ---
>  net/iucv/af_iucv.c | 10 ++++------
>  1 file changed, 4 insertions(+), 6 deletions(-)

Here is the summary with links:
  - net/af_iucv: fix virtual vs physical address confusion
    https://git.kernel.org/netdev/net-next/c/9eda38dc9150

You are awesome, thank you!
diff mbox series

Patch

diff --git a/net/iucv/af_iucv.c b/net/iucv/af_iucv.c
index 498a0c35b7bb..4aa1c72e6c49 100644
--- a/net/iucv/af_iucv.c
+++ b/net/iucv/af_iucv.c
@@ -1060,13 +1060,12 @@  static int iucv_sock_sendmsg(struct socket *sock, struct msghdr *msg,
 			int i;
 
 			/* skip iucv_array lying in the headroom */
-			iba[0].address = (u32)(addr_t)skb->data;
+			iba[0].address = (u32)virt_to_phys(skb->data);
 			iba[0].length = (u32)skb_headlen(skb);
 			for (i = 0; i < skb_shinfo(skb)->nr_frags; i++) {
 				skb_frag_t *frag = &skb_shinfo(skb)->frags[i];
 
-				iba[i + 1].address =
-					(u32)(addr_t)skb_frag_address(frag);
+				iba[i + 1].address = (u32)virt_to_phys(skb_frag_address(frag));
 				iba[i + 1].length = (u32)skb_frag_size(frag);
 			}
 			err = pr_iucv->message_send(iucv->path, &txmsg,
@@ -1162,13 +1161,12 @@  static void iucv_process_message(struct sock *sk, struct sk_buff *skb,
 			struct iucv_array *iba = (struct iucv_array *)skb->head;
 			int i;
 
-			iba[0].address = (u32)(addr_t)skb->data;
+			iba[0].address = (u32)virt_to_phys(skb->data);
 			iba[0].length = (u32)skb_headlen(skb);
 			for (i = 0; i < skb_shinfo(skb)->nr_frags; i++) {
 				skb_frag_t *frag = &skb_shinfo(skb)->frags[i];
 
-				iba[i + 1].address =
-					(u32)(addr_t)skb_frag_address(frag);
+				iba[i + 1].address = (u32)virt_to_phys(skb_frag_address(frag));
 				iba[i + 1].length = (u32)skb_frag_size(frag);
 			}
 			rc = pr_iucv->message_receive(path, msg,