Re: [PATCH 7/8] efi/capsule-loader: use page addresses rather than struct page pointers

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 18 April 2017 at 13:56, Matt Fleming <matt@xxxxxxxxxxxxxxxxxxx> wrote:
> On Wed, 05 Apr, at 10:23:16AM, Ard Biesheuvel wrote:
>> To give some leeway to code that handles non-standard capsule headers,
>> let's keep an array of page addresses rather than struct page pointers.
>>
>> This gives special implementations of efi_capsule_setup_info() the
>> opportunity to mangle the payload a bit before it is presented to the
>> firmware, without putting any knowledge of the nature of such quirks
>> into the generic code.
>>
>> Signed-off-by: Ard Biesheuvel <ard.biesheuvel@xxxxxxxxxx>
>> ---
>>  drivers/firmware/efi/capsule-loader.c | 12 ++++++++----
>>  drivers/firmware/efi/capsule.c        |  7 ++++---
>>  include/linux/efi.h                   |  4 ++--
>>  3 files changed, 14 insertions(+), 9 deletions(-)
>>
>> diff --git a/drivers/firmware/efi/capsule-loader.c b/drivers/firmware/efi/capsule-loader.c
>> index d68a1ecebbf3..22b2bb73176c 100644
>> --- a/drivers/firmware/efi/capsule-loader.c
>> +++ b/drivers/firmware/efi/capsule-loader.c
>> @@ -20,6 +20,10 @@
>>
>>  #define NO_FURTHER_WRITE_ACTION -1
>>
>> +#ifndef phys_to_page
>> +#define phys_to_page(x)              virt_to_page((unsigned long)__va(x))
>> +#endif
>
> Is this going to work with highmem pages, which presumably, is a
> possibility for the 32-bit Quark?

Good point. Given that we don't really care about the virtual address
anyway, what is the best way to translate physical addresses to struct
page pointers on x86? i suppose pfn_to_page(pa >> PAGE_SHIFT) always
does the trick?
--
To unsubscribe from this list: send the line "unsubscribe linux-efi" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux