* [PATCH] powerpc/xive: Fix compile when !CONFIG_PPC_POWERNV.
@ 2021-12-01 16:54 Cédric Le Goater
2021-12-07 13:27 ` Michael Ellerman
0 siblings, 1 reply; 2+ messages in thread
From: Cédric Le Goater @ 2021-12-01 16:54 UTC (permalink / raw)
To: linuxppc-dev; +Cc: Cédric Le Goater, kernel test robot
The automatic "save & restore" of interrupt context is a POWER10/XIVE2
feature exploited by KVM under the PowerNV platform. It is not
available under pSeries and the associated toggle should not be
exposed under the XIVE debugfs directory.
Introduce a platform handler for debugfs initialization and move the
'save-restore' entry under the native (PowerNV) backend to fix compile
when !CONFIG_PPC_POWERNV.
Reported-by: kernel test robot <lkp@intel.com>
Fixes: 1e7684dc4fc7 ("powerpc/xive: Add a debugfs toggle for save-restore")
Signed-off-by: Cédric Le Goater <clg@kaod.org>
---
arch/powerpc/sysdev/xive/xive-internal.h | 1 +
arch/powerpc/sysdev/xive/common.c | 4 +++-
arch/powerpc/sysdev/xive/native.c | 11 +++++++++++
3 files changed, 15 insertions(+), 1 deletion(-)
diff --git a/arch/powerpc/sysdev/xive/xive-internal.h b/arch/powerpc/sysdev/xive/xive-internal.h
index e0941bc64430..fe6d95d54af9 100644
--- a/arch/powerpc/sysdev/xive/xive-internal.h
+++ b/arch/powerpc/sysdev/xive/xive-internal.h
@@ -58,6 +58,7 @@ struct xive_ops {
void (*put_ipi)(unsigned int cpu, struct xive_cpu *xc);
#endif
int (*debug_show)(struct seq_file *m, void *private);
+ int (*debug_create)(struct dentry *xive_dir);
const char *name;
};
diff --git a/arch/powerpc/sysdev/xive/common.c b/arch/powerpc/sysdev/xive/common.c
index 43f7f7df6407..1ca5564bda9d 100644
--- a/arch/powerpc/sysdev/xive/common.c
+++ b/arch/powerpc/sysdev/xive/common.c
@@ -1847,7 +1847,9 @@ static void xive_core_debugfs_create(void)
&xive_eq_debug_fops);
}
debugfs_create_bool("store-eoi", 0600, xive_dir, &xive_store_eoi);
- debugfs_create_bool("save-restore", 0600, xive_dir, &xive_has_save_restore);
+
+ if (xive_ops->debug_create)
+ xive_ops->debug_create(xive_dir);
}
#else
static inline void xive_core_debugfs_create(void) { }
diff --git a/arch/powerpc/sysdev/xive/native.c b/arch/powerpc/sysdev/xive/native.c
index d6a091dc1bce..d4243dab230e 100644
--- a/arch/powerpc/sysdev/xive/native.c
+++ b/arch/powerpc/sysdev/xive/native.c
@@ -461,6 +461,14 @@ void xive_native_sync_queue(u32 hw_irq)
}
EXPORT_SYMBOL_GPL(xive_native_sync_queue);
+#ifdef CONFIG_DEBUG_FS
+static int xive_native_debug_create(struct dentry *xive_dir)
+{
+ debugfs_create_bool("save-restore", 0600, xive_dir, &xive_has_save_restore);
+ return 0;
+}
+#endif
+
static const struct xive_ops xive_native_ops = {
.populate_irq_data = xive_native_populate_irq_data,
.configure_irq = xive_native_configure_irq,
@@ -478,6 +486,9 @@ static const struct xive_ops xive_native_ops = {
.get_ipi = xive_native_get_ipi,
.put_ipi = xive_native_put_ipi,
#endif /* CONFIG_SMP */
+#ifdef CONFIG_DEBUG_FS
+ .debug_create = xive_native_debug_create,
+#endif /* CONFIG_DEBUG_FS */
.name = "native",
};
--
2.31.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] powerpc/xive: Fix compile when !CONFIG_PPC_POWERNV.
2021-12-01 16:54 [PATCH] powerpc/xive: Fix compile when !CONFIG_PPC_POWERNV Cédric Le Goater
@ 2021-12-07 13:27 ` Michael Ellerman
0 siblings, 0 replies; 2+ messages in thread
From: Michael Ellerman @ 2021-12-07 13:27 UTC (permalink / raw)
To: Cédric Le Goater, linuxppc-dev; +Cc: kernel test robot
On Wed, 1 Dec 2021 17:54:18 +0100, Cédric Le Goater wrote:
> The automatic "save & restore" of interrupt context is a POWER10/XIVE2
> feature exploited by KVM under the PowerNV platform. It is not
> available under pSeries and the associated toggle should not be
> exposed under the XIVE debugfs directory.
>
> Introduce a platform handler for debugfs initialization and move the
> 'save-restore' entry under the native (PowerNV) backend to fix compile
> when !CONFIG_PPC_POWERNV.
>
> [...]
Applied to powerpc/next.
[1/1] powerpc/xive: Fix compile when !CONFIG_PPC_POWERNV.
https://git.kernel.org/powerpc/c/2a2ac8a7018b953cd23d770ebd28f8e1ea365df4
cheers
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2021-12-07 13:31 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-12-01 16:54 [PATCH] powerpc/xive: Fix compile when !CONFIG_PPC_POWERNV Cédric Le Goater
2021-12-07 13:27 ` Michael Ellerman
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.