[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20160512064606.GA30717@gmail.com>
Date: Thu, 12 May 2016 08:46:06 +0200
From: Ingo Molnar <mingo@...nel.org>
To: Alex Thorlton <athorlton@....com>
Cc: linux-kernel@...r.kernel.org, Dimitri Sivanich <sivanich@....com>,
Russ Anderson <rja@....com>, Mike Travis <travis@....com>,
Matt Fleming <matt@...eblueprint.co.uk>,
Borislav Petkov <bp@...e.de>,
Thomas Gleixner <tglx@...utronix.de>,
Ingo Molnar <mingo@...hat.com>,
"H. Peter Anvin" <hpa@...or.com>, x86@...nel.org,
linux-efi@...r.kernel.org
Subject: Re: [PATCH 1/2] Create UV efi_call macros
* Alex Thorlton <athorlton@....com> wrote:
> +#define efi_call_virt(f, args...) \
> +({ \
> + efi_status_t __s; \
> + unsigned long flags; \
> + arch_efi_call_virt_setup(); \
> + local_save_flags(flags); \
> + __s = arch_efi_call_virt(f, args); \
> + efi_call_virt_check_flags(flags, __stringify(f)); \
> + arch_efi_call_virt_teardown(); \
> + __s; \
> +})
> +
> +#define __efi_call_virt(f, args...) \
> +({ \
> + unsigned long flags; \
> + arch_efi_call_virt_setup(); \
> + local_save_flags(flags); \
> + arch_efi_call_virt(f, args); \
> + efi_call_virt_check_flags(flags, __stringify(f)); \
> + arch_efi_call_virt_teardown(); \
> +})
> +
> +#define uv_call_virt(f, args...) \
> +({ \
> + efi_status_t __s; \
> + unsigned long flags; \
> + arch_efi_call_virt_setup(); \
> + local_save_flags(flags); \
> + __s = uv_efi_call_virt(f, args); \
> + efi_call_virt_check_flags(flags, __stringify(f)); \
> + arch_efi_call_virt_teardown(); \
> + __s; \
> +})
Btw., a very (very!) small stylistic nit that caught my eyes, and I realize that
you just moved code, but could you please improve these macros a bit and make it
look like regular kernel code? I.e. something like:
#define efi_call_virt(f, args...) \
({ \
efi_status_t __s; \
unsigned long flags; \
\
arch_efi_call_virt_setup(); \
\
local_save_flags(flags); \
__s = arch_efi_call_virt(f, args); \
efi_call_virt_check_flags(flags, __stringify(f)); \
arch_efi_call_virt_teardown(); \
\
__s; \
})
This delineates the various blocks of code: variables, setup, the saving/calling
block plus the return code.
(Assuming the EFI folks like the whole approach.)
Thanks,
Ingo
Powered by blists - more mailing lists