[PATCH v4.4 backport 16/16] powerpc/64s: Allow control of RFI flush via debugfs

2018-02-03 Thread Michael Ellerman
commit 236003e6b5443c45c18e613d2b0d776a9f87540e upstream. Expose the state of the RFI flush (enabled/disabled) via debugfs, and allow it to be enabled/disabled at runtime. eg: $ cat /sys/kernel/debug/powerpc/rfi_flush 1 $ echo 0 > /sys/kernel/debug/powerpc/rfi_flush $ cat

[PATCH v4.4 backport 15/16] powerpc/64s: Wire up cpu_show_meltdown()

2018-02-03 Thread Michael Ellerman
commit fd6e440f20b1a4304553775fc55938848ff617c9 upstream. The recent commit 87590ce6e373 ("sysfs/cpu: Add vulnerability folder") added a generic folder and set of files for reporting information on CPU vulnerabilities. One of those was for meltdown:

[PATCH v4.4 backport 14/16] powerpc/powernv: Check device-tree for RFI flush settings

2018-02-03 Thread Michael Ellerman
From: Oliver O'Halloran commit 6e032b350cd1fdb830f18f8320ef0e13b4e24094 upstream. New device-tree properties are available which tell the hypervisor settings related to the RFI flush. Use them to determine the appropriate flush instruction to use, and whether the flush is

[PATCH v4.4 backport 13/16] powerpc/pseries: Query hypervisor for RFI flush settings

2018-02-03 Thread Michael Ellerman
From: Michael Neuling commit 8989d56878a7735dfdb234707a2fee6faf631085 upstream. A new hypervisor call is available which tells the guest settings related to the RFI flush. Use it to query the appropriate flush instruction(s), and whether the flush is required. Signed-off-by:

[PATCH v4.4 backport 12/16] powerpc/64s: Support disabling RFI flush with no_rfi_flush and nopti

2018-02-03 Thread Michael Ellerman
commit bc9c9304a45480797e13a8e1df96ffcf44fb62fe upstream. Because there may be some performance overhead of the RFI flush, add kernel command line options to disable it. We add a sensibly named 'no_rfi_flush' option, but we also hijack the x86 option 'nopti'. The RFI flush is not the same as

[PATCH v4.4 backport 11/16] powerpc/64s: Add support for RFI flush of L1-D cache

2018-02-03 Thread Michael Ellerman
commit aa8a5e0062ac940f7659394f4817c948dc8c0667 upstream. On some CPUs we can prevent the Meltdown vulnerability by flushing the L1-D cache on exit from kernel to user mode, and from hypervisor to guest. This is known to be the case on at least Power7, Power8 and Power9. At this time we do not

[PATCH v4.4 backport 10/16] powerpc/64s: Convert slb_miss_common to use RFI_TO_USER/KERNEL

2018-02-03 Thread Michael Ellerman
From: Nicholas Piggin commit c7305645eb0c1621351cfc104038831ae87c0053 upstream. In the SLB miss handler we may be returning to user or kernel. We need to add a check early on and save the result in the cr4 register, and then we bifurcate the return path based on that.

[PATCH v4.4 backport 09/16] powerpc/64: Convert the syscall exit path to use RFI_TO_USER/KERNEL

2018-02-03 Thread Michael Ellerman
From: Nicholas Piggin commit b8e90cb7bc04a509e821e82ab6ed7a8ef11ba333 upstream. In the syscall exit path we may be returning to user or kernel context. We already have a test for that, because we conditionally restore r13. So use that existing test and branch, and bifurcate

[PATCH v4.4 backport 08/16] powerpc/64: Convert fast_exception_return to use RFI_TO_USER/KERNEL

2018-02-03 Thread Michael Ellerman
From: Nicholas Piggin commit a08f828cf47e6c605af21d2cdec68f84e799c318 upstream. Similar to the syscall return path, in fast_exception_return we may be returning to user or kernel context. We already have a test for that, because we conditionally restore r13. So use that

[PATCH v4.4 backport 07/16] powerpc/64s: Simple RFI macro conversions

2018-02-03 Thread Michael Ellerman
From: Nicholas Piggin commit 222f20f140623ef6033491d0103ee0875fe87d35 upstream. This commit does simple conversions of rfi/rfid to the new macros that include the expected destination context. By simple we mean cases where there is a single well known destination context, and

[PATCH v4.4 backport 06/16] powerpc/64: Add macros for annotating the destination of rfid/hrfid

2018-02-03 Thread Michael Ellerman
From: Nicholas Piggin commit 50e51c13b3822d14ff6df4279423e4b7b2269bc3 upstream. The rfid/hrfid ((Hypervisor) Return From Interrupt) instruction is used for switching from the kernel to userspace, and from the hypervisor to the guest kernel. However it can and is also used for

[PATCH v4.4 backport 05/16] powerpc/pseries: Add H_GET_CPU_CHARACTERISTICS flags & wrapper

2018-02-03 Thread Michael Ellerman
From: Michael Neuling commit 191eccb1580939fb0d47deb405b82a85b0379070 upstream. A new hypervisor call has been defined to communicate various characteristics of the CPU to guests. Add definitions for the hcall number, flags and a wrapper function. Signed-off-by: Michael

[PATCH v4.4 backport 04/16] powerpc: Simplify module TOC handling

2018-02-03 Thread Michael Ellerman
From: Alan Modra commit c153693d7eb9eeb28478aa2deaaf0b4e7b5ff5e9 upstream. PowerPC64 uses the symbol .TOC. much as other targets use _GLOBAL_OFFSET_TABLE_. It identifies the value of the GOT pointer (or in powerpc parlance, the TOC pointer). Global offset tables are generally

[PATCH v4.4 backport 03/16] powerpc: Fix VSX enabling/flushing to also test MSR_FP and MSR_VEC

2018-02-03 Thread Michael Ellerman
From: Benjamin Herrenschmidt commit 5a69aec945d27e78abac9fd032533d3aaebf7c1e upstream. VSX uses a combination of the old vector registers, the old FP registers and new "second halves" of the FP registers. Thus when we need to see the VSX state in the thread struct

[PATCH v4.4 backport 02/16] powerpc/64: Fix flush_(d|i)cache_range() called from modules

2018-02-03 Thread Michael Ellerman
From: Oliver O'Halloran commit 8f5f525d5b83f7d76a6baf9c4e94d4bf312ea7f6 upstream. When the kernel is compiled to use 64bit ABIv2 the _GLOBAL() macro does not include a global entry point. A function's global entry point is used when the function is called from a different TOC

[PATCH v4.4 backport 01/16] powerpc/bpf/jit: Disable classic BPF JIT on ppc64le

2018-02-03 Thread Michael Ellerman
From: "Naveen N. Rao" commit 844e3be47693f92a108cb1fb3b0606bf25e9c7a6 upstream. Backport required due to rename of HAVE_BPF_JIT to HAVE_CBPF_JIT upstream - mpe. Classic BPF JIT was never ported completely to work on little endian powerpc. However, it can be

[PATCH v4.4 backport 00/16] powerpc stable backports for v4.4

2018-02-03 Thread Michael Ellerman
Hi Greg, This is a backport to v4.4 of the RFI flush series that went upstream recently. There's also a few other commits I noticed had not made it to v4.4 due to needing manual backports. cheers

[PATCH v6 1/1] KVM: PPC: Book3S: Add MMIO emulation for VMX instructions

2018-02-03 Thread Jose Ricardo Ziviani
This patch provides the MMIO load/store vector indexed X-Form emulation. Instructions implemented: lvx: the quadword in storage addressed by the result of EA & 0x___fff0 is loaded into VRT. stvx: the contents of VRS are stored into the quadword in storage addressed by the result of

[PATCH v6 0/1] Implements MMIO emulation for lvx/stvx instructions

2018-02-03 Thread Jose Ricardo Ziviani
v6: - Applied Paul's code suggestion to fix endianess - Moved kvmppc_get_vsr_dword_offset() back to #ifdef CONFIG_VSX v5: - Fixed the mask off of the effective address v4: - Changed KVM_MMIO_REG_VMX to 0xc0 because there are 64 VSX registers v3: - Added Reported-by in the commit

Re: [PATCH (skiboot)] dt: add /cpus/ibm, powerpc-cpu-features device tree bindings

2018-02-03 Thread Segher Boessenkool
Hi! Some remarks: On Sat, Feb 03, 2018 at 02:27:32PM +1000, Nicholas Piggin wrote: > + /* > + * ISAv3.0B deliver a random number instruction (darn) > + */ > + { "random-number-generator", That's not such a great name... "darn-instruction" maybe? Just "wait" as a name is a

Re: macintosh: change some data types from int to bool

2018-02-03 Thread Gustavo A. R. Silva
Hi Michael, Quoting Michael Ellerman : "Gustavo A. R. Silva" writes: Hi Michael, Quoting Michael Ellerman : On Wed, 2018-01-24 at 01:42:28 UTC, "Gustavo A. R. Silva" wrote: Change the data type of the

Re: DPAA Ethernet traffice troubles with Linux kernel

2018-02-03 Thread mad skateman
For those interested... i have recorded a video of my X5000 DPAA Ethernet, and the weird problems.. In this Video i am also transfering hundereds of megabytes from my NAS to the X5000. You will also see pings die... mostly after the 12th packet and giving the no buffer space error.. Hopefully