public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: "Laszlo Ersek" <lersek@redhat.com>
To: devel@edk2.groups.io, tanda.sat@gmail.com
Cc: Michael D Kinney <michael.d.kinney@intel.com>,
	Liming Gao <gaoliming@byosoft.com.cn>,
	Zhiguang Liu <zhiguang.liu@intel.com>
Subject: Re: [edk2-devel] [PATCH] MdePkg: Fix AsmReadSs() with GCC toolchain
Date: Tue, 25 May 2021 14:16:31 +0200	[thread overview]
Message-ID: <6b450e1c-2d29-7fb3-1fc7-6fb55f170b06@redhat.com> (raw)
In-Reply-To: <d014090344f4822b57e806cc8d6a27bd5233429d.1621829775.git.tanda.sat@gmail.com>

CC'ing the MdePkg maintainers (see "Maintainers.txt" and
"$EDK_TOOLS_PATH/Scripts/GetMaintainer.py").

On 05/24/21 06:50, Satoshi Tanda wrote:
> REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3325

(1) The BZ URL is incorrect; the right URL is

https://bugzilla.tianocore.org/show_bug.cgi?id=3405

But I think whoever merges this patch can update the BZ URL upon merge.


(2) Similarly, I think the subject should be clarified, upon merge:

  MdePkg/BaseLib: Fix AsmReadSs() with GCC toolchain

> 
> AsmReadSs() in Ia32/GccInlinePriv.c and X64/GccInlinePriv.c return the
> DS segment selector value instead of SS.
> 
> Signed-off-by: Satoshi Tanda <tanda.sat@gmail.com>
> ---
>  MdePkg/Library/BaseLib/Ia32/GccInlinePriv.c | 2 +-
>  MdePkg/Library/BaseLib/X64/GccInlinePriv.c  | 2 +-
>  2 files changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/MdePkg/Library/BaseLib/Ia32/GccInlinePriv.c b/MdePkg/Library/BaseLib/Ia32/GccInlinePriv.c
> index 40e8c08beb..b8b5b85e73 100644
> --- a/MdePkg/Library/BaseLib/Ia32/GccInlinePriv.c
> +++ b/MdePkg/Library/BaseLib/Ia32/GccInlinePriv.c
> @@ -902,7 +902,7 @@ AsmReadSs (
>    UINT16  Data;
>  
>    __asm__ __volatile__ (
> -    "mov  %%ds, %0"
> +    "mov  %%ss, %0"
>      :"=a" (Data)
>      );
>  
> diff --git a/MdePkg/Library/BaseLib/X64/GccInlinePriv.c b/MdePkg/Library/BaseLib/X64/GccInlinePriv.c
> index 244bd62ee6..c3feb9f922 100644
> --- a/MdePkg/Library/BaseLib/X64/GccInlinePriv.c
> +++ b/MdePkg/Library/BaseLib/X64/GccInlinePriv.c
> @@ -911,7 +911,7 @@ AsmReadSs (
>    UINT16  Data;
>  
>    __asm__ __volatile__ (
> -    "mov  %%ds, %0"
> +    "mov  %%ss, %0"
>      :"=a" (Data)
>      );
>  
> 

With (1) and (2) fixed:

Reviewed-by: Laszlo Ersek <lersek@redhat.com>


Should this go into edk2-stable202105?

On one hand, this is clearly a bugfix. On the other hand, we're very
close to the tag, maybe something depends on the buggy behavior, and the
function has been broken since (at least) commit cf683fedc773
(2010-05-18). Personally I wouldn't rush it.

Thanks
Laszlo


  reply	other threads:[~2021-05-25 12:16 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-05-24  4:50 [PATCH] MdePkg: Fix AsmReadSs() with GCC toolchain Satoshi Tanda
2021-05-25 12:16 ` Laszlo Ersek [this message]
2021-05-25 14:28   ` [edk2-devel] " Satoshi Tanda
2021-05-25 16:24     ` Laszlo Ersek
2021-06-04  0:24       ` Satoshi Tanda
2021-06-04  3:03         ` 回复: " gaoliming
2021-06-04  3:28           ` [edk2-devel] " Satoshi Tanda

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=6b450e1c-2d29-7fb3-1fc7-6fb55f170b06@redhat.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