[PATCH 1/1] RISC-V: Change signature header field to use `.ascii` instead of opcode
Kefeng Wang
wangkefeng.wang at huawei.com
Mon Jan 17 17:23:48 PST 2022
On 2022/1/18 2:59, Jessica Clarke wrote:
> On 17 Jan 2022, at 17:39, Florian Wagner <florian.wagner at nextsilicon.com> wrote:
>> The `MZ` in the signature header field is now encoded via `.ascii` to make
>> the kernel compile without the `c` extension.
>>
>> Signed-off-by: Florian Wagner <florian.wagner at nextsilicon.com>
>> Signed-off-by: Yaron Dinkin <yaron.dinkin at nextsilicon.com>
>> ---
>> arch/riscv/kernel/head.S | 2 +-
>> 1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/arch/riscv/kernel/head.S b/arch/riscv/kernel/head.S
>> index f52f01ecbeea..931b63464b90 100644
>> --- a/arch/riscv/kernel/head.S
>> +++ b/arch/riscv/kernel/head.S
>> @@ -48,7 +48,7 @@ ENTRY(_start)
>> /*
>> * This instruction decodes to "MZ" ASCII required by UEFI.
>> */
>> - c.li s4,-13
>> + .ascii "MZ"
>> j _start_kernel
> CONFIG_EFI has select RISCV_ISA_C, so this doesn’t seem to achieve
> anything? If you then remove that select, well, you get an EFI binary
> that works, but if you jump to it directly as a non-EFI binary then
> you’ll trap on a non-RVC system as that won’t be a valid instruction.
> So I think this needs more explanation and discussion.
I sent a question[1] before, and there are some advises from Arnd and
Palmer.
[1]
https://lore.kernel.org/linux-riscv/350c7458-c77b-56de-de5e-8c96ce9c16ae@huawei.com/
> Jess
>
>
> _______________________________________________
> linux-riscv mailing list
> linux-riscv at lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-riscv
More information about the linux-riscv
mailing list