From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [216.205.24.124]) by mx.groups.io with SMTP id smtpd.web10.8803.1621945002443604961 for ; Tue, 25 May 2021 05:16:42 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=JZLiQYqX; spf=pass (domain: redhat.com, ip: 216.205.24.124, mailfrom: lersek@redhat.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1621945001; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=FYpkIM9J3XRw+Syj2UJ8bbRxm6PvCWW0rqFd+MHhRaU=; b=JZLiQYqXzTqYwyIAAMETNr8u4rnhqD4PapE9QFE3rM2ZkjYoiVKQxX5NdSCbnGv1ot2kSM oBgNNrYB9fMadrUZT6HvAeVjPDvyUmccKe400SRQGkANYiFNMs2bDc32jBHcd8FVePns7i vClg32WOIm9QypZUoB7VU20oKrhZmLo= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-185-Fkny4mjIOZefsEKNJoXOuw-1; Tue, 25 May 2021 08:16:36 -0400 X-MC-Unique: Fkny4mjIOZefsEKNJoXOuw-1 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 58C67801E5A; Tue, 25 May 2021 12:16:35 +0000 (UTC) Received: from lacos-laptop-7.usersys.redhat.com (ovpn-113-28.ams2.redhat.com [10.36.113.28]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 48E8E179E6; Tue, 25 May 2021 12:16:33 +0000 (UTC) Subject: Re: [edk2-devel] [PATCH] MdePkg: Fix AsmReadSs() with GCC toolchain To: devel@edk2.groups.io, tanda.sat@gmail.com References: From: "Laszlo Ersek" Cc: Michael D Kinney , Liming Gao , Zhiguang Liu Message-ID: <6b450e1c-2d29-7fb3-1fc7-6fb55f170b06@redhat.com> Date: Tue, 25 May 2021 14:16:31 +0200 MIME-Version: 1.0 In-Reply-To: X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=lersek@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit 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 > --- > 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 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