Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S935460AbcKWKfQ (ORCPT ); Wed, 23 Nov 2016 05:35:16 -0500 Received: from mail-io0-f176.google.com ([209.85.223.176]:33180 "EHLO mail-io0-f176.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S935357AbcKWKfC (ORCPT ); Wed, 23 Nov 2016 05:35:02 -0500 MIME-Version: 1.0 In-Reply-To: <5320.1479893643@warthog.procyon.org.uk> References: <147986054870.13790.8640536414645705863.stgit@warthog.procyon.org.uk> <147986056324.13790.12670822944798392730.stgit@warthog.procyon.org.uk> <5320.1479893643@warthog.procyon.org.uk> From: Ard Biesheuvel Date: Wed, 23 Nov 2016 10:35:01 +0000 Message-ID: Subject: Re: [PATCH 2/6] arm/efi: Allow invocation of arbitrary runtime services [ver #2] To: David Howells Cc: Lukas Wunner , "linux-efi@vger.kernel.org" , linux-security-module , keyrings@vger.kernel.org, "linux-kernel@vger.kernel.org" Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 872 Lines: 20 On 23 November 2016 at 09:34, David Howells wrote: > David Howells wrote: > >> +#define efi_call_runtime(f, ...) sys_table_arg->runtime->f(__VA_ARGS__) > > Turns out it's not that simple - of course. runtime->get_variable is just a > void pointer. The old arm stub was casting it by virtue of assignment to a > function pointer variable. > > The x86_64 appears to be doing bypassing all the compile-time type checking by > passing the arguments through an ellipsis and then fixing up the argument list > in the ->call() function. > > What I've changed the ARM and ARM64 things to is: > > #define efi_call_runtime(f, ...) ((efi_##f##_t *)sys_table_arg->runtime->f)(__VA_ARGS__) > Could we please instead fix the definition of efi_runtime_services_t, given that we have typedefs already for all its members?