-----BEGIN PGP SIGNATURE----- iQIzBAABCAAdFiEEZH8oZUiU471FcZm+ONu9yGCSaT4FAlo06IYACgkQONu9yGCS aT6M4hAAhACzW/fsu/NDmfsx8qroVSfugMaZd2kWd1Hne6lx4SXK/Fy61UFRLC04 oImmBfzkkDekMg3wserA+pQmUaB1ZZl3wowh7J1M9wgfNdaNvPe5mN/9tU+LRGKH wOjZT1UWZ9Vf4a2JavsyujIL+H7QiOrsvZMaOKdUjD+chg3wexIQFoYg3NdE+wPZ /Rhztxvuj+yBG6zZl3Ws9y55suq2NATcltpiW4bbVZf5i2cMA3en/ugsGpWuB/UO IF2cnqzgernOpkkzVGFbXd0ePH8MhLxEiMMm+cVoE5xDGM0M7HMCePiPc66yOyYy 4axU5KiVRRe1y0a0QDWGOO9MNPX1q0AE2Gy6B6p3nlOVvA5LO9mW1mI9gGY1yH5/ Cfr9GqE9N/SmHQdLVGq8SFMKDdrOfxqyaFTOdTzMxa3TQX3qNYhoUWxcWmDVeMGY hNCqS1wTQ8Pp3ZH7VREm/kGpLFmcIe7vaERzhZYyXGU9cE+o2REWIJzx4W5pSH3D qaw9V+vN7aiep9TzP7G8TibXszW3j07+I7K4Ua3wBAfnbJR4hUcsExROBr/oV1+m klzq/xoj5L1m6x4Jf5avvaW5ykbnzKIeX3urALrW4qqnd3nyrir0w9Ja1YeBymMz 56uGu8vqb02TZySPky7sSRnAyctEBP4SUL4vuudDRxIm+mbNors= =ZyVC -----END PGP SIGNATURE----- Merge 4.4.106 into android-4.4 Changes in 4.4.106 can: ti_hecc: Fix napi poll return value for repoll can: kvaser_usb: free buf in error paths can: kvaser_usb: Fix comparison bug in kvaser_usb_read_bulk_callback() can: kvaser_usb: ratelimit errors if incomplete messages are received can: kvaser_usb: cancel urb on -EPIPE and -EPROTO can: ems_usb: cancel urb on -EPIPE and -EPROTO can: esd_usb2: cancel urb on -EPIPE and -EPROTO can: usb_8dev: cancel urb on -EPIPE and -EPROTO virtio: release virtio index when fail to device_register hv: kvp: Avoid reading past allocated blocks from KVP file isa: Prevent NULL dereference in isa_bus driver callbacks scsi: libsas: align sata_device's rps_resp on a cacheline efi: Move some sysfs files to be read-only by root ASN.1: fix out-of-bounds read when parsing indefinite length item ASN.1: check for error from ASN1_OP_END__ACT actions X.509: reject invalid BIT STRING for subjectPublicKey x86/PCI: Make broadcom_postcore_init() check acpi_disabled ALSA: pcm: prevent UAF in snd_pcm_info ALSA: seq: Remove spurious WARN_ON() at timer check ALSA: usb-audio: Fix out-of-bound error ALSA: usb-audio: Add check return value for usb_string() iommu/vt-d: Fix scatterlist offset handling s390: fix compat system call table kdb: Fix handling of kallsyms_symbol_next() return value drm: extra printk() wrapper macros drm/exynos: gem: Drop NONCONTIG flag for buffers allocated without IOMMU media: dvb: i2c transfers over usb cannot be done from stack arm64: KVM: fix VTTBR_BADDR_MASK BUG_ON off-by-one KVM: VMX: remove I/O port 0x80 bypass on Intel hosts arm64: fpsimd: Prevent registers leaking from dead tasks ARM: BUG if jumping to usermode address in kernel mode ARM: avoid faulting on qemu scsi: storvsc: Workaround for virtual DVD SCSI version thp: reduce indentation level in change_huge_pmd() thp: fix MADV_DONTNEED vs. numa balancing race mm: drop unused pmdp_huge_get_and_clear_notify() Revert "drm/armada: Fix compile fail" Revert "spi: SPI_FSL_DSPI should depend on HAS_DMA" Revert "s390/kbuild: enable modversions for symbols exported from asm" vti6: Don't report path MTU below IPV6_MIN_MTU. ARM: OMAP2+: gpmc-onenand: propagate error on initialization failure x86/hpet: Prevent might sleep splat on resume selftest/powerpc: Fix false failures for skipped tests module: set __jump_table alignment to 8 ARM: OMAP2+: Fix device node reference counts ARM: OMAP2+: Release device node after it is no longer needed. gpio: altera: Use handle_level_irq when configured as a level_high HID: chicony: Add support for another ASUS Zen AiO keyboard usb: gadget: configs: plug memory leak USB: gadgetfs: Fix a potential memory leak in 'dev_config()' kvm: nVMX: VMCLEAR should not cause the vCPU to shut down libata: drop WARN from protocol error in ata_sff_qc_issue() workqueue: trigger WARN if queue_delayed_work() is called with NULL @wq scsi: lpfc: Fix crash during Hardware error recovery on SLI3 adapters irqchip/crossbar: Fix incorrect type of register size KVM: nVMX: reset nested_run_pending if the vCPU is going to be reset arm: KVM: Survive unknown traps from guests arm64: KVM: Survive unknown traps from guests spi_ks8995: fix "BUG: key accdaa28 not in .data!" bnx2x: prevent crash when accessing PTP with interface down bnx2x: fix possible overrun of VFPF multicast addresses array bnx2x: do not rollback VF MAC/VLAN filters we did not configure ipv6: reorder icmpv6_init() and ip6_mr_init() crypto: s5p-sss - Fix completing crypto request in IRQ handler i2c: riic: fix restart condition zram: set physical queue limits to avoid array out of bounds accesses netfilter: don't track fragmented packets axonram: Fix gendisk handling drm/amd/amdgpu: fix console deadlock if late init failed powerpc/powernv/ioda2: Gracefully fail if too many TCE levels requested EDAC, i5000, i5400: Fix use of MTR_DRAM_WIDTH macro EDAC, i5000, i5400: Fix definition of NRECMEMB register kbuild: pkg: use --transform option to prefix paths in tar mac80211_hwsim: Fix memory leak in hwsim_new_radio_nl() route: also update fnhe_genid when updating a route cache route: update fnhe_expires for redirect when the fnhe exists lib/genalloc.c: make the avail variable an atomic_long_t dynamic-debug-howto: fix optional/omitted ending line number to be LARGE instead of 0 NFS: Fix a typo in nfs_rename() sunrpc: Fix rpc_task_begin trace point block: wake up all tasks blocked in get_request() sparc64/mm: set fields in deferred pages sctp: do not free asoc when it is already dead in sctp_sendmsg sctp: use the right sk after waking up from wait_buf sleep atm: horizon: Fix irq release error jump_label: Invoke jump_label_test() via early_initcall() xfrm: Copy policy family in clone_policy IB/mlx4: Increase maximal message size under UD QP IB/mlx5: Assign send CQ and recv CQ of UMR QP afs: Connect up the CB.ProbeUuid ipvlan: fix ipv6 outbound device audit: ensure that 'audit=1' actually enables audit for PID 1 ipmi: Stop timers before cleaning up the module s390: always save and restore all registers on context switch more bio_map_user_iov() leak fixes tipc: fix memory leak in tipc_accept_from_sock() rds: Fix NULL pointer dereference in __rds_rdma_map sit: update frag_off info packet: fix crash in fanout_demux_rollover() net/packet: fix a race in packet_bind() and packet_notifier() Revert "x86/efi: Build our own page table structures" Revert "x86/efi: Hoist page table switching code into efi_call_virt()" Revert "x86/mm/pat: Ensure cpa->pfn only contains page frame numbers" arm: KVM: Fix VTTBR_BADDR_MASK BUG_ON off-by-one usb: gadget: ffs: Forbid usb_ep_alloc_request from sleeping Linux 4.4.106 Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
212 lines
5.8 KiB
C
212 lines
5.8 KiB
C
#ifndef _ASM_X86_EFI_H
|
|
#define _ASM_X86_EFI_H
|
|
|
|
#include <asm/fpu/api.h>
|
|
#include <asm/pgtable.h>
|
|
|
|
/*
|
|
* We map the EFI regions needed for runtime services non-contiguously,
|
|
* with preserved alignment on virtual addresses starting from -4G down
|
|
* for a total max space of 64G. This way, we provide for stable runtime
|
|
* services addresses across kernels so that a kexec'd kernel can still
|
|
* use them.
|
|
*
|
|
* This is the main reason why we're doing stable VA mappings for RT
|
|
* services.
|
|
*
|
|
* This flag is used in conjuction with a chicken bit called
|
|
* "efi=old_map" which can be used as a fallback to the old runtime
|
|
* services mapping method in case there's some b0rkage with a
|
|
* particular EFI implementation (haha, it is hard to hold up the
|
|
* sarcasm here...).
|
|
*/
|
|
#define EFI_OLD_MEMMAP EFI_ARCH_1
|
|
|
|
#define EFI32_LOADER_SIGNATURE "EL32"
|
|
#define EFI64_LOADER_SIGNATURE "EL64"
|
|
|
|
#define MAX_CMDLINE_ADDRESS UINT_MAX
|
|
|
|
#ifdef CONFIG_X86_32
|
|
|
|
|
|
extern unsigned long asmlinkage efi_call_phys(void *, ...);
|
|
|
|
/*
|
|
* Wrap all the virtual calls in a way that forces the parameters on the stack.
|
|
*/
|
|
|
|
/* Use this macro if your virtual returns a non-void value */
|
|
#define efi_call_virt(f, args...) \
|
|
({ \
|
|
efi_status_t __s; \
|
|
kernel_fpu_begin(); \
|
|
__s = ((efi_##f##_t __attribute__((regparm(0)))*) \
|
|
efi.systab->runtime->f)(args); \
|
|
kernel_fpu_end(); \
|
|
__s; \
|
|
})
|
|
|
|
/* Use this macro if your virtual call does not return any value */
|
|
#define __efi_call_virt(f, args...) \
|
|
({ \
|
|
kernel_fpu_begin(); \
|
|
((efi_##f##_t __attribute__((regparm(0)))*) \
|
|
efi.systab->runtime->f)(args); \
|
|
kernel_fpu_end(); \
|
|
})
|
|
|
|
#define efi_ioremap(addr, size, type, attr) ioremap_cache(addr, size)
|
|
|
|
#else /* !CONFIG_X86_32 */
|
|
|
|
#define EFI_LOADER_SIGNATURE "EL64"
|
|
|
|
extern u64 asmlinkage efi_call(void *fp, ...);
|
|
|
|
#define efi_call_phys(f, args...) efi_call((f), args)
|
|
|
|
#define efi_call_virt(f, ...) \
|
|
({ \
|
|
efi_status_t __s; \
|
|
\
|
|
efi_sync_low_kernel_mappings(); \
|
|
preempt_disable(); \
|
|
__kernel_fpu_begin(); \
|
|
__s = efi_call((void *)efi.systab->runtime->f, __VA_ARGS__); \
|
|
__kernel_fpu_end(); \
|
|
preempt_enable(); \
|
|
__s; \
|
|
})
|
|
|
|
/*
|
|
* All X86_64 virt calls return non-void values. Thus, use non-void call for
|
|
* virt calls that would be void on X86_32.
|
|
*/
|
|
#define __efi_call_virt(f, args...) efi_call_virt(f, args)
|
|
|
|
extern void __iomem *__init efi_ioremap(unsigned long addr, unsigned long size,
|
|
u32 type, u64 attribute);
|
|
|
|
#ifdef CONFIG_KASAN
|
|
/*
|
|
* CONFIG_KASAN may redefine memset to __memset. __memset function is present
|
|
* only in kernel binary. Since the EFI stub linked into a separate binary it
|
|
* doesn't have __memset(). So we should use standard memset from
|
|
* arch/x86/boot/compressed/string.c. The same applies to memcpy and memmove.
|
|
*/
|
|
#undef memcpy
|
|
#undef memset
|
|
#undef memmove
|
|
#endif
|
|
|
|
#endif /* CONFIG_X86_32 */
|
|
|
|
extern struct efi_scratch efi_scratch;
|
|
extern void __init efi_set_executable(efi_memory_desc_t *md, bool executable);
|
|
extern int __init efi_memblock_x86_reserve_range(void);
|
|
extern pgd_t * __init efi_call_phys_prolog(void);
|
|
extern void __init efi_call_phys_epilog(pgd_t *save_pgd);
|
|
extern void __init efi_print_memmap(void);
|
|
extern void __init efi_unmap_memmap(void);
|
|
extern void __init efi_memory_uc(u64 addr, unsigned long size);
|
|
extern void __init efi_map_region(efi_memory_desc_t *md);
|
|
extern void __init efi_map_region_fixed(efi_memory_desc_t *md);
|
|
extern void efi_sync_low_kernel_mappings(void);
|
|
extern int __init efi_setup_page_tables(unsigned long pa_memmap, unsigned num_pages);
|
|
extern void __init efi_cleanup_page_tables(unsigned long pa_memmap, unsigned num_pages);
|
|
extern void __init old_map_region(efi_memory_desc_t *md);
|
|
extern void __init runtime_code_page_mkexec(void);
|
|
extern void __init efi_runtime_mkexec(void);
|
|
extern void __init efi_dump_pagetable(void);
|
|
extern void __init efi_apply_memmap_quirks(void);
|
|
extern int __init efi_reuse_config(u64 tables, int nr_tables);
|
|
extern void efi_delete_dummy_variable(void);
|
|
|
|
struct efi_setup_data {
|
|
u64 fw_vendor;
|
|
u64 runtime;
|
|
u64 tables;
|
|
u64 smbios;
|
|
u64 reserved[8];
|
|
};
|
|
|
|
extern u64 efi_setup;
|
|
|
|
#ifdef CONFIG_EFI
|
|
|
|
static inline bool efi_is_native(void)
|
|
{
|
|
return IS_ENABLED(CONFIG_X86_64) == efi_enabled(EFI_64BIT);
|
|
}
|
|
|
|
static inline bool efi_runtime_supported(void)
|
|
{
|
|
if (efi_is_native())
|
|
return true;
|
|
|
|
if (IS_ENABLED(CONFIG_EFI_MIXED) && !efi_enabled(EFI_OLD_MEMMAP))
|
|
return true;
|
|
|
|
return false;
|
|
}
|
|
|
|
extern struct console early_efi_console;
|
|
extern void parse_efi_setup(u64 phys_addr, u32 data_len);
|
|
|
|
#ifdef CONFIG_EFI_MIXED
|
|
extern void efi_thunk_runtime_setup(void);
|
|
extern efi_status_t efi_thunk_set_virtual_address_map(
|
|
void *phys_set_virtual_address_map,
|
|
unsigned long memory_map_size,
|
|
unsigned long descriptor_size,
|
|
u32 descriptor_version,
|
|
efi_memory_desc_t *virtual_map);
|
|
#else
|
|
static inline void efi_thunk_runtime_setup(void) {}
|
|
static inline efi_status_t efi_thunk_set_virtual_address_map(
|
|
void *phys_set_virtual_address_map,
|
|
unsigned long memory_map_size,
|
|
unsigned long descriptor_size,
|
|
u32 descriptor_version,
|
|
efi_memory_desc_t *virtual_map)
|
|
{
|
|
return EFI_SUCCESS;
|
|
}
|
|
#endif /* CONFIG_EFI_MIXED */
|
|
|
|
|
|
/* arch specific definitions used by the stub code */
|
|
|
|
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;
|
|
|
|
__pure const struct efi_config *__efi_early(void);
|
|
|
|
#define efi_call_early(f, ...) \
|
|
__efi_early()->call(__efi_early()->f, __VA_ARGS__);
|
|
|
|
extern bool efi_reboot_required(void);
|
|
|
|
#else
|
|
static inline void parse_efi_setup(u64 phys_addr, u32 data_len) {}
|
|
static inline bool efi_reboot_required(void)
|
|
{
|
|
return false;
|
|
}
|
|
#endif /* CONFIG_EFI */
|
|
|
|
#endif /* _ASM_X86_EFI_H */
|