mirror of
https://github.com/hardkernel/linux.git
synced 2026-03-25 03:50:24 +09:00
Merge tag 'lsk-v3.14-15.02' of https://git.linaro.org/kernel/linux-linaro-stable into odroidc2-3.14.y-linarohk
LSK 15.02 v3.14 Conflicts: arch/arm64/kernel/head.S fs/pstore/ram.c mm/page_alloc.c mm/vmscan.c
This commit is contained in:
28
Documentation/ABI/testing/sysfs-firmware-ofw
Normal file
28
Documentation/ABI/testing/sysfs-firmware-ofw
Normal file
@@ -0,0 +1,28 @@
|
||||
What: /sys/firmware/devicetree/*
|
||||
Date: November 2013
|
||||
Contact: Grant Likely <grant.likely@linaro.org>
|
||||
Description:
|
||||
When using OpenFirmware or a Flattened Device Tree to enumerate
|
||||
hardware, the device tree structure will be exposed in this
|
||||
directory.
|
||||
|
||||
It is possible for multiple device-tree directories to exist.
|
||||
Some device drivers use a separate detached device tree which
|
||||
have no attachment to the system tree and will appear in a
|
||||
different subdirectory under /sys/firmware/devicetree.
|
||||
|
||||
Userspace must not use the /sys/firmware/devicetree/base
|
||||
path directly, but instead should follow /proc/device-tree
|
||||
symlink. It is possible that the absolute path will change
|
||||
in the future, but the symlink is the stable ABI.
|
||||
|
||||
The /proc/device-tree symlink replaces the devicetree /proc
|
||||
filesystem support, and has largely the same semantics and
|
||||
should be compatible with existing userspace.
|
||||
|
||||
The contents of /sys/firmware/devicetree/ is a
|
||||
hierarchy of directories, one per device tree node. The
|
||||
directory name is the resolved path component name (node
|
||||
name plus address). Properties are represented as files
|
||||
in the directory. The contents of each file is the exact
|
||||
binary data from the device tree.
|
||||
71
Documentation/devicetree/bindings/unittest.txt
Normal file
71
Documentation/devicetree/bindings/unittest.txt
Normal file
@@ -0,0 +1,71 @@
|
||||
1) OF selftest platform device
|
||||
|
||||
** selftest
|
||||
|
||||
Required properties:
|
||||
- compatible: must be "selftest"
|
||||
|
||||
All other properties are optional.
|
||||
|
||||
Example:
|
||||
selftest {
|
||||
compatible = "selftest";
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
2) OF selftest i2c adapter platform device
|
||||
|
||||
** platform device unittest adapter
|
||||
|
||||
Required properties:
|
||||
- compatible: must be selftest-i2c-bus
|
||||
|
||||
Children nodes contain selftest i2c devices.
|
||||
|
||||
Example:
|
||||
selftest-i2c-bus {
|
||||
compatible = "selftest-i2c-bus";
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
3) OF selftest i2c device
|
||||
|
||||
** I2C selftest device
|
||||
|
||||
Required properties:
|
||||
- compatible: must be selftest-i2c-dev
|
||||
|
||||
All other properties are optional
|
||||
|
||||
Example:
|
||||
selftest-i2c-dev {
|
||||
compatible = "selftest-i2c-dev";
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
4) OF selftest i2c mux device
|
||||
|
||||
** I2C selftest mux
|
||||
|
||||
Required properties:
|
||||
- compatible: must be selftest-i2c-mux
|
||||
|
||||
Children nodes contain selftest i2c bus nodes per channel.
|
||||
|
||||
Example:
|
||||
selftest-i2c-mux {
|
||||
compatible = "selftest-i2c-mux";
|
||||
status = "okay";
|
||||
#address-cells = <1>;
|
||||
#size-cells = <0>;
|
||||
channel-0 {
|
||||
reg = <0>;
|
||||
#address-cells = <1>;
|
||||
#size-cells = <0>;
|
||||
i2c-dev {
|
||||
reg = <8>;
|
||||
compatible = "selftest-i2c-dev";
|
||||
status = "okay";
|
||||
};
|
||||
};
|
||||
};
|
||||
40
Documentation/devicetree/changesets.txt
Normal file
40
Documentation/devicetree/changesets.txt
Normal file
@@ -0,0 +1,40 @@
|
||||
A DT changeset is a method which allows one to apply changes
|
||||
in the live tree in such a way that either the full set of changes
|
||||
will be applied, or none of them will be. If an error occurs partway
|
||||
through applying the changeset, then the tree will be rolled back to the
|
||||
previous state. A changeset can also be removed after it has been
|
||||
applied.
|
||||
|
||||
When a changeset is applied, all of the changes get applied to the tree
|
||||
at once before emitting OF_RECONFIG notifiers. This is so that the
|
||||
receiver sees a complete and consistent state of the tree when it
|
||||
receives the notifier.
|
||||
|
||||
The sequence of a changeset is as follows.
|
||||
|
||||
1. of_changeset_init() - initializes a changeset
|
||||
|
||||
2. A number of DT tree change calls, of_changeset_attach_node(),
|
||||
of_changeset_detach_node(), of_changeset_add_property(),
|
||||
of_changeset_remove_property, of_changeset_update_property() to prepare
|
||||
a set of changes. No changes to the active tree are made at this point.
|
||||
All the change operations are recorded in the of_changeset 'entries'
|
||||
list.
|
||||
|
||||
3. mutex_lock(of_mutex) - starts a changeset; The global of_mutex
|
||||
ensures there can only be one editor at a time.
|
||||
|
||||
4. of_changeset_apply() - Apply the changes to the tree. Either the
|
||||
entire changeset will get applied, or if there is an error the tree will
|
||||
be restored to the previous state
|
||||
|
||||
5. mutex_unlock(of_mutex) - All operations complete, release the mutex
|
||||
|
||||
If a successfully applied changeset needs to be removed, it can be done
|
||||
with the following sequence.
|
||||
|
||||
1. mutex_lock(of_mutex)
|
||||
|
||||
2. of_changeset_revert()
|
||||
|
||||
3. mutex_unlock(of_mutex)
|
||||
25
Documentation/devicetree/dynamic-resolution-notes.txt
Normal file
25
Documentation/devicetree/dynamic-resolution-notes.txt
Normal file
@@ -0,0 +1,25 @@
|
||||
Device Tree Dynamic Resolver Notes
|
||||
----------------------------------
|
||||
|
||||
This document describes the implementation of the in-kernel
|
||||
Device Tree resolver, residing in drivers/of/resolver.c and is a
|
||||
companion document to Documentation/devicetree/dt-object-internal.txt[1]
|
||||
|
||||
How the resolver works
|
||||
----------------------
|
||||
|
||||
The resolver is given as an input an arbitrary tree compiled with the
|
||||
proper dtc option and having a /plugin/ tag. This generates the
|
||||
appropriate __fixups__ & __local_fixups__ nodes as described in [1].
|
||||
|
||||
In sequence the resolver works by the following steps:
|
||||
|
||||
1. Get the maximum device tree phandle value from the live tree + 1.
|
||||
2. Adjust all the local phandles of the tree to resolve by that amount.
|
||||
3. Using the __local__fixups__ node information adjust all local references
|
||||
by the same amount.
|
||||
4. For each property in the __fixups__ node locate the node it references
|
||||
in the live tree. This is the label used to tag the node.
|
||||
5. Retrieve the phandle of the target of the fixup.
|
||||
6. For each fixup in the property locate the node:property:offset location
|
||||
and replace it with the phandle value.
|
||||
133
Documentation/devicetree/overlay-notes.txt
Normal file
133
Documentation/devicetree/overlay-notes.txt
Normal file
@@ -0,0 +1,133 @@
|
||||
Device Tree Overlay Notes
|
||||
-------------------------
|
||||
|
||||
This document describes the implementation of the in-kernel
|
||||
device tree overlay functionality residing in drivers/of/overlay.c and is a
|
||||
companion document to Documentation/devicetree/dt-object-internal.txt[1] &
|
||||
Documentation/devicetree/dynamic-resolution-notes.txt[2]
|
||||
|
||||
How overlays work
|
||||
-----------------
|
||||
|
||||
A Device Tree's overlay purpose is to modify the kernel's live tree, and
|
||||
have the modification affecting the state of the the kernel in a way that
|
||||
is reflecting the changes.
|
||||
Since the kernel mainly deals with devices, any new device node that result
|
||||
in an active device should have it created while if the device node is either
|
||||
disabled or removed all together, the affected device should be deregistered.
|
||||
|
||||
Lets take an example where we have a foo board with the following base tree
|
||||
which is taken from [1].
|
||||
|
||||
---- foo.dts -----------------------------------------------------------------
|
||||
/* FOO platform */
|
||||
/ {
|
||||
compatible = "corp,foo";
|
||||
|
||||
/* shared resources */
|
||||
res: res {
|
||||
};
|
||||
|
||||
/* On chip peripherals */
|
||||
ocp: ocp {
|
||||
/* peripherals that are always instantiated */
|
||||
peripheral1 { ... };
|
||||
}
|
||||
};
|
||||
---- foo.dts -----------------------------------------------------------------
|
||||
|
||||
The overlay bar.dts, when loaded (and resolved as described in [2]) should
|
||||
|
||||
---- bar.dts -----------------------------------------------------------------
|
||||
/plugin/; /* allow undefined label references and record them */
|
||||
/ {
|
||||
.... /* various properties for loader use; i.e. part id etc. */
|
||||
fragment@0 {
|
||||
target = <&ocp>;
|
||||
__overlay__ {
|
||||
/* bar peripheral */
|
||||
bar {
|
||||
compatible = "corp,bar";
|
||||
... /* various properties and child nodes */
|
||||
}
|
||||
};
|
||||
};
|
||||
};
|
||||
---- bar.dts -----------------------------------------------------------------
|
||||
|
||||
result in foo+bar.dts
|
||||
|
||||
---- foo+bar.dts -------------------------------------------------------------
|
||||
/* FOO platform + bar peripheral */
|
||||
/ {
|
||||
compatible = "corp,foo";
|
||||
|
||||
/* shared resources */
|
||||
res: res {
|
||||
};
|
||||
|
||||
/* On chip peripherals */
|
||||
ocp: ocp {
|
||||
/* peripherals that are always instantiated */
|
||||
peripheral1 { ... };
|
||||
|
||||
/* bar peripheral */
|
||||
bar {
|
||||
compatible = "corp,bar";
|
||||
... /* various properties and child nodes */
|
||||
}
|
||||
}
|
||||
};
|
||||
---- foo+bar.dts -------------------------------------------------------------
|
||||
|
||||
As a result of the the overlay, a new device node (bar) has been created
|
||||
so a bar platform device will be registered and if a matching device driver
|
||||
is loaded the device will be created as expected.
|
||||
|
||||
Overlay in-kernel API
|
||||
--------------------------------
|
||||
|
||||
The API is quite easy to use.
|
||||
|
||||
1. Call of_overlay_create() to create and apply an overlay. The return value
|
||||
is a cookie identifying this overlay.
|
||||
|
||||
2. Call of_overlay_destroy() to remove and cleanup the overlay previously
|
||||
created via the call to of_overlay_create(). Removal of an overlay that
|
||||
is stacked by another will not be permitted.
|
||||
|
||||
Finally, if you need to remove all overlays in one-go, just call
|
||||
of_overlay_destroy_all() which will remove every single one in the correct
|
||||
order.
|
||||
|
||||
Overlay DTS Format
|
||||
------------------
|
||||
|
||||
The DTS of an overlay should have the following format:
|
||||
|
||||
{
|
||||
/* ignored properties by the overlay */
|
||||
|
||||
fragment@0 { /* first child node */
|
||||
|
||||
target=<phandle>; /* phandle target of the overlay */
|
||||
or
|
||||
target-path="/path"; /* target path of the overlay */
|
||||
|
||||
__overlay__ {
|
||||
property-a; /* add property-a to the target */
|
||||
node-a { /* add to an existing, or create a node-a */
|
||||
...
|
||||
};
|
||||
};
|
||||
}
|
||||
fragment@1 { /* second child node */
|
||||
...
|
||||
};
|
||||
/* more fragments follow */
|
||||
}
|
||||
|
||||
Using the non-phandle based target method allows one to use a base DT which does
|
||||
not contain a __symbols__ node, i.e. it was not compiled with the -@ option.
|
||||
The __symbols__ node is only required for the target=<phandle> method, since it
|
||||
contains the information required to map from a phandle to a tree location.
|
||||
@@ -1175,6 +1175,7 @@ bytes respectively. Such letter suffixes can also be entirely omitted.
|
||||
i8042.notimeout [HW] Ignore timeout condition signalled by controller
|
||||
i8042.reset [HW] Reset the controller during init and cleanup
|
||||
i8042.unlock [HW] Unlock (ignore) the keylock
|
||||
i8042.kbdreset [HW] Reset device connected to KBD port
|
||||
|
||||
i810= [HW,DRM]
|
||||
|
||||
|
||||
2
Makefile
2
Makefile
@@ -1,6 +1,6 @@
|
||||
VERSION = 3
|
||||
PATCHLEVEL = 14
|
||||
SUBLEVEL = 29
|
||||
SUBLEVEL = 32
|
||||
EXTRAVERSION =
|
||||
NAME = Remembering Coco
|
||||
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
/* this is for console on PGU */
|
||||
/* bootargs = "console=tty0 consoleblank=0"; */
|
||||
/* this is for console on serial */
|
||||
bootargs = "earlycon=uart8250,mmio32,0xc0000000,115200n8 console=tty0 console=ttyS0,115200n8 consoleblank=0 debug";
|
||||
bootargs = "earlycon=uart8250,mmio32,0xf0000000,115200n8 console=tty0 console=ttyS0,115200n8 consoleblank=0 debug";
|
||||
};
|
||||
|
||||
aliases {
|
||||
@@ -46,9 +46,9 @@
|
||||
#interrupt-cells = <1>;
|
||||
};
|
||||
|
||||
uart0: serial@c0000000 {
|
||||
uart0: serial@f0000000 {
|
||||
compatible = "ns8250";
|
||||
reg = <0xc0000000 0x2000>;
|
||||
reg = <0xf0000000 0x2000>;
|
||||
interrupts = <11>;
|
||||
clock-frequency = <3686400>;
|
||||
baud = <115200>;
|
||||
@@ -57,21 +57,21 @@
|
||||
no-loopback-test = <1>;
|
||||
};
|
||||
|
||||
pgu0: pgu@c9000000 {
|
||||
pgu0: pgu@f9000000 {
|
||||
compatible = "snps,arcpgufb";
|
||||
reg = <0xc9000000 0x400>;
|
||||
reg = <0xf9000000 0x400>;
|
||||
};
|
||||
|
||||
ps2: ps2@c9001000 {
|
||||
ps2: ps2@f9001000 {
|
||||
compatible = "snps,arc_ps2";
|
||||
reg = <0xc9000400 0x14>;
|
||||
reg = <0xf9000400 0x14>;
|
||||
interrupts = <13>;
|
||||
interrupt-names = "arc_ps2_irq";
|
||||
};
|
||||
|
||||
eth0: ethernet@c0003000 {
|
||||
eth0: ethernet@f0003000 {
|
||||
compatible = "snps,oscilan";
|
||||
reg = <0xc0003000 0x44>;
|
||||
reg = <0xf0003000 0x44>;
|
||||
interrupts = <7>, <8>;
|
||||
interrupt-names = "rx", "tx";
|
||||
};
|
||||
|
||||
@@ -1,37 +0,0 @@
|
||||
/*
|
||||
* Copyright (C) 2004, 2007-2010, 2011-2012 Synopsys, Inc. (www.synopsys.com)
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License version 2 as
|
||||
* published by the Free Software Foundation.
|
||||
*/
|
||||
|
||||
#ifndef __ASM_BARRIER_H
|
||||
#define __ASM_BARRIER_H
|
||||
|
||||
#ifndef __ASSEMBLY__
|
||||
|
||||
/* TODO-vineetg: Need to see what this does, don't we need sync anywhere */
|
||||
#define mb() __asm__ __volatile__ ("" : : : "memory")
|
||||
#define rmb() mb()
|
||||
#define wmb() mb()
|
||||
#define set_mb(var, value) do { var = value; mb(); } while (0)
|
||||
#define set_wmb(var, value) do { var = value; wmb(); } while (0)
|
||||
#define read_barrier_depends() mb()
|
||||
|
||||
/* TODO-vineetg verify the correctness of macros here */
|
||||
#ifdef CONFIG_SMP
|
||||
#define smp_mb() mb()
|
||||
#define smp_rmb() rmb()
|
||||
#define smp_wmb() wmb()
|
||||
#else
|
||||
#define smp_mb() barrier()
|
||||
#define smp_rmb() barrier()
|
||||
#define smp_wmb() barrier()
|
||||
#endif
|
||||
|
||||
#define smp_read_barrier_depends() do { } while (0)
|
||||
|
||||
#endif
|
||||
|
||||
#endif
|
||||
@@ -13,20 +13,6 @@
|
||||
|
||||
#define ASM_NL ` /* use '`' to mark new line in macro */
|
||||
|
||||
/* Can't use the ENTRY macro in linux/linkage.h
|
||||
* gas considers ';' as comment vs. newline
|
||||
*/
|
||||
.macro ARC_ENTRY name
|
||||
.global \name
|
||||
.align 4
|
||||
\name:
|
||||
.endm
|
||||
|
||||
.macro ARC_EXIT name
|
||||
#define ASM_PREV_SYM_ADDR(name) .-##name
|
||||
.size \ name, ASM_PREV_SYM_ADDR(\name)
|
||||
.endm
|
||||
|
||||
/* annotation for data we want in DCCM - if enabled in .config */
|
||||
.macro ARCFP_DATA nm
|
||||
#ifdef CONFIG_ARC_HAS_DCCM
|
||||
|
||||
@@ -10,9 +10,9 @@
|
||||
* -This is the more "natural" hand written assembler
|
||||
*/
|
||||
|
||||
#include <linux/linkage.h>
|
||||
#include <asm/entry.h> /* For the SAVE_* macros */
|
||||
#include <asm/asm-offsets.h>
|
||||
#include <asm/linkage.h>
|
||||
|
||||
#define KSP_WORD_OFF ((TASK_THREAD + THREAD_KSP) / 4)
|
||||
|
||||
@@ -62,4 +62,4 @@ __switch_to:
|
||||
ld.ab blink, [sp, 4]
|
||||
j [blink]
|
||||
|
||||
ARC_EXIT __switch_to
|
||||
END(__switch_to)
|
||||
|
||||
@@ -141,7 +141,7 @@ VECTOR EV_Extension ; 0x130, Extn Intruction Excp (0x26)
|
||||
VECTOR reserved ; Reserved Exceptions
|
||||
.endr
|
||||
|
||||
#include <linux/linkage.h> /* ARC_{EXTRY,EXIT} */
|
||||
#include <linux/linkage.h> /* {EXTRY,EXIT} */
|
||||
#include <asm/entry.h> /* SAVE_ALL_{INT1,INT2,SYS...} */
|
||||
#include <asm/errno.h>
|
||||
#include <asm/arcregs.h>
|
||||
@@ -184,7 +184,7 @@ reserved: ; processor restart
|
||||
; ---------------------------------------------
|
||||
; Level 2 ISR: Can interrupt a Level 1 ISR
|
||||
; ---------------------------------------------
|
||||
ARC_ENTRY handle_interrupt_level2
|
||||
ENTRY(handle_interrupt_level2)
|
||||
|
||||
; TODO-vineetg for SMP this wont work
|
||||
; free up r9 as scratchpad
|
||||
@@ -225,14 +225,14 @@ ARC_ENTRY handle_interrupt_level2
|
||||
|
||||
b ret_from_exception
|
||||
|
||||
ARC_EXIT handle_interrupt_level2
|
||||
END(handle_interrupt_level2)
|
||||
|
||||
#endif
|
||||
|
||||
; ---------------------------------------------
|
||||
; Level 1 ISR
|
||||
; ---------------------------------------------
|
||||
ARC_ENTRY handle_interrupt_level1
|
||||
ENTRY(handle_interrupt_level1)
|
||||
|
||||
/* free up r9 as scratchpad */
|
||||
#ifdef CONFIG_SMP
|
||||
@@ -265,7 +265,7 @@ ARC_ENTRY handle_interrupt_level1
|
||||
sr r8, [AUX_IRQ_LV12] ; clear bit in Sticky Status Reg
|
||||
|
||||
b ret_from_exception
|
||||
ARC_EXIT handle_interrupt_level1
|
||||
END(handle_interrupt_level1)
|
||||
|
||||
;################### Non TLB Exception Handling #############################
|
||||
|
||||
@@ -273,7 +273,7 @@ ARC_EXIT handle_interrupt_level1
|
||||
; Instruction Error Exception Handler
|
||||
; ---------------------------------------------
|
||||
|
||||
ARC_ENTRY instr_service
|
||||
ENTRY(instr_service)
|
||||
|
||||
EXCEPTION_PROLOGUE
|
||||
|
||||
@@ -284,13 +284,13 @@ ARC_ENTRY instr_service
|
||||
|
||||
bl do_insterror_or_kprobe
|
||||
b ret_from_exception
|
||||
ARC_EXIT instr_service
|
||||
END(instr_service)
|
||||
|
||||
; ---------------------------------------------
|
||||
; Memory Error Exception Handler
|
||||
; ---------------------------------------------
|
||||
|
||||
ARC_ENTRY mem_service
|
||||
ENTRY(mem_service)
|
||||
|
||||
EXCEPTION_PROLOGUE
|
||||
|
||||
@@ -301,13 +301,13 @@ ARC_ENTRY mem_service
|
||||
|
||||
bl do_memory_error
|
||||
b ret_from_exception
|
||||
ARC_EXIT mem_service
|
||||
END(mem_service)
|
||||
|
||||
; ---------------------------------------------
|
||||
; Machine Check Exception Handler
|
||||
; ---------------------------------------------
|
||||
|
||||
ARC_ENTRY EV_MachineCheck
|
||||
ENTRY(EV_MachineCheck)
|
||||
|
||||
EXCEPTION_PROLOGUE
|
||||
|
||||
@@ -331,13 +331,13 @@ ARC_ENTRY EV_MachineCheck
|
||||
|
||||
j do_machine_check_fault
|
||||
|
||||
ARC_EXIT EV_MachineCheck
|
||||
END(EV_MachineCheck)
|
||||
|
||||
; ---------------------------------------------
|
||||
; Protection Violation Exception Handler
|
||||
; ---------------------------------------------
|
||||
|
||||
ARC_ENTRY EV_TLBProtV
|
||||
ENTRY(EV_TLBProtV)
|
||||
|
||||
EXCEPTION_PROLOGUE
|
||||
|
||||
@@ -385,12 +385,12 @@ ARC_ENTRY EV_TLBProtV
|
||||
|
||||
b ret_from_exception
|
||||
|
||||
ARC_EXIT EV_TLBProtV
|
||||
END(EV_TLBProtV)
|
||||
|
||||
; ---------------------------------------------
|
||||
; Privilege Violation Exception Handler
|
||||
; ---------------------------------------------
|
||||
ARC_ENTRY EV_PrivilegeV
|
||||
ENTRY(EV_PrivilegeV)
|
||||
|
||||
EXCEPTION_PROLOGUE
|
||||
|
||||
@@ -401,12 +401,12 @@ ARC_ENTRY EV_PrivilegeV
|
||||
|
||||
bl do_privilege_fault
|
||||
b ret_from_exception
|
||||
ARC_EXIT EV_PrivilegeV
|
||||
END(EV_PrivilegeV)
|
||||
|
||||
; ---------------------------------------------
|
||||
; Extension Instruction Exception Handler
|
||||
; ---------------------------------------------
|
||||
ARC_ENTRY EV_Extension
|
||||
ENTRY(EV_Extension)
|
||||
|
||||
EXCEPTION_PROLOGUE
|
||||
|
||||
@@ -417,7 +417,7 @@ ARC_ENTRY EV_Extension
|
||||
|
||||
bl do_extension_fault
|
||||
b ret_from_exception
|
||||
ARC_EXIT EV_Extension
|
||||
END(EV_Extension)
|
||||
|
||||
;######################### System Call Tracing #########################
|
||||
|
||||
@@ -504,7 +504,7 @@ trap_with_param:
|
||||
; (2) Break Points
|
||||
;------------------------------------------------------------------
|
||||
|
||||
ARC_ENTRY EV_Trap
|
||||
ENTRY(EV_Trap)
|
||||
|
||||
EXCEPTION_PROLOGUE
|
||||
|
||||
@@ -534,9 +534,9 @@ ARC_ENTRY EV_Trap
|
||||
jl [r9] ; Entry into Sys Call Handler
|
||||
|
||||
; fall through to ret_from_system_call
|
||||
ARC_EXIT EV_Trap
|
||||
END(EV_Trap)
|
||||
|
||||
ARC_ENTRY ret_from_system_call
|
||||
ENTRY(ret_from_system_call)
|
||||
|
||||
st r0, [sp, PT_r0] ; sys call return value in pt_regs
|
||||
|
||||
@@ -546,7 +546,7 @@ ARC_ENTRY ret_from_system_call
|
||||
;
|
||||
; If ret to user mode do we need to handle signals, schedule() et al.
|
||||
|
||||
ARC_ENTRY ret_from_exception
|
||||
ENTRY(ret_from_exception)
|
||||
|
||||
; Pre-{IRQ,Trap,Exception} K/U mode from pt_regs->status32
|
||||
ld r8, [sp, PT_status32] ; returning to User/Kernel Mode
|
||||
@@ -728,9 +728,9 @@ not_level1_interrupt:
|
||||
debug_marker_syscall:
|
||||
rtie
|
||||
|
||||
ARC_EXIT ret_from_exception
|
||||
END(ret_from_exception)
|
||||
|
||||
ARC_ENTRY ret_from_fork
|
||||
ENTRY(ret_from_fork)
|
||||
; when the forked child comes here from the __switch_to function
|
||||
; r0 has the last task pointer.
|
||||
; put last task in scheduler queue
|
||||
@@ -747,11 +747,11 @@ ARC_ENTRY ret_from_fork
|
||||
; special case of kernel_thread entry point returning back due to
|
||||
; kernel_execve() - pretend return from syscall to ret to userland
|
||||
b ret_from_exception
|
||||
ARC_EXIT ret_from_fork
|
||||
END(ret_from_fork)
|
||||
|
||||
;################### Special Sys Call Wrappers ##########################
|
||||
|
||||
ARC_ENTRY sys_clone_wrapper
|
||||
ENTRY(sys_clone_wrapper)
|
||||
SAVE_CALLEE_SAVED_USER
|
||||
bl @sys_clone
|
||||
DISCARD_CALLEE_SAVED_USER
|
||||
@@ -761,7 +761,7 @@ ARC_ENTRY sys_clone_wrapper
|
||||
bnz tracesys_exit
|
||||
|
||||
b ret_from_system_call
|
||||
ARC_EXIT sys_clone_wrapper
|
||||
END(sys_clone_wrapper)
|
||||
|
||||
#ifdef CONFIG_ARC_DW2_UNWIND
|
||||
; Workaround for bug 94179 (STAR ):
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
* published by the Free Software Foundation.
|
||||
*/
|
||||
|
||||
#include <asm/linkage.h>
|
||||
#include <linux/linkage.h>
|
||||
|
||||
#ifdef __LITTLE_ENDIAN__
|
||||
#define WORD2 r2
|
||||
@@ -16,7 +16,7 @@
|
||||
#define SHIFT r2
|
||||
#endif
|
||||
|
||||
ARC_ENTRY memcmp
|
||||
ENTRY(memcmp)
|
||||
or r12,r0,r1
|
||||
asl_s r12,r12,30
|
||||
sub r3,r2,1
|
||||
@@ -121,4 +121,4 @@ ARC_ENTRY memcmp
|
||||
.Lnil:
|
||||
j_s.d [blink]
|
||||
mov r0,0
|
||||
ARC_EXIT memcmp
|
||||
END(memcmp)
|
||||
|
||||
@@ -6,9 +6,9 @@
|
||||
* published by the Free Software Foundation.
|
||||
*/
|
||||
|
||||
#include <asm/linkage.h>
|
||||
#include <linux/linkage.h>
|
||||
|
||||
ARC_ENTRY memcpy
|
||||
ENTRY(memcpy)
|
||||
or r3,r0,r1
|
||||
asl_s r3,r3,30
|
||||
mov_s r5,r0
|
||||
@@ -63,4 +63,4 @@ ARC_ENTRY memcpy
|
||||
.Lendbloop:
|
||||
j_s.d [blink]
|
||||
stb r12,[r5,0]
|
||||
ARC_EXIT memcpy
|
||||
END(memcpy)
|
||||
|
||||
@@ -6,11 +6,11 @@
|
||||
* published by the Free Software Foundation.
|
||||
*/
|
||||
|
||||
#include <asm/linkage.h>
|
||||
#include <linux/linkage.h>
|
||||
|
||||
#define SMALL 7 /* Must be at least 6 to deal with alignment/loop issues. */
|
||||
|
||||
ARC_ENTRY memset
|
||||
ENTRY(memset)
|
||||
mov_s r4,r0
|
||||
or r12,r0,r2
|
||||
bmsk.f r12,r12,1
|
||||
@@ -46,14 +46,14 @@ ARC_ENTRY memset
|
||||
stb.ab r1,[r4,1]
|
||||
.Ltiny_end:
|
||||
j_s [blink]
|
||||
ARC_EXIT memset
|
||||
END(memset)
|
||||
|
||||
; memzero: @r0 = mem, @r1 = size_t
|
||||
; memset: @r0 = mem, @r1 = char, @r2 = size_t
|
||||
|
||||
ARC_ENTRY memzero
|
||||
ENTRY(memzero)
|
||||
; adjust bzero args to memset args
|
||||
mov r2, r1
|
||||
mov r1, 0
|
||||
b memset ;tail call so need to tinker with blink
|
||||
ARC_EXIT memzero
|
||||
END(memzero)
|
||||
|
||||
@@ -11,9 +11,9 @@
|
||||
presence of the norm instruction makes it easier to operate on whole
|
||||
words branch-free. */
|
||||
|
||||
#include <asm/linkage.h>
|
||||
#include <linux/linkage.h>
|
||||
|
||||
ARC_ENTRY strchr
|
||||
ENTRY(strchr)
|
||||
extb_s r1,r1
|
||||
asl r5,r1,8
|
||||
bmsk r2,r0,1
|
||||
@@ -130,4 +130,4 @@ ARC_ENTRY strchr
|
||||
j_s.d [blink]
|
||||
mov.mi r0,0
|
||||
#endif /* ENDIAN */
|
||||
ARC_EXIT strchr
|
||||
END(strchr)
|
||||
|
||||
@@ -13,9 +13,9 @@
|
||||
source 1; however, that would increase the overhead for loop setup / finish,
|
||||
and strcmp might often terminate early. */
|
||||
|
||||
#include <asm/linkage.h>
|
||||
#include <linux/linkage.h>
|
||||
|
||||
ARC_ENTRY strcmp
|
||||
ENTRY(strcmp)
|
||||
or r2,r0,r1
|
||||
bmsk_s r2,r2,1
|
||||
brne r2,0,.Lcharloop
|
||||
@@ -93,4 +93,4 @@ ARC_ENTRY strcmp
|
||||
.Lcmpend:
|
||||
j_s.d [blink]
|
||||
sub r0,r2,r3
|
||||
ARC_EXIT strcmp
|
||||
END(strcmp)
|
||||
|
||||
@@ -16,9 +16,9 @@
|
||||
there, but the it is not likely to be taken often, and it
|
||||
would also be likey to cost an unaligned mispredict at the next call. */
|
||||
|
||||
#include <asm/linkage.h>
|
||||
#include <linux/linkage.h>
|
||||
|
||||
ARC_ENTRY strcpy
|
||||
ENTRY(strcpy)
|
||||
or r2,r0,r1
|
||||
bmsk_s r2,r2,1
|
||||
brne.d r2,0,charloop
|
||||
@@ -67,4 +67,4 @@ charloop:
|
||||
brne.d r3,0,charloop
|
||||
stb.ab r3,[r10,1]
|
||||
j [blink]
|
||||
ARC_EXIT strcpy
|
||||
END(strcpy)
|
||||
|
||||
@@ -6,9 +6,9 @@
|
||||
* published by the Free Software Foundation.
|
||||
*/
|
||||
|
||||
#include <asm/linkage.h>
|
||||
#include <linux/linkage.h>
|
||||
|
||||
ARC_ENTRY strlen
|
||||
ENTRY(strlen)
|
||||
or r3,r0,7
|
||||
ld r2,[r3,-7]
|
||||
ld.a r6,[r3,-3]
|
||||
@@ -80,4 +80,4 @@ ARC_ENTRY strlen
|
||||
.Learly_end:
|
||||
b.d .Lend
|
||||
sub_s.ne r1,r1,r1
|
||||
ARC_EXIT strlen
|
||||
END(strlen)
|
||||
|
||||
@@ -260,7 +260,7 @@ ARCFP_CODE ;Fast Path Code, candidate for ICCM
|
||||
; I-TLB Miss Exception Handler
|
||||
;-----------------------------------------------------------------------------
|
||||
|
||||
ARC_ENTRY EV_TLBMissI
|
||||
ENTRY(EV_TLBMissI)
|
||||
|
||||
TLBMISS_FREEUP_REGS
|
||||
|
||||
@@ -293,13 +293,13 @@ ARC_ENTRY EV_TLBMissI
|
||||
TLBMISS_RESTORE_REGS
|
||||
rtie
|
||||
|
||||
ARC_EXIT EV_TLBMissI
|
||||
END(EV_TLBMissI)
|
||||
|
||||
;-----------------------------------------------------------------------------
|
||||
; D-TLB Miss Exception Handler
|
||||
;-----------------------------------------------------------------------------
|
||||
|
||||
ARC_ENTRY EV_TLBMissD
|
||||
ENTRY(EV_TLBMissD)
|
||||
|
||||
TLBMISS_FREEUP_REGS
|
||||
|
||||
@@ -381,6 +381,4 @@ do_slow_path_pf:
|
||||
bl do_page_fault
|
||||
b ret_from_exception
|
||||
|
||||
ARC_EXIT EV_TLBMissD
|
||||
|
||||
ARC_ENTRY EV_TLBMissB ; Bogus entry to measure sz of DTLBMiss hdlr
|
||||
END(EV_TLBMissD)
|
||||
|
||||
@@ -158,7 +158,7 @@
|
||||
#size-cells = <0>;
|
||||
compatible = "fsl,imx25-cspi", "fsl,imx35-cspi";
|
||||
reg = <0x43fa4000 0x4000>;
|
||||
clocks = <&clks 62>, <&clks 62>;
|
||||
clocks = <&clks 78>, <&clks 78>;
|
||||
clock-names = "ipg", "per";
|
||||
interrupts = <14>;
|
||||
status = "disabled";
|
||||
@@ -352,7 +352,7 @@
|
||||
compatible = "fsl,imx25-pwm", "fsl,imx27-pwm";
|
||||
#pwm-cells = <2>;
|
||||
reg = <0x53fa0000 0x4000>;
|
||||
clocks = <&clks 106>, <&clks 36>;
|
||||
clocks = <&clks 106>, <&clks 52>;
|
||||
clock-names = "ipg", "per";
|
||||
interrupts = <36>;
|
||||
};
|
||||
@@ -371,7 +371,7 @@
|
||||
compatible = "fsl,imx25-pwm", "fsl,imx27-pwm";
|
||||
#pwm-cells = <2>;
|
||||
reg = <0x53fa8000 0x4000>;
|
||||
clocks = <&clks 107>, <&clks 36>;
|
||||
clocks = <&clks 107>, <&clks 52>;
|
||||
clock-names = "ipg", "per";
|
||||
interrupts = <41>;
|
||||
};
|
||||
@@ -412,7 +412,7 @@
|
||||
pwm4: pwm@53fc8000 {
|
||||
compatible = "fsl,imx25-pwm", "fsl,imx27-pwm";
|
||||
reg = <0x53fc8000 0x4000>;
|
||||
clocks = <&clks 108>, <&clks 36>;
|
||||
clocks = <&clks 108>, <&clks 52>;
|
||||
clock-names = "ipg", "per";
|
||||
interrupts = <42>;
|
||||
};
|
||||
@@ -458,7 +458,7 @@
|
||||
compatible = "fsl,imx25-pwm", "fsl,imx27-pwm";
|
||||
#pwm-cells = <2>;
|
||||
reg = <0x53fe0000 0x4000>;
|
||||
clocks = <&clks 105>, <&clks 36>;
|
||||
clocks = <&clks 105>, <&clks 52>;
|
||||
clock-names = "ipg", "per";
|
||||
interrupts = <26>;
|
||||
};
|
||||
|
||||
@@ -46,5 +46,3 @@
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
#include <testcases.dtsi>
|
||||
|
||||
@@ -427,205 +427,6 @@
|
||||
};
|
||||
};
|
||||
|
||||
etb@0,20010000 {
|
||||
compatible = "arm,coresight-etb10", "arm,primecell";
|
||||
reg = <0 0x20010000 0 0x1000>;
|
||||
|
||||
coresight-default-sink;
|
||||
clocks = <&oscclk6a>;
|
||||
clock-names = "apb_pclk";
|
||||
port {
|
||||
etb_in_port: endpoint@0 {
|
||||
slave-mode;
|
||||
remote-endpoint = <&replicator_out_port0>;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
tpiu@0,20030000 {
|
||||
compatible = "arm,coresight-tpiu", "arm,primecell";
|
||||
reg = <0 0x20030000 0 0x1000>;
|
||||
|
||||
clocks = <&oscclk6a>;
|
||||
clock-names = "apb_pclk";
|
||||
port {
|
||||
tpiu_in_port: endpoint@0 {
|
||||
slave-mode;
|
||||
remote-endpoint = <&replicator_out_port1>;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
replicator {
|
||||
/* non-configurable replicators don't show up on the
|
||||
* AMBA bus. As such no need to add "arm,primecell".
|
||||
*/
|
||||
compatible = "arm,coresight-replicator";
|
||||
|
||||
ports {
|
||||
#address-cells = <1>;
|
||||
#size-cells = <0>;
|
||||
|
||||
/* replicator output ports */
|
||||
port@0 {
|
||||
reg = <0>;
|
||||
replicator_out_port0: endpoint {
|
||||
remote-endpoint = <&etb_in_port>;
|
||||
};
|
||||
};
|
||||
|
||||
port@1 {
|
||||
reg = <1>;
|
||||
replicator_out_port1: endpoint {
|
||||
remote-endpoint = <&tpiu_in_port>;
|
||||
};
|
||||
};
|
||||
|
||||
/* replicator input port */
|
||||
port@2 {
|
||||
reg = <0>;
|
||||
replicator_in_port0: endpoint {
|
||||
slave-mode;
|
||||
remote-endpoint = <&funnel_out_port0>;
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
funnel@0,20040000 {
|
||||
compatible = "arm,coresight-funnel", "arm,primecell";
|
||||
reg = <0 0x20040000 0 0x1000>;
|
||||
|
||||
clocks = <&oscclk6a>;
|
||||
clock-names = "apb_pclk";
|
||||
ports {
|
||||
#address-cells = <1>;
|
||||
#size-cells = <0>;
|
||||
|
||||
/* funnel output port */
|
||||
port@0 {
|
||||
reg = <0>;
|
||||
funnel_out_port0: endpoint {
|
||||
remote-endpoint =
|
||||
<&replicator_in_port0>;
|
||||
};
|
||||
};
|
||||
|
||||
/* funnel input ports */
|
||||
port@1 {
|
||||
reg = <0>;
|
||||
funnel_in_port0: endpoint {
|
||||
slave-mode;
|
||||
remote-endpoint = <&ptm0_out_port>;
|
||||
};
|
||||
};
|
||||
|
||||
port@2 {
|
||||
reg = <1>;
|
||||
funnel_in_port1: endpoint {
|
||||
slave-mode;
|
||||
remote-endpoint = <&ptm1_out_port>;
|
||||
};
|
||||
};
|
||||
|
||||
port@3 {
|
||||
reg = <2>;
|
||||
funnel_in_port2: endpoint {
|
||||
slave-mode;
|
||||
remote-endpoint = <&etm0_out_port>;
|
||||
};
|
||||
};
|
||||
|
||||
/* Input port #3 is for ITM, not supported here */
|
||||
|
||||
port@4 {
|
||||
reg = <4>;
|
||||
funnel_in_port4: endpoint {
|
||||
slave-mode;
|
||||
remote-endpoint = <&etm1_out_port>;
|
||||
};
|
||||
};
|
||||
|
||||
port@5 {
|
||||
reg = <5>;
|
||||
funnel_in_port5: endpoint {
|
||||
slave-mode;
|
||||
remote-endpoint = <&etm2_out_port>;
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
ptm@0,2201c000 {
|
||||
compatible = "arm,coresight-etm3x", "arm,primecell";
|
||||
reg = <0 0x2201c000 0 0x1000>;
|
||||
|
||||
cpu = <&cpu0>;
|
||||
clocks = <&oscclk6a>;
|
||||
clock-names = "apb_pclk";
|
||||
port {
|
||||
ptm0_out_port: endpoint {
|
||||
remote-endpoint = <&funnel_in_port0>;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
ptm@0,2201d000 {
|
||||
compatible = "arm,coresight-etm3x", "arm,primecell";
|
||||
reg = <0 0x2201d000 0 0x1000>;
|
||||
|
||||
cpu = <&cpu1>;
|
||||
clocks = <&oscclk6a>;
|
||||
clock-names = "apb_pclk";
|
||||
port {
|
||||
ptm1_out_port: endpoint {
|
||||
remote-endpoint = <&funnel_in_port1>;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
etm@0,2203c000 {
|
||||
compatible = "arm,coresight-etm3x", "arm,primecell";
|
||||
reg = <0 0x2203c000 0 0x1000>;
|
||||
|
||||
cpu = <&cpu2>;
|
||||
clocks = <&oscclk6a>;
|
||||
clock-names = "apb_pclk";
|
||||
port {
|
||||
etm0_out_port: endpoint {
|
||||
remote-endpoint = <&funnel_in_port2>;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
etm@0,2203d000 {
|
||||
compatible = "arm,coresight-etm3x", "arm,primecell";
|
||||
reg = <0 0x2203d000 0 0x1000>;
|
||||
|
||||
cpu = <&cpu3>;
|
||||
clocks = <&oscclk6a>;
|
||||
clock-names = "apb_pclk";
|
||||
port {
|
||||
etm1_out_port: endpoint {
|
||||
remote-endpoint = <&funnel_in_port4>;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
etm@0,2203e000 {
|
||||
compatible = "arm,coresight-etm3x", "arm,primecell";
|
||||
reg = <0 0x2203e000 0 0x1000>;
|
||||
|
||||
cpu = <&cpu4>;
|
||||
clocks = <&oscclk6a>;
|
||||
clock-names = "apb_pclk";
|
||||
port {
|
||||
etm2_out_port: endpoint {
|
||||
remote-endpoint = <&funnel_in_port5>;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
smb {
|
||||
compatible = "simple-bus";
|
||||
|
||||
|
||||
@@ -93,6 +93,6 @@ module_exit(aes_fini);
|
||||
|
||||
MODULE_DESCRIPTION("Rijndael (AES) Cipher Algorithm (ASM)");
|
||||
MODULE_LICENSE("GPL");
|
||||
MODULE_ALIAS("aes");
|
||||
MODULE_ALIAS("aes-asm");
|
||||
MODULE_ALIAS_CRYPTO("aes");
|
||||
MODULE_ALIAS_CRYPTO("aes-asm");
|
||||
MODULE_AUTHOR("David McCullough <ucdevel@gmail.com>");
|
||||
|
||||
@@ -171,5 +171,5 @@ module_exit(sha1_mod_fini);
|
||||
|
||||
MODULE_LICENSE("GPL");
|
||||
MODULE_DESCRIPTION("SHA1 Secure Hash Algorithm (ARM)");
|
||||
MODULE_ALIAS("sha1");
|
||||
MODULE_ALIAS_CRYPTO("sha1");
|
||||
MODULE_AUTHOR("David McCullough <ucdevel@gmail.com>");
|
||||
|
||||
@@ -161,8 +161,8 @@ static void __init imx6q_clocks_init(struct device_node *ccm_node)
|
||||
post_div_table[1].div = 1;
|
||||
post_div_table[2].div = 1;
|
||||
video_div_table[1].div = 1;
|
||||
video_div_table[2].div = 1;
|
||||
};
|
||||
video_div_table[3].div = 1;
|
||||
}
|
||||
|
||||
/* type name parent_name base div_mask */
|
||||
clk[pll1_sys] = imx_clk_pllv3(IMX_PLLV3_SYS, "pll1_sys", "osc", base, 0x7f);
|
||||
|
||||
@@ -513,11 +513,11 @@ static void __init realtime_counter_init(void)
|
||||
rate = clk_get_rate(sys_clk);
|
||||
/* Numerator/denumerator values refer TRM Realtime Counter section */
|
||||
switch (rate) {
|
||||
case 1200000:
|
||||
case 12000000:
|
||||
num = 64;
|
||||
den = 125;
|
||||
break;
|
||||
case 1300000:
|
||||
case 13000000:
|
||||
num = 768;
|
||||
den = 1625;
|
||||
break;
|
||||
@@ -529,11 +529,11 @@ static void __init realtime_counter_init(void)
|
||||
num = 192;
|
||||
den = 625;
|
||||
break;
|
||||
case 2600000:
|
||||
case 26000000:
|
||||
num = 384;
|
||||
den = 1625;
|
||||
break;
|
||||
case 2700000:
|
||||
case 27000000:
|
||||
num = 256;
|
||||
den = 1125;
|
||||
break;
|
||||
|
||||
@@ -617,6 +617,7 @@ static struct platform_device ipmmu_device = {
|
||||
|
||||
static struct renesas_intc_irqpin_config irqpin0_platform_data = {
|
||||
.irq_base = irq_pin(0), /* IRQ0 -> IRQ7 */
|
||||
.control_parent = true,
|
||||
};
|
||||
|
||||
static struct resource irqpin0_resources[] = {
|
||||
@@ -678,6 +679,7 @@ static struct platform_device irqpin1_device = {
|
||||
|
||||
static struct renesas_intc_irqpin_config irqpin2_platform_data = {
|
||||
.irq_base = irq_pin(16), /* IRQ16 -> IRQ23 */
|
||||
.control_parent = true,
|
||||
};
|
||||
|
||||
static struct resource irqpin2_resources[] = {
|
||||
@@ -708,6 +710,7 @@ static struct platform_device irqpin2_device = {
|
||||
|
||||
static struct renesas_intc_irqpin_config irqpin3_platform_data = {
|
||||
.irq_base = irq_pin(24), /* IRQ24 -> IRQ31 */
|
||||
.control_parent = true,
|
||||
};
|
||||
|
||||
static struct resource irqpin3_resources[] = {
|
||||
|
||||
@@ -465,12 +465,21 @@ void __init dma_contiguous_remap(void)
|
||||
map.type = MT_MEMORY_DMA_READY;
|
||||
|
||||
/*
|
||||
* Clear previous low-memory mapping
|
||||
* Clear previous low-memory mapping to ensure that the
|
||||
* TLB does not see any conflicting entries, then flush
|
||||
* the TLB of the old entries before creating new mappings.
|
||||
*
|
||||
* This ensures that any speculatively loaded TLB entries
|
||||
* (even though they may be rare) can not cause any problems,
|
||||
* and ensures that this code is architecturally compliant.
|
||||
*/
|
||||
for (addr = __phys_to_virt(start); addr < __phys_to_virt(end);
|
||||
addr += PMD_SIZE)
|
||||
pmd_clear(pmd_off_k(addr));
|
||||
|
||||
flush_tlb_kernel_range(__phys_to_virt(start),
|
||||
__phys_to_virt(end));
|
||||
|
||||
iotable_init(&map, 1);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -512,6 +512,20 @@ config BUILD_ARM64_APPENDED_DTB_IMAGE_NAMES
|
||||
Space separated list of names of dtbs to append when
|
||||
building a concatenated Image.gz-dtb.
|
||||
|
||||
config EFI
|
||||
bool "UEFI runtime support"
|
||||
depends on OF && !CPU_BIG_ENDIAN
|
||||
select LIBFDT
|
||||
select UCS2_STRING
|
||||
select EFI_PARAMS_FROM_FDT
|
||||
default y
|
||||
help
|
||||
This option provides support for runtime services provided
|
||||
by UEFI firmware (such as non-volatile variables, realtime
|
||||
clock, and platform reset). A UEFI stub is also provided to
|
||||
allow the kernel to be booted as an EFI application. This
|
||||
is only useful on systems that have UEFI firmware.
|
||||
|
||||
endmenu
|
||||
|
||||
menu "Userspace binary formats"
|
||||
@@ -566,6 +580,8 @@ source "net/Kconfig"
|
||||
|
||||
source "drivers/Kconfig"
|
||||
|
||||
source "drivers/firmware/Kconfig"
|
||||
|
||||
source "fs/Kconfig"
|
||||
|
||||
source "arch/arm64/kvm/Kconfig"
|
||||
|
||||
14
arch/arm64/include/asm/efi.h
Normal file
14
arch/arm64/include/asm/efi.h
Normal file
@@ -0,0 +1,14 @@
|
||||
#ifndef _ASM_EFI_H
|
||||
#define _ASM_EFI_H
|
||||
|
||||
#include <asm/io.h>
|
||||
|
||||
#ifdef CONFIG_EFI
|
||||
extern void efi_init(void);
|
||||
extern void efi_idmap_init(void);
|
||||
#else
|
||||
#define efi_init()
|
||||
#define efi_idmap_init()
|
||||
#endif
|
||||
|
||||
#endif /* _ASM_EFI_H */
|
||||
@@ -4,6 +4,8 @@
|
||||
|
||||
CPPFLAGS_vmlinux.lds := -DTEXT_OFFSET=$(TEXT_OFFSET)
|
||||
AFLAGS_head.o := -DTEXT_OFFSET=$(TEXT_OFFSET)
|
||||
CFLAGS_efi-stub.o := -DTEXT_OFFSET=$(TEXT_OFFSET) \
|
||||
-I$(src)/../../../scripts/dtc/libfdt
|
||||
|
||||
CFLAGS_REMOVE_ftrace.o = -pg
|
||||
CFLAGS_REMOVE_insn.o = -pg
|
||||
@@ -30,6 +32,7 @@ arm64-obj-$(CONFIG_ARM64_CPU_SUSPEND) += sleep.o suspend.o
|
||||
arm64-obj-$(CONFIG_ARM_CPU_SUSPEND) += sleep.o suspend.o
|
||||
arm64-obj-$(CONFIG_JUMP_LABEL) += jump_label.o
|
||||
arm64-obj-$(CONFIG_KGDB) += kgdb.o
|
||||
arm64-obj-$(CONFIG_EFI) += efi.o efi-stub.o efi-entry.o
|
||||
|
||||
arm64-obj-$(CONFIG_INSTABOOT) += hibernate.o
|
||||
|
||||
|
||||
109
arch/arm64/kernel/efi-entry.S
Normal file
109
arch/arm64/kernel/efi-entry.S
Normal file
@@ -0,0 +1,109 @@
|
||||
/*
|
||||
* EFI entry point.
|
||||
*
|
||||
* Copyright (C) 2013, 2014 Red Hat, Inc.
|
||||
* Author: Mark Salter <msalter@redhat.com>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License version 2 as
|
||||
* published by the Free Software Foundation.
|
||||
*
|
||||
*/
|
||||
#include <linux/linkage.h>
|
||||
#include <linux/init.h>
|
||||
|
||||
#include <asm/assembler.h>
|
||||
|
||||
#define EFI_LOAD_ERROR 0x8000000000000001
|
||||
|
||||
__INIT
|
||||
|
||||
/*
|
||||
* We arrive here from the EFI boot manager with:
|
||||
*
|
||||
* * CPU in little-endian mode
|
||||
* * MMU on with identity-mapped RAM
|
||||
* * Icache and Dcache on
|
||||
*
|
||||
* We will most likely be running from some place other than where
|
||||
* we want to be. The kernel image wants to be placed at TEXT_OFFSET
|
||||
* from start of RAM.
|
||||
*/
|
||||
ENTRY(efi_stub_entry)
|
||||
/*
|
||||
* Create a stack frame to save FP/LR with extra space
|
||||
* for image_addr variable passed to efi_entry().
|
||||
*/
|
||||
stp x29, x30, [sp, #-32]!
|
||||
|
||||
/*
|
||||
* Call efi_entry to do the real work.
|
||||
* x0 and x1 are already set up by firmware. Current runtime
|
||||
* address of image is calculated and passed via *image_addr.
|
||||
*
|
||||
* unsigned long efi_entry(void *handle,
|
||||
* efi_system_table_t *sys_table,
|
||||
* unsigned long *image_addr) ;
|
||||
*/
|
||||
adrp x8, _text
|
||||
add x8, x8, #:lo12:_text
|
||||
add x2, sp, 16
|
||||
str x8, [x2]
|
||||
bl efi_entry
|
||||
cmn x0, #1
|
||||
b.eq efi_load_fail
|
||||
|
||||
/*
|
||||
* efi_entry() will have relocated the kernel image if necessary
|
||||
* and we return here with device tree address in x0 and the kernel
|
||||
* entry point stored at *image_addr. Save those values in registers
|
||||
* which are callee preserved.
|
||||
*/
|
||||
mov x20, x0 // DTB address
|
||||
ldr x0, [sp, #16] // relocated _text address
|
||||
mov x21, x0
|
||||
|
||||
/*
|
||||
* Flush dcache covering current runtime addresses
|
||||
* of kernel text/data. Then flush all of icache.
|
||||
*/
|
||||
adrp x1, _text
|
||||
add x1, x1, #:lo12:_text
|
||||
adrp x2, _edata
|
||||
add x2, x2, #:lo12:_edata
|
||||
sub x1, x2, x1
|
||||
|
||||
bl __flush_dcache_area
|
||||
ic ialluis
|
||||
|
||||
/* Turn off Dcache and MMU */
|
||||
mrs x0, CurrentEL
|
||||
cmp x0, #PSR_MODE_EL2t
|
||||
ccmp x0, #PSR_MODE_EL2h, #0x4, ne
|
||||
b.ne 1f
|
||||
mrs x0, sctlr_el2
|
||||
bic x0, x0, #1 << 0 // clear SCTLR.M
|
||||
bic x0, x0, #1 << 2 // clear SCTLR.C
|
||||
msr sctlr_el2, x0
|
||||
isb
|
||||
b 2f
|
||||
1:
|
||||
mrs x0, sctlr_el1
|
||||
bic x0, x0, #1 << 0 // clear SCTLR.M
|
||||
bic x0, x0, #1 << 2 // clear SCTLR.C
|
||||
msr sctlr_el1, x0
|
||||
isb
|
||||
2:
|
||||
/* Jump to kernel entry point */
|
||||
mov x0, x20
|
||||
mov x1, xzr
|
||||
mov x2, xzr
|
||||
mov x3, xzr
|
||||
br x21
|
||||
|
||||
efi_load_fail:
|
||||
mov x0, #EFI_LOAD_ERROR
|
||||
ldp x29, x30, [sp], #32
|
||||
ret
|
||||
|
||||
ENDPROC(efi_stub_entry)
|
||||
79
arch/arm64/kernel/efi-stub.c
Normal file
79
arch/arm64/kernel/efi-stub.c
Normal file
@@ -0,0 +1,79 @@
|
||||
/*
|
||||
* Copyright (C) 2013, 2014 Linaro Ltd; <roy.franz@linaro.org>
|
||||
*
|
||||
* This file implements the EFI boot stub for the arm64 kernel.
|
||||
* Adapted from ARM version by Mark Salter <msalter@redhat.com>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License version 2 as
|
||||
* published by the Free Software Foundation.
|
||||
*
|
||||
*/
|
||||
#include <linux/efi.h>
|
||||
#include <linux/libfdt.h>
|
||||
#include <asm/sections.h>
|
||||
|
||||
/*
|
||||
* AArch64 requires the DTB to be 8-byte aligned in the first 512MiB from
|
||||
* start of kernel and may not cross a 2MiB boundary. We set alignment to
|
||||
* 2MiB so we know it won't cross a 2MiB boundary.
|
||||
*/
|
||||
#define EFI_FDT_ALIGN SZ_2M /* used by allocate_new_fdt_and_exit_boot() */
|
||||
#define MAX_FDT_OFFSET SZ_512M
|
||||
|
||||
#define efi_call_early(f, ...) sys_table_arg->boottime->f(__VA_ARGS__)
|
||||
|
||||
static void efi_char16_printk(efi_system_table_t *sys_table_arg,
|
||||
efi_char16_t *str);
|
||||
|
||||
static efi_status_t efi_open_volume(efi_system_table_t *sys_table,
|
||||
void *__image, void **__fh);
|
||||
static efi_status_t efi_file_close(void *handle);
|
||||
|
||||
static efi_status_t
|
||||
efi_file_read(void *handle, unsigned long *size, void *addr);
|
||||
|
||||
static efi_status_t
|
||||
efi_file_size(efi_system_table_t *sys_table, void *__fh,
|
||||
efi_char16_t *filename_16, void **handle, u64 *file_sz);
|
||||
|
||||
/* Include shared EFI stub code */
|
||||
#include "../../../drivers/firmware/efi/efi-stub-helper.c"
|
||||
#include "../../../drivers/firmware/efi/fdt.c"
|
||||
#include "../../../drivers/firmware/efi/arm-stub.c"
|
||||
|
||||
|
||||
static efi_status_t handle_kernel_image(efi_system_table_t *sys_table,
|
||||
unsigned long *image_addr,
|
||||
unsigned long *image_size,
|
||||
unsigned long *reserve_addr,
|
||||
unsigned long *reserve_size,
|
||||
unsigned long dram_base,
|
||||
efi_loaded_image_t *image)
|
||||
{
|
||||
efi_status_t status;
|
||||
unsigned long kernel_size, kernel_memsize = 0;
|
||||
|
||||
/* Relocate the image, if required. */
|
||||
kernel_size = _edata - _text;
|
||||
if (*image_addr != (dram_base + TEXT_OFFSET)) {
|
||||
kernel_memsize = kernel_size + (_end - _edata);
|
||||
status = efi_relocate_kernel(sys_table, image_addr,
|
||||
kernel_size, kernel_memsize,
|
||||
dram_base + TEXT_OFFSET,
|
||||
PAGE_SIZE);
|
||||
if (status != EFI_SUCCESS) {
|
||||
pr_efi_err(sys_table, "Failed to relocate kernel\n");
|
||||
return status;
|
||||
}
|
||||
if (*image_addr != (dram_base + TEXT_OFFSET)) {
|
||||
pr_efi_err(sys_table, "Failed to alloc kernel memory\n");
|
||||
efi_free(sys_table, kernel_memsize, *image_addr);
|
||||
return EFI_ERROR;
|
||||
}
|
||||
*image_size = kernel_memsize;
|
||||
}
|
||||
|
||||
|
||||
return EFI_SUCCESS;
|
||||
}
|
||||
469
arch/arm64/kernel/efi.c
Normal file
469
arch/arm64/kernel/efi.c
Normal file
@@ -0,0 +1,469 @@
|
||||
/*
|
||||
* Extensible Firmware Interface
|
||||
*
|
||||
* Based on Extensible Firmware Interface Specification version 2.4
|
||||
*
|
||||
* Copyright (C) 2013, 2014 Linaro Ltd.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License version 2 as
|
||||
* published by the Free Software Foundation.
|
||||
*
|
||||
*/
|
||||
|
||||
#include <linux/efi.h>
|
||||
#include <linux/export.h>
|
||||
#include <linux/memblock.h>
|
||||
#include <linux/bootmem.h>
|
||||
#include <linux/of.h>
|
||||
#include <linux/of_fdt.h>
|
||||
#include <linux/sched.h>
|
||||
#include <linux/slab.h>
|
||||
|
||||
#include <asm/cacheflush.h>
|
||||
#include <asm/efi.h>
|
||||
#include <asm/tlbflush.h>
|
||||
#include <asm/mmu_context.h>
|
||||
|
||||
struct efi_memory_map memmap;
|
||||
|
||||
static efi_runtime_services_t *runtime;
|
||||
|
||||
static u64 efi_system_table;
|
||||
|
||||
static int uefi_debug __initdata;
|
||||
static int __init uefi_debug_setup(char *str)
|
||||
{
|
||||
uefi_debug = 1;
|
||||
|
||||
return 0;
|
||||
}
|
||||
early_param("uefi_debug", uefi_debug_setup);
|
||||
|
||||
static int __init is_normal_ram(efi_memory_desc_t *md)
|
||||
{
|
||||
if (md->attribute & EFI_MEMORY_WB)
|
||||
return 1;
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void __init efi_setup_idmap(void)
|
||||
{
|
||||
struct memblock_region *r;
|
||||
efi_memory_desc_t *md;
|
||||
u64 paddr, npages, size;
|
||||
|
||||
for_each_memblock(memory, r)
|
||||
create_id_mapping(r->base, r->size, 0);
|
||||
|
||||
/* map runtime io spaces */
|
||||
for_each_efi_memory_desc(&memmap, md) {
|
||||
if (!(md->attribute & EFI_MEMORY_RUNTIME) || is_normal_ram(md))
|
||||
continue;
|
||||
paddr = md->phys_addr;
|
||||
npages = md->num_pages;
|
||||
memrange_efi_to_native(&paddr, &npages);
|
||||
size = npages << PAGE_SHIFT;
|
||||
create_id_mapping(paddr, size, 1);
|
||||
}
|
||||
}
|
||||
|
||||
static int __init uefi_init(void)
|
||||
{
|
||||
efi_char16_t *c16;
|
||||
char vendor[100] = "unknown";
|
||||
int i, retval;
|
||||
|
||||
efi.systab = early_memremap(efi_system_table,
|
||||
sizeof(efi_system_table_t));
|
||||
if (efi.systab == NULL) {
|
||||
pr_warn("Unable to map EFI system table.\n");
|
||||
return -ENOMEM;
|
||||
}
|
||||
|
||||
set_bit(EFI_BOOT, &efi.flags);
|
||||
set_bit(EFI_64BIT, &efi.flags);
|
||||
|
||||
/*
|
||||
* Verify the EFI Table
|
||||
*/
|
||||
if (efi.systab->hdr.signature != EFI_SYSTEM_TABLE_SIGNATURE) {
|
||||
pr_err("System table signature incorrect\n");
|
||||
return -EINVAL;
|
||||
}
|
||||
if ((efi.systab->hdr.revision >> 16) < 2)
|
||||
pr_warn("Warning: EFI system table version %d.%02d, expected 2.00 or greater\n",
|
||||
efi.systab->hdr.revision >> 16,
|
||||
efi.systab->hdr.revision & 0xffff);
|
||||
|
||||
/* Show what we know for posterity */
|
||||
c16 = early_memremap(efi.systab->fw_vendor,
|
||||
sizeof(vendor));
|
||||
if (c16) {
|
||||
for (i = 0; i < (int) sizeof(vendor) - 1 && *c16; ++i)
|
||||
vendor[i] = c16[i];
|
||||
vendor[i] = '\0';
|
||||
}
|
||||
|
||||
pr_info("EFI v%u.%.02u by %s\n",
|
||||
efi.systab->hdr.revision >> 16,
|
||||
efi.systab->hdr.revision & 0xffff, vendor);
|
||||
|
||||
retval = efi_config_init(NULL);
|
||||
if (retval == 0)
|
||||
set_bit(EFI_CONFIG_TABLES, &efi.flags);
|
||||
|
||||
early_memunmap(c16, sizeof(vendor));
|
||||
early_memunmap(efi.systab, sizeof(efi_system_table_t));
|
||||
|
||||
return retval;
|
||||
}
|
||||
|
||||
static __initdata char memory_type_name[][32] = {
|
||||
{"Reserved"},
|
||||
{"Loader Code"},
|
||||
{"Loader Data"},
|
||||
{"Boot Code"},
|
||||
{"Boot Data"},
|
||||
{"Runtime Code"},
|
||||
{"Runtime Data"},
|
||||
{"Conventional Memory"},
|
||||
{"Unusable Memory"},
|
||||
{"ACPI Reclaim Memory"},
|
||||
{"ACPI Memory NVS"},
|
||||
{"Memory Mapped I/O"},
|
||||
{"MMIO Port Space"},
|
||||
{"PAL Code"},
|
||||
};
|
||||
|
||||
/*
|
||||
* Return true for RAM regions we want to permanently reserve.
|
||||
*/
|
||||
static __init int is_reserve_region(efi_memory_desc_t *md)
|
||||
{
|
||||
if (!is_normal_ram(md))
|
||||
return 0;
|
||||
|
||||
if (md->attribute & EFI_MEMORY_RUNTIME)
|
||||
return 1;
|
||||
|
||||
if (md->type == EFI_ACPI_RECLAIM_MEMORY ||
|
||||
md->type == EFI_RESERVED_TYPE)
|
||||
return 1;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static __init void reserve_regions(void)
|
||||
{
|
||||
efi_memory_desc_t *md;
|
||||
u64 paddr, npages, size;
|
||||
|
||||
if (uefi_debug)
|
||||
pr_info("Processing EFI memory map:\n");
|
||||
|
||||
for_each_efi_memory_desc(&memmap, md) {
|
||||
paddr = md->phys_addr;
|
||||
npages = md->num_pages;
|
||||
|
||||
if (uefi_debug)
|
||||
pr_info(" 0x%012llx-0x%012llx [%s]",
|
||||
paddr, paddr + (npages << EFI_PAGE_SHIFT) - 1,
|
||||
memory_type_name[md->type]);
|
||||
|
||||
memrange_efi_to_native(&paddr, &npages);
|
||||
size = npages << PAGE_SHIFT;
|
||||
|
||||
if (is_normal_ram(md))
|
||||
early_init_dt_add_memory_arch(paddr, size);
|
||||
|
||||
if (is_reserve_region(md) ||
|
||||
md->type == EFI_BOOT_SERVICES_CODE ||
|
||||
md->type == EFI_BOOT_SERVICES_DATA) {
|
||||
memblock_reserve(paddr, size);
|
||||
if (uefi_debug)
|
||||
pr_cont("*");
|
||||
}
|
||||
|
||||
if (uefi_debug)
|
||||
pr_cont("\n");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
static u64 __init free_one_region(u64 start, u64 end)
|
||||
{
|
||||
u64 size = end - start;
|
||||
|
||||
if (uefi_debug)
|
||||
pr_info(" EFI freeing: 0x%012llx-0x%012llx\n", start, end - 1);
|
||||
|
||||
free_bootmem_late(start, size);
|
||||
return size;
|
||||
}
|
||||
|
||||
static u64 __init free_region(u64 start, u64 end)
|
||||
{
|
||||
u64 map_start, map_end, total = 0;
|
||||
|
||||
if (end <= start)
|
||||
return total;
|
||||
|
||||
map_start = (u64)memmap.phys_map;
|
||||
map_end = PAGE_ALIGN(map_start + (memmap.map_end - memmap.map));
|
||||
map_start &= PAGE_MASK;
|
||||
|
||||
if (start < map_end && end > map_start) {
|
||||
/* region overlaps UEFI memmap */
|
||||
if (start < map_start)
|
||||
total += free_one_region(start, map_start);
|
||||
|
||||
if (map_end < end)
|
||||
total += free_one_region(map_end, end);
|
||||
} else
|
||||
total += free_one_region(start, end);
|
||||
|
||||
return total;
|
||||
}
|
||||
|
||||
static void __init free_boot_services(void)
|
||||
{
|
||||
u64 total_freed = 0;
|
||||
u64 keep_end, free_start, free_end;
|
||||
efi_memory_desc_t *md;
|
||||
|
||||
/*
|
||||
* If kernel uses larger pages than UEFI, we have to be careful
|
||||
* not to inadvertantly free memory we want to keep if there is
|
||||
* overlap at the kernel page size alignment. We do not want to
|
||||
* free is_reserve_region() memory nor the UEFI memmap itself.
|
||||
*
|
||||
* The memory map is sorted, so we keep track of the end of
|
||||
* any previous region we want to keep, remember any region
|
||||
* we want to free and defer freeing it until we encounter
|
||||
* the next region we want to keep. This way, before freeing
|
||||
* it, we can clip it as needed to avoid freeing memory we
|
||||
* want to keep for UEFI.
|
||||
*/
|
||||
|
||||
keep_end = 0;
|
||||
free_start = 0;
|
||||
|
||||
for_each_efi_memory_desc(&memmap, md) {
|
||||
u64 paddr, npages, size;
|
||||
|
||||
if (is_reserve_region(md)) {
|
||||
/*
|
||||
* We don't want to free any memory from this region.
|
||||
*/
|
||||
if (free_start) {
|
||||
/* adjust free_end then free region */
|
||||
if (free_end > md->phys_addr)
|
||||
free_end -= PAGE_SIZE;
|
||||
total_freed += free_region(free_start, free_end);
|
||||
free_start = 0;
|
||||
}
|
||||
keep_end = md->phys_addr + (md->num_pages << EFI_PAGE_SHIFT);
|
||||
continue;
|
||||
}
|
||||
|
||||
if (md->type != EFI_BOOT_SERVICES_CODE &&
|
||||
md->type != EFI_BOOT_SERVICES_DATA) {
|
||||
/* no need to free this region */
|
||||
continue;
|
||||
}
|
||||
|
||||
/*
|
||||
* We want to free memory from this region.
|
||||
*/
|
||||
paddr = md->phys_addr;
|
||||
npages = md->num_pages;
|
||||
memrange_efi_to_native(&paddr, &npages);
|
||||
size = npages << PAGE_SHIFT;
|
||||
|
||||
if (free_start) {
|
||||
if (paddr <= free_end)
|
||||
free_end = paddr + size;
|
||||
else {
|
||||
total_freed += free_region(free_start, free_end);
|
||||
free_start = paddr;
|
||||
free_end = paddr + size;
|
||||
}
|
||||
} else {
|
||||
free_start = paddr;
|
||||
free_end = paddr + size;
|
||||
}
|
||||
if (free_start < keep_end) {
|
||||
free_start += PAGE_SIZE;
|
||||
if (free_start >= free_end)
|
||||
free_start = 0;
|
||||
}
|
||||
}
|
||||
if (free_start)
|
||||
total_freed += free_region(free_start, free_end);
|
||||
|
||||
if (total_freed)
|
||||
pr_info("Freed 0x%llx bytes of EFI boot services memory",
|
||||
total_freed);
|
||||
}
|
||||
|
||||
void __init efi_init(void)
|
||||
{
|
||||
struct efi_fdt_params params;
|
||||
|
||||
/* Grab UEFI information placed in FDT by stub */
|
||||
if (!efi_get_fdt_params(¶ms, uefi_debug))
|
||||
return;
|
||||
|
||||
efi_system_table = params.system_table;
|
||||
|
||||
memblock_reserve(params.mmap & PAGE_MASK,
|
||||
PAGE_ALIGN(params.mmap_size + (params.mmap & ~PAGE_MASK)));
|
||||
memmap.phys_map = (void *)params.mmap;
|
||||
memmap.map = early_memremap(params.mmap, params.mmap_size);
|
||||
memmap.map_end = memmap.map + params.mmap_size;
|
||||
memmap.desc_size = params.desc_size;
|
||||
memmap.desc_version = params.desc_ver;
|
||||
|
||||
if (uefi_init() < 0)
|
||||
return;
|
||||
|
||||
reserve_regions();
|
||||
}
|
||||
|
||||
void __init efi_idmap_init(void)
|
||||
{
|
||||
if (!efi_enabled(EFI_BOOT))
|
||||
return;
|
||||
|
||||
/* boot time idmap_pg_dir is incomplete, so fill in missing parts */
|
||||
efi_setup_idmap();
|
||||
}
|
||||
|
||||
static int __init remap_region(efi_memory_desc_t *md, void **new)
|
||||
{
|
||||
u64 paddr, vaddr, npages, size;
|
||||
|
||||
paddr = md->phys_addr;
|
||||
npages = md->num_pages;
|
||||
memrange_efi_to_native(&paddr, &npages);
|
||||
size = npages << PAGE_SHIFT;
|
||||
|
||||
if (is_normal_ram(md))
|
||||
vaddr = (__force u64)ioremap_cache(paddr, size);
|
||||
else
|
||||
vaddr = (__force u64)ioremap(paddr, size);
|
||||
|
||||
if (!vaddr) {
|
||||
pr_err("Unable to remap 0x%llx pages @ %p\n",
|
||||
npages, (void *)paddr);
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* adjust for any rounding when EFI and system pagesize differs */
|
||||
md->virt_addr = vaddr + (md->phys_addr - paddr);
|
||||
|
||||
if (uefi_debug)
|
||||
pr_info(" EFI remap 0x%012llx => %p\n",
|
||||
md->phys_addr, (void *)md->virt_addr);
|
||||
|
||||
memcpy(*new, md, memmap.desc_size);
|
||||
*new += memmap.desc_size;
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
/*
|
||||
* Switch UEFI from an identity map to a kernel virtual map
|
||||
*/
|
||||
static int __init arm64_enter_virtual_mode(void)
|
||||
{
|
||||
efi_memory_desc_t *md;
|
||||
phys_addr_t virtmap_phys;
|
||||
void *virtmap, *virt_md;
|
||||
efi_status_t status;
|
||||
u64 mapsize;
|
||||
int count = 0;
|
||||
unsigned long flags;
|
||||
|
||||
if (!efi_enabled(EFI_BOOT)) {
|
||||
pr_info("EFI services will not be available.\n");
|
||||
return -1;
|
||||
}
|
||||
|
||||
pr_info("Remapping and enabling EFI services.\n");
|
||||
|
||||
/* replace early memmap mapping with permanent mapping */
|
||||
mapsize = memmap.map_end - memmap.map;
|
||||
early_memunmap(memmap.map, mapsize);
|
||||
memmap.map = (__force void *)ioremap_cache((phys_addr_t)memmap.phys_map,
|
||||
mapsize);
|
||||
memmap.map_end = memmap.map + mapsize;
|
||||
|
||||
efi.memmap = &memmap;
|
||||
|
||||
/* Map the runtime regions */
|
||||
virtmap = kmalloc(mapsize, GFP_KERNEL);
|
||||
if (!virtmap) {
|
||||
pr_err("Failed to allocate EFI virtual memmap\n");
|
||||
return -1;
|
||||
}
|
||||
virtmap_phys = virt_to_phys(virtmap);
|
||||
virt_md = virtmap;
|
||||
|
||||
for_each_efi_memory_desc(&memmap, md) {
|
||||
if (!(md->attribute & EFI_MEMORY_RUNTIME))
|
||||
continue;
|
||||
if (remap_region(md, &virt_md))
|
||||
++count;
|
||||
}
|
||||
|
||||
efi.systab = (__force void *)efi_lookup_mapped_addr(efi_system_table);
|
||||
if (efi.systab)
|
||||
set_bit(EFI_SYSTEM_TABLES, &efi.flags);
|
||||
|
||||
local_irq_save(flags);
|
||||
cpu_switch_mm(idmap_pg_dir, &init_mm);
|
||||
|
||||
/* Call SetVirtualAddressMap with the physical address of the map */
|
||||
runtime = efi.systab->runtime;
|
||||
efi.set_virtual_address_map = runtime->set_virtual_address_map;
|
||||
|
||||
status = efi.set_virtual_address_map(count * memmap.desc_size,
|
||||
memmap.desc_size,
|
||||
memmap.desc_version,
|
||||
(efi_memory_desc_t *)virtmap_phys);
|
||||
cpu_set_reserved_ttbr0();
|
||||
flush_tlb_all();
|
||||
local_irq_restore(flags);
|
||||
|
||||
kfree(virtmap);
|
||||
|
||||
free_boot_services();
|
||||
|
||||
if (status != EFI_SUCCESS) {
|
||||
pr_err("Failed to set EFI virtual address map! [%lx]\n",
|
||||
status);
|
||||
return -1;
|
||||
}
|
||||
|
||||
/* Set up runtime services function pointers */
|
||||
runtime = efi.systab->runtime;
|
||||
efi.get_time = runtime->get_time;
|
||||
efi.set_time = runtime->set_time;
|
||||
efi.get_wakeup_time = runtime->get_wakeup_time;
|
||||
efi.set_wakeup_time = runtime->set_wakeup_time;
|
||||
efi.get_variable = runtime->get_variable;
|
||||
efi.get_next_variable = runtime->get_next_variable;
|
||||
efi.set_variable = runtime->set_variable;
|
||||
efi.query_variable_info = runtime->query_variable_info;
|
||||
efi.update_capsule = runtime->update_capsule;
|
||||
efi.query_capsule_caps = runtime->query_capsule_caps;
|
||||
efi.get_next_high_mono_count = runtime->get_next_high_mono_count;
|
||||
efi.reset_system = runtime->reset_system;
|
||||
|
||||
set_bit(EFI_RUNTIME_SERVICES, &efi.flags);
|
||||
|
||||
return 0;
|
||||
}
|
||||
early_initcall(arm64_enter_virtual_mode);
|
||||
@@ -97,11 +97,21 @@
|
||||
/*
|
||||
* DO NOT MODIFY. Image header expected by Linux boot-loaders.
|
||||
*/
|
||||
#ifdef CONFIG_EFI
|
||||
efi_head:
|
||||
/*
|
||||
* This add instruction has no meaningful effect except that
|
||||
* its opcode forms the magic "MZ" signature required by UEFI.
|
||||
*/
|
||||
add x13, x18, #0x16
|
||||
b stext
|
||||
#else
|
||||
b stext // branch to kernel start, magic
|
||||
.long 0 // reserved
|
||||
.quad _kernel_offset_le // Image load offset from start of RAM, little-endian
|
||||
.quad _kernel_size_le // Effective size of kernel image, little-endian
|
||||
.quad _kernel_flags_le // Informative flags, little-endian
|
||||
#endif
|
||||
.quad 0 // reserved
|
||||
.quad 0 // reserved
|
||||
.quad 0 // reserved
|
||||
@@ -109,7 +119,109 @@
|
||||
.byte 0x52
|
||||
.byte 0x4d
|
||||
.byte 0x64
|
||||
#ifdef CONFIG_EFI
|
||||
.long pe_header - efi_head // Offset to the PE header.
|
||||
#else
|
||||
.word 0 // reserved
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_EFI
|
||||
.align 3
|
||||
pe_header:
|
||||
.ascii "PE"
|
||||
.short 0
|
||||
coff_header:
|
||||
.short 0xaa64 // AArch64
|
||||
.short 2 // nr_sections
|
||||
.long 0 // TimeDateStamp
|
||||
.long 0 // PointerToSymbolTable
|
||||
.long 1 // NumberOfSymbols
|
||||
.short section_table - optional_header // SizeOfOptionalHeader
|
||||
.short 0x206 // Characteristics.
|
||||
// IMAGE_FILE_DEBUG_STRIPPED |
|
||||
// IMAGE_FILE_EXECUTABLE_IMAGE |
|
||||
// IMAGE_FILE_LINE_NUMS_STRIPPED
|
||||
optional_header:
|
||||
.short 0x20b // PE32+ format
|
||||
.byte 0x02 // MajorLinkerVersion
|
||||
.byte 0x14 // MinorLinkerVersion
|
||||
.long _edata - stext // SizeOfCode
|
||||
.long 0 // SizeOfInitializedData
|
||||
.long 0 // SizeOfUninitializedData
|
||||
.long efi_stub_entry - efi_head // AddressOfEntryPoint
|
||||
.long stext - efi_head // BaseOfCode
|
||||
|
||||
extra_header_fields:
|
||||
.quad 0 // ImageBase
|
||||
.long 0x20 // SectionAlignment
|
||||
.long 0x8 // FileAlignment
|
||||
.short 0 // MajorOperatingSystemVersion
|
||||
.short 0 // MinorOperatingSystemVersion
|
||||
.short 0 // MajorImageVersion
|
||||
.short 0 // MinorImageVersion
|
||||
.short 0 // MajorSubsystemVersion
|
||||
.short 0 // MinorSubsystemVersion
|
||||
.long 0 // Win32VersionValue
|
||||
|
||||
.long _edata - efi_head // SizeOfImage
|
||||
|
||||
// Everything before the kernel image is considered part of the header
|
||||
.long stext - efi_head // SizeOfHeaders
|
||||
.long 0 // CheckSum
|
||||
.short 0xa // Subsystem (EFI application)
|
||||
.short 0 // DllCharacteristics
|
||||
.quad 0 // SizeOfStackReserve
|
||||
.quad 0 // SizeOfStackCommit
|
||||
.quad 0 // SizeOfHeapReserve
|
||||
.quad 0 // SizeOfHeapCommit
|
||||
.long 0 // LoaderFlags
|
||||
.long 0x6 // NumberOfRvaAndSizes
|
||||
|
||||
.quad 0 // ExportTable
|
||||
.quad 0 // ImportTable
|
||||
.quad 0 // ResourceTable
|
||||
.quad 0 // ExceptionTable
|
||||
.quad 0 // CertificationTable
|
||||
.quad 0 // BaseRelocationTable
|
||||
|
||||
// Section table
|
||||
section_table:
|
||||
|
||||
/*
|
||||
* The EFI application loader requires a relocation section
|
||||
* because EFI applications must be relocatable. This is a
|
||||
* dummy section as far as we are concerned.
|
||||
*/
|
||||
.ascii ".reloc"
|
||||
.byte 0
|
||||
.byte 0 // end of 0 padding of section name
|
||||
.long 0
|
||||
.long 0
|
||||
.long 0 // SizeOfRawData
|
||||
.long 0 // PointerToRawData
|
||||
.long 0 // PointerToRelocations
|
||||
.long 0 // PointerToLineNumbers
|
||||
.short 0 // NumberOfRelocations
|
||||
.short 0 // NumberOfLineNumbers
|
||||
.long 0x42100040 // Characteristics (section flags)
|
||||
|
||||
|
||||
.ascii ".text"
|
||||
.byte 0
|
||||
.byte 0
|
||||
.byte 0 // end of 0 padding of section name
|
||||
.long _edata - stext // VirtualSize
|
||||
.long stext - efi_head // VirtualAddress
|
||||
.long _edata - stext // SizeOfRawData
|
||||
.long stext - efi_head // PointerToRawData
|
||||
|
||||
.long 0 // PointerToRelocations (0 for executables)
|
||||
.long 0 // PointerToLineNumbers (0 for executables)
|
||||
.short 0 // NumberOfRelocations (0 for executables)
|
||||
.short 0 // NumberOfLineNumbers (0 for executables)
|
||||
.long 0xe0500020 // Characteristics (section flags)
|
||||
.align 5
|
||||
#endif
|
||||
|
||||
ENTRY(stext)
|
||||
mov x21, x0 // x21=FDT
|
||||
|
||||
@@ -42,6 +42,7 @@
|
||||
#include <linux/memblock.h>
|
||||
#include <linux/of_fdt.h>
|
||||
#include <linux/of_platform.h>
|
||||
#include <linux/efi.h>
|
||||
|
||||
#include <asm/fixmap.h>
|
||||
#include <asm/cputype.h>
|
||||
@@ -56,6 +57,7 @@
|
||||
#include <asm/traps.h>
|
||||
#include <asm/memblock.h>
|
||||
#include <asm/psci.h>
|
||||
#include <asm/efi.h>
|
||||
|
||||
unsigned int processor_id;
|
||||
EXPORT_SYMBOL(processor_id);
|
||||
@@ -380,11 +382,14 @@ void __init setup_arch(char **cmdline_p)
|
||||
|
||||
parse_early_param();
|
||||
|
||||
efi_init();
|
||||
arm64_memblock_init();
|
||||
|
||||
paging_init();
|
||||
request_standard_resources();
|
||||
|
||||
efi_idmap_init();
|
||||
|
||||
unflatten_device_tree();
|
||||
|
||||
psci_init();
|
||||
|
||||
@@ -477,6 +477,9 @@ efi_init (void)
|
||||
char *cp, vendor[100] = "unknown";
|
||||
int i;
|
||||
|
||||
set_bit(EFI_BOOT, &efi.flags);
|
||||
set_bit(EFI_64BIT, &efi.flags);
|
||||
|
||||
/*
|
||||
* It's too early to be able to use the standard kernel command line
|
||||
* support...
|
||||
@@ -529,6 +532,8 @@ efi_init (void)
|
||||
efi.systab->hdr.revision >> 16,
|
||||
efi.systab->hdr.revision & 0xffff, vendor);
|
||||
|
||||
set_bit(EFI_SYSTEM_TABLES, &efi.flags);
|
||||
|
||||
palo_phys = EFI_INVALID_TABLE_ADDR;
|
||||
|
||||
if (efi_config_init(arch_tables) != 0)
|
||||
@@ -657,6 +662,8 @@ efi_enter_virtual_mode (void)
|
||||
return;
|
||||
}
|
||||
|
||||
set_bit(EFI_RUNTIME_SERVICES, &efi.flags);
|
||||
|
||||
/*
|
||||
* Now that EFI is in virtual mode, we call the EFI functions more
|
||||
* efficiently:
|
||||
|
||||
@@ -33,11 +33,18 @@
|
||||
|
||||
#endif /*!CONFIG_PA20*/
|
||||
|
||||
/* LDCW, the only atomic read-write operation PA-RISC has. *sigh*. */
|
||||
/* LDCW, the only atomic read-write operation PA-RISC has. *sigh*.
|
||||
We don't explicitly expose that "*a" may be written as reload
|
||||
fails to find a register in class R1_REGS when "a" needs to be
|
||||
reloaded when generating 64-bit PIC code. Instead, we clobber
|
||||
memory to indicate to the compiler that the assembly code reads
|
||||
or writes to items other than those listed in the input and output
|
||||
operands. This may pessimize the code somewhat but __ldcw is
|
||||
usually used within code blocks surrounded by memory barriors. */
|
||||
#define __ldcw(a) ({ \
|
||||
unsigned __ret; \
|
||||
__asm__ __volatile__(__LDCW " 0(%2),%0" \
|
||||
: "=r" (__ret), "+m" (*(a)) : "r" (a)); \
|
||||
__asm__ __volatile__(__LDCW " 0(%1),%0" \
|
||||
: "=r" (__ret) : "r" (a) : "memory"); \
|
||||
__ret; \
|
||||
})
|
||||
|
||||
|
||||
@@ -154,4 +154,5 @@ module_exit(sha1_powerpc_mod_fini);
|
||||
MODULE_LICENSE("GPL");
|
||||
MODULE_DESCRIPTION("SHA1 Secure Hash Algorithm");
|
||||
|
||||
MODULE_ALIAS("sha1-powerpc");
|
||||
MODULE_ALIAS_CRYPTO("sha1");
|
||||
MODULE_ALIAS_CRYPTO("sha1-powerpc");
|
||||
|
||||
@@ -51,10 +51,6 @@ static inline void dcr_write_mmio(dcr_host_mmio_t host,
|
||||
out_be32(host.token + ((host.base + dcr_n) * host.stride), value);
|
||||
}
|
||||
|
||||
extern u64 of_translate_dcr_address(struct device_node *dev,
|
||||
unsigned int dcr_n,
|
||||
unsigned int *stride);
|
||||
|
||||
#endif /* __KERNEL__ */
|
||||
#endif /* _ASM_POWERPC_DCR_MMIO_H */
|
||||
|
||||
|
||||
@@ -838,76 +838,6 @@ int cpu_to_chip_id(int cpu)
|
||||
}
|
||||
EXPORT_SYMBOL(cpu_to_chip_id);
|
||||
|
||||
#ifdef CONFIG_PPC_PSERIES
|
||||
/*
|
||||
* Fix up the uninitialized fields in a new device node:
|
||||
* name, type and pci-specific fields
|
||||
*/
|
||||
|
||||
static int of_finish_dynamic_node(struct device_node *node)
|
||||
{
|
||||
struct device_node *parent = of_get_parent(node);
|
||||
int err = 0;
|
||||
const phandle *ibm_phandle;
|
||||
|
||||
node->name = of_get_property(node, "name", NULL);
|
||||
node->type = of_get_property(node, "device_type", NULL);
|
||||
|
||||
if (!node->name)
|
||||
node->name = "<NULL>";
|
||||
if (!node->type)
|
||||
node->type = "<NULL>";
|
||||
|
||||
if (!parent) {
|
||||
err = -ENODEV;
|
||||
goto out;
|
||||
}
|
||||
|
||||
/* We don't support that function on PowerMac, at least
|
||||
* not yet
|
||||
*/
|
||||
if (machine_is(powermac))
|
||||
return -ENODEV;
|
||||
|
||||
/* fix up new node's phandle field */
|
||||
if ((ibm_phandle = of_get_property(node, "ibm,phandle", NULL)))
|
||||
node->phandle = *ibm_phandle;
|
||||
|
||||
out:
|
||||
of_node_put(parent);
|
||||
return err;
|
||||
}
|
||||
|
||||
static int prom_reconfig_notifier(struct notifier_block *nb,
|
||||
unsigned long action, void *node)
|
||||
{
|
||||
int err;
|
||||
|
||||
switch (action) {
|
||||
case OF_RECONFIG_ATTACH_NODE:
|
||||
err = of_finish_dynamic_node(node);
|
||||
if (err < 0)
|
||||
printk(KERN_ERR "finish_node returned %d\n", err);
|
||||
break;
|
||||
default:
|
||||
err = 0;
|
||||
break;
|
||||
}
|
||||
return notifier_from_errno(err);
|
||||
}
|
||||
|
||||
static struct notifier_block prom_reconfig_nb = {
|
||||
.notifier_call = prom_reconfig_notifier,
|
||||
.priority = 10, /* This one needs to run first */
|
||||
};
|
||||
|
||||
static int __init prom_reconfig_setup(void)
|
||||
{
|
||||
return of_reconfig_notifier_register(&prom_reconfig_nb);
|
||||
}
|
||||
__initcall(prom_reconfig_setup);
|
||||
#endif
|
||||
|
||||
bool arch_match_cpu_phys_id(int cpu, u64 phys_id)
|
||||
{
|
||||
return (int)phys_id == get_hard_smp_processor_id(cpu);
|
||||
|
||||
@@ -1659,12 +1659,11 @@ static void stage_topology_update(int core_id)
|
||||
static int dt_update_callback(struct notifier_block *nb,
|
||||
unsigned long action, void *data)
|
||||
{
|
||||
struct of_prop_reconfig *update;
|
||||
struct of_reconfig_data *update = data;
|
||||
int rc = NOTIFY_DONE;
|
||||
|
||||
switch (action) {
|
||||
case OF_RECONFIG_UPDATE_PROPERTY:
|
||||
update = (struct of_prop_reconfig *)data;
|
||||
if (!of_prop_cmp(update->dn->type, "cpu") &&
|
||||
!of_prop_cmp(update->prop->name, "ibm,associativity")) {
|
||||
u32 core_id;
|
||||
|
||||
@@ -11,7 +11,6 @@
|
||||
*/
|
||||
|
||||
#include <linux/kernel.h>
|
||||
#include <linux/kref.h>
|
||||
#include <linux/notifier.h>
|
||||
#include <linux/spinlock.h>
|
||||
#include <linux/cpu.h>
|
||||
@@ -87,7 +86,6 @@ static struct device_node *dlpar_parse_cc_node(struct cc_workarea *ccwa,
|
||||
}
|
||||
|
||||
of_node_set_flag(dn, OF_DYNAMIC);
|
||||
kref_init(&dn->kref);
|
||||
|
||||
return dn;
|
||||
}
|
||||
|
||||
@@ -338,16 +338,17 @@ static void pseries_remove_processor(struct device_node *np)
|
||||
}
|
||||
|
||||
static int pseries_smp_notifier(struct notifier_block *nb,
|
||||
unsigned long action, void *node)
|
||||
unsigned long action, void *data)
|
||||
{
|
||||
struct of_reconfig_data *rd = data;
|
||||
int err = 0;
|
||||
|
||||
switch (action) {
|
||||
case OF_RECONFIG_ATTACH_NODE:
|
||||
err = pseries_add_processor(node);
|
||||
err = pseries_add_processor(rd->dn);
|
||||
break;
|
||||
case OF_RECONFIG_DETACH_NODE:
|
||||
pseries_remove_processor(node);
|
||||
pseries_remove_processor(rd->dn);
|
||||
break;
|
||||
}
|
||||
return notifier_from_errno(err);
|
||||
|
||||
@@ -200,7 +200,7 @@ static int pseries_add_memory(struct device_node *np)
|
||||
return (ret < 0) ? -EINVAL : 0;
|
||||
}
|
||||
|
||||
static int pseries_update_drconf_memory(struct of_prop_reconfig *pr)
|
||||
static int pseries_update_drconf_memory(struct of_reconfig_data *pr)
|
||||
{
|
||||
struct of_drconf_cell *new_drmem, *old_drmem;
|
||||
unsigned long memblock_size;
|
||||
@@ -212,7 +212,7 @@ static int pseries_update_drconf_memory(struct of_prop_reconfig *pr)
|
||||
if (!memblock_size)
|
||||
return -EINVAL;
|
||||
|
||||
p = (u32 *)of_get_property(pr->dn, "ibm,dynamic-memory", NULL);
|
||||
p = (u32 *) pr->old_prop->value;
|
||||
if (!p)
|
||||
return -EINVAL;
|
||||
|
||||
@@ -247,9 +247,9 @@ static int pseries_update_drconf_memory(struct of_prop_reconfig *pr)
|
||||
}
|
||||
|
||||
static int pseries_memory_notifier(struct notifier_block *nb,
|
||||
unsigned long action, void *node)
|
||||
unsigned long action, void *data)
|
||||
{
|
||||
struct of_prop_reconfig *pr;
|
||||
struct of_reconfig_data *rd = data;
|
||||
int err = 0;
|
||||
|
||||
switch (action) {
|
||||
@@ -260,9 +260,8 @@ static int pseries_memory_notifier(struct notifier_block *nb,
|
||||
err = pseries_remove_memory(node);
|
||||
break;
|
||||
case OF_RECONFIG_UPDATE_PROPERTY:
|
||||
pr = (struct of_prop_reconfig *)node;
|
||||
if (!strcmp(pr->prop->name, "ibm,dynamic-memory"))
|
||||
err = pseries_update_drconf_memory(pr);
|
||||
if (!strcmp(rd->prop->name, "ibm,dynamic-memory"))
|
||||
err = pseries_update_drconf_memory(rd);
|
||||
break;
|
||||
}
|
||||
return notifier_from_errno(err);
|
||||
|
||||
@@ -1252,10 +1252,11 @@ static struct notifier_block iommu_mem_nb = {
|
||||
.notifier_call = iommu_mem_notifier,
|
||||
};
|
||||
|
||||
static int iommu_reconfig_notifier(struct notifier_block *nb, unsigned long action, void *node)
|
||||
static int iommu_reconfig_notifier(struct notifier_block *nb, unsigned long action, void *data)
|
||||
{
|
||||
int err = NOTIFY_OK;
|
||||
struct device_node *np = node;
|
||||
struct of_reconfig_data *rd = data;
|
||||
struct device_node *np = rd->dn;
|
||||
struct pci_dn *pci = PCI_DN(np);
|
||||
struct direct_window *window;
|
||||
|
||||
|
||||
@@ -12,7 +12,6 @@
|
||||
*/
|
||||
|
||||
#include <linux/kernel.h>
|
||||
#include <linux/kref.h>
|
||||
#include <linux/notifier.h>
|
||||
#include <linux/proc_fs.h>
|
||||
#include <linux/slab.h>
|
||||
@@ -70,7 +69,6 @@ static int pSeries_reconfig_add_node(const char *path, struct property *proplist
|
||||
|
||||
np->properties = proplist;
|
||||
of_node_set_flag(np, OF_DYNAMIC);
|
||||
kref_init(&np->kref);
|
||||
|
||||
np->parent = derive_parent(path);
|
||||
if (IS_ERR(np->parent)) {
|
||||
|
||||
@@ -253,9 +253,10 @@ static void __init pseries_discover_pic(void)
|
||||
" interrupt-controller\n");
|
||||
}
|
||||
|
||||
static int pci_dn_reconfig_notifier(struct notifier_block *nb, unsigned long action, void *node)
|
||||
static int pci_dn_reconfig_notifier(struct notifier_block *nb, unsigned long action, void *data)
|
||||
{
|
||||
struct device_node *np = node;
|
||||
struct of_reconfig_data *rd = data;
|
||||
struct device_node *np = rd->dn;
|
||||
struct pci_dn *pci = NULL;
|
||||
int err = NOTIFY_OK;
|
||||
|
||||
|
||||
@@ -152,9 +152,9 @@ EXPORT_SYMBOL_GPL(dcr_resource_len);
|
||||
|
||||
#ifdef CONFIG_PPC_DCR_MMIO
|
||||
|
||||
u64 of_translate_dcr_address(struct device_node *dev,
|
||||
unsigned int dcr_n,
|
||||
unsigned int *out_stride)
|
||||
static u64 of_translate_dcr_address(struct device_node *dev,
|
||||
unsigned int dcr_n,
|
||||
unsigned int *out_stride)
|
||||
{
|
||||
struct device_node *dp;
|
||||
const u32 *p;
|
||||
|
||||
@@ -202,7 +202,7 @@ void __init test_of_node(void)
|
||||
|
||||
/* There should really be a struct device_node allocator */
|
||||
memset(&of_node, 0, sizeof(of_node));
|
||||
kref_init(&of_node.kref);
|
||||
kref_init(&of_node.kobj.kref);
|
||||
of_node.full_name = node_name;
|
||||
|
||||
check(0 == msi_bitmap_alloc(&bmp, size, &of_node));
|
||||
|
||||
@@ -288,6 +288,7 @@ static inline void disable_surveillance(void)
|
||||
args.token = rtas_token("set-indicator");
|
||||
if (args.token == RTAS_UNKNOWN_SERVICE)
|
||||
return;
|
||||
args.token = cpu_to_be32(args.token);
|
||||
args.nargs = cpu_to_be32(3);
|
||||
args.nret = cpu_to_be32(1);
|
||||
args.rets = &args.args[3];
|
||||
|
||||
@@ -979,7 +979,7 @@ static void __exit aes_s390_fini(void)
|
||||
module_init(aes_s390_init);
|
||||
module_exit(aes_s390_fini);
|
||||
|
||||
MODULE_ALIAS("aes-all");
|
||||
MODULE_ALIAS_CRYPTO("aes-all");
|
||||
|
||||
MODULE_DESCRIPTION("Rijndael (AES) Cipher Algorithm");
|
||||
MODULE_LICENSE("GPL");
|
||||
|
||||
@@ -619,8 +619,8 @@ static void __exit des_s390_exit(void)
|
||||
module_init(des_s390_init);
|
||||
module_exit(des_s390_exit);
|
||||
|
||||
MODULE_ALIAS("des");
|
||||
MODULE_ALIAS("des3_ede");
|
||||
MODULE_ALIAS_CRYPTO("des");
|
||||
MODULE_ALIAS_CRYPTO("des3_ede");
|
||||
|
||||
MODULE_LICENSE("GPL");
|
||||
MODULE_DESCRIPTION("DES & Triple DES EDE Cipher Algorithms");
|
||||
|
||||
@@ -160,7 +160,7 @@ static void __exit ghash_mod_exit(void)
|
||||
module_init(ghash_mod_init);
|
||||
module_exit(ghash_mod_exit);
|
||||
|
||||
MODULE_ALIAS("ghash");
|
||||
MODULE_ALIAS_CRYPTO("ghash");
|
||||
|
||||
MODULE_LICENSE("GPL");
|
||||
MODULE_DESCRIPTION("GHASH Message Digest Algorithm, s390 implementation");
|
||||
|
||||
@@ -103,6 +103,6 @@ static void __exit sha1_s390_fini(void)
|
||||
module_init(sha1_s390_init);
|
||||
module_exit(sha1_s390_fini);
|
||||
|
||||
MODULE_ALIAS("sha1");
|
||||
MODULE_ALIAS_CRYPTO("sha1");
|
||||
MODULE_LICENSE("GPL");
|
||||
MODULE_DESCRIPTION("SHA1 Secure Hash Algorithm");
|
||||
|
||||
@@ -143,7 +143,7 @@ static void __exit sha256_s390_fini(void)
|
||||
module_init(sha256_s390_init);
|
||||
module_exit(sha256_s390_fini);
|
||||
|
||||
MODULE_ALIAS("sha256");
|
||||
MODULE_ALIAS("sha224");
|
||||
MODULE_ALIAS_CRYPTO("sha256");
|
||||
MODULE_ALIAS_CRYPTO("sha224");
|
||||
MODULE_LICENSE("GPL");
|
||||
MODULE_DESCRIPTION("SHA256 and SHA224 Secure Hash Algorithm");
|
||||
|
||||
@@ -86,7 +86,7 @@ static struct shash_alg sha512_alg = {
|
||||
}
|
||||
};
|
||||
|
||||
MODULE_ALIAS("sha512");
|
||||
MODULE_ALIAS_CRYPTO("sha512");
|
||||
|
||||
static int sha384_init(struct shash_desc *desc)
|
||||
{
|
||||
@@ -126,7 +126,7 @@ static struct shash_alg sha384_alg = {
|
||||
}
|
||||
};
|
||||
|
||||
MODULE_ALIAS("sha384");
|
||||
MODULE_ALIAS_CRYPTO("sha384");
|
||||
|
||||
static int __init init(void)
|
||||
{
|
||||
|
||||
@@ -499,6 +499,6 @@ module_exit(aes_sparc64_mod_fini);
|
||||
MODULE_LICENSE("GPL");
|
||||
MODULE_DESCRIPTION("AES Secure Hash Algorithm, sparc64 aes opcode accelerated");
|
||||
|
||||
MODULE_ALIAS("aes");
|
||||
MODULE_ALIAS_CRYPTO("aes");
|
||||
|
||||
#include "crop_devid.c"
|
||||
|
||||
@@ -322,6 +322,6 @@ module_exit(camellia_sparc64_mod_fini);
|
||||
MODULE_LICENSE("GPL");
|
||||
MODULE_DESCRIPTION("Camellia Cipher Algorithm, sparc64 camellia opcode accelerated");
|
||||
|
||||
MODULE_ALIAS("aes");
|
||||
MODULE_ALIAS_CRYPTO("aes");
|
||||
|
||||
#include "crop_devid.c"
|
||||
|
||||
@@ -176,6 +176,6 @@ module_exit(crc32c_sparc64_mod_fini);
|
||||
MODULE_LICENSE("GPL");
|
||||
MODULE_DESCRIPTION("CRC32c (Castagnoli), sparc64 crc32c opcode accelerated");
|
||||
|
||||
MODULE_ALIAS("crc32c");
|
||||
MODULE_ALIAS_CRYPTO("crc32c");
|
||||
|
||||
#include "crop_devid.c"
|
||||
|
||||
@@ -532,6 +532,6 @@ module_exit(des_sparc64_mod_fini);
|
||||
MODULE_LICENSE("GPL");
|
||||
MODULE_DESCRIPTION("DES & Triple DES EDE Cipher Algorithms, sparc64 des opcode accelerated");
|
||||
|
||||
MODULE_ALIAS("des");
|
||||
MODULE_ALIAS_CRYPTO("des");
|
||||
|
||||
#include "crop_devid.c"
|
||||
|
||||
@@ -185,6 +185,6 @@ module_exit(md5_sparc64_mod_fini);
|
||||
MODULE_LICENSE("GPL");
|
||||
MODULE_DESCRIPTION("MD5 Secure Hash Algorithm, sparc64 md5 opcode accelerated");
|
||||
|
||||
MODULE_ALIAS("md5");
|
||||
MODULE_ALIAS_CRYPTO("md5");
|
||||
|
||||
#include "crop_devid.c"
|
||||
|
||||
@@ -180,6 +180,6 @@ module_exit(sha1_sparc64_mod_fini);
|
||||
MODULE_LICENSE("GPL");
|
||||
MODULE_DESCRIPTION("SHA1 Secure Hash Algorithm, sparc64 sha1 opcode accelerated");
|
||||
|
||||
MODULE_ALIAS("sha1");
|
||||
MODULE_ALIAS_CRYPTO("sha1");
|
||||
|
||||
#include "crop_devid.c"
|
||||
|
||||
@@ -237,7 +237,7 @@ module_exit(sha256_sparc64_mod_fini);
|
||||
MODULE_LICENSE("GPL");
|
||||
MODULE_DESCRIPTION("SHA-224 and SHA-256 Secure Hash Algorithm, sparc64 sha256 opcode accelerated");
|
||||
|
||||
MODULE_ALIAS("sha224");
|
||||
MODULE_ALIAS("sha256");
|
||||
MODULE_ALIAS_CRYPTO("sha224");
|
||||
MODULE_ALIAS_CRYPTO("sha256");
|
||||
|
||||
#include "crop_devid.c"
|
||||
|
||||
@@ -222,7 +222,7 @@ module_exit(sha512_sparc64_mod_fini);
|
||||
MODULE_LICENSE("GPL");
|
||||
MODULE_DESCRIPTION("SHA-384 and SHA-512 Secure Hash Algorithm, sparc64 sha512 opcode accelerated");
|
||||
|
||||
MODULE_ALIAS("sha384");
|
||||
MODULE_ALIAS("sha512");
|
||||
MODULE_ALIAS_CRYPTO("sha384");
|
||||
MODULE_ALIAS_CRYPTO("sha512");
|
||||
|
||||
#include "crop_devid.c"
|
||||
|
||||
@@ -2,6 +2,7 @@ config UML
|
||||
bool
|
||||
default y
|
||||
select HAVE_UID16
|
||||
select HAVE_FUTEX_CMPXCHG if FUTEX
|
||||
select GENERIC_IRQ_SHOW
|
||||
select GENERIC_CPU_DEVICES
|
||||
select GENERIC_IO
|
||||
|
||||
@@ -854,7 +854,7 @@ source "kernel/Kconfig.preempt"
|
||||
|
||||
config X86_UP_APIC
|
||||
bool "Local APIC support on uniprocessors"
|
||||
depends on X86_32 && !SMP && !X86_32_NON_STANDARD && !PCI_MSI
|
||||
depends on X86_32 && !SMP && !X86_32_NON_STANDARD
|
||||
---help---
|
||||
A local APIC (Advanced Programmable Interrupt Controller) is an
|
||||
integrated interrupt controller in the CPU. If you have a single-CPU
|
||||
@@ -865,6 +865,10 @@ config X86_UP_APIC
|
||||
performance counters), and the NMI watchdog which detects hard
|
||||
lockups.
|
||||
|
||||
config X86_UP_APIC_MSI
|
||||
def_bool y
|
||||
select X86_UP_APIC if X86_32 && !SMP && !X86_32_NON_STANDARD && PCI_MSI
|
||||
|
||||
config X86_UP_IOAPIC
|
||||
bool "IO-APIC support on uniprocessors"
|
||||
depends on X86_UP_APIC
|
||||
|
||||
@@ -76,7 +76,7 @@ suffix-$(CONFIG_KERNEL_LZO) := lzo
|
||||
suffix-$(CONFIG_KERNEL_LZ4) := lz4
|
||||
|
||||
RUN_SIZE = $(shell $(OBJDUMP) -h vmlinux | \
|
||||
perl $(srctree)/arch/x86/tools/calc_run_size.pl)
|
||||
$(CONFIG_SHELL) $(srctree)/arch/x86/tools/calc_run_size.sh)
|
||||
quiet_cmd_mkpiggy = MKPIGGY $@
|
||||
cmd_mkpiggy = $(obj)/mkpiggy $< $(RUN_SIZE) > $@ || ( rm -f $@ ; false )
|
||||
|
||||
|
||||
@@ -489,8 +489,7 @@ struct boot_params *make_boot_params(void *handle, efi_system_table_t *_table)
|
||||
hdr->type_of_loader = 0x21;
|
||||
|
||||
/* Convert unicode cmdline to ascii */
|
||||
cmdline_ptr = efi_convert_cmdline_to_ascii(sys_table, image,
|
||||
&options_size);
|
||||
cmdline_ptr = efi_convert_cmdline(sys_table, image, &options_size);
|
||||
if (!cmdline_ptr)
|
||||
goto fail;
|
||||
hdr->cmd_line_ptr = (unsigned long)cmdline_ptr;
|
||||
|
||||
@@ -10,6 +10,7 @@
|
||||
#define SEG_GRANULARITY_4KB (1 << 0)
|
||||
|
||||
#define DESC_TYPE_CODE_DATA (1 << 0)
|
||||
#define EFI_READ_CHUNK_SIZE (1024 * 1024)
|
||||
|
||||
#define EFI_CONSOLE_OUT_DEVICE_GUID \
|
||||
EFI_GUID(0xd3b36f2c, 0xd551, 0x11d4, 0x9a, 0x46, 0x0, 0x90, 0x27, \
|
||||
@@ -37,6 +38,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 +65,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,6 +86,18 @@ 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;
|
||||
|
||||
@@ -396,6 +396,8 @@ asmlinkage void *decompress_kernel(void *rmode, memptr heap,
|
||||
unsigned long output_len,
|
||||
unsigned long run_size)
|
||||
{
|
||||
unsigned char *output_orig = output;
|
||||
|
||||
real_mode = rmode;
|
||||
|
||||
sanitize_boot_params(real_mode);
|
||||
@@ -444,7 +446,12 @@ asmlinkage void *decompress_kernel(void *rmode, memptr heap,
|
||||
debug_putstr("\nDecompressing Linux... ");
|
||||
decompress(input_data, input_len, NULL, NULL, output, NULL, error);
|
||||
parse_elf(output);
|
||||
handle_relocations(output, output_len);
|
||||
/*
|
||||
* 32-bit always performs relocations. 64-bit relocations are only
|
||||
* needed if kASLR has chosen a different load address.
|
||||
*/
|
||||
if (!IS_ENABLED(CONFIG_X86_64) || output != output_orig)
|
||||
handle_relocations(output, output_len);
|
||||
debug_putstr("done.\nBooting the kernel.\n");
|
||||
return output;
|
||||
}
|
||||
|
||||
@@ -66,5 +66,5 @@ module_exit(aes_fini);
|
||||
|
||||
MODULE_DESCRIPTION("Rijndael (AES) Cipher Algorithm, asm optimized");
|
||||
MODULE_LICENSE("GPL");
|
||||
MODULE_ALIAS("aes");
|
||||
MODULE_ALIAS("aes-asm");
|
||||
MODULE_ALIAS_CRYPTO("aes");
|
||||
MODULE_ALIAS_CRYPTO("aes-asm");
|
||||
|
||||
@@ -1514,4 +1514,4 @@ module_exit(aesni_exit);
|
||||
|
||||
MODULE_DESCRIPTION("Rijndael (AES) Cipher Algorithm, Intel AES-NI instructions optimized");
|
||||
MODULE_LICENSE("GPL");
|
||||
MODULE_ALIAS("aes");
|
||||
MODULE_ALIAS_CRYPTO("aes");
|
||||
|
||||
@@ -481,5 +481,5 @@ module_exit(fini);
|
||||
|
||||
MODULE_LICENSE("GPL");
|
||||
MODULE_DESCRIPTION("Blowfish Cipher Algorithm, asm optimized");
|
||||
MODULE_ALIAS("blowfish");
|
||||
MODULE_ALIAS("blowfish-asm");
|
||||
MODULE_ALIAS_CRYPTO("blowfish");
|
||||
MODULE_ALIAS_CRYPTO("blowfish-asm");
|
||||
|
||||
@@ -582,5 +582,5 @@ module_exit(camellia_aesni_fini);
|
||||
|
||||
MODULE_LICENSE("GPL");
|
||||
MODULE_DESCRIPTION("Camellia Cipher Algorithm, AES-NI/AVX2 optimized");
|
||||
MODULE_ALIAS("camellia");
|
||||
MODULE_ALIAS("camellia-asm");
|
||||
MODULE_ALIAS_CRYPTO("camellia");
|
||||
MODULE_ALIAS_CRYPTO("camellia-asm");
|
||||
|
||||
@@ -574,5 +574,5 @@ module_exit(camellia_aesni_fini);
|
||||
|
||||
MODULE_LICENSE("GPL");
|
||||
MODULE_DESCRIPTION("Camellia Cipher Algorithm, AES-NI/AVX optimized");
|
||||
MODULE_ALIAS("camellia");
|
||||
MODULE_ALIAS("camellia-asm");
|
||||
MODULE_ALIAS_CRYPTO("camellia");
|
||||
MODULE_ALIAS_CRYPTO("camellia-asm");
|
||||
|
||||
@@ -1725,5 +1725,5 @@ module_exit(fini);
|
||||
|
||||
MODULE_LICENSE("GPL");
|
||||
MODULE_DESCRIPTION("Camellia Cipher Algorithm, asm optimized");
|
||||
MODULE_ALIAS("camellia");
|
||||
MODULE_ALIAS("camellia-asm");
|
||||
MODULE_ALIAS_CRYPTO("camellia");
|
||||
MODULE_ALIAS_CRYPTO("camellia-asm");
|
||||
|
||||
@@ -494,4 +494,4 @@ module_exit(cast5_exit);
|
||||
|
||||
MODULE_DESCRIPTION("Cast5 Cipher Algorithm, AVX optimized");
|
||||
MODULE_LICENSE("GPL");
|
||||
MODULE_ALIAS("cast5");
|
||||
MODULE_ALIAS_CRYPTO("cast5");
|
||||
|
||||
@@ -611,4 +611,4 @@ module_exit(cast6_exit);
|
||||
|
||||
MODULE_DESCRIPTION("Cast6 Cipher Algorithm, AVX optimized");
|
||||
MODULE_LICENSE("GPL");
|
||||
MODULE_ALIAS("cast6");
|
||||
MODULE_ALIAS_CRYPTO("cast6");
|
||||
|
||||
@@ -197,5 +197,5 @@ module_exit(crc32_pclmul_mod_fini);
|
||||
MODULE_AUTHOR("Alexander Boyko <alexander_boyko@xyratex.com>");
|
||||
MODULE_LICENSE("GPL");
|
||||
|
||||
MODULE_ALIAS("crc32");
|
||||
MODULE_ALIAS("crc32-pclmul");
|
||||
MODULE_ALIAS_CRYPTO("crc32");
|
||||
MODULE_ALIAS_CRYPTO("crc32-pclmul");
|
||||
|
||||
@@ -280,5 +280,5 @@ MODULE_AUTHOR("Austin Zhang <austin.zhang@intel.com>, Kent Liu <kent.liu@intel.c
|
||||
MODULE_DESCRIPTION("CRC32c (Castagnoli) optimization using Intel Hardware.");
|
||||
MODULE_LICENSE("GPL");
|
||||
|
||||
MODULE_ALIAS("crc32c");
|
||||
MODULE_ALIAS("crc32c-intel");
|
||||
MODULE_ALIAS_CRYPTO("crc32c");
|
||||
MODULE_ALIAS_CRYPTO("crc32c-intel");
|
||||
|
||||
@@ -147,5 +147,5 @@ MODULE_AUTHOR("Tim Chen <tim.c.chen@linux.intel.com>");
|
||||
MODULE_DESCRIPTION("T10 DIF CRC calculation accelerated with PCLMULQDQ.");
|
||||
MODULE_LICENSE("GPL");
|
||||
|
||||
MODULE_ALIAS("crct10dif");
|
||||
MODULE_ALIAS("crct10dif-pclmul");
|
||||
MODULE_ALIAS_CRYPTO("crct10dif");
|
||||
MODULE_ALIAS_CRYPTO("crct10dif-pclmul");
|
||||
|
||||
@@ -17,6 +17,7 @@
|
||||
#include <linux/kernel.h>
|
||||
#include <linux/module.h>
|
||||
#include <linux/slab.h>
|
||||
#include <linux/crypto.h>
|
||||
#include <asm/i387.h>
|
||||
|
||||
struct crypto_fpu_ctx {
|
||||
@@ -159,3 +160,5 @@ void __exit crypto_fpu_exit(void)
|
||||
{
|
||||
crypto_unregister_template(&crypto_fpu_tmpl);
|
||||
}
|
||||
|
||||
MODULE_ALIAS_CRYPTO("fpu");
|
||||
|
||||
@@ -341,4 +341,4 @@ module_exit(ghash_pclmulqdqni_mod_exit);
|
||||
MODULE_LICENSE("GPL");
|
||||
MODULE_DESCRIPTION("GHASH Message Digest Algorithm, "
|
||||
"acclerated by PCLMULQDQ-NI");
|
||||
MODULE_ALIAS("ghash");
|
||||
MODULE_ALIAS_CRYPTO("ghash");
|
||||
|
||||
@@ -119,5 +119,5 @@ module_exit(fini);
|
||||
|
||||
MODULE_LICENSE("GPL");
|
||||
MODULE_DESCRIPTION ("Salsa20 stream cipher algorithm (optimized assembly version)");
|
||||
MODULE_ALIAS("salsa20");
|
||||
MODULE_ALIAS("salsa20-asm");
|
||||
MODULE_ALIAS_CRYPTO("salsa20");
|
||||
MODULE_ALIAS_CRYPTO("salsa20-asm");
|
||||
|
||||
@@ -558,5 +558,5 @@ module_exit(fini);
|
||||
|
||||
MODULE_LICENSE("GPL");
|
||||
MODULE_DESCRIPTION("Serpent Cipher Algorithm, AVX2 optimized");
|
||||
MODULE_ALIAS("serpent");
|
||||
MODULE_ALIAS("serpent-asm");
|
||||
MODULE_ALIAS_CRYPTO("serpent");
|
||||
MODULE_ALIAS_CRYPTO("serpent-asm");
|
||||
|
||||
@@ -617,4 +617,4 @@ module_exit(serpent_exit);
|
||||
|
||||
MODULE_DESCRIPTION("Serpent Cipher Algorithm, AVX optimized");
|
||||
MODULE_LICENSE("GPL");
|
||||
MODULE_ALIAS("serpent");
|
||||
MODULE_ALIAS_CRYPTO("serpent");
|
||||
|
||||
@@ -618,4 +618,4 @@ module_exit(serpent_sse2_exit);
|
||||
|
||||
MODULE_DESCRIPTION("Serpent Cipher Algorithm, SSE2 optimized");
|
||||
MODULE_LICENSE("GPL");
|
||||
MODULE_ALIAS("serpent");
|
||||
MODULE_ALIAS_CRYPTO("serpent");
|
||||
|
||||
@@ -237,4 +237,4 @@ module_exit(sha1_ssse3_mod_fini);
|
||||
MODULE_LICENSE("GPL");
|
||||
MODULE_DESCRIPTION("SHA1 Secure Hash Algorithm, Supplemental SSE3 accelerated");
|
||||
|
||||
MODULE_ALIAS("sha1");
|
||||
MODULE_ALIAS_CRYPTO("sha1");
|
||||
|
||||
@@ -318,5 +318,5 @@ module_exit(sha256_ssse3_mod_fini);
|
||||
MODULE_LICENSE("GPL");
|
||||
MODULE_DESCRIPTION("SHA256 Secure Hash Algorithm, Supplemental SSE3 accelerated");
|
||||
|
||||
MODULE_ALIAS("sha256");
|
||||
MODULE_ALIAS("sha224");
|
||||
MODULE_ALIAS_CRYPTO("sha256");
|
||||
MODULE_ALIAS_CRYPTO("sha224");
|
||||
|
||||
@@ -326,5 +326,5 @@ module_exit(sha512_ssse3_mod_fini);
|
||||
MODULE_LICENSE("GPL");
|
||||
MODULE_DESCRIPTION("SHA512 Secure Hash Algorithm, Supplemental SSE3 accelerated");
|
||||
|
||||
MODULE_ALIAS("sha512");
|
||||
MODULE_ALIAS("sha384");
|
||||
MODULE_ALIAS_CRYPTO("sha512");
|
||||
MODULE_ALIAS_CRYPTO("sha384");
|
||||
|
||||
@@ -579,4 +579,4 @@ module_exit(twofish_exit);
|
||||
|
||||
MODULE_DESCRIPTION("Twofish Cipher Algorithm, AVX optimized");
|
||||
MODULE_LICENSE("GPL");
|
||||
MODULE_ALIAS("twofish");
|
||||
MODULE_ALIAS_CRYPTO("twofish");
|
||||
|
||||
@@ -96,5 +96,5 @@ module_exit(fini);
|
||||
|
||||
MODULE_LICENSE("GPL");
|
||||
MODULE_DESCRIPTION ("Twofish Cipher Algorithm, asm optimized");
|
||||
MODULE_ALIAS("twofish");
|
||||
MODULE_ALIAS("twofish-asm");
|
||||
MODULE_ALIAS_CRYPTO("twofish");
|
||||
MODULE_ALIAS_CRYPTO("twofish-asm");
|
||||
|
||||
@@ -495,5 +495,5 @@ module_exit(fini);
|
||||
|
||||
MODULE_LICENSE("GPL");
|
||||
MODULE_DESCRIPTION("Twofish Cipher Algorithm, 3-way parallel asm optimized");
|
||||
MODULE_ALIAS("twofish");
|
||||
MODULE_ALIAS("twofish-asm");
|
||||
MODULE_ALIAS_CRYPTO("twofish");
|
||||
MODULE_ALIAS_CRYPTO("twofish-asm");
|
||||
|
||||
@@ -251,7 +251,8 @@ static inline void native_load_tls(struct thread_struct *t, unsigned int cpu)
|
||||
gdt[GDT_ENTRY_TLS_MIN + i] = t->tls_array[i];
|
||||
}
|
||||
|
||||
#define _LDT_empty(info) \
|
||||
/* This intentionally ignores lm, since 32-bit apps don't have that field. */
|
||||
#define LDT_empty(info) \
|
||||
((info)->base_addr == 0 && \
|
||||
(info)->limit == 0 && \
|
||||
(info)->contents == 0 && \
|
||||
@@ -261,11 +262,18 @@ static inline void native_load_tls(struct thread_struct *t, unsigned int cpu)
|
||||
(info)->seg_not_present == 1 && \
|
||||
(info)->useable == 0)
|
||||
|
||||
#ifdef CONFIG_X86_64
|
||||
#define LDT_empty(info) (_LDT_empty(info) && ((info)->lm == 0))
|
||||
#else
|
||||
#define LDT_empty(info) (_LDT_empty(info))
|
||||
#endif
|
||||
/* Lots of programs expect an all-zero user_desc to mean "no segment at all". */
|
||||
static inline bool LDT_zero(const struct user_desc *info)
|
||||
{
|
||||
return (info->base_addr == 0 &&
|
||||
info->limit == 0 &&
|
||||
info->contents == 0 &&
|
||||
info->read_exec_only == 0 &&
|
||||
info->seg_32bit == 0 &&
|
||||
info->limit_in_pages == 0 &&
|
||||
info->seg_not_present == 0 &&
|
||||
info->useable == 0);
|
||||
}
|
||||
|
||||
static inline void clear_LDT(void)
|
||||
{
|
||||
|
||||
@@ -67,6 +67,7 @@ static struct clocksource hyperv_cs = {
|
||||
.rating = 400, /* use this when running on Hyperv*/
|
||||
.read = read_hv_clock,
|
||||
.mask = CLOCKSOURCE_MASK(64),
|
||||
.flags = CLOCK_SOURCE_IS_CONTINUOUS,
|
||||
};
|
||||
|
||||
static void __init ms_hyperv_init_platform(void)
|
||||
|
||||
@@ -1017,6 +1017,15 @@ int __kprobes setjmp_pre_handler(struct kprobe *p, struct pt_regs *regs)
|
||||
regs->flags &= ~X86_EFLAGS_IF;
|
||||
trace_hardirqs_off();
|
||||
regs->ip = (unsigned long)(jp->entry);
|
||||
|
||||
/*
|
||||
* jprobes use jprobe_return() which skips the normal return
|
||||
* path of the function, and this messes up the accounting of the
|
||||
* function graph tracer to get messed up.
|
||||
*
|
||||
* Pause function graph tracing while performing the jprobe function.
|
||||
*/
|
||||
pause_graph_tracing();
|
||||
return 1;
|
||||
}
|
||||
|
||||
@@ -1042,24 +1051,25 @@ int __kprobes longjmp_break_handler(struct kprobe *p, struct pt_regs *regs)
|
||||
struct kprobe_ctlblk *kcb = get_kprobe_ctlblk();
|
||||
u8 *addr = (u8 *) (regs->ip - 1);
|
||||
struct jprobe *jp = container_of(p, struct jprobe, kp);
|
||||
void *saved_sp = kcb->jprobe_saved_sp;
|
||||
|
||||
if ((addr > (u8 *) jprobe_return) &&
|
||||
(addr < (u8 *) jprobe_return_end)) {
|
||||
if (stack_addr(regs) != kcb->jprobe_saved_sp) {
|
||||
if (stack_addr(regs) != saved_sp) {
|
||||
struct pt_regs *saved_regs = &kcb->jprobe_saved_regs;
|
||||
printk(KERN_ERR
|
||||
"current sp %p does not match saved sp %p\n",
|
||||
stack_addr(regs), kcb->jprobe_saved_sp);
|
||||
stack_addr(regs), saved_sp);
|
||||
printk(KERN_ERR "Saved registers for jprobe %p\n", jp);
|
||||
show_regs(saved_regs);
|
||||
printk(KERN_ERR "Current registers\n");
|
||||
show_regs(regs);
|
||||
BUG();
|
||||
}
|
||||
/* It's OK to start function graph tracing again */
|
||||
unpause_graph_tracing();
|
||||
*regs = kcb->jprobe_saved_regs;
|
||||
memcpy((kprobe_opcode_t *)(kcb->jprobe_saved_sp),
|
||||
kcb->jprobes_stack,
|
||||
MIN_STACK_SIZE(kcb->jprobe_saved_sp));
|
||||
memcpy(saved_sp, kcb->jprobes_stack, MIN_STACK_SIZE(saved_sp));
|
||||
preempt_enable_no_resched();
|
||||
return 1;
|
||||
}
|
||||
|
||||
@@ -926,11 +926,11 @@ void __init setup_arch(char **cmdline_p)
|
||||
#ifdef CONFIG_EFI
|
||||
if (!strncmp((char *)&boot_params.efi_info.efi_loader_signature,
|
||||
"EL32", 4)) {
|
||||
set_bit(EFI_BOOT, &x86_efi_facility);
|
||||
set_bit(EFI_BOOT, &efi.flags);
|
||||
} else if (!strncmp((char *)&boot_params.efi_info.efi_loader_signature,
|
||||
"EL64", 4)) {
|
||||
set_bit(EFI_BOOT, &x86_efi_facility);
|
||||
set_bit(EFI_64BIT, &x86_efi_facility);
|
||||
set_bit(EFI_BOOT, &efi.flags);
|
||||
set_bit(EFI_64BIT, &efi.flags);
|
||||
}
|
||||
|
||||
if (efi_enabled(EFI_BOOT))
|
||||
|
||||
@@ -29,7 +29,28 @@ static int get_free_idx(void)
|
||||
|
||||
static bool tls_desc_okay(const struct user_desc *info)
|
||||
{
|
||||
if (LDT_empty(info))
|
||||
/*
|
||||
* For historical reasons (i.e. no one ever documented how any
|
||||
* of the segmentation APIs work), user programs can and do
|
||||
* assume that a struct user_desc that's all zeros except for
|
||||
* entry_number means "no segment at all". This never actually
|
||||
* worked. In fact, up to Linux 3.19, a struct user_desc like
|
||||
* this would create a 16-bit read-write segment with base and
|
||||
* limit both equal to zero.
|
||||
*
|
||||
* That was close enough to "no segment at all" until we
|
||||
* hardened this function to disallow 16-bit TLS segments. Fix
|
||||
* it up by interpreting these zeroed segments the way that they
|
||||
* were almost certainly intended to be interpreted.
|
||||
*
|
||||
* The correct way to ask for "no segment at all" is to specify
|
||||
* a user_desc that satisfies LDT_empty. To keep everything
|
||||
* working, we accept both.
|
||||
*
|
||||
* Note that there's a similar kludge in modify_ldt -- look at
|
||||
* the distinction between modes 1 and 0x11.
|
||||
*/
|
||||
if (LDT_empty(info) || LDT_zero(info))
|
||||
return true;
|
||||
|
||||
/*
|
||||
@@ -71,7 +92,7 @@ static void set_tls_desc(struct task_struct *p, int idx,
|
||||
cpu = get_cpu();
|
||||
|
||||
while (n-- > 0) {
|
||||
if (LDT_empty(info))
|
||||
if (LDT_empty(info) || LDT_zero(info))
|
||||
desc->a = desc->b = 0;
|
||||
else
|
||||
fill_ldt(desc, info);
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user