From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753067AbcHOLyU (ORCPT ); Mon, 15 Aug 2016 07:54:20 -0400 Received: from mail-wm0-f46.google.com ([74.125.82.46]:35105 "EHLO mail-wm0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752979AbcHOLyR (ORCPT ); Mon, 15 Aug 2016 07:54:17 -0400 Date: Mon, 15 Aug 2016 12:54:14 +0100 From: Matt Fleming To: Lukas Wunner Cc: linux-efi@vger.kernel.org, linux-kernel@vger.kernel.org, Andreas Noever , x86@kernel.org, linux-acpi@vger.kernel.org Subject: Re: [PATCH 0/6] Apple device properties Message-ID: <20160815115414.GE30909@codeblueprint.co.uk> References: <20160804145710.GL3636@codeblueprint.co.uk> <20160809133816.GA6571@wunner.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20160809133816.GA6571@wunner.de> User-Agent: Mutt/1.5.24+41 (02bc14ed1569) (2015-08-30) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 09 Aug, at 03:38:16PM, Lukas Wunner wrote: > @@ -208,7 +201,10 @@ struct efi_config { > __pure const struct efi_config *__efi_early(void); > > #define efi_call_early(f, ...) \ > - __efi_early()->call(__efi_early()->f, __VA_ARGS__); > + __efi_early()->call(__efi_early()->is64 ? \ > + ((efi_boot_services_64_t *)__efi_early()->boot_services)->f : \ > + ((efi_boot_services_32_t *)__efi_early()->boot_services)->f, \ > + __VA_ARGS__); > You cannot use pointers from the firmware directly in mixed mode because the kernel is compiled for 64-bits but the firmware is using 32-bit addresses, so dereferencing a pointer causes a 64-bit load. That's the reason we deconstruct the tables and copy the addresses from the last level - so we don't have to jump through multiple pointers.