Received: from list by lists.gnu.org with archive (Exim 4.71) id 1ZmJx4-0002bT-KU for mharc-grub-devel@gnu.org; Wed, 14 Oct 2015 07:10:34 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:44763) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZmJva-0002NQ-7M for grub-devel@gnu.org; Wed, 14 Oct 2015 07:09:03 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZmJvT-0002RP-Iw for grub-devel@gnu.org; Wed, 14 Oct 2015 07:08:59 -0400 Received: from aserp1040.oracle.com ([141.146.126.69]:44042) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZmJvT-0002RJ-CV for grub-devel@gnu.org; Wed, 14 Oct 2015 07:08:55 -0400 Received: from userv0021.oracle.com (userv0021.oracle.com [156.151.31.71]) by aserp1040.oracle.com (Sentrion-MTA-4.3.2/Sentrion-MTA-4.3.2) with ESMTP id t9EB8rOk012832 (version=TLSv1 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Wed, 14 Oct 2015 11:08:53 GMT Received: from userv0122.oracle.com (userv0122.oracle.com [156.151.31.75]) by userv0021.oracle.com (8.13.8/8.13.8) with ESMTP id t9EB8qw8020681 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=FAIL); Wed, 14 Oct 2015 11:08:52 GMT Received: from abhmp0015.oracle.com (abhmp0015.oracle.com [141.146.116.21]) by userv0122.oracle.com (8.13.8/8.13.8) with ESMTP id t9EB8qnI009483; Wed, 14 Oct 2015 11:08:52 GMT Received: from olila.local.net-space.pl (/10.175.195.2) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Wed, 14 Oct 2015 04:08:51 -0700 Date: Wed, 14 Oct 2015 13:08:47 +0200 From: Daniel Kiper To: "Ye, Ting" Subject: Re: [edk2] [grub PATCH] efinet: disable MNP background polling Message-ID: <20151014110847.GQ6226@olila.local.net-space.pl> References: <20151001.182655.371384337.d.hatayama@jp.fujitsu.com> <560D1E07.3090902@redhat.com> <20151013214919.GA6140@router-fw-old.local.net-space.pl> <561D83E9.6050703@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) X-Source-IP: userv0021.oracle.com [156.151.31.71] X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.4.x-2.6.x [generic] X-Received-From: 141.146.126.69 Cc: "grub-devel@gnu.org" , "arvidjaar@gmail.com" , edk2-devel-01 , "glin@suse.com" , "seth.goldberg@oracle.com" , Mark Salter , Laszlo Ersek X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list Reply-To: The development of GNU GRUB List-Id: The development of GNU GRUB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 Oct 2015 11:09:03 -0000 On Wed, Oct 14, 2015 at 05:19:32AM +0000, Ye, Ting wrote: > Hi all, > > If I understand the issue correctly, I don't quite agree that UEFI > spec is imprecise about SNP constraints described as following. > The "constraint" described here is that the grub should use attribute > "EXCLUSIVE" to open SNP protocol to gain exclusive access. This usage > is clearly described in page 184, chapter 6.3 EFI_BOOT_SERVICES.OpenProtocol(). > > EXCLUSIVE Used by applications to gain exclusive access to a protocol interface. > If any drivers have the protocol interface opened with an attribute of BY_DRIVER, > then an attempt will be made to remove them by calling the driver's Stop() function. > > The grub code should not assume that the SNP is not occupied by other > drivers, instead, it should use EXCLUSIVE to open SNP protocol, or to > be more precise, use OpenProtocolInformation() to check whether SNP is > already opened by other driver, then decide whether need to use EXCLUSIVE > to disconnect the other drivers. This is the typical usage for all UEFI > protocol, not particular constraints to SNP protocol. Looks good! Great! However, it looks that we still have a problem if somebody opens SNP in EXCLUSIVE mode. Then GRUB2 SNP open will fail according to UEFI spec. Sadly we do not have a control on other stuff and one day our approach may fail because somebody decided to open SNP in EXCLUSIVE mode in e.g. a driver. Does it mean that migration to MNP is one sensible solution for our problems? As I know this is huge overhaul, so, we should think twice before choosing that way. Daniel