mirror of
https://github.com/torvalds/linux
synced 2024-10-15 15:59:15 +00:00
powerpc/xive: Fix compile when !CONFIG_PPC_POWERNV.
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.
Fixes: 1e7684dc4f
("powerpc/xive: Add a debugfs toggle for save-restore")
Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: Cédric Le Goater <clg@kaod.org>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/20211201165418.1041842-1-clg@kaod.org
This commit is contained in:
parent
62ea67e319
commit
2a2ac8a701
|
@ -1847,7 +1847,9 @@ static void xive_core_debugfs_create(void)
|
||||||
&xive_eq_debug_fops);
|
&xive_eq_debug_fops);
|
||||||
}
|
}
|
||||||
debugfs_create_bool("store-eoi", 0600, xive_dir, &xive_store_eoi);
|
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
|
#else
|
||||||
static inline void xive_core_debugfs_create(void) { }
|
static inline void xive_core_debugfs_create(void) { }
|
||||||
|
|
|
@ -461,6 +461,14 @@ void xive_native_sync_queue(u32 hw_irq)
|
||||||
}
|
}
|
||||||
EXPORT_SYMBOL_GPL(xive_native_sync_queue);
|
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 = {
|
static const struct xive_ops xive_native_ops = {
|
||||||
.populate_irq_data = xive_native_populate_irq_data,
|
.populate_irq_data = xive_native_populate_irq_data,
|
||||||
.configure_irq = xive_native_configure_irq,
|
.configure_irq = xive_native_configure_irq,
|
||||||
|
@ -478,6 +486,9 @@ static const struct xive_ops xive_native_ops = {
|
||||||
.get_ipi = xive_native_get_ipi,
|
.get_ipi = xive_native_get_ipi,
|
||||||
.put_ipi = xive_native_put_ipi,
|
.put_ipi = xive_native_put_ipi,
|
||||||
#endif /* CONFIG_SMP */
|
#endif /* CONFIG_SMP */
|
||||||
|
#ifdef CONFIG_DEBUG_FS
|
||||||
|
.debug_create = xive_native_debug_create,
|
||||||
|
#endif /* CONFIG_DEBUG_FS */
|
||||||
.name = "native",
|
.name = "native",
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -58,6 +58,7 @@ struct xive_ops {
|
||||||
void (*put_ipi)(unsigned int cpu, struct xive_cpu *xc);
|
void (*put_ipi)(unsigned int cpu, struct xive_cpu *xc);
|
||||||
#endif
|
#endif
|
||||||
int (*debug_show)(struct seq_file *m, void *private);
|
int (*debug_show)(struct seq_file *m, void *private);
|
||||||
|
int (*debug_create)(struct dentry *xive_dir);
|
||||||
const char *name;
|
const char *name;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue