Home Home > GIT Browse > SLE12-SP4
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichal Suchanek <msuchanek@suse.de>2018-11-28 17:34:09 +0100
committerMichal Suchanek <msuchanek@suse.de>2019-10-17 15:33:06 +0200
commit03c07e13e32958565a94041defa9aeab4074100e (patch)
tree9ec4e13ce1a687e236eb2876b2d8264cea8d4993
parent91897e8899426da99df2bfbef5248e8aa1a21961 (diff)
powerpc/pseries: Export raw per-CPU VPA data via debugfs
-rw-r--r--patches.suse/powerpc-pseries-Export-raw-per-CPU-VPA-data-via-debu.patch97
-rw-r--r--series.conf1
2 files changed, 98 insertions, 0 deletions
diff --git a/patches.suse/powerpc-pseries-Export-raw-per-CPU-VPA-data-via-debu.patch b/patches.suse/powerpc-pseries-Export-raw-per-CPU-VPA-data-via-debu.patch
new file mode 100644
index 0000000000..68104f95ee
--- /dev/null
+++ b/patches.suse/powerpc-pseries-Export-raw-per-CPU-VPA-data-via-debu.patch
@@ -0,0 +1,97 @@
+From c6c26fb55e8e4b3fc376be5611685990a17de27a Mon Sep 17 00:00:00 2001
+From: Aravinda Prasad <aravinda@linux.vnet.ibm.com>
+Date: Tue, 16 Oct 2018 17:20:05 +0530
+Subject: [PATCH] powerpc/pseries: Export raw per-CPU VPA data via debugfs
+
+References: FATE#326394
+Patch-mainline: v4.20-rc1
+Git-commit: c6c26fb55e8e4b3fc376be5611685990a17de27a
+
+This patch exports the raw per-CPU VPA data via debugfs.
+A per-CPU file is created which exports the VPA data of
+that CPU to help debug some of the VPA related issues or
+to analyze the per-CPU VPA related statistics.
+
+v3: Removed offline CPU check.
+
+v2: Included offline CPU check and other review comments.
+
+Signed-off-by: Aravinda Prasad <aravinda@linux.vnet.ibm.com>
+Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
+Acked-by: Michal Suchanek <msuchanek@suse.de>
+---
+ arch/powerpc/platforms/pseries/lpar.c | 54 +++++++++++++++++++++++++++++++++++
+ 1 file changed, 54 insertions(+)
+
+diff --git a/arch/powerpc/platforms/pseries/lpar.c b/arch/powerpc/platforms/pseries/lpar.c
+index 0b5081085a44..32d4452973e7 100644
+--- a/arch/powerpc/platforms/pseries/lpar.c
++++ b/arch/powerpc/platforms/pseries/lpar.c
+@@ -48,6 +48,7 @@
+ #include <asm/kexec.h>
+ #include <asm/fadump.h>
+ #include <asm/asm-prototypes.h>
++#include <asm/debugfs.h>
+
+ #include "pseries.h"
+
+@@ -1239,3 +1240,56 @@ static int __init reserve_vrma_context_id(void)
+ return 0;
+ }
+ machine_device_initcall(pseries, reserve_vrma_context_id);
++
++#ifdef CONFIG_DEBUG_FS
++/* debugfs file interface for vpa data */
++static ssize_t vpa_file_read(struct file *filp, char __user *buf, size_t len,
++ loff_t *pos)
++{
++ int cpu = (long)filp->private_data;
++ struct lppaca *lppaca = &lppaca_of(cpu);
++
++ return simple_read_from_buffer(buf, len, pos, lppaca,
++ sizeof(struct lppaca));
++}
++
++static const struct file_operations vpa_fops = {
++ .open = simple_open,
++ .read = vpa_file_read,
++ .llseek = default_llseek,
++};
++
++static int __init vpa_debugfs_init(void)
++{
++ char name[16];
++ long i;
++ static struct dentry *vpa_dir;
++
++ if (!firmware_has_feature(FW_FEATURE_SPLPAR))
++ return 0;
++
++ vpa_dir = debugfs_create_dir("vpa", powerpc_debugfs_root);
++ if (!vpa_dir) {
++ pr_warn("%s: can't create vpa root dir\n", __func__);
++ return -ENOMEM;
++ }
++
++ /* set up the per-cpu vpa file*/
++ for_each_possible_cpu(i) {
++ struct dentry *d;
++
++ sprintf(name, "cpu-%ld", i);
++
++ d = debugfs_create_file(name, 0400, vpa_dir, (void *)i,
++ &vpa_fops);
++ if (!d) {
++ pr_warn("%s: can't create per-cpu vpa file\n",
++ __func__);
++ return -ENOMEM;
++ }
++ }
++
++ return 0;
++}
++machine_arch_initcall(pseries, vpa_debugfs_init);
++#endif /* CONFIG_DEBUG_FS */
+--
+2.13.7
+
diff --git a/series.conf b/series.conf
index f67c4b4db4..8c98f5b91f 100644
--- a/series.conf
+++ b/series.conf
@@ -20619,6 +20619,7 @@
patches.suse/powerpc-Use-cpu_smallcore_sibling_mask-at-SMT-level-.patch
patches.suse/powerpc-cacheinfo-Report-the-correct-shared_cpu_map-.patch
patches.suse/powerpc-rtas-Fix-a-potential-race-between-CPU-Offlin.patch
+ patches.suse/powerpc-pseries-Export-raw-per-CPU-VPA-data-via-debu.patch
patches.suse/powerpc-mm-Add-missing-tracepoint-for-tlbie.patch
patches.suse/powerpc-mm-radix-Display-if-mappings-are-exec-or-not.patch
patches.suse/powerpc-mm-Fix-page-table-dump-to-work-on-Radix.patch