diff mbox series

efi_stub: Fix GDT_NOTSYS check

Message ID 20171204153326.8232-1-agraf@suse.de
State Accepted
Commit 14d61d4e577c57ba77b826c6cc9d99a0b3f3fc37
Headers show
Series efi_stub: Fix GDT_NOTSYS check | expand

Commit Message

Alexander Graf Dec. 4, 2017, 3:33 p.m. UTC
The get_codeseg32() wants to know if a passed in descriptor has
flag GDT_NOTSYS set (desc & GDT_NOTSYS), not whether desc and
GDT_NOTSYS are not != 0 (desk && GDT_NOTSYS).

This is an obvious typo. Fix it up.

Signed-off-by: Alexander Graf <agraf@suse.de>
---
 lib/efi/efi_stub.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Bin Meng Dec. 4, 2017, 11:20 p.m. UTC | #1
On Mon, Dec 4, 2017 at 11:33 PM, Alexander Graf <agraf@suse.de> wrote:
> The get_codeseg32() wants to know if a passed in descriptor has
> flag GDT_NOTSYS set (desc & GDT_NOTSYS), not whether desc and
> GDT_NOTSYS are not != 0 (desk && GDT_NOTSYS).
>
> This is an obvious typo. Fix it up.
>
> Signed-off-by: Alexander Graf <agraf@suse.de>
> ---
>  lib/efi/efi_stub.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>

Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Bin Meng Feb. 12, 2018, 6:26 a.m. UTC | #2
Hi Alexander,

On Tue, Dec 5, 2017 at 7:20 AM, Bin Meng <bmeng.cn@gmail.com> wrote:
> On Mon, Dec 4, 2017 at 11:33 PM, Alexander Graf <agraf@suse.de> wrote:
>> The get_codeseg32() wants to know if a passed in descriptor has
>> flag GDT_NOTSYS set (desc & GDT_NOTSYS), not whether desc and
>> GDT_NOTSYS are not != 0 (desk && GDT_NOTSYS).
>>
>> This is an obvious typo. Fix it up.
>>
>> Signed-off-by: Alexander Graf <agraf@suse.de>
>> ---
>>  lib/efi/efi_stub.c | 2 +-
>>  1 file changed, 1 insertion(+), 1 deletion(-)
>>
>
> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>

Looks this one is applied nowhere?

Regards,
Bin
Alexander Graf Feb. 15, 2018, 3:03 p.m. UTC | #3
On 12.02.18 07:26, Bin Meng wrote:
> Hi Alexander,
> 
> On Tue, Dec 5, 2017 at 7:20 AM, Bin Meng <bmeng.cn@gmail.com> wrote:
>> On Mon, Dec 4, 2017 at 11:33 PM, Alexander Graf <agraf@suse.de> wrote:
>>> The get_codeseg32() wants to know if a passed in descriptor has
>>> flag GDT_NOTSYS set (desc & GDT_NOTSYS), not whether desc and
>>> GDT_NOTSYS are not != 0 (desk && GDT_NOTSYS).
>>>
>>> This is an obvious typo. Fix it up.
>>>
>>> Signed-off-by: Alexander Graf <agraf@suse.de>
>>> ---
>>>  lib/efi/efi_stub.c | 2 +-
>>>  1 file changed, 1 insertion(+), 1 deletion(-)
>>>
>>
>> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
> 
> Looks this one is applied nowhere?

lib/efi is something you maintain, no?

I only want to run U-Boot as UEFI firmware, I don't particularly care
about running U-Boot as UEFI payload :).


Alex
Bin Meng March 30, 2018, 7:58 a.m. UTC | #4
Hi Alex,

On Thu, Feb 15, 2018 at 11:03 PM, Alexander Graf <agraf@suse.de> wrote:
>
>
> On 12.02.18 07:26, Bin Meng wrote:
>> Hi Alexander,
>>
>> On Tue, Dec 5, 2017 at 7:20 AM, Bin Meng <bmeng.cn@gmail.com> wrote:
>>> On Mon, Dec 4, 2017 at 11:33 PM, Alexander Graf <agraf@suse.de> wrote:
>>>> The get_codeseg32() wants to know if a passed in descriptor has
>>>> flag GDT_NOTSYS set (desc & GDT_NOTSYS), not whether desc and
>>>> GDT_NOTSYS are not != 0 (desk && GDT_NOTSYS).
>>>>
>>>> This is an obvious typo. Fix it up.
>>>>
>>>> Signed-off-by: Alexander Graf <agraf@suse.de>
>>>> ---
>>>>  lib/efi/efi_stub.c | 2 +-
>>>>  1 file changed, 1 insertion(+), 1 deletion(-)
>>>>
>>>
>>> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
>>
>> Looks this one is applied nowhere?
>
> lib/efi is something you maintain, no?
>
> I only want to run U-Boot as UEFI firmware, I don't particularly care
> about running U-Boot as UEFI payload :).

Since I see on patchwork, this patch was assigned to you so I did not take it.
I will pick this patch to x86. Thanks.

applied to u-boot-x86, thanks!

Regards,
Bin
diff mbox series

Patch

diff --git a/lib/efi/efi_stub.c b/lib/efi/efi_stub.c
index 1814960572..9788dedba7 100644
--- a/lib/efi/efi_stub.c
+++ b/lib/efi/efi_stub.c
@@ -182,7 +182,7 @@  static int get_codeseg32(void)
 				<< 16;
 		base <<= 12;	/* 4KB granularity */
 		limit <<= 12;
-		if ((desc & GDT_PRESENT) && (desc && GDT_NOTSYS) &&
+		if ((desc & GDT_PRESENT) && (desc & GDT_NOTSYS) &&
 		    !(desc & GDT_LONG) && (desc & GDT_4KB) &&
 		    (desc & GDT_32BIT) && (desc & GDT_CODE) &&
 		    CONFIG_SYS_TEXT_BASE > base &&