public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
* [PATCH] UefiCpuPkg/CpuDxe: fix an incorrect bit-wise operation
@ 2018-09-08  2:48 Jian J Wang
  2018-09-08  3:24 ` Wang, Jian J
  0 siblings, 1 reply; 4+ messages in thread
From: Jian J Wang @ 2018-09-08  2:48 UTC (permalink / raw)
  To: edk2-devel; +Cc: Hao A Wu

The left operand is 64-bit but right operand could be 32-bit.
A typecast is a must because of '~' op before it.

Cc: Hao A Wu <hao.a.wu@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Jian J Wang <jian.j.wang@intel.com>
---
 UefiCpuPkg/CpuDxe/CpuPageTable.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/UefiCpuPkg/CpuDxe/CpuPageTable.c b/UefiCpuPkg/CpuDxe/CpuPageTable.c
index ef6e080a07..0a980b9753 100644
--- a/UefiCpuPkg/CpuDxe/CpuPageTable.c
+++ b/UefiCpuPkg/CpuDxe/CpuPageTable.c
@@ -1181,7 +1181,7 @@ DebugExceptionHandler (
 
   for (PFEntry = 0; PFEntry < mPFEntryCount[CpuIndex]; PFEntry++) {
     if (mLastPFEntryPointer[CpuIndex][PFEntry] != NULL) {
-      *mLastPFEntryPointer[CpuIndex][PFEntry] &= ~IA32_PG_P;
+      *mLastPFEntryPointer[CpuIndex][PFEntry] &= ~(UINT64)IA32_PG_P;
     }
   }
 
-- 
2.16.2.windows.1



^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] UefiCpuPkg/CpuDxe: fix an incorrect bit-wise operation
  2018-09-08  2:48 [PATCH] UefiCpuPkg/CpuDxe: fix an incorrect bit-wise operation Jian J Wang
@ 2018-09-08  3:24 ` Wang, Jian J
  2018-09-08  3:32   ` Wang, Jian J
  0 siblings, 1 reply; 4+ messages in thread
From: Wang, Jian J @ 2018-09-08  3:24 UTC (permalink / raw)
  To: edk2-devel, edk2-devel@lists.01.org; +Cc: Wu, Hao A

Forgot to mention BZ info:
https://bugzilla.tianocore.org/show_bug.cgi?id=1095

Regards,
Jian


> -----Original Message-----
> From: edk2-devel [mailto:edk2-devel-bounces@lists.01.org]
> Sent: Saturday, September 08, 2018 10:48 AM
> To: edk2-devel@lists.01.org
> Cc: Wu, Hao A <hao.a.wu@intel.com>
> Subject: [edk2] [PATCH] UefiCpuPkg/CpuDxe: fix an incorrect bit-wise operation
> 
> The left operand is 64-bit but right operand could be 32-bit.
> A typecast is a must because of '~' op before it.
> 
> Cc: Hao A Wu <hao.a.wu@intel.com>
> Contributed-under: TianoCore Contribution Agreement 1.1
> Signed-off-by: Jian J Wang <jian.j.wang@intel.com>
> ---
>  UefiCpuPkg/CpuDxe/CpuPageTable.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/UefiCpuPkg/CpuDxe/CpuPageTable.c
> b/UefiCpuPkg/CpuDxe/CpuPageTable.c
> index ef6e080a07..0a980b9753 100644
> --- a/UefiCpuPkg/CpuDxe/CpuPageTable.c
> +++ b/UefiCpuPkg/CpuDxe/CpuPageTable.c
> @@ -1181,7 +1181,7 @@ DebugExceptionHandler (
> 
>    for (PFEntry = 0; PFEntry < mPFEntryCount[CpuIndex]; PFEntry++) {
>      if (mLastPFEntryPointer[CpuIndex][PFEntry] != NULL) {
> -      *mLastPFEntryPointer[CpuIndex][PFEntry] &= ~IA32_PG_P;
> +      *mLastPFEntryPointer[CpuIndex][PFEntry] &= ~(UINT64)IA32_PG_P;
>      }
>    }
> 
> --
> 2.16.2.windows.1
> 
> _______________________________________________
> edk2-devel mailing list
> edk2-devel@lists.01.org
> https://lists.01.org/mailman/listinfo/edk2-devel


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] UefiCpuPkg/CpuDxe: fix an incorrect bit-wise operation
  2018-09-08  3:24 ` Wang, Jian J
