From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM03-CO1-obe.outbound.protection.outlook.com (mail-co1nam03on0614.outbound.protection.outlook.com [IPv6:2a01:111:f400:fe48::614]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 3B6A6819E4 for ; Fri, 6 Jan 2017 07:31:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amdcloud.onmicrosoft.com; s=selector1-amd-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=y2/n2oUmmLmgA1H36rivLfQrqVnsZet80U/hqkC5jSQ=; b=S1ZsA4cQ9vcmCiFHAxC5jeoE3iNAGpheuU33YnA92fxQnpHuueRmAqWdz6lKlT0LC5uVTOKhnhQ0ew1BorrCLXSiATF/7V/NcWjnkxSEs6PU7+CcYkA/lUngOU38JB954wMgOybeEeNMU27uhhcuWqNQVcalcxxyoio5a7z1M5A= Received: from DM5PR12MB1243.namprd12.prod.outlook.com (10.168.237.22) by SN1PR12MB0672.namprd12.prod.outlook.com (10.163.208.30) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.817.10; Fri, 6 Jan 2017 15:31:12 +0000 Received: from DM5PR12MB1243.namprd12.prod.outlook.com ([10.168.237.22]) by DM5PR12MB1243.namprd12.prod.outlook.com ([10.168.237.22]) with mapi id 15.01.0817.009; Fri, 6 Jan 2017 15:31:10 +0000 From: "Duran, Leo" To: 'Laszlo Ersek' , "edk2-devel@ml01.01.org" CC: "ruiyu.ni@intel.com" , "Singh, Brijesh" , "jordan.l.justen@intel.com" , "liming.gao@intel.com" , "michael.d.kinney@intel.com" , "jeff.fan@intel.com" , "prince.agyeman@intel.com" , "david.wei@intel.com" Thread-Topic: [edk2] [PATCH v3 4/4] Modify QemuFwCfgLib to use new BaseIoFifoLib library. Thread-Index: AQHSZ52g61kNcdgd5029H+E6aPjsGKErUu2AgABBTEA= Date: Fri, 6 Jan 2017 15:31:10 +0000 Message-ID: References: <1483652965-14357-1-git-send-email-leo.duran@amd.com> <1483652965-14357-5-git-send-email-leo.duran@amd.com> In-Reply-To: Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: spf=none (sender IP is ) smtp.mailfrom=leo.duran@amd.com; x-originating-ip: [165.204.77.1] x-microsoft-exchange-diagnostics: 1; SN1PR12MB0672; 7:an8BcNrHo0eA0kQVdcL4l9Vr50vyAGJZEiA3ELWeKfvb5SqqnefdK0MPasLQW2HfbbnSIXp+8AyjM9ueeY2HAOb0w6KY+fODJRPPILFh2poFByVbWy8DHKhq3LwA4UDHn3wH2eUhO31Zw+hS0yEtOxYBOTci2lXtxNB8QSG49n3eRV2vp42PMg/UskURBOt9vfHTRD/7l0DIwXkvPAgM51X5CUkgUT+Wpk6b+YPmkyPvZSRDc+tskWMoo+iyls94+P634/PS729i6Y2GHW3uEUeItJNQsBwA9q0A81gzq3bXkA1OVCWOUqXYKEMUWTt0qmSqS9o1cHbZoUoTjjqq8KqGoLjTLQJVss7r4ORScJFs7YFoNtGOiaqOMtplfrpg2XuX205bfs0b3NmoVh2sR38lK0V42HOOeQZatWR5cnodxOCN0N8Brplkmvh3YkRLu4VFbkaJGoSWpq4Gow9qAA==; 20:CcjrYbXf7JlmCG97n6E3HEcP2PHMnCV1ZO7JJbN9jSA78hOFGbcjo+YFvcBilmRLpSIP5dzjCIvPVWw/F6+DlxpP1CWyga7FUEdcnhJHdoBOQQYhwb9gooTRsECJTNRvl8qLBfZhracfpNkuweju0yT/z/nDpHzAVekvu5d89cazjhg5Nctf80uhZBC2BUoCYENyDf27ViK8ONEGhwEOnUcva1TXxoYvFbh3rYS8WIcjmHIJlMshepIJNMiyAtcq x-forefront-antispam-report: SFV:SKI; SCL:-1SFV:NSPM; SFS:(10009020)(6009001)(6029001)(7916002)(39410400002)(39850400002)(39860400002)(39840400002)(39450400003)(377454003)(199003)(52314003)(189002)(24454002)(13464003)(50986999)(68736007)(99286003)(81156014)(2906002)(305945005)(25786008)(81166006)(7736002)(55016002)(54356999)(8676002)(6306002)(101416001)(189998001)(2501003)(8936002)(74316002)(122556002)(7696004)(76176999)(97736004)(5660300001)(1720100001)(2950100002)(3846002)(5001770100001)(92566002)(2900100001)(54906002)(106356001)(102836003)(33656002)(106116001)(6116002)(86362001)(4326007)(6436002)(9686002)(105586002)(38730400001)(77096006)(6506006)(15395725005)(229853002)(3280700002)(3660700001)(66066001)(19627235001); DIR:OUT; SFP:1101; SCL:1; SRVR:SN1PR12MB0672; H:DM5PR12MB1243.namprd12.prod.outlook.com; FPR:; SPF:None; PTR:InfoNoRecords; A:1; MX:1; LANG:en; x-ms-office365-filtering-correlation-id: 80ebd5c3-69aa-4a2e-bc27-08d436490aec x-microsoft-antispam: UriScan:;BCL:0;PCL:0;RULEID:(22001);SRVR:SN1PR12MB0672; x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:(767451399110)(228905959029699); x-exchange-antispam-report-cfa-test: BCL:0; PCL:0; RULEID:(6040375)(601004)(2401047)(5005006)(8121501046)(10201501046)(3002001)(6055026)(6041248)(20161123560025)(20161123562025)(20161123555025)(20161123564025)(6072148); SRVR:SN1PR12MB0672; BCL:0; PCL:0; RULEID:; SRVR:SN1PR12MB0672; x-forefront-prvs: 01792087B6 received-spf: None (protection.outlook.com: amd.com does not designate permitted sender hosts) spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM MIME-Version: 1.0 X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-originalarrivaltime: 06 Jan 2017 15:31:10.7479 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN1PR12MB0672 Subject: Re: [PATCH v3 4/4] Modify QemuFwCfgLib to use new BaseIoFifoLib library. X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 06 Jan 2017 15:31:14 -0000 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable > -----Original Message----- > From: Laszlo Ersek [mailto:lersek@redhat.com] > Sent: Friday, January 06, 2017 5:36 AM > To: Duran, Leo ; edk2-devel@ml01.01.org > Cc: ruiyu.ni@intel.com; Singh, Brijesh ; > jordan.l.justen@intel.com; liming.gao@intel.com; > michael.d.kinney@intel.com; jeff.fan@intel.com; > prince.agyeman@intel.com; david.wei@intel.com > Subject: Re: [edk2] [PATCH v3 4/4] Modify QemuFwCfgLib to use new > BaseIoFifoLib library. >=20 > On 01/05/17 22:49, Leo Duran wrote: > > From: Brijesh Singh > > > > Contributed-under: TianoCore Contribution Agreement 1.0 > > Signed-off-by: Brijesh Singh > > Signed-off-by: Leo Duran > > --- > > OvmfPkg/Library/QemuFwCfgLib/Ia32/IoLibExAsm.nasm | 55 ---------------= - > ------- > > OvmfPkg/Library/QemuFwCfgLib/QemuFwCfgLib.c | 54 +--------------= --- > ---- > > OvmfPkg/Library/QemuFwCfgLib/QemuFwCfgLib.inf | 8 +--- > > OvmfPkg/Library/QemuFwCfgLib/QemuFwCfgSecLib.inf | 8 +--- > > OvmfPkg/Library/QemuFwCfgLib/X64/IoLibExAsm.nasm | 52 > > --------------------- > > 5 files changed, 5 insertions(+), 172 deletions(-) delete mode > > 100644 OvmfPkg/Library/QemuFwCfgLib/Ia32/IoLibExAsm.nasm > > delete mode 100644 > OvmfPkg/Library/QemuFwCfgLib/X64/IoLibExAsm.nasm >=20 > Differences vs. v1: > - git metadata & commit msg tags fixed, good > - copyright notices added, okay > - now unnecessary prototypes removed, good > - QemuFwCfgSecLib.inf now handled (I didn't notice it in v1, sorry!), OK >=20 > However, the #include directive is also gone, from > "QemuFwCfgLib.c".=20 [Duran, Leo] OK, I'll fix that on the next revision. Thanks. > I think you may have moved that directive to > "QemuFwCfgLibInternal.h", but forgotten to stage that change for commit, > with "git add"? >=20 > (Anyway, what was wrong with the #include directive being in > "QemuFwCfgLib.c"?) >=20 > Apart from the #include directive, it looks good to me. (I know Liming is > proposing a different avenue, and here I'm not arguing against that; just > saying that under this approach, the patch seems mostly okay.) >=20 > Thanks, > Laszlo >=20 >=20 > > diff --git a/OvmfPkg/Library/QemuFwCfgLib/Ia32/IoLibExAsm.nasm > > b/OvmfPkg/Library/QemuFwCfgLib/Ia32/IoLibExAsm.nasm > > deleted file mode 100644 > > index faa22e9..0000000 > > --- a/OvmfPkg/Library/QemuFwCfgLib/Ia32/IoLibExAsm.nasm > > +++ /dev/null > > @@ -1,55 +0,0 @@ > > -;-------------------------------------------------------------------- > > ---------- > > -; > > -; Copyright (c) 2006 - 2013, Intel Corporation. All rights > > reserved.
-; This program and the accompanying materials -; are > > licensed and made available under the terms and conditions of the BSD > > License -; which accompanies this distribution. The full text of the > > license may be found at -; http://opensource.org/licenses/bsd- > license.php. > > -; > > -; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" > > BASIS, -; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, > EITHER EXPRESS OR IMPLIED. > > -; > > -;-------------------------------------------------------------------- > > ---------- > > - > > - SECTION .text > > - > > -;-------------------------------------------------------------------- > > ---------- > > -; VOID > > -; EFIAPI > > -; IoReadFifo8 ( > > -; IN UINTN Port, > > -; IN UINTN Size, > > -; IN VOID *Buffer > > -; ); > > -;-------------------------------------------------------------------- > > ---------- > > -global ASM_PFX(IoReadFifo8) > > -ASM_PFX(IoReadFifo8): > > - > > - mov dx, [esp + 4] > > - mov ecx, [esp + 8] > > - push edi > > - mov edi, [esp + 16] > > -rep insb > > - pop edi > > - ret > > - > > -;-------------------------------------------------------------------- > > ---------- > > -; VOID > > -; EFIAPI > > -; IoWriteFifo8 ( > > -; IN UINTN Port, > > -; IN UINTN Size, > > -; IN VOID *Buffer > > -; ); > > -;-------------------------------------------------------------------- > > ---------- > > -global ASM_PFX(IoWriteFifo8) > > -ASM_PFX(IoWriteFifo8): > > - > > - mov dx, [esp + 4] > > - mov ecx, [esp + 8] > > - push esi > > - mov esi, [esp + 16] > > -rep outsb > > - pop esi > > - ret > > - > > diff --git a/OvmfPkg/Library/QemuFwCfgLib/QemuFwCfgLib.c > > b/OvmfPkg/Library/QemuFwCfgLib/QemuFwCfgLib.c > > index 0bbf121..68fbade 100644 > > --- a/OvmfPkg/Library/QemuFwCfgLib/QemuFwCfgLib.c > > +++ b/OvmfPkg/Library/QemuFwCfgLib/QemuFwCfgLib.c > > @@ -2,6 +2,7 @@ > > > > Copyright (c) 2011 - 2013, Intel Corporation. All rights reserved. > > Copyright (C) 2013, Red Hat, Inc. > > + Copyright (c) 2017, AMD Inc. All rights reserved.
> > > > This program and the accompanying materials > > are licensed and made available under the terms and conditions of > > the BSD License @@ -26,59 +27,6 @@ > > > > > > /** > > - Reads an 8-bit I/O port fifo into a block of memory. > > - > > - Reads the 8-bit I/O fifo port specified by Port. > > - > > - The port is read Count times, and the read data is > > - stored in the provided Buffer. > > - > > - This function must guarantee that all I/O read and write operations > > are > > - serialized. > > - > > - If 8-bit I/O port operations are not supported, then ASSERT(). > > - > > - @param Port The I/O port to read. > > - @param Count The number of times to read I/O port. > > - @param Buffer The buffer to store the read data into. > > - > > -**/ > > -VOID > > -EFIAPI > > -IoReadFifo8 ( > > - IN UINTN Port, > > - IN UINTN Count, > > - OUT VOID *Buffer > > - ); > > - > > -/** > > - Writes an 8-bit I/O port fifo from a block of memory. > > - > > - Writes the 8-bit I/O fifo port specified by Port. > > - > > - The port is written Count times, and the data are obtained > > - from the provided Buffer. > > - > > - This function must guarantee that all I/O read and write operations > > are > > - serialized. > > - > > - If 8-bit I/O port operations are not supported, then ASSERT(). > > - > > - @param Port The I/O port to read. > > - @param Count The number of times to read I/O port. > > - @param Buffer The buffer to store the read data into. > > - > > -**/ > > -VOID > > -EFIAPI > > -IoWriteFifo8 ( > > - IN UINTN Port, > > - IN UINTN Count, > > - OUT VOID *Buffer > > - ); > > - > > - > > -/** > > Selects a firmware configuration item for reading. > > > > Following this call, any data read from this item will start from > > diff --git a/OvmfPkg/Library/QemuFwCfgLib/QemuFwCfgLib.inf > > b/OvmfPkg/Library/QemuFwCfgLib/QemuFwCfgLib.inf > > index 66ac778..e48c639 100644 > > --- a/OvmfPkg/Library/QemuFwCfgLib/QemuFwCfgLib.inf > > +++ b/OvmfPkg/Library/QemuFwCfgLib/QemuFwCfgLib.inf > > @@ -4,6 +4,7 @@ > > # > > # Copyright (C) 2013, Red Hat, Inc. > > # Copyright (c) 2008 - 2012, Intel Corporation. All rights > > reserved.
> > +# Copyright (c) 2017, AMD Inc. All rights reserved.
> > # > > # This program and the accompanying materials # are licensed and > > made available under the terms and conditions of the BSD License @@ > > -36,12 +37,6 @@ [Sources] > > QemuFwCfgLib.c > > QemuFwCfgPeiDxe.c > > > > -[Sources.IA32] > > - Ia32/IoLibExAsm.nasm > > - > > -[Sources.X64] > > - X64/IoLibExAsm.nasm > > - > > [Packages] > > MdePkg/MdePkg.dec > > OvmfPkg/OvmfPkg.dec > > @@ -51,5 +46,6 @@ [LibraryClasses] > > BaseMemoryLib > > DebugLib > > IoLib > > + IoFifoLib > > MemoryAllocationLib > > > > diff --git a/OvmfPkg/Library/QemuFwCfgLib/QemuFwCfgSecLib.inf > > b/OvmfPkg/Library/QemuFwCfgLib/QemuFwCfgSecLib.inf > > index c1d6a54..6275ba9 100644 > > --- a/OvmfPkg/Library/QemuFwCfgLib/QemuFwCfgSecLib.inf > > +++ b/OvmfPkg/Library/QemuFwCfgLib/QemuFwCfgSecLib.inf > > @@ -4,6 +4,7 @@ > > # > > # Copyright (C) 2013, Red Hat, Inc. > > # Copyright (c) 2008 - 2012, Intel Corporation. All rights > > reserved.
> > +# Copyright (c) 2017, AMD Inc. All rights reserved.
> > # > > # This program and the accompanying materials # are licensed and > > made available under the terms and conditions of the BSD License @@ > > -34,12 +35,6 @@ [Sources] > > QemuFwCfgLib.c > > QemuFwCfgSec.c > > > > -[Sources.IA32] > > - Ia32/IoLibExAsm.nasm > > - > > -[Sources.X64] > > - X64/IoLibExAsm.nasm > > - > > [Packages] > > MdePkg/MdePkg.dec > > OvmfPkg/OvmfPkg.dec > > @@ -49,5 +44,6 @@ [LibraryClasses] > > BaseMemoryLib > > DebugLib > > IoLib > > + IoFifoLib > > MemoryAllocationLib > > > > diff --git a/OvmfPkg/Library/QemuFwCfgLib/X64/IoLibExAsm.nasm > > b/OvmfPkg/Library/QemuFwCfgLib/X64/IoLibExAsm.nasm > > deleted file mode 100644 > > index f1078f2..0000000 > > --- a/OvmfPkg/Library/QemuFwCfgLib/X64/IoLibExAsm.nasm > > +++ /dev/null > > @@ -1,52 +0,0 @@ > > -;-------------------------------------------------------------------- > > ---------- > > -; > > -; Copyright (c) 2006 - 2013, Intel Corporation. All rights > > reserved.
-; This program and the accompanying materials -; are > > licensed and made available under the terms and conditions of the BSD > > License -; which accompanies this distribution. The full text of the > > license may be found at -; http://opensource.org/licenses/bsd- > license.php. > > -; > > -; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" > > BASIS, -; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, > EITHER EXPRESS OR IMPLIED. > > -; > > -;-------------------------------------------------------------------- > > ---------- > > - > > - DEFAULT REL > > - SECTION .text > > - > > -;-------------------------------------------------------------------- > > ---------- > > -; VOID > > -; EFIAPI > > -; IoReadFifo8 ( > > -; IN UINTN Port, // rcx > > -; IN UINTN Size, // rdx > > -; IN VOID *Buffer // r8 > > -; ); > > -;-------------------------------------------------------------------- > > ---------- > > -global ASM_PFX(IoReadFifo8) > > -ASM_PFX(IoReadFifo8): > > - > > - xchg rcx, rdx > > - xchg rdi, r8 ; rdi: buffer address; r8: save rdi > > -rep insb > > - mov rdi, r8 ; restore rdi > > - ret > > - > > -;-------------------------------------------------------------------- > > ---------- > > -; VOID > > -; EFIAPI > > -; IoWriteFifo8 ( > > -; IN UINTN Port, // rcx > > -; IN UINTN Size, // rdx > > -; IN VOID *Buffer // r8 > > -; ); > > -;-------------------------------------------------------------------- > > ---------- > > -global ASM_PFX(IoWriteFifo8) > > -ASM_PFX(IoWriteFifo8): > > - > > - xchg rcx, rdx > > - xchg rsi, r8 ; rdi: buffer address; r8: save rdi > > -rep outsb > > - mov rsi, r8 ; restore rdi > > - ret > > - > >