From: Stefan Kerkmann <s.kerkmann@pengutronix.de>
To: Sascha Hauer <s.hauer@pengutronix.de>,
Ahmad Fatoum <a.fatoum@pengutronix.de>
Cc: BAREBOX <barebox@lists.infradead.org>
Subject: Re: [PATCH v2 2/2] habv4: use hab rom implementation of report_event
Date: Wed, 17 Jan 2024 08:45:31 +0100 [thread overview]
Message-ID: <b9430a6f-7de6-49e5-b8ca-52eb6aeb23ea@pengutronix.de> (raw)
In-Reply-To: <20240117072025.GE4700@pengutronix.de>
Hello Ahmad, Hello Sascha,
On 17.01.24 08:20, Sascha Hauer wrote:
> On Tue, Jan 16, 2024 at 09:13:48AM +0100, Ahmad Fatoum wrote:
>> Hello Stefan,
>>
>> On 12.01.24 16:21, Stefan Kerkmann wrote:
>>> +static enum hab_status hab_sip_report_event(enum hab_status status,
>>> + uint32_t index, uint8_t *event,
>>> + size_t *bytes)
>>> +{
>>> + struct arm_smccc_res res;
>>> +
>>> + v8_flush_dcache_range((unsigned long)bytes,
>>> + (unsigned long)bytes + sizeof(*bytes));
>>> +
>>> + if (event)
>>> + v8_flush_dcache_range((unsigned long)event,
>>> + (unsigned long)event + *bytes);
>>
>> I am not too happy about the cache maintenance here. *event and *bytes
>> are both stack memory, which share a cache line with other stack variables.
>>
>> This issue exists in hab_sip_report_status too, so this need not delay
>> application of the series, but it would nice to get this cleaned up,
>> eventually.
>>
>> A first attempt was here:
>> https://lore.barebox.org/barebox/20230921095649.310666-1-a.fatoum@pengutronix.de/
>>
>> I am also unsure if cache maintenance is correct, see:
>> https://lists.trustedfirmware.org/archives/list/tf-a@lists.trustedfirmware.org/message/D3PIAW7G2B3JQIH5BGMUZZKHPGNMXUUT/
>>
When implementing the cache maintenance I had a quick talk with a
colleague and it wasn't clear if this is needed at all. In the end I
opted for "better safe than sorry". I suggest to wait a bit if there is
a definitive answer from the TF-A list and remove it altogether if it
turns out to be unnecessary.
>>> +static enum hab_status imx8m_report_event(enum hab_status status,
>>> + uint32_t index, uint8_t *event,
>>> + size_t *bytes)
>>> +{
>>> + if (cpu_is_mx8mm() || cpu_is_mx8mn() || cpu_is_imx8mp())
>>
>> I suggest we swap the if else clauses and use cpu_is_mx8mq(). imx8m_read_sram_events
>> only supports that one SoC now and it's likely that new SoCs (e.g. i.MX9) will
>> also reuse hab_sip_report_event. Could you send a fixup?
>
> I fixed this part up here.
Thank you!
>
> Sascha
>
Stefan
--
Pengutronix e.K. | Stefan Kerkmann |
Steuerwalder Str. 21 | https://www.pengutronix.de/ |
31137 Hildesheim, Germany | Phone: +49-5121-206917-128 |
Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-9 |
next prev parent reply other threads:[~2024-01-17 7:46 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-01-12 15:21 [PATCH v2 0/2] Use HABv4 report_event implementation for imx8mm and imx8mn Stefan Kerkmann
2024-01-12 15:21 ` [PATCH v2 1/2] habv4: correct habv4 rom vector table Stefan Kerkmann
2024-01-12 15:21 ` [PATCH v2 2/2] habv4: use hab rom implementation of report_event Stefan Kerkmann
2024-01-12 16:29 ` Stefan Kerkmann
2024-01-16 6:53 ` Sascha Hauer
2024-01-16 8:13 ` Ahmad Fatoum
2024-01-17 7:20 ` Sascha Hauer
2024-01-17 7:45 ` Stefan Kerkmann [this message]
2024-01-16 6:50 ` [PATCH v2 0/2] Use HABv4 report_event implementation for imx8mm and imx8mn Sascha Hauer
2024-01-16 7:09 ` 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=b9430a6f-7de6-49e5-b8ca-52eb6aeb23ea@pengutronix.de \
--to=s.kerkmann@pengutronix.de \
--cc=a.fatoum@pengutronix.de \
--cc=barebox@lists.infradead.org \
--cc=s.hauer@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