From: Sascha Hauer <s.hauer@pengutronix.de>
To: Ahmad Fatoum <a.fatoum@pengutronix.de>
Cc: "open list:BAREBOX" <barebox@lists.infradead.org>
Subject: Re: [PATCH 4/9] mci: add RPMB support
Date: Tue, 18 Mar 2025 12:33:05 +0100 [thread overview]
Message-ID: <Z9lZ8Q4bhUnuur1X@pengutronix.de> (raw)
In-Reply-To: <9c66b31b-a79c-4a07-a03f-119c7c3dadc7@pengutronix.de>
On Mon, Mar 17, 2025 at 04:18:32PM +0100, Ahmad Fatoum wrote:
> Hello Sascha,
>
> On 3/12/25 13:16, Sascha Hauer wrote:
> > +
> > +int mci_rpmb_route_frames(struct mci *mci, void *req, unsigned long reqlen,
> > + void *rsp, unsigned long rsplen)
> > +{
> > + /*
> > + * Whoever crafted the data supplied to this function knows how to
> > + * format the PRMB frames and which response is expected. If
> > + * there's some unexpected mismatch it's more helpful to report an
> > + * error immediately than trying to guess what was the intention
> > + * and possibly just delay an eventual error which will be harder
> > + * to track down.
> > + */
> > + void *rpmb_data = NULL;
> > + int ret;
> > +
> > + mci_blk_part_switch(mci->rpmb_part);
> > +
> > + if (!IS_ALIGNED((uintptr_t)req, ARCH_DMA_MINALIGN)) {
>
> Even if alignment happens to be correct, there is no guarantee that
> there is no other data sharing a cache line.
reqlen is expected to be a single block of 512 bytes, so indeed when req
is aligned then the end is cacheline aligned as well. We could check
reqlen as well, but I actually never ran into this case, so we can just
return an error for now as you suggested.
Sascha
--
Pengutronix e.K. | |
Steuerwalder Str. 21 | http://www.pengutronix.de/ |
31137 Hildesheim, Germany | Phone: +49-5121-206917-0 |
Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |
next prev parent reply other threads:[~2025-03-18 11:33 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-03-12 12:16 [PATCH 0/9] Add " Sascha Hauer
2025-03-12 12:16 ` [PATCH 1/9] mci: implement mci_set_blockcount() Sascha Hauer
2025-03-12 12:16 ` [PATCH 2/9] mci: export some functions for RPMB support Sascha Hauer
2025-03-12 12:16 ` [PATCH 3/9] mci: detect RPMB partitions Sascha Hauer
2025-03-12 12:16 ` [PATCH 4/9] mci: add RPMB support Sascha Hauer
2025-03-17 15:18 ` Ahmad Fatoum
2025-03-18 11:33 ` Sascha Hauer [this message]
2025-03-12 12:16 ` [PATCH 5/9] tee: optee: probe successfully even when no devices are found Sascha Hauer
2025-03-12 12:16 ` [PATCH 6/9] tee: optee: implement shared mem alloc/free RPC commands Sascha Hauer
2025-03-18 11:42 ` Ahmad Fatoum
2025-03-12 12:16 ` [PATCH 7/9] tee: optee: implement RPMB support Sascha Hauer
2025-03-12 12:16 ` [PATCH 8/9] tee: optee: implement AVB named persistent values support Sascha Hauer
2025-03-12 12:16 ` [PATCH 9/9] commands: add avb_pvalue command Sascha Hauer
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=Z9lZ8Q4bhUnuur1X@pengutronix.de \
--to=s.hauer@pengutronix.de \
--cc=a.fatoum@pengutronix.de \
--cc=barebox@lists.infradead.org \
/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