Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1191445

Re: [PATCH 31/42] x86, efi: Copy SETUP_EFI data and access directly

From Dave Young <dyoung@redhat.com>
Newsgroups linux.kernel
Subject Re: [PATCH 31/42] x86, efi: Copy SETUP_EFI data and access directly
Date 2015-07-24 04:10 +0200
Message-ID <pPAAX-8ws-33@gated-at.bofh.it> (permalink)
References <pJHF7-1PR-3@gated-at.bofh.it> <pJHFa-1PR-77@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


Hi,

On 07/07/15 at 01:20pm, Yinghai Lu wrote:
> The copy will be in __initdata, and it is small.
> 
> We can use pointer to access the setup_data instead of using early_memmap
> everywhere.

Looks good to me except one issue about missing checking memremap return value.
see the comment inline

> 
> Cc: Matt Fleming <matt.fleming@intel.com>
> Cc: linux-efi@vger.kernel.org
> Signed-off-by: Yinghai Lu <yinghai@kernel.org>
> ---

[snip]

> --- a/arch/x86/platform/efi/efi_64.c
> +++ b/arch/x86/platform/efi/efi_64.c
> @@ -295,9 +295,17 @@ void __iomem *__init efi_ioremap(unsigned long phys_addr, unsigned long size,
>  	return (void __iomem *)__va(phys_addr);
>  }
>  
> +static struct efi_setup_data efi_setup_data __initdata;
> +
>  void __init parse_efi_setup(u64 phys_addr, u32 data_len)
>  {
> -	efi_setup = phys_addr + sizeof(struct setup_data);
> +	struct efi_setup_data *data;
> +
> +	data = early_memremap(phys_addr + sizeof(struct setup_data),
> +			      sizeof(*data));

There should be a checking for return value here..

> +	efi_setup_data = *data;
> +	early_memunmap(data, sizeof(*data));
> +	efi_setup = &efi_setup_data;
>  }
>  

[snip]

Thanks
Dave
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Back to linux.kernel | Previous | Next | Find similar | Unroll thread


Thread

Re: [PATCH 31/42] x86, efi: Copy SETUP_EFI data and access directly Dave Young <dyoung@redhat.com> - 2015-07-24 04:10 +0200

csiph-web