netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Alexandra Winter <wintera@linux.ibm.com>
To: Alexander Gordeev <agordeev@linux.ibm.com>,
	Thorsten Winkler <twinkler@linux.ibm.com>
Cc: linux-s390@vger.kernel.org, netdev@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] net/af_iucv: fix virtual vs physical address confusion
Date: Thu, 15 Feb 2024 14:36:57 +0100	[thread overview]
Message-ID: <47789946-0ffe-462e-9e2e-43b03ea41fe0@linux.ibm.com> (raw)
In-Reply-To: <20240215080500.2616848-1-agordeev@linux.ibm.com>



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. 

  reply	other threads:[~2024-02-15 13:41 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-02-15  8:05 [PATCH] net/af_iucv: fix virtual vs physical address confusion Alexander Gordeev
2024-02-15 13:36 ` Alexandra Winter [this message]
2024-02-21 22:31   ` Jakub Kicinski
2024-02-22 14:41     ` Alexandra Winter
2024-02-23  2:29       ` Jakub Kicinski
2024-02-23  2:40 ` patchwork-bot+netdevbpf

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=47789946-0ffe-462e-9e2e-43b03ea41fe0@linux.ibm.com \
    --to=wintera@linux.ibm.com \
    --cc=agordeev@linux.ibm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-s390@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=twinkler@linux.ibm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).