Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 994448f1 authored by Matt Fleming's avatar Matt Fleming
Browse files

Merge remote-tracking branch 'tip/x86/efi-mixed' into efi-for-mingo

Conflicts:
	arch/x86/kernel/setup.c
	arch/x86/platform/efi/efi.c
	arch/x86/platform/efi/efi_64.c
parents 4fd69331 18c46461
Loading
Loading
Loading
Loading
+14 −0
Original line number Diff line number Diff line
@@ -1585,6 +1585,20 @@ config EFI_STUB

	  See Documentation/efi-stub.txt for more information.

config EFI_MIXED
	bool "EFI mixed-mode support"
	depends on EFI_STUB && X86_64
	---help---
	   Enabling this feature allows a 64-bit kernel to be booted
	   on a 32-bit firmware, provided that your CPU supports 64-bit
	   mode.

	   Note that it is not possible to boot a mixed-mode enabled
	   kernel via the EFI boot stub - a bootloader that supports
	   the EFI handover protocol must be used.

	   If unsure, say N.

config SECCOMP
	def_bool y
	prompt "Enable seccomp to safely compute untrusted bytecode"
+1 −1
Original line number Diff line number Diff line
@@ -80,7 +80,7 @@ targets += voffset.h
$(obj)/voffset.h: vmlinux FORCE
	$(call if_changed,voffset)

sed-zoffset := -e 's/^\([0-9a-fA-F]*\) . \(startup_32\|startup_64\|efi_pe_entry\|efi_stub_entry\|input_data\|_end\|z_.*\)$$/\#define ZO_\2 0x\1/p'
sed-zoffset := -e 's/^\([0-9a-fA-F]*\) . \(startup_32\|startup_64\|efi32_stub_entry\|efi64_stub_entry\|efi_pe_entry\|input_data\|_end\|z_.*\)$$/\#define ZO_\2 0x\1/p'

quiet_cmd_zoffset = ZOFFSET $@
      cmd_zoffset = $(NM) $< | sed -n $(sed-zoffset) > $@
+816 −202

File changed.

Preview size limit exceeded, changes collapsed.

+60 −0
Original line number Diff line number Diff line
@@ -37,6 +37,24 @@ struct efi_graphics_output_mode_info {
	u32 pixels_per_scan_line;
} __packed;

struct efi_graphics_output_protocol_mode_32 {
	u32 max_mode;
	u32 mode;
	u32 info;
	u32 size_of_info;
	u64 frame_buffer_base;
	u32 frame_buffer_size;
} __packed;

struct efi_graphics_output_protocol_mode_64 {
	u32 max_mode;
	u32 mode;
	u64 info;
	u64 size_of_info;
	u64 frame_buffer_base;
	u64 frame_buffer_size;
} __packed;

struct efi_graphics_output_protocol_mode {
	u32 max_mode;
	u32 mode;
@@ -46,6 +64,20 @@ struct efi_graphics_output_protocol_mode {
	unsigned long frame_buffer_size;
} __packed;

struct efi_graphics_output_protocol_32 {
	u32 query_mode;
	u32 set_mode;
	u32 blt;
	u32 mode;
};

struct efi_graphics_output_protocol_64 {
	u64 query_mode;
	u64 set_mode;
	u64 blt;
	u64 mode;
};

struct efi_graphics_output_protocol {
	void *query_mode;
	unsigned long set_mode;
@@ -53,10 +85,38 @@ struct efi_graphics_output_protocol {
	struct efi_graphics_output_protocol_mode *mode;
};

struct efi_uga_draw_protocol_32 {
	u32 get_mode;
	u32 set_mode;
	u32 blt;
};

struct efi_uga_draw_protocol_64 {
	u64 get_mode;
	u64 set_mode;
	u64 blt;
};

struct efi_uga_draw_protocol {
	void *get_mode;
	void *set_mode;
	void *blt;
};

struct efi_config {
	u64 image_handle;
	u64 table;
	u64 allocate_pool;
	u64 allocate_pages;
	u64 get_memory_map;
	u64 free_pool;
	u64 free_pages;
	u64 locate_handle;
	u64 handle_protocol;
	u64 exit_boot_services;
	u64 text_output;
	efi_status_t (*call)(unsigned long, ...);
	bool is64;
} __packed;

#endif /* BOOT_COMPRESSED_EBOOT_H */
+29 −0
Original line number Diff line number Diff line
#include <asm/segment.h>
#include <asm/msr.h>
#include <asm/processor-flags.h>

#include "../../platform/efi/efi_stub_64.S"

#ifdef CONFIG_EFI_MIXED
	.code64
	.text
ENTRY(efi64_thunk)
	push	%rbp
	push	%rbx

	subq	$16, %rsp
	leaq	efi_exit32(%rip), %rax
	movl	%eax, 8(%rsp)
	leaq	efi_gdt64(%rip), %rax
	movl	%eax, 4(%rsp)
	movl	%eax, 2(%rax)		/* Fixup the gdt base address */
	leaq	efi32_boot_gdt(%rip), %rax
	movl	%eax, (%rsp)

	call	__efi64_thunk

	addq	$16, %rsp
	pop	%rbx
	pop	%rbp
	ret
ENDPROC(efi64_thunk)
#endif /* CONFIG_EFI_MIXED */
Loading