* [PATCH 1/2] efi: Add dependency on M-mode for RISC-V
@ 2020-09-28 16:08 Sean Anderson
2020-09-28 16:08 ` [PATCH 2/2] efi: Fix typo in documentation Sean Anderson
2020-09-28 16:27 ` [PATCH 1/2] efi: Add dependency on M-mode for RISC-V Heinrich Schuchardt
0 siblings, 2 replies; 7+ messages in thread
From: Sean Anderson @ 2020-09-28 16:08 UTC (permalink / raw)
To: u-boot
From section 2.3.7 of the UEFI specification:
> RISC-V UEFI will only be executed in machine mode. The machine mode has
> the highest privilege and this mode is the only mandatory privilege level
> for RISC-V platforms; all other privilege levels are optional depending
> on the platform requirements. Machine mode is the first mode entered at
> the power-on reset. This level is used in UEFI for low-level access to a
> hardware platform.
Signed-off-by: Sean Anderson <seanga2@gmail.com>
---
lib/efi_loader/Kconfig | 2 ++
1 file changed, 2 insertions(+)
diff --git a/lib/efi_loader/Kconfig b/lib/efi_loader/Kconfig
index bad1a29ba8..2197c84bf3 100644
--- a/lib/efi_loader/Kconfig
+++ b/lib/efi_loader/Kconfig
@@ -10,6 +10,8 @@ config EFI_LOADER
depends on !EFI_STUB || !X86_64 || EFI_STUB_64BIT
# We need EFI_STUB_32BIT to be set on x86_32 with EFI_STUB
depends on !EFI_STUB || !X86 || X86_64 || EFI_STUB_32BIT
+ # RISC-V UEFI must run in machine mode
+ depends on !RISCV || RISCV_M_MODE
default y if !ARM || SYS_CPU = armv7 || SYS_CPU = armv8
select LIB_UUID
select HAVE_BLOCK_DEVICE
--
2.28.0
^ permalink raw reply related [flat|nested] 7+ messages in thread
* [PATCH 2/2] efi: Fix typo in documentation
2020-09-28 16:08 [PATCH 1/2] efi: Add dependency on M-mode for RISC-V Sean Anderson
@ 2020-09-28 16:08 ` Sean Anderson
2020-09-28 16:31 ` Heinrich Schuchardt
2020-09-28 16:27 ` [PATCH 1/2] efi: Add dependency on M-mode for RISC-V Heinrich Schuchardt
1 sibling, 1 reply; 7+ messages in thread
From: Sean Anderson @ 2020-09-28 16:08 UTC (permalink / raw)
To: u-boot
There is an extra space.
Signed-off-by: Sean Anderson <seanga2@gmail.com>
---
lib/efi_selftest/efi_selftest_set_virtual_address_map.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/lib/efi_selftest/efi_selftest_set_virtual_address_map.c b/lib/efi_selftest/efi_selftest_set_virtual_address_map.c
index a4e5a50f63..b097a81136 100644
--- a/lib/efi_selftest/efi_selftest_set_virtual_address_map.c
+++ b/lib/efi_selftest/efi_selftest_set_virtual_address_map.c
@@ -23,7 +23,7 @@ static u32 notify_call_count;
static bool convert_pointer_failed;
/**
- * notify () - notification function
+ * notify() - notification function
*
* This function is called when the EVT_SIGNAL_VIRTUAL_ADDRESS_CHANGE event
* occurs. The correct output of ConvertPointer() is checked.
--
2.28.0
^ permalink raw reply related [flat|nested] 7+ messages in thread
* [PATCH 1/2] efi: Add dependency on M-mode for RISC-V
2020-09-28 16:08 [PATCH 1/2] efi: Add dependency on M-mode for RISC-V Sean Anderson
2020-09-28 16:08 ` [PATCH 2/2] efi: Fix typo in documentation Sean Anderson
@ 2020-09-28 16:27 ` Heinrich Schuchardt
2020-09-28 17:15 ` Sean Anderson
1 sibling, 1 reply; 7+ messages in thread
From: Heinrich Schuchardt @ 2020-09-28 16:27 UTC (permalink / raw)
To: u-boot
On 28.09.20 18:08, Sean Anderson wrote:
>>From section 2.3.7 of the UEFI specification:
>
>> RISC-V UEFI will only be executed in machine mode. The machine mode has
>> the highest privilege and this mode is the only mandatory privilege level
>> for RISC-V platforms; all other privilege levels are optional depending
>> on the platform requirements. Machine mode is the first mode entered at
>> the power-on reset. This level is used in UEFI for low-level access to a
>> hardware platform.
>
> Signed-off-by: Sean Anderson <seanga2@gmail.com>
> ---
>
> lib/efi_loader/Kconfig | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/lib/efi_loader/Kconfig b/lib/efi_loader/Kconfig
> index bad1a29ba8..2197c84bf3 100644
> --- a/lib/efi_loader/Kconfig
> +++ b/lib/efi_loader/Kconfig
> @@ -10,6 +10,8 @@ config EFI_LOADER
> depends on !EFI_STUB || !X86_64 || EFI_STUB_64BIT
> # We need EFI_STUB_32BIT to be set on x86_32 with EFI_STUB
> depends on !EFI_STUB || !X86 || X86_64 || EFI_STUB_32BIT
> + # RISC-V UEFI must run in machine mode
> + depends on !RISCV || RISCV_M_MODE
> default y if !ARM || SYS_CPU = armv7 || SYS_CPU = armv8
> select LIB_UUID
> select HAVE_BLOCK_DEVICE
>
Hello Sean,
the specification is wrong. A change request has been made to correct
the specification. We should not change U-Boot here.
See the discussion in this thread:
https://lists.linaro.org/pipermail/boot-architecture/2020-September/001481.html
Best regards
Heinrich
^ permalink raw reply [flat|nested] 7+ messages in thread
* [PATCH 2/2] efi: Fix typo in documentation
2020-09-28 16:08 ` [PATCH 2/2] efi: Fix typo in documentation Sean Anderson
@ 2020-09-28 16:31 ` Heinrich Schuchardt
0 siblings, 0 replies; 7+ messages in thread
From: Heinrich Schuchardt @ 2020-09-28 16:31 UTC (permalink / raw)
To: u-boot
On 28.09.20 18:08, Sean Anderson wrote:
> There is an extra space.
>
> Signed-off-by: Sean Anderson <seanga2@gmail.com>
> ---
>
> lib/efi_selftest/efi_selftest_set_virtual_address_map.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/lib/efi_selftest/efi_selftest_set_virtual_address_map.c b/lib/efi_selftest/efi_selftest_set_virtual_address_map.c
> index a4e5a50f63..b097a81136 100644
> --- a/lib/efi_selftest/efi_selftest_set_virtual_address_map.c
> +++ b/lib/efi_selftest/efi_selftest_set_virtual_address_map.c
> @@ -23,7 +23,7 @@ static u32 notify_call_count;
> static bool convert_pointer_failed;
>
> /**
> - * notify () - notification function
> + * notify() - notification function
> *
> * This function is called when the EVT_SIGNAL_VIRTUAL_ADDRESS_CHANGE event
> * occurs. The correct output of ConvertPointer() is checked.
>
Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
^ permalink raw reply [flat|nested] 7+ messages in thread
* [PATCH 1/2] efi: Add dependency on M-mode for RISC-V
2020-09-28 16:27 ` [PATCH 1/2] efi: Add dependency on M-mode for RISC-V Heinrich Schuchardt
@ 2020-09-28 17:15 ` Sean Anderson
2020-09-28 18:24 ` Heinrich Schuchardt
0 siblings, 1 reply; 7+ messages in thread
From: Sean Anderson @ 2020-09-28 17:15 UTC (permalink / raw)
To: u-boot
On 9/28/20 12:27 PM, Heinrich Schuchardt wrote:
> On 28.09.20 18:08, Sean Anderson wrote:
>> >From section 2.3.7 of the UEFI specification:
>>
>>> RISC-V UEFI will only be executed in machine mode. The machine mode has
>>> the highest privilege and this mode is the only mandatory privilege level
>>> for RISC-V platforms; all other privilege levels are optional depending
>>> on the platform requirements. Machine mode is the first mode entered at
>>> the power-on reset. This level is used in UEFI for low-level access to a
>>> hardware platform.
>>
>> Signed-off-by: Sean Anderson <seanga2@gmail.com>
>> ---
>>
>> lib/efi_loader/Kconfig | 2 ++
>> 1 file changed, 2 insertions(+)
>>
>> diff --git a/lib/efi_loader/Kconfig b/lib/efi_loader/Kconfig
>> index bad1a29ba8..2197c84bf3 100644
>> --- a/lib/efi_loader/Kconfig
>> +++ b/lib/efi_loader/Kconfig
>> @@ -10,6 +10,8 @@ config EFI_LOADER
>> depends on !EFI_STUB || !X86_64 || EFI_STUB_64BIT
>> # We need EFI_STUB_32BIT to be set on x86_32 with EFI_STUB
>> depends on !EFI_STUB || !X86 || X86_64 || EFI_STUB_32BIT
>> + # RISC-V UEFI must run in machine mode
>> + depends on !RISCV || RISCV_M_MODE
>> default y if !ARM || SYS_CPU = armv7 || SYS_CPU = armv8
>> select LIB_UUID
>> select HAVE_BLOCK_DEVICE
>>
>
> Hello Sean,
>
> the specification is wrong. A change request has been made to correct
> the specification. We should not change U-Boot here.
>
> See the discussion in this thread:
> https://lists.linaro.org/pipermail/boot-architecture/2020-September/001481.html
>
> Best regards
>
> Heinrich
>
Thanks for linking that. I'm glad some of these issues are being addressed. However, I am concerned about your suggestion
> * Don't trust the values of tp and gp when entered
> from the payloads world.
Because tp *must* be trusted in S-Mode...
Of course, all this could be averted by adding an sbi_get_mhartid function...
--Sean
^ permalink raw reply [flat|nested] 7+ messages in thread
* [PATCH 1/2] efi: Add dependency on M-mode for RISC-V
2020-09-28 17:15 ` Sean Anderson
@ 2020-09-28 18:24 ` Heinrich Schuchardt
2020-09-28 18:29 ` Sean Anderson
0 siblings, 1 reply; 7+ messages in thread
From: Heinrich Schuchardt @ 2020-09-28 18:24 UTC (permalink / raw)
To: u-boot
On 28.09.20 19:15, Sean Anderson wrote:
> On 9/28/20 12:27 PM, Heinrich Schuchardt wrote:
>> On 28.09.20 18:08, Sean Anderson wrote:
>>> >From section 2.3.7 of the UEFI specification:
>>>
>>>> RISC-V UEFI will only be executed in machine mode. The machine mode has
>>>> the highest privilege and this mode is the only mandatory privilege level
>>>> for RISC-V platforms; all other privilege levels are optional depending
>>>> on the platform requirements. Machine mode is the first mode entered at
>>>> the power-on reset. This level is used in UEFI for low-level access to a
>>>> hardware platform.
>>>
>>> Signed-off-by: Sean Anderson <seanga2@gmail.com>
>>> ---
>>>
>>> lib/efi_loader/Kconfig | 2 ++
>>> 1 file changed, 2 insertions(+)
>>>
>>> diff --git a/lib/efi_loader/Kconfig b/lib/efi_loader/Kconfig
>>> index bad1a29ba8..2197c84bf3 100644
>>> --- a/lib/efi_loader/Kconfig
>>> +++ b/lib/efi_loader/Kconfig
>>> @@ -10,6 +10,8 @@ config EFI_LOADER
>>> depends on !EFI_STUB || !X86_64 || EFI_STUB_64BIT
>>> # We need EFI_STUB_32BIT to be set on x86_32 with EFI_STUB
>>> depends on !EFI_STUB || !X86 || X86_64 || EFI_STUB_32BIT
>>> + # RISC-V UEFI must run in machine mode
>>> + depends on !RISCV || RISCV_M_MODE
>>> default y if !ARM || SYS_CPU = armv7 || SYS_CPU = armv8
>>> select LIB_UUID
>>> select HAVE_BLOCK_DEVICE
>>>
>>
>> Hello Sean,
>>
>> the specification is wrong. A change request has been made to correct
>> the specification. We should not change U-Boot here.
>>
>> See the discussion in this thread:
>> https://lists.linaro.org/pipermail/boot-architecture/2020-September/001481.html
>>
>> Best regards
>>
>> Heinrich
>>
>
> Thanks for linking that. I'm glad some of these issues are being addressed. However, I am concerned about your suggestion
>
>> * Don't trust the values of tp and gp when entered
>> from the payloads world.
>
> Because tp *must* be trusted in S-Mode...
>
> Of course, all this could be averted by adding an sbi_get_mhartid function...
I thought only the secondary hart uses tp in U-Boot.
Best regards
Heinrich
^ permalink raw reply [flat|nested] 7+ messages in thread
* [PATCH 1/2] efi: Add dependency on M-mode for RISC-V
2020-09-28 18:24 ` Heinrich Schuchardt
@ 2020-09-28 18:29 ` Sean Anderson
0 siblings, 0 replies; 7+ messages in thread
From: Sean Anderson @ 2020-09-28 18:29 UTC (permalink / raw)
To: u-boot
On 9/28/20 2:24 PM, Heinrich Schuchardt wrote:
> On 28.09.20 19:15, Sean Anderson wrote:
>> On 9/28/20 12:27 PM, Heinrich Schuchardt wrote:
>>> On 28.09.20 18:08, Sean Anderson wrote:
>>>> >From section 2.3.7 of the UEFI specification:
>>>>
>>>>> RISC-V UEFI will only be executed in machine mode. The machine mode has
>>>>> the highest privilege and this mode is the only mandatory privilege level
>>>>> for RISC-V platforms; all other privilege levels are optional depending
>>>>> on the platform requirements. Machine mode is the first mode entered at
>>>>> the power-on reset. This level is used in UEFI for low-level access to a
>>>>> hardware platform.
>>>>
>>>> Signed-off-by: Sean Anderson <seanga2@gmail.com>
>>>> ---
>>>>
>>>> lib/efi_loader/Kconfig | 2 ++
>>>> 1 file changed, 2 insertions(+)
>>>>
>>>> diff --git a/lib/efi_loader/Kconfig b/lib/efi_loader/Kconfig
>>>> index bad1a29ba8..2197c84bf3 100644
>>>> --- a/lib/efi_loader/Kconfig
>>>> +++ b/lib/efi_loader/Kconfig
>>>> @@ -10,6 +10,8 @@ config EFI_LOADER
>>>> depends on !EFI_STUB || !X86_64 || EFI_STUB_64BIT
>>>> # We need EFI_STUB_32BIT to be set on x86_32 with EFI_STUB
>>>> depends on !EFI_STUB || !X86 || X86_64 || EFI_STUB_32BIT
>>>> + # RISC-V UEFI must run in machine mode
>>>> + depends on !RISCV || RISCV_M_MODE
>>>> default y if !ARM || SYS_CPU = armv7 || SYS_CPU = armv8
>>>> select LIB_UUID
>>>> select HAVE_BLOCK_DEVICE
>>>>
>>>
>>> Hello Sean,
>>>
>>> the specification is wrong. A change request has been made to correct
>>> the specification. We should not change U-Boot here.
>>>
>>> See the discussion in this thread:
>>> https://lists.linaro.org/pipermail/boot-architecture/2020-September/001481.html
>>>
>>> Best regards
>>>
>>> Heinrich
>>>
>>
>> Thanks for linking that. I'm glad some of these issues are being addressed. However, I am concerned about your suggestion
>>
>>> * Don't trust the values of tp and gp when entered
>>> from the payloads world.
>>
>> Because tp *must* be trusted in S-Mode...
>>
>> Of course, all this could be averted by adding an sbi_get_mhartid function...
>
> I thought only the secondary hart uses tp in U-Boot.
>
> Best regards
>
> Heinrich
>
So UEFI is only ever ran on a single hart? I thought one of the
advantages of UEFI was that it could initialize devices in parallel.
--Sean
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2020-09-28 18:29 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-09-28 16:08 [PATCH 1/2] efi: Add dependency on M-mode for RISC-V Sean Anderson
2020-09-28 16:08 ` [PATCH 2/2] efi: Fix typo in documentation Sean Anderson
2020-09-28 16:31 ` Heinrich Schuchardt
2020-09-28 16:27 ` [PATCH 1/2] efi: Add dependency on M-mode for RISC-V Heinrich Schuchardt
2020-09-28 17:15 ` Sean Anderson
2020-09-28 18:24 ` Heinrich Schuchardt
2020-09-28 18:29 ` Sean Anderson
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.