From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from list by lists.gnu.org with archive (Exim 4.71) id 1bVK5G-0004WU-BV for mharc-grub-devel@gnu.org; Thu, 04 Aug 2016 10:57:18 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:56712) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bVK5D-0004Uu-LS for grub-devel@gnu.org; Thu, 04 Aug 2016 10:57:16 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bVK5B-000314-Cj for grub-devel@gnu.org; Thu, 04 Aug 2016 10:57:14 -0400 Received: from mail-wm0-x22e.google.com ([2a00:1450:400c:c09::22e]:38148) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bVK5B-00030u-3q for grub-devel@gnu.org; Thu, 04 Aug 2016 10:57:13 -0400 Received: by mail-wm0-x22e.google.com with SMTP id o80so381881231wme.1 for ; Thu, 04 Aug 2016 07:57:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=codeblueprint-co-uk.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=XkpKLdIuFUCZdokOeJZEgLMmWNCJ0HmJC29RObdTXQs=; b=nslQ6+3hFZBXOJ92dR5fpMKIDUXZ5TiYcTlbTe5PwPRq/w7gcln9eQTmDErLBJvOH7 jBYryPBp5JtrWlYMiZvJuZ80rXpfhOsxIiBd9pnuf4xEgB1GeD7u2xffcVYvxicTLoY9 +ctbWfVKoQVwq1aFlZur0BSSZd733zfvOeKO4Sl+Q690862AaNjCtPz/+ok3HdyVoOu+ Pm/S0ntxluiYKsX+HzOpvYT/q47MMpVv4VRWPlzNIKhQDvoRYlKDt7iOTlX9vxvV7tIC iriG4rBRQwUfsYuKYTlVo1XcVcpEbeugKSrUPHW4icsCo07xuJ07Umsfi+lFwGFBqs3L qtXw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=XkpKLdIuFUCZdokOeJZEgLMmWNCJ0HmJC29RObdTXQs=; b=OtB4/p3vxLQ77W9Tlm2SSlneGr7xqbqNClU/RCqDOi7r/AcWSZYSskwyFpLXPX1KTv q4B5pmPD6gNSoYzANc1qStcpTGG2npVLxp7kxx8dSoNReCynL3K8SS1y4XHToBsH5/i+ LmzOjXKEc79kSUshdeb2+5xW34RxH3t8VxBXmUOZ12LrAW8Xb3x8b+CSpJlA8QPr0FIa 5ckKKxHT4yqy0dVjxRuVyzqKOQXjEhUno1RhOcmYkHx7dXAICQhcG4LXjnCysQ95tofL 0kYZTcU9irKHv7TK2M8THgKUPW6+0EXVZWYM+WW45cq/or72nciHZKUYbqO8FarPk92l zraQ== X-Gm-Message-State: AEkoouvQIapVTi0HlM+Z0gp/GltrGfs4CChwLmxRXQPNIHRUqSv2Kjj89a37yjv8wuLZAg== X-Received: by 10.194.249.170 with SMTP id yv10mr14675786wjc.73.1470322631597; Thu, 04 Aug 2016 07:57:11 -0700 (PDT) Received: from localhost ([2a02:c7f:9225:4100:de53:60ff:fe39:5599]) by smtp.gmail.com with ESMTPSA id ka6sm13226467wjb.38.2016.08.04.07.57.10 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 04 Aug 2016 07:57:10 -0700 (PDT) Date: Thu, 4 Aug 2016 15:57:10 +0100 From: Matt Fleming To: Lukas Wunner Cc: linux-efi@vger.kernel.org, linux-kernel@vger.kernel.org, Andreas Noever , Pierre Moreau , reverser@put.as, grub-devel@gnu.org, x86@kernel.org, Aleksey Makarov , "Rafael J. Wysocki" , Mika Westerberg , Andy Shevchenko , Greg Kroah-Hartman , linux-acpi@vger.kernel.org Subject: Re: [PATCH 0/6] Apple device properties Message-ID: <20160804145710.GL3636@codeblueprint.co.uk> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.24+41 (02bc14ed1569) (2015-08-30) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2a00:1450:400c:c09::22e X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: The development of GNU GRUB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 04 Aug 2016 14:57:17 -0000 On Thu, 28 Jul, at 02:25:41AM, Lukas Wunner wrote: > Apple EFI drivers supply device properties which are needed to support > Macs optimally. > > This series extends the efistub to retrieve the device properties before > ExitBootServices is called (patch [1/6]). They are assigned to devices > in an fs_initcall (patch [5/6]). As a first use case, the Thunderbolt > driver is amended to take advantage of the Device ROM supplied by EFI > (patch [6/6]). > > A by-product is a parser for EFI Device Paths which finds the struct > device corresponding to a given path. This is needed to assign > properties to their devices (patch [3/6]). > > > I've pushed these patches to GitHub where they can be reviewed more > comfortably with green/red highlighting: > https://github.com/l1k/linux/commits/apple_properties_v1 > > > It would be good if one of the resident EFI experts could look over > patch [1/6] to see if I've made any mistakes that might prevent this > from working on 32 bit. It was only tested on 64 bit, I don't know > anyone with an older Mac who could test this. > > Specifically, is the following okay: > efi_early->call((unsigned long)sys_table->boottime->locate_protocol, ...) This probably isn't going to work with EFI mixed mode because you can't jump through pointers at runtime - that's the whole point of the setup_boot_services*bits() code. > It would be convenient to have LocateProtocol or LocateHandleBuffer in > struct efi_config so that they can be called with efi_call_early(). > Would a patch to add those be entertained? Right now we only offer > LocateHandle and HandleProtocol, which is somewhat cumbersome and > needs more code as the setup_pci() functions show. Yes, go for it. Doing this would make it work with EFI mixed mode too.