From mboxrd@z Thu Jan 1 00:00:00 1970 From: Lukas Wunner Subject: Re: [PATCH 0/6] Apple device properties Date: Mon, 22 Aug 2016 11:58:50 +0200 Message-ID: <20160822095850.GA22131@wunner.de> References: <20160804145710.GL3636@codeblueprint.co.uk> <20160809133816.GA6571@wunner.de> <20160815115414.GE30909@codeblueprint.co.uk> <20160815161358.GA9603@wunner.de> <20160818203433.GP30909@codeblueprint.co.uk> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Content-Disposition: inline In-Reply-To: <20160818203433.GP30909-mF/unelCI9GS6iBeEJttW/XRex20P6io@public.gmane.org> Sender: linux-efi-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org To: Matt Fleming Cc: linux-efi-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, Andreas Noever , x86-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org List-Id: linux-efi@vger.kernel.org On Thu, Aug 18, 2016 at 09:34:33PM +0100, Matt Fleming wrote: > On Mon, 15 Aug, at 06:13:58PM, Lukas Wunner wrote: > > But I would like to understand the "cannot jump through pointers at > > runtime" argument because the binary code looks to me like it should > > work on 32 bit. I guess I must be missing something obvious? > > Ah no, I forgot that efi_boot_services_{32,64}_t doesn't contain > pointers - it contains u32/u64 objects. So yeah, your patch looks > fine. > > It does trigger the following warnings when building for i386 though, > > In file included from /dev/shm/mfleming/git/efi/drivers/firmware/efi/libstub/efi-stub-helper.c:14:0: > /dev/shm/mfleming/git/efi/drivers/firmware/efi/libstub/efi-stub-helper.c: In function ???efi_get_memory_map???: > /dev/shm/mfleming/git/efi/arch/x86/include/asm/efi.h:205:3: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast] > ((efi_boot_services_64_t *)__efi_early()->boot_services)->f : \ > ^ Right, sorry, I didn't compile-test that version on x86_32. I'm sending out a new version now which compiles cleanly in all three cases (x86_32, x86_64 with and without mixed-mode), works fine on my 64-bit EFI and the 32-bit code at least *looks* okay when disassembled. By the way, arch/x86/Kconfig says that "it is not possible to boot a mixed-mode enabled kernel via the EFI boot stub - a bootloader that supports the EFI handover protocol must be used". Is this still correct? With all the mixed-mode support in head_64.S and eboot.c, I'm wondering what's missing? Thanks, Lukas From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752700AbcHVJ57 (ORCPT ); Mon, 22 Aug 2016 05:57:59 -0400 Received: from mailout3.hostsharing.net ([176.9.242.54]:54023 "EHLO mailout3.hostsharing.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751294AbcHVJ55 (ORCPT ); Mon, 22 Aug 2016 05:57:57 -0400 Date: Mon, 22 Aug 2016 11:58:50 +0200 From: Lukas Wunner To: Matt Fleming Cc: linux-efi@vger.kernel.org, linux-kernel@vger.kernel.org, Andreas Noever , x86@kernel.org Subject: Re: [PATCH 0/6] Apple device properties Message-ID: <20160822095850.GA22131@wunner.de> References: <20160804145710.GL3636@codeblueprint.co.uk> <20160809133816.GA6571@wunner.de> <20160815115414.GE30909@codeblueprint.co.uk> <20160815161358.GA9603@wunner.de> <20160818203433.GP30909@codeblueprint.co.uk> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20160818203433.GP30909@codeblueprint.co.uk> User-Agent: Mutt/1.6.1 (2016-04-27) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Aug 18, 2016 at 09:34:33PM +0100, Matt Fleming wrote: > On Mon, 15 Aug, at 06:13:58PM, Lukas Wunner wrote: > > But I would like to understand the "cannot jump through pointers at > > runtime" argument because the binary code looks to me like it should > > work on 32 bit. I guess I must be missing something obvious? > > Ah no, I forgot that efi_boot_services_{32,64}_t doesn't contain > pointers - it contains u32/u64 objects. So yeah, your patch looks > fine. > > It does trigger the following warnings when building for i386 though, > > In file included from /dev/shm/mfleming/git/efi/drivers/firmware/efi/libstub/efi-stub-helper.c:14:0: > /dev/shm/mfleming/git/efi/drivers/firmware/efi/libstub/efi-stub-helper.c: In function ???efi_get_memory_map???: > /dev/shm/mfleming/git/efi/arch/x86/include/asm/efi.h:205:3: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast] > ((efi_boot_services_64_t *)__efi_early()->boot_services)->f : \ > ^ Right, sorry, I didn't compile-test that version on x86_32. I'm sending out a new version now which compiles cleanly in all three cases (x86_32, x86_64 with and without mixed-mode), works fine on my 64-bit EFI and the 32-bit code at least *looks* okay when disassembled. By the way, arch/x86/Kconfig says that "it is not possible to boot a mixed-mode enabled kernel via the EFI boot stub - a bootloader that supports the EFI handover protocol must be used". Is this still correct? With all the mixed-mode support in head_64.S and eboot.c, I'm wondering what's missing? Thanks, Lukas