public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: Brijesh Singh <brijesh.ksingh@gmail.com>
To: Tom Lendacky <thomas.lendacky@amd.com>
Cc: jordan.l.justen@intel.com, edk2-devel@ml01.01.org,
	lersek@redhat.com,  Leo Duran <leo.duran@amd.com>,
	brijesh.singh@amd.com
Subject: Re: [RFC PATCH v1 5/5] OvmfPkg/BaseIoLibIntrinsic: Unroll String I/O when SEV is active
Date: Tue, 7 Mar 2017 12:43:25 -0600	[thread overview]
Message-ID: <CA+HCGMZ+RcieNa6MxUZnpFZ5y8oYu8QO+Gdbbjt4bUKk0SwpLg@mail.gmail.com> (raw)
In-Reply-To: <5a66f334-27e1-3b49-150e-c01209ecb2f6@amd.com>

On Tue, Mar 7, 2017 at 10:49 AM, Tom Lendacky <thomas.lendacky@amd.com>
wrote:

> On 3/6/2017 5:28 PM, Brijesh Singh wrote:
>
>> Secure Encrypted Virtualization (SEV) does not support string I/O, so
>> unroll the string I/O operation into a loop operating on one element at
>> a time.
>>
>> Contributed-under: TianoCore Contribution Agreement 1.0
>> Signed-off-by: Brijesh Singh <brijesh.singh@amd.com>
>> ---
>>  .../BaseIoLibIntrinsic/BaseIoLibIntrinsic.inf      |    3
>>  .../Library/BaseIoLibIntrinsic/Ia32/IoFifo.nasm    |   19 +++
>>  .../Library/BaseIoLibIntrinsic/Ia32/SevIoFifo.nasm |  141
>> ++++++++++++++++++++
>>  OvmfPkg/Library/BaseIoLibIntrinsic/X64/IoFifo.nasm |   19 +++
>>  .../Library/BaseIoLibIntrinsic/X64/SevIoFifo.nasm  |  143
>> ++++++++++++++++++++
>>  5 files changed, 324 insertions(+), 1 deletion(-)
>>  create mode 100644 OvmfPkg/Library/BaseIoLibIntri
>> nsic/Ia32/SevIoFifo.nasm
>>  create mode 100644 OvmfPkg/Library/BaseIoLibIntrinsic/X64/SevIoFifo.nasm
>>
>> diff --git a/OvmfPkg/Library/BaseIoLibIntrinsic/BaseIoLibIntrinsic.inf
>> b/OvmfPkg/Library/BaseIoLibIntrinsic/BaseIoLibIntrinsic.inf
>> index 8844b1c..e7eeb59 100644
>> --- a/OvmfPkg/Library/BaseIoLibIntrinsic/BaseIoLibIntrinsic.inf
>> +++ b/OvmfPkg/Library/BaseIoLibIntrinsic/BaseIoLibIntrinsic.inf
>> @@ -28,7 +28,6 @@
>>    VERSION_STRING                 = 1.0
>>    LIBRARY_CLASS                  = IoLib
>>
>> -
>>  #
>>  #  VALID_ARCHITECTURES           = IA32 X64 EBC IPF ARM AARCH64
>>  #
>> @@ -45,6 +44,7 @@
>>    IoLib.c
>>    Ia32/IoFifo.nasm
>>    Ia32/IoFifo.asm
>> +  Ia32/SevIoFifo.nasm
>>
>>  [Sources.X64]
>>    IoLibGcc.c    | GCC
>> @@ -53,6 +53,7 @@
>>    IoLib.c
>>    X64/IoFifo.nasm
>>    X64/IoFifo.asm
>> +  X64/SevIoFifo.nasm
>>
>>  [Sources.EBC]
>>    IoLibEbc.c
>> diff --git a/OvmfPkg/Library/BaseIoLibIntrinsic/Ia32/IoFifo.nasm
>> b/OvmfPkg/Library/BaseIoLibIntrinsic/Ia32/IoFifo.nasm
>> index bcaa743..fb585e6 100644
>> --- a/OvmfPkg/Library/BaseIoLibIntrinsic/Ia32/IoFifo.nasm
>> +++ b/OvmfPkg/Library/BaseIoLibIntrinsic/Ia32/IoFifo.nasm
>> @@ -13,6 +13,10 @@
>>  ;
>>  ;----------------------------------------------------------
>> --------------------
>>
>> +    EXTERN ASM_PFX(SevIoReadFifo8)
>> +    EXTERN ASM_PFX(SevIoReadFifo16)
>> +    EXTERN ASM_PFX(SevIoReadFifo32)
>> +
>>      SECTION .text
>>
>>  ;----------------------------------------------------------
>> --------------------
>> @@ -31,7 +35,12 @@ ASM_PFX(IoReadFifo8):
>>      mov     dx, [esp + 8]
>>      mov     ecx, [esp + 12]
>>      mov     edi, [esp + 16]
>> +    call    SevIoReadFifo8
>>
>
> Maybe just add a comment here (and in the other places) that if SEV
> isn't active we drop through and perform the "rep" form of the
> instruction.
>
>
Thanks, I will add comments in next rev.


      parent reply	other threads:[~2017-03-07 18:43 UTC|newest]

Thread overview: 33+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-03-06 23:27 [RFC PATCH v1 0/5] x86: Secure Encrypted Virtualization (AMD) Brijesh Singh
2017-03-06 23:27 ` [RFC PATCH v1 1/5] OvmfPkg/ResetVector: Set memory encryption when SEV is active Brijesh Singh
     [not found]   ` <3ec1cf2d-952d-97fa-108d-a6c70e613277@amd.com>
2017-03-07 16:34     ` Brijesh Singh
2017-03-07 16:35     ` Laszlo Ersek
2017-03-08 18:38   ` Jordan Justen
2017-03-08 18:42     ` Brijesh Singh
2017-03-06 23:27 ` [RFC PATCH v1 2/5] OvmfPkg/MemcryptSevLib: Add SEV helper library Brijesh Singh
2017-03-07 17:06   ` Laszlo Ersek
2017-03-07 19:14     ` Brijesh Singh
2017-03-07 22:08       ` Laszlo Ersek
2017-03-07 22:36         ` Brijesh Singh
2017-03-08  8:40           ` Laszlo Ersek
2017-03-17  2:02             ` Brijesh Singh
2017-03-17 10:29               ` Laszlo Ersek
2017-03-17 14:08                 ` Brijesh Singh
2017-03-08 14:56         ` Duran, Leo
2017-03-08 15:19           ` Laszlo Ersek
2017-03-06 23:27 ` [RFC PATCH v1 3/5] OvmfPkg/PlatformPei: Initialize SEV support Brijesh Singh
2017-03-07 17:08   ` Laszlo Ersek
2017-03-07 19:17     ` Brijesh Singh
2017-03-06 23:27 ` [RFC PATCH v1 4/5] OvmfPkg/BaseIoLibIntrinsic: import BaseIoLibIntrinsic package Brijesh Singh
2017-03-07 17:20   ` Laszlo Ersek
2017-03-07 20:06     ` Jordan Justen
2017-03-07 22:18       ` Laszlo Ersek
2017-03-08 15:41       ` Gao, Liming
2017-03-08 16:26         ` Brijesh Singh
2017-03-09  1:43           ` Gao, Liming
2017-03-08 18:58         ` Jordan Justen
2017-03-09  1:48           ` Gao, Liming
2017-03-09 15:36             ` Duran, Leo
2017-03-09 16:36               ` Laszlo Ersek
2017-03-06 23:28 ` [RFC PATCH v1 5/5] OvmfPkg/BaseIoLibIntrinsic: Unroll String I/O when SEV is active Brijesh Singh
     [not found]   ` <5a66f334-27e1-3b49-150e-c01209ecb2f6@amd.com>
2017-03-07 18:43     ` Brijesh Singh [this message]

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=CA+HCGMZ+RcieNa6MxUZnpFZ5y8oYu8QO+Gdbbjt4bUKk0SwpLg@mail.gmail.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