Pull EFI updates from Ard Biesheuvel: - support taking the measurement of the initrd when loaded via the LoadFile2 protocol - kobject API cleanup from Greg - some header file whitespace fixes * tag 'efi-next-for-v5.17' of git://git.kernel.org/pub/scm/linux/kernel/git/efi/efi: efi: use default_groups in kobj_type efi/libstub: measure loaded initrd info into the TPM efi/libstub: consolidate initrd handling across architectures efi/libstub: x86/mixed: increase supported argument count efi/libstub: add prototype of efi_tcg2_protocol::hash_log_extend_event() include/linux/efi.h: Remove unneeded whitespaces before tabs
Unified · Split
| @@ -26,8 +26,6 @@ SYM_FUNC_START(__efi64_thunk) · 25 unmodified lines | |||
| 26 | push %rbp | 26 | push %rbp |
| 27 | push %rbx | 27 | push %rbx |
| 28 | 28 | ||
| 29 | leaq 1f(%rip), %rbp | ||
| 30 | |||
| 31 | movl %ds, %eax | 29 | movl %ds, %eax |
| 32 | push %rax | 30 | push %rax |
| 33 | movl %es, %eax | 31 | movl %es, %eax |
| @@ -35,6 +33,11 @@ SYM_FUNC_START(__efi64_thunk) · 1 unmodified line | |||
| 35 | movl %ss, %eax | 33 | movl %ss, %eax |
| 36 | push %rax | 34 | push %rax |
| 37 | 35 | ||
| 36 | /* Copy args passed on stack */ | ||
| 37 | movq 0x30(%rsp), %rbp | ||
| 38 | movq 0x38(%rsp), %rbx | ||
| 39 | movq 0x40(%rsp), %rax | ||
| 40 | |||
| 38 | /* | 41 | /* |
| 39 | * Convert x86-64 ABI params to i386 ABI | 42 | * Convert x86-64 ABI params to i386 ABI |
| 40 | */ | 43 | */ |
| @@ -44,13 +47,18 @@ SYM_FUNC_START(__efi64_thunk) · 3 unmodified lines | |||
| 44 | movl %ecx, 0x8(%rsp) | 47 | movl %ecx, 0x8(%rsp) |
| 45 | movl %r8d, 0xc(%rsp) | 48 | movl %r8d, 0xc(%rsp) |
| 46 | movl %r9d, 0x10(%rsp) | 49 | movl %r9d, 0x10(%rsp) |
| 50 | movl %ebp, 0x14(%rsp) | ||
| 51 | movl %ebx, 0x18(%rsp) | ||
| 52 | movl %eax, 0x1c(%rsp) | ||
| 47 | 53 | ||
| 48 | leaq 0x14(%rsp), %rbx | 54 | leaq 0x20(%rsp), %rbx |
| 49 | sgdt (%rbx) | 55 | sgdt (%rbx) |
| 50 | 56 | ||
| 51 | addq $16, %rbx | 57 | addq $16, %rbx |
| 52 | sidt (%rbx) | 58 | sidt (%rbx) |
| 53 | 59 | ||
| 60 | leaq 1f(%rip), %rbp | ||
| 61 | |||
| 54 | /* | 62 | /* |
| 55 | * Switch to IDT and GDT with 32-bit segments. This is the firmware GDT | 63 | * Switch to IDT and GDT with 32-bit segments. This is the firmware GDT |
| 56 | * and IDT that was installed when the kernel started executing. The | 64 | * and IDT that was installed when the kernel started executing. The |
| @@ -46,13 +46,14 @@ extern unsigned long efi_mixed_mode_stack_pa; · 45 unmodified lines | |||
| 46 | 46 | ||
| 47 | #define __efi_nargs(...) __efi_nargs_(__VA_ARGS__) | 47 | #define __efi_nargs(...) __efi_nargs_(__VA_ARGS__) |
| 48 | #define __efi_nargs_(...) __efi_nargs__(0, ##__VA_ARGS__, \ | 48 | #define __efi_nargs_(...) __efi_nargs__(0, ##__VA_ARGS__, \ |
| 49 | __efi_arg_sentinel(9), __efi_arg_sentinel(8), \ | ||
| 49 | __efi_arg_sentinel(7), __efi_arg_sentinel(6), \ | 50 | __efi_arg_sentinel(7), __efi_arg_sentinel(6), \ |
| 50 | __efi_arg_sentinel(5), __efi_arg_sentinel(4), \ | 51 | __efi_arg_sentinel(5), __efi_arg_sentinel(4), \ |
| 51 | __efi_arg_sentinel(3), __efi_arg_sentinel(2), \ | 52 | __efi_arg_sentinel(3), __efi_arg_sentinel(2), \ |
| 52 | __efi_arg_sentinel(1), __efi_arg_sentinel(0)) | 53 | __efi_arg_sentinel(1), __efi_arg_sentinel(0)) |
| 53 | #define __efi_nargs__(_0, _1, _2, _3, _4, _5, _6, _7, n, ...) \ | 54 | #define __efi_nargs__(_0, _1, _2, _3, _4, _5, _6, _7, _8, _9, n, ...) \ |
| 54 | __take_second_arg(n, \ | 55 | __take_second_arg(n, \ |
| 55 | ({ BUILD_BUG_ON_MSG(1, "__efi_nargs limit exceeded"); 8; })) | 56 | ({ BUILD_BUG_ON_MSG(1, "__efi_nargs limit exceeded"); 10; })) |
| 56 | #define __efi_arg_sentinel(n) , n | 57 | #define __efi_arg_sentinel(n) , n |
| 57 | 58 | ||
| 58 | /* | 59 | /* |
| @@ -176,8 +177,9 @@ extern u64 efi_setup; · 117 unmodified lines | |||
| 176 | extern efi_status_t __efi64_thunk(u32, ...); | 177 | extern efi_status_t __efi64_thunk(u32, ...); |
| 177 | 178 | ||
| 178 | #define efi64_thunk(...) ({ \ | 179 | #define efi64_thunk(...) ({ \ |
| 179 | __efi_nargs_check(efi64_thunk, 6, __VA_ARGS__); \ | 180 | u64 __pad[3]; /* must have space for 3 args on the stack */ \ |
| 180 | __efi64_thunk(__VA_ARGS__); \ | 181 | __efi_nargs_check(efi64_thunk, 9, __VA_ARGS__); \ |
| 182 | __efi64_thunk(__VA_ARGS__, __pad); \ | ||
| 181 | }) | 183 | }) |
| 182 | 184 | ||
| 183 | static inline bool efi_is_mixed(void) | 185 | static inline bool efi_is_mixed(void) |
| @@ -306,6 +308,10 @@ static inline u32 efi64_convert_status(efi_status_t status) · 122 unmodified lines | |||
| 306 | #define __efi64_argmap_query_mode(gop, mode, size, info) \ | 308 | #define __efi64_argmap_query_mode(gop, mode, size, info) \ |
| 307 | ((gop), (mode), efi64_zero_upper(size), efi64_zero_upper(info)) | 309 | ((gop), (mode), efi64_zero_upper(size), efi64_zero_upper(info)) |
| 308 | 310 | ||
| 311 | /* TCG2 protocol */ | ||
| 312 | #define __efi64_argmap_hash_log_extend_event(prot, fl, addr, size, ev) \ | ||
| 313 | ((prot), (fl), 0ULL, (u64)(addr), 0ULL, (u64)(size), 0ULL, ev) | ||
| 314 | |||
| 309 | /* | 315 | /* |
| 310 | * The macros below handle the plumbing for the argument mapping. To add a | 316 | * The macros below handle the plumbing for the argument mapping. To add a |
| 311 | * mapping for a specific EFI method, simply define a macro | 317 | * mapping for a specific EFI method, simply define a macro |
| @@ -36,6 +36,17 @@ SYM_CODE_START(__efi64_thunk) · 35 unmodified lines | |||
| 36 | movq efi_mixed_mode_stack_pa(%rip), %rsp | 36 | movq efi_mixed_mode_stack_pa(%rip), %rsp |
| 37 | push %rax | 37 | push %rax |
| 38 | 38 | ||
| 39 | /* | ||
| 40 | * Copy args passed via the stack | ||
| 41 | */ | ||
| 42 | subq $0x24, %rsp | ||
| 43 | movq 0x18(%rax), %rbp | ||
| 44 | movq 0x20(%rax), %rbx | ||
| 45 | movq 0x28(%rax), %rax | ||
| 46 | movl %ebp, 0x18(%rsp) | ||
| 47 | movl %ebx, 0x1c(%rsp) | ||
| 48 | movl %eax, 0x20(%rsp) | ||
| 49 | |||
| 39 | /* | 50 | /* |
| 40 | * Calculate the physical address of the kernel text. | 51 | * Calculate the physical address of the kernel text. |
| 41 | */ | 52 | */ |
| @@ -47,7 +58,6 @@ SYM_CODE_START(__efi64_thunk) · 5 unmodified lines | |||
| 47 | subq %rax, %rbp | 58 | subq %rax, %rbp |
| 48 | subq %rax, %rbx | 59 | subq %rax, %rbx |
| 49 | 60 | ||
| 50 | subq $28, %rsp | ||
| 51 | movl %ebx, 0x0(%rsp) /* return address */ | 61 | movl %ebx, 0x0(%rsp) /* return address */ |
| 52 | movl %esi, 0x4(%rsp) | 62 | movl %esi, 0x4(%rsp) |
| 53 | movl %edx, 0x8(%rsp) | 63 | movl %edx, 0x8(%rsp) |
| @@ -60,7 +70,7 @@ SYM_CODE_START(__efi64_thunk) · 6 unmodified lines | |||
| 60 | pushq %rdi /* EFI runtime service address */ | 70 | pushq %rdi /* EFI runtime service address */ |
| 61 | lretq | 71 | lretq |
| 62 | 72 | ||
| 63 | 1: movq 24(%rsp), %rsp | 73 | 1: movq 0x20(%rsp), %rsp |
| 64 | pop %rbx | 74 | pop %rbx |
| 65 | pop %rbp | 75 | pop %rbp |
| 66 | retq | 76 | retq |
| @@ -352,11 +352,12 @@ static struct attribute *def_attrs[] = { · 351 unmodified lines | |||
| 352 | &efivar_attr_raw_var.attr, | 352 | &efivar_attr_raw_var.attr, |
| 353 | NULL, | 353 | NULL, |
| 354 | }; | 354 | }; |
| 355 | ATTRIBUTE_GROUPS(def); | ||
| 355 | 356 | ||
| 356 | static struct kobj_type efivar_ktype = { | 357 | static struct kobj_type efivar_ktype = { |
| 357 | .release = efivar_release, | 358 | .release = efivar_release, |
| 358 | .sysfs_ops = &efivar_attr_ops, | 359 | .sysfs_ops = &efivar_attr_ops, |
| 359 | .default_attrs = def_attrs, | 360 | .default_groups = def_groups, |
| 360 | }; | 361 | }; |
| 361 | 362 | ||
| 362 | static ssize_t efivar_create(struct file *filp, struct kobject *kobj, | 363 | static ssize_t efivar_create(struct file *filp, struct kobject *kobj, |
| @@ -146,6 +146,8 @@ static struct attribute *esre1_attrs[] = { · 145 unmodified lines | |||
| 146 | &esre_last_attempt_status.attr, | 146 | &esre_last_attempt_status.attr, |
| 147 | NULL | 147 | NULL |
| 148 | }; | 148 | }; |
| 149 | ATTRIBUTE_GROUPS(esre1); | ||
| 150 | |||
| 149 | static void esre_release(struct kobject *kobj) | 151 | static void esre_release(struct kobject *kobj) |
| 150 | { | 152 | { |
| 151 | struct esre_entry *entry = to_entry(kobj); | 153 | struct esre_entry *entry = to_entry(kobj); |
| @@ -157,7 +159,7 @@ static void esre_release(struct kobject *kobj) · 5 unmodified lines | |||
| 157 | static struct kobj_type esre1_ktype = { | 159 | static struct kobj_type esre1_ktype = { |
| 158 | .release = esre_release, | 160 | .release = esre_release, |
| 159 | .sysfs_ops = &esre_attr_ops, | 161 | .sysfs_ops = &esre_attr_ops, |
| 160 | .default_attrs = esre1_attrs, | 162 | .default_groups = esre1_groups, |
| 161 | }; | 163 | }; |
| 162 | 164 | ||
| 163 | 165 | ||
| @@ -20,10 +20,10 @@ · 19 unmodified lines | |||
| 20 | 20 | ||
| 21 | bool efi_nochunk; | 21 | bool efi_nochunk; |
| 22 | bool efi_nokaslr = !IS_ENABLED(CONFIG_RANDOMIZE_BASE); | 22 | bool efi_nokaslr = !IS_ENABLED(CONFIG_RANDOMIZE_BASE); |
| 23 | bool efi_noinitrd; | ||
| 24 | int efi_loglevel = CONSOLE_LOGLEVEL_DEFAULT; | 23 | int efi_loglevel = CONSOLE_LOGLEVEL_DEFAULT; |
| 25 | bool efi_novamap; | 24 | bool efi_novamap; |
| 26 | 25 | ||
| 26 | static bool efi_noinitrd; | ||
| 27 | static bool efi_nosoftreserve; | 27 | static bool efi_nosoftreserve; |
| 28 | static bool efi_disable_pci_dma = IS_ENABLED(CONFIG_EFI_DISABLE_PCI_DMA); | 28 | static bool efi_disable_pci_dma = IS_ENABLED(CONFIG_EFI_DISABLE_PCI_DMA); |
| 29 | 29 | ||
| @@ -625,6 +625,47 @@ efi_status_t efi_load_initrd_cmdline(efi_loaded_image_t *image, · 595 unmodified lines | |||
| 625 | load_addr, load_size); | 625 | load_addr, load_size); |
| 626 | } | 626 | } |
| 627 | 627 | ||
| 628 | static const struct { | ||
| 629 | efi_tcg2_event_t event_data; | ||
| 630 | efi_tcg2_tagged_event_t tagged_event; | ||
| 631 | u8 tagged_event_data[]; | ||
| 632 | } initrd_tcg2_event = { | ||
| 633 | { | ||
| 634 | sizeof(initrd_tcg2_event) + sizeof("Linux initrd"), | ||
| 635 | { | ||
| 636 | sizeof(initrd_tcg2_event.event_data.event_header), | ||
| 637 | EFI_TCG2_EVENT_HEADER_VERSION, | ||
| 638 | 9, | ||
| 639 | EV_EVENT_TAG, | ||
| 640 | }, | ||
| 641 | }, | ||
| 642 | { | ||
| 643 | INITRD_EVENT_TAG_ID, | ||
| 644 | sizeof("Linux initrd"), | ||
| 645 | }, | ||
| 646 | { "Linux initrd" }, | ||
| 647 | }; | ||
| 648 | |||
| 649 | static void efi_measure_initrd(unsigned long load_addr, unsigned long load_size) | ||
| 650 | { | ||
| 651 | efi_guid_t tcg2_guid = EFI_TCG2_PROTOCOL_GUID; | ||
| 652 | efi_tcg2_protocol_t *tcg2 = NULL; | ||
| 653 | efi_status_t status; | ||
| 654 | |||
| 655 | efi_bs_call(locate_protocol, &tcg2_guid, NULL, (void **)&tcg2); | ||
| 656 | if (tcg2) { | ||
| 657 | status = efi_call_proto(tcg2, hash_log_extend_event, | ||
| 658 | 0, load_addr, load_size, | ||
| 659 | &initrd_tcg2_event.event_data); | ||
| 660 | if (status != EFI_SUCCESS) | ||
| 661 | efi_warn("Failed to measure initrd data: 0x%lx\n", | ||
| 662 | status); | ||
| 663 | else | ||
| 664 | efi_info("Measured initrd data into PCR %d\n", | ||
| 665 | initrd_tcg2_event.event_data.event_header.pcr_index); | ||
| 666 | } | ||
| 667 | } | ||
| 668 | |||
| 628 | /** | 669 | /** |
| 629 | * efi_load_initrd() - Load initial RAM disk | 670 | * efi_load_initrd() - Load initial RAM disk |
| 630 | * @image: EFI loaded image protocol | 671 | * @image: EFI loaded image protocol |
| @@ -643,17 +684,25 @@ efi_status_t efi_load_initrd(efi_loaded_image_t *image, · 12 unmodified lines | |||
| 643 | { | 684 | { |
| 644 | efi_status_t status; | 685 | efi_status_t status; |
| 645 | 686 | ||
| 646 | if (!load_addr || !load_size) | 687 | if (efi_noinitrd) { |
| 647 | return EFI_INVALID_PARAMETER; | 688 | *load_addr = *load_size = 0; |
| 648 | 689 | status = EFI_SUCCESS; | |
| 649 | status = efi_load_initrd_dev_path(load_addr, load_size, hard_limit); | 690 | } else { |
| 650 | if (status == EFI_SUCCESS) { | 691 | status = efi_load_initrd_dev_path(load_addr, load_size, hard_limit); |
| 651 | efi_info("Loaded initrd from LINUX_EFI_INITRD_MEDIA_GUID device path\n"); | 692 | if (status == EFI_SUCCESS) { |
| 652 | } else if (status == EFI_NOT_FOUND) { | 693 | efi_info("Loaded initrd from LINUX_EFI_INITRD_MEDIA_GUID device path\n"); |
| 653 | status = efi_load_initrd_cmdline(image, load_addr, load_size, | 694 | if (*load_size > 0) |
| 654 | soft_limit, hard_limit); | 695 | efi_measure_initrd(*load_addr, *load_size); |
| 655 | if (status == EFI_SUCCESS && *load_size > 0) | 696 | } else if (status == EFI_NOT_FOUND) { |
| 656 | efi_info("Loaded initrd from command line option\n"); | 697 | status = efi_load_initrd_cmdline(image, load_addr, load_size, |
| 698 | soft_limit, hard_limit); | ||
| 699 | if (status == EFI_SUCCESS && *load_size > 0) | ||
| 700 | efi_info("Loaded initrd from command line option\n"); | ||
| 701 | } | ||
| 702 | if (status != EFI_SUCCESS) { | ||
| 703 | efi_err("Failed to load initrd: 0x%lx\n", status); | ||
| 704 | *load_addr = *load_size = 0; | ||
| 705 | } | ||
| 657 | } | 706 | } |
| 658 | 707 | ||
| 659 | return status; | 708 | return status; |
| @@ -134,7 +134,6 @@ efi_status_t __efiapi efi_pe_entry(efi_handle_t handle, · 133 unmodified lines | |||
| 134 | enum efi_secureboot_mode secure_boot; | 134 | enum efi_secureboot_mode secure_boot; |
| 135 | struct screen_info *si; | 135 | struct screen_info *si; |
| 136 | efi_properties_table_t *prop_tbl; | 136 | efi_properties_table_t *prop_tbl; |
| 137 | unsigned long max_addr; | ||
| 138 | 137 | ||
| 139 | efi_system_table = sys_table_arg; | 138 | efi_system_table = sys_table_arg; |
| 140 | 139 | ||
| @@ -240,13 +239,8 @@ efi_status_t __efiapi efi_pe_entry(efi_handle_t handle, · 99 unmodified lines | |||
| 240 | if (!fdt_addr) | 239 | if (!fdt_addr) |
| 241 | efi_info("Generating empty DTB\n"); | 240 | efi_info("Generating empty DTB\n"); |
| 242 | 241 | ||
| 243 | if (!efi_noinitrd) { | 242 | efi_load_initrd(image, &initrd_addr, &initrd_size, ULONG_MAX, |
| 244 | max_addr = efi_get_max_initrd_addr(image_addr); | 243 | efi_get_max_initrd_addr(image_addr)); |
| 245 | status = efi_load_initrd(image, &initrd_addr, &initrd_size, | ||
| 246 | ULONG_MAX, max_addr); | ||
| 247 | if (status != EFI_SUCCESS) | ||
| 248 | efi_err("Failed to load initrd!\n"); | ||
| 249 | } | ||
| 250 | 244 | ||
| 251 | efi_random_get_seed(); | 245 | efi_random_get_seed(); |
| 252 | 246 | ||
| @@ -31,7 +31,6 @@ · 30 unmodified lines | |||
| 31 | 31 | ||
| 32 | extern bool efi_nochunk; | 32 | extern bool efi_nochunk; |
| 33 | extern bool efi_nokaslr; | 33 | extern bool efi_nokaslr; |
| 34 | extern bool efi_noinitrd; | ||
| 35 | extern int efi_loglevel; | 34 | extern int efi_loglevel; |
| 36 | extern bool efi_novamap; | 35 | extern bool efi_novamap; |
| 37 | 36 | ||
| @@ -667,6 +666,29 @@ union apple_properties_protocol { · 629 unmodified lines | |||
| 667 | 666 | ||
| 668 | typedef u32 efi_tcg2_event_log_format; | 667 | typedef u32 efi_tcg2_event_log_format; |
| 669 | 668 | ||
| 669 | #define INITRD_EVENT_TAG_ID 0x8F3B22ECU | ||
| 670 | #define EV_EVENT_TAG 0x00000006U | ||
| 671 | #define EFI_TCG2_EVENT_HEADER_VERSION 0x1 | ||
| 672 | |||
| 673 | struct efi_tcg2_event { | ||
| 674 | u32 event_size; | ||
| 675 | struct { | ||
| 676 | u32 header_size; | ||
| 677 | u16 header_version; | ||
| 678 | u32 pcr_index; | ||
| 679 | u32 event_type; | ||
| 680 | } __packed event_header; | ||
| 681 | /* u8[] event follows here */ | ||
| 682 | } __packed; | ||
| 683 | |||
| 684 | struct efi_tcg2_tagged_event { | ||
| 685 | u32 tagged_event_id; | ||
| 686 | u32 tagged_event_data_size; | ||
| 687 | /* u8 tagged event data follows here */ | ||
| 688 | } __packed; | ||
| 689 | |||
| 690 | typedef struct efi_tcg2_event efi_tcg2_event_t; | ||
| 691 | typedef struct efi_tcg2_tagged_event efi_tcg2_tagged_event_t; | ||
| 670 | typedef union efi_tcg2_protocol efi_tcg2_protocol_t; | 692 | typedef union efi_tcg2_protocol efi_tcg2_protocol_t; |
| 671 | 693 | ||
| 672 | union efi_tcg2_protocol { | 694 | union efi_tcg2_protocol { |
| @@ -677,7 +699,11 @@ union efi_tcg2_protocol { · 4 unmodified lines | |||
| 677 | efi_physical_addr_t *, | 699 | efi_physical_addr_t *, |
| 678 | efi_physical_addr_t *, | 700 | efi_physical_addr_t *, |
| 679 | efi_bool_t *); | 701 | efi_bool_t *); |
| 680 | void *hash_log_extend_event; | 702 | efi_status_t (__efiapi *hash_log_extend_event)(efi_tcg2_protocol_t *, |
| 703 | u64, | ||
| 704 | efi_physical_addr_t, | ||
| 705 | u64, | ||
| 706 | const efi_tcg2_event_t *); | ||
| 681 | void *submit_command; | 707 | void *submit_command; |
| 682 | void *get_active_pcr_banks; | 708 | void *get_active_pcr_banks; |
| 683 | void *set_active_pcr_banks; | 709 | void *set_active_pcr_banks; |
| @@ -673,6 +673,7 @@ unsigned long efi_main(efi_handle_t handle, · 672 unmodified lines | |||
| 673 | unsigned long bzimage_addr = (unsigned long)startup_32; | 673 | unsigned long bzimage_addr = (unsigned long)startup_32; |
| 674 | unsigned long buffer_start, buffer_end; | 674 | unsigned long buffer_start, buffer_end; |
| 675 | struct setup_header *hdr = &boot_params->hdr; | 675 | struct setup_header *hdr = &boot_params->hdr; |
| 676 | unsigned long addr, size; | ||
| 676 | efi_status_t status; | 677 | efi_status_t status; |
| 677 | 678 | ||
| 678 | efi_system_table = sys_table_arg; | 679 | efi_system_table = sys_table_arg; |
| @@ -761,22 +762,15 @@ unsigned long efi_main(efi_handle_t handle, · 82 unmodified lines | |||
| 761 | * arguments will be processed only if image is not NULL, which will be | 762 | * arguments will be processed only if image is not NULL, which will be |
| 762 | * the case only if we were loaded via the PE entry point. | 763 | * the case only if we were loaded via the PE entry point. |
| 763 | */ | 764 | */ |
| 764 | if (!efi_noinitrd) { | 765 | status = efi_load_initrd(image, &addr, &size, hdr->initrd_addr_max, |
| 765 | unsigned long addr, size; | 766 | ULONG_MAX); |
| 766 | 767 | if (status != EFI_SUCCESS) | |
| 767 | status = efi_load_initrd(image, &addr, &size, | 768 | goto fail; |
| 768 | hdr->initrd_addr_max, ULONG_MAX); | 769 | if (size > 0) { |
| 769 | 770 | efi_set_u64_split(addr, &hdr->ramdisk_image, | |
| 770 | if (status != EFI_SUCCESS) { | 771 | &boot_params->ext_ramdisk_image); |
| 771 | efi_err("Failed to load initrd!\n"); | 772 | efi_set_u64_split(size, &hdr->ramdisk_size, |
| 772 | goto fail; | 773 | &boot_params->ext_ramdisk_size); |
| 773 | } | ||
| 774 | if (size > 0) { | ||
| 775 | efi_set_u64_split(addr, &hdr->ramdisk_image, | ||
| 776 | &boot_params->ext_ramdisk_image); | ||
| 777 | efi_set_u64_split(size, &hdr->ramdisk_size, | ||
| 778 | &boot_params->ext_ramdisk_size); | ||
| 779 | } | ||
| 780 | } | 774 | } |
| 781 | 775 | ||
| 782 | /* | 776 | /* |
| @@ -79,6 +79,7 @@ static struct attribute *def_attrs[] = { · 78 unmodified lines | |||
| 79 | &map_attribute_attr.attr, | 79 | &map_attribute_attr.attr, |
| 80 | NULL | 80 | NULL |
| 81 | }; | 81 | }; |
| 82 | ATTRIBUTE_GROUPS(def); | ||
| 82 | 83 | ||
| 83 | static const struct sysfs_ops map_attr_ops = { | 84 | static const struct sysfs_ops map_attr_ops = { |
| 84 | .show = map_attr_show, | 85 | .show = map_attr_show, |
| @@ -94,7 +95,7 @@ static void map_release(struct kobject *kobj) · 9 unmodified lines | |||
| 94 | 95 | ||
| 95 | static struct kobj_type __refdata map_ktype = { | 96 | static struct kobj_type __refdata map_ktype = { |
| 96 | .sysfs_ops = &map_attr_ops, | 97 | .sysfs_ops = &map_attr_ops, |
| 97 | .default_attrs = def_attrs, | 98 | .default_groups = def_groups, |
| 98 | .release = map_release, | 99 | .release = map_release, |
| 99 | }; | 100 | }; |
| 100 | 101 | ||
| @@ -570,8 +570,8 @@ extern struct efi { · 569 unmodified lines | |||
| 570 | unsigned long flags; | 570 | unsigned long flags; |
| 571 | } efi; | 571 | } efi; |
| 572 | 572 | ||
| 573 | #define EFI_RT_SUPPORTED_GET_TIME 0x0001 | 573 | #define EFI_RT_SUPPORTED_GET_TIME 0x0001 |
| 574 | #define EFI_RT_SUPPORTED_SET_TIME 0x0002 | 574 | #define EFI_RT_SUPPORTED_SET_TIME 0x0002 |
| 575 | #define EFI_RT_SUPPORTED_GET_WAKEUP_TIME 0x0004 | 575 | #define EFI_RT_SUPPORTED_GET_WAKEUP_TIME 0x0004 |
| 576 | #define EFI_RT_SUPPORTED_SET_WAKEUP_TIME 0x0008 | 576 | #define EFI_RT_SUPPORTED_SET_WAKEUP_TIME 0x0008 |
| 577 | #define EFI_RT_SUPPORTED_GET_VARIABLE 0x0010 | 577 | #define EFI_RT_SUPPORTED_GET_VARIABLE 0x0010 |
| @@ -838,7 +838,7 @@ extern int efi_status_to_err(efi_status_t status); · 260 unmodified lines | |||
| 838 | #define EFI_VARIABLE_TIME_BASED_AUTHENTICATED_WRITE_ACCESS 0x0000000000000020 | 838 | #define EFI_VARIABLE_TIME_BASED_AUTHENTICATED_WRITE_ACCESS 0x0000000000000020 |
| 839 | #define EFI_VARIABLE_APPEND_WRITE 0x0000000000000040 | 839 | #define EFI_VARIABLE_APPEND_WRITE 0x0000000000000040 |
| 840 | 840 | ||
| 841 | #define EFI_VARIABLE_MASK (EFI_VARIABLE_NON_VOLATILE | \ | 841 | #define EFI_VARIABLE_MASK (EFI_VARIABLE_NON_VOLATILE | \ |
| 842 | EFI_VARIABLE_BOOTSERVICE_ACCESS | \ | 842 | EFI_VARIABLE_BOOTSERVICE_ACCESS | \ |
| 843 | EFI_VARIABLE_RUNTIME_ACCESS | \ | 843 | EFI_VARIABLE_RUNTIME_ACCESS | \ |
| 844 | EFI_VARIABLE_HARDWARE_ERROR_RECORD | \ | 844 | EFI_VARIABLE_HARDWARE_ERROR_RECORD | \ |