aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc/lib/sstep.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2017-11-16 15:47:46 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2017-11-16 15:47:46 -0500
commit5b0e2cb020085efe202123162502e0b551e49a0e (patch)
tree534bbb4c9f98c2ed9a520e11107029e5df38c3c2 /arch/powerpc/lib/sstep.c
parent758f875848d78148cf9a9cdb3ff1ddf29b234056 (diff)
parent3ffa9d9e2a7c10127d8cbf91ea2be15390b450ed (diff)
Merge tag 'powerpc-4.15-1' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux
Pull powerpc updates from Michael Ellerman: "A bit of a small release, I suspect in part due to me travelling for KS. But my backlog of patches to review is smaller than usual, so I think in part folks just didn't send as much this cycle. Non-highlights: - Five fixes for the >128T address space handling, both to fix bugs in our implementation and to bring the semantics exactly into line with x86. Highlights: - Support for a new OPAL call on bare metal machines which gives us a true NMI (ie. is not masked by MSR[EE]=0) for debugging etc. - Support for Power9 DD2 in the CXL driver. - Improvements to machine check handling so that uncorrectable errors can be reported into the generic memory_failure() machinery. - Some fixes and improvements for VPHN, which is used under PowerVM to notify the Linux partition of topology changes. - Plumbing to enable TM (transactional memory) without suspend on some Power9 processors (PPC_FEATURE2_HTM_NO_SUSPEND). - Support for emulating vector loads form cache-inhibited memory, on some Power9 revisions. - Disable the fast-endian switch "syscall" by default (behind a CONFIG), we believe it has never had any users. - A major rework of the API drivers use when initiating and waiting for long running operations performed by OPAL firmware, and changes to the powernv_flash driver to use the new API. - Several fixes for the handling of FP/VMX/VSX while processes are using transactional memory. - Optimisations of TLB range flushes when using the radix MMU on Power9. - Improvements to the VAS facility used to access coprocessors on Power9, and related improvements to the way the NX crypto driver handles requests. - Implementation of PMEM_API and UACCESS_FLUSHCACHE for 64-bit. Thanks to: Alexey Kardashevskiy, Alistair Popple, Allen Pais, Andrew Donnellan, Aneesh Kumar K.V, Arnd Bergmann, Balbir Singh, Benjamin Herrenschmidt, Breno Leitao, Christophe Leroy, Christophe Lombard, Cyril Bur, Frederic Barrat, Gautham R. Shenoy, Geert Uytterhoeven, Guilherme G. Piccoli, Gustavo Romero, Haren Myneni, Joel Stanley, Kamalesh Babulal, Kautuk Consul, Markus Elfring, Masami Hiramatsu, Michael Bringmann, Michael Neuling, Michal Suchanek, Naveen N. Rao, Nicholas Piggin, Oliver O'Halloran, Paul Mackerras, Pedro Miraglia Franco de Carvalho, Philippe Bergheaud, Sandipan Das, Seth Forshee, Shriya, Stephen Rothwell, Stewart Smith, Sukadev Bhattiprolu, Tyrel Datwyler, Vaibhav Jain, Vaidyanathan Srinivasan, and William A. Kennington III" * tag 'powerpc-4.15-1' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux: (151 commits) powerpc/64s: Fix Power9 DD2.0 workarounds by adding DD2.1 feature powerpc/64s: Fix masking of SRR1 bits on instruction fault powerpc/64s: mm_context.addr_limit is only used on hash powerpc/64s/radix: Fix 128TB-512TB virtual address boundary case allocation powerpc/64s/hash: Allow MAP_FIXED allocations to cross 128TB boundary powerpc/64s/hash: Fix fork() with 512TB process address space powerpc/64s/hash: Fix 128TB-512TB virtual address boundary case allocation powerpc/64s/hash: Fix 512T hint detection to use >= 128T powerpc: Fix DABR match on hash based systems powerpc/signal: Properly handle return value from uprobe_deny_signal() powerpc/fadump: use kstrtoint to handle sysfs store powerpc/lib: Implement UACCESS_FLUSHCACHE API powerpc/lib: Implement PMEM API powerpc/powernv/npu: Don't explicitly flush nmmu tlb powerpc/powernv/npu: Use flush_all_mm() instead of flush_tlb_mm() powerpc/powernv/idle: Round up latency and residency values powerpc/kprobes: refactor kprobe_lookup_name for safer string operations powerpc/kprobes: Blacklist emulate_update_regs() from kprobes powerpc/kprobes: Do not disable interrupts for optprobes and kprobes_on_ftrace powerpc/kprobes: Disable preemption before invoking probe handler for optprobes ...
Diffstat (limited to 'arch/powerpc/lib/sstep.c')
-rw-r--r--arch/powerpc/lib/sstep.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/arch/powerpc/lib/sstep.c b/arch/powerpc/lib/sstep.c
index f208f560aecd..70274b7b4773 100644
--- a/arch/powerpc/lib/sstep.c
+++ b/arch/powerpc/lib/sstep.c
@@ -31,6 +31,8 @@ extern char system_call_common[];
31#define XER_SO 0x80000000U 31#define XER_SO 0x80000000U
32#define XER_OV 0x40000000U 32#define XER_OV 0x40000000U
33#define XER_CA 0x20000000U 33#define XER_CA 0x20000000U
34#define XER_OV32 0x00080000U
35#define XER_CA32 0x00040000U
34 36
35#ifdef CONFIG_PPC_FPU 37#ifdef CONFIG_PPC_FPU
36/* 38/*
@@ -962,6 +964,16 @@ static nokprobe_inline void set_cr0(const struct pt_regs *regs,
962 op->ccval |= 0x20000000; 964 op->ccval |= 0x20000000;
963} 965}
964 966
967static nokprobe_inline void set_ca32(struct instruction_op *op, bool val)
968{
969 if (cpu_has_feature(CPU_FTR_ARCH_300)) {
970 if (val)
971 op->xerval |= XER_CA32;
972 else
973 op->xerval &= ~XER_CA32;
974 }
975}
976
965static nokprobe_inline void add_with_carry(const struct pt_regs *regs, 977static nokprobe_inline void add_with_carry(const struct pt_regs *regs,
966 struct instruction_op *op, int rd, 978 struct instruction_op *op, int rd,
967 unsigned long val1, unsigned long val2, 979 unsigned long val1, unsigned long val2,
@@ -985,6 +997,9 @@ static nokprobe_inline void add_with_carry(const struct pt_regs *regs,
985 op->xerval |= XER_CA; 997 op->xerval |= XER_CA;
986 else 998 else
987 op->xerval &= ~XER_CA; 999 op->xerval &= ~XER_CA;
1000
1001 set_ca32(op, (unsigned int)val < (unsigned int)val1 ||
1002 (carry_in && (unsigned int)val == (unsigned int)val1));
988} 1003}
989 1004
990static nokprobe_inline void do_cmp_signed(const struct pt_regs *regs, 1005static nokprobe_inline void do_cmp_signed(const struct pt_regs *regs,
@@ -1791,6 +1806,7 @@ int analyse_instr(struct instruction_op *op, const struct pt_regs *regs,
1791 op->xerval |= XER_CA; 1806 op->xerval |= XER_CA;
1792 else 1807 else
1793 op->xerval &= ~XER_CA; 1808 op->xerval &= ~XER_CA;
1809 set_ca32(op, op->xerval & XER_CA);
1794 goto logical_done; 1810 goto logical_done;
1795 1811
1796 case 824: /* srawi */ 1812 case 824: /* srawi */
@@ -1803,6 +1819,7 @@ int analyse_instr(struct instruction_op *op, const struct pt_regs *regs,
1803 op->xerval |= XER_CA; 1819 op->xerval |= XER_CA;
1804 else 1820 else
1805 op->xerval &= ~XER_CA; 1821 op->xerval &= ~XER_CA;
1822 set_ca32(op, op->xerval & XER_CA);
1806 goto logical_done; 1823 goto logical_done;
1807 1824
1808#ifdef __powerpc64__ 1825#ifdef __powerpc64__
@@ -1832,6 +1849,7 @@ int analyse_instr(struct instruction_op *op, const struct pt_regs *regs,
1832 op->xerval |= XER_CA; 1849 op->xerval |= XER_CA;
1833 else 1850 else
1834 op->xerval &= ~XER_CA; 1851 op->xerval &= ~XER_CA;
1852 set_ca32(op, op->xerval & XER_CA);
1835 goto logical_done; 1853 goto logical_done;
1836 1854
1837 case 826: /* sradi with sh_5 = 0 */ 1855 case 826: /* sradi with sh_5 = 0 */
@@ -1845,6 +1863,7 @@ int analyse_instr(struct instruction_op *op, const struct pt_regs *regs,
1845 op->xerval |= XER_CA; 1863 op->xerval |= XER_CA;
1846 else 1864 else
1847 op->xerval &= ~XER_CA; 1865 op->xerval &= ~XER_CA;
1866 set_ca32(op, op->xerval & XER_CA);
1848 goto logical_done; 1867 goto logical_done;
1849#endif /* __powerpc64__ */ 1868#endif /* __powerpc64__ */
1850 1869
@@ -2698,6 +2717,7 @@ void emulate_update_regs(struct pt_regs *regs, struct instruction_op *op)
2698 } 2717 }
2699 regs->nip = next_pc; 2718 regs->nip = next_pc;
2700} 2719}
2720NOKPROBE_SYMBOL(emulate_update_regs);
2701 2721
2702/* 2722/*
2703 * Emulate a previously-analysed load or store instruction. 2723 * Emulate a previously-analysed load or store instruction.