From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=17.151.62.68; helo=nwk-aaemail-lapp03.apple.com; envelope-from=afish@apple.com; receiver=edk2-devel@lists.01.org Received: from nwk-aaemail-lapp03.apple.com (nwk-aaemail-lapp03.apple.com [17.151.62.68]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 7A04421130703 for ; Fri, 21 Sep 2018 11:41:43 -0700 (PDT) Received: from pps.filterd (nwk-aaemail-lapp03.apple.com [127.0.0.1]) by nwk-aaemail-lapp03.apple.com (8.16.0.22/8.16.0.22) with SMTP id w8LIaLhD020285; Fri, 21 Sep 2018 11:41:42 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=apple.com; h=mime-version : content-transfer-encoding : content-type : sender : subject : from : in-reply-to : date : cc : message-id : references : to; s=20180706; bh=FA9zpO8vHH+1tE46gHyhVeAXUC+L1b1RRdA54pChjkY=; b=IHq6TUm1aeAPS5CVWpITjnkiHHyNWfhKBLKRmuQDkr4xv+gS+NL/FMfmhIB6JQQgSgAH CSKD1H+dFXmpa2y47Ap88fMoERwcvVsUN/lAjItszTleFsCPfUl7z2TrBPcM9snUY1// N/kZXgjJxoUwuULbGcjOuKJ1dt3D5kcitPI3PQZ6I84rLvoRmLcWT0pv5THD1Mz/0gPW CMJWKHnVrqqVExFBaz/ya57bYVwmNAgvs63DlYSWP81lhW3yglMyBXw1AOkr+15vsKav GmMPyYUFfD46tjUj+a7Uf6B43z5Us9QoZI/uMVSjsPGU8BRB41ZonljwLhW6BPNftKqm KQ== Received: from ma1-mtap-s01.corp.apple.com (ma1-mtap-s01.corp.apple.com [17.40.76.5]) by nwk-aaemail-lapp03.apple.com with ESMTP id 2mmkmd0fsk-3 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NO); Fri, 21 Sep 2018 11:41:42 -0700 MIME-version: 1.0 Received: from ma1-mmpp-sz09.apple.com (ma1-mmpp-sz09.apple.com [17.171.128.183]) by ma1-mtap-s01.corp.apple.com (Oracle Communications Messaging Server 8.0.2.3.20180614 64bit (built Jun 14 2018)) with ESMTPS id <0PFF0060C59IX8H0@ma1-mtap-s01.corp.apple.com>; Fri, 21 Sep 2018 11:41:42 -0700 (PDT) Received: from process_viserion-daemon.ma1-mmpp-sz09.apple.com by ma1-mmpp-sz09.apple.com (Oracle Communications Messaging Server 8.0.2.3.20180614 64bit (built Jun 14 2018)) id <0PFF00B004YGGX00@ma1-mmpp-sz09.apple.com>; Fri, 21 Sep 2018 11:41:42 -0700 (PDT) X-Va-A: X-Va-T-CD: 5cd1a828138b67c7bd0a3a7f04e50fb8 X-Va-E-CD: bdbe391e5843ef66f9a947730a9a0e4b X-Va-R-CD: 2d23e95dd4b02f0ab5c3e28c91859195 X-Va-CD: 0 X-Va-ID: ac527154-b81d-432b-8531-5a562e1215a1 X-V-A: X-V-T-CD: c0790f8abce7a670f0ced751abd18b42 X-V-E-CD: bdbe391e5843ef66f9a947730a9a0e4b X-V-R-CD: 2d23e95dd4b02f0ab5c3e28c91859195 X-V-CD: 0 X-V-ID: b26598c0-d1db-418a-835e-bfde2a2626a8 Received: from process_milters-daemon.ma1-mmpp-sz09.apple.com by ma1-mmpp-sz09.apple.com (Oracle Communications Messaging Server 8.0.2.3.20180614 64bit (built Jun 14 2018)) id <0PFF00B004YFGT00@ma1-mmpp-sz09.apple.com>; Fri, 21 Sep 2018 11:41:42 -0700 (PDT) X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:,, definitions=2018-09-21_07:,, signatures=0 X-Proofpoint-Scanner-Instance: ma-grpmailp-qapp22.corp.apple.com-10000_instance1 Received: from [17.234.198.76] (unknown [17.234.198.76]) by ma1-mmpp-sz09.apple.com (Oracle Communications Messaging Server 8.0.2.3.20180614 64bit (built Jun 14 2018)) with ESMTPSA id <0PFF00GFC59FD220@ma1-mmpp-sz09.apple.com>; Fri, 21 Sep 2018 11:41:42 -0700 (PDT) Sender: afish@apple.com From: Andrew Fish In-reply-to: Date: Fri, 21 Sep 2018 11:41:23 -0700 Cc: edk2-devel@lists.01.org Message-id: References: <69e85ce8-a6bd-1400-5e16-aadd1551b877@gmail.com> To: poxyran X-Mailer: Apple Mail (2.3445.6.18) X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:, , definitions=2018-09-21_07:, , signatures=0 Subject: Re: [Question] Testing environment regarding SMM driver X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 21 Sep 2018 18:41:43 -0000 Content-transfer-encoding: 7BIT Content-type: text/plain; CHARSET=US-ASCII > On Sep 21, 2018, at 11:15 AM, poxyran 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 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