* [PATCH v1] "Reset registers to enhance robustness."
@ 2024-05-29 7:37 Pope B.Lei
0 siblings, 0 replies; 6+ messages in thread
From: Pope B.Lei @ 2024-05-29 7:37 UTC (permalink / raw)
To: opensbi
Signed-off-by: Pope B.Lei <popeblei@gmail.com>
---
V1: If the registers are not initialized, they may remain in an x-state in certain DV verification environments due to the lack of written values, causing the x-state to propagate during the boot process. Adding register initialization enhances robustness.
firmware/fw_base.S | 2 ++
1 file changed, 2 insertions(+)
diff --git a/firmware/fw_base.S b/firmware/fw_base.S
index b950c0b..10889a9 100644
--- a/firmware/fw_base.S
+++ b/firmware/fw_base.S
@@ -36,6 +36,8 @@
.globl _start
.globl _start_warm
_start:
+ /* Reset registers to enhance robustness. */
+ call _reset_regs
/* Find preferred boot HART id */
MOV_3R s0, a0, s1, a1, s2, a2
call fw_boot_hart
--
2.35.2.windows.1
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH v1] "Reset registers to enhance robustness."
@ 2024-05-29 7:37 Pope B.Lei
2024-05-29 7:40 ` Jessica Clarke
2024-05-30 1:07 ` Xiang W
0 siblings, 2 replies; 6+ messages in thread
From: Pope B.Lei @ 2024-05-29 7:37 UTC (permalink / raw)
To: opensbi
Signed-off-by: Pope B.Lei <popeblei@gmail.com>
---
V1: If the registers are not initialized, they may remain in an x-state in certain DV verification environments due to the lack of written values, causing the x-state to propagate during the boot process. Adding register initialization enhances robustness.
firmware/fw_base.S | 2 ++
1 file changed, 2 insertions(+)
diff --git a/firmware/fw_base.S b/firmware/fw_base.S
index b950c0b..10889a9 100644
--- a/firmware/fw_base.S
+++ b/firmware/fw_base.S
@@ -36,6 +36,8 @@
.globl _start
.globl _start_warm
_start:
+ /* Reset registers to enhance robustness. */
+ call _reset_regs
/* Find preferred boot HART id */
MOV_3R s0, a0, s1, a1, s2, a2
call fw_boot_hart
--
2.35.2.windows.1
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH v1] "Reset registers to enhance robustness."
2024-05-29 7:37 [PATCH v1] "Reset registers to enhance robustness." Pope B.Lei
@ 2024-05-29 7:40 ` Jessica Clarke
2024-05-29 8:18 ` Pope B.Lei
2024-05-30 1:07 ` Xiang W
1 sibling, 1 reply; 6+ messages in thread
From: Jessica Clarke @ 2024-05-29 7:40 UTC (permalink / raw)
To: opensbi
On 29 May 2024, at 08:37, Pope B.Lei <popeblei@gmail.com> wrote:
>
> Signed-off-by: Pope B.Lei <popeblei@gmail.com>
> ---
> V1: If the registers are not initialized, they may remain in an x-state in certain DV verification environments
Don?t do that then? If you want equal traces, use a well-defined start
or use smarter trace equivalence checking. The code being added serves
zero practical purpose in a real system.
Jess
> due to the lack of written values, causing the x-state to propagate during the boot process. Adding register initialization enhances robustness.
> firmware/fw_base.S | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/firmware/fw_base.S b/firmware/fw_base.S
> index b950c0b..10889a9 100644
> --- a/firmware/fw_base.S
> +++ b/firmware/fw_base.S
> @@ -36,6 +36,8 @@
> .globl _start
> .globl _start_warm
> _start:
> + /* Reset registers to enhance robustness. */
> + call _reset_regs
> /* Find preferred boot HART id */
> MOV_3R s0, a0, s1, a1, s2, a2
> call fw_boot_hart
> --
> 2.35.2.windows.1
>
>
> --
> opensbi mailing list
> opensbi at lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/opensbi
^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH v1] "Reset registers to enhance robustness."
2024-05-29 7:40 ` Jessica Clarke
@ 2024-05-29 8:18 ` Pope B.Lei
0 siblings, 0 replies; 6+ messages in thread
From: Pope B.Lei @ 2024-05-29 8:18 UTC (permalink / raw)
To: opensbi
Due to the completeness of Opensbi's functionality and its excellent,
stable code, I use Opensbi to boot multiple cores for testing in the
DV system tests of multi-core RISCV SOCs. The DV verification system
is also a real system, and in a certain sense, using Opensbi during
the DV verification phase is even more valuable.
On Wed, May 29, 2024 at 3:40?PM Jessica Clarke <jrtc27@jrtc27.com> wrote:
>
> On 29 May 2024, at 08:37, Pope B.Lei <popeblei@gmail.com> wrote:
> >
> > Signed-off-by: Pope B.Lei <popeblei@gmail.com>
> > ---
> > V1: If the registers are not initialized, they may remain in an x-state in certain DV verification environments
>
> Don?t do that then? If you want equal traces, use a well-defined start
> or use smarter trace equivalence checking. The code being added serves
> zero practical purpose in a real system.
>
> Jess
>
> > due to the lack of written values, causing the x-state to propagate during the boot process. Adding register initialization enhances robustness.
> > firmware/fw_base.S | 2 ++
> > 1 file changed, 2 insertions(+)
> >
> > diff --git a/firmware/fw_base.S b/firmware/fw_base.S
> > index b950c0b..10889a9 100644
> > --- a/firmware/fw_base.S
> > +++ b/firmware/fw_base.S
> > @@ -36,6 +36,8 @@
> > .globl _start
> > .globl _start_warm
> > _start:
> > + /* Reset registers to enhance robustness. */
> > + call _reset_regs
> > /* Find preferred boot HART id */
> > MOV_3R s0, a0, s1, a1, s2, a2
> > call fw_boot_hart
> > --
> > 2.35.2.windows.1
> >
> >
> > --
> > opensbi mailing list
> > opensbi at lists.infradead.org
> > http://lists.infradead.org/mailman/listinfo/opensbi
>
^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH v1] "Reset registers to enhance robustness."
2024-05-29 7:37 [PATCH v1] "Reset registers to enhance robustness." Pope B.Lei
2024-05-29 7:40 ` Jessica Clarke
@ 2024-05-30 1:07 ` Xiang W
2024-05-30 2:56 ` Pope B.Lei
1 sibling, 1 reply; 6+ messages in thread
From: Xiang W @ 2024-05-30 1:07 UTC (permalink / raw)
To: opensbi
? 2024-05-29???? 15:37 +0800?Pope B.Lei???
> Signed-off-by: Pope B.Lei <popeblei@gmail.com>
> ---
> V1: If the registers are not initialized, they may remain in an x-state in certain DV verification environments due to the lack of written
> values, causing the x-state to propagate during the boot process. Adding register initialization enhances robustness.
In DV system, all registers should be written to prevent the existence of registers
in x-state state. _reset_regs cannot write all registers for parameter passing. If
all registers are written, it will affect the function of opensbi.
So I don't think it's a good way to stop a register from having x-state state.
Regards,
Xiang W
> ?firmware/fw_base.S | 2 ++
> ?1 file changed, 2 insertions(+)
>
> diff --git a/firmware/fw_base.S b/firmware/fw_base.S
> index b950c0b..10889a9 100644
> --- a/firmware/fw_base.S
> +++ b/firmware/fw_base.S
> @@ -36,6 +36,8 @@
> ? .globl _start
> ? .globl _start_warm
> ?_start:
> + /* Reset registers to enhance robustness. */
> + call _reset_regs
> ? /* Find preferred boot HART id */
> ? MOV_3R s0, a0, s1, a1, s2, a2
> ? call fw_boot_hart
> --
> 2.35.2.windows.1
>
>
^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH v1] "Reset registers to enhance robustness."
2024-05-30 1:07 ` Xiang W
@ 2024-05-30 2:56 ` Pope B.Lei
0 siblings, 0 replies; 6+ messages in thread
From: Pope B.Lei @ 2024-05-30 2:56 UTC (permalink / raw)
To: opensbi
Dear Xiang:
You are right. In actual use, I will add an operation to set the
parameter to a fixed value. However, since this is just an operation
in the DV environment, I didn't push it.
Referring to the approach of the kernel, my understanding is that
it is worthwhile to clean up irrelevant content in the context during
a switch.
https://patchwork.kernel.org/project/linux-mm/patch/20190624054311.30256-17-hch at lst.de/
Regards,
B.Lei
On Thu, May 30, 2024 at 9:08?AM Xiang W <wxjstz@126.com> wrote:
>
> ? 2024-05-29???? 15:37 +0800?Pope B.Lei???
> > Signed-off-by: Pope B.Lei <popeblei@gmail.com>
> > ---
> > V1: If the registers are not initialized, they may remain in an x-state in certain DV verification environments due to the lack of written
> > values, causing the x-state to propagate during the boot process. Adding register initialization enhances robustness.
>
> In DV system, all registers should be written to prevent the existence of registers
> in x-state state. _reset_regs cannot write all registers for parameter passing. If
> all registers are written, it will affect the function of opensbi.
>
> So I don't think it's a good way to stop a register from having x-state state.
>
> Regards,
> Xiang W
>
> > firmware/fw_base.S | 2 ++
> > 1 file changed, 2 insertions(+)
> >
> > diff --git a/firmware/fw_base.S b/firmware/fw_base.S
> > index b950c0b..10889a9 100644
> > --- a/firmware/fw_base.S
> > +++ b/firmware/fw_base.S
> > @@ -36,6 +36,8 @@
> > .globl _start
> > .globl _start_warm
> > _start:
> > + /* Reset registers to enhance robustness. */
> > + call _reset_regs
> > /* Find preferred boot HART id */
> > MOV_3R s0, a0, s1, a1, s2, a2
> > call fw_boot_hart
> > --
> > 2.35.2.windows.1
> >
> >
>
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2024-05-30 2:56 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-05-29 7:37 [PATCH v1] "Reset registers to enhance robustness." Pope B.Lei
2024-05-29 7:40 ` Jessica Clarke
2024-05-29 8:18 ` Pope B.Lei
2024-05-30 1:07 ` Xiang W
2024-05-30 2:56 ` Pope B.Lei
-- strict thread matches above, loose matches on Subject: below --
2024-05-29 7:37 Pope B.Lei
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.