* [PATCH 0/6] selftests: powerpc build fixes
From: Joel Stanley @ 2018-10-23 6:16 UTC (permalink / raw)
To: linuxppc-dev; +Cc: linux-kselftest
This series fixes issues I encountered building and running the
selftests on a Ubuntu Cosmic ppc64le system.
Joel Stanley (6):
selftests: powerpc/ptrace: Make tests build
selftests: powerpc/ptrace: Remove clean rule
selftests: powerpc/ptrace: Fix linking against pthread
selftests: powerpc/signal: Make tests build
selftests: powerpc/signal: Fix signal_tm CFLAGS
selftests: powerpc/pmu: Link ebb tests with -no-pie
tools/testing/selftests/powerpc/pmu/ebb/Makefile | 3 +++
tools/testing/selftests/powerpc/ptrace/Makefile | 11 ++++-------
tools/testing/selftests/powerpc/signal/Makefile | 9 +++------
3 files changed, 10 insertions(+), 13 deletions(-)
--
2.19.1
^ permalink raw reply
* Re: [PATCH] net/wan/fsl_ucc_hdlc: error counters
From: David Miller @ 2018-10-23 2:58 UTC (permalink / raw)
To: mathias.thore; +Cc: netdev, linuxppc-dev, david.gounaris, qiang.zhao
In-Reply-To: <20181022125550.31170-1-mathias.thore@infinera.com>
From: Mathias Thore <mathias.thore@infinera.com>
Date: Mon, 22 Oct 2018 14:55:50 +0200
> Extract error information from rx and tx buffer descriptors,
> and update error counters.
>
> Signed-off-by: Mathias Thore <mathias.thore@infinera.com>
Applied.
^ permalink raw reply
* [PATCH] powerpc/pseries: add missing cpumask.h include file
From: Tyrel Datwyler @ 2018-10-23 1:32 UTC (permalink / raw)
To: mpe; +Cc: linuxppc-dev, Tyrel Datwyler, nfont
Build error is encountered when inlcuding <asm/rtas.h> if no explicit or
implicit include of cpumask.h exists in the including file.
In file included from arch/powerpc/platforms/pseries/hotplug-pci.c:3:0:
./arch/powerpc/include/asm/rtas.h:360:34: error: unknown type name 'cpumask_var_t'
extern int rtas_online_cpus_mask(cpumask_var_t cpus);
^
./arch/powerpc/include/asm/rtas.h:361:35: error: unknown type name 'cpumask_var_t'
extern int rtas_offline_cpus_mask(cpumask_var_t cpus);
Fixes: 120496ac2d2d ("powerpc: Bring all threads online prior to migration/hibernation")
Signed-off-by: Tyrel Datwyler <tyreld@linux.vnet.ibm.com>
---
arch/powerpc/include/asm/rtas.h | 1 +
1 file changed, 1 insertion(+)
diff --git a/arch/powerpc/include/asm/rtas.h b/arch/powerpc/include/asm/rtas.h
index 71e393c..06b8dd3 100644
--- a/arch/powerpc/include/asm/rtas.h
+++ b/arch/powerpc/include/asm/rtas.h
@@ -5,6 +5,7 @@
#include <linux/spinlock.h>
#include <asm/page.h>
#include <linux/time.h>
+#include <linux/cpumask.h>
/*
* Definitions for talking to the RTAS on CHRP machines.
--
2.7.4
^ permalink raw reply related
* Pull request: scottwood/linux.git next
From: Scott Wood @ 2018-10-23 0:22 UTC (permalink / raw)
To: Michael Ellerman; +Cc: linuxppc-dev
This contains a couple device tree updates, and a fix for a missing
prototype warning.
The following changes since commit a0e102914aa3f619a5bc68a0d33e17d1788cdf4c:
powerpc/io: remove old GCC version implementation (2018-10-19 00:56:17 +1100)
are available in the Git repository at:
git://git.kernel.org/pub/scm/linux/kernel/git/scottwood/linux.git next
for you to fetch changes up to b6ae3550c8e2ca8f7ce1b7f04585dc12a0eb5cbd:
powerpc/8xx: add missing header in 8xx_mmu.c (2018-10-22 19:11:58 -0500)
----------------------------------------------------------------
Camelia Groza (1):
powerpc/dts/fsl: t2080rdb: reorder the Cortina PHY XFI lanes
Christophe Leroy (2):
powerpc/8xx: Add DT node for using the SEC engine of the MPC885
powerpc/8xx: add missing header in 8xx_mmu.c
arch/powerpc/boot/dts/fsl/t2080rdb.dts | 4 ++--
arch/powerpc/boot/dts/mpc885ads.dts | 13 ++++++++++++-
arch/powerpc/mm/8xx_mmu.c | 1 +
3 files changed, 15 insertions(+), 3 deletions(-)
^ permalink raw reply
* Re: [PATCH v5 00/18] of: overlay: validation checks, subsequent fixes
From: Alan Tull @ 2018-10-22 21:24 UTC (permalink / raw)
To: Frank Rowand
Cc: open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS,
linux-fpga, Pantelis Antoniou, linux-kernel, Rob Herring,
Moritz Fischer, Paul Mackerras, linuxppc-dev
In-Reply-To: <1539902796-8382-1-git-send-email-frowand.list@gmail.com>
On Thu, Oct 18, 2018 at 5:48 PM <frowand.list@gmail.com> wrote:
>
> From: Frank Rowand <frank.rowand@sony.com>
>
> Add checks to (1) overlay apply process and (2) memory freeing
> triggered by overlay release. The checks are intended to detect
> possible memory leaks and invalid overlays.
I've tested v5, nothing new to report.
Alan
>
> The checks revealed bugs in existing code. Fixed the bugs.
>
> While fixing bugs, noted other issues, which are fixed in
> separate patches.
>
> ***** Powerpc folks: I was not able to test the patches that
> ***** directly impact Powerpc systems that use dynamic
> ***** devicetree. Please review that code carefully and
> ***** test. The specific patches are: 03/16, 04/16, 07/16
>
> FPGA folks:
>
> I made the validation checks that should result in an
> invalid live devicetree report "ERROR" and cause the overlay apply
> to fail.
>
> I made the memory leak validation tests report "WARNING" and allow
> the overlay apply to complete successfully. Please let me know
> if you encounter the warnings. There are at least two paths
> forward to deal with the cases that trigger the warning: (1) change
> the warning to an error and fail the overlay apply, or (2) find a
> way to detect the potential memory leaks and free the memory
> appropriately.
>
> ALL people:
>
> The validations do _not_ address another major concern I have with
> releasing overlays, which is use after free errors.
>
> Changes since v4:
> - 01/18: make error message format consistent, error first, path last
> - 09/18: create of_prop_val_eq() and change open code to use it
> - 09/18: remove extra blank lines
>
> Changes since v3:
> - 01/18: Add expected value of refcount for destroy cset entry error. Also
> explain the cause of the error.
>
> - 09/18: for errors of an overlay changing the value of #size-cells or
> #address-cells, return -EINVAL so that overlay apply will fail
> - 09/18: for errors of an overlay changing the value of #size-cells or
> #address-cells, make the message more direct.
> Old message:
> OF: overlay: ERROR: overlay and/or live tree #size-cells invalid in node /soc/base_fpga_region
> New message:
> OF: overlay: ERROR: changing value of /soc/base_fpga_region/#size-cells not allowed
>
> - 13/18: Update patch comment header to state that this patch modifies the
> previous patch to not return immediately on fragment error and
> explain this is not a performance issue.
> - 13/18: remove redundant "overlay" from two error messages. "OF: overlay:"
> is already present in pr_fmt()
>
> Changes since v2:
>
> - 13/18: Use continue to reduce indentation in find_dup_cset_node_entry()
> and find_dup_cset_prop()
>
> Changes since v1:
>
> - move patch 16/16 to 17/18
> - move patch 15/16 to 18/18
> - new patch 15/18
> - new patch 16/18
>
> - 05/18: add_changeset_node() header comment: incorrect comment for @target
>
> - 18/18: add same fix for of_parse_phandle_with_args()
> - 18/18: add same fix for of_parse_phandle_with_args_map()
>
>
> *** BLURB HERE ***
>
> Frank Rowand (18):
> of: overlay: add tests to validate kfrees from overlay removal
> of: overlay: add missing of_node_put() after add new node to changeset
> of: overlay: add missing of_node_get() in __of_attach_node_sysfs
> powerpc/pseries: add of_node_put() in dlpar_detach_node()
> of: overlay: use prop add changeset entry for property in new nodes
> of: overlay: do not duplicate properties from overlay for new nodes
> of: dynamic: change type of of_{at,de}tach_node() to void
> of: overlay: reorder fields in struct fragment
> of: overlay: validate overlay properties #address-cells and
> #size-cells
> of: overlay: make all pr_debug() and pr_err() messages unique
> of: overlay: test case of two fragments adding same node
> of: overlay: check prevents multiple fragments add or delete same node
> of: overlay: check prevents multiple fragments touching same property
> of: unittest: remove unused of_unittest_apply_overlay() argument
> of: overlay: set node fields from properties when add new overlay node
> of: unittest: allow base devicetree to have symbol metadata
> of: unittest: find overlays[] entry by name instead of index
> of: unittest: initialize args before calling of_*parse_*()
>
> arch/powerpc/platforms/pseries/dlpar.c | 15 +-
> arch/powerpc/platforms/pseries/reconfig.c | 6 +-
> drivers/of/dynamic.c | 68 +++--
> drivers/of/kobj.c | 4 +-
> drivers/of/overlay.c | 292 ++++++++++++++++-----
> drivers/of/unittest-data/Makefile | 2 +
> .../of/unittest-data/overlay_bad_add_dup_node.dts | 28 ++
> .../of/unittest-data/overlay_bad_add_dup_prop.dts | 24 ++
> drivers/of/unittest-data/overlay_base.dts | 1 +
> drivers/of/unittest.c | 96 +++++--
> include/linux/of.h | 25 +-
> 11 files changed, 439 insertions(+), 122 deletions(-)
> create mode 100644 drivers/of/unittest-data/overlay_bad_add_dup_node.dts
> create mode 100644 drivers/of/unittest-data/overlay_bad_add_dup_prop.dts
>
> --
> Frank Rowand <frank.rowand@sony.com>
>
^ permalink raw reply
* [PATCH] selftests/powerpc: Fix ptrace tm failure
From: Breno Leitao @ 2018-10-22 21:16 UTC (permalink / raw)
To: linuxppc-dev; +Cc: Breno Leitao, mikey, stable, gromero
Test ptrace-tm-spd-gpr fails on current kernel (4.19) due to a segmentation
fault that happens on the child process prior to setting cptr[2] = 1. This
causes the parent process to wait forever at 'while (!pptr[2])' and the test to
be killed by the test harness framework by timeout, thus, failing.
The segmentation fault happens because of a inline assembly being
generated as:
0x10000355c <tm_spd_gpr+492> lfs f0, 0(0)
This is reading memory position 0x0 and causing the segmentation fault.
This code is being generated by ASM_LOAD_FPR_SINGLE_PRECISION(flt_4), where
flt_4 is passed to the inline assembly block as:
[flt_4] "r" (&d)
Since the inline assembly 'r' constraint means any GPR, gpr0 is being
chosen, thus causing this issue when issuing a Load Floating-Point Single
instruction.
This patch simply changes the constraint to 'b', which specify that this
register will be used as base, and r0 is not allowed to be used, avoiding
this issue.
Other than that, removing flt_2 register from the input operands, since it
is not used by the inline assembly code at all.
Cc: stable@vger.kernel.org
Signed-off-by: Breno Leitao <leitao@debian.org>
---
tools/testing/selftests/powerpc/ptrace/ptrace-tm-spd-gpr.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/tools/testing/selftests/powerpc/ptrace/ptrace-tm-spd-gpr.c b/tools/testing/selftests/powerpc/ptrace/ptrace-tm-spd-gpr.c
index 327fa943c7f3..dbdffa2e2c82 100644
--- a/tools/testing/selftests/powerpc/ptrace/ptrace-tm-spd-gpr.c
+++ b/tools/testing/selftests/powerpc/ptrace/ptrace-tm-spd-gpr.c
@@ -67,8 +67,8 @@ void tm_spd_gpr(void)
"3: ;"
: [res] "=r" (result), [texasr] "=r" (texasr)
: [gpr_1]"i"(GPR_1), [gpr_2]"i"(GPR_2), [gpr_4]"i"(GPR_4),
- [sprn_texasr] "i" (SPRN_TEXASR), [flt_1] "r" (&a),
- [flt_2] "r" (&b), [flt_4] "r" (&d)
+ [sprn_texasr] "i" (SPRN_TEXASR), [flt_1] "b" (&a),
+ [flt_4] "b" (&d)
: "memory", "r5", "r6", "r7",
"r8", "r9", "r10", "r11", "r12", "r13", "r14", "r15",
"r16", "r17", "r18", "r19", "r20", "r21", "r22", "r23",
--
2.19.0
^ permalink raw reply related
* Re: [v9 2/7] dmaengine: fsldma: Adding macro FSL_DMA_IN/OUT implement for ARM platform
From: kbuild test robot @ 2018-10-22 17:14 UTC (permalink / raw)
To: Peng Ma
Cc: mark.rutland, devicetree, Wen He, linuxppc-dev, Peng Ma,
linux-kernel, leoyang.li, zw, vkoul, robh+dt, kbuild-all,
dmaengine, dan.j.williams, shawnguo, linux-arm-kernel
In-Reply-To: <20181017055957.542-2-peng.ma@nxp.com>
[-- Attachment #1: Type: text/plain, Size: 6549 bytes --]
Hi Peng,
Thank you for the patch! Perhaps something to improve:
[auto build test WARNING on linux-sof-driver/master]
[also build test WARNING on v4.19 next-20181019]
[if your patch is applied to the wrong git tree, please drop us a note to help improve the system]
url: https://github.com/0day-ci/linux/commits/Peng-Ma/dmaengine-fsldma-Replace-DMA_IN-OUT-by-FSL_DMA_IN-OUT/20181017-232444
base: https://github.com/thesofproject/linux master
config: powerpc-xes_mpc85xx_defconfig (attached as .config)
compiler: powerpc-linux-gnu-gcc (Debian 7.2.0-11) 7.2.0
reproduce:
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# save the attached .config to linux build tree
GCC_VERSION=7.2.0 make.cross ARCH=powerpc
All warnings (new ones prefixed by >>):
In file included from drivers/dma/fsldma.c:41:0:
drivers/dma/fsldma.h: In function 'fsl_ioread64':
>> drivers/dma/fsldma.h:210:17: warning: passing argument 1 of 'in_le32' makes pointer from integer without a cast [-Wint-conversion]
return in_le32(fsl_addr) | in_le32(fsl_addr + 1) << 32;
^~~~~~~~
In file included from include/linux/io.h:25:0,
from include/linux/irq.h:20,
from arch/powerpc/include/asm/hardirq.h:6,
from include/linux/hardirq.h:9,
from include/linux/interrupt.h:11,
from include/linux/pci.h:32,
from drivers/dma/fsldma.c:29:
arch/powerpc/include/asm/io.h:172:15: note: expected 'const volatile u32 * {aka const volatile unsigned int *}' but argument is of type 'u32 {aka unsigned int}'
DEF_MMIO_IN_X(in_le32, 32, lwbrx);
^
arch/powerpc/include/asm/io.h:131:23: note: in definition of macro 'DEF_MMIO_IN_X'
static inline u##size name(const volatile u##size __iomem *addr) \
^~~~
In file included from drivers/dma/fsldma.c:41:0:
drivers/dma/fsldma.h:210:37: warning: passing argument 1 of 'in_le32' makes pointer from integer without a cast [-Wint-conversion]
return in_le32(fsl_addr) | in_le32(fsl_addr + 1) << 32;
^~~~~~~~
In file included from include/linux/io.h:25:0,
from include/linux/irq.h:20,
from arch/powerpc/include/asm/hardirq.h:6,
from include/linux/hardirq.h:9,
from include/linux/interrupt.h:11,
from include/linux/pci.h:32,
from drivers/dma/fsldma.c:29:
arch/powerpc/include/asm/io.h:172:15: note: expected 'const volatile u32 * {aka const volatile unsigned int *}' but argument is of type 'u32 {aka unsigned int}'
DEF_MMIO_IN_X(in_le32, 32, lwbrx);
^
arch/powerpc/include/asm/io.h:131:23: note: in definition of macro 'DEF_MMIO_IN_X'
static inline u##size name(const volatile u##size __iomem *addr) \
^~~~
In file included from drivers/dma/fsldma.c:41:0:
>> drivers/dma/fsldma.h:210:51: warning: left shift count >= width of type [-Wshift-count-overflow]
return in_le32(fsl_addr) | in_le32(fsl_addr + 1) << 32;
^~
drivers/dma/fsldma.h: In function 'fsl_ioread64be':
>> drivers/dma/fsldma.h:223:17: warning: passing argument 1 of 'in_be32' makes pointer from integer without a cast [-Wint-conversion]
return in_be32(fsl_addr + 1) | in_be32(fsl_addr) << 32;
^~~~~~~~
In file included from include/linux/io.h:25:0,
from include/linux/irq.h:20,
from arch/powerpc/include/asm/hardirq.h:6,
from include/linux/hardirq.h:9,
from include/linux/interrupt.h:11,
from include/linux/pci.h:32,
from drivers/dma/fsldma.c:29:
arch/powerpc/include/asm/io.h:170:15: note: expected 'const volatile u32 * {aka const volatile unsigned int *}' but argument is of type 'u32 {aka unsigned int}'
DEF_MMIO_IN_D(in_be32, 32, lwz);
^
arch/powerpc/include/asm/io.h:149:23: note: in definition of macro 'DEF_MMIO_IN_D'
static inline u##size name(const volatile u##size __iomem *addr) \
^~~~
In file included from drivers/dma/fsldma.c:41:0:
drivers/dma/fsldma.h:223:41: warning: passing argument 1 of 'in_be32' makes pointer from integer without a cast [-Wint-conversion]
return in_be32(fsl_addr + 1) | in_be32(fsl_addr) << 32;
^~~~~~~~
In file included from include/linux/io.h:25:0,
from include/linux/irq.h:20,
from arch/powerpc/include/asm/hardirq.h:6,
from include/linux/hardirq.h:9,
from include/linux/interrupt.h:11,
from include/linux/pci.h:32,
from drivers/dma/fsldma.c:29:
arch/powerpc/include/asm/io.h:170:15: note: expected 'const volatile u32 * {aka const volatile unsigned int *}' but argument is of type 'u32 {aka unsigned int}'
DEF_MMIO_IN_D(in_be32, 32, lwz);
^
arch/powerpc/include/asm/io.h:149:23: note: in definition of macro 'DEF_MMIO_IN_D'
static inline u##size name(const volatile u##size __iomem *addr) \
^~~~
In file included from drivers/dma/fsldma.c:41:0:
drivers/dma/fsldma.h:223:51: warning: left shift count >= width of type [-Wshift-count-overflow]
return in_be32(fsl_addr + 1) | in_be32(fsl_addr) << 32;
^~
vim +/in_le32 +210 drivers/dma/fsldma.h
204
205 #ifndef __powerpc64__
206 static u64 fsl_ioread64(const u64 __iomem *addr)
207 {
208 u32 fsl_addr = lower_32_bits(addr);
209
> 210 return in_le32(fsl_addr) | in_le32(fsl_addr + 1) << 32;
211 }
212
213 static void fsl_iowrite64(u64 val, u64 __iomem *addr)
214 {
215 out_le32((u32 __iomem *)addr + 1, val >> 32);
216 out_le32((u32 __iomem *)addr, (u32)val);
217 }
218
219 static u64 fsl_ioread64be(const u64 __iomem *addr)
220 {
221 u32 fsl_addr = lower_32_bits(addr);
222
> 223 return in_be32(fsl_addr + 1) | in_be32(fsl_addr) << 32;
224 }
225
---
0-DAY kernel test infrastructure Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all Intel Corporation
[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 17785 bytes --]
^ permalink raw reply
* [PATCH 4/9] powerpc/xive: Define xive_do_source_eoi as static
From: Breno Leitao @ 2018-10-22 14:54 UTC (permalink / raw)
To: linuxppc-dev; +Cc: Breno Leitao
In-Reply-To: <1540220060-30162-1-git-send-email-leitao@debian.org>
Sparse shows that xive_do_source_eoi() file is defined without any
declaration, thus, it should be a static function.
arch/powerpc/sysdev/xive/common.c:312:6: warning: symbol 'xive_do_source_eoi' was not declared. Should it be static?
This patch simply turns this symbol into static.
Signed-off-by: Breno Leitao <leitao@debian.org>
---
arch/powerpc/sysdev/xive/common.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/powerpc/sysdev/xive/common.c b/arch/powerpc/sysdev/xive/common.c
index 959a2a62f233..6a6178357529 100644
--- a/arch/powerpc/sysdev/xive/common.c
+++ b/arch/powerpc/sysdev/xive/common.c
@@ -309,7 +309,7 @@ static void xive_do_queue_eoi(struct xive_cpu *xc)
* EOI an interrupt at the source. There are several methods
* to do this depending on the HW version and source type
*/
-void xive_do_source_eoi(u32 hw_irq, struct xive_irq_data *xd)
+static void xive_do_source_eoi(u32 hw_irq, struct xive_irq_data *xd)
{
/* If the XIVE supports the new "store EOI facility, use it */
if (xd->flags & XIVE_IRQ_FLAG_STORE_EOI)
--
2.19.0
^ permalink raw reply related
* [PATCH 2/9] powerpc/eeh: Declare pci_ers_result_name() as static
From: Breno Leitao @ 2018-10-22 14:54 UTC (permalink / raw)
To: linuxppc-dev; +Cc: Breno Leitao
In-Reply-To: <1540220060-30162-1-git-send-email-leitao@debian.org>
Function pci_ers_result_name() is a static function, although not declared
as such. This was detected by sparse in the following warning
arch/powerpc/kernel/eeh_driver.c:63:12: warning: symbol 'pci_ers_result_name' was not declared. Should it be static?
This patch simply declares the function a static.
Signed-off-by: Breno Leitao <leitao@debian.org>
---
arch/powerpc/kernel/eeh_driver.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/powerpc/kernel/eeh_driver.c b/arch/powerpc/kernel/eeh_driver.c
index 67619b4b3f96..c325dedfee73 100644
--- a/arch/powerpc/kernel/eeh_driver.c
+++ b/arch/powerpc/kernel/eeh_driver.c
@@ -60,7 +60,7 @@ static int eeh_result_priority(enum pci_ers_result result)
}
};
-const char *pci_ers_result_name(enum pci_ers_result result)
+static const char *pci_ers_result_name(enum pci_ers_result result)
{
switch (result) {
case PCI_ERS_RESULT_NONE:
--
2.19.0
^ permalink raw reply related
* [PATCH 9/9] powerpc/pkey: Define functions as static
From: Breno Leitao @ 2018-10-22 14:54 UTC (permalink / raw)
To: linuxppc-dev; +Cc: Breno Leitao
In-Reply-To: <1540220060-30162-1-git-send-email-leitao@debian.org>
Sparse tool is showing some warnings on pkeys.c file, mainly related to
storage class identifiers. There are static variables and functions not
declared as such. The same thing happens with an extern function, which
misses the header inclusion.
arch/powerpc/mm/pkeys.c:14:6: warning: symbol 'pkey_execute_disable_supported' was not declared. Should it be static?
arch/powerpc/mm/pkeys.c:16:6: warning: symbol 'pkeys_devtree_defined' was not declared. Should it be static?
arch/powerpc/mm/pkeys.c:19:6: warning: symbol 'pkey_amr_mask' was not declared. Should it be static?
arch/powerpc/mm/pkeys.c:20:6: warning: symbol 'pkey_iamr_mask' was not declared. Should it be static?
arch/powerpc/mm/pkeys.c:21:6: warning: symbol 'pkey_uamor_mask' was not declared. Should it be static?
arch/powerpc/mm/pkeys.c:22:6: warning: symbol 'execute_only_key' was not declared. Should it be static?
arch/powerpc/mm/pkeys.c:60:5: warning: symbol 'pkey_initialize' was not declared. Should it be static?
arch/powerpc/mm/pkeys.c:404:6: warning: symbol 'arch_vma_access_permitted' was not declared. Should it be static?
This patch fix al the warning, basically turning all global variables that
are not declared as extern at asm/pkeys.h into static.
It also includes asm/mmu_context.h header, which contains the definition of
arch_vma_access_permitted.
Signed-off-by: Breno Leitao <leitao@debian.org>
---
arch/powerpc/mm/pkeys.c | 15 ++++++++-------
1 file changed, 8 insertions(+), 7 deletions(-)
diff --git a/arch/powerpc/mm/pkeys.c b/arch/powerpc/mm/pkeys.c
index b271b283c785..04b60a8f6e69 100644
--- a/arch/powerpc/mm/pkeys.c
+++ b/arch/powerpc/mm/pkeys.c
@@ -6,20 +6,21 @@
*/
#include <asm/mman.h>
+#include <asm/mmu_context.h>
#include <asm/setup.h>
#include <linux/pkeys.h>
#include <linux/of_device.h>
DEFINE_STATIC_KEY_TRUE(pkey_disabled);
-bool pkey_execute_disable_supported;
int pkeys_total; /* Total pkeys as per device tree */
-bool pkeys_devtree_defined; /* pkey property exported by device tree */
u32 initial_allocation_mask; /* Bits set for the initially allocated keys */
u32 reserved_allocation_mask; /* Bits set for reserved keys */
-u64 pkey_amr_mask; /* Bits in AMR not to be touched */
-u64 pkey_iamr_mask; /* Bits in AMR not to be touched */
-u64 pkey_uamor_mask; /* Bits in UMOR not to be touched */
-int execute_only_key = 2;
+static bool pkey_execute_disable_supported;
+static bool pkeys_devtree_defined; /* property exported by device tree */
+static u64 pkey_amr_mask; /* Bits in AMR not to be touched */
+static u64 pkey_iamr_mask; /* Bits in AMR not to be touched */
+static u64 pkey_uamor_mask; /* Bits in UMOR not to be touched */
+static int execute_only_key = 2;
#define AMR_BITS_PER_PKEY 2
#define AMR_RD_BIT 0x1UL
@@ -57,7 +58,7 @@ static inline bool pkey_mmu_enabled(void)
return cpu_has_feature(CPU_FTR_PKEY);
}
-int pkey_initialize(void)
+static int pkey_initialize(void)
{
int os_reserved, i;
--
2.19.0
^ permalink raw reply related
* [PATCH 8/9] powerpc/perf: Declare static identifier a such
From: Breno Leitao @ 2018-10-22 14:54 UTC (permalink / raw)
To: linuxppc-dev; +Cc: Breno Leitao
In-Reply-To: <1540220060-30162-1-git-send-email-leitao@debian.org>
There are three symbols (two variables and a function) that are being used
solely in the same file (imc-pmu.c), thus, these symbols should be static,
but they are not. This was detected by sparse:
arch/powerpc/perf/imc-pmu.c:31:20: warning: symbol 'nest_imc_refc' was not declared. Should it be static?
arch/powerpc/perf/imc-pmu.c:37:20: warning: symbol 'core_imc_refc' was not declared. Should it be static?
arch/powerpc/perf/imc-pmu.c:46:16: warning: symbol 'imc_event_to_pmu' was not declared. Should it be static?
This patch simply adds the 'static' storage-class definition to these
symbols, thus, restricting their usage only in the imc-pmu.c file.
Signed-off-by: Breno Leitao <leitao@debian.org>
---
arch/powerpc/perf/imc-pmu.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/arch/powerpc/perf/imc-pmu.c b/arch/powerpc/perf/imc-pmu.c
index 1fafc32b12a0..1c693c7726f7 100644
--- a/arch/powerpc/perf/imc-pmu.c
+++ b/arch/powerpc/perf/imc-pmu.c
@@ -28,13 +28,13 @@ static DEFINE_MUTEX(nest_init_lock);
static DEFINE_PER_CPU(struct imc_pmu_ref *, local_nest_imc_refc);
static struct imc_pmu **per_nest_pmu_arr;
static cpumask_t nest_imc_cpumask;
-struct imc_pmu_ref *nest_imc_refc;
+static struct imc_pmu_ref *nest_imc_refc;
static int nest_pmus;
/* Core IMC data structures and variables */
static cpumask_t core_imc_cpumask;
-struct imc_pmu_ref *core_imc_refc;
+static struct imc_pmu_ref *core_imc_refc;
static struct imc_pmu *core_imc_pmu;
/* Thread IMC data structures and variables */
@@ -43,7 +43,7 @@ static DEFINE_PER_CPU(u64 *, thread_imc_mem);
static struct imc_pmu *thread_imc_pmu;
static int thread_imc_mem_size;
-struct imc_pmu *imc_event_to_pmu(struct perf_event *event)
+static struct imc_pmu *imc_event_to_pmu(struct perf_event *event)
{
return container_of(event->pmu, struct imc_pmu, pmu);
}
--
2.19.0
^ permalink raw reply related
* [PATCH 6/9] powerpc/lib: Declare static methods
From: Breno Leitao @ 2018-10-22 14:54 UTC (permalink / raw)
To: linuxppc-dev; +Cc: Breno Leitao
In-Reply-To: <1540220060-30162-1-git-send-email-leitao@debian.org>
Functions do_stf_{entry,exit}_barrier_fixups are static but not declared as
such. This was detected by `sparse` tool with the following warning:
arch/powerpc/lib/feature-fixups.c:121:6: warning: symbol 'do_stf_entry_barrier_fixups' was not declared. Should it be static?
arch/powerpc/lib/feature-fixups.c:171:6: warning: symbol 'do_stf_exit_barrier_fixups' was not declared. Should it be static?
This patch declares both functions as static, as they are only called by
do_stf_barrier_fixups(), which is in the same source code file.
Signed-off-by: Breno Leitao <leitao@debian.org>
---
arch/powerpc/lib/feature-fixups.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/arch/powerpc/lib/feature-fixups.c b/arch/powerpc/lib/feature-fixups.c
index e613b02bb2f0..ca8478503f18 100644
--- a/arch/powerpc/lib/feature-fixups.c
+++ b/arch/powerpc/lib/feature-fixups.c
@@ -118,7 +118,7 @@ void do_feature_fixups(unsigned long value, void *fixup_start, void *fixup_end)
}
#ifdef CONFIG_PPC_BOOK3S_64
-void do_stf_entry_barrier_fixups(enum stf_barrier_type types)
+static void do_stf_entry_barrier_fixups(enum stf_barrier_type types)
{
unsigned int instrs[3], *dest;
long *start, *end;
@@ -168,7 +168,7 @@ void do_stf_entry_barrier_fixups(enum stf_barrier_type types)
: "unknown");
}
-void do_stf_exit_barrier_fixups(enum stf_barrier_type types)
+static void do_stf_exit_barrier_fixups(enum stf_barrier_type types)
{
unsigned int instrs[6], *dest;
long *start, *end;
--
2.19.0
^ permalink raw reply related
* [PATCH 7/9] powerpc/scom: Return NULL instead of 0
From: Breno Leitao @ 2018-10-22 14:54 UTC (permalink / raw)
To: linuxppc-dev; +Cc: Breno Leitao
In-Reply-To: <1540220060-30162-1-git-send-email-leitao@debian.org>
Function scom_map_device() returns data type 'scom_map_t', which is a
typedef for 'void *'. This functions is currently returning NULL and zero,
which causes the following warning by 'sparse':
arch/powerpc/sysdev/scom.c:63:24: warning: Using plain integer as NULL pointer
arch/powerpc/sysdev/scom.c:86:24: warning: Using plain integer as NULL pointer
This patch simply replaces zero by NULL.
Signed-off-by: Breno Leitao <leitao@debian.org>
---
arch/powerpc/sysdev/scom.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/arch/powerpc/sysdev/scom.c b/arch/powerpc/sysdev/scom.c
index 0f6fd5d04d33..a707b24a7ddb 100644
--- a/arch/powerpc/sysdev/scom.c
+++ b/arch/powerpc/sysdev/scom.c
@@ -60,7 +60,7 @@ scom_map_t scom_map_device(struct device_node *dev, int index)
parent = scom_find_parent(dev);
if (parent == NULL)
- return 0;
+ return NULL;
/*
* We support "scom-reg" properties for adding scom registers
@@ -83,7 +83,7 @@ scom_map_t scom_map_device(struct device_node *dev, int index)
size >>= 2;
if (index >= (size / (2*cells)))
- return 0;
+ return NULL;
reg = of_read_number(&prop[index * cells * 2], cells);
cnt = of_read_number(&prop[index * cells * 2 + cells], cells);
--
2.19.0
^ permalink raw reply related
* [PATCH 5/9] powerpc/xmon: Define static functions
From: Breno Leitao @ 2018-10-22 14:54 UTC (permalink / raw)
To: linuxppc-dev; +Cc: Breno Leitao
In-Reply-To: <1540220060-30162-1-git-send-email-leitao@debian.org>
Currently sparse is complaining about three issues on the xmon code. Two
storage classes issues and a dereferencing a 'noderef' pointer. These are
the warnings:
arch/powerpc/xmon/xmon.c:2783:1: warning: symbol 'dump_log_buf' was not declared. Should it be static?
arch/powerpc/xmon/xmon.c:2989:6: warning: symbol 'format_pte' was not declared. Should it be static?
arch/powerpc/xmon/xmon.c:2983:30: warning: dereference of noderef expression
This patch fixes all of them, turning both functions static and
dereferencing a pointer calling rcu_dereference() instead of a
straightforward dereference.
Signed-off-by: Breno Leitao <leitao@debian.org>
---
arch/powerpc/xmon/xmon.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/arch/powerpc/xmon/xmon.c b/arch/powerpc/xmon/xmon.c
index 4264aedc7775..5c7187923a72 100644
--- a/arch/powerpc/xmon/xmon.c
+++ b/arch/powerpc/xmon/xmon.c
@@ -2779,7 +2779,7 @@ print_address(unsigned long addr)
xmon_print_symbol(addr, "\t# ", "");
}
-void
+static void
dump_log_buf(void)
{
struct kmsg_dumper dumper = { .active = 1 };
@@ -2980,13 +2980,13 @@ static void show_task(struct task_struct *tsk)
printf("%px %016lx %6d %6d %c %2d %s\n", tsk,
tsk->thread.ksp,
- tsk->pid, tsk->parent->pid,
+ tsk->pid, rcu_dereference(tsk->parent)->pid,
state, task_thread_info(tsk)->cpu,
tsk->comm);
}
#ifdef CONFIG_PPC_BOOK3S_64
-void format_pte(void *ptep, unsigned long pte)
+static void format_pte(void *ptep, unsigned long pte)
{
printf("ptep @ 0x%016lx = 0x%016lx\n", (unsigned long)ptep, pte);
printf("Maps physical address = 0x%016lx\n", pte & PTE_RPN_MASK);
--
2.19.0
^ permalink raw reply related
* [PATCH 1/9] powerpc/64s: Include cpu header
From: Breno Leitao @ 2018-10-22 14:54 UTC (permalink / raw)
To: linuxppc-dev; +Cc: Breno Leitao
Current powerpc security.c file is defining functions, as
cpu_show_meltdown(), cpu_show_spectre_v{1,2} and others, that are being
declared at linux/cpu.h header without including the header file that
contains these declarations.
This is being reported by sparse, which thinks that these functions are
static, due to the lack of declaration:
arch/powerpc/kernel/security.c:105:9: warning: symbol 'cpu_show_meltdown' was not declared. Should it be static?
arch/powerpc/kernel/security.c:139:9: warning: symbol 'cpu_show_spectre_v1' was not declared. Should it be static?
arch/powerpc/kernel/security.c:161:9: warning: symbol 'cpu_show_spectre_v2' was not declared. Should it be static?
arch/powerpc/kernel/security.c:209:6: warning: symbol 'stf_barrier' was not declared. Should it be static?
arch/powerpc/kernel/security.c:289:9: warning: symbol 'cpu_show_spec_store_bypass' was not declared. Should it be static?
This patch simply includes the proper header (linux/cpu.h) to match
function definition and declaration.
Signed-off-by: Breno Leitao <leitao@debian.org>
---
arch/powerpc/kernel/security.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/arch/powerpc/kernel/security.c b/arch/powerpc/kernel/security.c
index f6f469fc4073..9703dce36307 100644
--- a/arch/powerpc/kernel/security.c
+++ b/arch/powerpc/kernel/security.c
@@ -4,6 +4,7 @@
//
// Copyright 2018, Michael Ellerman, IBM Corporation.
+#include <linux/cpu.h>
#include <linux/kernel.h>
#include <linux/device.h>
#include <linux/seq_buf.h>
--
2.19.0
^ permalink raw reply related
* [PATCH 3/9] powerpc/mm: Remove extern from function definition
From: Breno Leitao @ 2018-10-22 14:54 UTC (permalink / raw)
To: linuxppc-dev; +Cc: Breno Leitao
In-Reply-To: <1540220060-30162-1-git-send-email-leitao@debian.org>
Function huge_ptep_set_access_flags() has the 'extern' keyword in the
function definition and also in the function declaration. This causes a
warning in 'sparse' since the 'extern' storage class should be used only on
symbol declarations.
arch/powerpc/mm/pgtable.c:232:12: warning: function 'huge_ptep_set_access_flags' with external linkage has definition
This patch removes the keyword from the definition part, while keeps it in
the declaration part.
Signed-off-by: Breno Leitao <leitao@debian.org>
---
arch/powerpc/mm/pgtable.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/powerpc/mm/pgtable.c b/arch/powerpc/mm/pgtable.c
index d71c7777669c..213933b78077 100644
--- a/arch/powerpc/mm/pgtable.c
+++ b/arch/powerpc/mm/pgtable.c
@@ -229,7 +229,7 @@ int ptep_set_access_flags(struct vm_area_struct *vma, unsigned long address,
}
#ifdef CONFIG_HUGETLB_PAGE
-extern int huge_ptep_set_access_flags(struct vm_area_struct *vma,
+int huge_ptep_set_access_flags(struct vm_area_struct *vma,
unsigned long addr, pte_t *ptep,
pte_t pte, int dirty)
{
--
2.19.0
^ permalink raw reply related
* Re: [PATCH] powerpc: Fix stack protector crashes on CPU hotplug
From: Abdul Haleem @ 2018-10-22 13:40 UTC (permalink / raw)
To: Michael Ellerman; +Cc: linuxppc-dev, joel
In-Reply-To: <20181019055927.20009-1-mpe@ellerman.id.au>
On Fri, 2018-10-19 at 16:59 +1100, Michael Ellerman wrote:
> Recently in commit 7241d26e8175 ("powerpc/64: properly initialise
> the stackprotector canary on SMP.") we fixed a crash with stack
> protector on SMP by initialising the stack canary in
> cpu_idle_thread_init().
>
> But this can also causes crashes, when a CPU comes back online after
> being offline:
>
> Kernel panic - not syncing: stack-protector: Kernel stack is corrupted in: pnv_smp_cpu_kill_self+0x2a0/0x2b0
> CPU: 1 PID: 0 Comm: swapper/1 Not tainted 4.19.0-rc3-gcc-7.3.1-00168-g4ffe713b7587 #94
> Call Trace:
> dump_stack+0xb0/0xf4 (unreliable)
> panic+0x144/0x328
> __stack_chk_fail+0x2c/0x30
> pnv_smp_cpu_kill_self+0x2a0/0x2b0
> cpu_die+0x48/0x70
> arch_cpu_idle_dead+0x20/0x40
> do_idle+0x274/0x390
> cpu_startup_entry+0x38/0x50
> start_secondary+0x5e4/0x600
> start_secondary_prolog+0x10/0x14
>
> Looking at the stack we see that the canary value in the stack frame
> doesn't match the canary in the task/paca. That is because we have
> reinitialised the task/paca value, but then the CPU coming online has
> returned into a function using the old canary value. That causes the
> comparison to fail.
>
> Instead we can call boot_init_stack_canary() from start_secondary()
> which never returns. This is essentially what the generic code does in
> cpu_startup_entry() under #ifdef X86, we should make that non-x86
> specific in a future patch.
>
> Fixes: 7241d26e8175 ("powerpc/64: properly initialise the stackprotector canary on SMP.")
> Reported-by: Joel Stanley <joel@jms.id.au>
> Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
> ---
> arch/powerpc/kernel/smp.c | 10 +++-------
> 1 file changed, 3 insertions(+), 7 deletions(-)
>
> diff --git a/arch/powerpc/kernel/smp.c b/arch/powerpc/kernel/smp.c
> index 8e3a5da24d59..951c476faffc 100644
> --- a/arch/powerpc/kernel/smp.c
> +++ b/arch/powerpc/kernel/smp.c
> @@ -61,6 +61,7 @@
> #include <asm/asm-prototypes.h>
> #include <asm/cpu_has_feature.h>
> #include <asm/ftrace.h>
> +#include <asm/stackprotector.h>
>
> #ifdef DEBUG
> #include <asm/udbg.h>
> @@ -1014,16 +1015,9 @@ static void cpu_idle_thread_init(unsigned int cpu, struct task_struct *idle)
> {
> struct thread_info *ti = task_thread_info(idle);
>
> -#ifdef CONFIG_STACKPROTECTOR
> - idle->stack_canary = get_random_canary();
> -#endif
> -
> #ifdef CONFIG_PPC64
> paca_ptrs[cpu]->__current = idle;
> paca_ptrs[cpu]->kstack = (unsigned long)ti + THREAD_SIZE - STACK_FRAME_OVERHEAD;
> -#ifdef CONFIG_STACKPROTECTOR
> - paca_ptrs[cpu]->canary = idle->stack_canary;
> -#endif
> #endif
> ti->cpu = cpu;
> secondary_ti = current_set[cpu] = ti;
> @@ -1316,6 +1310,8 @@ void start_secondary(void *unused)
> notify_cpu_starting(cpu);
> set_cpu_online(cpu, true);
>
> + boot_init_stack_canary();
> +
> local_irq_enable();
>
> /* We can enable ftrace for secondary cpus now */
Tested-by: Abdul Haleem <abdhalee@linux.vnet.ibm.com>
--
Regard's
Abdul Haleem
IBM Linux Technology Centre
^ permalink raw reply
* [PATCH] selftests: powerpc: Fix warning for security subdir
From: Joel Stanley @ 2018-10-22 12:09 UTC (permalink / raw)
To: linuxppc-dev
typing 'make' inside tools/testing/selftests/powerpc gave a build
warning:
BUILD_TARGET=tools/testing/selftests/powerpc/security; mkdir -p $BUILD_TARGET; make OUTPUT=$BUILD_TARGET -k -C security all
make[1]: Entering directory 'tools/testing/selftests/powerpc/security'
../../lib.mk:20: ../../../../scripts/subarch.include: No such file or directory
make[1]: *** No rule to make target '../../../../scripts/subarch.include'.
make[1]: Failed to remake makefile '../../../../scripts/subarch.include'.
The build is one level deeper than lib.mk thinks it is. Set top_srcdir
to set things straight.
Note that the test program is still built.
Signed-off-by: Joel Stanley <joel@jms.id.au>
---
tools/testing/selftests/powerpc/security/Makefile | 1 +
1 file changed, 1 insertion(+)
diff --git a/tools/testing/selftests/powerpc/security/Makefile b/tools/testing/selftests/powerpc/security/Makefile
index 44690f1bb26a..85861c46b445 100644
--- a/tools/testing/selftests/powerpc/security/Makefile
+++ b/tools/testing/selftests/powerpc/security/Makefile
@@ -1,6 +1,7 @@
# SPDX-License-Identifier: GPL-2.0+
TEST_GEN_PROGS := rfi_flush
+top_srcdir = ../../../../..
CFLAGS += -I../../../../../usr/include
--
2.19.1
^ permalink raw reply related
* Re: [PATCH] powerpc/pseries: Export maximum memory value
From: Aravinda Prasad @ 2018-10-22 10:17 UTC (permalink / raw)
To: Nathan Fontenot, mpe, linuxppc-dev; +Cc: naveen.n.rao
In-Reply-To: <0c429575-93e1-0ca9-9c75-29dec1e4105c@linux.vnet.ibm.com>
On Wednesday 10 October 2018 09:50 PM, Nathan Fontenot wrote:
> On 10/10/2018 05:22 AM, Aravinda Prasad wrote:
>> This patch exports the maximum possible amount of memory
>> configured on the system via /proc/powerpc/lparcfg.
>>
>> Signed-off-by: Aravinda Prasad <aravinda@linux.vnet.ibm.com>
>> ---
>> arch/powerpc/platforms/pseries/lparcfg.c | 13 +++++++++++++
>> 1 file changed, 13 insertions(+)
>>
>> diff --git a/arch/powerpc/platforms/pseries/lparcfg.c b/arch/powerpc/platforms/pseries/lparcfg.c
>> index 7c872dc..aa82f55 100644
>> --- a/arch/powerpc/platforms/pseries/lparcfg.c
>> +++ b/arch/powerpc/platforms/pseries/lparcfg.c
>> @@ -26,6 +26,7 @@
>> #include <linux/seq_file.h>
>> #include <linux/slab.h>
>> #include <linux/uaccess.h>
>> +#include <linux/hugetlb.h>
>> #include <asm/lppaca.h>
>> #include <asm/hvcall.h>
>> #include <asm/firmware.h>
>> @@ -36,6 +37,7 @@
>> #include <asm/vio.h>
>> #include <asm/mmu.h>
>> #include <asm/machdep.h>
>> +#include <asm/drmem.h>
>>
>> #include "pseries.h"
>>
>> @@ -433,6 +435,16 @@ static void parse_em_data(struct seq_file *m)
>> seq_printf(m, "power_mode_data=%016lx\n", retbuf[0]);
>> }
>>
>> +static void maxmem_data(struct seq_file *m)
>> +{
>> + unsigned long maxmem = 0;
>> +
>> + maxmem += drmem_info->n_lmbs * drmem_info->lmb_size;
>> + maxmem += hugetlb_total_pages() * PAGE_SIZE;
>> +
>> + seq_printf(m, "MaxMem=%ld\n", maxmem);
>
> Should this be MaxPossibleMem?
>
> At least for the drmem memory the value calculated is the maximum possible
> memory. I wonder if calling it MaxMem would lead users to think they have
> that much memory available to them.
Nathan,
I feel MaxMem makes more sense because, we use "Minimum memory",
"Desired memory" and "Maximum memory" in the LPAR profile configuration
and MaxMem is in fact displaying the value of this "Maximum memory"
profile value.
So I want to keep it as "MaxMem". Let me know if you think otherwise.
Regards,
Aravinda
>
> -Nathan
>
>> +}
>> +
>> static int pseries_lparcfg_data(struct seq_file *m, void *v)
>> {
>> int partition_potential_processors;
>> @@ -491,6 +503,7 @@ static int pseries_lparcfg_data(struct seq_file *m, void *v)
>> seq_printf(m, "slb_size=%d\n", mmu_slb_size);
>> #endif
>> parse_em_data(m);
>> + maxmem_data(m);
>>
>> return 0;
>> }
>>
--
Regards,
Aravinda
^ permalink raw reply
* Re: powerpc/msi: Fix compile error on mpc83xx
From: Michael Ellerman @ 2018-10-22 9:40 UTC (permalink / raw)
To: Christophe Leroy, Benjamin Herrenschmidt, Paul Mackerras,
radu.rendec
Cc: linuxppc-dev, linux-kernel
In-Reply-To: <c0cec03a57070ef3662ae7e2ddffbdeefb128b81.1539891327.git.christophe.leroy@c-s.fr>
On Fri, 2018-10-19 at 06:12:50 UTC, Christophe Leroy wrote:
> mpic_get_primary_version() is not defined when not using MPIC.
> The compile error log like:
>
> arch/powerpc/sysdev/built-in.o: In function `fsl_of_msi_probe':
> fsl_msi.c:(.text+0x150c): undefined reference to `fsl_mpic_primary_get_version'
>
> Signed-off-by: Jia Hongtao <hongtao.jia@freescale.com>
> Signed-off-by: Scott Wood <scottwood@freescale.com>
> Reported-by: Radu Rendec <radu.rendec@gmail.com>
> Fixes: 807d38b73b6 ("powerpc/mpic: Add get_version API both for internal and external use")
> Cc: stable@vger.kernel.org
> Signed-off-by: Christophe Leroy <christophe.leroy@c-s.fr>
Applied to powerpc next, thanks.
https://git.kernel.org/powerpc/c/0f99153def98134403c9149128e59d
cheers
^ permalink raw reply
* Re: powerpc: Fix stack protector crashes on CPU hotplug
From: Michael Ellerman @ 2018-10-22 9:40 UTC (permalink / raw)
To: Michael Ellerman, linuxppc-dev; +Cc: abdhalee, joel
In-Reply-To: <20181019055927.20009-1-mpe@ellerman.id.au>
On Fri, 2018-10-19 at 05:59:27 UTC, Michael Ellerman wrote:
> Recently in commit 7241d26e8175 ("powerpc/64: properly initialise
> the stackprotector canary on SMP.") we fixed a crash with stack
> protector on SMP by initialising the stack canary in
> cpu_idle_thread_init().
>
> But this can also causes crashes, when a CPU comes back online after
> being offline:
>
> Kernel panic - not syncing: stack-protector: Kernel stack is corrupted in: pnv_smp_cpu_kill_self+0x2a0/0x2b0
> CPU: 1 PID: 0 Comm: swapper/1 Not tainted 4.19.0-rc3-gcc-7.3.1-00168-g4ffe713b7587 #94
> Call Trace:
> dump_stack+0xb0/0xf4 (unreliable)
> panic+0x144/0x328
> __stack_chk_fail+0x2c/0x30
> pnv_smp_cpu_kill_self+0x2a0/0x2b0
> cpu_die+0x48/0x70
> arch_cpu_idle_dead+0x20/0x40
> do_idle+0x274/0x390
> cpu_startup_entry+0x38/0x50
> start_secondary+0x5e4/0x600
> start_secondary_prolog+0x10/0x14
>
> Looking at the stack we see that the canary value in the stack frame
> doesn't match the canary in the task/paca. That is because we have
> reinitialised the task/paca value, but then the CPU coming online has
> returned into a function using the old canary value. That causes the
> comparison to fail.
>
> Instead we can call boot_init_stack_canary() from start_secondary()
> which never returns. This is essentially what the generic code does in
> cpu_startup_entry() under #ifdef X86, we should make that non-x86
> specific in a future patch.
>
> Fixes: 7241d26e8175 ("powerpc/64: properly initialise the stackprotector canary on SMP.")
> Reported-by: Joel Stanley <joel@jms.id.au>
> Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
> Reviewed-by: Christophe Leroy <christophe.leroy@c-s.fr>
Applied to powerpc next.
https://git.kernel.org/powerpc/c/b6aeddea74b08518289fc86545297c
cheers
^ permalink raw reply
* Re: powerpc/time: Fix clockevent_decrementer initalisation for PR KVM
From: Michael Ellerman @ 2018-10-22 9:40 UTC (permalink / raw)
To: Michael Ellerman, linuxppc-dev; +Cc: paulus, anton, kvm-ppc
In-Reply-To: <20181019042319.9457-1-mpe@ellerman.id.au>
On Fri, 2018-10-19 at 04:23:19 UTC, Michael Ellerman wrote:
> In the recent commit 8b78fdb045de ("powerpc/time: Use
> clockevents_register_device(), fixing an issue with large
> decrementer") we changed the way we initialise the decrementer
> clockevent(s).
>
> We no longer initialise the mult & shift values of
> decrementer_clockevent itself.
>
> This has the effect of breaking PR KVM, because it uses those values
> in kvmppc_emulate_dec(). The symptom is guest kernels spin forever
> mid-way through boot.
>
> For now fix it by assigning back to decrementer_clockevent the mult
> and shift values.
>
> Fixes: 8b78fdb045de ("powerpc/time: Use clockevents_register_device(), fixing an issue with large decrementer")
> Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
> Acked-by: Anton Blanchard <anton@samba.org>
Applied to powerpc next.
https://git.kernel.org/powerpc/c/b4d16ab58c41ff0125822464bdff07
cheers
^ permalink raw reply
* Re: [1/6] powerpc/mm/radix: Fix off-by-one in split mapping logic
From: Michael Ellerman @ 2018-10-22 9:39 UTC (permalink / raw)
To: Michael Ellerman, linuxppc-dev; +Cc: aneesh.kumar
In-Reply-To: <20181019041334.4945-1-mpe@ellerman.id.au>
On Fri, 2018-10-19 at 04:13:29 UTC, Michael Ellerman wrote:
> When we have CONFIG_STRICT_KERNEL_RWX enabled, we try to split the
> kernel linear (1:1) mapping so that the kernel text is in a separate
> page to kernel data, so we can mark the former read-only.
>
> We could achieve that just by always using 64K pages for the linear
> mapping, but we try to be smarter. Instead we use huge pages when
> possible, and only switch to smaller pages when necessary.
>
> However we have an off-by-one bug in that logic, which causes us to
> calculate the wrong boundary between text and data.
>
> For example with the end of the kernel text at 16M we see:
>
> radix-mmu: Mapped 0x0000000000000000-0x0000000001200000 with 64.0 KiB pages
> radix-mmu: Mapped 0x0000000001200000-0x0000000040000000 with 2.00 MiB pages
> radix-mmu: Mapped 0x0000000040000000-0x0000000100000000 with 1.00 GiB pages
>
> ie. we mapped from 0 to 18M with 64K pages, even though the boundary
> between text and data is at 16M.
>
> With the fix we see we're correctly hitting the 16M boundary:
>
> radix-mmu: Mapped 0x0000000000000000-0x0000000001000000 with 64.0 KiB pages
> radix-mmu: Mapped 0x0000000001000000-0x0000000040000000 with 2.00 MiB pages
> radix-mmu: Mapped 0x0000000040000000-0x0000000100000000 with 1.00 GiB pages
>
> Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Series applied to powerpc next.
https://git.kernel.org/powerpc/c/5c6499b7041b43807dfaeda28aa87f
cheers
^ permalink raw reply
* Re: powerpc/mm: Fix page table dump to work on Radix
From: Michael Ellerman @ 2018-10-22 9:39 UTC (permalink / raw)
To: Michael Ellerman, linuxppc-dev; +Cc: aneesh.kumar
In-Reply-To: <20181019041250.3831-1-mpe@ellerman.id.au>
On Fri, 2018-10-19 at 04:12:50 UTC, Michael Ellerman wrote:
> When we're running on Book3S with the Radix MMU enabled the page table
> dump currently prints the wrong addresses because it uses the wrong
> start address.
>
> Fix it to use PAGE_OFFSET rather than KERN_VIRT_START.
>
> Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Applied to powerpc next.
https://git.kernel.org/powerpc/c/0d923962ab69c27cca664a2d535e90
cheers
^ permalink raw reply
* Re: selftests/powerpc: Fix out-of-tree build errors
From: Michael Ellerman @ 2018-10-22 9:39 UTC (permalink / raw)
To: Michael Ellerman, linuxppc-dev
In-Reply-To: <20181019040616.345-1-mpe@ellerman.id.au>
On Fri, 2018-10-19 at 04:06:16 UTC, Michael Ellerman wrote:
> Some of our Makefiles don't do the right thing when building the
> selftests with O=, fix them up.
>
> Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Applied to powerpc next.
https://git.kernel.org/powerpc/c/d8a2fe29d3c97038c8efcc328d5e79
cheers
^ permalink raw reply
page: next (older) | prev (newer) | latest
- recent:[subjects (threaded)|topics (new)|topics (active)]
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox