Skip to content

Commit 3d15b79

Browse files
committed
Merge tag 'arm64-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/cmarinas/linux-aarch64
Pull arm64 update from Catalin Marinas: - Since drivers/irqchip/irq-gic.c no longer has dependencies on arm32 specifics (the 'gic' branch merged), it can be enabled on arm64. - Enable arm64 support for poweroff/restart (for code under drivers/power/reset/). - Fixes (dts file, exception handling, bitops) * tag 'arm64-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/cmarinas/linux-aarch64: arm64: Treat the bitops index argument as an 'int' arm64: Ignore the 'write' ESR flag on cache maintenance faults arm64: dts: fix #address-cells for foundation-v8 arm64: vexpress: Add support for poweroff/restart arm64: Enable support for the ARM GIC interrupt controller
2 parents 942d33d + 420c158 commit 3d15b79

File tree

6 files changed

+17
-12
lines changed

6 files changed

+17
-12
lines changed

arch/arm64/Kconfig

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ config ARM64
66
select ARCH_WANT_FRAME_POINTERS
77
select ARM_AMBA
88
select ARM_ARCH_TIMER
9+
select ARM_GIC
910
select CLONE_BACKWARDS
1011
select COMMON_CLK
1112
select GENERIC_CLOCKEVENTS
@@ -31,6 +32,8 @@ config ARM64
3132
select OF
3233
select OF_EARLY_FLATTREE
3334
select PERF_USE_VMALLOC
35+
select POWER_RESET
36+
select POWER_SUPPLY
3437
select RTC_LIB
3538
select SPARSE_IRQ
3639
select SYSCTL_EXCEPTION_TRACE
@@ -105,6 +108,7 @@ config ARCH_VEXPRESS
105108
bool "ARMv8 software model (Versatile Express)"
106109
select ARCH_REQUIRE_GPIOLIB
107110
select COMMON_CLK_VERSATILE
111+
select POWER_RESET_VEXPRESS
108112
select VEXPRESS_CONFIG
109113
help
110114
This enables support for the ARMv8 software model (Versatile

arch/arm64/boot/dts/foundation-v8.dts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
};
2424

2525
cpus {
26-
#address-cells = <1>;
26+
#address-cells = <2>;
2727
#size-cells = <0>;
2828

2929
cpu@0 {

arch/arm64/include/asm/system_misc.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ extern void show_pte(struct mm_struct *mm, unsigned long addr);
4141
extern void __show_regs(struct pt_regs *);
4242

4343
void soft_restart(unsigned long);
44-
extern void (*pm_restart)(const char *cmd);
44+
extern void (*arm_pm_restart)(char str, const char *cmd);
4545

4646
#define UDBG_UNDEFINED (1 << 0)
4747
#define UDBG_SYSCALL (1 << 1)

arch/arm64/kernel/process.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -81,8 +81,8 @@ void soft_restart(unsigned long addr)
8181
void (*pm_power_off)(void);
8282
EXPORT_SYMBOL_GPL(pm_power_off);
8383

84-
void (*pm_restart)(const char *cmd);
85-
EXPORT_SYMBOL_GPL(pm_restart);
84+
void (*arm_pm_restart)(char str, const char *cmd);
85+
EXPORT_SYMBOL_GPL(arm_pm_restart);
8686

8787
void arch_cpu_idle_prepare(void)
8888
{
@@ -131,8 +131,8 @@ void machine_restart(char *cmd)
131131
local_fiq_disable();
132132

133133
/* Now call the architecture specific reboot code. */
134-
if (pm_restart)
135-
pm_restart(cmd);
134+
if (arm_pm_restart)
135+
arm_pm_restart('h', cmd);
136136

137137
/*
138138
* Whoops - the architecture was unable to reboot.

arch/arm64/lib/bitops.S

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,13 +21,13 @@
2121

2222
/*
2323
* x0: bits 5:0 bit offset
24-
* bits 63:6 word offset
24+
* bits 31:6 word offset
2525
* x1: address
2626
*/
2727
.macro bitop, name, instr
2828
ENTRY( \name )
29-
and x3, x0, #63 // Get bit offset
30-
eor x0, x0, x3 // Clear low bits
29+
and w3, w0, #63 // Get bit offset
30+
eor w0, w0, w3 // Clear low bits
3131
mov x2, #1
3232
add x1, x1, x0, lsr #3 // Get word offset
3333
lsl x3, x2, x3 // Create mask
@@ -41,8 +41,8 @@ ENDPROC(\name )
4141

4242
.macro testop, name, instr
4343
ENTRY( \name )
44-
and x3, x0, #63 // Get bit offset
45-
eor x0, x0, x3 // Clear low bits
44+
and w3, w0, #63 // Get bit offset
45+
eor w0, w0, w3 // Clear low bits
4646
mov x2, #1
4747
add x1, x1, x0, lsr #3 // Get word offset
4848
lsl x4, x2, x3 // Create mask

arch/arm64/mm/fault.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,7 @@ void do_bad_area(unsigned long addr, unsigned int esr, struct pt_regs *regs)
148148
#define VM_FAULT_BADACCESS 0x020000
149149

150150
#define ESR_WRITE (1 << 6)
151+
#define ESR_CM (1 << 8)
151152
#define ESR_LNX_EXEC (1 << 24)
152153

153154
/*
@@ -206,7 +207,7 @@ static int __kprobes do_page_fault(unsigned long addr, unsigned int esr,
206207
struct task_struct *tsk;
207208
struct mm_struct *mm;
208209
int fault, sig, code;
209-
int write = esr & ESR_WRITE;
210+
bool write = (esr & ESR_WRITE) && !(esr & ESR_CM);
210211
unsigned int flags = FAULT_FLAG_ALLOW_RETRY | FAULT_FLAG_KILLABLE |
211212
(write ? FAULT_FLAG_WRITE : 0);
212213

0 commit comments

Comments
 (0)