Linux s390 Architecture development
 help / color / mirror / Atom feed
From: Heiko Carstens <hca@linux.ibm.com>
To: Peter Oberparleiter <oberpar@linux.ibm.com>
Cc: Vineeth Vijayan <vneethv@linux.ibm.com>,
	Vasily Gorbik <gor@linux.ibm.com>,
	Alexander Gordeev <agordeev@linux.ibm.com>,
	linux-s390@vger.kernel.org
Subject: Re: [PATCH] s390/cmf: Fix virtual vs physical address confusion
Date: Sun, 20 Sep 2026 18:15:13 +0200	[thread overview]
Message-ID: <20260920161513.18515A31-hca@linux.ibm.com> (raw)
In-Reply-To: <20260918161207.1756809-1-oberpar@linux.ibm.com>

On Fri, Sep 18, 2026 at 06:12:07PM +0200, Peter Oberparleiter wrote:
> The measurement block address is an absolute address; therefore add a
> missing virt_to_phys() translation.
> 
> Without this fix, a wrong address will be used by firmware when storing
> extended format channel measurement data on kernels built with
> CONFIG_RANDOMIZE_IDENTITY_BASE=y.
> 
> Signed-off-by: Peter Oberparleiter <oberpar@linux.ibm.com>
> ---
>  drivers/s390/cio/cmf.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/s390/cio/cmf.c b/drivers/s390/cio/cmf.c
> index 92ab3d546fe4..5f57a12762d2 100644
> --- a/drivers/s390/cio/cmf.c
> +++ b/drivers/s390/cio/cmf.c
> @@ -183,7 +183,7 @@ static int set_schib(struct ccw_device *cdev, u32 mme, int mbfc,
>  	sch->config.mbfc = mbfc;
>  	/* address can be either a block address or a block index */
>  	if (mbfc)
> -		sch->config.mba = address;
> +		sch->config.mba = address ? virt_to_phys((void *)address) : 0;

Would it make sense to change the type of the mba member in struct
schib_config and struct schib to dma64_t, and use virt_to_dma64()
instead of virt_to_phys() here?

That would add sparse type checking and would catch similar future bugs.

  parent reply	other threads:[~2026-09-20 16:15 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-18 16:12 [PATCH] s390/cmf: Fix virtual vs physical address confusion Peter Oberparleiter
2026-09-18 16:20 ` sashiko-bot
2026-09-20 16:15 ` Heiko Carstens [this message]
2026-09-21 10:58   ` Peter Oberparleiter

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=20260920161513.18515A31-hca@linux.ibm.com \
    --to=hca@linux.ibm.com \
    --cc=agordeev@linux.ibm.com \
    --cc=gor@linux.ibm.com \
    --cc=linux-s390@vger.kernel.org \
    --cc=oberpar@linux.ibm.com \
    --cc=vneethv@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