Skip to contentSkip to conversation

efi_stub: Fix GDT_NOTSYS check

PATCH New Alexander Graf 2 participants 5 messages Dec 4, 2017 – Mar 30, 2018

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 efi_stub: Fix GDT_NOTSYS check

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.

---
 lib/efi/efi_stub.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
lib/efi/efi_stub.c +1 -1
index 1814960572..9788dedba7 100644
@@ -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 &&
Signature · 1 line
2.12.3
#1 lore raw

PATCH 1/1 efi_stub: Fix GDT_NOTSYS check

Quoted 11 lines · Alexander Graf

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.

---
 lib/efi/efi_stub.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
#2 lore raw

PATCH 1/1 efi_stub: Fix GDT_NOTSYS check

Hi Alexander,

Quoted 7 lines · Bin Meng
Quoted 6 lines · Alexander Graf

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.

Quoted 7 lines
Quoted 5 lines
---
 lib/efi/efi_stub.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Looks this one is applied nowhere?

Regards,
Bin

#3 lore raw

PATCH 1/1 efi_stub: Fix GDT_NOTSYS check

Quoted 16 lines · Bin Meng

Hi Alexander,

Quoted 13 lines · Bin Meng
Quoted 11 lines · Alexander Graf

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.

---
 lib/efi/efi_stub.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
Quoted 3 lines
Quoted 1 line

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

#4 lore raw

PATCH 1/1 efi_stub: Fix GDT_NOTSYS check

Hi Alex,

Quoted 19 lines · Alexander Graf
Quoted 16 lines · Bin Meng

Hi Alexander,

Quoted 13 lines · Bin Meng
Quoted 11 lines · Alexander Graf

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.

---
 lib/efi/efi_stub.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
Quoted 8 lines
Quoted 3 lines
Quoted 1 line

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