@ 2018-09-08  3:32   ` Wang, Jian J
  2018-09-10  1:22     ` Wu, Hao A
  0 siblings, 1 reply; 4+ messages in thread
From: Wang, Jian J @ 2018-09-08  3:32 UTC (permalink / raw)
  To: edk2-devel, edk2-devel@lists.01.org; +Cc: Wu, Hao A

And BZ#1164: https://bugzilla.tianocore.org/show_bug.cgi?id=1164

Regards,
Jian

From: edk2-devel [mailto:edk2-devel-bounces@lists.01.org]
Sent: Saturday, September 08, 2018 11:25 AM
To: edk2-devel <edk2-devel-bounces@lists.01.org>; edk2-devel@lists.01.org
Cc: Wu, Hao A <hao.a.wu@intel.com>
Subject: Re: [edk2] [PATCH] UefiCpuPkg/CpuDxe: fix an incorrect bit-wise operation

Forgot to mention BZ info:
https://bugzilla.tianocore.org/show_bug.cgi?id=1095

Regards,
Jian


> -----Original Message-----
> From: edk2-devel [mailto:edk2-devel-bounces@lists.01.org]
> Sent: Saturday, September 08, 2018 10:48 AM
> To: edk2-devel@lists.01.org<mailto:edk2-devel@lists.01.org>
> Cc: Wu, Hao A <hao.a.wu@intel.com<mailto:hao.a.wu@intel.com>>
> Subject: [edk2] [PATCH] UefiCpuPkg/CpuDxe: fix an incorrect bit-wise operation
>
> The left operand is 64-bit but right operand could be 32-bit.
> A typecast is a must because of '~' op before it.
>
> Cc: Hao A Wu <hao.a.wu@intel.com<mailto:hao.a.wu@intel.com>>
> Contributed-under: TianoCore Contribution Agreement 1.1
> Signed-off-by: Jian J Wang <jian.j.wang@intel.com<mailto:jian.j.wang@intel.com>>
> ---
>  UefiCpuPkg/CpuDxe/CpuPageTable.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/UefiCpuPkg/CpuDxe/CpuPageTable.c
> b/UefiCpuPkg/CpuDxe/CpuPageTable.c
> index ef6e080a07..0a980b9753 100644
> --- a/UefiCpuPkg/CpuDxe/CpuPageTable.c
> +++ b/UefiCpuPkg/CpuDxe/CpuPageTable.c
> @@ -1181,7 +1181,7 @@ DebugExceptionHandler (
>
>    for (PFEntry = 0; PFEntry < mPFEntryCount[CpuIndex]; PFEntry++) {
>      if (mLastPFEntryPointer[CpuIndex][PFEntry] != NULL) {
> -      *mLastPFEntryPointer[CpuIndex][PFEntry] &= ~IA32_PG_P;
> +      *mLastPFEntryPointer[CpuIndex][PFEntry] &= ~(UINT64)IA32_PG_P;
>      }
>    }
>
> --
> 2.16.2.windows.1
>
> _______________________________________________
> edk2-devel mailing list
> edk2-devel@lists.01.org<mailto:edk2-devel@lists.01.org>
> https://lists.01.org/mailman/listinfo/edk2-devel
_______________________________________________
edk2-devel mailing list
edk2-devel@lists.01.org<mailto:edk2-devel@lists.01.org>
https://lists.01.org/mailman/listinfo/edk2-devel


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] UefiCpuPkg/CpuDxe: fix an incorrect bit-wise operation
  2018-09-08  3:32   ` Wang, Jian J
@ 2018-09-10  1:22     ` Wu, Hao A
  0 siblings, 0 replies; 4+ messages in thread
