From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from us-smtp-1.mimecast.com (us-smtp-1.mimecast.com [205.139.110.120]) by mx.groups.io with SMTP id smtpd.web11.42201.1578938167852787787 for ; Mon, 13 Jan 2020 09:56:08 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=EhaBFcew; spf=pass (domain: redhat.com, ip: 205.139.110.120, mailfrom: lersek@redhat.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1578938166; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=b9QEeq7ELzpShqcR3Jr3q0frmYJiutMHA1oM3vh4W9E=; b=EhaBFcewJWowAToS06QpDysthL50k46LDbrAscAbGOzjlLcvnB+OhhtDQFuVBykyb9CkZv cQcWGgtWlOivQt4/qWwtLWbg/zDD/WKzKfd/HifGwVCr+x1dsr+UeunP3oxjDlj10++MSv Lj+bBTk0EDpkgfBEYPlavoOB/rMyRQY= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-392-4VUWOyq5Mhq5tZN3AcfvyA-1; Mon, 13 Jan 2020 12:56:02 -0500 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 2B9E9477; Mon, 13 Jan 2020 17:56:01 +0000 (UTC) Received: from lacos-laptop-7.usersys.redhat.com (ovpn-116-224.ams2.redhat.com [10.36.116.224]) by smtp.corp.redhat.com (Postfix) with ESMTP id 2450F82086; Mon, 13 Jan 2020 17:55:59 +0000 (UTC) Subject: Re: [edk2-devel] [PATCH 1/1] ShellPkg: Do not connect handles without device paths To: devel@edk2.groups.io, ray.ni@intel.com, vit9696 , "Gao, Zhichao" References: <20200112213845.96853-1-vit9696@protonmail.com> <20200112213845.96853-2-vit9696@protonmail.com> <483a200323c14afb95bdb94ad447868d@intel.com> <9A165163-4BB4-434A-8C65-A84CDCB3C3C2@protonmail.com> <734D49CCEBEEF84792F5B80ED585239D5C3F2C88@SHSMSX104.ccr.corp.intel.com> From: "Laszlo Ersek" Message-ID: <0f80880e-417c-6aaf-4dfe-16158dd799c0@redhat.com> Date: Mon, 13 Jan 2020 18:55:59 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: <734D49CCEBEEF84792F5B80ED585239D5C3F2C88@SHSMSX104.ccr.corp.intel.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-MC-Unique: 4VUWOyq5Mhq5tZN3AcfvyA-1 X-Mimecast-Spam-Score: 0 Content-Language: en-US Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit On 01/13/20 12:56, Ni, Ray wrote: > We shouldn't assume that a DriverBindingStart() can only start on a handle with device path installed. DevicePath protocol is just a special protocol. > It's possible that a bus driver starts on a host controller handle and creates multiple children, each with only a Specific_IO protocol installed. > Certain device driver can start on the children handle and open the Specific_IO protocol BY_DRIVER. > I am not sure if certain today's network drivers may work like this. It's allowed per UEFI spec. I agree. Under "10.2 EFI Device Path Protocol", the spec says, "If the handle does not logically map to a physical device, the handle may not necessarily support the device path protocol." I think gBS->ConnectController() and EFI_DRIVER_BINDING_PROTOCOL.Supported() should work on such handles. If we'd like to work around related issues in drivers, then I'd suggest new command line options for the "load", "connect", "reconnect" shell commands (maybe more), for filtering out handles that do not carry device paths. Such command line options could be added as an extension, IIUC, such as "-_option". I.e., I believe it's not necessary to start with UEFI Shell Spec updates. Thanks Laszlo