From: "Dong, Eric" <eric.dong@intel.com>
To: "Ni, Ruiyu" <ruiyu.ni@intel.com>,
"edk2-devel@lists.01.org" <edk2-devel@lists.01.org>
Subject: Re: [PATCH] UefiCpuPkg/MtrrLib: Use SetMem instead of SetMem64 to fix hang
Date: Mon, 23 Oct 2017 07:11:56 +0000 [thread overview]
Message-ID: <ED077930C258884BBCB450DB737E66224AA3D3F4@shsmsx102.ccr.corp.intel.com> (raw)
In-Reply-To: <20171023051205.197944-1-ruiyu.ni@intel.com>
Reviewed-by: Eric Dong <eric.dong@intel.com>
> -----Original Message-----
> From: Ni, Ruiyu
> Sent: Monday, October 23, 2017 1:12 PM
> To: edk2-devel@lists.01.org
> Cc: Dong, Eric <eric.dong@intel.com>
> Subject: [PATCH] UefiCpuPkg/MtrrLib: Use SetMem instead of SetMem64 to
> fix hang
>
> ClearMasks and OrMasks are not 8-byte aligned.
> But SetMem64 requires the input address is 8-byte aligned.
> If the input is not 8-byte aligned, assertion is hit.
> Use SetMem instead.
>
> Contributed-under: TianoCore Contribution Agreement 1.1
> Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com>
> Cc: Eric Dong <eric.dong@intel.com>
> ---
> UefiCpuPkg/Library/MtrrLib/MtrrLib.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/UefiCpuPkg/Library/MtrrLib/MtrrLib.c
> b/UefiCpuPkg/Library/MtrrLib/MtrrLib.c
> index 200becdd4a..8e46e46cd4 100644
> --- a/UefiCpuPkg/Library/MtrrLib/MtrrLib.c
> +++ b/UefiCpuPkg/Library/MtrrLib/MtrrLib.c
> @@ -2123,8 +2123,8 @@ MtrrLibSetBelow1MBMemoryAttribute (
> //
> // (Value & ~0 | 0) still equals to (Value)
> //
> - SetMem64 (ClearMasks, sizeof (ClearMasks), 0);
> - SetMem64 (OrMasks, sizeof (OrMasks), 0);
> + SetMem (ClearMasks, sizeof (ClearMasks), 0); SetMem (OrMasks, sizeof
> + (OrMasks), 0);
>
> MsrIndex = (UINT32)-1;
> while ((BaseAddress < BASE_1MB) && (Length != 0)) {
> --
> 2.12.2.windows.2
prev parent reply other threads:[~2017-10-23 7:08 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-10-23 5:12 [PATCH] UefiCpuPkg/MtrrLib: Use SetMem instead of SetMem64 to fix hang Ruiyu Ni
2017-10-23 7:11 ` Dong, Eric [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-list from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=ED077930C258884BBCB450DB737E66224AA3D3F4@shsmsx102.ccr.corp.intel.com \
--to=devel@edk2.groups.io \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox