* [PATCH] MdePkg: Fix AsmReadSs() with GCC toolchain
@ 2021-05-24 4:50 Satoshi Tanda
2021-05-25 12:16 ` [edk2-devel] " Laszlo Ersek
0 siblings, 1 reply; 7+ messages in thread
From: Satoshi Tanda @ 2021-05-24 4:50 UTC (permalink / raw)
To: devel; +Cc: lersek, Satoshi Tanda
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3325
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)
);
--
2.25.1
^ permalink raw reply related [flat|nested] 7+ messages in thread
* Re: [edk2-devel] [PATCH] MdePkg: Fix AsmReadSs() with GCC toolchain
2021-05-24 4:50 [PATCH] MdePkg: Fix AsmReadSs() with GCC toolchain Satoshi Tanda
@ 2021-05-25 12:16 ` Laszlo Ersek
2021-05-25 14:28 ` Satoshi Tanda
0 siblings, 1 reply; 7+ messages in thread
From: Laszlo Ersek @ 2021-05-25 12:16 UTC (permalink / raw)
To: devel, tanda.sat; +Cc: Michael D Kinney, Liming Gao, Zhiguang Liu
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
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [edk2-devel] [PATCH] MdePkg: Fix AsmReadSs() with GCC toolchain
2021-05-25 12:16 ` [edk2-devel] " Laszlo Ersek
@ 2021-05-25 14:28 ` Satoshi Tanda
2021-05-25 16:24 ` Laszlo Ersek
0 siblings, 1 reply; 7+ messages in thread
From: Satoshi Tanda @ 2021-05-25 14:28 UTC (permalink / raw)
To: Laszlo Ersek, devel
[-- Attachment #1: Type: text/plain, Size: 762 bytes --]
On Tue, May 25, 2021 at 05:16 AM, Laszlo Ersek wrote:
>
> (1) The BZ URL is incorrect;
>
> (2) Similarly, I think the subject should be clarified, upon merge
Let me know if anyone needs the updates of the patch on those (vs updating them inline at PR). I will do it if required.
>
> Should this go into edk2-stable202105?
No, to me. I do not find a reason to rush it neither.
>
> CC'ing the MdePkg maintainers (see "Maintainers.txt" and "$EDK_TOOLS_PATH/Scripts/GetMaintainer.py").
>
This document should probably be updated to mention them later. Those are not explained.
https://github.com/tianocore/tianocore.github.io/wiki/EDK-II-Development-Process
Thanks for the reviewing this and guiding me on the process.
Satoshi
[-- Attachment #2: Type: text/html, Size: 1244 bytes --]
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [edk2-devel] [PATCH] MdePkg: Fix AsmReadSs() with GCC toolchain
2021-05-25 14:28 ` Satoshi Tanda
@ 2021-05-25 16:24 ` Laszlo Ersek
2021-06-04 0:24 ` Satoshi Tanda
0 siblings, 1 reply; 7+ messages in thread
From: Laszlo Ersek @ 2021-05-25 16:24 UTC (permalink / raw)
To: Satoshi Tanda, devel
On 05/25/21 16:28, Satoshi Tanda wrote:
> On Tue, May 25, 2021 at 05:16 AM, Laszlo Ersek wrote:
>
>>
>> (1) The BZ URL is incorrect;
>
>>
>> (2) Similarly, I think the subject should be clarified, upon merge
>
> Let me know if anyone needs the updates of the patch on those (vs updating them inline at PR). I will do it if required.
I'll leave that decision to the MdePkg owners.
>
>>
>> Should this go into edk2-stable202105?
>
> No, to me. I do not find a reason to rush it neither.
>
>>
>> CC'ing the MdePkg maintainers (see "Maintainers.txt" and "$EDK_TOOLS_PATH/Scripts/GetMaintainer.py").
>>
>
> This document should probably be updated to mention them later. Those are not explained.
> https://github.com/tianocore/tianocore.github.io/wiki/EDK-II-Development-Process
It is spelled out in the "unkempt git guide", in this section:
https://github.com/tianocore/tianocore.github.io/wiki/Laszlo%27s-unkempt-git-guide-for-edk2-contributors-and-maintainers#contrib-18
but indeed it's not part of the official (normative) article.
The problem with writing more documentation is that then you have to
keep more documentation up-to-date :/
Thanks,
Laszlo
>
> Thanks for the reviewing this and guiding me on the process.
>
> Satoshi
>
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2021-06-04 3:28 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-05-24 4:50 [PATCH] MdePkg: Fix AsmReadSs() with GCC toolchain Satoshi Tanda
2021-05-25 12:16 ` [edk2-devel] " Laszlo Ersek
2021-05-25 14:28 ` 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
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox