public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: Andrew Fish <afish@apple.com>
To: poxyran <poxyrantab@gmail.com>
Cc: edk2-devel@lists.01.org
Subject: Re: [Question] Testing environment regarding SMM driver
Date: Fri, 21 Sep 2018 11:41:23 -0700	[thread overview]
Message-ID: <CDF8FE35-C0C9-4ED2-8EF3-F7C722DF16D1@apple.com> (raw)
In-Reply-To: <fa90d804-acb4-b5cd-983a-2704db5e0098@gmail.com>



> On Sep 21, 2018, at 11:15 AM, poxyran <poxyrantab@gmail.com> wrote:
> 
> Hello again,
> 
> my question is: is it possible to create a SMM driver that
> installs/register a SMI handler (in order to call it from a usermode app
> in the OS) and test it in the UEFI Shell

poxyran,

Does "test it in the UEFI Shell" mean load the SMM driver from the UEFI Shell? The answer to that is no. 

It should be possible to communicate with SMM code from the UEFI Shell. The difference in testing from the OS is gEfiEventExitBootServicesGuid has fired an a lot of the UEFI Boot Services have been freed when running from an OS. It is also much easier to test the ACPI flows like S3 (suspend to RAM) from an OS.

On edk2 systems that support UEFI Secure Boot the UEFI Variable Services make SMM calls, since the variable write code lives in SMM. So when you write a variable at the UEFI Shell there is an SMM call going on. See: https://github.com/tianocore/edk2/blob/UDK2018/MdeModulePkg/Universal/Variable/RuntimeDxe/VariableSmmRuntimeDxe.inf

Thanks,

Andrew Fish

> or do I need to setup up a
> dedicated machine with the SMM stack as described in official EDK II
> documentation [1]?
> 
> [1]
> 
> https://github.com/tianocore/tianocore.github.io/wiki/Testing-SMM-with-QEMU,-KVM-and-libvirt
> 
> On 9/20/2018 6:09 PM, Andrew Fish wrote:
>> 
>>> On Sep 20, 2018, at 7:30 AM, poxyran <poxyrantab@gmail.com> wrote:
>>> 
>>> Hello,
>>> 
>>> I have a specific question regarding SMM drivers. I'm trying to create a
>>> mixed driver as mentioned here
>>> http://blog.cr4.sh/2015/07/building-reliable-smm-backdoor-for-uefi.html
>>> and my first try is to create a kind of 'Hello World'. My try is to
>>> install a SMI handler and call it from a user-mode app once the OS
>>> booted up. The testing aproach mentioned in the blog post is not
>>> practical, from my pooint of view. My question is, is it possible to
>>> test this kind of drivers from the UEFI shell? or do I need to setup a
>>> dedicated machine as mentioned here
>> poxyran,
>> 
>> I'm not sure what you are asking?  Indirectly referencing a 10,000 word article is not very helpful. Feel free to ask a specific question. 
>> 
>> Thanks,
>> 
>> Andrew Fish
>> 
>>> https://github.com/tianocore/tianocore.github.io/wiki/Testing-SMM-with-QEMU,-KVM-and-libvirt?
>>> 
>>> BR,
>>> poxyran
>>> 
>>> _______________________________________________
>>> edk2-devel mailing list
>>> edk2-devel@lists.01.org
>>> https://lists.01.org/mailman/listinfo/edk2-devel
> 
> _______________________________________________
> edk2-devel mailing list
> edk2-devel@lists.01.org
> https://lists.01.org/mailman/listinfo/edk2-devel



  reply	other threads:[~2018-09-21 18:41 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-09-20 14:30 [Question] Testing environment regarding SMM driver poxyran
2018-09-20 21:09 ` Andrew Fish
2018-09-21 18:15   ` poxyran
2018-09-21 18:41     ` Andrew Fish [this message]
2018-09-21 19:05     ` Laszlo Ersek
2018-09-25 13:10       ` poxyran

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=CDF8FE35-C0C9-4ED2-8EF3-F7C722DF16D1@apple.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