From: Peter Oberparleiter <oberpar@linux.ibm.com>
To: Heiko Carstens <hca@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: Mon, 21 Sep 2026 12:58:27 +0200 [thread overview]
Message-ID: <2701aca4-eef8-4f61-bb29-fe032b960c04@linux.ibm.com> (raw)
In-Reply-To: <20260920161513.18515A31-hca@linux.ibm.com>
On 20.09.2026 18:15, Heiko Carstens wrote:
> 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.
Sounds good - I'll prepare a v2.
--
Peter Oberparleiter
Linux on IBM Z Development - IBM Germany R&D
prev parent reply other threads:[~2026-09-21 10:58 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
2026-09-21 10:58 ` Peter Oberparleiter [this message]
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=2701aca4-eef8-4f61-bb29-fe032b960c04@linux.ibm.com \
--to=oberpar@linux.ibm.com \
--cc=agordeev@linux.ibm.com \
--cc=gor@linux.ibm.com \
--cc=hca@linux.ibm.com \
--cc=linux-s390@vger.kernel.org \
--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