* [edk2-platforms] [PATCH] KabyLakeSiliconPkg: Bitmask comparison logic bug
@ 2020-06-10 0:30 Nate DeSimone
2020-06-11 2:01 ` Chaganty, Rangasai V
2020-06-11 23:50 ` Chiu, Chasel
0 siblings, 2 replies; 3+ messages in thread
From: Nate DeSimone @ 2020-06-10 0:30 UTC (permalink / raw)
To: devel; +Cc: Chasel Chiu, Sai Chaganty
(Cpptv & B_PCH_SPI_SFDPX_VSCCX_CPPTV) can only evaluate to
two possible values, 0x0 or B_PCH_SPI_SFDPX_VSCCX_CPPTV
(aka BIT31). The current comparison to 0x1 will always fail.
Fixed the if statement to compare to B_PCH_SPI_SFDPX_VSCCX_CPPTV.
Signed-off-by: Nate DeSimone <nathaniel.l.desimone@intel.com>
Cc: Chasel Chiu <chasel.chiu@intel.com>
Cc: Sai Chaganty <rangasai.v.chaganty@intel.com>
---
.../KabylakeSiliconPkg/Hsti/Dxe/BootFirmwareMediaProtection.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/Silicon/Intel/KabylakeSiliconPkg/Hsti/Dxe/BootFirmwareMediaProtection.c b/Silicon/Intel/KabylakeSiliconPkg/Hsti/Dxe/BootFirmwareMediaProtection.c
index a255e7e514..467e133cd5 100644
--- a/Silicon/Intel/KabylakeSiliconPkg/Hsti/Dxe/BootFirmwareMediaProtection.c
+++ b/Silicon/Intel/KabylakeSiliconPkg/Hsti/Dxe/BootFirmwareMediaProtection.c
@@ -167,7 +167,7 @@ CheckBootFirmwareMediaProtection (
FreePool (HstiErrorString);
}
} else {
- if ((Cpptv & B_PCH_SPI_SFDPX_VSCCX_CPPTV) == 1) {
+ if ((Cpptv & B_PCH_SPI_SFDPX_VSCCX_CPPTV) == B_PCH_SPI_SFDPX_VSCCX_CPPTV) {
HstiErrorString = BuildHstiErrorString (HSTI_BYTE0_BOOT_FIRMWARE_MEDIA_PROTECTION_ERROR_CODE_6 ,HSTI_SPI_FLASH_CONFIGURATION, HSTI_BYTE0_BOOT_FIRMWARE_MEDIA_PROTECTION_ERROR_STRING_6);
Status = HstiLibAppendErrorString (
--
2.20.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [edk2-platforms] [PATCH] KabyLakeSiliconPkg: Bitmask comparison logic bug
2020-06-10 0:30 [edk2-platforms] [PATCH] KabyLakeSiliconPkg: Bitmask comparison logic bug Nate DeSimone
@ 2020-06-11 2:01 ` Chaganty, Rangasai V
2020-06-11 23:50 ` Chiu, Chasel
1 sibling, 0 replies; 3+ messages in thread
From: Chaganty, Rangasai V @ 2020-06-11 2:01 UTC (permalink / raw)
To: Desimone, Nathaniel L, devel@edk2.groups.io; +Cc: Chiu, Chasel
Good catch.
Reviewed-by: Sai Chaganty <rangasai.v.chaganty@intel.com>
-----Original Message-----
From: Desimone, Nathaniel L <nathaniel.l.desimone@intel.com>
Sent: Tuesday, June 09, 2020 5:31 PM
To: devel@edk2.groups.io
Cc: Chiu, Chasel <chasel.chiu@intel.com>; Chaganty, Rangasai V <rangasai.v.chaganty@intel.com>
Subject: [edk2-platforms] [PATCH] KabyLakeSiliconPkg: Bitmask comparison logic bug
(Cpptv & B_PCH_SPI_SFDPX_VSCCX_CPPTV) can only evaluate to two possible values, 0x0 or B_PCH_SPI_SFDPX_VSCCX_CPPTV (aka BIT31). The current comparison to 0x1 will always fail.
Fixed the if statement to compare to B_PCH_SPI_SFDPX_VSCCX_CPPTV.
Signed-off-by: Nate DeSimone <nathaniel.l.desimone@intel.com>
Cc: Chasel Chiu <chasel.chiu@intel.com>
Cc: Sai Chaganty <rangasai.v.chaganty@intel.com>
---
.../KabylakeSiliconPkg/Hsti/Dxe/BootFirmwareMediaProtection.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/Silicon/Intel/KabylakeSiliconPkg/Hsti/Dxe/BootFirmwareMediaProtection.c b/Silicon/Intel/KabylakeSiliconPkg/Hsti/Dxe/BootFirmwareMediaProtection.c
index a255e7e514..467e133cd5 100644
--- a/Silicon/Intel/KabylakeSiliconPkg/Hsti/Dxe/BootFirmwareMediaProtection.c
+++ b/Silicon/Intel/KabylakeSiliconPkg/Hsti/Dxe/BootFirmwareMediaProtect
+++ ion.c
@@ -167,7 +167,7 @@ CheckBootFirmwareMediaProtection (
FreePool (HstiErrorString);
}
} else {
- if ((Cpptv & B_PCH_SPI_SFDPX_VSCCX_CPPTV) == 1) {
+ if ((Cpptv & B_PCH_SPI_SFDPX_VSCCX_CPPTV) ==
+ B_PCH_SPI_SFDPX_VSCCX_CPPTV) {
HstiErrorString = BuildHstiErrorString (HSTI_BYTE0_BOOT_FIRMWARE_MEDIA_PROTECTION_ERROR_CODE_6 ,HSTI_SPI_FLASH_CONFIGURATION, HSTI_BYTE0_BOOT_FIRMWARE_MEDIA_PROTECTION_ERROR_STRING_6);
Status = HstiLibAppendErrorString (
--
2.20.1
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [edk2-platforms] [PATCH] KabyLakeSiliconPkg: Bitmask comparison logic bug
2020-06-10 0:30 [edk2-platforms] [PATCH] KabyLakeSiliconPkg: Bitmask comparison logic bug Nate DeSimone
2020-06-11 2:01 ` Chaganty, Rangasai V
@ 2020-06-11 23:50 ` Chiu, Chasel
1 sibling, 0 replies; 3+ messages in thread
From: Chiu, Chasel @ 2020-06-11 23:50 UTC (permalink / raw)
To: Desimone, Nathaniel L, devel@edk2.groups.io; +Cc: Chaganty, Rangasai V
Reviewed-by: Chasel Chiu <chasel.chiu@intel.com>
> -----Original Message-----
> From: Desimone, Nathaniel L <nathaniel.l.desimone@intel.com>
> Sent: Wednesday, June 10, 2020 8:31 AM
> To: devel@edk2.groups.io
> Cc: Chiu, Chasel <chasel.chiu@intel.com>; Chaganty, Rangasai V
> <rangasai.v.chaganty@intel.com>
> Subject: [edk2-platforms] [PATCH] KabyLakeSiliconPkg: Bitmask comparison
> logic bug
>
> (Cpptv & B_PCH_SPI_SFDPX_VSCCX_CPPTV) can only evaluate to two possible
> values, 0x0 or B_PCH_SPI_SFDPX_VSCCX_CPPTV (aka BIT31). The current
> comparison to 0x1 will always fail.
>
> Fixed the if statement to compare to B_PCH_SPI_SFDPX_VSCCX_CPPTV.
>
> Signed-off-by: Nate DeSimone <nathaniel.l.desimone@intel.com>
> Cc: Chasel Chiu <chasel.chiu@intel.com>
> Cc: Sai Chaganty <rangasai.v.chaganty@intel.com>
> ---
> .../KabylakeSiliconPkg/Hsti/Dxe/BootFirmwareMediaProtection.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git
> a/Silicon/Intel/KabylakeSiliconPkg/Hsti/Dxe/BootFirmwareMediaProtection.c
> b/Silicon/Intel/KabylakeSiliconPkg/Hsti/Dxe/BootFirmwareMediaProtection.c
> index a255e7e514..467e133cd5 100644
> ---
> a/Silicon/Intel/KabylakeSiliconPkg/Hsti/Dxe/BootFirmwareMediaProtection.c
> +++ b/Silicon/Intel/KabylakeSiliconPkg/Hsti/Dxe/BootFirmwareMediaProtect
> +++ ion.c
> @@ -167,7 +167,7 @@ CheckBootFirmwareMediaProtection (
> FreePool (HstiErrorString);
> }
> } else {
> - if ((Cpptv & B_PCH_SPI_SFDPX_VSCCX_CPPTV) == 1) {
> + if ((Cpptv & B_PCH_SPI_SFDPX_VSCCX_CPPTV) ==
> + B_PCH_SPI_SFDPX_VSCCX_CPPTV) {
>
> HstiErrorString = BuildHstiErrorString
> (HSTI_BYTE0_BOOT_FIRMWARE_MEDIA_PROTECTION_ERROR_CODE_6 ,HSTI_
> SPI_FLASH_CONFIGURATION,
> HSTI_BYTE0_BOOT_FIRMWARE_MEDIA_PROTECTION_ERROR_STRING_6);
> Status = HstiLibAppendErrorString (
> --
> 2.20.1
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2020-06-11 23:50 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-06-10 0:30 [edk2-platforms] [PATCH] KabyLakeSiliconPkg: Bitmask comparison logic bug Nate DeSimone
2020-06-11 2:01 ` Chaganty, Rangasai V
2020-06-11 23:50 ` Chiu, Chasel
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox