lkml.org 
[lkml]   [2023]   [Aug]   [31]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: [PATCH] riscv: kexec: Cleanup riscv_kexec_relocate
From
Hi, Andreas:

在 2023/8/30 15:24, Andreas Schwab 写道:
> On Aug 30 2023, Song Shuai wrote:
>
>> @@ -52,21 +42,27 @@ SYM_CODE_START(riscv_kexec_relocate)
>> * the start of the loop below so that we jump there in
>> * any case.
>> */
>> - la s8, 1f
>> - sub s8, s8, s7
>> - csrw CSR_STVEC, s8
>> + la s6, 1f
>> + sub s6, s6, s4
>> + csrw CSR_STVEC, s6
>> +
>> + /*
>> + * With C-extension, here we get 42 Bytes and the next
>> + * .align directive would pad zeros here up to 44 Bytes.
>> + * So manually put a nop here to avoid zeros padding.
>> + */
>> + nop
>>
>> /* Process entries in a loop */
>> .align 2
>
> While you are at it, I'd suggest being explicit about .palign
> vs. .balign.
>
How about this commemt:

Due to the stvec.BASE 4-byte alignment constraint, the following .align
(alias of .p2align) directive will align the next instruction to
a 4-byte boundary by padding zeros for this .rodata section.

With C-extension, here we get 42 Bytes and would be padded with zeros
up to 44 Bytes. So manually put a nop here to avoid it.

--
Thanks
Song Shuai

\
 
 \ /
  Last update: 2023-08-31 08:56    [W:0.307 / U:0.188 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site