From: Wu, Hao A @ 2018-09-10  1:22 UTC (permalink / raw)
  To: Wang, Jian J, edk2-devel, edk2-devel@lists.01.org

Reviewed-by: Hao Wu <hao.a.wu@intel.com>

Best Regards,
Hao Wu

From: Wang, Jian J
Sent: Saturday, September 08, 2018 11:32 AM
To: edk2-devel; edk2-devel@lists.01.org
Cc: Wu, Hao A
Subject: RE: [edk2] [PATCH] UefiCpuPkg/CpuDxe: fix an incorrect bit-wise operation

And BZ#1164: https://bugzilla.tianocore.org/show_bug.cgi?id=1164

Regards,
Jian

From: edk2-devel [mailto:edk2-devel-bounces@lists.01.org]
Sent: Saturday, September 08, 2018 11:25 AM
To: edk2-devel <edk2-devel-bounces@lists.01.org>; edk2-devel@lists.01.org
Cc: Wu, Hao A <hao.a.wu@intel.com>
Subject: Re: [edk2] [PATCH] UefiCpuPkg/CpuDxe: fix an incorrect bit-wise operation

Forgot to mention BZ info:
https://bugzilla.tianocore.org/show_bug.cgi?id=1095

Regards,
Jian


> -----Original Message-----
> From: edk2-devel [mailto:edk2-devel-bounces@lists.01.org]
> Sent: Saturday, September 08, 2018 10:48 AM
> To: edk2-devel@lists.01.org<mailto:edk2-devel@lists.01.org>
> Cc: Wu, Hao A <hao.a.wu@intel.com<mailto:hao.a.wu@intel.com>>
> Subject: [edk2] [PATCH] UefiCpuPkg/CpuDxe: fix an incorrect bit-wise operation
>
> The left operand is 64-bit but right operand could be 32-bit.
> A typecast is a must because of '~' op before it.
>
> Cc: Hao A Wu <hao.a.wu@intel.com<mailto:hao.a.wu@intel.com>>
> Contributed-under: TianoCore Contribution Agreement 1.1
> Signed-off-by: Jian J Wang <jian.j.wang@intel.com<mailto:jian.j.wang@intel.com>>
> ---
>  UefiCpuPkg/CpuDxe/CpuPageTable.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/UefiCpuPkg/CpuDxe/CpuPageTable.c
> b/UefiCpuPkg/CpuDxe/CpuPageTable.c
> index ef6e080a07..0a980b9753 100644
> --- a/UefiCpuPkg/CpuDxe/CpuPageTable.c
> +++ b/UefiCpuPkg/CpuDxe/CpuPageTable.c
> @@ -1181,7 +1181,7 @@ DebugExceptionHandler (
>
>    for (PFEntry = 0; PFEntry < mPFEntryCount[CpuIndex]; PFEntry++) {
>      if (mLastPFEntryPointer[CpuIndex][PFEntry] != NULL) {
> -      *mLastPFEntryPointer[CpuIndex][PFEntry] &= ~IA32_PG_P;
> +      *mLastPFEntryPointer[CpuIndex][PFEntry] &= ~(UINT64)IA32_PG_P;
>      }
>    }
>
> --
> 2.16.2.windows.1
>
> _______________________________________________
> edk2-devel mailing list
> edk2-devel@lists.01.org<mailto:edk2-devel@lists.01.org>
> https://lists.01.org/mailman/listinfo/edk2-devel
_______________________________________________
edk2-devel mailing list
edk2-devel@lists.01.org<mailto:edk2-devel@lists.01.org>
https://lists.01.org/mailman/listinfo/edk2-devel


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2018-09-10  1:22 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-09-08  2:48 [PATCH] UefiCpuPkg/CpuDxe: fix an incorrect bit-wise operation Jian J Wang
2018-09-08  3:24 ` Wang, Jian J
2018-09-08  3:32   ` Wang, Jian J
2018-09-10  1:22     ` Wu, Hao A

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox