[edk2-devel] [PATCH 0/2] Remove string IO instruction in BaseIoLibIntrinsic.inf

duntan posted 2 patches 5 months, 3 weeks ago
Failed in applying to current master (apply log)
MdePkg/Library/BaseIoLibIntrinsic/BaseIoLibIntrinsic.inf    |  10 ++--------
MdePkg/Library/BaseIoLibIntrinsic/BaseIoLibIntrinsicSev.inf |   2 +-
MdePkg/Library/BaseIoLibIntrinsic/Ia32/IoFifo.nasm          | 131 -----------------------------------------------------------------------------------------------------------------------------------
MdePkg/Library/BaseIoLibIntrinsic/IoLibFifo.c               |  59 +++++++++++++++++++++++++++++++----------------------------
MdePkg/Library/BaseIoLibIntrinsic/IoLibFifoCc.c             | 217 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
MdePkg/Library/BaseIoLibIntrinsic/X64/IoFifo.nasm           | 120 ------------------------------------------------------------------------------------------------------------------------
6 files changed, 251 insertions(+), 288 deletions(-)
delete mode 100644 MdePkg/Library/BaseIoLibIntrinsic/Ia32/IoFifo.nasm
create mode 100644 MdePkg/Library/BaseIoLibIntrinsic/IoLibFifoCc.c
delete mode 100644 MdePkg/Library/BaseIoLibIntrinsic/X64/IoFifo.nasm
[edk2-devel] [PATCH 0/2] Remove string IO instruction in BaseIoLibIntrinsic.inf
Posted by duntan 5 months, 3 weeks ago
Simplify IoRead/WriteFifo implement in BaseIoLibIntrinsic by repeatedly calling
IoRead/Write in C code. This can avoid calling assembly code to use string I/O instructions.
With this change, Ia32/IoFifo.nasm and X64/IoFifo.nasm can be removed. Also
source files for IA32 and X64 are the same.

Dun Tan (2):
  MdePkg: Change IoLibFifo.c to IoLibFifoCc.c
  MdePkg:simplify Fifo API in BaseIoLibIntrinsic

 MdePkg/Library/BaseIoLibIntrinsic/BaseIoLibIntrinsic.inf    |  10 ++--------
 MdePkg/Library/BaseIoLibIntrinsic/BaseIoLibIntrinsicSev.inf |   2 +-
 MdePkg/Library/BaseIoLibIntrinsic/Ia32/IoFifo.nasm          | 131 -----------------------------------------------------------------------------------------------------------------------------------
 MdePkg/Library/BaseIoLibIntrinsic/IoLibFifo.c               |  59 +++++++++++++++++++++++++++++++----------------------------
 MdePkg/Library/BaseIoLibIntrinsic/IoLibFifoCc.c             | 217 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 MdePkg/Library/BaseIoLibIntrinsic/X64/IoFifo.nasm           | 120 ------------------------------------------------------------------------------------------------------------------------
 6 files changed, 251 insertions(+), 288 deletions(-)
 delete mode 100644 MdePkg/Library/BaseIoLibIntrinsic/Ia32/IoFifo.nasm
 create mode 100644 MdePkg/Library/BaseIoLibIntrinsic/IoLibFifoCc.c
 delete mode 100644 MdePkg/Library/BaseIoLibIntrinsic/X64/IoFifo.nasm

-- 
2.31.1.windows.1



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#110938): https://edk2.groups.io/g/devel/message/110938
Mute This Topic: https://groups.io/mt/102478994/1787277
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org]
-=-=-=-=-=-=-=-=-=-=-=-
Re: [edk2-devel] [PATCH 0/2] Remove string IO instruction in BaseIoLibIntrinsic.inf
Posted by Ni, Ray 5 months, 3 weeks ago
Reviewed-by: Ray Ni <ray.ni@intel.com>

Thanks for providing the alternative solution that avoids impacting OVMF boot performance.

Thanks,
Ray
________________________________
From: devel@edk2.groups.io <devel@edk2.groups.io> on behalf of duntan <dun.tan@intel.com>
Sent: Thursday, November 9, 2023 10:49 AM
To: devel@edk2.groups.io <devel@edk2.groups.io>
Subject: [edk2-devel] [PATCH 0/2] Remove string IO instruction in BaseIoLibIntrinsic.inf

Simplify IoRead/WriteFifo implement in BaseIoLibIntrinsic by repeatedly calling
IoRead/Write in C code. This can avoid calling assembly code to use string I/O instructions.
With this change, Ia32/IoFifo.nasm and X64/IoFifo.nasm can be removed. Also
source files for IA32 and X64 are the same.

Dun Tan (2):
  MdePkg: Change IoLibFifo.c to IoLibFifoCc.c
  MdePkg:simplify Fifo API in BaseIoLibIntrinsic

 MdePkg/Library/BaseIoLibIntrinsic/BaseIoLibIntrinsic.inf    |  10 ++--------
 MdePkg/Library/BaseIoLibIntrinsic/BaseIoLibIntrinsicSev.inf |   2 +-
 MdePkg/Library/BaseIoLibIntrinsic/Ia32/IoFifo.nasm          | 131 -----------------------------------------------------------------------------------------------------------------------------------
 MdePkg/Library/BaseIoLibIntrinsic/IoLibFifo.c               |  59 +++++++++++++++++++++++++++++++----------------------------
 MdePkg/Library/BaseIoLibIntrinsic/IoLibFifoCc.c             | 217 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 MdePkg/Library/BaseIoLibIntrinsic/X64/IoFifo.nasm           | 120 ------------------------------------------------------------------------------------------------------------------------
 6 files changed, 251 insertions(+), 288 deletions(-)
 delete mode 100644 MdePkg/Library/BaseIoLibIntrinsic/Ia32/IoFifo.nasm
 create mode 100644 MdePkg/Library/BaseIoLibIntrinsic/IoLibFifoCc.c
 delete mode 100644 MdePkg/Library/BaseIoLibIntrinsic/X64/IoFifo.nasm

--
2.31.1.windows.1








-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#110949): https://edk2.groups.io/g/devel/message/110949
Mute This Topic: https://groups.io/mt/102478994/1787277
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/leave/3901457/1787277/102458076/xyzzy [importer@patchew.org]
-=-=-=-=-=-=-=-=-=-=-=-


Re: [edk2-devel] [PATCH 0/2] Remove string IO instruction in BaseIoLibIntrinsic.inf
Posted by Laszlo Ersek 5 months, 2 weeks ago
On 11/9/23 06:56, Ni, Ray wrote:
> Reviewed-by: Ray Ni <ray.ni@intel.com>
> 
> Thanks for providing the alternative solution that avoids impacting OVMF
> boot performance.

This approach looks good to me.

The IA32 and X64 OVMF platforms use "BaseIoLibIntrinsicSev.inf", and
that library instance is left alone.

The RISC-V OVMF platform uses "BaseIoLibIntrinsic.inf", but RISC-V
already doesn't (can't) use the IA32/X64 NASM files.

So, surprisingly, the "IoFifo.nasm" files are actually unused,
pre-patch; IA32 and X64 OVMF only uses the "IoFifoSev.nasm" files.

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

Thanks!
Laszlo




> 
> Thanks,
> Ray
> ------------------------------------------------------------------------
> *From:* devel@edk2.groups.io <devel@edk2.groups.io> on behalf of duntan
> <dun.tan@intel.com>
> *Sent:* Thursday, November 9, 2023 10:49 AM
> *To:* devel@edk2.groups.io <devel@edk2.groups.io>
> *Subject:* [edk2-devel] [PATCH 0/2] Remove string IO instruction in
> BaseIoLibIntrinsic.inf
>  
> Simplify IoRead/WriteFifo implement in BaseIoLibIntrinsic by repeatedly
> calling
> IoRead/Write in C code. This can avoid calling assembly code to use
> string I/O instructions.
> With this change, Ia32/IoFifo.nasm and X64/IoFifo.nasm can be removed. Also
> source files for IA32 and X64 are the same.
> 
> Dun Tan (2):
>   MdePkg: Change IoLibFifo.c to IoLibFifoCc.c
>   MdePkg:simplify Fifo API in BaseIoLibIntrinsic
> 
>  MdePkg/Library/BaseIoLibIntrinsic/BaseIoLibIntrinsic.inf    |  10
> ++--------
>  MdePkg/Library/BaseIoLibIntrinsic/BaseIoLibIntrinsicSev.inf |   2 +-
>  MdePkg/Library/BaseIoLibIntrinsic/Ia32/IoFifo.nasm          | 131
> -----------------------------------------------------------------------------------------------------------------------------------
>  MdePkg/Library/BaseIoLibIntrinsic/IoLibFifo.c               |  59
> +++++++++++++++++++++++++++++++----------------------------
>  MdePkg/Library/BaseIoLibIntrinsic/IoLibFifoCc.c             | 217
> +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
>  MdePkg/Library/BaseIoLibIntrinsic/X64/IoFifo.nasm           | 120
> ------------------------------------------------------------------------------------------------------------------------
>  6 files changed, 251 insertions(+), 288 deletions(-)
>  delete mode 100644 MdePkg/Library/BaseIoLibIntrinsic/Ia32/IoFifo.nasm
>  create mode 100644 MdePkg/Library/BaseIoLibIntrinsic/IoLibFifoCc.c
>  delete mode 100644 MdePkg/Library/BaseIoLibIntrinsic/X64/IoFifo.nasm
> 
> -- 
> 2.31.1.windows.1
> 
> 
> 
> 
> 
> 
> 



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#111152): https://edk2.groups.io/g/devel/message/111152
Mute This Topic: https://groups.io/mt/102478994/1787277
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/leave/3901457/1787277/102458076/xyzzy [importer@patchew.org]
-=-=-=-=-=-=-=-=-=-=-=-


Re: [edk2-devel] [PATCH 0/2] Remove string IO instruction in BaseIoLibIntrinsic.inf
Posted by duntan 5 months ago
Hi Mike and Liming,

Could you help to review this patch set? It's to remove string IO instruction in BaseIoLibIntrinsic and simplify BaseIoLibIntrinsic.

Thanks,
Dun

-----Original Message-----
From: Laszlo Ersek <lersek@redhat.com> 
Sent: Monday, November 13, 2023 9:08 PM
To: devel@edk2.groups.io; Ni, Ray <ray.ni@intel.com>; Tan, Dun <dun.tan@intel.com>
Subject: Re: [edk2-devel] [PATCH 0/2] Remove string IO instruction in BaseIoLibIntrinsic.inf

On 11/9/23 06:56, Ni, Ray wrote:
> Reviewed-by: Ray Ni <ray.ni@intel.com>
> 
> Thanks for providing the alternative solution that avoids impacting 
> OVMF boot performance.

This approach looks good to me.

The IA32 and X64 OVMF platforms use "BaseIoLibIntrinsicSev.inf", and that library instance is left alone.

The RISC-V OVMF platform uses "BaseIoLibIntrinsic.inf", but RISC-V already doesn't (can't) use the IA32/X64 NASM files.

So, surprisingly, the "IoFifo.nasm" files are actually unused, pre-patch; IA32 and X64 OVMF only uses the "IoFifoSev.nasm" files.

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

Thanks!
Laszlo




> 
> Thanks,
> Ray
> ----------------------------------------------------------------------
> --
> *From:* devel@edk2.groups.io <devel@edk2.groups.io> on behalf of 
> duntan <dun.tan@intel.com>
> *Sent:* Thursday, November 9, 2023 10:49 AM
> *To:* devel@edk2.groups.io <devel@edk2.groups.io>
> *Subject:* [edk2-devel] [PATCH 0/2] Remove string IO instruction in 
> BaseIoLibIntrinsic.inf
>  
> Simplify IoRead/WriteFifo implement in BaseIoLibIntrinsic by 
> repeatedly calling IoRead/Write in C code. This can avoid calling 
> assembly code to use string I/O instructions.
> With this change, Ia32/IoFifo.nasm and X64/IoFifo.nasm can be removed. 
> Also source files for IA32 and X64 are the same.
> 
> Dun Tan (2):
>   MdePkg: Change IoLibFifo.c to IoLibFifoCc.c
>   MdePkg:simplify Fifo API in BaseIoLibIntrinsic
> 
>  MdePkg/Library/BaseIoLibIntrinsic/BaseIoLibIntrinsic.inf    |  10
> ++--------
>  MdePkg/Library/BaseIoLibIntrinsic/BaseIoLibIntrinsicSev.inf |   2 +-
>  MdePkg/Library/BaseIoLibIntrinsic/Ia32/IoFifo.nasm          | 131
> ----------------------------------------------------------------------
> -------------------------------------------------------------
>  MdePkg/Library/BaseIoLibIntrinsic/IoLibFifo.c               |  59
> +++++++++++++++++++++++++++++++----------------------------
>  MdePkg/Library/BaseIoLibIntrinsic/IoLibFifoCc.c             | 217
> +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
>  MdePkg/Library/BaseIoLibIntrinsic/X64/IoFifo.nasm           | 120
> ----------------------------------------------------------------------
> --------------------------------------------------
>  6 files changed, 251 insertions(+), 288 deletions(-)
>  delete mode 100644 MdePkg/Library/BaseIoLibIntrinsic/Ia32/IoFifo.nasm
>  create mode 100644 MdePkg/Library/BaseIoLibIntrinsic/IoLibFifoCc.c
>  delete mode 100644 MdePkg/Library/BaseIoLibIntrinsic/X64/IoFifo.nasm
> 
> --
> 2.31.1.windows.1
> 
> 
> 
> 
> 
> 
> 



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#111734): https://edk2.groups.io/g/devel/message/111734
Mute This Topic: https://groups.io/mt/102478994/1787277
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org]
-=-=-=-=-=-=-=-=-=-=-=-