From: Ahmad Fatoum <a.fatoum@pengutronix.de>
To: barebox@lists.infradead.org
Cc: rcz@pengutronix.de, mfe@pengutronix.de,
Ahmad Fatoum <a.fatoum@pengutronix.de>
Subject: [PATCH 3/4] hab: habv4: align config/state at 64 byte boundary
Date: Thu, 21 Sep 2023 11:56:48 +0200 [thread overview]
Message-ID: <20230921095649.310666-3-a.fatoum@pengutronix.de> (raw)
In-Reply-To: <20230921095649.310666-1-a.fatoum@pengutronix.de>
We do manual cache maintenance for &config and &state, because they are
passed as arguments to a secure monitor call. Before the SMC, they are
flushed and afterwards, they are invalidated, but still, we should keep
data we do manual cache maintenance for separate from usual local
variables. Do this by using the new __dma_aligned attribute.
Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
---
drivers/hab/habv4.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/drivers/hab/habv4.c b/drivers/hab/habv4.c
index 38f464fbf978..bbceb0e985b6 100644
--- a/drivers/hab/habv4.c
+++ b/drivers/hab/habv4.c
@@ -12,6 +12,7 @@
#include <init.h>
#include <types.h>
#include <mmu.h>
+#include <dma.h>
#include <zero_page.h>
#include <linux/sizes.h>
#include <linux/arm-smccc.h>
@@ -547,8 +548,8 @@ static int habv4_get_status(const struct habv4_rvt *rvt)
uint32_t len;
int i;
enum hab_status status;
- enum hab_config config = 0x0;
- enum habv4_state state = 0x0;
+ __dma_aligned enum hab_config config = 0x0;
+ __dma_aligned enum habv4_state state = 0x0;
if (rvt->header.tag != HAB_TAG_RVT) {
pr_err("ERROR - RVT not found!\n");
--
2.39.2
next prev parent reply other threads:[~2023-09-21 9:58 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-09-21 9:56 [PATCH 1/4] dma: define __dma_aligned attribute Ahmad Fatoum
2023-09-21 9:56 ` [PATCH 2/4] ARM: dma: define DMA_ALIGNMENT instead of defining dma_alloc Ahmad Fatoum
2023-09-21 10:35 ` Marco Felsch
2023-09-21 9:56 ` Ahmad Fatoum [this message]
2023-09-21 9:56 ` [PATCH 4/4] hab: habv4: apply sizeof() to correct object Ahmad Fatoum
2023-09-21 10:35 ` [PATCH 1/4] dma: define __dma_aligned attribute Ahmad Fatoum
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=20230921095649.310666-3-a.fatoum@pengutronix.de \
--to=a.fatoum@pengutronix.de \
--cc=barebox@lists.infradead.org \
--cc=mfe@pengutronix.de \
--cc=rcz@pengutronix.de \
/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