mirror of
https://github.com/torvalds/linux.git
synced 2024-11-10 22:21:40 +00:00
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net
Conflicts: arch/mips/net/bpf_jit.c drivers/net/can/flexcan.c Both the flexcan and MIPS bpf_jit conflicts were cases of simple overlapping changes. Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
commit
1f6d80358d
@ -16,9 +16,9 @@ Example:
|
||||
* DMA client
|
||||
|
||||
Required properties:
|
||||
- dmas: a list of <[DMA multiplexer phandle] [SRS/DRS value]> pairs,
|
||||
where SRS/DRS values are fixed handles, specified in the SoC
|
||||
manual as the value that would be written into the PDMACHCR.
|
||||
- dmas: a list of <[DMA multiplexer phandle] [SRS << 8 | DRS]> pairs.
|
||||
where SRS/DRS are specified in the SoC manual.
|
||||
It will be written into PDMACHCR as high 16-bit parts.
|
||||
- dma-names: a list of DMA channel names, one per "dmas" entry
|
||||
|
||||
Example:
|
||||
|
@ -11,10 +11,6 @@ Required properties:
|
||||
|
||||
Optional properties for main touchpad device:
|
||||
|
||||
- linux,gpio-keymap: An array of up to 4 entries indicating the Linux
|
||||
keycode generated by each GPIO. Linux keycodes are defined in
|
||||
<dt-bindings/input/input.h>.
|
||||
|
||||
- linux,gpio-keymap: When enabled, the SPT_GPIOPWN_T19 object sends messages
|
||||
on GPIO bit changes. An array of up to 8 entries can be provided
|
||||
indicating the Linux keycode mapped to each bit of the status byte,
|
||||
|
@ -31,7 +31,7 @@ i2s@ff890000 {
|
||||
#address-cells = <1>;
|
||||
#size-cells = <0>;
|
||||
dmas = <&pdma1 0>, <&pdma1 1>;
|
||||
dma-names = "rx", "tx";
|
||||
dma-names = "tx", "rx";
|
||||
clock-names = "i2s_hclk", "i2s_clk";
|
||||
clocks = <&cru HCLK_I2S0>, <&cru SCLK_I2S0>;
|
||||
};
|
||||
|
@ -16,11 +16,15 @@ Required Properties:
|
||||
- clocks: Must contain an entry for each entry in clock-names.
|
||||
- clock-names: Shall be "spiclk" for the transfer-clock, and "apb_pclk" for
|
||||
the peripheral clock.
|
||||
- #address-cells: should be 1.
|
||||
- #size-cells: should be 0.
|
||||
|
||||
Optional Properties:
|
||||
|
||||
- dmas: DMA specifiers for tx and rx dma. See the DMA client binding,
|
||||
Documentation/devicetree/bindings/dma/dma.txt
|
||||
- dma-names: DMA request names should include "tx" and "rx" if present.
|
||||
- #address-cells: should be 1.
|
||||
- #size-cells: should be 0.
|
||||
|
||||
|
||||
Example:
|
||||
|
||||
|
@ -5,6 +5,7 @@ Required properties:
|
||||
* "fsl,imx23-usbphy" for imx23 and imx28
|
||||
* "fsl,imx6q-usbphy" for imx6dq and imx6dl
|
||||
* "fsl,imx6sl-usbphy" for imx6sl
|
||||
* "fsl,imx6sx-usbphy" for imx6sx
|
||||
"fsl,imx23-usbphy" is still a fallback for other strings
|
||||
- reg: Should contain registers location and length
|
||||
- interrupts: Should contain phy interrupt
|
||||
|
@ -2,7 +2,7 @@ Analog TV Connector
|
||||
===================
|
||||
|
||||
Required properties:
|
||||
- compatible: "composite-connector" or "svideo-connector"
|
||||
- compatible: "composite-video-connector" or "svideo-connector"
|
||||
|
||||
Optional properties:
|
||||
- label: a symbolic name for the connector
|
||||
@ -14,7 +14,7 @@ Example
|
||||
-------
|
||||
|
||||
tv: connector {
|
||||
compatible = "composite-connector";
|
||||
compatible = "composite-video-connector";
|
||||
label = "tv";
|
||||
|
||||
port {
|
||||
|
@ -3541,6 +3541,7 @@ bytes respectively. Such letter suffixes can also be entirely omitted.
|
||||
bogus residue values);
|
||||
s = SINGLE_LUN (the device has only one
|
||||
Logical Unit);
|
||||
u = IGNORE_UAS (don't bind to the uas driver);
|
||||
w = NO_WP_DETECT (don't test whether the
|
||||
medium is write-protected).
|
||||
Example: quirks=0419:aaf5:rl,0421:0433:rc
|
||||
|
@ -462,9 +462,9 @@ JIT compiler
|
||||
------------
|
||||
|
||||
The Linux kernel has a built-in BPF JIT compiler for x86_64, SPARC, PowerPC,
|
||||
ARM and s390 and can be enabled through CONFIG_BPF_JIT. The JIT compiler is
|
||||
transparently invoked for each attached filter from user space or for internal
|
||||
kernel users if it has been previously enabled by root:
|
||||
ARM, MIPS and s390 and can be enabled through CONFIG_BPF_JIT. The JIT compiler
|
||||
is transparently invoked for each attached filter from user space or for
|
||||
internal kernel users if it has been previously enabled by root:
|
||||
|
||||
echo 1 > /proc/sys/net/core/bpf_jit_enable
|
||||
|
||||
|
23
MAINTAINERS
23
MAINTAINERS
@ -6425,7 +6425,8 @@ F: Documentation/scsi/NinjaSCSI.txt
|
||||
F: drivers/scsi/nsp32*
|
||||
|
||||
NTB DRIVER
|
||||
M: Jon Mason <jon.mason@intel.com>
|
||||
M: Jon Mason <jdmason@kudzu.us>
|
||||
M: Dave Jiang <dave.jiang@intel.com>
|
||||
S: Supported
|
||||
W: https://github.com/jonmason/ntb/wiki
|
||||
T: git git://github.com/jonmason/ntb.git
|
||||
@ -6876,7 +6877,7 @@ F: arch/x86/kernel/quirks.c
|
||||
|
||||
PCI DRIVER FOR IMX6
|
||||
M: Richard Zhu <r65037@freescale.com>
|
||||
M: Shawn Guo <shawn.guo@freescale.com>
|
||||
M: Lucas Stach <l.stach@pengutronix.de>
|
||||
L: linux-pci@vger.kernel.org
|
||||
L: linux-arm-kernel@lists.infradead.org (moderated for non-subscribers)
|
||||
S: Maintained
|
||||
@ -7054,7 +7055,7 @@ S: Maintained
|
||||
F: drivers/pinctrl/sh-pfc/
|
||||
|
||||
PIN CONTROLLER - SAMSUNG
|
||||
M: Tomasz Figa <t.figa@samsung.com>
|
||||
M: Tomasz Figa <tomasz.figa@gmail.com>
|
||||
M: Thomas Abraham <thomas.abraham@linaro.org>
|
||||
L: linux-arm-kernel@lists.infradead.org (moderated for non-subscribers)
|
||||
L: linux-samsung-soc@vger.kernel.org (moderated for non-subscribers)
|
||||
@ -7900,7 +7901,8 @@ S: Supported
|
||||
F: drivers/media/i2c/s5k5baf.c
|
||||
|
||||
SAMSUNG SOC CLOCK DRIVERS
|
||||
M: Tomasz Figa <t.figa@samsung.com>
|
||||
M: Sylwester Nawrocki <s.nawrocki@samsung.com>
|
||||
M: Tomasz Figa <tomasz.figa@gmail.com>
|
||||
S: Supported
|
||||
L: linux-samsung-soc@vger.kernel.org (moderated for non-subscribers)
|
||||
F: drivers/clk/samsung/
|
||||
@ -7913,6 +7915,19 @@ S: Supported
|
||||
L: netdev@vger.kernel.org
|
||||
F: drivers/net/ethernet/samsung/sxgbe/
|
||||
|
||||
SAMSUNG USB2 PHY DRIVER
|
||||
M: Kamil Debski <k.debski@samsung.com>
|
||||
L: linux-kernel@vger.kernel.org
|
||||
S: Supported
|
||||
F: Documentation/devicetree/bindings/phy/samsung-phy.txt
|
||||
F: Documentation/phy/samsung-usb2.txt
|
||||
F: drivers/phy/phy-exynos4210-usb2.c
|
||||
F: drivers/phy/phy-exynos4x12-usb2.c
|
||||
F: drivers/phy/phy-exynos5250-usb2.c
|
||||
F: drivers/phy/phy-s5pv210-usb2.c
|
||||
F: drivers/phy/phy-samsung-usb2.c
|
||||
F: drivers/phy/phy-samsung-usb2.h
|
||||
|
||||
SERIAL DRIVERS
|
||||
M: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
|
||||
L: linux-serial@vger.kernel.org
|
||||
|
2
Makefile
2
Makefile
@ -1,7 +1,7 @@
|
||||
VERSION = 3
|
||||
PATCHLEVEL = 17
|
||||
SUBLEVEL = 0
|
||||
EXTRAVERSION = -rc4
|
||||
EXTRAVERSION = -rc6
|
||||
NAME = Shuffling Zombie Juror
|
||||
|
||||
# *DOCUMENTATION*
|
||||
|
@ -93,7 +93,7 @@
|
||||
};
|
||||
|
||||
tv: connector {
|
||||
compatible = "composite-connector";
|
||||
compatible = "composite-video-connector";
|
||||
label = "tv";
|
||||
|
||||
port {
|
||||
|
@ -1,6 +1,9 @@
|
||||
#ifndef __ASMARM_TLS_H
|
||||
#define __ASMARM_TLS_H
|
||||
|
||||
#include <linux/compiler.h>
|
||||
#include <asm/thread_info.h>
|
||||
|
||||
#ifdef __ASSEMBLY__
|
||||
#include <asm/asm-offsets.h>
|
||||
.macro switch_tls_none, base, tp, tpuser, tmp1, tmp2
|
||||
@ -50,6 +53,47 @@
|
||||
#endif
|
||||
|
||||
#ifndef __ASSEMBLY__
|
||||
|
||||
static inline void set_tls(unsigned long val)
|
||||
{
|
||||
struct thread_info *thread;
|
||||
|
||||
thread = current_thread_info();
|
||||
|
||||
thread->tp_value[0] = val;
|
||||
|
||||
/*
|
||||
* This code runs with preemption enabled and therefore must
|
||||
* be reentrant with respect to switch_tls.
|
||||
*
|
||||
* We need to ensure ordering between the shadow state and the
|
||||
* hardware state, so that we don't corrupt the hardware state
|
||||
* with a stale shadow state during context switch.
|
||||
*
|
||||
* If we're preempted here, switch_tls will load TPIDRURO from
|
||||
* thread_info upon resuming execution and the following mcr
|
||||
* is merely redundant.
|
||||
*/
|
||||
barrier();
|
||||
|
||||
if (!tls_emu) {
|
||||
if (has_tls_reg) {
|
||||
asm("mcr p15, 0, %0, c13, c0, 3"
|
||||
: : "r" (val));
|
||||
} else {
|
||||
/*
|
||||
* User space must never try to access this
|
||||
* directly. Expect your app to break
|
||||
* eventually if you do so. The user helper
|
||||
* at 0xffff0fe0 must be used instead. (see
|
||||
* entry-armv.S for details)
|
||||
*/
|
||||
*((unsigned int *)0xffff0ff0) = val;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
static inline unsigned long get_tpuser(void)
|
||||
{
|
||||
unsigned long reg = 0;
|
||||
@ -59,5 +103,23 @@ static inline unsigned long get_tpuser(void)
|
||||
|
||||
return reg;
|
||||
}
|
||||
|
||||
static inline void set_tpuser(unsigned long val)
|
||||
{
|
||||
/* Since TPIDRURW is fully context-switched (unlike TPIDRURO),
|
||||
* we need not update thread_info.
|
||||
*/
|
||||
if (has_tls_reg && !tls_emu) {
|
||||
asm("mcr p15, 0, %0, c13, c0, 2"
|
||||
: : "r" (val));
|
||||
}
|
||||
}
|
||||
|
||||
static inline void flush_tls(void)
|
||||
{
|
||||
set_tls(0);
|
||||
set_tpuser(0);
|
||||
}
|
||||
|
||||
#endif
|
||||
#endif /* __ASMARM_TLS_H */
|
||||
|
@ -107,8 +107,11 @@ static inline void set_fs(mm_segment_t fs)
|
||||
extern int __get_user_1(void *);
|
||||
extern int __get_user_2(void *);
|
||||
extern int __get_user_4(void *);
|
||||
extern int __get_user_lo8(void *);
|
||||
extern int __get_user_32t_8(void *);
|
||||
extern int __get_user_8(void *);
|
||||
extern int __get_user_64t_1(void *);
|
||||
extern int __get_user_64t_2(void *);
|
||||
extern int __get_user_64t_4(void *);
|
||||
|
||||
#define __GUP_CLOBBER_1 "lr", "cc"
|
||||
#ifdef CONFIG_CPU_USE_DOMAINS
|
||||
@ -117,7 +120,7 @@ extern int __get_user_8(void *);
|
||||
#define __GUP_CLOBBER_2 "lr", "cc"
|
||||
#endif
|
||||
#define __GUP_CLOBBER_4 "lr", "cc"
|
||||
#define __GUP_CLOBBER_lo8 "lr", "cc"
|
||||
#define __GUP_CLOBBER_32t_8 "lr", "cc"
|
||||
#define __GUP_CLOBBER_8 "lr", "cc"
|
||||
|
||||
#define __get_user_x(__r2,__p,__e,__l,__s) \
|
||||
@ -131,12 +134,30 @@ extern int __get_user_8(void *);
|
||||
|
||||
/* narrowing a double-word get into a single 32bit word register: */
|
||||
#ifdef __ARMEB__
|
||||
#define __get_user_xb(__r2, __p, __e, __l, __s) \
|
||||
__get_user_x(__r2, __p, __e, __l, lo8)
|
||||
#define __get_user_x_32t(__r2, __p, __e, __l, __s) \
|
||||
__get_user_x(__r2, __p, __e, __l, 32t_8)
|
||||
#else
|
||||
#define __get_user_xb __get_user_x
|
||||
#define __get_user_x_32t __get_user_x
|
||||
#endif
|
||||
|
||||
/*
|
||||
* storing result into proper least significant word of 64bit target var,
|
||||
* different only for big endian case where 64 bit __r2 lsw is r3:
|
||||
*/
|
||||
#ifdef __ARMEB__
|
||||
#define __get_user_x_64t(__r2, __p, __e, __l, __s) \
|
||||
__asm__ __volatile__ ( \
|
||||
__asmeq("%0", "r0") __asmeq("%1", "r2") \
|
||||
__asmeq("%3", "r1") \
|
||||
"bl __get_user_64t_" #__s \
|
||||
: "=&r" (__e), "=r" (__r2) \
|
||||
: "0" (__p), "r" (__l) \
|
||||
: __GUP_CLOBBER_##__s)
|
||||
#else
|
||||
#define __get_user_x_64t __get_user_x
|
||||
#endif
|
||||
|
||||
|
||||
#define __get_user_check(x,p) \
|
||||
({ \
|
||||
unsigned long __limit = current_thread_info()->addr_limit - 1; \
|
||||
@ -146,17 +167,26 @@ extern int __get_user_8(void *);
|
||||
register int __e asm("r0"); \
|
||||
switch (sizeof(*(__p))) { \
|
||||
case 1: \
|
||||
__get_user_x(__r2, __p, __e, __l, 1); \
|
||||
if (sizeof((x)) >= 8) \
|
||||
__get_user_x_64t(__r2, __p, __e, __l, 1); \
|
||||
else \
|
||||
__get_user_x(__r2, __p, __e, __l, 1); \
|
||||
break; \
|
||||
case 2: \
|
||||
__get_user_x(__r2, __p, __e, __l, 2); \
|
||||
if (sizeof((x)) >= 8) \
|
||||
__get_user_x_64t(__r2, __p, __e, __l, 2); \
|
||||
else \
|
||||
__get_user_x(__r2, __p, __e, __l, 2); \
|
||||
break; \
|
||||
case 4: \
|
||||
__get_user_x(__r2, __p, __e, __l, 4); \
|
||||
if (sizeof((x)) >= 8) \
|
||||
__get_user_x_64t(__r2, __p, __e, __l, 4); \
|
||||
else \
|
||||
__get_user_x(__r2, __p, __e, __l, 4); \
|
||||
break; \
|
||||
case 8: \
|
||||
if (sizeof((x)) < 8) \
|
||||
__get_user_xb(__r2, __p, __e, __l, 4); \
|
||||
__get_user_x_32t(__r2, __p, __e, __l, 4); \
|
||||
else \
|
||||
__get_user_x(__r2, __p, __e, __l, 8); \
|
||||
break; \
|
||||
|
@ -26,25 +26,14 @@ static inline void xen_dma_map_page(struct device *hwdev, struct page *page,
|
||||
__generic_dma_ops(hwdev)->map_page(hwdev, page, offset, size, dir, attrs);
|
||||
}
|
||||
|
||||
static inline void xen_dma_unmap_page(struct device *hwdev, dma_addr_t handle,
|
||||
void xen_dma_unmap_page(struct device *hwdev, dma_addr_t handle,
|
||||
size_t size, enum dma_data_direction dir,
|
||||
struct dma_attrs *attrs)
|
||||
{
|
||||
if (__generic_dma_ops(hwdev)->unmap_page)
|
||||
__generic_dma_ops(hwdev)->unmap_page(hwdev, handle, size, dir, attrs);
|
||||
}
|
||||
struct dma_attrs *attrs);
|
||||
|
||||
static inline void xen_dma_sync_single_for_cpu(struct device *hwdev,
|
||||
dma_addr_t handle, size_t size, enum dma_data_direction dir)
|
||||
{
|
||||
if (__generic_dma_ops(hwdev)->sync_single_for_cpu)
|
||||
__generic_dma_ops(hwdev)->sync_single_for_cpu(hwdev, handle, size, dir);
|
||||
}
|
||||
void xen_dma_sync_single_for_cpu(struct device *hwdev,
|
||||
dma_addr_t handle, size_t size, enum dma_data_direction dir);
|
||||
|
||||
void xen_dma_sync_single_for_device(struct device *hwdev,
|
||||
dma_addr_t handle, size_t size, enum dma_data_direction dir);
|
||||
|
||||
static inline void xen_dma_sync_single_for_device(struct device *hwdev,
|
||||
dma_addr_t handle, size_t size, enum dma_data_direction dir)
|
||||
{
|
||||
if (__generic_dma_ops(hwdev)->sync_single_for_device)
|
||||
__generic_dma_ops(hwdev)->sync_single_for_device(hwdev, handle, size, dir);
|
||||
}
|
||||
#endif /* _ASM_ARM_XEN_PAGE_COHERENT_H */
|
||||
|
@ -33,7 +33,6 @@ typedef struct xpaddr {
|
||||
#define INVALID_P2M_ENTRY (~0UL)
|
||||
|
||||
unsigned long __pfn_to_mfn(unsigned long pfn);
|
||||
unsigned long __mfn_to_pfn(unsigned long mfn);
|
||||
extern struct rb_root phys_to_mach;
|
||||
|
||||
static inline unsigned long pfn_to_mfn(unsigned long pfn)
|
||||
@ -51,14 +50,6 @@ static inline unsigned long pfn_to_mfn(unsigned long pfn)
|
||||
|
||||
static inline unsigned long mfn_to_pfn(unsigned long mfn)
|
||||
{
|
||||
unsigned long pfn;
|
||||
|
||||
if (phys_to_mach.rb_node != NULL) {
|
||||
pfn = __mfn_to_pfn(mfn);
|
||||
if (pfn != INVALID_P2M_ENTRY)
|
||||
return pfn;
|
||||
}
|
||||
|
||||
return mfn;
|
||||
}
|
||||
|
||||
|
@ -98,6 +98,14 @@ EXPORT_SYMBOL(__clear_user);
|
||||
EXPORT_SYMBOL(__get_user_1);
|
||||
EXPORT_SYMBOL(__get_user_2);
|
||||
EXPORT_SYMBOL(__get_user_4);
|
||||
EXPORT_SYMBOL(__get_user_8);
|
||||
|
||||
#ifdef __ARMEB__
|
||||
EXPORT_SYMBOL(__get_user_64t_1);
|
||||
EXPORT_SYMBOL(__get_user_64t_2);
|
||||
EXPORT_SYMBOL(__get_user_64t_4);
|
||||
EXPORT_SYMBOL(__get_user_32t_8);
|
||||
#endif
|
||||
|
||||
EXPORT_SYMBOL(__put_user_1);
|
||||
EXPORT_SYMBOL(__put_user_2);
|
||||
|
@ -175,7 +175,7 @@ static bool migrate_one_irq(struct irq_desc *desc)
|
||||
c = irq_data_get_irq_chip(d);
|
||||
if (!c->irq_set_affinity)
|
||||
pr_debug("IRQ%u: unable to set affinity\n", d->irq);
|
||||
else if (c->irq_set_affinity(d, affinity, true) == IRQ_SET_MASK_OK && ret)
|
||||
else if (c->irq_set_affinity(d, affinity, false) == IRQ_SET_MASK_OK && ret)
|
||||
cpumask_copy(d->affinity, affinity);
|
||||
|
||||
return ret;
|
||||
|
@ -76,21 +76,15 @@ static struct pmu_hw_events *cpu_pmu_get_cpu_events(void)
|
||||
|
||||
static void cpu_pmu_enable_percpu_irq(void *data)
|
||||
{
|
||||
struct arm_pmu *cpu_pmu = data;
|
||||
struct platform_device *pmu_device = cpu_pmu->plat_device;
|
||||
int irq = platform_get_irq(pmu_device, 0);
|
||||
int irq = *(int *)data;
|
||||
|
||||
enable_percpu_irq(irq, IRQ_TYPE_NONE);
|
||||
cpumask_set_cpu(smp_processor_id(), &cpu_pmu->active_irqs);
|
||||
}
|
||||
|
||||
static void cpu_pmu_disable_percpu_irq(void *data)
|
||||
{
|
||||
struct arm_pmu *cpu_pmu = data;
|
||||
struct platform_device *pmu_device = cpu_pmu->plat_device;
|
||||
int irq = platform_get_irq(pmu_device, 0);
|
||||
int irq = *(int *)data;
|
||||
|
||||
cpumask_clear_cpu(smp_processor_id(), &cpu_pmu->active_irqs);
|
||||
disable_percpu_irq(irq);
|
||||
}
|
||||
|
||||
@ -103,7 +97,7 @@ static void cpu_pmu_free_irq(struct arm_pmu *cpu_pmu)
|
||||
|
||||
irq = platform_get_irq(pmu_device, 0);
|
||||
if (irq >= 0 && irq_is_percpu(irq)) {
|
||||
on_each_cpu(cpu_pmu_disable_percpu_irq, cpu_pmu, 1);
|
||||
on_each_cpu(cpu_pmu_disable_percpu_irq, &irq, 1);
|
||||
free_percpu_irq(irq, &percpu_pmu);
|
||||
} else {
|
||||
for (i = 0; i < irqs; ++i) {
|
||||
@ -138,7 +132,7 @@ static int cpu_pmu_request_irq(struct arm_pmu *cpu_pmu, irq_handler_t handler)
|
||||
irq);
|
||||
return err;
|
||||
}
|
||||
on_each_cpu(cpu_pmu_enable_percpu_irq, cpu_pmu, 1);
|
||||
on_each_cpu(cpu_pmu_enable_percpu_irq, &irq, 1);
|
||||
} else {
|
||||
for (i = 0; i < irqs; ++i) {
|
||||
err = 0;
|
||||
|
@ -334,6 +334,8 @@ void flush_thread(void)
|
||||
memset(&tsk->thread.debug, 0, sizeof(struct debug_info));
|
||||
memset(&thread->fpstate, 0, sizeof(union fp_state));
|
||||
|
||||
flush_tls();
|
||||
|
||||
thread_notify(THREAD_NOTIFY_FLUSH, thread);
|
||||
}
|
||||
|
||||
|
@ -142,14 +142,6 @@ static int emulate_swpX(unsigned int address, unsigned int *data,
|
||||
while (1) {
|
||||
unsigned long temp;
|
||||
|
||||
/*
|
||||
* Barrier required between accessing protected resource and
|
||||
* releasing a lock for it. Legacy code might not have done
|
||||
* this, and we cannot determine that this is not the case
|
||||
* being emulated, so insert always.
|
||||
*/
|
||||
smp_mb();
|
||||
|
||||
if (type == TYPE_SWPB)
|
||||
__user_swpb_asm(*data, address, res, temp);
|
||||
else
|
||||
@ -162,13 +154,6 @@ static int emulate_swpX(unsigned int address, unsigned int *data,
|
||||
}
|
||||
|
||||
if (res == 0) {
|
||||
/*
|
||||
* Barrier also required between acquiring a lock for a
|
||||
* protected resource and accessing the resource. Inserted for
|
||||
* same reason as above.
|
||||
*/
|
||||
smp_mb();
|
||||
|
||||
if (type == TYPE_SWPB)
|
||||
swpbcounter++;
|
||||
else
|
||||
|
@ -45,7 +45,7 @@ static int thumbee_notifier(struct notifier_block *self, unsigned long cmd, void
|
||||
|
||||
switch (cmd) {
|
||||
case THREAD_NOTIFY_FLUSH:
|
||||
thread->thumbee_state = 0;
|
||||
teehbr_write(0);
|
||||
break;
|
||||
case THREAD_NOTIFY_SWITCH:
|
||||
current_thread_info()->thumbee_state = teehbr_read();
|
||||
|
@ -581,7 +581,6 @@ do_cache_op(unsigned long start, unsigned long end, int flags)
|
||||
#define NR(x) ((__ARM_NR_##x) - __ARM_NR_BASE)
|
||||
asmlinkage int arm_syscall(int no, struct pt_regs *regs)
|
||||
{
|
||||
struct thread_info *thread = current_thread_info();
|
||||
siginfo_t info;
|
||||
|
||||
if ((no >> 16) != (__ARM_NR_BASE>> 16))
|
||||
@ -632,21 +631,7 @@ asmlinkage int arm_syscall(int no, struct pt_regs *regs)
|
||||
return regs->ARM_r0;
|
||||
|
||||
case NR(set_tls):
|
||||
thread->tp_value[0] = regs->ARM_r0;
|
||||
if (tls_emu)
|
||||
return 0;
|
||||
if (has_tls_reg) {
|
||||
asm ("mcr p15, 0, %0, c13, c0, 3"
|
||||
: : "r" (regs->ARM_r0));
|
||||
} else {
|
||||
/*
|
||||
* User space must never try to access this directly.
|
||||
* Expect your app to break eventually if you do so.
|
||||
* The user helper at 0xffff0fe0 must be used instead.
|
||||
* (see entry-armv.S for details)
|
||||
*/
|
||||
*((unsigned int *)0xffff0ff0) = regs->ARM_r0;
|
||||
}
|
||||
set_tls(regs->ARM_r0);
|
||||
return 0;
|
||||
|
||||
#ifdef CONFIG_NEEDS_SYSCALL_FOR_CMPXCHG
|
||||
|
@ -80,7 +80,7 @@ ENTRY(__get_user_8)
|
||||
ENDPROC(__get_user_8)
|
||||
|
||||
#ifdef __ARMEB__
|
||||
ENTRY(__get_user_lo8)
|
||||
ENTRY(__get_user_32t_8)
|
||||
check_uaccess r0, 8, r1, r2, __get_user_bad
|
||||
#ifdef CONFIG_CPU_USE_DOMAINS
|
||||
add r0, r0, #4
|
||||
@ -90,7 +90,37 @@ ENTRY(__get_user_lo8)
|
||||
#endif
|
||||
mov r0, #0
|
||||
ret lr
|
||||
ENDPROC(__get_user_lo8)
|
||||
ENDPROC(__get_user_32t_8)
|
||||
|
||||
ENTRY(__get_user_64t_1)
|
||||
check_uaccess r0, 1, r1, r2, __get_user_bad8
|
||||
8: TUSER(ldrb) r3, [r0]
|
||||
mov r0, #0
|
||||
ret lr
|
||||
ENDPROC(__get_user_64t_1)
|
||||
|
||||
ENTRY(__get_user_64t_2)
|
||||
check_uaccess r0, 2, r1, r2, __get_user_bad8
|
||||
#ifdef CONFIG_CPU_USE_DOMAINS
|
||||
rb .req ip
|
||||
9: ldrbt r3, [r0], #1
|
||||
10: ldrbt rb, [r0], #0
|
||||
#else
|
||||
rb .req r0
|
||||
9: ldrb r3, [r0]
|
||||
10: ldrb rb, [r0, #1]
|
||||
#endif
|
||||
orr r3, rb, r3, lsl #8
|
||||
mov r0, #0
|
||||
ret lr
|
||||
ENDPROC(__get_user_64t_2)
|
||||
|
||||
ENTRY(__get_user_64t_4)
|
||||
check_uaccess r0, 4, r1, r2, __get_user_bad8
|
||||
11: TUSER(ldr) r3, [r0]
|
||||
mov r0, #0
|
||||
ret lr
|
||||
ENDPROC(__get_user_64t_4)
|
||||
#endif
|
||||
|
||||
__get_user_bad8:
|
||||
@ -111,5 +141,9 @@ ENDPROC(__get_user_bad8)
|
||||
.long 6b, __get_user_bad8
|
||||
#ifdef __ARMEB__
|
||||
.long 7b, __get_user_bad
|
||||
.long 8b, __get_user_bad8
|
||||
.long 9b, __get_user_bad8
|
||||
.long 10b, __get_user_bad8
|
||||
.long 11b, __get_user_bad8
|
||||
#endif
|
||||
.popsection
|
||||
|
@ -146,7 +146,6 @@ ENDPROC(cpu_v7_set_pte_ext)
|
||||
mov \tmp, \ttbr1, lsr #(32 - ARCH_PGD_SHIFT) @ upper bits
|
||||
mov \ttbr1, \ttbr1, lsl #ARCH_PGD_SHIFT @ lower bits
|
||||
addls \ttbr1, \ttbr1, #TTBR1_OFFSET
|
||||
adcls \tmp, \tmp, #0
|
||||
mcrr p15, 1, \ttbr1, \tmp, c2 @ load TTBR1
|
||||
mov \tmp, \ttbr0, lsr #(32 - ARCH_PGD_SHIFT) @ upper bits
|
||||
mov \ttbr0, \ttbr0, lsl #ARCH_PGD_SHIFT @ lower bits
|
||||
|
@ -1 +1 @@
|
||||
obj-y := enlighten.o hypercall.o grant-table.o p2m.o mm.o
|
||||
obj-y := enlighten.o hypercall.o grant-table.o p2m.o mm.o mm32.o
|
||||
|
@ -260,6 +260,12 @@ static int __init xen_guest_init(void)
|
||||
xen_domain_type = XEN_HVM_DOMAIN;
|
||||
|
||||
xen_setup_features();
|
||||
|
||||
if (!xen_feature(XENFEAT_grant_map_identity)) {
|
||||
pr_warn("Please upgrade your Xen.\n"
|
||||
"If your platform has any non-coherent DMA devices, they won't work properly.\n");
|
||||
}
|
||||
|
||||
if (xen_feature(XENFEAT_dom0))
|
||||
xen_start_info->flags |= SIF_INITDOMAIN|SIF_PRIVILEGED;
|
||||
else
|
||||
|
202
arch/arm/xen/mm32.c
Normal file
202
arch/arm/xen/mm32.c
Normal file
@ -0,0 +1,202 @@
|
||||
#include <linux/cpu.h>
|
||||
#include <linux/dma-mapping.h>
|
||||
#include <linux/gfp.h>
|
||||
#include <linux/highmem.h>
|
||||
|
||||
#include <xen/features.h>
|
||||
|
||||
static DEFINE_PER_CPU(unsigned long, xen_mm32_scratch_virt);
|
||||
static DEFINE_PER_CPU(pte_t *, xen_mm32_scratch_ptep);
|
||||
|
||||
static int alloc_xen_mm32_scratch_page(int cpu)
|
||||
{
|
||||
struct page *page;
|
||||
unsigned long virt;
|
||||
pmd_t *pmdp;
|
||||
pte_t *ptep;
|
||||
|
||||
if (per_cpu(xen_mm32_scratch_ptep, cpu) != NULL)
|
||||
return 0;
|
||||
|
||||
page = alloc_page(GFP_KERNEL);
|
||||
if (page == NULL) {
|
||||
pr_warn("Failed to allocate xen_mm32_scratch_page for cpu %d\n", cpu);
|
||||
return -ENOMEM;
|
||||
}
|
||||
|
||||
virt = (unsigned long)__va(page_to_phys(page));
|
||||
pmdp = pmd_offset(pud_offset(pgd_offset_k(virt), virt), virt);
|
||||
ptep = pte_offset_kernel(pmdp, virt);
|
||||
|
||||
per_cpu(xen_mm32_scratch_virt, cpu) = virt;
|
||||
per_cpu(xen_mm32_scratch_ptep, cpu) = ptep;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int xen_mm32_cpu_notify(struct notifier_block *self,
|
||||
unsigned long action, void *hcpu)
|
||||
{
|
||||
int cpu = (long)hcpu;
|
||||
switch (action) {
|
||||
case CPU_UP_PREPARE:
|
||||
if (alloc_xen_mm32_scratch_page(cpu))
|
||||
return NOTIFY_BAD;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
return NOTIFY_OK;
|
||||
}
|
||||
|
||||
static struct notifier_block xen_mm32_cpu_notifier = {
|
||||
.notifier_call = xen_mm32_cpu_notify,
|
||||
};
|
||||
|
||||
static void* xen_mm32_remap_page(dma_addr_t handle)
|
||||
{
|
||||
unsigned long virt = get_cpu_var(xen_mm32_scratch_virt);
|
||||
pte_t *ptep = __get_cpu_var(xen_mm32_scratch_ptep);
|
||||
|
||||
*ptep = pfn_pte(handle >> PAGE_SHIFT, PAGE_KERNEL);
|
||||
local_flush_tlb_kernel_page(virt);
|
||||
|
||||
return (void*)virt;
|
||||
}
|
||||
|
||||
static void xen_mm32_unmap(void *vaddr)
|
||||
{
|
||||
put_cpu_var(xen_mm32_scratch_virt);
|
||||
}
|
||||
|
||||
|
||||
/* functions called by SWIOTLB */
|
||||
|
||||
static void dma_cache_maint(dma_addr_t handle, unsigned long offset,
|
||||
size_t size, enum dma_data_direction dir,
|
||||
void (*op)(const void *, size_t, int))
|
||||
{
|
||||
unsigned long pfn;
|
||||
size_t left = size;
|
||||
|
||||
pfn = (handle >> PAGE_SHIFT) + offset / PAGE_SIZE;
|
||||
offset %= PAGE_SIZE;
|
||||
|
||||
do {
|
||||
size_t len = left;
|
||||
void *vaddr;
|
||||
|
||||
if (!pfn_valid(pfn))
|
||||
{
|
||||
/* Cannot map the page, we don't know its physical address.
|
||||
* Return and hope for the best */
|
||||
if (!xen_feature(XENFEAT_grant_map_identity))
|
||||
return;
|
||||
vaddr = xen_mm32_remap_page(handle) + offset;
|
||||
op(vaddr, len, dir);
|
||||
xen_mm32_unmap(vaddr - offset);
|
||||
} else {
|
||||
struct page *page = pfn_to_page(pfn);
|
||||
|
||||
if (PageHighMem(page)) {
|
||||
if (len + offset > PAGE_SIZE)
|
||||
len = PAGE_SIZE - offset;
|
||||
|
||||
if (cache_is_vipt_nonaliasing()) {
|
||||
vaddr = kmap_atomic(page);
|
||||
op(vaddr + offset, len, dir);
|
||||
kunmap_atomic(vaddr);
|
||||
} else {
|
||||
vaddr = kmap_high_get(page);
|
||||
if (vaddr) {
|
||||
op(vaddr + offset, len, dir);
|
||||
kunmap_high(page);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
vaddr = page_address(page) + offset;
|
||||
op(vaddr, len, dir);
|
||||
}
|
||||
}
|
||||
|
||||
offset = 0;
|
||||
pfn++;
|
||||
left -= len;
|
||||
} while (left);
|
||||
}
|
||||
|
||||
static void __xen_dma_page_dev_to_cpu(struct device *hwdev, dma_addr_t handle,
|
||||
size_t size, enum dma_data_direction dir)
|
||||
{
|
||||
/* Cannot use __dma_page_dev_to_cpu because we don't have a
|
||||
* struct page for handle */
|
||||
|
||||
if (dir != DMA_TO_DEVICE)
|
||||
outer_inv_range(handle, handle + size);
|
||||
|
||||
dma_cache_maint(handle & PAGE_MASK, handle & ~PAGE_MASK, size, dir, dmac_unmap_area);
|
||||
}
|
||||
|
||||
static void __xen_dma_page_cpu_to_dev(struct device *hwdev, dma_addr_t handle,
|
||||
size_t size, enum dma_data_direction dir)
|
||||
{
|
||||
|
||||
dma_cache_maint(handle & PAGE_MASK, handle & ~PAGE_MASK, size, dir, dmac_map_area);
|
||||
|
||||
if (dir == DMA_FROM_DEVICE) {
|
||||
outer_inv_range(handle, handle + size);
|
||||
} else {
|
||||
outer_clean_range(handle, handle + size);
|
||||
}
|
||||
}
|
||||
|
||||
void xen_dma_unmap_page(struct device *hwdev, dma_addr_t handle,
|
||||
size_t size, enum dma_data_direction dir,
|
||||
struct dma_attrs *attrs)
|
||||
|
||||
{
|
||||
if (!__generic_dma_ops(hwdev)->unmap_page)
|
||||
return;
|
||||
if (dma_get_attr(DMA_ATTR_SKIP_CPU_SYNC, attrs))
|
||||
return;
|
||||
|
||||
__xen_dma_page_dev_to_cpu(hwdev, handle, size, dir);
|
||||
}
|
||||
|
||||
void xen_dma_sync_single_for_cpu(struct device *hwdev,
|
||||
dma_addr_t handle, size_t size, enum dma_data_direction dir)
|
||||
{
|
||||
if (!__generic_dma_ops(hwdev)->sync_single_for_cpu)
|
||||
return;
|
||||
__xen_dma_page_dev_to_cpu(hwdev, handle, size, dir);
|
||||
}
|
||||
|
||||
void xen_dma_sync_single_for_device(struct device *hwdev,
|
||||
dma_addr_t handle, size_t size, enum dma_data_direction dir)
|
||||
{
|
||||
if (!__generic_dma_ops(hwdev)->sync_single_for_device)
|
||||
return;
|
||||
__xen_dma_page_cpu_to_dev(hwdev, handle, size, dir);
|
||||
}
|
||||
|
||||
int __init xen_mm32_init(void)
|
||||
{
|
||||
int cpu;
|
||||
|
||||
if (!xen_initial_domain())
|
||||
return 0;
|
||||
|
||||
register_cpu_notifier(&xen_mm32_cpu_notifier);
|
||||
get_online_cpus();
|
||||
for_each_online_cpu(cpu) {
|
||||
if (alloc_xen_mm32_scratch_page(cpu)) {
|
||||
put_online_cpus();
|
||||
unregister_cpu_notifier(&xen_mm32_cpu_notifier);
|
||||
return -ENOMEM;
|
||||
}
|
||||
}
|
||||
put_online_cpus();
|
||||
|
||||
return 0;
|
||||
}
|
||||
arch_initcall(xen_mm32_init);
|
@ -21,14 +21,12 @@ struct xen_p2m_entry {
|
||||
unsigned long pfn;
|
||||
unsigned long mfn;
|
||||
unsigned long nr_pages;
|
||||
struct rb_node rbnode_mach;
|
||||
struct rb_node rbnode_phys;
|
||||
};
|
||||
|
||||
static rwlock_t p2m_lock;
|
||||
struct rb_root phys_to_mach = RB_ROOT;
|
||||
EXPORT_SYMBOL_GPL(phys_to_mach);
|
||||
static struct rb_root mach_to_phys = RB_ROOT;
|
||||
|
||||
static int xen_add_phys_to_mach_entry(struct xen_p2m_entry *new)
|
||||
{
|
||||
@ -41,8 +39,6 @@ static int xen_add_phys_to_mach_entry(struct xen_p2m_entry *new)
|
||||
parent = *link;
|
||||
entry = rb_entry(parent, struct xen_p2m_entry, rbnode_phys);
|
||||
|
||||
if (new->mfn == entry->mfn)
|
||||
goto err_out;
|
||||
if (new->pfn == entry->pfn)
|
||||
goto err_out;
|
||||
|
||||
@ -88,64 +84,6 @@ unsigned long __pfn_to_mfn(unsigned long pfn)
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(__pfn_to_mfn);
|
||||
|
||||
static int xen_add_mach_to_phys_entry(struct xen_p2m_entry *new)
|
||||
{
|
||||
struct rb_node **link = &mach_to_phys.rb_node;
|
||||
struct rb_node *parent = NULL;
|
||||
struct xen_p2m_entry *entry;
|
||||
int rc = 0;
|
||||
|
||||
while (*link) {
|
||||
parent = *link;
|
||||
entry = rb_entry(parent, struct xen_p2m_entry, rbnode_mach);
|
||||
|
||||
if (new->mfn == entry->mfn)
|
||||
goto err_out;
|
||||
if (new->pfn == entry->pfn)
|
||||
goto err_out;
|
||||
|
||||
if (new->mfn < entry->mfn)
|
||||
link = &(*link)->rb_left;
|
||||
else
|
||||
link = &(*link)->rb_right;
|
||||
}
|
||||
rb_link_node(&new->rbnode_mach, parent, link);
|
||||
rb_insert_color(&new->rbnode_mach, &mach_to_phys);
|
||||
goto out;
|
||||
|
||||
err_out:
|
||||
rc = -EINVAL;
|
||||
pr_warn("%s: cannot add pfn=%pa -> mfn=%pa: pfn=%pa -> mfn=%pa already exists\n",
|
||||
__func__, &new->pfn, &new->mfn, &entry->pfn, &entry->mfn);
|
||||
out:
|
||||
return rc;
|
||||
}
|
||||
|
||||
unsigned long __mfn_to_pfn(unsigned long mfn)
|
||||
{
|
||||
struct rb_node *n = mach_to_phys.rb_node;
|
||||
struct xen_p2m_entry *entry;
|
||||
unsigned long irqflags;
|
||||
|
||||
read_lock_irqsave(&p2m_lock, irqflags);
|
||||
while (n) {
|
||||
entry = rb_entry(n, struct xen_p2m_entry, rbnode_mach);
|
||||
if (entry->mfn <= mfn &&
|
||||
entry->mfn + entry->nr_pages > mfn) {
|
||||
read_unlock_irqrestore(&p2m_lock, irqflags);
|
||||
return entry->pfn + (mfn - entry->mfn);
|
||||
}
|
||||
if (mfn < entry->mfn)
|
||||
n = n->rb_left;
|
||||
else
|
||||
n = n->rb_right;
|
||||
}
|
||||
read_unlock_irqrestore(&p2m_lock, irqflags);
|
||||
|
||||
return INVALID_P2M_ENTRY;
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(__mfn_to_pfn);
|
||||
|
||||
int set_foreign_p2m_mapping(struct gnttab_map_grant_ref *map_ops,
|
||||
struct gnttab_map_grant_ref *kmap_ops,
|
||||
struct page **pages, unsigned int count)
|
||||
@ -192,7 +130,6 @@ bool __set_phys_to_machine_multi(unsigned long pfn,
|
||||
p2m_entry = rb_entry(n, struct xen_p2m_entry, rbnode_phys);
|
||||
if (p2m_entry->pfn <= pfn &&
|
||||
p2m_entry->pfn + p2m_entry->nr_pages > pfn) {
|
||||
rb_erase(&p2m_entry->rbnode_mach, &mach_to_phys);
|
||||
rb_erase(&p2m_entry->rbnode_phys, &phys_to_mach);
|
||||
write_unlock_irqrestore(&p2m_lock, irqflags);
|
||||
kfree(p2m_entry);
|
||||
@ -217,8 +154,7 @@ bool __set_phys_to_machine_multi(unsigned long pfn,
|
||||
p2m_entry->mfn = mfn;
|
||||
|
||||
write_lock_irqsave(&p2m_lock, irqflags);
|
||||
if ((rc = xen_add_phys_to_mach_entry(p2m_entry) < 0) ||
|
||||
(rc = xen_add_mach_to_phys_entry(p2m_entry) < 0)) {
|
||||
if ((rc = xen_add_phys_to_mach_entry(p2m_entry)) < 0) {
|
||||
write_unlock_irqrestore(&p2m_lock, irqflags);
|
||||
return false;
|
||||
}
|
||||
|
@ -97,19 +97,15 @@ static bool migrate_one_irq(struct irq_desc *desc)
|
||||
if (irqd_is_per_cpu(d) || !cpumask_test_cpu(smp_processor_id(), affinity))
|
||||
return false;
|
||||
|
||||
if (cpumask_any_and(affinity, cpu_online_mask) >= nr_cpu_ids)
|
||||
if (cpumask_any_and(affinity, cpu_online_mask) >= nr_cpu_ids) {
|
||||
affinity = cpu_online_mask;
|
||||
ret = true;
|
||||
}
|
||||
|
||||
/*
|
||||
* when using forced irq_set_affinity we must ensure that the cpu
|
||||
* being offlined is not present in the affinity mask, it may be
|
||||
* selected as the target CPU otherwise
|
||||
*/
|
||||
affinity = cpu_online_mask;
|
||||
c = irq_data_get_irq_chip(d);
|
||||
if (!c->irq_set_affinity)
|
||||
pr_debug("IRQ%u: unable to set affinity\n", d->irq);
|
||||
else if (c->irq_set_affinity(d, affinity, true) == IRQ_SET_MASK_OK && ret)
|
||||
else if (c->irq_set_affinity(d, affinity, false) == IRQ_SET_MASK_OK && ret)
|
||||
cpumask_copy(d->affinity, affinity);
|
||||
|
||||
return ret;
|
||||
|
@ -230,9 +230,27 @@ void exit_thread(void)
|
||||
{
|
||||
}
|
||||
|
||||
static void tls_thread_flush(void)
|
||||
{
|
||||
asm ("msr tpidr_el0, xzr");
|
||||
|
||||
if (is_compat_task()) {
|
||||
current->thread.tp_value = 0;
|
||||
|
||||
/*
|
||||
* We need to ensure ordering between the shadow state and the
|
||||
* hardware state, so that we don't corrupt the hardware state
|
||||
* with a stale shadow state during context switch.
|
||||
*/
|
||||
barrier();
|
||||
asm ("msr tpidrro_el0, xzr");
|
||||
}
|
||||
}
|
||||
|
||||
void flush_thread(void)
|
||||
{
|
||||
fpsimd_flush_thread();
|
||||
tls_thread_flush();
|
||||
flush_ptrace_hw_breakpoint(current);
|
||||
}
|
||||
|
||||
|
@ -79,6 +79,12 @@ long compat_arm_syscall(struct pt_regs *regs)
|
||||
|
||||
case __ARM_NR_compat_set_tls:
|
||||
current->thread.tp_value = regs->regs[0];
|
||||
|
||||
/*
|
||||
* Protect against register corruption from context switch.
|
||||
* See comment in tls_thread_flush.
|
||||
*/
|
||||
barrier();
|
||||
asm ("msr tpidrro_el0, %0" : : "r" (regs->regs[0]));
|
||||
return 0;
|
||||
|
||||
|
@ -149,8 +149,7 @@ void __init arm64_memblock_init(void)
|
||||
memblock_reserve(__virt_to_phys(initrd_start), initrd_end - initrd_start);
|
||||
#endif
|
||||
|
||||
if (!efi_enabled(EFI_MEMMAP))
|
||||
early_init_fdt_scan_reserved_mem();
|
||||
early_init_fdt_scan_reserved_mem();
|
||||
|
||||
/* 4GB maximum for 32-bit only capable devices */
|
||||
if (IS_ENABLED(CONFIG_ZONE_DMA))
|
||||
|
@ -329,6 +329,6 @@
|
||||
#define __NR_sched_getattr 1337
|
||||
#define __NR_renameat2 1338
|
||||
#define __NR_getrandom 1339
|
||||
#define __NR_memfd_create 1339
|
||||
#define __NR_memfd_create 1340
|
||||
|
||||
#endif /* _UAPI_ASM_IA64_UNISTD_H */
|
||||
|
@ -38,27 +38,6 @@ static void pci_fixup_video(struct pci_dev *pdev)
|
||||
return;
|
||||
/* Maybe, this machine supports legacy memory map. */
|
||||
|
||||
if (!vga_default_device()) {
|
||||
resource_size_t start, end;
|
||||
int i;
|
||||
|
||||
/* Does firmware framebuffer belong to us? */
|
||||
for (i = 0; i < DEVICE_COUNT_RESOURCE; i++) {
|
||||
if (!(pci_resource_flags(pdev, i) & IORESOURCE_MEM))
|
||||
continue;
|
||||
|
||||
start = pci_resource_start(pdev, i);
|
||||
end = pci_resource_end(pdev, i);
|
||||
|
||||
if (!start || !end)
|
||||
continue;
|
||||
|
||||
if (screen_info.lfb_base >= start &&
|
||||
(screen_info.lfb_base + screen_info.lfb_size) < end)
|
||||
vga_set_default_device(pdev);
|
||||
}
|
||||
}
|
||||
|
||||
/* Is VGA routed to us? */
|
||||
bus = pdev->bus;
|
||||
while (bus) {
|
||||
@ -83,8 +62,7 @@ static void pci_fixup_video(struct pci_dev *pdev)
|
||||
pci_read_config_word(pdev, PCI_COMMAND, &config);
|
||||
if (config & (PCI_COMMAND_IO | PCI_COMMAND_MEMORY)) {
|
||||
pdev->resource[PCI_ROM_RESOURCE].flags |= IORESOURCE_ROM_SHADOW;
|
||||
dev_printk(KERN_DEBUG, &pdev->dev, "Boot video device\n");
|
||||
vga_set_default_device(pdev);
|
||||
dev_printk(KERN_DEBUG, &pdev->dev, "Video device with shadowed ROM\n");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -127,7 +127,7 @@ config SECCOMP
|
||||
|
||||
endmenu
|
||||
|
||||
menu "Advanced setup"
|
||||
menu "Kernel features"
|
||||
|
||||
config ADVANCED_OPTIONS
|
||||
bool "Prompt for advanced kernel configuration options"
|
||||
@ -248,10 +248,10 @@ config MICROBLAZE_64K_PAGES
|
||||
|
||||
endchoice
|
||||
|
||||
endmenu
|
||||
|
||||
source "mm/Kconfig"
|
||||
|
||||
endmenu
|
||||
|
||||
menu "Executable file formats"
|
||||
|
||||
source "fs/Kconfig.binfmt"
|
||||
|
@ -15,6 +15,7 @@
|
||||
|
||||
#include <asm/percpu.h>
|
||||
#include <asm/ptrace.h>
|
||||
#include <linux/linkage.h>
|
||||
|
||||
/*
|
||||
* These are per-cpu variables required in entry.S, among other
|
||||
|
@ -98,13 +98,13 @@ static inline int access_ok(int type, const void __user *addr,
|
||||
|
||||
if ((get_fs().seg < ((unsigned long)addr)) ||
|
||||
(get_fs().seg < ((unsigned long)addr + size - 1))) {
|
||||
pr_debug("ACCESS fail: %s at 0x%08x (size 0x%x), seg 0x%08x\n",
|
||||
pr_devel("ACCESS fail: %s at 0x%08x (size 0x%x), seg 0x%08x\n",
|
||||
type ? "WRITE" : "READ ", (__force u32)addr, (u32)size,
|
||||
(u32)get_fs().seg);
|
||||
return 0;
|
||||
}
|
||||
ok:
|
||||
pr_debug("ACCESS OK: %s at 0x%08x (size 0x%x), seg 0x%08x\n",
|
||||
pr_devel("ACCESS OK: %s at 0x%08x (size 0x%x), seg 0x%08x\n",
|
||||
type ? "WRITE" : "READ ", (__force u32)addr, (u32)size,
|
||||
(u32)get_fs().seg);
|
||||
return 1;
|
||||
|
@ -38,6 +38,6 @@
|
||||
|
||||
#endif /* __ASSEMBLY__ */
|
||||
|
||||
#define __NR_syscalls 381
|
||||
#define __NR_syscalls 387
|
||||
|
||||
#endif /* _ASM_MICROBLAZE_UNISTD_H */
|
||||
|
@ -546,6 +546,7 @@ config SGI_IP28
|
||||
# select SYS_HAS_EARLY_PRINTK
|
||||
select SYS_SUPPORTS_64BIT_KERNEL
|
||||
select SYS_SUPPORTS_BIG_ENDIAN
|
||||
select MIPS_L1_CACHE_SHIFT_7
|
||||
help
|
||||
This is the SGI Indigo2 with R10000 processor. To compile a Linux
|
||||
kernel that runs on these, say Y here.
|
||||
@ -2029,7 +2030,9 @@ config MIPS_CMP
|
||||
bool "MIPS CMP framework support (DEPRECATED)"
|
||||
depends on SYS_SUPPORTS_MIPS_CMP
|
||||
select MIPS_GIC_IPI
|
||||
select SMP
|
||||
select SYNC_R4K
|
||||
select SYS_SUPPORTS_SMP
|
||||
select WEAK_ORDERING
|
||||
default n
|
||||
help
|
||||
|
@ -113,7 +113,16 @@ predef-le += -DMIPSEL -D_MIPSEL -D__MIPSEL -D__MIPSEL__
|
||||
cflags-$(CONFIG_CPU_BIG_ENDIAN) += $(shell $(CC) -dumpmachine |grep -q 'mips.*el-.*' && echo -EB $(undef-all) $(predef-be))
|
||||
cflags-$(CONFIG_CPU_LITTLE_ENDIAN) += $(shell $(CC) -dumpmachine |grep -q 'mips.*el-.*' || echo -EL $(undef-all) $(predef-le))
|
||||
|
||||
cflags-$(CONFIG_CPU_HAS_SMARTMIPS) += $(call cc-option,-msmartmips)
|
||||
# For smartmips configurations, there are hundreds of warnings due to ISA overrides
|
||||
# in assembly and header files. smartmips is only supported for MIPS32r1 onwards
|
||||
# and there is no support for 64-bit. Various '.set mips2' or '.set mips3' or
|
||||
# similar directives in the kernel will spam the build logs with the following warnings:
|
||||
# Warning: the `smartmips' extension requires MIPS32 revision 1 or greater
|
||||
# or
|
||||
# Warning: the 64-bit MIPS architecture does not support the `smartmips' extension
|
||||
# Pass -Wa,--no-warn to disable all assembler warnings until the kernel code has
|
||||
# been fixed properly.
|
||||
cflags-$(CONFIG_CPU_HAS_SMARTMIPS) += $(call cc-option,-msmartmips) -Wa,--no-warn
|
||||
cflags-$(CONFIG_CPU_MICROMIPS) += $(call cc-option,-mmicromips)
|
||||
|
||||
cflags-$(CONFIG_SB1XXX_CORELIS) += $(call cc-option,-mno-sched-prolog) \
|
||||
|
@ -434,7 +434,7 @@ static void bcm63xx_init_irq(void)
|
||||
irq_stat_addr[0] += PERF_IRQSTAT_3368_REG;
|
||||
irq_mask_addr[0] += PERF_IRQMASK_3368_REG;
|
||||
irq_stat_addr[1] = 0;
|
||||
irq_stat_addr[1] = 0;
|
||||
irq_mask_addr[1] = 0;
|
||||
irq_bits = 32;
|
||||
ext_irq_count = 4;
|
||||
ext_irq_cfg_reg1 = PERF_EXTIRQ_CFG_REG_3368;
|
||||
@ -443,7 +443,7 @@ static void bcm63xx_init_irq(void)
|
||||
irq_stat_addr[0] += PERF_IRQSTAT_6328_REG(0);
|
||||
irq_mask_addr[0] += PERF_IRQMASK_6328_REG(0);
|
||||
irq_stat_addr[1] += PERF_IRQSTAT_6328_REG(1);
|
||||
irq_stat_addr[1] += PERF_IRQMASK_6328_REG(1);
|
||||
irq_mask_addr[1] += PERF_IRQMASK_6328_REG(1);
|
||||
irq_bits = 64;
|
||||
ext_irq_count = 4;
|
||||
is_ext_irq_cascaded = 1;
|
||||
|
@ -13,6 +13,7 @@
|
||||
|
||||
#include <linux/types.h>
|
||||
#include <linux/kernel.h>
|
||||
#include <linux/string.h>
|
||||
|
||||
#include <asm/addrspace.h>
|
||||
|
||||
|
@ -16,8 +16,8 @@
|
||||
extern void octeon_cop2_save(struct octeon_cop2_state *);
|
||||
extern void octeon_cop2_restore(struct octeon_cop2_state *);
|
||||
|
||||
#define cop2_save(r) octeon_cop2_save(r)
|
||||
#define cop2_restore(r) octeon_cop2_restore(r)
|
||||
#define cop2_save(r) octeon_cop2_save(&(r)->thread.cp2)
|
||||
#define cop2_restore(r) octeon_cop2_restore(&(r)->thread.cp2)
|
||||
|
||||
#define cop2_present 1
|
||||
#define cop2_lazy_restore 1
|
||||
@ -26,26 +26,26 @@ extern void octeon_cop2_restore(struct octeon_cop2_state *);
|
||||
|
||||
extern void nlm_cop2_save(struct nlm_cop2_state *);
|
||||
extern void nlm_cop2_restore(struct nlm_cop2_state *);
|
||||
#define cop2_save(r) nlm_cop2_save(r)
|
||||
#define cop2_restore(r) nlm_cop2_restore(r)
|
||||
|
||||
#define cop2_save(r) nlm_cop2_save(&(r)->thread.cp2)
|
||||
#define cop2_restore(r) nlm_cop2_restore(&(r)->thread.cp2)
|
||||
|
||||
#define cop2_present 1
|
||||
#define cop2_lazy_restore 0
|
||||
|
||||
#elif defined(CONFIG_CPU_LOONGSON3)
|
||||
|
||||
#define cop2_save(r)
|
||||
#define cop2_restore(r)
|
||||
|
||||
#define cop2_present 1
|
||||
#define cop2_lazy_restore 1
|
||||
#define cop2_save(r) do { (r); } while (0)
|
||||
#define cop2_restore(r) do { (r); } while (0)
|
||||
|
||||
#else
|
||||
|
||||
#define cop2_present 0
|
||||
#define cop2_lazy_restore 0
|
||||
#define cop2_save(r)
|
||||
#define cop2_restore(r)
|
||||
#define cop2_save(r) do { (r); } while (0)
|
||||
#define cop2_restore(r) do { (r); } while (0)
|
||||
#endif
|
||||
|
||||
enum cu2_ops {
|
||||
|
@ -11,15 +11,8 @@
|
||||
#ifndef _ASM_MACH_IP28_SPACES_H
|
||||
#define _ASM_MACH_IP28_SPACES_H
|
||||
|
||||
#define CAC_BASE _AC(0xa800000000000000, UL)
|
||||
|
||||
#define HIGHMEM_START (~0UL)
|
||||
|
||||
#define PHYS_OFFSET _AC(0x20000000, UL)
|
||||
|
||||
#define UNCAC_BASE _AC(0xc0000000, UL) /* 0xa0000000 + PHYS_OFFSET */
|
||||
#define IO_BASE UNCAC_BASE
|
||||
|
||||
#include <asm/mach-generic/spaces.h>
|
||||
|
||||
#endif /* _ASM_MACH_IP28_SPACES_H */
|
||||
|
@ -37,7 +37,7 @@
|
||||
|
||||
/*
|
||||
* This is used for calculating the real page sizes
|
||||
* for FTLB or VTLB + FTLB confugrations.
|
||||
* for FTLB or VTLB + FTLB configurations.
|
||||
*/
|
||||
static inline unsigned int page_size_ftlb(unsigned int mmuextdef)
|
||||
{
|
||||
@ -223,7 +223,8 @@ static inline int pfn_valid(unsigned long pfn)
|
||||
|
||||
#endif
|
||||
|
||||
#define virt_to_page(kaddr) pfn_to_page(PFN_DOWN(virt_to_phys(kaddr)))
|
||||
#define virt_to_page(kaddr) pfn_to_page(PFN_DOWN(virt_to_phys((void *) \
|
||||
(kaddr))))
|
||||
|
||||
extern int __virt_addr_valid(const volatile void *kaddr);
|
||||
#define virt_addr_valid(kaddr) \
|
||||
|
@ -37,11 +37,6 @@ extern int __cpu_logical_map[NR_CPUS];
|
||||
|
||||
#define NO_PROC_ID (-1)
|
||||
|
||||
#define topology_physical_package_id(cpu) (cpu_data[cpu].package)
|
||||
#define topology_core_id(cpu) (cpu_data[cpu].core)
|
||||
#define topology_core_cpumask(cpu) (&cpu_core_map[cpu])
|
||||
#define topology_thread_cpumask(cpu) (&cpu_sibling_map[cpu])
|
||||
|
||||
#define SMP_RESCHEDULE_YOURSELF 0x1 /* XXX braindead */
|
||||
#define SMP_CALL_FUNCTION 0x2
|
||||
/* Octeon - Tell another core to flush its icache */
|
||||
|
@ -92,7 +92,7 @@ do { \
|
||||
KSTK_STATUS(prev) &= ~ST0_CU2; \
|
||||
__c0_stat = read_c0_status(); \
|
||||
write_c0_status(__c0_stat | ST0_CU2); \
|
||||
cop2_save(&prev->thread.cp2); \
|
||||
cop2_save(prev); \
|
||||
write_c0_status(__c0_stat & ~ST0_CU2); \
|
||||
} \
|
||||
__clear_software_ll_bit(); \
|
||||
@ -111,7 +111,7 @@ do { \
|
||||
(KSTK_STATUS(current) & ST0_CU2)) { \
|
||||
__c0_stat = read_c0_status(); \
|
||||
write_c0_status(__c0_stat | ST0_CU2); \
|
||||
cop2_restore(¤t->thread.cp2); \
|
||||
cop2_restore(current); \
|
||||
write_c0_status(__c0_stat & ~ST0_CU2); \
|
||||
} \
|
||||
if (cpu_has_dsp) \
|
||||
|
@ -9,5 +9,13 @@
|
||||
#define __ASM_TOPOLOGY_H
|
||||
|
||||
#include <topology.h>
|
||||
#include <linux/smp.h>
|
||||
|
||||
#ifdef CONFIG_SMP
|
||||
#define topology_physical_package_id(cpu) (cpu_data[cpu].package)
|
||||
#define topology_core_id(cpu) (cpu_data[cpu].core)
|
||||
#define topology_core_cpumask(cpu) (&cpu_core_map[cpu])
|
||||
#define topology_thread_cpumask(cpu) (&cpu_sibling_map[cpu])
|
||||
#endif
|
||||
|
||||
#endif /* __ASM_TOPOLOGY_H */
|
||||
|
@ -373,16 +373,18 @@
|
||||
#define __NR_sched_getattr (__NR_Linux + 350)
|
||||
#define __NR_renameat2 (__NR_Linux + 351)
|
||||
#define __NR_seccomp (__NR_Linux + 352)
|
||||
#define __NR_getrandom (__NR_Linux + 353)
|
||||
#define __NR_memfd_create (__NR_Linux + 354)
|
||||
|
||||
/*
|
||||
* Offset of the last Linux o32 flavoured syscall
|
||||
*/
|
||||
#define __NR_Linux_syscalls 352
|
||||
#define __NR_Linux_syscalls 354
|
||||
|
||||
#endif /* _MIPS_SIM == _MIPS_SIM_ABI32 */
|
||||
|
||||
#define __NR_O32_Linux 4000
|
||||
#define __NR_O32_Linux_syscalls 352
|
||||
#define __NR_O32_Linux_syscalls 354
|
||||
|
||||
#if _MIPS_SIM == _MIPS_SIM_ABI64
|
||||
|
||||
@ -703,16 +705,18 @@
|
||||
#define __NR_sched_getattr (__NR_Linux + 310)
|
||||
#define __NR_renameat2 (__NR_Linux + 311)
|
||||
#define __NR_seccomp (__NR_Linux + 312)
|
||||
#define __NR_getrandom (__NR_Linux + 313)
|
||||
#define __NR_memfd_create (__NR_Linux + 314)
|
||||
|
||||
/*
|
||||
* Offset of the last Linux 64-bit flavoured syscall
|
||||
*/
|
||||
#define __NR_Linux_syscalls 312
|
||||
#define __NR_Linux_syscalls 314
|
||||
|
||||
#endif /* _MIPS_SIM == _MIPS_SIM_ABI64 */
|
||||
|
||||
#define __NR_64_Linux 5000
|
||||
#define __NR_64_Linux_syscalls 312
|
||||
#define __NR_64_Linux_syscalls 314
|
||||
|
||||
#if _MIPS_SIM == _MIPS_SIM_NABI32
|
||||
|
||||
@ -1037,15 +1041,17 @@
|
||||
#define __NR_sched_getattr (__NR_Linux + 314)
|
||||
#define __NR_renameat2 (__NR_Linux + 315)
|
||||
#define __NR_seccomp (__NR_Linux + 316)
|
||||
#define __NR_getrandom (__NR_Linux + 317)
|
||||
#define __NR_memfd_create (__NR_Linux + 318)
|
||||
|
||||
/*
|
||||
* Offset of the last N32 flavoured syscall
|
||||
*/
|
||||
#define __NR_Linux_syscalls 316
|
||||
#define __NR_Linux_syscalls 318
|
||||
|
||||
#endif /* _MIPS_SIM == _MIPS_SIM_NABI32 */
|
||||
|
||||
#define __NR_N32_Linux 6000
|
||||
#define __NR_N32_Linux_syscalls 316
|
||||
#define __NR_N32_Linux_syscalls 318
|
||||
|
||||
#endif /* _UAPI_ASM_UNISTD_H */
|
||||
|
@ -71,8 +71,12 @@ machine_kexec(struct kimage *image)
|
||||
kexec_start_address =
|
||||
(unsigned long) phys_to_virt(image->start);
|
||||
|
||||
kexec_indirection_page =
|
||||
(unsigned long) phys_to_virt(image->head & PAGE_MASK);
|
||||
if (image->type == KEXEC_TYPE_DEFAULT) {
|
||||
kexec_indirection_page =
|
||||
(unsigned long) phys_to_virt(image->head & PAGE_MASK);
|
||||
} else {
|
||||
kexec_indirection_page = (unsigned long)&image->head;
|
||||
}
|
||||
|
||||
memcpy((void*)reboot_code_buffer, relocate_new_kernel,
|
||||
relocate_new_kernel_size);
|
||||
|
@ -577,3 +577,5 @@ EXPORT(sys_call_table)
|
||||
PTR sys_sched_getattr /* 4350 */
|
||||
PTR sys_renameat2
|
||||
PTR sys_seccomp
|
||||
PTR sys_getrandom
|
||||
PTR sys_memfd_create
|
||||
|
@ -432,4 +432,6 @@ EXPORT(sys_call_table)
|
||||
PTR sys_sched_getattr /* 5310 */
|
||||
PTR sys_renameat2
|
||||
PTR sys_seccomp
|
||||
PTR sys_getrandom
|
||||
PTR sys_memfd_create
|
||||
.size sys_call_table,.-sys_call_table
|
||||
|
@ -425,4 +425,6 @@ EXPORT(sysn32_call_table)
|
||||
PTR sys_sched_getattr
|
||||
PTR sys_renameat2 /* 6315 */
|
||||
PTR sys_seccomp
|
||||
PTR sys_getrandom
|
||||
PTR sys_memfd_create
|
||||
.size sysn32_call_table,.-sysn32_call_table
|
||||
|
@ -562,4 +562,6 @@ EXPORT(sys32_call_table)
|
||||
PTR sys_sched_getattr /* 4350 */
|
||||
PTR sys_renameat2
|
||||
PTR sys_seccomp
|
||||
PTR sys_getrandom
|
||||
PTR sys_memfd_create
|
||||
.size sys32_call_table,.-sys32_call_table
|
||||
|
@ -53,6 +53,7 @@
|
||||
*/
|
||||
unsigned long empty_zero_page, zero_page_mask;
|
||||
EXPORT_SYMBOL_GPL(empty_zero_page);
|
||||
EXPORT_SYMBOL(zero_page_mask);
|
||||
|
||||
/*
|
||||
* Not static inline because used by IP27 special magic initialization code
|
||||
|
@ -772,6 +772,7 @@ static int build_body(struct jit_ctx *ctx)
|
||||
const struct sock_filter *inst;
|
||||
unsigned int i, off, load_order, condt;
|
||||
u32 k, b_off __maybe_unused;
|
||||
int tmp;
|
||||
|
||||
for (i = 0; i < prog->len; i++) {
|
||||
u16 code;
|
||||
|
@ -321,6 +321,22 @@ source "fs/Kconfig"
|
||||
|
||||
source "arch/parisc/Kconfig.debug"
|
||||
|
||||
config SECCOMP
|
||||
def_bool y
|
||||
prompt "Enable seccomp to safely compute untrusted bytecode"
|
||||
---help---
|
||||
This kernel feature is useful for number crunching applications
|
||||
that may need to compute untrusted bytecode during their
|
||||
execution. By using pipes or other transports made available to
|
||||
the process as file descriptors supporting the read/write
|
||||
syscalls, it's possible to isolate those applications in
|
||||
their own address space using seccomp. Once seccomp is
|
||||
enabled via prctl(PR_SET_SECCOMP), it cannot be disabled
|
||||
and the task is only allowed to execute a few safe syscalls
|
||||
defined by each seccomp mode.
|
||||
|
||||
If unsure, say Y. Only embedded should say N here.
|
||||
|
||||
source "security/Kconfig"
|
||||
|
||||
source "crypto/Kconfig"
|
||||
|
@ -456,7 +456,7 @@ int hpux_sysfs(int opcode, unsigned long arg1, unsigned long arg2)
|
||||
}
|
||||
|
||||
/* String could be altered by userspace after strlen_user() */
|
||||
fsname[len] = '\0';
|
||||
fsname[len - 1] = '\0';
|
||||
|
||||
printk(KERN_DEBUG "that is '%s' as (char *)\n", fsname);
|
||||
if ( !strcmp(fsname, "hfs") ) {
|
||||
|
16
arch/parisc/include/asm/seccomp.h
Normal file
16
arch/parisc/include/asm/seccomp.h
Normal file
@ -0,0 +1,16 @@
|
||||
#ifndef _ASM_PARISC_SECCOMP_H
|
||||
#define _ASM_PARISC_SECCOMP_H
|
||||
|
||||
#include <linux/unistd.h>
|
||||
|
||||
#define __NR_seccomp_read __NR_read
|
||||
#define __NR_seccomp_write __NR_write
|
||||
#define __NR_seccomp_exit __NR_exit
|
||||
#define __NR_seccomp_sigreturn __NR_rt_sigreturn
|
||||
|
||||
#define __NR_seccomp_read_32 __NR_read
|
||||
#define __NR_seccomp_write_32 __NR_write
|
||||
#define __NR_seccomp_exit_32 __NR_exit
|
||||
#define __NR_seccomp_sigreturn_32 __NR_rt_sigreturn
|
||||
|
||||
#endif /* _ASM_PARISC_SECCOMP_H */
|
@ -60,6 +60,7 @@ struct thread_info {
|
||||
#define TIF_NOTIFY_RESUME 8 /* callback before returning to user */
|
||||
#define TIF_SINGLESTEP 9 /* single stepping? */
|
||||
#define TIF_BLOCKSTEP 10 /* branch stepping? */
|
||||
#define TIF_SECCOMP 11 /* secure computing */
|
||||
|
||||
#define _TIF_SYSCALL_TRACE (1 << TIF_SYSCALL_TRACE)
|
||||
#define _TIF_SIGPENDING (1 << TIF_SIGPENDING)
|
||||
@ -70,11 +71,13 @@ struct thread_info {
|
||||
#define _TIF_NOTIFY_RESUME (1 << TIF_NOTIFY_RESUME)
|
||||
#define _TIF_SINGLESTEP (1 << TIF_SINGLESTEP)
|
||||
#define _TIF_BLOCKSTEP (1 << TIF_BLOCKSTEP)
|
||||
#define _TIF_SECCOMP (1 << TIF_SECCOMP)
|
||||
|
||||
#define _TIF_USER_WORK_MASK (_TIF_SIGPENDING | _TIF_NOTIFY_RESUME | \
|
||||
_TIF_NEED_RESCHED)
|
||||
#define _TIF_SYSCALL_TRACE_MASK (_TIF_SYSCALL_TRACE | _TIF_SINGLESTEP | \
|
||||
_TIF_BLOCKSTEP | _TIF_SYSCALL_AUDIT)
|
||||
_TIF_BLOCKSTEP | _TIF_SYSCALL_AUDIT | \
|
||||
_TIF_SECCOMP)
|
||||
|
||||
#ifdef CONFIG_64BIT
|
||||
# ifdef CONFIG_COMPAT
|
||||
|
@ -830,8 +830,11 @@
|
||||
#define __NR_sched_getattr (__NR_Linux + 335)
|
||||
#define __NR_utimes (__NR_Linux + 336)
|
||||
#define __NR_renameat2 (__NR_Linux + 337)
|
||||
#define __NR_seccomp (__NR_Linux + 338)
|
||||
#define __NR_getrandom (__NR_Linux + 339)
|
||||
#define __NR_memfd_create (__NR_Linux + 340)
|
||||
|
||||
#define __NR_Linux_syscalls (__NR_renameat2 + 1)
|
||||
#define __NR_Linux_syscalls (__NR_memfd_create + 1)
|
||||
|
||||
|
||||
#define __IGNORE_select /* newselect */
|
||||
|
@ -270,6 +270,12 @@ long do_syscall_trace_enter(struct pt_regs *regs)
|
||||
{
|
||||
long ret = 0;
|
||||
|
||||
/* Do the secure computing check first. */
|
||||
if (secure_computing(regs->gr[20])) {
|
||||
/* seccomp failures shouldn't expose any additional code. */
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (test_thread_flag(TIF_SYSCALL_TRACE) &&
|
||||
tracehook_report_syscall_entry(regs))
|
||||
ret = -1L;
|
||||
|
@ -74,7 +74,7 @@ ENTRY(linux_gateway_page)
|
||||
/* ADDRESS 0xb0 to 0xb8, lws uses two insns for entry */
|
||||
/* Light-weight-syscall entry must always be located at 0xb0 */
|
||||
/* WARNING: Keep this number updated with table size changes */
|
||||
#define __NR_lws_entries (2)
|
||||
#define __NR_lws_entries (3)
|
||||
|
||||
lws_entry:
|
||||
gate lws_start, %r0 /* increase privilege */
|
||||
@ -502,7 +502,7 @@ lws_exit:
|
||||
|
||||
|
||||
/***************************************************
|
||||
Implementing CAS as an atomic operation:
|
||||
Implementing 32bit CAS as an atomic operation:
|
||||
|
||||
%r26 - Address to examine
|
||||
%r25 - Old value to check (old)
|
||||
@ -659,6 +659,230 @@ cas_action:
|
||||
ASM_EXCEPTIONTABLE_ENTRY(2b-linux_gateway_page, 3b-linux_gateway_page)
|
||||
|
||||
|
||||
/***************************************************
|
||||
New CAS implementation which uses pointers and variable size
|
||||
information. The value pointed by old and new MUST NOT change
|
||||
while performing CAS. The lock only protect the value at %r26.
|
||||
|
||||
%r26 - Address to examine
|
||||
%r25 - Pointer to the value to check (old)
|
||||
%r24 - Pointer to the value to set (new)
|
||||
%r23 - Size of the variable (0/1/2/3 for 8/16/32/64 bit)
|
||||
%r28 - Return non-zero on failure
|
||||
%r21 - Kernel error code
|
||||
|
||||
%r21 has the following meanings:
|
||||
|
||||
EAGAIN - CAS is busy, ldcw failed, try again.
|
||||
EFAULT - Read or write failed.
|
||||
|
||||
Scratch: r20, r22, r28, r29, r1, fr4 (32bit for 64bit CAS only)
|
||||
|
||||
****************************************************/
|
||||
|
||||
/* ELF32 Process entry path */
|
||||
lws_compare_and_swap_2:
|
||||
#ifdef CONFIG_64BIT
|
||||
/* Clip the input registers */
|
||||
depdi 0, 31, 32, %r26
|
||||
depdi 0, 31, 32, %r25
|
||||
depdi 0, 31, 32, %r24
|
||||
depdi 0, 31, 32, %r23
|
||||
#endif
|
||||
|
||||
/* Check the validity of the size pointer */
|
||||
subi,>>= 4, %r23, %r0
|
||||
b,n lws_exit_nosys
|
||||
|
||||
/* Jump to the functions which will load the old and new values into
|
||||
registers depending on the their size */
|
||||
shlw %r23, 2, %r29
|
||||
blr %r29, %r0
|
||||
nop
|
||||
|
||||
/* 8bit load */
|
||||
4: ldb 0(%sr3,%r25), %r25
|
||||
b cas2_lock_start
|
||||
5: ldb 0(%sr3,%r24), %r24
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
|
||||
/* 16bit load */
|
||||
6: ldh 0(%sr3,%r25), %r25
|
||||
b cas2_lock_start
|
||||
7: ldh 0(%sr3,%r24), %r24
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
|
||||
/* 32bit load */
|
||||
8: ldw 0(%sr3,%r25), %r25
|
||||
b cas2_lock_start
|
||||
9: ldw 0(%sr3,%r24), %r24
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
|
||||
/* 64bit load */
|
||||
#ifdef CONFIG_64BIT
|
||||
10: ldd 0(%sr3,%r25), %r25
|
||||
11: ldd 0(%sr3,%r24), %r24
|
||||
#else
|
||||
/* Load new value into r22/r23 - high/low */
|
||||
10: ldw 0(%sr3,%r25), %r22
|
||||
11: ldw 4(%sr3,%r25), %r23
|
||||
/* Load new value into fr4 for atomic store later */
|
||||
12: flddx 0(%sr3,%r24), %fr4
|
||||
#endif
|
||||
|
||||
cas2_lock_start:
|
||||
/* Load start of lock table */
|
||||
ldil L%lws_lock_start, %r20
|
||||
ldo R%lws_lock_start(%r20), %r28
|
||||
|
||||
/* Extract four bits from r26 and hash lock (Bits 4-7) */
|
||||
extru %r26, 27, 4, %r20
|
||||
|
||||
/* Find lock to use, the hash is either one of 0 to
|
||||
15, multiplied by 16 (keep it 16-byte aligned)
|
||||
and add to the lock table offset. */
|
||||
shlw %r20, 4, %r20
|
||||
add %r20, %r28, %r20
|
||||
|
||||
rsm PSW_SM_I, %r0 /* Disable interrupts */
|
||||
/* COW breaks can cause contention on UP systems */
|
||||
LDCW 0(%sr2,%r20), %r28 /* Try to acquire the lock */
|
||||
cmpb,<>,n %r0, %r28, cas2_action /* Did we get it? */
|
||||
cas2_wouldblock:
|
||||
ldo 2(%r0), %r28 /* 2nd case */
|
||||
ssm PSW_SM_I, %r0
|
||||
b lws_exit /* Contended... */
|
||||
ldo -EAGAIN(%r0), %r21 /* Spin in userspace */
|
||||
|
||||
/*
|
||||
prev = *addr;
|
||||
if ( prev == old )
|
||||
*addr = new;
|
||||
return prev;
|
||||
*/
|
||||
|
||||
/* NOTES:
|
||||
This all works becuse intr_do_signal
|
||||
and schedule both check the return iasq
|
||||
and see that we are on the kernel page
|
||||
so this process is never scheduled off
|
||||
or is ever sent any signal of any sort,
|
||||
thus it is wholly atomic from usrspaces
|
||||
perspective
|
||||
*/
|
||||
cas2_action:
|
||||
/* Jump to the correct function */
|
||||
blr %r29, %r0
|
||||
/* Set %r28 as non-zero for now */
|
||||
ldo 1(%r0),%r28
|
||||
|
||||
/* 8bit CAS */
|
||||
13: ldb,ma 0(%sr3,%r26), %r29
|
||||
sub,= %r29, %r25, %r0
|
||||
b,n cas2_end
|
||||
14: stb,ma %r24, 0(%sr3,%r26)
|
||||
b cas2_end
|
||||
copy %r0, %r28
|
||||
nop
|
||||
nop
|
||||
|
||||
/* 16bit CAS */
|
||||
15: ldh,ma 0(%sr3,%r26), %r29
|
||||
sub,= %r29, %r25, %r0
|
||||
b,n cas2_end
|
||||
16: sth,ma %r24, 0(%sr3,%r26)
|
||||
b cas2_end
|
||||
copy %r0, %r28
|
||||
nop
|
||||
nop
|
||||
|
||||
/* 32bit CAS */
|
||||
17: ldw,ma 0(%sr3,%r26), %r29
|
||||
sub,= %r29, %r25, %r0
|
||||
b,n cas2_end
|
||||
18: stw,ma %r24, 0(%sr3,%r26)
|
||||
b cas2_end
|
||||
copy %r0, %r28
|
||||
nop
|
||||
nop
|
||||
|
||||
/* 64bit CAS */
|
||||
#ifdef CONFIG_64BIT
|
||||
19: ldd,ma 0(%sr3,%r26), %r29
|
||||
sub,= %r29, %r25, %r0
|
||||
b,n cas2_end
|
||||
20: std,ma %r24, 0(%sr3,%r26)
|
||||
copy %r0, %r28
|
||||
#else
|
||||
/* Compare first word */
|
||||
19: ldw,ma 0(%sr3,%r26), %r29
|
||||
sub,= %r29, %r22, %r0
|
||||
b,n cas2_end
|
||||
/* Compare second word */
|
||||
20: ldw,ma 4(%sr3,%r26), %r29
|
||||
sub,= %r29, %r23, %r0
|
||||
b,n cas2_end
|
||||
/* Perform the store */
|
||||
21: fstdx %fr4, 0(%sr3,%r26)
|
||||
copy %r0, %r28
|
||||
#endif
|
||||
|
||||
cas2_end:
|
||||
/* Free lock */
|
||||
stw,ma %r20, 0(%sr2,%r20)
|
||||
/* Enable interrupts */
|
||||
ssm PSW_SM_I, %r0
|
||||
/* Return to userspace, set no error */
|
||||
b lws_exit
|
||||
copy %r0, %r21
|
||||
|
||||
22:
|
||||
/* Error occurred on load or store */
|
||||
/* Free lock */
|
||||
stw %r20, 0(%sr2,%r20)
|
||||
ssm PSW_SM_I, %r0
|
||||
ldo 1(%r0),%r28
|
||||
b lws_exit
|
||||
ldo -EFAULT(%r0),%r21 /* set errno */
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
|
||||
/* Exception table entries, for the load and store, return EFAULT.
|
||||
Each of the entries must be relocated. */
|
||||
ASM_EXCEPTIONTABLE_ENTRY(4b-linux_gateway_page, 22b-linux_gateway_page)
|
||||
ASM_EXCEPTIONTABLE_ENTRY(5b-linux_gateway_page, 22b-linux_gateway_page)
|
||||
ASM_EXCEPTIONTABLE_ENTRY(6b-linux_gateway_page, 22b-linux_gateway_page)
|
||||
ASM_EXCEPTIONTABLE_ENTRY(7b-linux_gateway_page, 22b-linux_gateway_page)
|
||||
ASM_EXCEPTIONTABLE_ENTRY(8b-linux_gateway_page, 22b-linux_gateway_page)
|
||||
ASM_EXCEPTIONTABLE_ENTRY(9b-linux_gateway_page, 22b-linux_gateway_page)
|
||||
ASM_EXCEPTIONTABLE_ENTRY(10b-linux_gateway_page, 22b-linux_gateway_page)
|
||||
ASM_EXCEPTIONTABLE_ENTRY(11b-linux_gateway_page, 22b-linux_gateway_page)
|
||||
ASM_EXCEPTIONTABLE_ENTRY(13b-linux_gateway_page, 22b-linux_gateway_page)
|
||||
ASM_EXCEPTIONTABLE_ENTRY(14b-linux_gateway_page, 22b-linux_gateway_page)
|
||||
ASM_EXCEPTIONTABLE_ENTRY(15b-linux_gateway_page, 22b-linux_gateway_page)
|
||||
ASM_EXCEPTIONTABLE_ENTRY(16b-linux_gateway_page, 22b-linux_gateway_page)
|
||||
ASM_EXCEPTIONTABLE_ENTRY(17b-linux_gateway_page, 22b-linux_gateway_page)
|
||||
ASM_EXCEPTIONTABLE_ENTRY(18b-linux_gateway_page, 22b-linux_gateway_page)
|
||||
ASM_EXCEPTIONTABLE_ENTRY(19b-linux_gateway_page, 22b-linux_gateway_page)
|
||||
ASM_EXCEPTIONTABLE_ENTRY(20b-linux_gateway_page, 22b-linux_gateway_page)
|
||||
#ifndef CONFIG_64BIT
|
||||
ASM_EXCEPTIONTABLE_ENTRY(12b-linux_gateway_page, 22b-linux_gateway_page)
|
||||
ASM_EXCEPTIONTABLE_ENTRY(21b-linux_gateway_page, 22b-linux_gateway_page)
|
||||
#endif
|
||||
|
||||
/* Make sure nothing else is placed on this page */
|
||||
.align PAGE_SIZE
|
||||
END(linux_gateway_page)
|
||||
@ -675,8 +899,9 @@ ENTRY(end_linux_gateway_page)
|
||||
/* Light-weight-syscall table */
|
||||
/* Start of lws table. */
|
||||
ENTRY(lws_table)
|
||||
LWS_ENTRY(compare_and_swap32) /* 0 - ELF32 Atomic compare and swap */
|
||||
LWS_ENTRY(compare_and_swap64) /* 1 - ELF64 Atomic compare and swap */
|
||||
LWS_ENTRY(compare_and_swap32) /* 0 - ELF32 Atomic 32bit CAS */
|
||||
LWS_ENTRY(compare_and_swap64) /* 1 - ELF64 Atomic 32bit CAS */
|
||||
LWS_ENTRY(compare_and_swap_2) /* 2 - ELF32 Atomic 64bit CAS */
|
||||
END(lws_table)
|
||||
/* End of lws table */
|
||||
|
||||
|
@ -433,6 +433,9 @@
|
||||
ENTRY_SAME(sched_getattr) /* 335 */
|
||||
ENTRY_COMP(utimes)
|
||||
ENTRY_SAME(renameat2)
|
||||
ENTRY_SAME(seccomp)
|
||||
ENTRY_SAME(getrandom)
|
||||
ENTRY_SAME(memfd_create) /* 340 */
|
||||
|
||||
/* Nothing yet */
|
||||
|
||||
|
@ -5,6 +5,7 @@ CONFIG_SMP=y
|
||||
CONFIG_NR_CPUS=4
|
||||
CONFIG_EXPERIMENTAL=y
|
||||
CONFIG_SYSVIPC=y
|
||||
CONFIG_FHANDLE=y
|
||||
CONFIG_IKCONFIG=y
|
||||
CONFIG_IKCONFIG_PROC=y
|
||||
CONFIG_LOG_BUF_SHIFT=15
|
||||
|
@ -5,6 +5,7 @@ CONFIG_SMP=y
|
||||
CONFIG_NR_CPUS=4
|
||||
CONFIG_EXPERIMENTAL=y
|
||||
CONFIG_SYSVIPC=y
|
||||
CONFIG_FHANDLE=y
|
||||
CONFIG_IKCONFIG=y
|
||||
CONFIG_IKCONFIG_PROC=y
|
||||
CONFIG_LOG_BUF_SHIFT=15
|
||||
|
@ -4,6 +4,7 @@ CONFIG_ALTIVEC=y
|
||||
CONFIG_SMP=y
|
||||
CONFIG_NR_CPUS=24
|
||||
CONFIG_SYSVIPC=y
|
||||
CONFIG_FHANDLE=y
|
||||
CONFIG_IRQ_DOMAIN_DEBUG=y
|
||||
CONFIG_NO_HZ=y
|
||||
CONFIG_HIGH_RES_TIMERS=y
|
||||
|
@ -5,6 +5,7 @@ CONFIG_NR_CPUS=4
|
||||
CONFIG_EXPERIMENTAL=y
|
||||
CONFIG_SYSVIPC=y
|
||||
CONFIG_POSIX_MQUEUE=y
|
||||
CONFIG_FHANDLE=y
|
||||
CONFIG_IKCONFIG=y
|
||||
CONFIG_IKCONFIG_PROC=y
|
||||
CONFIG_BLK_DEV_INITRD=y
|
||||
|
@ -4,6 +4,7 @@ CONFIG_NR_CPUS=4
|
||||
CONFIG_EXPERIMENTAL=y
|
||||
CONFIG_SYSVIPC=y
|
||||
CONFIG_POSIX_MQUEUE=y
|
||||
CONFIG_FHANDLE=y
|
||||
CONFIG_IKCONFIG=y
|
||||
CONFIG_IKCONFIG_PROC=y
|
||||
# CONFIG_COMPAT_BRK is not set
|
||||
|
@ -3,6 +3,7 @@ CONFIG_ALTIVEC=y
|
||||
CONFIG_SMP=y
|
||||
CONFIG_NR_CPUS=2
|
||||
CONFIG_SYSVIPC=y
|
||||
CONFIG_FHANDLE=y
|
||||
CONFIG_NO_HZ=y
|
||||
CONFIG_HIGH_RES_TIMERS=y
|
||||
CONFIG_BLK_DEV_INITRD=y
|
||||
|
@ -4,6 +4,7 @@ CONFIG_VSX=y
|
||||
CONFIG_SMP=y
|
||||
CONFIG_SYSVIPC=y
|
||||
CONFIG_POSIX_MQUEUE=y
|
||||
CONFIG_FHANDLE=y
|
||||
CONFIG_IRQ_DOMAIN_DEBUG=y
|
||||
CONFIG_NO_HZ=y
|
||||
CONFIG_HIGH_RES_TIMERS=y
|
||||
|
@ -3,6 +3,7 @@ CONFIG_PPC_BOOK3E_64=y
|
||||
CONFIG_SMP=y
|
||||
CONFIG_SYSVIPC=y
|
||||
CONFIG_POSIX_MQUEUE=y
|
||||
CONFIG_FHANDLE=y
|
||||
CONFIG_NO_HZ=y
|
||||
CONFIG_HIGH_RES_TIMERS=y
|
||||
CONFIG_TASKSTATS=y
|
||||
|
@ -5,6 +5,7 @@ CONFIG_SMP=y
|
||||
CONFIG_NR_CPUS=2
|
||||
CONFIG_SYSVIPC=y
|
||||
CONFIG_POSIX_MQUEUE=y
|
||||
CONFIG_FHANDLE=y
|
||||
CONFIG_HIGH_RES_TIMERS=y
|
||||
CONFIG_BLK_DEV_INITRD=y
|
||||
CONFIG_RD_LZMA=y
|
||||
|
@ -5,6 +5,7 @@ CONFIG_SMP=y
|
||||
CONFIG_NR_CPUS=2048
|
||||
CONFIG_SYSVIPC=y
|
||||
CONFIG_POSIX_MQUEUE=y
|
||||
CONFIG_FHANDLE=y
|
||||
CONFIG_AUDIT=y
|
||||
CONFIG_AUDITSYSCALL=y
|
||||
CONFIG_IRQ_DOMAIN_DEBUG=y
|
||||
|
@ -6,6 +6,7 @@ CONFIG_NR_CPUS=2048
|
||||
CONFIG_CPU_LITTLE_ENDIAN=y
|
||||
CONFIG_SYSVIPC=y
|
||||
CONFIG_POSIX_MQUEUE=y
|
||||
CONFIG_FHANDLE=y
|
||||
CONFIG_AUDIT=y
|
||||
CONFIG_AUDITSYSCALL=y
|
||||
CONFIG_IRQ_DOMAIN_DEBUG=y
|
||||
|
@ -47,6 +47,12 @@
|
||||
STACK_FRAME_OVERHEAD + KERNEL_REDZONE_SIZE)
|
||||
#define STACK_FRAME_MARKER 12
|
||||
|
||||
#if defined(_CALL_ELF) && _CALL_ELF == 2
|
||||
#define STACK_FRAME_MIN_SIZE 32
|
||||
#else
|
||||
#define STACK_FRAME_MIN_SIZE STACK_FRAME_OVERHEAD
|
||||
#endif
|
||||
|
||||
/* Size of dummy stack frame allocated when calling signal handler. */
|
||||
#define __SIGNAL_FRAMESIZE 128
|
||||
#define __SIGNAL_FRAMESIZE32 64
|
||||
@ -60,6 +66,7 @@
|
||||
#define STACK_FRAME_REGS_MARKER ASM_CONST(0x72656773)
|
||||
#define STACK_INT_FRAME_SIZE (sizeof(struct pt_regs) + STACK_FRAME_OVERHEAD)
|
||||
#define STACK_FRAME_MARKER 2
|
||||
#define STACK_FRAME_MIN_SIZE STACK_FRAME_OVERHEAD
|
||||
|
||||
/* Size of stack frame allocated when calling signal handler. */
|
||||
#define __SIGNAL_FRAMESIZE 64
|
||||
|
@ -362,3 +362,6 @@ SYSCALL(ni_syscall) /* sys_kcmp */
|
||||
SYSCALL_SPU(sched_setattr)
|
||||
SYSCALL_SPU(sched_getattr)
|
||||
SYSCALL_SPU(renameat2)
|
||||
SYSCALL_SPU(seccomp)
|
||||
SYSCALL_SPU(getrandom)
|
||||
SYSCALL_SPU(memfd_create)
|
||||
|
@ -12,7 +12,7 @@
|
||||
#include <uapi/asm/unistd.h>
|
||||
|
||||
|
||||
#define __NR_syscalls 358
|
||||
#define __NR_syscalls 361
|
||||
|
||||
#define __NR__exit __NR_exit
|
||||
#define NR_syscalls __NR_syscalls
|
||||
|
@ -380,5 +380,8 @@
|
||||
#define __NR_sched_setattr 355
|
||||
#define __NR_sched_getattr 356
|
||||
#define __NR_renameat2 357
|
||||
#define __NR_seccomp 358
|
||||
#define __NR_getrandom 359
|
||||
#define __NR_memfd_create 360
|
||||
|
||||
#endif /* _UAPI_ASM_POWERPC_UNISTD_H_ */
|
||||
|
@ -35,7 +35,7 @@ static int valid_next_sp(unsigned long sp, unsigned long prev_sp)
|
||||
return 0; /* must be 16-byte aligned */
|
||||
if (!validate_sp(sp, current, STACK_FRAME_OVERHEAD))
|
||||
return 0;
|
||||
if (sp >= prev_sp + STACK_FRAME_OVERHEAD)
|
||||
if (sp >= prev_sp + STACK_FRAME_MIN_SIZE)
|
||||
return 1;
|
||||
/*
|
||||
* sp could decrease when we jump off an interrupt stack
|
||||
|
@ -28,6 +28,7 @@
|
||||
|
||||
#include <asm/opal.h>
|
||||
#include <asm/cputable.h>
|
||||
#include <asm/machdep.h>
|
||||
|
||||
static int opal_hmi_handler_nb_init;
|
||||
struct OpalHmiEvtNode {
|
||||
@ -185,4 +186,4 @@ static int __init opal_hmi_handler_init(void)
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
subsys_initcall(opal_hmi_handler_init);
|
||||
machine_subsys_initcall(powernv, opal_hmi_handler_init);
|
||||
|
@ -113,7 +113,7 @@ out:
|
||||
static int pseries_remove_mem_node(struct device_node *np)
|
||||
{
|
||||
const char *type;
|
||||
const unsigned int *regs;
|
||||
const __be32 *regs;
|
||||
unsigned long base;
|
||||
unsigned int lmb_size;
|
||||
int ret = -EINVAL;
|
||||
@ -132,8 +132,8 @@ static int pseries_remove_mem_node(struct device_node *np)
|
||||
if (!regs)
|
||||
return ret;
|
||||
|
||||
base = *(unsigned long *)regs;
|
||||
lmb_size = regs[3];
|
||||
base = be64_to_cpu(*(unsigned long *)regs);
|
||||
lmb_size = be32_to_cpu(regs[3]);
|
||||
|
||||
pseries_remove_memblock(base, lmb_size);
|
||||
return 0;
|
||||
@ -153,7 +153,7 @@ static inline int pseries_remove_mem_node(struct device_node *np)
|
||||
static int pseries_add_mem_node(struct device_node *np)
|
||||
{
|
||||
const char *type;
|
||||
const unsigned int *regs;
|
||||
const __be32 *regs;
|
||||
unsigned long base;
|
||||
unsigned int lmb_size;
|
||||
int ret = -EINVAL;
|
||||
@ -172,8 +172,8 @@ static int pseries_add_mem_node(struct device_node *np)
|
||||
if (!regs)
|
||||
return ret;
|
||||
|
||||
base = *(unsigned long *)regs;
|
||||
lmb_size = regs[3];
|
||||
base = be64_to_cpu(*(unsigned long *)regs);
|
||||
lmb_size = be32_to_cpu(regs[3]);
|
||||
|
||||
/*
|
||||
* Update memory region to represent the memory add
|
||||
@ -187,14 +187,14 @@ static int pseries_update_drconf_memory(struct of_prop_reconfig *pr)
|
||||
struct of_drconf_cell *new_drmem, *old_drmem;
|
||||
unsigned long memblock_size;
|
||||
u32 entries;
|
||||
u32 *p;
|
||||
__be32 *p;
|
||||
int i, rc = -EINVAL;
|
||||
|
||||
memblock_size = pseries_memory_block_size();
|
||||
if (!memblock_size)
|
||||
return -EINVAL;
|
||||
|
||||
p = (u32 *) pr->old_prop->value;
|
||||
p = (__be32 *) pr->old_prop->value;
|
||||
if (!p)
|
||||
return -EINVAL;
|
||||
|
||||
@ -203,28 +203,30 @@ static int pseries_update_drconf_memory(struct of_prop_reconfig *pr)
|
||||
* entries. Get the niumber of entries and skip to the array of
|
||||
* of_drconf_cell's.
|
||||
*/
|
||||
entries = *p++;
|
||||
entries = be32_to_cpu(*p++);
|
||||
old_drmem = (struct of_drconf_cell *)p;
|
||||
|
||||
p = (u32 *)pr->prop->value;
|
||||
p = (__be32 *)pr->prop->value;
|
||||
p++;
|
||||
new_drmem = (struct of_drconf_cell *)p;
|
||||
|
||||
for (i = 0; i < entries; i++) {
|
||||
if ((old_drmem[i].flags & DRCONF_MEM_ASSIGNED) &&
|
||||
(!(new_drmem[i].flags & DRCONF_MEM_ASSIGNED))) {
|
||||
rc = pseries_remove_memblock(old_drmem[i].base_addr,
|
||||
if ((be32_to_cpu(old_drmem[i].flags) & DRCONF_MEM_ASSIGNED) &&
|
||||
(!(be32_to_cpu(new_drmem[i].flags) & DRCONF_MEM_ASSIGNED))) {
|
||||
rc = pseries_remove_memblock(
|
||||
be64_to_cpu(old_drmem[i].base_addr),
|
||||
memblock_size);
|
||||
break;
|
||||
} else if ((!(old_drmem[i].flags & DRCONF_MEM_ASSIGNED)) &&
|
||||
(new_drmem[i].flags & DRCONF_MEM_ASSIGNED)) {
|
||||
rc = memblock_add(old_drmem[i].base_addr,
|
||||
} else if ((!(be32_to_cpu(old_drmem[i].flags) &
|
||||
DRCONF_MEM_ASSIGNED)) &&
|
||||
(be32_to_cpu(new_drmem[i].flags) &
|
||||
DRCONF_MEM_ASSIGNED)) {
|
||||
rc = memblock_add(be64_to_cpu(old_drmem[i].base_addr),
|
||||
memblock_size);
|
||||
rc = (rc < 0) ? -EINVAL : 0;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return rc;
|
||||
}
|
||||
|
||||
|
@ -17,12 +17,12 @@
|
||||
#define IPL_PARM_BLK_FCP_LEN (sizeof(struct ipl_list_hdr) + \
|
||||
sizeof(struct ipl_block_fcp))
|
||||
|
||||
#define IPL_PARM_BLK0_FCP_LEN (sizeof(struct ipl_block_fcp) + 8)
|
||||
#define IPL_PARM_BLK0_FCP_LEN (sizeof(struct ipl_block_fcp) + 16)
|
||||
|
||||
#define IPL_PARM_BLK_CCW_LEN (sizeof(struct ipl_list_hdr) + \
|
||||
sizeof(struct ipl_block_ccw))
|
||||
|
||||
#define IPL_PARM_BLK0_CCW_LEN (sizeof(struct ipl_block_ccw) + 8)
|
||||
#define IPL_PARM_BLK0_CCW_LEN (sizeof(struct ipl_block_ccw) + 16)
|
||||
|
||||
#define IPL_MAX_SUPPORTED_VERSION (0)
|
||||
|
||||
@ -38,10 +38,11 @@ struct ipl_list_hdr {
|
||||
u8 pbt;
|
||||
u8 flags;
|
||||
u16 reserved2;
|
||||
u8 loadparm[8];
|
||||
} __attribute__((packed));
|
||||
|
||||
struct ipl_block_fcp {
|
||||
u8 reserved1[313-1];
|
||||
u8 reserved1[305-1];
|
||||
u8 opt;
|
||||
u8 reserved2[3];
|
||||
u16 reserved3;
|
||||
@ -62,7 +63,6 @@ struct ipl_block_fcp {
|
||||
offsetof(struct ipl_block_fcp, scp_data)))
|
||||
|
||||
struct ipl_block_ccw {
|
||||
u8 load_parm[8];
|
||||
u8 reserved1[84];
|
||||
u8 reserved2[2];
|
||||
u16 devno;
|
||||
|
@ -455,22 +455,6 @@ DEFINE_IPL_ATTR_RO(ipl_fcp, bootprog, "%lld\n", (unsigned long long)
|
||||
DEFINE_IPL_ATTR_RO(ipl_fcp, br_lba, "%lld\n", (unsigned long long)
|
||||
IPL_PARMBLOCK_START->ipl_info.fcp.br_lba);
|
||||
|
||||
static struct attribute *ipl_fcp_attrs[] = {
|
||||
&sys_ipl_type_attr.attr,
|
||||
&sys_ipl_device_attr.attr,
|
||||
&sys_ipl_fcp_wwpn_attr.attr,
|
||||
&sys_ipl_fcp_lun_attr.attr,
|
||||
&sys_ipl_fcp_bootprog_attr.attr,
|
||||
&sys_ipl_fcp_br_lba_attr.attr,
|
||||
NULL,
|
||||
};
|
||||
|
||||
static struct attribute_group ipl_fcp_attr_group = {
|
||||
.attrs = ipl_fcp_attrs,
|
||||
};
|
||||
|
||||
/* CCW ipl device attributes */
|
||||
|
||||
static ssize_t ipl_ccw_loadparm_show(struct kobject *kobj,
|
||||
struct kobj_attribute *attr, char *page)
|
||||
{
|
||||
@ -487,6 +471,23 @@ static ssize_t ipl_ccw_loadparm_show(struct kobject *kobj,
|
||||
static struct kobj_attribute sys_ipl_ccw_loadparm_attr =
|
||||
__ATTR(loadparm, 0444, ipl_ccw_loadparm_show, NULL);
|
||||
|
||||
static struct attribute *ipl_fcp_attrs[] = {
|
||||
&sys_ipl_type_attr.attr,
|
||||
&sys_ipl_device_attr.attr,
|
||||
&sys_ipl_fcp_wwpn_attr.attr,
|
||||
&sys_ipl_fcp_lun_attr.attr,
|
||||
&sys_ipl_fcp_bootprog_attr.attr,
|
||||
&sys_ipl_fcp_br_lba_attr.attr,
|
||||
&sys_ipl_ccw_loadparm_attr.attr,
|
||||
NULL,
|
||||
};
|
||||
|
||||
static struct attribute_group ipl_fcp_attr_group = {
|
||||
.attrs = ipl_fcp_attrs,
|
||||
};
|
||||
|
||||
/* CCW ipl device attributes */
|
||||
|
||||
static struct attribute *ipl_ccw_attrs_vm[] = {
|
||||
&sys_ipl_type_attr.attr,
|
||||
&sys_ipl_device_attr.attr,
|
||||
@ -765,28 +766,10 @@ DEFINE_IPL_ATTR_RW(reipl_fcp, br_lba, "%lld\n", "%lld\n",
|
||||
DEFINE_IPL_ATTR_RW(reipl_fcp, device, "0.0.%04llx\n", "0.0.%llx\n",
|
||||
reipl_block_fcp->ipl_info.fcp.devno);
|
||||
|
||||
static struct attribute *reipl_fcp_attrs[] = {
|
||||
&sys_reipl_fcp_device_attr.attr,
|
||||
&sys_reipl_fcp_wwpn_attr.attr,
|
||||
&sys_reipl_fcp_lun_attr.attr,
|
||||
&sys_reipl_fcp_bootprog_attr.attr,
|
||||
&sys_reipl_fcp_br_lba_attr.attr,
|
||||
NULL,
|
||||
};
|
||||
|
||||
static struct attribute_group reipl_fcp_attr_group = {
|
||||
.attrs = reipl_fcp_attrs,
|
||||
};
|
||||
|
||||
/* CCW reipl device attributes */
|
||||
|
||||
DEFINE_IPL_ATTR_RW(reipl_ccw, device, "0.0.%04llx\n", "0.0.%llx\n",
|
||||
reipl_block_ccw->ipl_info.ccw.devno);
|
||||
|
||||
static void reipl_get_ascii_loadparm(char *loadparm,
|
||||
struct ipl_parameter_block *ibp)
|
||||
{
|
||||
memcpy(loadparm, ibp->ipl_info.ccw.load_parm, LOADPARM_LEN);
|
||||
memcpy(loadparm, ibp->hdr.loadparm, LOADPARM_LEN);
|
||||
EBCASC(loadparm, LOADPARM_LEN);
|
||||
loadparm[LOADPARM_LEN] = 0;
|
||||
strim(loadparm);
|
||||
@ -821,13 +804,50 @@ static ssize_t reipl_generic_loadparm_store(struct ipl_parameter_block *ipb,
|
||||
return -EINVAL;
|
||||
}
|
||||
/* initialize loadparm with blanks */
|
||||
memset(ipb->ipl_info.ccw.load_parm, ' ', LOADPARM_LEN);
|
||||
memset(ipb->hdr.loadparm, ' ', LOADPARM_LEN);
|
||||
/* copy and convert to ebcdic */
|
||||
memcpy(ipb->ipl_info.ccw.load_parm, buf, lp_len);
|
||||
ASCEBC(ipb->ipl_info.ccw.load_parm, LOADPARM_LEN);
|
||||
memcpy(ipb->hdr.loadparm, buf, lp_len);
|
||||
ASCEBC(ipb->hdr.loadparm, LOADPARM_LEN);
|
||||
return len;
|
||||
}
|
||||
|
||||
/* FCP wrapper */
|
||||
static ssize_t reipl_fcp_loadparm_show(struct kobject *kobj,
|
||||
struct kobj_attribute *attr, char *page)
|
||||
{
|
||||
return reipl_generic_loadparm_show(reipl_block_fcp, page);
|
||||
}
|
||||
|
||||
static ssize_t reipl_fcp_loadparm_store(struct kobject *kobj,
|
||||
struct kobj_attribute *attr,
|
||||
const char *buf, size_t len)
|
||||
{
|
||||
return reipl_generic_loadparm_store(reipl_block_fcp, buf, len);
|
||||
}
|
||||
|
||||
static struct kobj_attribute sys_reipl_fcp_loadparm_attr =
|
||||
__ATTR(loadparm, S_IRUGO | S_IWUSR, reipl_fcp_loadparm_show,
|
||||
reipl_fcp_loadparm_store);
|
||||
|
||||
static struct attribute *reipl_fcp_attrs[] = {
|
||||
&sys_reipl_fcp_device_attr.attr,
|
||||
&sys_reipl_fcp_wwpn_attr.attr,
|
||||
&sys_reipl_fcp_lun_attr.attr,
|
||||
&sys_reipl_fcp_bootprog_attr.attr,
|
||||
&sys_reipl_fcp_br_lba_attr.attr,
|
||||
&sys_reipl_fcp_loadparm_attr.attr,
|
||||
NULL,
|
||||
};
|
||||
|
||||
static struct attribute_group reipl_fcp_attr_group = {
|
||||
.attrs = reipl_fcp_attrs,
|
||||
};
|
||||
|
||||
/* CCW reipl device attributes */
|
||||
|
||||
DEFINE_IPL_ATTR_RW(reipl_ccw, device, "0.0.%04llx\n", "0.0.%llx\n",
|
||||
reipl_block_ccw->ipl_info.ccw.devno);
|
||||
|
||||
/* NSS wrapper */
|
||||
static ssize_t reipl_nss_loadparm_show(struct kobject *kobj,
|
||||
struct kobj_attribute *attr, char *page)
|
||||
@ -1125,11 +1145,10 @@ static void reipl_block_ccw_fill_parms(struct ipl_parameter_block *ipb)
|
||||
/* LOADPARM */
|
||||
/* check if read scp info worked and set loadparm */
|
||||
if (sclp_ipl_info.is_valid)
|
||||
memcpy(ipb->ipl_info.ccw.load_parm,
|
||||
&sclp_ipl_info.loadparm, LOADPARM_LEN);
|
||||
memcpy(ipb->hdr.loadparm, &sclp_ipl_info.loadparm, LOADPARM_LEN);
|
||||
else
|
||||
/* read scp info failed: set empty loadparm (EBCDIC blanks) */
|
||||
memset(ipb->ipl_info.ccw.load_parm, 0x40, LOADPARM_LEN);
|
||||
memset(ipb->hdr.loadparm, 0x40, LOADPARM_LEN);
|
||||
ipb->hdr.flags = DIAG308_FLAGS_LP_VALID;
|
||||
|
||||
/* VM PARM */
|
||||
@ -1251,9 +1270,16 @@ static int __init reipl_fcp_init(void)
|
||||
return rc;
|
||||
}
|
||||
|
||||
if (ipl_info.type == IPL_TYPE_FCP)
|
||||
if (ipl_info.type == IPL_TYPE_FCP) {
|
||||
memcpy(reipl_block_fcp, IPL_PARMBLOCK_START, PAGE_SIZE);
|
||||
else {
|
||||
/*
|
||||
* Fix loadparm: There are systems where the (SCSI) LOADPARM
|
||||
* is invalid in the SCSI IPL parameter block, so take it
|
||||
* always from sclp_ipl_info.
|
||||
*/
|
||||
memcpy(reipl_block_fcp->hdr.loadparm, sclp_ipl_info.loadparm,
|
||||
LOADPARM_LEN);
|
||||
} else {
|
||||
reipl_block_fcp->hdr.len = IPL_PARM_BLK_FCP_LEN;
|
||||
reipl_block_fcp->hdr.version = IPL_PARM_BLOCK_VERSION;
|
||||
reipl_block_fcp->hdr.blk0_len = IPL_PARM_BLK0_FCP_LEN;
|
||||
@ -1864,7 +1890,23 @@ static void __init shutdown_actions_init(void)
|
||||
|
||||
static int __init s390_ipl_init(void)
|
||||
{
|
||||
char str[8] = {0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40};
|
||||
|
||||
sclp_get_ipl_info(&sclp_ipl_info);
|
||||
/*
|
||||
* Fix loadparm: There are systems where the (SCSI) LOADPARM
|
||||
* returned by read SCP info is invalid (contains EBCDIC blanks)
|
||||
* when the system has been booted via diag308. In that case we use
|
||||
* the value from diag308, if available.
|
||||
*
|
||||
* There are also systems where diag308 store does not work in
|
||||
* case the system is booted from HMC. Fortunately in this case
|
||||
* READ SCP info provides the correct value.
|
||||
*/
|
||||
if (memcmp(sclp_ipl_info.loadparm, str, sizeof(str)) == 0 &&
|
||||
diag308_set_works)
|
||||
memcpy(sclp_ipl_info.loadparm, ipl_block.hdr.loadparm,
|
||||
LOADPARM_LEN);
|
||||
shutdown_actions_init();
|
||||
shutdown_triggers_init();
|
||||
return 0;
|
||||
|
@ -22,13 +22,11 @@ __kernel_clock_gettime:
|
||||
basr %r5,0
|
||||
0: al %r5,21f-0b(%r5) /* get &_vdso_data */
|
||||
chi %r2,__CLOCK_REALTIME
|
||||
je 10f
|
||||
je 11f
|
||||
chi %r2,__CLOCK_MONOTONIC
|
||||
jne 19f
|
||||
|
||||
/* CLOCK_MONOTONIC */
|
||||
ltr %r3,%r3
|
||||
jz 9f /* tp == NULL */
|
||||
1: l %r4,__VDSO_UPD_COUNT+4(%r5) /* load update counter */
|
||||
tml %r4,0x0001 /* pending update ? loop */
|
||||
jnz 1b
|
||||
@ -67,12 +65,10 @@ __kernel_clock_gettime:
|
||||
j 6b
|
||||
8: st %r2,0(%r3) /* store tp->tv_sec */
|
||||
st %r1,4(%r3) /* store tp->tv_nsec */
|
||||
9: lhi %r2,0
|
||||
lhi %r2,0
|
||||
br %r14
|
||||
|
||||
/* CLOCK_REALTIME */
|
||||
10: ltr %r3,%r3 /* tp == NULL */
|
||||
jz 18f
|
||||
11: l %r4,__VDSO_UPD_COUNT+4(%r5) /* load update counter */
|
||||
tml %r4,0x0001 /* pending update ? loop */
|
||||
jnz 11b
|
||||
@ -111,7 +107,7 @@ __kernel_clock_gettime:
|
||||
j 15b
|
||||
17: st %r2,0(%r3) /* store tp->tv_sec */
|
||||
st %r1,4(%r3) /* store tp->tv_nsec */
|
||||
18: lhi %r2,0
|
||||
lhi %r2,0
|
||||
br %r14
|
||||
|
||||
/* Fallback to system call */
|
||||
|
@ -21,7 +21,7 @@ __kernel_clock_gettime:
|
||||
.cfi_startproc
|
||||
larl %r5,_vdso_data
|
||||
cghi %r2,__CLOCK_REALTIME
|
||||
je 4f
|
||||
je 5f
|
||||
cghi %r2,__CLOCK_THREAD_CPUTIME_ID
|
||||
je 9f
|
||||
cghi %r2,-2 /* Per-thread CPUCLOCK with PID=0, VIRT=1 */
|
||||
@ -30,8 +30,6 @@ __kernel_clock_gettime:
|
||||
jne 12f
|
||||
|
||||
/* CLOCK_MONOTONIC */
|
||||
ltgr %r3,%r3
|
||||
jz 3f /* tp == NULL */
|
||||
0: lg %r4,__VDSO_UPD_COUNT(%r5) /* load update counter */
|
||||
tmll %r4,0x0001 /* pending update ? loop */
|
||||
jnz 0b
|
||||
@ -53,12 +51,10 @@ __kernel_clock_gettime:
|
||||
j 1b
|
||||
2: stg %r0,0(%r3) /* store tp->tv_sec */
|
||||
stg %r1,8(%r3) /* store tp->tv_nsec */
|
||||
3: lghi %r2,0
|
||||
lghi %r2,0
|
||||
br %r14
|
||||
|
||||
/* CLOCK_REALTIME */
|
||||
4: ltr %r3,%r3 /* tp == NULL */
|
||||
jz 8f
|
||||
5: lg %r4,__VDSO_UPD_COUNT(%r5) /* load update counter */
|
||||
tmll %r4,0x0001 /* pending update ? loop */
|
||||
jnz 5b
|
||||
@ -80,7 +76,7 @@ __kernel_clock_gettime:
|
||||
j 6b
|
||||
7: stg %r0,0(%r3) /* store tp->tv_sec */
|
||||
stg %r1,8(%r3) /* store tp->tv_nsec */
|
||||
8: lghi %r2,0
|
||||
lghi %r2,0
|
||||
br %r14
|
||||
|
||||
/* CLOCK_THREAD_CPUTIME_ID for this thread */
|
||||
|
@ -43,6 +43,7 @@ pgd_t swapper_pg_dir[PTRS_PER_PGD] __attribute__((__aligned__(PAGE_SIZE)));
|
||||
|
||||
unsigned long empty_zero_page, zero_page_mask;
|
||||
EXPORT_SYMBOL(empty_zero_page);
|
||||
EXPORT_SYMBOL(zero_page_mask);
|
||||
|
||||
static void __init setup_zero_pages(void)
|
||||
{
|
||||
|
@ -105,6 +105,8 @@ static noinline int gup_pte_range(pmd_t pmd, unsigned long addr,
|
||||
VM_BUG_ON(!pfn_valid(pte_pfn(pte)));
|
||||
page = pte_page(pte);
|
||||
get_page(page);
|
||||
__flush_anon_page(page, addr);
|
||||
flush_dcache_page(page);
|
||||
pages[*nr] = page;
|
||||
(*nr)++;
|
||||
|
||||
|
@ -234,12 +234,18 @@ do { BUILD_BUG_ON(FIELD_SIZEOF(STRUCT, FIELD) != sizeof(u8)); \
|
||||
__emit_load8(BASE, STRUCT, FIELD, DEST); \
|
||||
} while (0)
|
||||
|
||||
#define emit_ldmem(OFF, DEST) \
|
||||
do { *prog++ = LD32I | RS1(FP) | S13(-(OFF)) | RD(DEST); \
|
||||
#ifdef CONFIG_SPARC64
|
||||
#define BIAS (STACK_BIAS - 4)
|
||||
#else
|
||||
#define BIAS (-4)
|
||||
#endif
|
||||
|
||||
#define emit_ldmem(OFF, DEST) \
|
||||
do { *prog++ = LD32I | RS1(SP) | S13(BIAS - (OFF)) | RD(DEST); \
|
||||
} while (0)
|
||||
|
||||
#define emit_stmem(OFF, SRC) \
|
||||
do { *prog++ = LD32I | RS1(FP) | S13(-(OFF)) | RD(SRC); \
|
||||
#define emit_stmem(OFF, SRC) \
|
||||
do { *prog++ = ST32I | RS1(SP) | S13(BIAS - (OFF)) | RD(SRC); \
|
||||
} while (0)
|
||||
|
||||
#ifdef CONFIG_SMP
|
||||
@ -610,10 +616,11 @@ void bpf_jit_compile(struct bpf_prog *fp)
|
||||
case BPF_ANC | SKF_AD_VLAN_TAG:
|
||||
case BPF_ANC | SKF_AD_VLAN_TAG_PRESENT:
|
||||
emit_skb_load16(vlan_tci, r_A);
|
||||
if (code == (BPF_ANC | SKF_AD_VLAN_TAG)) {
|
||||
emit_andi(r_A, VLAN_VID_MASK, r_A);
|
||||
if (code != (BPF_ANC | SKF_AD_VLAN_TAG)) {
|
||||
emit_alu_K(SRL, 12);
|
||||
emit_andi(r_A, 1, r_A);
|
||||
} else {
|
||||
emit_loadimm(VLAN_TAG_PRESENT, r_TMP);
|
||||
emit_loadimm(~VLAN_TAG_PRESENT, r_TMP);
|
||||
emit_and(r_A, r_TMP, r_A);
|
||||
}
|
||||
break;
|
||||
@ -625,15 +632,19 @@ void bpf_jit_compile(struct bpf_prog *fp)
|
||||
emit_loadimm(K, r_X);
|
||||
break;
|
||||
case BPF_LD | BPF_MEM:
|
||||
seen |= SEEN_MEM;
|
||||
emit_ldmem(K * 4, r_A);
|
||||
break;
|
||||
case BPF_LDX | BPF_MEM:
|
||||
seen |= SEEN_MEM | SEEN_XREG;
|
||||
emit_ldmem(K * 4, r_X);
|
||||
break;
|
||||
case BPF_ST:
|
||||
seen |= SEEN_MEM;
|
||||
emit_stmem(K * 4, r_A);
|
||||
break;
|
||||
case BPF_STX:
|
||||
seen |= SEEN_MEM | SEEN_XREG;
|
||||
emit_stmem(K * 4, r_X);
|
||||
break;
|
||||
|
||||
|
@ -23,6 +23,7 @@ config X86
|
||||
def_bool y
|
||||
select ARCH_MIGHT_HAVE_ACPI_PDC if ACPI
|
||||
select ARCH_HAS_DEBUG_STRICT_USER_COPY_CHECKS
|
||||
select ARCH_HAS_FAST_MULTIPLIER
|
||||
select ARCH_MIGHT_HAVE_PC_PARPORT
|
||||
select ARCH_MIGHT_HAVE_PC_SERIO
|
||||
select HAVE_AOUT if X86_32
|
||||
|
@ -1032,7 +1032,6 @@ struct boot_params *make_boot_params(struct efi_config *c)
|
||||
int i;
|
||||
unsigned long ramdisk_addr;
|
||||
unsigned long ramdisk_size;
|
||||
unsigned long initrd_addr_max;
|
||||
|
||||
efi_early = c;
|
||||
sys_table = (efi_system_table_t *)(unsigned long)efi_early->table;
|
||||
@ -1095,15 +1094,20 @@ struct boot_params *make_boot_params(struct efi_config *c)
|
||||
|
||||
memset(sdt, 0, sizeof(*sdt));
|
||||
|
||||
if (hdr->xloadflags & XLF_CAN_BE_LOADED_ABOVE_4G)
|
||||
initrd_addr_max = -1UL;
|
||||
else
|
||||
initrd_addr_max = hdr->initrd_addr_max;
|
||||
|
||||
status = handle_cmdline_files(sys_table, image,
|
||||
(char *)(unsigned long)hdr->cmd_line_ptr,
|
||||
"initrd=", initrd_addr_max,
|
||||
"initrd=", hdr->initrd_addr_max,
|
||||
&ramdisk_addr, &ramdisk_size);
|
||||
|
||||
if (status != EFI_SUCCESS &&
|
||||
hdr->xloadflags & XLF_CAN_BE_LOADED_ABOVE_4G) {
|
||||
efi_printk(sys_table, "Trying to load files to higher address\n");
|
||||
status = handle_cmdline_files(sys_table, image,
|
||||
(char *)(unsigned long)hdr->cmd_line_ptr,
|
||||
"initrd=", -1UL,
|
||||
&ramdisk_addr, &ramdisk_size);
|
||||
}
|
||||
|
||||
if (status != EFI_SUCCESS)
|
||||
goto fail2;
|
||||
hdr->ramdisk_image = ramdisk_addr & 0xffffffff;
|
||||
|
@ -30,6 +30,33 @@
|
||||
#include <asm/boot.h>
|
||||
#include <asm/asm-offsets.h>
|
||||
|
||||
/*
|
||||
* Adjust our own GOT
|
||||
*
|
||||
* The relocation base must be in %ebx
|
||||
*
|
||||
* It is safe to call this macro more than once, because in some of the
|
||||
* code paths multiple invocations are inevitable, e.g. via the efi*
|
||||
* entry points.
|
||||
*
|
||||
* Relocation is only performed the first time.
|
||||
*/
|
||||
.macro FIXUP_GOT
|
||||
cmpb $1, got_fixed(%ebx)
|
||||
je 2f
|
||||
|
||||
leal _got(%ebx), %edx
|
||||
leal _egot(%ebx), %ecx
|
||||
1:
|
||||
cmpl %ecx, %edx
|
||||
jae 2f
|
||||
addl %ebx, (%edx)
|
||||
addl $4, %edx
|
||||
jmp 1b
|
||||
2:
|
||||
movb $1, got_fixed(%ebx)
|
||||
.endm
|
||||
|
||||
__HEAD
|
||||
ENTRY(startup_32)
|
||||
#ifdef CONFIG_EFI_STUB
|
||||
@ -56,6 +83,9 @@ ENTRY(efi_pe_entry)
|
||||
add %esi, 88(%eax)
|
||||
pushl %eax
|
||||
|
||||
movl %esi, %ebx
|
||||
FIXUP_GOT
|
||||
|
||||
call make_boot_params
|
||||
cmpl $0, %eax
|
||||
je fail
|
||||
@ -81,6 +111,10 @@ ENTRY(efi32_stub_entry)
|
||||
leal efi32_config(%esi), %eax
|
||||
add %esi, 88(%eax)
|
||||
pushl %eax
|
||||
|
||||
movl %esi, %ebx
|
||||
FIXUP_GOT
|
||||
|
||||
2:
|
||||
call efi_main
|
||||
cmpl $0, %eax
|
||||
@ -190,19 +224,7 @@ relocated:
|
||||
shrl $2, %ecx
|
||||
rep stosl
|
||||
|
||||
/*
|
||||
* Adjust our own GOT
|
||||
*/
|
||||
leal _got(%ebx), %edx
|
||||
leal _egot(%ebx), %ecx
|
||||
1:
|
||||
cmpl %ecx, %edx
|
||||
jae 2f
|
||||
addl %ebx, (%edx)
|
||||
addl $4, %edx
|
||||
jmp 1b
|
||||
2:
|
||||
|
||||
FIXUP_GOT
|
||||
/*
|
||||
* Do the decompression, and jump to the new kernel..
|
||||
*/
|
||||
@ -225,8 +247,12 @@ relocated:
|
||||
xorl %ebx, %ebx
|
||||
jmp *%eax
|
||||
|
||||
#ifdef CONFIG_EFI_STUB
|
||||
.data
|
||||
/* Have we relocated the GOT? */
|
||||
got_fixed:
|
||||
.byte 0
|
||||
|
||||
#ifdef CONFIG_EFI_STUB
|
||||
efi32_config:
|
||||
.fill 11,8,0
|
||||
.long efi_call_phys
|
||||
|
@ -32,6 +32,33 @@
|
||||
#include <asm/processor-flags.h>
|
||||
#include <asm/asm-offsets.h>
|
||||
|
||||
/*
|
||||
* Adjust our own GOT
|
||||
*
|
||||
* The relocation base must be in %rbx
|
||||
*
|
||||
* It is safe to call this macro more than once, because in some of the
|
||||
* code paths multiple invocations are inevitable, e.g. via the efi*
|
||||
* entry points.
|
||||
*
|
||||
* Relocation is only performed the first time.
|
||||
*/
|
||||
.macro FIXUP_GOT
|
||||
cmpb $1, got_fixed(%rip)
|
||||
je 2f
|
||||
|
||||
leaq _got(%rip), %rdx
|
||||
leaq _egot(%rip), %rcx
|
||||
1:
|
||||
cmpq %rcx, %rdx
|
||||
jae 2f
|
||||
addq %rbx, (%rdx)
|
||||
addq $8, %rdx
|
||||
jmp 1b
|
||||
2:
|
||||
movb $1, got_fixed(%rip)
|
||||
.endm
|
||||
|
||||
__HEAD
|
||||
.code32
|
||||
ENTRY(startup_32)
|
||||
@ -252,10 +279,13 @@ ENTRY(efi_pe_entry)
|
||||
subq $1b, %rbp
|
||||
|
||||
/*
|
||||
* Relocate efi_config->call().
|
||||
* Relocate efi_config->call() and the GOT entries.
|
||||
*/
|
||||
addq %rbp, efi64_config+88(%rip)
|
||||
|
||||
movq %rbp, %rbx
|
||||
FIXUP_GOT
|
||||
|
||||
movq %rax, %rdi
|
||||
call make_boot_params
|
||||
cmpq $0,%rax
|
||||
@ -271,10 +301,13 @@ handover_entry:
|
||||
subq $1b, %rbp
|
||||
|
||||
/*
|
||||
* Relocate efi_config->call().
|
||||
* Relocate efi_config->call() and the GOT entries.
|
||||
*/
|
||||
movq efi_config(%rip), %rax
|
||||
addq %rbp, 88(%rax)
|
||||
|
||||
movq %rbp, %rbx
|
||||
FIXUP_GOT
|
||||
2:
|
||||
movq efi_config(%rip), %rdi
|
||||
call efi_main
|
||||
@ -385,19 +418,8 @@ relocated:
|
||||
shrq $3, %rcx
|
||||
rep stosq
|
||||
|
||||
/*
|
||||
* Adjust our own GOT
|
||||
*/
|
||||
leaq _got(%rip), %rdx
|
||||
leaq _egot(%rip), %rcx
|
||||
1:
|
||||
cmpq %rcx, %rdx
|
||||
jae 2f
|
||||
addq %rbx, (%rdx)
|
||||
addq $8, %rdx
|
||||
jmp 1b
|
||||
2:
|
||||
|
||||
FIXUP_GOT
|
||||
|
||||
/*
|
||||
* Do the decompression, and jump to the new kernel..
|
||||
*/
|
||||
@ -437,6 +459,10 @@ gdt:
|
||||
.quad 0x0000000000000000 /* TS continued */
|
||||
gdt_end:
|
||||
|
||||
/* Have we relocated the GOT? */
|
||||
got_fixed:
|
||||
.byte 0
|
||||
|
||||
#ifdef CONFIG_EFI_STUB
|
||||
efi_config:
|
||||
.quad 0
|
||||
|
@ -497,8 +497,6 @@ static __always_inline int fls64(__u64 x)
|
||||
|
||||
#include <asm-generic/bitops/sched.h>
|
||||
|
||||
#define ARCH_HAS_FAST_MULTIPLIER 1
|
||||
|
||||
#include <asm/arch_hweight.h>
|
||||
|
||||
#include <asm-generic/bitops/const_hweight.h>
|
||||
|
@ -239,6 +239,7 @@ static inline int mp_find_ioapic(u32 gsi) { return 0; }
|
||||
static inline u32 mp_pin_to_gsi(int ioapic, int pin) { return UINT_MAX; }
|
||||
static inline int mp_map_gsi_to_irq(u32 gsi, unsigned int flags) { return gsi; }
|
||||
static inline void mp_unmap_irq(int irq) { }
|
||||
static inline bool mp_should_keep_irq(struct device *dev) { return 1; }
|
||||
|
||||
static inline int save_ioapic_entries(void)
|
||||
{
|
||||
|
@ -19,6 +19,7 @@ extern pud_t level3_ident_pgt[512];
|
||||
extern pmd_t level2_kernel_pgt[512];
|
||||
extern pmd_t level2_fixmap_pgt[512];
|
||||
extern pmd_t level2_ident_pgt[512];
|
||||
extern pte_t level1_fixmap_pgt[512];
|
||||
extern pgd_t init_level4_pgt[];
|
||||
|
||||
#define swapper_pg_dir init_level4_pgt
|
||||
|
@ -338,8 +338,10 @@ int arch_prepare_optimized_kprobe(struct optimized_kprobe *op)
|
||||
* a relative jump.
|
||||
*/
|
||||
rel = (long)op->optinsn.insn - (long)op->kp.addr + RELATIVEJUMP_SIZE;
|
||||
if (abs(rel) > 0x7fffffff)
|
||||
if (abs(rel) > 0x7fffffff) {
|
||||
__arch_remove_optimized_kprobe(op, 0);
|
||||
return -ERANGE;
|
||||
}
|
||||
|
||||
buf = (u8 *)op->optinsn.insn;
|
||||
|
||||
|
@ -48,7 +48,9 @@ enum address_markers_idx {
|
||||
LOW_KERNEL_NR,
|
||||
VMALLOC_START_NR,
|
||||
VMEMMAP_START_NR,
|
||||
# ifdef CONFIG_X86_ESPFIX64
|
||||
ESPFIX_START_NR,
|
||||
# endif
|
||||
HIGH_KERNEL_NR,
|
||||
MODULES_VADDR_NR,
|
||||
MODULES_END_NR,
|
||||
@ -71,7 +73,9 @@ static struct addr_marker address_markers[] = {
|
||||
{ PAGE_OFFSET, "Low Kernel Mapping" },
|
||||
{ VMALLOC_START, "vmalloc() Area" },
|
||||
{ VMEMMAP_START, "Vmemmap" },
|
||||
# ifdef CONFIG_X86_ESPFIX64
|
||||
{ ESPFIX_BASE_ADDR, "ESPfix Area", 16 },
|
||||
# endif
|
||||
{ __START_KERNEL_map, "High Kernel Mapping" },
|
||||
{ MODULES_VADDR, "Modules" },
|
||||
{ MODULES_END, "End Modules" },
|
||||
|
@ -31,7 +31,7 @@
|
||||
#include <linux/sched.h>
|
||||
#include <asm/elf.h>
|
||||
|
||||
struct __read_mostly va_alignment va_align = {
|
||||
struct va_alignment __read_mostly va_align = {
|
||||
.flags = -1,
|
||||
};
|
||||
|
||||
|
@ -326,27 +326,6 @@ static void pci_fixup_video(struct pci_dev *pdev)
|
||||
struct pci_bus *bus;
|
||||
u16 config;
|
||||
|
||||
if (!vga_default_device()) {
|
||||
resource_size_t start, end;
|
||||
int i;
|
||||
|
||||
/* Does firmware framebuffer belong to us? */
|
||||
for (i = 0; i < DEVICE_COUNT_RESOURCE; i++) {
|
||||
if (!(pci_resource_flags(pdev, i) & IORESOURCE_MEM))
|
||||
continue;
|
||||
|
||||
start = pci_resource_start(pdev, i);
|
||||
end = pci_resource_end(pdev, i);
|
||||
|
||||
if (!start || !end)
|
||||
continue;
|
||||
|
||||
if (screen_info.lfb_base >= start &&
|
||||
(screen_info.lfb_base + screen_info.lfb_size) < end)
|
||||
vga_set_default_device(pdev);
|
||||
}
|
||||
}
|
||||
|
||||
/* Is VGA routed to us? */
|
||||
bus = pdev->bus;
|
||||
while (bus) {
|
||||
@ -371,8 +350,7 @@ static void pci_fixup_video(struct pci_dev *pdev)
|
||||
pci_read_config_word(pdev, PCI_COMMAND, &config);
|
||||
if (config & (PCI_COMMAND_IO | PCI_COMMAND_MEMORY)) {
|
||||
pdev->resource[PCI_ROM_RESOURCE].flags |= IORESOURCE_ROM_SHADOW;
|
||||
dev_printk(KERN_DEBUG, &pdev->dev, "Boot video device\n");
|
||||
vga_set_default_device(pdev);
|
||||
dev_printk(KERN_DEBUG, &pdev->dev, "Video device with shadowed ROM\n");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user