* [PATCH] cxl: Fix timebase synchronization status on P9
From: Christophe Lombard @ 2018-02-15 16:32 UTC (permalink / raw)
To: linuxppc-dev, fbarrat, vaibhav, andrew.donnellan
The PSL Timebase register is updated by the PSL to maintain the
timebase.
On P9, the Timebase value is only provided by the CAPP as received
the last time a timebase request was performed.
The timebase requests are initiated through the adapter configuration or
application registers.
The specific sysfs entry "/sys/class/cxl/cardxx/psl_timebase_synced" is
now dynamically updated according the content of the PSL Timebase
register.
---
drivers/misc/cxl/pci.c | 35 +++++++++++++++++++----------------
drivers/misc/cxl/sysfs.c | 14 ++++++++++++++
2 files changed, 33 insertions(+), 16 deletions(-)
diff --git a/drivers/misc/cxl/pci.c b/drivers/misc/cxl/pci.c
index 758842f..270afb5 100644
--- a/drivers/misc/cxl/pci.c
+++ b/drivers/misc/cxl/pci.c
@@ -612,8 +612,6 @@ static u64 timebase_read_xsl(struct cxl *adapter)
static void cxl_setup_psl_timebase(struct cxl *adapter, struct pci_dev *dev)
{
- u64 psl_tb;
- int delta;
unsigned int retry = 0;
struct device_node *np;
@@ -641,20 +639,25 @@ static void cxl_setup_psl_timebase(struct cxl *adapter, struct pci_dev *dev)
cxl_p1_write(adapter, CXL_PSL_Control, 0x0000000000000000);
cxl_p1_write(adapter, CXL_PSL_Control, CXL_PSL_Control_tb);
- /* Wait until CORE TB and PSL TB difference <= 16usecs */
- do {
- msleep(1);
- if (retry++ > 5) {
- dev_info(&dev->dev, "PSL timebase can't synchronize\n");
- return;
- }
- psl_tb = adapter->native->sl_ops->timebase_read(adapter);
- delta = mftb() - psl_tb;
- if (delta < 0)
- delta = -delta;
- } while (tb_to_ns(delta) > 16000);
-
- adapter->psl_timebase_synced = true;
+ if (cxl_is_power8()) {
+ u64 psl_tb;
+ int delta;
+
+ /* Wait until CORE TB and PSL TB difference <= 16usecs */
+ do {
+ msleep(1);
+ if (retry++ > 5) {
+ dev_info(&dev->dev, "PSL timebase can't synchronize\n");
+ return;
+ }
+ psl_tb = adapter->native->sl_ops->timebase_read(adapter);
+ delta = mftb() - psl_tb;
+ if (delta < 0)
+ delta = -delta;
+ } while (tb_to_ns(delta) > 16000);
+
+ adapter->psl_timebase_synced = true;
+ }
return;
}
diff --git a/drivers/misc/cxl/sysfs.c b/drivers/misc/cxl/sysfs.c
index a8b6d6a..f3bfc5a 100644
--- a/drivers/misc/cxl/sysfs.c
+++ b/drivers/misc/cxl/sysfs.c
@@ -63,6 +63,20 @@ static ssize_t psl_timebase_synced_show(struct device *device,
{
struct cxl *adapter = to_cxl_adapter(device);
+ /*
+ * On P9, the Timebase value is only updated as a result of
+ * PSL TimeBase command sent to CAPP.
+ */
+ if (cxl_is_power9()) {
+ u64 psl_tb;
+ int delta;
+
+ psl_tb = cxl_p1_read(adapter, CXL_PSL9_Timebase);
+ delta = mftb() - psl_tb;
+ if (delta < 0)
+ delta = -delta;
+ adapter->psl_timebase_synced = true ? tb_to_ns(delta) < 16000: false;
+ }
return scnprintf(buf, PAGE_SIZE, "%i\n", adapter->psl_timebase_synced);
}
--
2.7.4
^ permalink raw reply related
* [PATCH v2] cxl: Check if PSL data-cache is available before issue flush request
From: Vaibhav Jain @ 2018-02-15 15:49 UTC (permalink / raw)
To: linuxppc-dev, Frederic Barrat
Cc: Vaibhav Jain, Andrew Donnellan, Christophe Lombard,
Philippe Bergheaud, Alastair D'Silva
PSL9D doesn't have a data-cache that needs to be flushed before
resetting the card. However when cxl tries to flush data-cache on such
a card, it times-out as PSL_Control register never indicates flush
operation complete due to missing data-cache. This is usually
indicated in the kernel logs with this message:
"WARNING: cache flush timed out"
To fix this the patch checks PSL_Debug register CDC-Field(BIT:27)
which indicates the absence of a data-cache and sets a flag
'no_data_cache' in 'struct cxl_native' to indicate this. When
cxl_data_cache_flush() is called it checks the flag and if set bails
out early without requesting a data-cache flush operation to the PSL.
Signed-off-by: Vaibhav Jain <vaibhav@linux.vnet.ibm.com>
---
Change-log:
v2 -> Changed the dev_info to dev_dbg (Fred)
Removed the check for DD1.0 chips (Fred)
---
drivers/misc/cxl/cxl.h | 4 ++++
drivers/misc/cxl/native.c | 11 ++++++++++-
drivers/misc/cxl/pci.c | 18 ++++++++++++------
3 files changed, 26 insertions(+), 7 deletions(-)
diff --git a/drivers/misc/cxl/cxl.h b/drivers/misc/cxl/cxl.h
index 4f015da78f28..4949b8d5a748 100644
--- a/drivers/misc/cxl/cxl.h
+++ b/drivers/misc/cxl/cxl.h
@@ -369,6 +369,9 @@ static const cxl_p2n_reg_t CXL_PSL_WED_An = {0x0A0};
#define CXL_PSL_TFC_An_AE (1ull << (63-30)) /* Restart PSL with address error */
#define CXL_PSL_TFC_An_R (1ull << (63-31)) /* Restart PSL transaction */
+/****** CXL_PSL_DEBUG *****************************************************/
+#define CXL_PSL_DEBUG_CDC (1ull << (63-27)) /* Coherent Data cache support */
+
/****** CXL_XSL9_IERAT_ERAT - CAIA 2 **********************************/
#define CXL_XSL9_IERAT_MLPID (1ull << (63-0)) /* Match LPID */
#define CXL_XSL9_IERAT_MPID (1ull << (63-1)) /* Match PID */
@@ -669,6 +672,7 @@ struct cxl_native {
irq_hw_number_t err_hwirq;
unsigned int err_virq;
u64 ps_off;
+ bool no_data_cache; /* set if no data cache on the card */
const struct cxl_service_layer_ops *sl_ops;
};
diff --git a/drivers/misc/cxl/native.c b/drivers/misc/cxl/native.c
index 1b3d7c65ea3f..98f867fcef24 100644
--- a/drivers/misc/cxl/native.c
+++ b/drivers/misc/cxl/native.c
@@ -353,8 +353,17 @@ int cxl_data_cache_flush(struct cxl *adapter)
u64 reg;
unsigned long timeout = jiffies + (HZ * CXL_TIMEOUT);
- pr_devel("Flushing data cache\n");
+ /*
+ * Do a datacache flush only if datacache is available.
+ * In case of PSL9D datacache absent hence flush operation.
+ * would timeout.
+ */
+ if (adapter->native->no_data_cache) {
+ pr_devel("No PSL data cache. Ignoring cache flush req.\n");
+ return 0;
+ }
+ pr_devel("Flushing data cache\n");
reg = cxl_p1_read(adapter, CXL_PSL_Control);
reg |= CXL_PSL_Control_Fr;
cxl_p1_write(adapter, CXL_PSL_Control, reg);
diff --git a/drivers/misc/cxl/pci.c b/drivers/misc/cxl/pci.c
index 758842f65a1b..3255f89c85d0 100644
--- a/drivers/misc/cxl/pci.c
+++ b/drivers/misc/cxl/pci.c
@@ -456,6 +456,7 @@ static int init_implementation_adapter_regs_psl9(struct cxl *adapter,
u64 chipid;
u32 phb_index;
u64 capp_unit_id;
+ u64 psl_debug;
int rc;
rc = cxl_calc_capp_routing(dev, &chipid, &phb_index, &capp_unit_id);
@@ -506,6 +507,15 @@ static int init_implementation_adapter_regs_psl9(struct cxl *adapter,
} else
cxl_p1_write(adapter, CXL_PSL9_DEBUG, 0x4000000000000000ULL);
+ /* Check if PSL has data-cache. We need to flush adapter datacache
+ * when as its about to be removed.
+ */
+ psl_debug = cxl_p1_read(adapter, CXL_PSL9_DEBUG);
+ if (psl_debug & CXL_PSL_DEBUG_CDC) {
+ dev_dbg(&dev->dev, "No data-cache present\n");
+ adapter->native->no_data_cache = true;
+ }
+
return 0;
}
@@ -1449,10 +1459,8 @@ int cxl_pci_reset(struct cxl *adapter)
/*
* The adapter is about to be reset, so ignore errors.
- * Not supported on P9 DD1
*/
- if ((cxl_is_power8()) || (!(cxl_is_power9_dd1())))
- cxl_data_cache_flush(adapter);
+ cxl_data_cache_flush(adapter);
/* pcie_warm_reset requests a fundamental pci reset which includes a
* PERST assert/deassert. PERST triggers a loading of the image
@@ -1936,10 +1944,8 @@ static void cxl_pci_remove_adapter(struct cxl *adapter)
/*
* Flush adapter datacache as its about to be removed.
- * Not supported on P9 DD1.
*/
- if ((cxl_is_power8()) || (!(cxl_is_power9_dd1())))
- cxl_data_cache_flush(adapter);
+ cxl_data_cache_flush(adapter);
cxl_deconfigure_adapter(adapter);
--
2.14.3
^ permalink raw reply related
* [PATCH] crypto: nx-842: Delete an error message for a failed memory allocation in nx842_pseries_init()
From: SF Markus Elfring @ 2018-02-14 16:17 UTC (permalink / raw)
To: linux-crypto, linuxppc-dev, Benjamin Herrenschmidt,
David S. Miller, Haren Myneni, Herbert Xu, Michael Ellerman,
Paul Mackerras
Cc: LKML, kernel-janitors, Dan Streetman
From: Markus Elfring <elfring@users.sourceforge.net>
Date: Wed, 14 Feb 2018 17:05:13 +0100
Omit an extra message for a memory allocation failure in this function.
This issue was detected by using the Coccinelle software.
Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
---
drivers/crypto/nx/nx-842-pseries.c | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/drivers/crypto/nx/nx-842-pseries.c b/drivers/crypto/nx/nx-842-pseries.c
index bf52cd1d7fca..66869976cfa2 100644
--- a/drivers/crypto/nx/nx-842-pseries.c
+++ b/drivers/crypto/nx/nx-842-pseries.c
@@ -1105,10 +1105,9 @@ static int __init nx842_pseries_init(void)
RCU_INIT_POINTER(devdata, NULL);
new_devdata = kzalloc(sizeof(*new_devdata), GFP_KERNEL);
- if (!new_devdata) {
- pr_err("Could not allocate memory for device data\n");
+ if (!new_devdata)
return -ENOMEM;
- }
+
RCU_INIT_POINTER(devdata, new_devdata);
ret = vio_register_driver(&nx842_vio_driver);
--
2.16.1
^ permalink raw reply related
* Re: [PATCH v2] powerpc/via-pmu: Fix section mismatch warning
From: Laurent Vivier @ 2018-02-15 10:35 UTC (permalink / raw)
To: Mathieu Malaterre, Michael Ellerman
Cc: Benjamin Herrenschmidt, linuxppc-dev, linux-kernel
In-Reply-To: <20180214211519.15683-1-malat@debian.org>
On 14/02/2018 22:15, Mathieu Malaterre wrote:
> Make the struct via_pmu_driver const to avoid following warning:
>
> WARNING: vmlinux.o(.data+0x4739c): Section mismatch in reference from the variable via_pmu_driver to the function .init.text:pmu_init()
> The variable via_pmu_driver references
> the function __init pmu_init()
> If the reference is valid then annotate the
> variable with __init* or __refdata (see linux/init.h) or name the variable:
> *_template, *_timer, *_sht, *_ops, *_probe, *_probe_one, *_console
>
> Signed-off-by: Mathieu Malaterre <malat@debian.org>
> Suggested-by: Laurent Vivier <lvivier@redhat.com>
> ---
> v2: pmu_init() is really an init function, leave __init marker
>
> drivers/macintosh/via-pmu.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/macintosh/via-pmu.c b/drivers/macintosh/via-pmu.c
> index 94c0f3f7df69..fc56c7067732 100644
> --- a/drivers/macintosh/via-pmu.c
> +++ b/drivers/macintosh/via-pmu.c
> @@ -198,7 +198,7 @@ static const struct file_operations pmu_battery_proc_fops;
> static const struct file_operations pmu_options_proc_fops;
>
> #ifdef CONFIG_ADB
> -struct adb_driver via_pmu_driver = {
> +const struct adb_driver via_pmu_driver = {
> "PMU",
> pmu_probe,
> pmu_init,
>
Reviewed-by: Laurent Vivier <lvivier@redhat.com>
^ permalink raw reply
* Re: [PATCH] cxl: Check if PSL data-cache is available before issue flush request
From: Frederic Barrat @ 2018-02-15 9:37 UTC (permalink / raw)
To: Vaibhav Jain, linuxppc-dev
Cc: Philippe Bergheaud, Alastair D'Silva, Andrew Donnellan,
Christophe Lombard
In-Reply-To: <20180213111022.27611-1-vaibhav@linux.vnet.ibm.com>
Le 13/02/2018 à 12:10, Vaibhav Jain a écrit :
> PSL9D doesn't have a data-cache that needs to be flushed before
> resetting the card. However when cxl tries to flush data-cache on such
> a card, it times-out as PSL_Control register never indicates flush
> operation complete due to missing data-cache. This is usually
> indicated in the kernel logs with this message:
>
> "WARNING: cache flush timed out"
>
> To fix this the patch checks PSL_Debug register CDC-Field(BIT:27)
> which indicates the absence of a data-cache and sets a flag
> 'no_data_cache' in 'struct cxl_native' to indicate this. When
> cxl_data_cache_flush() is called it checks the flag and if set bails
> out early without requesting a data-cache flush operation to the PSL.
>
> Signed-off-by: Vaibhav Jain <vaibhav@linux.vnet.ibm.com>
> ---
> drivers/misc/cxl/cxl.h | 4 ++++
> drivers/misc/cxl/native.c | 11 ++++++++++-
> drivers/misc/cxl/pci.c | 19 +++++++++++++------
> 3 files changed, 27 insertions(+), 7 deletions(-)
>
> diff --git a/drivers/misc/cxl/cxl.h b/drivers/misc/cxl/cxl.h
> index 4f015da78f28..4949b8d5a748 100644
> --- a/drivers/misc/cxl/cxl.h
> +++ b/drivers/misc/cxl/cxl.h
> @@ -369,6 +369,9 @@ static const cxl_p2n_reg_t CXL_PSL_WED_An = {0x0A0};
> #define CXL_PSL_TFC_An_AE (1ull << (63-30)) /* Restart PSL with address error */
> #define CXL_PSL_TFC_An_R (1ull << (63-31)) /* Restart PSL transaction */
>
> +/****** CXL_PSL_DEBUG *****************************************************/
> +#define CXL_PSL_DEBUG_CDC (1ull << (63-27)) /* Coherent Data cache support */
> +
> /****** CXL_XSL9_IERAT_ERAT - CAIA 2 **********************************/
> #define CXL_XSL9_IERAT_MLPID (1ull << (63-0)) /* Match LPID */
> #define CXL_XSL9_IERAT_MPID (1ull << (63-1)) /* Match PID */
> @@ -669,6 +672,7 @@ struct cxl_native {
> irq_hw_number_t err_hwirq;
> unsigned int err_virq;
> u64 ps_off;
> + bool no_data_cache; /* set if no data cache on the card */
> const struct cxl_service_layer_ops *sl_ops;
> };
>
> diff --git a/drivers/misc/cxl/native.c b/drivers/misc/cxl/native.c
> index 1b3d7c65ea3f..98f867fcef24 100644
> --- a/drivers/misc/cxl/native.c
> +++ b/drivers/misc/cxl/native.c
> @@ -353,8 +353,17 @@ int cxl_data_cache_flush(struct cxl *adapter)
> u64 reg;
> unsigned long timeout = jiffies + (HZ * CXL_TIMEOUT);
>
> - pr_devel("Flushing data cache\n");
> + /*
> + * Do a datacache flush only if datacache is available.
> + * In case of PSL9D datacache absent hence flush operation.
> + * would timeout.
> + */
> + if (adapter->native->no_data_cache) {
> + pr_devel("No PSL data cache. Ignoring cache flush req.\n");
> + return 0;
> + }
>
> + pr_devel("Flushing data cache\n");
> reg = cxl_p1_read(adapter, CXL_PSL_Control);
> reg |= CXL_PSL_Control_Fr;
> cxl_p1_write(adapter, CXL_PSL_Control, reg);
> diff --git a/drivers/misc/cxl/pci.c b/drivers/misc/cxl/pci.c
> index 758842f65a1b..39ddf89c3c14 100644
> --- a/drivers/misc/cxl/pci.c
> +++ b/drivers/misc/cxl/pci.c
> @@ -456,6 +456,7 @@ static int init_implementation_adapter_regs_psl9(struct cxl *adapter,
> u64 chipid;
> u32 phb_index;
> u64 capp_unit_id;
> + u64 psl_debug;
> int rc;
>
> rc = cxl_calc_capp_routing(dev, &chipid, &phb_index, &capp_unit_id);
> @@ -506,6 +507,16 @@ static int init_implementation_adapter_regs_psl9(struct cxl *adapter,
> } else
> cxl_p1_write(adapter, CXL_PSL9_DEBUG, 0x4000000000000000ULL);
>
> + /* Check if PSL has data-cache. We need to flush adapter datacache
> + * when as its about to be removed. But data-cache flush is not
> + * supported supported on P9-DD1 and
> + */
> + psl_debug = cxl_p1_read(adapter, CXL_PSL9_DEBUG);
> + if (cxl_is_power9_dd1() || (psl_debug & CXL_PSL_DEBUG_CDC)) {
> + dev_info(&dev->dev, "No data-cache present\n");
Doesn't dev_info() always show in the log? If so then it should be tuned
down to dev_dbg(), as nobody cares.
Also, I wouldn't introduce any new code testing for dd1. It's dead code
we're going to have to remove soon anyway.
Fred
> + adapter->native->no_data_cache = true;
> + }
> +
> return 0;
> }
>
> @@ -1449,10 +1460,8 @@ int cxl_pci_reset(struct cxl *adapter)
>
> /*
> * The adapter is about to be reset, so ignore errors.
> - * Not supported on P9 DD1
> */
> - if ((cxl_is_power8()) || (!(cxl_is_power9_dd1())))
> - cxl_data_cache_flush(adapter);
> + cxl_data_cache_flush(adapter);
>
> /* pcie_warm_reset requests a fundamental pci reset which includes a
> * PERST assert/deassert. PERST triggers a loading of the image
> @@ -1936,10 +1945,8 @@ static void cxl_pci_remove_adapter(struct cxl *adapter)
>
> /*
> * Flush adapter datacache as its about to be removed.
> - * Not supported on P9 DD1.
> */
> - if ((cxl_is_power8()) || (!(cxl_is_power9_dd1())))
> - cxl_data_cache_flush(adapter);
> + cxl_data_cache_flush(adapter);
>
> cxl_deconfigure_adapter(adapter);
>
^ permalink raw reply
* Re: [PATCH v2] cxl: Remove function write_timebase_ctrl_psl9() for PSL9
From: Frederic Barrat @ 2018-02-15 9:28 UTC (permalink / raw)
To: Vaibhav Jain, Andrew Donnellan, Christophe Lombard
Cc: linuxppc-dev, Philippe Bergheaud, Alastair D'Silva
In-Reply-To: <20180215061936.27131-1-vaibhav@linux.vnet.ibm.com>
Le 15/02/2018 à 07:19, Vaibhav Jain a écrit :
> For PSL9 the contents of PSL_TB_CTLSTAT register have changed in PSL9
> and all of the register is now readonly. Hence we don't need an sl_ops
> implementation for 'write_timebase_ctrl' for to populate this register
> for PSL9.
>
> Hence this patch removes function write_timebase_ctrl_psl9() and its
> references from the code.
>
> Signed-off-by: Vaibhav Jain <vaibhav@linux.vnet.ibm.com>
> ---
Thanks!
Acked-by: Frederic Barrat <fbarrat@linux.vnet.ibm.com>
> Change-log:
> v2 -> Updated the patch description to accurately reflect changes
> between PSL9 and PSL8. (Fred)
> ---
> drivers/misc/cxl/pci.c | 10 ++--------
> 1 file changed, 2 insertions(+), 8 deletions(-)
>
> diff --git a/drivers/misc/cxl/pci.c b/drivers/misc/cxl/pci.c
> index c983f23cc2ed..9bc30c20b66b 100644
> --- a/drivers/misc/cxl/pci.c
> +++ b/drivers/misc/cxl/pci.c
> @@ -572,12 +572,6 @@ static int init_implementation_adapter_regs_xsl(struct cxl *adapter, struct pci_
> /* For the PSL this is a multiple for 0 < n <= 7: */
> #define PSL_2048_250MHZ_CYCLES 1
>
> -static void write_timebase_ctrl_psl9(struct cxl *adapter)
> -{
> - cxl_p1_write(adapter, CXL_PSL9_TB_CTLSTAT,
> - TBSYNC_CNT(2 * PSL_2048_250MHZ_CYCLES));
> -}
> -
> static void write_timebase_ctrl_psl8(struct cxl *adapter)
> {
> cxl_p1_write(adapter, CXL_PSL_TB_CTLSTAT,
> @@ -639,7 +633,8 @@ static void cxl_setup_psl_timebase(struct cxl *adapter, struct pci_dev *dev)
> * Setup PSL Timebase Control and Status register
> * with the recommended Timebase Sync Count value
> */
> - adapter->native->sl_ops->write_timebase_ctrl(adapter);
> + if (adapter->native->sl_ops->write_timebase_ctrl)
> + adapter->native->sl_ops->write_timebase_ctrl(adapter);
>
> /* Enable PSL Timebase */
> cxl_p1_write(adapter, CXL_PSL_Control, 0x0000000000000000);
> @@ -1805,7 +1800,6 @@ static const struct cxl_service_layer_ops psl9_ops = {
> .psl_irq_dump_registers = cxl_native_irq_dump_regs_psl9,
> .err_irq_dump_registers = cxl_native_err_irq_dump_regs_psl9,
> .debugfs_stop_trace = cxl_stop_trace_psl9,
> - .write_timebase_ctrl = write_timebase_ctrl_psl9,
> .timebase_read = timebase_read_psl9,
> .capi_mode = OPAL_PHB_CAPI_MODE_CAPI,
> .needs_reset_before_disable = true,
>
^ permalink raw reply
* Re: [PATCH 2/3] rfi-flush: Make it possible to call setup_rfi_flush() again
From: Michal Suchánek @ 2018-02-15 7:13 UTC (permalink / raw)
To: Mauricio Faria de Oliveira; +Cc: linuxppc-dev, mpe
In-Reply-To: <1518644021-17037-3-git-send-email-mauricfo@linux.vnet.ibm.com>
Hello,
On Wed, 14 Feb 2018 19:33:40 -0200
Mauricio Faria de Oliveira <mauricfo@linux.vnet.ibm.com> wrote:
> From: Michael Ellerman <mpe@ellerman.id.au>
>
> For PowerVM migration we want to be able to call setup_rfi_flush()
> again after we've migrated the partition.
>
> To support that we need to check that we're not trying to allocate the
> fallback flush area after memblock has gone away. If so we just fail,
> we don't support migrating from a patched to an unpatched machine. Or
> we do support it, but there will be no RFI flush enabled on the
> destination.
>
This sounds bad to me. Either we support RFI flush or we don't.
If we do the fallback area should be allocated at boot so it is always
available. The user can use nopti to disable all RFI flush and then it
is OK to not allocate it.
Thanks
Michal
^ permalink raw reply
* Re: [PATCH] powerpc/xmon: Dont register sysrq key when kernel param xmon=off
From: Vaibhav Jain @ 2018-02-15 6:43 UTC (permalink / raw)
To: Michael Ellerman, Balbir Singh
Cc: linux-kernel@vger.kernel.org, Nicholas Piggin, Paul Mackerras,
Douglas Miller, Pan Xinhui,
open list:LINUX FOR POWERPC (32-BIT AND 64-BIT)
In-Reply-To: <87eflnre7w.fsf@concordia.ellerman.id.au>
Thanks for looking into this patch Mpe.
Michael Ellerman <mpe@ellerman.id.au> writes:
> <snip>
>
> But the same crash happens with XMON_DEFAULT=n and nothing on the
> command line.
Yes, XMON_DEFAULT=n and empty boot command line implies xmon=off hence
you will see the same issue and this patch should fix that issue too.
>
> The problem is not xmon=off on the command line.
>
> The problem is that when xmon_on = false and we enter xmon via sysrq and
> then set breakpoints, we need to enable xmon_on before leaving xmon.
>
Agree on both the points made.
> So this is a bug introduced by:
>
> 3b5bf42b81d5 ("powerpc/xmon: Fix an unexpected xmon on/off state change")
>
>
> How to fix it is not entirely clear. In general I like the behaviour we
> have since the above commit, ie. quickly dropping into xmon and
> inspecting something doesn't leave xmon enabled, which then causes the
> system not to kdump/reboot later.
Agree on the convenience factor of leaving the xmon console
enabled. However we still need a way to disable xmon completely at
kernel-boot time. Leaving xmon enabled even if 'xmon=off' is provided at
command line is counter intuitive.
>
> What would be nice is if we keep that behaviour, but any action you take
> in xmon that requires xmon to remain resident, ie. setting a breakpoint,
> calls a function which makes sure xmon_on = true and if it wasn't prints
> a nice message saying "Turning xmon on due to breakpoint insertion" or
> something.
That makes sense to me and sounds workable. However we already have a
debugfs interface to enable/disable xmon debugger hook. I can also tweak
this interface to also register the sysrq key when xmon is enabled. This
should provide the user the ability to still use xmon if they want to
after the system has booted with xmon=off.
>
> cheers
>
--
Vaibhav Jain <vaibhav@linux.vnet.ibm.com>
Linux Technology Center, IBM India Pvt. Ltd.
^ permalink raw reply
* Re: [PATCH v2] cxl: Remove function write_timebase_ctrl_psl9() for PSL9
From: Andrew Donnellan @ 2018-02-15 6:24 UTC (permalink / raw)
To: Vaibhav Jain, Frederic Barrat, Christophe Lombard
Cc: linuxppc-dev, Philippe Bergheaud, Alastair D'Silva
In-Reply-To: <20180215061936.27131-1-vaibhav@linux.vnet.ibm.com>
Acked-by: Andrew Donnellan <andrew.donnellan@au1.ibm.com>
On 15/02/18 17:19, Vaibhav Jain wrote:
> For PSL9 the contents of PSL_TB_CTLSTAT register have changed in PSL9
> and all of the register is now readonly. Hence we don't need an sl_ops
> implementation for 'write_timebase_ctrl' for to populate this register
> for PSL9.
>
> Hence this patch removes function write_timebase_ctrl_psl9() and its
> references from the code.
>
> Signed-off-by: Vaibhav Jain <vaibhav@linux.vnet.ibm.com>
> ---
> Change-log:
> v2 -> Updated the patch description to accurately reflect changes
> between PSL9 and PSL8. (Fred)
> ---
> drivers/misc/cxl/pci.c | 10 ++--------
> 1 file changed, 2 insertions(+), 8 deletions(-)
>
> diff --git a/drivers/misc/cxl/pci.c b/drivers/misc/cxl/pci.c
> index c983f23cc2ed..9bc30c20b66b 100644
> --- a/drivers/misc/cxl/pci.c
> +++ b/drivers/misc/cxl/pci.c
> @@ -572,12 +572,6 @@ static int init_implementation_adapter_regs_xsl(struct cxl *adapter, struct pci_
> /* For the PSL this is a multiple for 0 < n <= 7: */
> #define PSL_2048_250MHZ_CYCLES 1
>
> -static void write_timebase_ctrl_psl9(struct cxl *adapter)
> -{
> - cxl_p1_write(adapter, CXL_PSL9_TB_CTLSTAT,
> - TBSYNC_CNT(2 * PSL_2048_250MHZ_CYCLES));
> -}
> -
> static void write_timebase_ctrl_psl8(struct cxl *adapter)
> {
> cxl_p1_write(adapter, CXL_PSL_TB_CTLSTAT,
> @@ -639,7 +633,8 @@ static void cxl_setup_psl_timebase(struct cxl *adapter, struct pci_dev *dev)
> * Setup PSL Timebase Control and Status register
> * with the recommended Timebase Sync Count value
> */
> - adapter->native->sl_ops->write_timebase_ctrl(adapter);
> + if (adapter->native->sl_ops->write_timebase_ctrl)
> + adapter->native->sl_ops->write_timebase_ctrl(adapter);
>
> /* Enable PSL Timebase */
> cxl_p1_write(adapter, CXL_PSL_Control, 0x0000000000000000);
> @@ -1805,7 +1800,6 @@ static const struct cxl_service_layer_ops psl9_ops = {
> .psl_irq_dump_registers = cxl_native_irq_dump_regs_psl9,
> .err_irq_dump_registers = cxl_native_err_irq_dump_regs_psl9,
> .debugfs_stop_trace = cxl_stop_trace_psl9,
> - .write_timebase_ctrl = write_timebase_ctrl_psl9,
> .timebase_read = timebase_read_psl9,
> .capi_mode = OPAL_PHB_CAPI_MODE_CAPI,
> .needs_reset_before_disable = true,
>
--
Andrew Donnellan OzLabs, ADL Canberra
andrew.donnellan@au1.ibm.com IBM Australia Limited
^ permalink raw reply
* [PATCH v2] cxl: Remove function write_timebase_ctrl_psl9() for PSL9
From: Vaibhav Jain @ 2018-02-15 6:19 UTC (permalink / raw)
To: Frederic Barrat, Andrew Donnellan, Christophe Lombard
Cc: Vaibhav Jain, linuxppc-dev, Philippe Bergheaud,
Alastair D'Silva
For PSL9 the contents of PSL_TB_CTLSTAT register have changed in PSL9
and all of the register is now readonly. Hence we don't need an sl_ops
implementation for 'write_timebase_ctrl' for to populate this register
for PSL9.
Hence this patch removes function write_timebase_ctrl_psl9() and its
references from the code.
Signed-off-by: Vaibhav Jain <vaibhav@linux.vnet.ibm.com>
---
Change-log:
v2 -> Updated the patch description to accurately reflect changes
between PSL9 and PSL8. (Fred)
---
drivers/misc/cxl/pci.c | 10 ++--------
1 file changed, 2 insertions(+), 8 deletions(-)
diff --git a/drivers/misc/cxl/pci.c b/drivers/misc/cxl/pci.c
index c983f23cc2ed..9bc30c20b66b 100644
--- a/drivers/misc/cxl/pci.c
+++ b/drivers/misc/cxl/pci.c
@@ -572,12 +572,6 @@ static int init_implementation_adapter_regs_xsl(struct cxl *adapter, struct pci_
/* For the PSL this is a multiple for 0 < n <= 7: */
#define PSL_2048_250MHZ_CYCLES 1
-static void write_timebase_ctrl_psl9(struct cxl *adapter)
-{
- cxl_p1_write(adapter, CXL_PSL9_TB_CTLSTAT,
- TBSYNC_CNT(2 * PSL_2048_250MHZ_CYCLES));
-}
-
static void write_timebase_ctrl_psl8(struct cxl *adapter)
{
cxl_p1_write(adapter, CXL_PSL_TB_CTLSTAT,
@@ -639,7 +633,8 @@ static void cxl_setup_psl_timebase(struct cxl *adapter, struct pci_dev *dev)
* Setup PSL Timebase Control and Status register
* with the recommended Timebase Sync Count value
*/
- adapter->native->sl_ops->write_timebase_ctrl(adapter);
+ if (adapter->native->sl_ops->write_timebase_ctrl)
+ adapter->native->sl_ops->write_timebase_ctrl(adapter);
/* Enable PSL Timebase */
cxl_p1_write(adapter, CXL_PSL_Control, 0x0000000000000000);
@@ -1805,7 +1800,6 @@ static const struct cxl_service_layer_ops psl9_ops = {
.psl_irq_dump_registers = cxl_native_irq_dump_regs_psl9,
.err_irq_dump_registers = cxl_native_err_irq_dump_regs_psl9,
.debugfs_stop_trace = cxl_stop_trace_psl9,
- .write_timebase_ctrl = write_timebase_ctrl_psl9,
.timebase_read = timebase_read_psl9,
.capi_mode = OPAL_PHB_CAPI_MODE_CAPI,
.needs_reset_before_disable = true,
--
2.14.3
^ permalink raw reply related
* Re: [PATCH] cxl: Remove function write_timebase_ctrl_psl9() for PSL9
From: Vaibhav Jain @ 2018-02-15 6:03 UTC (permalink / raw)
To: Frederic Barrat, linuxppc-dev
Cc: Philippe Bergheaud, Alastair D'Silva, Andrew Donnellan,
Christophe Lombard
In-Reply-To: <17a1d3c8-c38d-0134-9463-4eebf1eced70@linux.vnet.ibm.com>
Frederic Barrat <fbarrat@linux.vnet.ibm.com> writes:
> The code change looks ok, but am I the only one to think the commit
> message doesn't match? The enable bit has always been in the PSL_CONTROL
> register, it was just badly documented on p8. What's been removed is
> much of the configuration found in PSL_TB_CTLSTAT.
>
Thanks for pointing this out Fred. I wrongly assumed looking at the PSL8
implementation that writing to the PSL_TV_CTLSTAT regiser enabled the
TB. I will update the patch description and resend the patch.
--
Vaibhav Jain <vaibhav@linux.vnet.ibm.com>
Linux Technology Center, IBM India Pvt. Ltd.
^ permalink raw reply
* Re: [PATCH kernel] powerpc/init: Do not advertise radix during client-architecture-support
From: Alexey Kardashevskiy @ 2018-02-15 5:44 UTC (permalink / raw)
To: linuxppc-dev
In-Reply-To: <20180109054520.31704-1-aik@ozlabs.ru>
On 09/01/18 16:45, Alexey Kardashevskiy wrote:
> Currently the pseries kernel advertises radix MMU support even if
> the actual support is disabled via the CONFIG_PPC_RADIX_MMU option.
>
> This adds a check for CONFIG_PPC_RADIX_MMU to avoid advertising radix
> to the hypervisor.
>
> Suggested-by: Paul Mackerras <paulus@ozlabs.org>
> Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
Ping?
> ---
> arch/powerpc/kernel/prom_init.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/arch/powerpc/kernel/prom_init.c b/arch/powerpc/kernel/prom_init.c
> index 02190e9..65879df 100644
> --- a/arch/powerpc/kernel/prom_init.c
> +++ b/arch/powerpc/kernel/prom_init.c
> @@ -1109,7 +1109,8 @@ static void __init prom_check_platform_support(void)
> }
> }
>
> - if (supported.radix_mmu && supported.radix_gtse) {
> + if (supported.radix_mmu && supported.radix_gtse &&
> + IS_ENABLED(CONFIG_PPC_RADIX_MMU)) {
> /* Radix preferred - but we require GTSE for now */
> prom_debug("Asking for radix with GTSE\n");
> ibm_architecture_vec.vec5.mmu = OV5_FEAT(OV5_MMU_RADIX);
>
--
Alexey
^ permalink raw reply
* Re: [PATCH kernel] powerpc/lpar/debug: Initialize flags before printing debug message
From: Alexey Kardashevskiy @ 2018-02-15 5:44 UTC (permalink / raw)
To: linuxppc-dev
In-Reply-To: <20180109055214.32199-1-aik@ozlabs.ru>
On 09/01/18 16:52, Alexey Kardashevskiy wrote:
> With enabled DEBUG, there is a compile error:
> "error: ‘flags’ is used uninitialized in this function".
>
> This moves pr_devel() little further where @flags are initialized.
>
> Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
Ping?
> ---
>
> /home/aik/p/guest-kernel/arch/powerpc/platforms/pseries/lpar.c: In function ‘pSeries_lpar_hpte_updatepp’:
> /home/aik/p/guest-kernel/include/linux/printk.h:320:2: error: ‘flags’ is used uninitialized in this function [-Werror=un
> initialized]
> printk(KERN_DEBUG pr_fmt(fmt), ##__VA_ARGS__)
> ^
> /home/aik/p/guest-kernel/arch/powerpc/platforms/pseries/lpar.c:304:16: note: ‘flags’ was declared here
> unsigned long flags;
> ^
> ---
> arch/powerpc/platforms/pseries/lpar.c | 10 +++++-----
> 1 file changed, 5 insertions(+), 5 deletions(-)
>
> diff --git a/arch/powerpc/platforms/pseries/lpar.c b/arch/powerpc/platforms/pseries/lpar.c
> index 0ee4a46..1365424 100644
> --- a/arch/powerpc/platforms/pseries/lpar.c
> +++ b/arch/powerpc/platforms/pseries/lpar.c
> @@ -306,14 +306,14 @@ static long pSeries_lpar_hpte_updatepp(unsigned long slot,
>
> want_v = hpte_encode_avpn(vpn, psize, ssize);
>
> + flags = (newpp & 7) | H_AVPN;
> + if (mmu_has_feature(MMU_FTR_KERNEL_RO))
> + /* Move pp0 into bit 8 (IBM 55) */
> + flags |= (newpp & HPTE_R_PP0) >> 55;
> +
> pr_devel(" update: avpnv=%016lx, hash=%016lx, f=%lx, psize: %d ...",
> want_v, slot, flags, psize);
>
> - flags = (newpp & 7) | H_AVPN;
> - if (mmu_has_feature(MMU_FTR_KERNEL_RO))
> - /* Move pp0 into bit 8 (IBM 55) */
> - flags |= (newpp & HPTE_R_PP0) >> 55;
> -
> lpar_rc = plpar_pte_protect(flags, slot, want_v);
>
> if (lpar_rc == H_NOT_FOUND) {
>
--
Alexey
^ permalink raw reply
* Re: samples/seccomp/ broken when cross compiling s390, ppc allyesconfig
From: Michael Ellerman @ 2018-02-14 23:23 UTC (permalink / raw)
To: Kees Cook, Michal Hocko; +Cc: Will Drewry, linux-s390, PowerPC, LKML
In-Reply-To: <CAGXu5jJCN_Js9rvM4RMjxDCDd4tVzWDo-jdnFiZs1D9e3cunrw@mail.gmail.com>
Kees Cook <keescook@chromium.org> writes:
> On Wed, Feb 14, 2018 at 1:20 AM, Michal Hocko <mhocko@kernel.org> wrote:
...
>>
>> OK, so let's try to nuke it. How should I route this patch?
>
> I'm fine if goes in via ppc (especially if it can land for 4.16). If
> Michael doesn't want it, I can send it through my seccomp tree via
> James Morris.
It's not really my area, so I'd prefer if you take it, or we could
always punt to akpm :)
cheers
^ permalink raw reply
* Re: [PATCH V3 0/9] powerpc: Support for ibm,dynamic-memory-v2
From: Michael Ellerman @ 2018-02-14 23:21 UTC (permalink / raw)
To: Tyrel Datwyler, Nathan Fontenot, linuxppc-dev; +Cc: Cyril Bur
In-Reply-To: <53bf14ae-bb01-585d-3d40-2d8afeb5d345@linux.vnet.ibm.com>
Tyrel Datwyler <tyreld@linux.vnet.ibm.com> writes:
> On 12/03/2017 09:13 PM, Michael Ellerman wrote:
>> Nathan Fontenot <nfont@linux.vnet.ibm.com> writes:
>>
>>> This patch set provides a series of updates to de-couple the LMB
>>> information provided in the device tree property from the device
>>> tree property format. This eases the ability to support a new
>>> format for the dynamic memory property, ibm,dynamic-memory-v2.
>>
>> Something in here is still blowing up for me in a KVM guest:
>
> So, it looks like this series was applied despite observing this KVM
> guest crash.
The crash has gone away for me, I do that KVM guest test on every push.
So I applied the series, but yeah you're right that was probably silly
of me.
cheers
^ permalink raw reply
* Re: 4.16-rc1 virtual machine crash on boot
From: Nathan Fontenot @ 2018-02-14 21:53 UTC (permalink / raw)
To: Tyrel Datwyler, Cyril Bur, linuxppc-dev@ozlabs.org,
Michael Ellerman
In-Reply-To: <3e71dc1a-ad80-71d7-3072-922dbaba5c05@linux.vnet.ibm.com>
On 02/14/2018 03:37 PM, Tyrel Datwyler wrote:
> On 02/13/2018 10:15 PM, Cyril Bur wrote:
>> On Tue, 2018-02-13 at 21:12 -0800, Tyrel Datwyler wrote:
>>> On 02/13/2018 05:20 PM, Cyril Bur wrote:
>>>> Hello all,
>>>
>>> Does reverting commit 02ef6dd8109b581343ebeb1c4c973513682535d6 alleviate the issue?
>>>
>>
>> Hi Tyrel,
>>
>> No it doesn't. Same backtrace.
>
> What about commit 0c38ed6f6f0b78a404fe46767d21504b37af8705? After a little closer look I think the series that commit enabled is the culprit. Especially, since Michael Ellerman complained of the same crash.
>
> -Tyrel
This wouldn't fix the issue. That patch enabled support for ibm,dynamic-memory-v2
but in the stack trace we see that the device tree has the old (v1) version of
the ibm,dynamic-memory property.
-Nathan
>
>>>
>>>>
>>>> I'm seeing this crash trying to boot a KVM virtual machine. This kernel
>>>> was compiled with pseries_le_defconfig and run using the following qemu
>>>> commandline:
>>>>
>>>> qemu-system-ppc64 -enable-kvm -cpu POWER8 -smp 4 -m 4G -M pseries
>>>> -nographic -vga none -drive file=vm.raw,if=virtio,format=raw -drive
>>>> file=mkvmconf2xeO,if=virtio,format=raw -netdev type=user,id=net0
>>>> -device virtio-net-pci,netdev=net0 -kernel vmlinux_tscr -append
>>>> 'root=/dev/vdb1 rw cloud-init=disabled'
>>>>
>>>> qemu-system-ppc64 --version
>>>> QEMU emulator version 2.5.0 (Debian 1:2.5+dfsg-5ubuntu10.16), Copyright
>>>> (c) 2003-2008 Fabrice Bellard
>>>>
>>>>
>>>> Key type dns_resolver registered
>>>> Unable to handle kernel paging request for data at address 0x00000010
>>>> Faulting instruction address: 0xc0000000018f2bbc
>>>> Oops: Kernel access of bad area, sig: 11 [#1]
>>>> LE SMP NR_CPUS=2048 NUMA pSeries
>>>> CPU: 1 PID: 1 Comm: swapper/0 Not tainted 4.16.0-rc1v4.16-rc1 #8
>>>> NIP: c0000000018f2bbc LR: c0000000018f2bb4 CTR: 0000000000000000
>>>> REGS: c0000000fea838d0 TRAP: 0380 Not tainted (4.16.0-rc1v4.16-rc1)
>>>> MSR: 8000000002009033 <SF,VEC,EE,ME,IR,DR,RI,LE> CR: 84000248 XER:
>>>> 20000000
>>>> CFAR: c0000000019591a0 SOFTE: 0
>>>> GPR00: c0000000018f2bb4 c0000000fea83b50 c000000001bd8400
>>>> 0000000000000000
>>>> GPR04: c0000000fea83b70 0000000000000000 000000000000002f
>>>> 0000000000000022
>>>> GPR08: 0000000000000000 c0000000022a3e90 0000000000000000
>>>> 0000000000000220
>>>> GPR12: 0000000000000000 c00000000fb40980 c00000000000d698
>>>> 0000000000000000
>>>> GPR16: 0000000000000000 0000000000000000 0000000000000000
>>>> 0000000000000000
>>>> GPR20: 0000000000000000 0000000000000000 0000000000000000
>>>> 0000000000000000
>>>> GPR24: 0000000000000000 c0000000018b9248 c0000000018e36d8
>>>> c0000000019738a8
>>>> GPR28: 0000000000000007 c0000000fffffc68 c0000000fea83bf0
>>>> 0000000000000010
>>>> NIP [c0000000018f2bbc] read_drconf_v1_cell+0x50/0x9c
>>>> LR [c0000000018f2bb4] read_drconf_v1_cell+0x48/0x9c
>>>> Call Trace:
>>>> [c0000000fea83b50] [c0000000018f2bb4] read_drconf_v1_cell+0x48/0x9c
>>>> (unreliable)
>>>> [c0000000fea83b90] [c0000000018f305c] drmem_init+0x13c/0x2ec
>>>> [c0000000fea83c40] [c0000000018e4288] do_one_initcall+0xdc/0x1ac
>>>> [c0000000fea83d00] [c0000000018e45d4] kernel_init_freeable+0x27c/0x358
>>>> [c0000000fea83dc0] [c00000000000d6bc] kernel_init+0x2c/0x160
>>>> [c0000000fea83e30] [c00000000000bc20] ret_from_kernel_thread+0x5c/0xbc
>>>> Instruction dump:
>>>> 7c7f1b78 60000000 60000000 7c240b78 3d22ffdc 3929f0a4 e95e0000
>>>> e8690002
>>>> f9440021 4806657d 60000000 e9210020 <f87f0000> 39090004 39490010
>>>> f9010020
>>>> ---[ end trace bd9f49f482d30e03 ]---
>>>>
>>>> Kernel panic - not syncing: Attempted to kill init! exitcode=0x0000000b
>>>>
>>>> WARNING: CPU: 1 PID: 1 at drivers/tty/vt/vt.c:3883
>>>> do_unblank_screen+0x1f0/0x270
>>>> CPU: 1 PID: 1 Comm: swapper/0 Tainted: G D 4.16.0-
>>>> rc1v4.16-rc1 #8
>>>> NIP: c0000000009aa800 LR: c0000000009aa63c CTR: c00000000148f5f0
>>>> REGS: c0000000fea832c0 TRAP: 0700 Tainted:
>>>> G D (4.16.0-rc1v4.16-rc1)
>>>> MSR: 8000000002029033 <SF,VEC,EE,ME,IR,DR,RI,LE> CR: 28002222 XER:
>>>> 20000000
>>>> CFAR: c0000000009aa658 SOFTE: 1
>>>> GPR00: c0000000009aa63c c0000000fea83540 c000000001bd8400
>>>> 0000000000000000
>>>> GPR04: 0000000000000001 c0000000fb0c200e 0000000000001dd7
>>>> c0000000fea834d0
>>>> GPR08: 00000000fe430000 0000000000000000 0000000000000000
>>>> 0000000000000001
>>>> GPR12: 0000000028002428 c00000000fb40980 c00000000000d698
>>>> 0000000000000000
>>>> GPR16: 0000000000000000 0000000000000000 0000000000000000
>>>> 0000000000000000
>>>> GPR20: 0000000000000000 0000000000000000 0000000000000000
>>>> 0000000000000000
>>>> GPR24: c0000000fea40000 c0000000feadf910 c000000001a4a7a8
>>>> c000000001cc4ea0
>>>> GPR28: c00000000173f4f0 c000000001cc4ec8 0000000000000000
>>>> 0000000000000000
>>>> NIP [c0000000009aa800] do_unblank_screen+0x1f0/0x270
>>>> LR [c0000000009aa63c] do_unblank_screen+0x2c/0x270
>>>> Call Trace:
>>>> [c0000000fea83540] [c0000000009aa63c] do_unblank_screen+0x2c/0x270
>>>> (unreliable)
>>>> [c0000000fea835b0] [c0000000008a2a70] bust_spinlocks+0x40/0x80
>>>> [c0000000fea835d0] [c0000000000da90c] panic+0x1b8/0x32c
>>>> [c0000000fea83670] [c0000000000e1bd4] do_exit+0xcb4/0xcc0
>>>> [c0000000fea83730] [c0000000000275fc] die+0x29c/0x450
>>>> [c0000000fea837c0] [c000000000053f88] bad_page_fault+0xe8/0x160
>>>> [c0000000fea83830] [c000000000028a90] slb_miss_bad_addr+0x40/0x90
>>>> [c0000000fea83860] [c000000000008b08] bad_addr_slb+0x158/0x160
>>>> --- interrupt: 380 at read_drconf_v1_cell+0x50/0x9c
>>>> LR = read_drconf_v1_cell+0x48/0x9c
>>>> [c0000000fea83b90] [c0000000018f305c] drmem_init+0x13c/0x2ec
>>>> [c0000000fea83c40] [c0000000018e4288] do_one_initcall+0xdc/0x1ac
>>>> [c0000000fea83d00] [c0000000018e45d4] kernel_init_freeable+0x27c/0x358
>>>> [c0000000fea83dc0] [c00000000000d6bc] kernel_init+0x2c/0x160
>>>> [c0000000fea83e30] [c00000000000bc20] ret_from_kernel_thread+0x5c/0xbc
>>>> Instruction dump:
>>>> 3c62ffbf 38840001 7c8407b4 38639ca8 4b7ae0ed 60000000 38210070
>>>> e8010010
>>>> ebc1fff0 ebe1fff8 7c0803a6 4e800020 <0fe00000> 4bfffe58 60000000
>>>> 60420000
>>>> ---[ end trace bd9f49f482d30e04 ]---
>>>> Rebooting in 10 seconds..
>>>>
>>>
>>>
>>
>
^ permalink raw reply
* Re: [PATCH V3 0/9] powerpc: Support for ibm,dynamic-memory-v2
From: Nathan Fontenot @ 2018-02-14 21:50 UTC (permalink / raw)
To: Tyrel Datwyler, Michael Ellerman, linuxppc-dev; +Cc: Cyril Bur
In-Reply-To: <53bf14ae-bb01-585d-3d40-2d8afeb5d345@linux.vnet.ibm.com>
On 02/14/2018 03:30 PM, Tyrel Datwyler wrote:
> On 12/03/2017 09:13 PM, Michael Ellerman wrote:
>> Nathan Fontenot <nfont@linux.vnet.ibm.com> writes:
>>
>>> This patch set provides a series of updates to de-couple the LMB
>>> information provided in the device tree property from the device
>>> tree property format. This eases the ability to support a new
>>> format for the dynamic memory property, ibm,dynamic-memory-v2.
>>
>> Something in here is still blowing up for me in a KVM guest:
>
> So, it looks like this series was applied despite observing this KVM guest crash. Cyril posted yesterday to the list about hitting this same issue with 4.16-rc1.
>
> -Tyrel
>
Yes, Michael pointed out that he hit this on his system but I have never
been able to replicate this error.
Now that others are seeing it any help I could get on re-creating the failure
would be appreciated.
-Nathan
>>
>> OF stdout device is: /vdevice/vty@71000000
>> Preparing to boot Linux version 4.14.0-rc2-gcc6x-g9e1fc7e (kerkins@alpine1-p1) (gcc version 6.4.1 20171202 (Custom 6328ca9eaa476138)) #1 SMP Sun Dec 3 21:45:32 AEDT 2017
>> Detected machine type: 0000000000000101
>> command line:
>> Max number of cores passed to firmware: 256 (NR_CPUS = 2048)
>> Calling ibm,client-architecture-support... done
>> memory layout at init:
>> memory_limit : 0000000000000000 (16 MB aligned)
>> alloc_bottom : 00000000015c0000
>> alloc_top : 0000000030000000
>> alloc_top_hi : 0000000100000000
>> rmo_top : 0000000030000000
>> ram_top : 0000000100000000
>> instantiating rtas at 0x000000002fff0000... done
>> prom_hold_cpus: skipped
>> copying OF device tree...
>> Building dt strings...
>> Building dt structure...
>> Device tree strings 0x00000000017d0000 -> 0x00000000017d09d8
>> Device tree struct 0x00000000017e0000 -> 0x00000000017f0000
>> Quiescing Open Firmware ...
>> Booting Linux via __start() @ 0x0000000000400000 ...
>> [ 0.000000] bootconsole [udbg0] enabled
>> [ 0.000000] Allocated 2883584 bytes for 2048 pacas at c00000000fd40000
>> [ 0.000000] hash-mmu: Page sizes from device-tree:
>> [ 0.000000] hash-mmu: base_shift=12: shift=12, sllp=0x0000, avpnm=0x00000000, tlbiel=1, penc=0
>> [ 0.000000] hash-mmu: base_shift=16: shift=16, sllp=0x0110, avpnm=0x00000000, tlbiel=1, penc=1
>> [ 0.000000] -> fw_vec5_feature_init()
>> [ 0.000000] <- fw_vec5_feature_init()
>> [ 0.000000] -> fw_hypertas_feature_init()
>> [ 0.000000] <- fw_hypertas_feature_init()
>> [ 0.000000] Page orders: linear mapping = 16, virtual = 16, io = 16, vmemmap = 16
>> [ 0.000000] Using 1TB segments
>> [ 0.000000] hash-mmu: Initializing hash mmu with SLB
>> [ 0.000000] Linux version 4.14.0-rc2-gcc6x-g9e1fc7e (kerkins@alpine1-p1) (gcc version 6.4.1 20171202 (Custom 6328ca9eaa476138)) #1 SMP Sun Dec 3 21:45:32 AEDT 2017
>> [ 0.000000] Found initrd at 0xc0000000015c0000:0xc00000000178d70b
>> [ 0.000000] Machine is LPAR !
>> [ 0.000000] -> pseries_init()
>> [ 0.000000] -> fw_cmo_feature_init()
>> [ 0.000000] CMO not available
>> [ 0.000000] <- fw_cmo_feature_init()
>> [ 0.000000] <- pseries_init()
>> [ 0.000000] Using pSeries machine description
>> [ 0.000000] Partition configured for 16 cpus.
>> [ 0.000000] CPU maps initialized for 8 threads per core
>> [ 0.000000] (thread shift is 3)
>> [ 0.000000] Freed 2818048 bytes for unused pacas
>> [ 0.000000] -----------------------------------------------------
>> [ 0.000000] ppc64_pft_size = 0x19
>> [ 0.000000] phys_mem_size = 0x100000000
>> [ 0.000000] dcache_bsize = 0x80
>> [ 0.000000] icache_bsize = 0x80
>> [ 0.000000] cpu_features = 0x17dc7aec18500249
>> [ 0.000000] possible = 0xdfdfffff18500649
>> [ 0.000000] always = 0x0000000018100040
>> [ 0.000000] cpu_user_features = 0xdc0065c2 0xef000000
>> [ 0.000000] mmu_features = 0x78006001
>> [ 0.000000] firmware_features = 0x00000001405a440b
>> [ 0.000000] htab_hash_mask = 0x3ffff
>> [ 0.000000] -----------------------------------------------------
>> [ 0.000000] numa: NODE_DATA [mem 0xfff6a300-0xfff73fff]
>> [ 0.000000] -> smp_init_pSeries()
>> [ 0.000000] <- smp_init_pSeries()
>> [ 0.000000] PCI host bridge /pci@800000020000000 ranges:
>> [ 0.000000] IO 0x0000010080000000..0x000001008000ffff -> 0x0000000000000000
>> [ 0.000000] MEM 0x00000100a0000000..0x000001101fffffff -> 0x0000000080000000
>> [ 0.000000] PPC64 nvram contains 65536 bytes
>> [ 0.000000] Top of RAM: 0x100000000, Total RAM: 0x100000000
>> [ 0.000000] Memory hole size: 0MB
>> [ 0.000000] Zone ranges:
>> [ 0.000000] DMA [mem 0x0000000000000000-0x00000000ffffffff]
>> [ 0.000000] DMA32 empty
>> [ 0.000000] Normal empty
>> [ 0.000000] Movable zone start for each node
>> [ 0.000000] Early memory node ranges
>> [ 0.000000] node 0: [mem 0x0000000000000000-0x00000000ffffffff]
>> [ 0.000000] Initmem setup node 0 [mem 0x0000000000000000-0x00000000ffffffff]
>> [ 0.000000] On node 0 totalpages: 65536
>> [ 0.000000] DMA zone: 64 pages used for memmap
>> [ 0.000000] DMA zone: 0 pages reserved
>> [ 0.000000] DMA zone: 65536 pages, LIFO batch:1
>> [ 0.000000] percpu: Embedded 4 pages/cpu @c0000000ffb00000 s167064 r0 d95080 u262144
>> [ 0.000000] pcpu-alloc: s167064 r0 d95080 u262144 alloc=1*1048576
>> [ 0.000000] pcpu-alloc: [0] 00 01 02 03 [0] 04 05 06 07
>> [ 0.000000] pcpu-alloc: [0] 08 09 10 11 [0] 12 13 14 15
>> [ 0.000000] Built 1 zonelists, mobility grouping on. Total pages: 65472
>> [ 0.000000] Policy zone: DMA
>> [ 0.000000] Kernel command line:
>> [ 0.000000] PID hash table entries: 4096 (order: -1, 32768 bytes)
>> [ 0.000000] Memory: 4163840K/4194304K available (11008K kernel code, 1664K rwdata, 2752K rodata, 1152K init, 1414K bss, 30464K reserved, 0K cma-reserved)
>> [ 0.000000] SLUB: HWalign=128, Order=0-3, MinObjects=0, CPUs=16, Nodes=1
>> [ 0.000000] ftrace: allocating 28124 entries in 11 pages
>> [ 0.000000] Hierarchical RCU implementation.
>> [ 0.000000] RCU event tracing is enabled.
>> [ 0.000000] RCU restricting CPUs from NR_CPUS=2048 to nr_cpu_ids=16.
>> [ 0.000000] RCU: Adjusting geometry for rcu_fanout_leaf=16, nr_cpu_ids=16
>> [ 0.000000] NR_IRQS: 512, nr_irqs: 512, preallocated irqs: 16
>> [ 0.000000] pic: no ISA interrupt controller
>> [ 0.000000] time_init: decrementer frequency = 512.000000 MHz
>> [ 0.000000] time_init: processor frequency = 3425.000000 MHz
>> [ 0.000001] clocksource: timebase: mask: 0xffffffffffffffff max_cycles: 0x761537d007, max_idle_ns: 440795202126 ns
>> [ 0.001138] clocksource: timebase mult[1f40000] shift[24] registered
>> [ 0.001818] clockevent: decrementer mult[83126e98] shift[32] cpu[0]
>> [ 0.002539] Console: colour dummy device 80x25
>> [ 0.003018] console [hvc0] enabled
>> [ 0.003018] console [hvc0] enabled
>> [ 0.003411] bootconsole [udbg0] disabled
>> [ 0.003411] bootconsole [udbg0] disabled
>> [ 0.003875] pid_max: default: 32768 minimum: 301
>> [ 0.004217] Dentry cache hash table entries: 524288 (order: 6, 4194304 bytes)
>> [ 0.004394] Inode-cache hash table entries: 262144 (order: 5, 2097152 bytes)
>> [ 0.004461] Mount-cache hash table entries: 8192 (order: 0, 65536 bytes)
>> [ 0.004514] Mountpoint-cache hash table entries: 8192 (order: 0, 65536 bytes)
>> [ 0.006022] EEH: pSeries platform initialized
>> [ 0.006102] POWER8 performance monitor hardware support registered
>> [ 0.006156] power8-pmu: PMAO restore workaround active.
>> [ 0.006211] Hierarchical SRCU implementation.
>> [ 0.006394] smp: Bringing up secondary CPUs ...
>> [ 0.020141] smp: Brought up 1 node, 16 CPUs
>> [ 0.020514] numa: Node 0 CPUs: 0-15
>> [ 0.020685] Using standard scheduler topology
>> [ 0.024234] devtmpfs: initialized
>> [ 0.024965] random: get_random_u32 called from bucket_table_alloc+0x144/0x360 with crng_init=0
>> [ 0.028242] clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 19112604462750000 ns
>> [ 0.029834] futex hash table entries: 4096 (order: 3, 524288 bytes)
>> [ 0.030024] kworker/u32:0 (106) used greatest stack depth: 12272 bytes left
>> [ 0.032033] NET: Registered protocol family 16
>> [ 0.032563] EEH: No capable adapters found
>> [ 0.034455] cpuidle: using governor menu
>> [ 0.036083] random: fast init done
>> [ 0.042279] RTAS daemon started
>> [ 0.042915] pstore: using zlib compression
>> [ 0.043109] pstore: Registered nvram as persistent store backend
>> Linux ppc64le
>> #1 SMP Sun Dec 3[ 0.045751] rtas_msi: Registering RTAS MSI callbacks.
>> [ 0.058501] PCI: Probing PCI hardware
>> [ 0.058823] no ibm,pcie-link-speed-stats property
>> [ 0.059114] PCI host bridge to bus 0000:00
>> [ 0.059378] pci_bus 0000:00: root bus resource [io 0x10000-0x1ffff] (bus address [0x0000-0xffff])
>> [ 0.059880] pci_bus 0000:00: root bus resource [mem 0x100a0000000-0x1101fffffff] (bus address [0x80000000-0xfffffffff])
>> [ 0.060473] pci_bus 0000:00: root bus resource [bus 00-ff]
>> [ 0.060686] pci_dma_bus_setup_pSeriesLP: setting up bus /pci@800000020000000
>> [ 0.061048] parent is /pci@800000020000000, iommu_table: 0x (null)
>> [ 0.065074] IOMMU table initialized, virtual merging enabled
>> [ 0.065428] created table: c0000000fe201000
>> [ 0.065681] PCI: Probing PCI hardware done
>> [ 0.086830] vgaarb: loaded
>> [ 0.087716] SCSI subsystem initialized
>> [ 0.088766] libata version 3.00 loaded.
>> [ 0.090210] usbcore: registered new interface driver usbfs
>> [ 0.090675] usbcore: registered new interface driver hub
>> [ 0.091411] usbcore: registered new device driver usb
>> [ 0.092023] pps_core: LinuxPPS API ver. 1 registered
>> [ 0.092418] pps_core: Software ver. 5.3.6 - Copyright 2005-2007 Rodolfo Giometti <giometti@linux.it>
>> [ 0.093119] PTP clock support registered
>> [ 0.094681] clocksource: Switched to clocksource timebase
>> [ 0.106055] hugetlbfs: disabling because there are no supported hugepage sizes
>> [ 0.111204] NET: Registered protocol family 2
>> [ 0.112104] TCP established hash table entries: 32768 (order: 2, 262144 bytes)
>> [ 0.112810] TCP bind hash table entries: 32768 (order: 3, 524288 bytes)
>> [ 0.113369] TCP: Hash tables configured (established 32768 bind 32768)
>> [ 0.113993] UDP hash table entries: 2048 (order: 0, 65536 bytes)
>> [ 0.114583] UDP-Lite hash table entries: 2048 (order: 0, 65536 bytes)
>> [ 0.115133] NET: Registered protocol family 1
>> [ 0.115852] RPC: Registered named UNIX socket transport module.
>> [ 0.116376] RPC: Registered udp transport module.
>> [ 0.116779] RPC: Registered tcp transport module.
>> [ 0.117176] RPC: Registered tcp NFSv4.1 backchannel transport module.
>> [ 0.117735] PCI: CLS 0 bytes, default 128
>> [ 0.118123] Trying to unpack rootfs image as initramfs...
>> [ 0.145121] Freeing initrd memory: 1792K
>> [ 0.151187] audit: initializing netlink subsys (disabled)
>> [ 0.152291] audit: type=2000 audit(1512304166.130:1): state=initialized audit_enabled=0 res=1
>> [ 0.153746] workingset: timestamp_bits=38 max_order=16 bucket_order=0
>> [ 0.161309] NFS: Registering the id_resolver key type
>> [ 0.161796] Key type id_resolver registered
>> [ 0.162029] Key type id_legacy registered
>> [ 0.162826] Block layer SCSI generic (bsg) driver version 0.4 loaded (major 250)
>> [ 0.163638] io scheduler noop registered
>> [ 0.164114] io scheduler deadline registered
>> [ 0.164758] io scheduler cfq registered (default)
>> [ 0.165354] io scheduler mq-deadline registered
>> [ 0.165713] io scheduler kyber registered
>> [ 0.166959] atomic64_test: passed
>> [ 0.197910] __vio_register_driver: driver hvc_console registering
>> [ 0.199239] Serial: 8250/16550 driver, 4 ports, IRQ sharing disabled
>> [ 0.203789] brd: module loaded
>> [ 0.209646] loop: module loaded
>> [ 0.209921] ipr: IBM Power RAID SCSI Device Driver version: 2.6.4 (March 14, 2017)
>> [ 0.210454] __vio_register_driver: driver ibmvscsi registering
>> [ 0.214828] ibmvscsi 71000003: SRP_VERSION: 16.a
>> [ 0.215752] ibmvscsi 71000003: Maximum ID: 64 Maximum LUN: 32 Maximum Channel: 3
>> [ 0.216463] scsi host0: IBM POWER Virtual SCSI Adapter 1.5.9
>> [ 0.217445] ibmvscsi 71000003: partner initialization complete
>> [ 0.217950] ibmvscsi 71000003: host srp version: 16.a, host partition qemu (0), OS 2, max io 2097152
>> [ 0.218617] ibmvscsi 71000003: sent SRP login
>> [ 0.218902] ibmvscsi 71000003: SRP_LOGIN succeeded
>> [ 0.257469] scsi 0:0:2:0: CD-ROM QEMU QEMU CD-ROM 2.5+ PQ: 0 ANSI: 5
>> [ 0.448382] sr 0:0:2:0: [sr0] scsi3-mmc drive: 16x/50x cd/rw xa/form2 cdda tray
>> [ 0.448992] cdrom: Uniform CD-ROM driver Revision: 3.20
>> [ 0.449673] sr 0:0:2:0: Attached scsi CD-ROM sr0
>> [ 0.450738] sr 0:0:2:0: Attached scsi generic sg0 type 5
>> [ 0.451472] libphy: Fixed MDIO Bus: probed
>> [ 0.452068] ibmveth: IBM Power Virtual Ethernet Driver 1.06
>> [ 0.452411] __vio_register_driver: driver ibmveth registering
>> [ 0.453225] e100: Intel(R) PRO/100 Network Driver, 3.5.24-k2-NAPI
>> [ 0.454141] e100: Copyright(c) 1999-2006 Intel Corporation
>> [ 0.454537] e1000: Intel(R) PRO/1000 Network Driver - version 7.3.21-k8-NAPI
>> [ 0.455441] e1000: Copyright (c) 1999-2006 Intel Corporation.
>> [ 0.455920] e1000e: Intel(R) PRO/1000 Network Driver - 3.2.6-k
>> [ 0.456616] e1000e: Copyright(c) 1999 - 2015 Intel Corporation.
>> [ 0.457115] ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver
>> [ 0.457528] ehci-pci: EHCI PCI platform driver
>> [ 0.457917] ohci_hcd: USB 1.1 'Open' Host Controller (OHCI) Driver
>> [ 0.458868] ohci-pci: OHCI PCI platform driver
>> [ 0.459673] rtc-generic rtc-generic: rtc core: registered rtc-generic as rtc0
>> [ 0.460373] i2c /dev entries driver
>> [ 0.460995] IR NEC protocol handler initialized
>> [ 0.461537] IR RC5(x/sz) protocol handler initialized
>> [ 0.461921] IR RC6 protocol handler initialized
>> [ 0.462304] IR JVC protocol handler initialized
>> [ 0.462679] IR Sony protocol handler initialized
>> [ 0.463061] IR SANYO protocol handler initialized
>> [ 0.463427] IR Sharp protocol handler initialized
>> [ 0.463811] IR MCE Keyboard/mouse protocol handler initialized
>> [ 0.464284] IR XMP protocol handler initialized
>> [ 0.464901] device-mapper: uevent: version 1.0.3
>> [ 0.465724] device-mapper: ioctl: 4.36.0-ioctl (2017-06-09) initialised: dm-devel@redhat.com
>> [ 0.466797] pseries_idle_driver registered
>> [ 0.467761] usbcore: registered new interface driver usbhid
>> [ 0.468401] usbhid: USB HID core driver
>> [ 0.469142] ipip: IPv4 and MPLS over IPv4 tunneling driver
>> [ 0.469558] NET: Registered protocol family 17
>> [ 0.470202] Key type dns_resolver registered
>> [ 0.470535] Unable to handle kernel paging request for data at address 0x00000010
>> [ 0.471030] Faulting instruction address: 0xc000000000d92d04
>> [ 0.471440] Oops: Kernel access of bad area, sig: 11 [#1]
>> [ 0.471760] LE SMP NR_CPUS=2048 NUMA pSeries
>> [ 0.472081] Modules linked in:
>> [ 0.472319] CPU: 7 PID: 1 Comm: swapper/0 Not tainted 4.14.0-rc2-gcc6x-g9e1fc7e #1
>> [ 0.472811] task: c0000000fea80000 task.stack: c0000000feb00000
>> [ 0.473215] NIP: c000000000d92d04 LR: c000000000d92cfc CTR: 0000000000000000
>> [ 0.473706] REGS: c0000000feb038d0 TRAP: 0380 Not tainted (4.14.0-rc2-gcc6x-g9e1fc7e)
>> [ 0.474203] MSR: 8000000002009033 <SF,VEC,EE,ME,IR,DR,RI,LE> CR: 84000248 XER: 20000000
>> [ 0.474901] CFAR: c000000000deb200 SOFTE: 1
>> [ 0.474901] GPR00: c000000000d92cfc c0000000feb03b50 c000000000fca600 0000000000000000
>> [ 0.474901] GPR04: c0000000feb03b70 0000000000000000 000000000000002f 0000000000000022
>> [ 0.474901] GPR08: 0000000000000000 c0000000017e35a8 0000000000000000 0000000000000220
>> [ 0.474901] GPR12: 0000000000000000 c00000000fd42680 c00000000000d778 0000000000000000
>> [ 0.474901] GPR16: 0000000000000000 0000000000000000 0000000000000000 0000000000000000
>> [ 0.474901] GPR20: 0000000000000000 0000000000000000 0000000000000000 0000000000000000
>> [ 0.474901] GPR24: 0000000000000000 c000000000d66f60 c000000000d838a4 c000000000dfd918
>> [ 0.474901] GPR28: 0000000000000007 c0000000fffffc30 c0000000feb03bf0 0000000000000010
>> [ 0.479304] NIP [c000000000d92d04] read_drconf_v1_cell+0x50/0x9c
>> [ 0.479705] LR [c000000000d92cfc] read_drconf_v1_cell+0x48/0x9c
>> [ 0.480104] Call Trace:
>> [ 0.480244] [c0000000feb03b50] [c000000000d92cfc] read_drconf_v1_cell+0x48/0x9c (unreliable)
>> [ 0.480907] [c0000000feb03b90] [c000000000d931a4] drmem_init+0x13c/0x2ec
>> [ 0.481352] [c0000000feb03c40] [c00000000000d50c] do_one_initcall+0x6c/0x1d0
>> [ 0.481897] [c0000000feb03d00] [c000000000d84600] kernel_init_freeable+0x27c/0x358
>> [ 0.482428] [c0000000feb03dc0] [c00000000000d79c] kernel_init+0x2c/0x160
>> [ 0.482872] [c0000000feb03e30] [c00000000000bae0] ret_from_kernel_thread+0x5c/0x7c
>> [ 0.483416] Instruction dump:
>> [ 0.483667] 7c7f1b78 60000000 60000000 7c240b78 3d22ffe5 39296414 e95e0000 e8690002
>> [ 0.484216] f9440021 48058495 60000000 e9210020 <f87f0000> 39090004 38e90008 39490010
>> [ 0.484926] ---[ end trace 5aca0f2a87d33521 ]---
>> [ 0.496557]
>> [ 1.496724] Kernel panic - not syncing: Attempted to kill init! exitcode=0x0000000b
>> [ 1.496724]
>> [ 1.505124] Rebooting in 10 seconds..
>>
>>
>> cheers
>>
>
^ permalink raw reply
* [PATCH] DEBUG: shortcut mobility fixup/migration store, and abuse no_rfi_flush
From: Mauricio Faria de Oliveira @ 2018-02-14 21:39 UTC (permalink / raw)
To: linuxppc-dev, mpe
In-Reply-To: <1518644021-17037-1-git-send-email-mauricfo@linux.vnet.ibm.com>
Signed-off-by: Mauricio Faria de Oliveira <mauricfo@linux.vnet.ibm.com>
---
arch/powerpc/kernel/setup_64.c | 8 ++++++++
arch/powerpc/platforms/pseries/mobility.c | 4 ++++
2 files changed, 12 insertions(+)
diff --git a/arch/powerpc/kernel/setup_64.c b/arch/powerpc/kernel/setup_64.c
index d692f71..a05b9f4 100644
--- a/arch/powerpc/kernel/setup_64.c
+++ b/arch/powerpc/kernel/setup_64.c
@@ -892,6 +892,9 @@ static bool init_fallback_flush(void)
void setup_rfi_flush(enum l1d_flush_type types, bool enable)
{
+ if (no_rfi_flush)
+ types = L1D_FLUSH_NONE;
+
if (types & L1D_FLUSH_FALLBACK) {
if (init_fallback_flush())
pr_info("rfi-flush: Using fallback displacement flush\n");
@@ -911,6 +914,11 @@ void setup_rfi_flush(enum l1d_flush_type types, bool enable)
if (!no_rfi_flush)
rfi_flush_enable(enable);
+
+ if (no_rfi_flush) {
+ pr_info("rfi-flush: re-enabled\n");
+ no_rfi_flush = 0;
+ }
}
#ifdef CONFIG_DEBUG_FS
diff --git a/arch/powerpc/platforms/pseries/mobility.c b/arch/powerpc/platforms/pseries/mobility.c
index 8a8033a..201710e 100644
--- a/arch/powerpc/platforms/pseries/mobility.c
+++ b/arch/powerpc/platforms/pseries/mobility.c
@@ -326,6 +326,7 @@ int pseries_devicetree_update(s32 scope)
void post_mobility_fixup(void)
{
+#if 0
int rc;
int activate_fw_token;
@@ -347,6 +348,7 @@ void post_mobility_fixup(void)
if (rc)
printk(KERN_ERR "Post-mobility device tree update "
"failed: %d\n", rc);
+#endif
/* Possibly switch to a new RFI flush type */
pseries_setup_rfi_flush();
@@ -358,6 +360,7 @@ static ssize_t migration_store(struct class *class,
struct class_attribute *attr, const char *buf,
size_t count)
{
+#if 0
u64 streamid;
int rc;
@@ -373,6 +376,7 @@ static ssize_t migration_store(struct class *class,
if (rc)
return rc;
+#endif
post_mobility_fixup();
return count;
--
2.7.4
^ permalink raw reply related
* Re: 4.16-rc1 virtual machine crash on boot
From: Tyrel Datwyler @ 2018-02-14 21:37 UTC (permalink / raw)
To: Cyril Bur, linuxppc-dev@ozlabs.org, Nathan Fontenot,
Michael Ellerman
In-Reply-To: <1518588956.9595.6.camel@gmail.com>
On 02/13/2018 10:15 PM, Cyril Bur wrote:
> On Tue, 2018-02-13 at 21:12 -0800, Tyrel Datwyler wrote:
>> On 02/13/2018 05:20 PM, Cyril Bur wrote:
>>> Hello all,
>>
>> Does reverting commit 02ef6dd8109b581343ebeb1c4c973513682535d6 alleviate the issue?
>>
>
> Hi Tyrel,
>
> No it doesn't. Same backtrace.
What about commit 0c38ed6f6f0b78a404fe46767d21504b37af8705? After a little closer look I think the series that commit enabled is the culprit. Especially, since Michael Ellerman complained of the same crash.
-Tyrel
>>
>>>
>>> I'm seeing this crash trying to boot a KVM virtual machine. This kernel
>>> was compiled with pseries_le_defconfig and run using the following qemu
>>> commandline:
>>>
>>> qemu-system-ppc64 -enable-kvm -cpu POWER8 -smp 4 -m 4G -M pseries
>>> -nographic -vga none -drive file=vm.raw,if=virtio,format=raw -drive
>>> file=mkvmconf2xeO,if=virtio,format=raw -netdev type=user,id=net0
>>> -device virtio-net-pci,netdev=net0 -kernel vmlinux_tscr -append
>>> 'root=/dev/vdb1 rw cloud-init=disabled'
>>>
>>> qemu-system-ppc64 --version
>>> QEMU emulator version 2.5.0 (Debian 1:2.5+dfsg-5ubuntu10.16), Copyright
>>> (c) 2003-2008 Fabrice Bellard
>>>
>>>
>>> Key type dns_resolver registered
>>> Unable to handle kernel paging request for data at address 0x00000010
>>> Faulting instruction address: 0xc0000000018f2bbc
>>> Oops: Kernel access of bad area, sig: 11 [#1]
>>> LE SMP NR_CPUS=2048 NUMA pSeries
>>> CPU: 1 PID: 1 Comm: swapper/0 Not tainted 4.16.0-rc1v4.16-rc1 #8
>>> NIP: c0000000018f2bbc LR: c0000000018f2bb4 CTR: 0000000000000000
>>> REGS: c0000000fea838d0 TRAP: 0380 Not tainted (4.16.0-rc1v4.16-rc1)
>>> MSR: 8000000002009033 <SF,VEC,EE,ME,IR,DR,RI,LE> CR: 84000248 XER:
>>> 20000000
>>> CFAR: c0000000019591a0 SOFTE: 0
>>> GPR00: c0000000018f2bb4 c0000000fea83b50 c000000001bd8400
>>> 0000000000000000
>>> GPR04: c0000000fea83b70 0000000000000000 000000000000002f
>>> 0000000000000022
>>> GPR08: 0000000000000000 c0000000022a3e90 0000000000000000
>>> 0000000000000220
>>> GPR12: 0000000000000000 c00000000fb40980 c00000000000d698
>>> 0000000000000000
>>> GPR16: 0000000000000000 0000000000000000 0000000000000000
>>> 0000000000000000
>>> GPR20: 0000000000000000 0000000000000000 0000000000000000
>>> 0000000000000000
>>> GPR24: 0000000000000000 c0000000018b9248 c0000000018e36d8
>>> c0000000019738a8
>>> GPR28: 0000000000000007 c0000000fffffc68 c0000000fea83bf0
>>> 0000000000000010
>>> NIP [c0000000018f2bbc] read_drconf_v1_cell+0x50/0x9c
>>> LR [c0000000018f2bb4] read_drconf_v1_cell+0x48/0x9c
>>> Call Trace:
>>> [c0000000fea83b50] [c0000000018f2bb4] read_drconf_v1_cell+0x48/0x9c
>>> (unreliable)
>>> [c0000000fea83b90] [c0000000018f305c] drmem_init+0x13c/0x2ec
>>> [c0000000fea83c40] [c0000000018e4288] do_one_initcall+0xdc/0x1ac
>>> [c0000000fea83d00] [c0000000018e45d4] kernel_init_freeable+0x27c/0x358
>>> [c0000000fea83dc0] [c00000000000d6bc] kernel_init+0x2c/0x160
>>> [c0000000fea83e30] [c00000000000bc20] ret_from_kernel_thread+0x5c/0xbc
>>> Instruction dump:
>>> 7c7f1b78 60000000 60000000 7c240b78 3d22ffdc 3929f0a4 e95e0000
>>> e8690002
>>> f9440021 4806657d 60000000 e9210020 <f87f0000> 39090004 39490010
>>> f9010020
>>> ---[ end trace bd9f49f482d30e03 ]---
>>>
>>> Kernel panic - not syncing: Attempted to kill init! exitcode=0x0000000b
>>>
>>> WARNING: CPU: 1 PID: 1 at drivers/tty/vt/vt.c:3883
>>> do_unblank_screen+0x1f0/0x270
>>> CPU: 1 PID: 1 Comm: swapper/0 Tainted: G D 4.16.0-
>>> rc1v4.16-rc1 #8
>>> NIP: c0000000009aa800 LR: c0000000009aa63c CTR: c00000000148f5f0
>>> REGS: c0000000fea832c0 TRAP: 0700 Tainted:
>>> G D (4.16.0-rc1v4.16-rc1)
>>> MSR: 8000000002029033 <SF,VEC,EE,ME,IR,DR,RI,LE> CR: 28002222 XER:
>>> 20000000
>>> CFAR: c0000000009aa658 SOFTE: 1
>>> GPR00: c0000000009aa63c c0000000fea83540 c000000001bd8400
>>> 0000000000000000
>>> GPR04: 0000000000000001 c0000000fb0c200e 0000000000001dd7
>>> c0000000fea834d0
>>> GPR08: 00000000fe430000 0000000000000000 0000000000000000
>>> 0000000000000001
>>> GPR12: 0000000028002428 c00000000fb40980 c00000000000d698
>>> 0000000000000000
>>> GPR16: 0000000000000000 0000000000000000 0000000000000000
>>> 0000000000000000
>>> GPR20: 0000000000000000 0000000000000000 0000000000000000
>>> 0000000000000000
>>> GPR24: c0000000fea40000 c0000000feadf910 c000000001a4a7a8
>>> c000000001cc4ea0
>>> GPR28: c00000000173f4f0 c000000001cc4ec8 0000000000000000
>>> 0000000000000000
>>> NIP [c0000000009aa800] do_unblank_screen+0x1f0/0x270
>>> LR [c0000000009aa63c] do_unblank_screen+0x2c/0x270
>>> Call Trace:
>>> [c0000000fea83540] [c0000000009aa63c] do_unblank_screen+0x2c/0x270
>>> (unreliable)
>>> [c0000000fea835b0] [c0000000008a2a70] bust_spinlocks+0x40/0x80
>>> [c0000000fea835d0] [c0000000000da90c] panic+0x1b8/0x32c
>>> [c0000000fea83670] [c0000000000e1bd4] do_exit+0xcb4/0xcc0
>>> [c0000000fea83730] [c0000000000275fc] die+0x29c/0x450
>>> [c0000000fea837c0] [c000000000053f88] bad_page_fault+0xe8/0x160
>>> [c0000000fea83830] [c000000000028a90] slb_miss_bad_addr+0x40/0x90
>>> [c0000000fea83860] [c000000000008b08] bad_addr_slb+0x158/0x160
>>> --- interrupt: 380 at read_drconf_v1_cell+0x50/0x9c
>>> LR = read_drconf_v1_cell+0x48/0x9c
>>> [c0000000fea83b90] [c0000000018f305c] drmem_init+0x13c/0x2ec
>>> [c0000000fea83c40] [c0000000018e4288] do_one_initcall+0xdc/0x1ac
>>> [c0000000fea83d00] [c0000000018e45d4] kernel_init_freeable+0x27c/0x358
>>> [c0000000fea83dc0] [c00000000000d6bc] kernel_init+0x2c/0x160
>>> [c0000000fea83e30] [c00000000000bc20] ret_from_kernel_thread+0x5c/0xbc
>>> Instruction dump:
>>> 3c62ffbf 38840001 7c8407b4 38639ca8 4b7ae0ed 60000000 38210070
>>> e8010010
>>> ebc1fff0 ebe1fff8 7c0803a6 4e800020 <0fe00000> 4bfffe58 60000000
>>> 60420000
>>> ---[ end trace bd9f49f482d30e04 ]---
>>> Rebooting in 10 seconds..
>>>
>>
>>
>
^ permalink raw reply
* [PATCH 3/3] rfi-flush: Call setup_rfi_flush() after LPM migration
From: Mauricio Faria de Oliveira @ 2018-02-14 21:33 UTC (permalink / raw)
To: linuxppc-dev, mpe
In-Reply-To: <1518644021-17037-1-git-send-email-mauricfo@linux.vnet.ibm.com>
From: Michael Ellerman <mpe@ellerman.id.au>
We might have migrated to a machine that uses a different flush type,
or doesn't need flushing at all.
If we migrate to a machine with no flush support, ie. that would use
fallback, we just print an error and switch flushing off. We could
support that, but it would complicate the implementation of the
fallback flush, and we don't expect anyone will ever do it.
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Signed-off-by: Mauricio Faria de Oliveira <mauricfo@linux.vnet.ibm.com>
---
arch/powerpc/platforms/pseries/mobility.c | 3 +++
arch/powerpc/platforms/pseries/pseries.h | 2 ++
arch/powerpc/platforms/pseries/setup.c | 2 +-
3 files changed, 6 insertions(+), 1 deletion(-)
diff --git a/arch/powerpc/platforms/pseries/mobility.c b/arch/powerpc/platforms/pseries/mobility.c
index 0f7fb71..8a8033a 100644
--- a/arch/powerpc/platforms/pseries/mobility.c
+++ b/arch/powerpc/platforms/pseries/mobility.c
@@ -348,6 +348,9 @@ void post_mobility_fixup(void)
printk(KERN_ERR "Post-mobility device tree update "
"failed: %d\n", rc);
+ /* Possibly switch to a new RFI flush type */
+ pseries_setup_rfi_flush();
+
return;
}
diff --git a/arch/powerpc/platforms/pseries/pseries.h b/arch/powerpc/platforms/pseries/pseries.h
index 1ae1d9f..27cdcb6 100644
--- a/arch/powerpc/platforms/pseries/pseries.h
+++ b/arch/powerpc/platforms/pseries/pseries.h
@@ -100,4 +100,6 @@ static inline unsigned long cmo_get_page_size(void)
int dlpar_workqueue_init(void);
+void pseries_setup_rfi_flush(void);
+
#endif /* _PSERIES_PSERIES_H */
diff --git a/arch/powerpc/platforms/pseries/setup.c b/arch/powerpc/platforms/pseries/setup.c
index 372d7ad..dad8197 100644
--- a/arch/powerpc/platforms/pseries/setup.c
+++ b/arch/powerpc/platforms/pseries/setup.c
@@ -459,7 +459,7 @@ static void __init find_and_init_phbs(void)
of_pci_check_probe_only();
}
-static void pseries_setup_rfi_flush(void)
+void pseries_setup_rfi_flush(void)
{
struct h_cpu_char_result result;
enum l1d_flush_type types;
--
2.7.4
^ permalink raw reply related
* [PATCH 2/3] rfi-flush: Make it possible to call setup_rfi_flush() again
From: Mauricio Faria de Oliveira @ 2018-02-14 21:33 UTC (permalink / raw)
To: linuxppc-dev, mpe
In-Reply-To: <1518644021-17037-1-git-send-email-mauricfo@linux.vnet.ibm.com>
From: Michael Ellerman <mpe@ellerman.id.au>
For PowerVM migration we want to be able to call setup_rfi_flush()
again after we've migrated the partition.
To support that we need to check that we're not trying to allocate the
fallback flush area after memblock has gone away. If so we just fail,
we don't support migrating from a patched to an unpatched machine. Or
we do support it, but there will be no RFI flush enabled on the
destination.
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Signed-off-by: Mauricio Faria de Oliveira <mauricfo@linux.vnet.ibm.com>
---
arch/powerpc/include/asm/setup.h | 2 +-
arch/powerpc/kernel/setup_64.c | 25 +++++++++++++++++++++----
2 files changed, 22 insertions(+), 5 deletions(-)
diff --git a/arch/powerpc/include/asm/setup.h b/arch/powerpc/include/asm/setup.h
index 469b7fd..bbcdf929 100644
--- a/arch/powerpc/include/asm/setup.h
+++ b/arch/powerpc/include/asm/setup.h
@@ -49,7 +49,7 @@ enum l1d_flush_type {
L1D_FLUSH_MTTRIG = 0x8,
};
-void __init setup_rfi_flush(enum l1d_flush_type, bool enable);
+void setup_rfi_flush(enum l1d_flush_type, bool enable);
void do_rfi_flush_fixups(enum l1d_flush_type types);
#endif /* !__ASSEMBLY__ */
diff --git a/arch/powerpc/kernel/setup_64.c b/arch/powerpc/kernel/setup_64.c
index 3efc01a..d692f71 100644
--- a/arch/powerpc/kernel/setup_64.c
+++ b/arch/powerpc/kernel/setup_64.c
@@ -855,11 +855,22 @@ void rfi_flush_enable(bool enable)
rfi_flush = enable;
}
-static void init_fallback_flush(void)
+static bool init_fallback_flush(void)
{
u64 l1d_size, limit;
int cpu;
+ if (l1d_flush_fallback_area)
+ return true;
+
+ /*
+ * Once the slab allocator is up it's too late to allocate the fallback
+ * flush area, so return an error. This could happen if we migrated from
+ * a patched machine to an unpatched machine.
+ */
+ if (slab_is_available())
+ return false;
+
l1d_size = ppc64_caches.l1d.size;
limit = min(ppc64_bolted_size(), ppc64_rma_size);
@@ -875,13 +886,19 @@ static void init_fallback_flush(void)
paca[cpu].rfi_flush_fallback_area = l1d_flush_fallback_area;
paca[cpu].l1d_flush_size = l1d_size;
}
+
+ return true;
}
-void __init setup_rfi_flush(enum l1d_flush_type types, bool enable)
+void setup_rfi_flush(enum l1d_flush_type types, bool enable)
{
if (types & L1D_FLUSH_FALLBACK) {
- pr_info("rfi-flush: Using fallback displacement flush\n");
- init_fallback_flush();
+ if (init_fallback_flush())
+ pr_info("rfi-flush: Using fallback displacement flush\n");
+ else {
+ pr_warn("rfi-flush: Error unable to use fallback displacement flush!\n");
+ types &= ~L1D_FLUSH_FALLBACK;
+ }
}
if (types & L1D_FLUSH_ORI)
--
2.7.4
^ permalink raw reply related
* [PATCH 1/3] rfi-flush: Move the logic to avoid a redo into the debugfs code
From: Mauricio Faria de Oliveira @ 2018-02-14 21:33 UTC (permalink / raw)
To: linuxppc-dev, mpe
In-Reply-To: <1518644021-17037-1-git-send-email-mauricfo@linux.vnet.ibm.com>
From: Michael Ellerman <mpe@ellerman.id.au>
rfi_flush_enable() includes a check to see if we're already
enabled (or disabled), and in that case does nothing.
But that means calling setup_rfi_flush() a 2nd time doesn't actually
work, which is a bit confusing.
Move that check into the debugfs code, where it really belongs.
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Signed-off-by: Mauricio Faria de Oliveira <mauricfo@linux.vnet.ibm.com>
---
arch/powerpc/kernel/setup_64.c | 13 ++++++++-----
1 file changed, 8 insertions(+), 5 deletions(-)
diff --git a/arch/powerpc/kernel/setup_64.c b/arch/powerpc/kernel/setup_64.c
index c388cc3..3efc01a 100644
--- a/arch/powerpc/kernel/setup_64.c
+++ b/arch/powerpc/kernel/setup_64.c
@@ -846,9 +846,6 @@ static void do_nothing(void *unused)
void rfi_flush_enable(bool enable)
{
- if (rfi_flush == enable)
- return;
-
if (enable) {
do_rfi_flush_fixups(enabled_flush_types);
on_each_cpu(do_nothing, NULL, 1);
@@ -902,13 +899,19 @@ void __init setup_rfi_flush(enum l1d_flush_type types, bool enable)
#ifdef CONFIG_DEBUG_FS
static int rfi_flush_set(void *data, u64 val)
{
+ bool enable;
+
if (val == 1)
- rfi_flush_enable(true);
+ enable = true;
else if (val == 0)
- rfi_flush_enable(false);
+ enable = false;
else
return -EINVAL;
+ /* Only do anything if we're changing state */
+ if (enable != rfi_flush)
+ rfi_flush_enable(enable);
+
return 0;
}
--
2.7.4
^ permalink raw reply related
* [PATCH 0/3] Setup RFI flush after PowerVM LPM migration
From: Mauricio Faria de Oliveira @ 2018-02-14 21:33 UTC (permalink / raw)
To: linuxppc-dev, mpe
This patchset allows for setup_rfi_flush() to be called again
after PowerVM LPM (live partition mobility) aka LPAR migration.
It's originally written by Michael Ellerman; I just rebased it
on top of powerpc/merge as of 2018-02-14 BRST (commit 3f6f556).
I tested it with a debug patch (sending shortly) to shortcut
the LPM functions migration_store() and post_mobility_fixup()
to just reach pseries_setup_rfi_flush(), and abuse the boot
option 'no_rfi_flush' not to allocate the fallback flush area
at boot (to simulate the migration from patched to unpatched
system).
Testing:
-------
Fallback flush area allocated at boot time:
# dmesg | grep rfi-flush
[ 0.000000] rfi-flush: Using fallback displacement flush
[ 0.000000] rfi-flush: patched 8 locations
# echo > /sys/kernel/mobility/migration
# dmesg | grep rfi-flush
[ 0.000000] rfi-flush: Using fallback displacement flush
[ 0.000000] rfi-flush: patched 8 locations
[ 51.793238] rfi-flush: Using fallback displacement flush
[ 51.793258] rfi-flush: patched 8 locations
Fallback flush area NOT allocated at boot time:
# grep -o no_rfi_flush /proc/cmdline
no_rfi_flush
# dmesg | grep rfi-flush
[ 0.000000] rfi-flush: disabled on command line.
[ 0.000000] rfi-flush: re-enabled
# echo > /sys/kernel/mobility/migration
# dmesg | grep rfi-flush
[ 0.000000] rfi-flush: disabled on command line.
[ 0.000000] rfi-flush: re-enabled
[ 31.817921] rfi-flush: Error unable to use fallback displacement flush!
[ 31.817927] rfi-flush: patched 8 locations
Michael Ellerman (3):
rfi-flush: Move the logic to avoid a redo into the debugfs code
rfi-flush: Make it possible to call setup_rfi_flush() again
rfi-flush: Call setup_rfi_flush() after LPM migration
arch/powerpc/include/asm/setup.h | 2 +-
arch/powerpc/kernel/setup_64.c | 38 +++++++++++++++++++++++--------
arch/powerpc/platforms/pseries/mobility.c | 3 +++
arch/powerpc/platforms/pseries/pseries.h | 2 ++
arch/powerpc/platforms/pseries/setup.c | 2 +-
5 files changed, 36 insertions(+), 11 deletions(-)
--
2.7.4
^ permalink raw reply
* Re: [PATCH V3 0/9] powerpc: Support for ibm,dynamic-memory-v2
From: Tyrel Datwyler @ 2018-02-14 21:30 UTC (permalink / raw)
To: Michael Ellerman, Nathan Fontenot, linuxppc-dev; +Cc: Cyril Bur
In-Reply-To: <87a7yz3wjo.fsf@concordia.ellerman.id.au>
On 12/03/2017 09:13 PM, Michael Ellerman wrote:
> Nathan Fontenot <nfont@linux.vnet.ibm.com> writes:
>
>> This patch set provides a series of updates to de-couple the LMB
>> information provided in the device tree property from the device
>> tree property format. This eases the ability to support a new
>> format for the dynamic memory property, ibm,dynamic-memory-v2.
>
> Something in here is still blowing up for me in a KVM guest:
So, it looks like this series was applied despite observing this KVM guest crash. Cyril posted yesterday to the list about hitting this same issue with 4.16-rc1.
-Tyrel
>
> OF stdout device is: /vdevice/vty@71000000
> Preparing to boot Linux version 4.14.0-rc2-gcc6x-g9e1fc7e (kerkins@alpine1-p1) (gcc version 6.4.1 20171202 (Custom 6328ca9eaa476138)) #1 SMP Sun Dec 3 21:45:32 AEDT 2017
> Detected machine type: 0000000000000101
> command line:
> Max number of cores passed to firmware: 256 (NR_CPUS = 2048)
> Calling ibm,client-architecture-support... done
> memory layout at init:
> memory_limit : 0000000000000000 (16 MB aligned)
> alloc_bottom : 00000000015c0000
> alloc_top : 0000000030000000
> alloc_top_hi : 0000000100000000
> rmo_top : 0000000030000000
> ram_top : 0000000100000000
> instantiating rtas at 0x000000002fff0000... done
> prom_hold_cpus: skipped
> copying OF device tree...
> Building dt strings...
> Building dt structure...
> Device tree strings 0x00000000017d0000 -> 0x00000000017d09d8
> Device tree struct 0x00000000017e0000 -> 0x00000000017f0000
> Quiescing Open Firmware ...
> Booting Linux via __start() @ 0x0000000000400000 ...
> [ 0.000000] bootconsole [udbg0] enabled
> [ 0.000000] Allocated 2883584 bytes for 2048 pacas at c00000000fd40000
> [ 0.000000] hash-mmu: Page sizes from device-tree:
> [ 0.000000] hash-mmu: base_shift=12: shift=12, sllp=0x0000, avpnm=0x00000000, tlbiel=1, penc=0
> [ 0.000000] hash-mmu: base_shift=16: shift=16, sllp=0x0110, avpnm=0x00000000, tlbiel=1, penc=1
> [ 0.000000] -> fw_vec5_feature_init()
> [ 0.000000] <- fw_vec5_feature_init()
> [ 0.000000] -> fw_hypertas_feature_init()
> [ 0.000000] <- fw_hypertas_feature_init()
> [ 0.000000] Page orders: linear mapping = 16, virtual = 16, io = 16, vmemmap = 16
> [ 0.000000] Using 1TB segments
> [ 0.000000] hash-mmu: Initializing hash mmu with SLB
> [ 0.000000] Linux version 4.14.0-rc2-gcc6x-g9e1fc7e (kerkins@alpine1-p1) (gcc version 6.4.1 20171202 (Custom 6328ca9eaa476138)) #1 SMP Sun Dec 3 21:45:32 AEDT 2017
> [ 0.000000] Found initrd at 0xc0000000015c0000:0xc00000000178d70b
> [ 0.000000] Machine is LPAR !
> [ 0.000000] -> pseries_init()
> [ 0.000000] -> fw_cmo_feature_init()
> [ 0.000000] CMO not available
> [ 0.000000] <- fw_cmo_feature_init()
> [ 0.000000] <- pseries_init()
> [ 0.000000] Using pSeries machine description
> [ 0.000000] Partition configured for 16 cpus.
> [ 0.000000] CPU maps initialized for 8 threads per core
> [ 0.000000] (thread shift is 3)
> [ 0.000000] Freed 2818048 bytes for unused pacas
> [ 0.000000] -----------------------------------------------------
> [ 0.000000] ppc64_pft_size = 0x19
> [ 0.000000] phys_mem_size = 0x100000000
> [ 0.000000] dcache_bsize = 0x80
> [ 0.000000] icache_bsize = 0x80
> [ 0.000000] cpu_features = 0x17dc7aec18500249
> [ 0.000000] possible = 0xdfdfffff18500649
> [ 0.000000] always = 0x0000000018100040
> [ 0.000000] cpu_user_features = 0xdc0065c2 0xef000000
> [ 0.000000] mmu_features = 0x78006001
> [ 0.000000] firmware_features = 0x00000001405a440b
> [ 0.000000] htab_hash_mask = 0x3ffff
> [ 0.000000] -----------------------------------------------------
> [ 0.000000] numa: NODE_DATA [mem 0xfff6a300-0xfff73fff]
> [ 0.000000] -> smp_init_pSeries()
> [ 0.000000] <- smp_init_pSeries()
> [ 0.000000] PCI host bridge /pci@800000020000000 ranges:
> [ 0.000000] IO 0x0000010080000000..0x000001008000ffff -> 0x0000000000000000
> [ 0.000000] MEM 0x00000100a0000000..0x000001101fffffff -> 0x0000000080000000
> [ 0.000000] PPC64 nvram contains 65536 bytes
> [ 0.000000] Top of RAM: 0x100000000, Total RAM: 0x100000000
> [ 0.000000] Memory hole size: 0MB
> [ 0.000000] Zone ranges:
> [ 0.000000] DMA [mem 0x0000000000000000-0x00000000ffffffff]
> [ 0.000000] DMA32 empty
> [ 0.000000] Normal empty
> [ 0.000000] Movable zone start for each node
> [ 0.000000] Early memory node ranges
> [ 0.000000] node 0: [mem 0x0000000000000000-0x00000000ffffffff]
> [ 0.000000] Initmem setup node 0 [mem 0x0000000000000000-0x00000000ffffffff]
> [ 0.000000] On node 0 totalpages: 65536
> [ 0.000000] DMA zone: 64 pages used for memmap
> [ 0.000000] DMA zone: 0 pages reserved
> [ 0.000000] DMA zone: 65536 pages, LIFO batch:1
> [ 0.000000] percpu: Embedded 4 pages/cpu @c0000000ffb00000 s167064 r0 d95080 u262144
> [ 0.000000] pcpu-alloc: s167064 r0 d95080 u262144 alloc=1*1048576
> [ 0.000000] pcpu-alloc: [0] 00 01 02 03 [0] 04 05 06 07
> [ 0.000000] pcpu-alloc: [0] 08 09 10 11 [0] 12 13 14 15
> [ 0.000000] Built 1 zonelists, mobility grouping on. Total pages: 65472
> [ 0.000000] Policy zone: DMA
> [ 0.000000] Kernel command line:
> [ 0.000000] PID hash table entries: 4096 (order: -1, 32768 bytes)
> [ 0.000000] Memory: 4163840K/4194304K available (11008K kernel code, 1664K rwdata, 2752K rodata, 1152K init, 1414K bss, 30464K reserved, 0K cma-reserved)
> [ 0.000000] SLUB: HWalign=128, Order=0-3, MinObjects=0, CPUs=16, Nodes=1
> [ 0.000000] ftrace: allocating 28124 entries in 11 pages
> [ 0.000000] Hierarchical RCU implementation.
> [ 0.000000] RCU event tracing is enabled.
> [ 0.000000] RCU restricting CPUs from NR_CPUS=2048 to nr_cpu_ids=16.
> [ 0.000000] RCU: Adjusting geometry for rcu_fanout_leaf=16, nr_cpu_ids=16
> [ 0.000000] NR_IRQS: 512, nr_irqs: 512, preallocated irqs: 16
> [ 0.000000] pic: no ISA interrupt controller
> [ 0.000000] time_init: decrementer frequency = 512.000000 MHz
> [ 0.000000] time_init: processor frequency = 3425.000000 MHz
> [ 0.000001] clocksource: timebase: mask: 0xffffffffffffffff max_cycles: 0x761537d007, max_idle_ns: 440795202126 ns
> [ 0.001138] clocksource: timebase mult[1f40000] shift[24] registered
> [ 0.001818] clockevent: decrementer mult[83126e98] shift[32] cpu[0]
> [ 0.002539] Console: colour dummy device 80x25
> [ 0.003018] console [hvc0] enabled
> [ 0.003018] console [hvc0] enabled
> [ 0.003411] bootconsole [udbg0] disabled
> [ 0.003411] bootconsole [udbg0] disabled
> [ 0.003875] pid_max: default: 32768 minimum: 301
> [ 0.004217] Dentry cache hash table entries: 524288 (order: 6, 4194304 bytes)
> [ 0.004394] Inode-cache hash table entries: 262144 (order: 5, 2097152 bytes)
> [ 0.004461] Mount-cache hash table entries: 8192 (order: 0, 65536 bytes)
> [ 0.004514] Mountpoint-cache hash table entries: 8192 (order: 0, 65536 bytes)
> [ 0.006022] EEH: pSeries platform initialized
> [ 0.006102] POWER8 performance monitor hardware support registered
> [ 0.006156] power8-pmu: PMAO restore workaround active.
> [ 0.006211] Hierarchical SRCU implementation.
> [ 0.006394] smp: Bringing up secondary CPUs ...
> [ 0.020141] smp: Brought up 1 node, 16 CPUs
> [ 0.020514] numa: Node 0 CPUs: 0-15
> [ 0.020685] Using standard scheduler topology
> [ 0.024234] devtmpfs: initialized
> [ 0.024965] random: get_random_u32 called from bucket_table_alloc+0x144/0x360 with crng_init=0
> [ 0.028242] clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 19112604462750000 ns
> [ 0.029834] futex hash table entries: 4096 (order: 3, 524288 bytes)
> [ 0.030024] kworker/u32:0 (106) used greatest stack depth: 12272 bytes left
> [ 0.032033] NET: Registered protocol family 16
> [ 0.032563] EEH: No capable adapters found
> [ 0.034455] cpuidle: using governor menu
> [ 0.036083] random: fast init done
> [ 0.042279] RTAS daemon started
> [ 0.042915] pstore: using zlib compression
> [ 0.043109] pstore: Registered nvram as persistent store backend
> Linux ppc64le
> #1 SMP Sun Dec 3[ 0.045751] rtas_msi: Registering RTAS MSI callbacks.
> [ 0.058501] PCI: Probing PCI hardware
> [ 0.058823] no ibm,pcie-link-speed-stats property
> [ 0.059114] PCI host bridge to bus 0000:00
> [ 0.059378] pci_bus 0000:00: root bus resource [io 0x10000-0x1ffff] (bus address [0x0000-0xffff])
> [ 0.059880] pci_bus 0000:00: root bus resource [mem 0x100a0000000-0x1101fffffff] (bus address [0x80000000-0xfffffffff])
> [ 0.060473] pci_bus 0000:00: root bus resource [bus 00-ff]
> [ 0.060686] pci_dma_bus_setup_pSeriesLP: setting up bus /pci@800000020000000
> [ 0.061048] parent is /pci@800000020000000, iommu_table: 0x (null)
> [ 0.065074] IOMMU table initialized, virtual merging enabled
> [ 0.065428] created table: c0000000fe201000
> [ 0.065681] PCI: Probing PCI hardware done
> [ 0.086830] vgaarb: loaded
> [ 0.087716] SCSI subsystem initialized
> [ 0.088766] libata version 3.00 loaded.
> [ 0.090210] usbcore: registered new interface driver usbfs
> [ 0.090675] usbcore: registered new interface driver hub
> [ 0.091411] usbcore: registered new device driver usb
> [ 0.092023] pps_core: LinuxPPS API ver. 1 registered
> [ 0.092418] pps_core: Software ver. 5.3.6 - Copyright 2005-2007 Rodolfo Giometti <giometti@linux.it>
> [ 0.093119] PTP clock support registered
> [ 0.094681] clocksource: Switched to clocksource timebase
> [ 0.106055] hugetlbfs: disabling because there are no supported hugepage sizes
> [ 0.111204] NET: Registered protocol family 2
> [ 0.112104] TCP established hash table entries: 32768 (order: 2, 262144 bytes)
> [ 0.112810] TCP bind hash table entries: 32768 (order: 3, 524288 bytes)
> [ 0.113369] TCP: Hash tables configured (established 32768 bind 32768)
> [ 0.113993] UDP hash table entries: 2048 (order: 0, 65536 bytes)
> [ 0.114583] UDP-Lite hash table entries: 2048 (order: 0, 65536 bytes)
> [ 0.115133] NET: Registered protocol family 1
> [ 0.115852] RPC: Registered named UNIX socket transport module.
> [ 0.116376] RPC: Registered udp transport module.
> [ 0.116779] RPC: Registered tcp transport module.
> [ 0.117176] RPC: Registered tcp NFSv4.1 backchannel transport module.
> [ 0.117735] PCI: CLS 0 bytes, default 128
> [ 0.118123] Trying to unpack rootfs image as initramfs...
> [ 0.145121] Freeing initrd memory: 1792K
> [ 0.151187] audit: initializing netlink subsys (disabled)
> [ 0.152291] audit: type=2000 audit(1512304166.130:1): state=initialized audit_enabled=0 res=1
> [ 0.153746] workingset: timestamp_bits=38 max_order=16 bucket_order=0
> [ 0.161309] NFS: Registering the id_resolver key type
> [ 0.161796] Key type id_resolver registered
> [ 0.162029] Key type id_legacy registered
> [ 0.162826] Block layer SCSI generic (bsg) driver version 0.4 loaded (major 250)
> [ 0.163638] io scheduler noop registered
> [ 0.164114] io scheduler deadline registered
> [ 0.164758] io scheduler cfq registered (default)
> [ 0.165354] io scheduler mq-deadline registered
> [ 0.165713] io scheduler kyber registered
> [ 0.166959] atomic64_test: passed
> [ 0.197910] __vio_register_driver: driver hvc_console registering
> [ 0.199239] Serial: 8250/16550 driver, 4 ports, IRQ sharing disabled
> [ 0.203789] brd: module loaded
> [ 0.209646] loop: module loaded
> [ 0.209921] ipr: IBM Power RAID SCSI Device Driver version: 2.6.4 (March 14, 2017)
> [ 0.210454] __vio_register_driver: driver ibmvscsi registering
> [ 0.214828] ibmvscsi 71000003: SRP_VERSION: 16.a
> [ 0.215752] ibmvscsi 71000003: Maximum ID: 64 Maximum LUN: 32 Maximum Channel: 3
> [ 0.216463] scsi host0: IBM POWER Virtual SCSI Adapter 1.5.9
> [ 0.217445] ibmvscsi 71000003: partner initialization complete
> [ 0.217950] ibmvscsi 71000003: host srp version: 16.a, host partition qemu (0), OS 2, max io 2097152
> [ 0.218617] ibmvscsi 71000003: sent SRP login
> [ 0.218902] ibmvscsi 71000003: SRP_LOGIN succeeded
> [ 0.257469] scsi 0:0:2:0: CD-ROM QEMU QEMU CD-ROM 2.5+ PQ: 0 ANSI: 5
> [ 0.448382] sr 0:0:2:0: [sr0] scsi3-mmc drive: 16x/50x cd/rw xa/form2 cdda tray
> [ 0.448992] cdrom: Uniform CD-ROM driver Revision: 3.20
> [ 0.449673] sr 0:0:2:0: Attached scsi CD-ROM sr0
> [ 0.450738] sr 0:0:2:0: Attached scsi generic sg0 type 5
> [ 0.451472] libphy: Fixed MDIO Bus: probed
> [ 0.452068] ibmveth: IBM Power Virtual Ethernet Driver 1.06
> [ 0.452411] __vio_register_driver: driver ibmveth registering
> [ 0.453225] e100: Intel(R) PRO/100 Network Driver, 3.5.24-k2-NAPI
> [ 0.454141] e100: Copyright(c) 1999-2006 Intel Corporation
> [ 0.454537] e1000: Intel(R) PRO/1000 Network Driver - version 7.3.21-k8-NAPI
> [ 0.455441] e1000: Copyright (c) 1999-2006 Intel Corporation.
> [ 0.455920] e1000e: Intel(R) PRO/1000 Network Driver - 3.2.6-k
> [ 0.456616] e1000e: Copyright(c) 1999 - 2015 Intel Corporation.
> [ 0.457115] ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver
> [ 0.457528] ehci-pci: EHCI PCI platform driver
> [ 0.457917] ohci_hcd: USB 1.1 'Open' Host Controller (OHCI) Driver
> [ 0.458868] ohci-pci: OHCI PCI platform driver
> [ 0.459673] rtc-generic rtc-generic: rtc core: registered rtc-generic as rtc0
> [ 0.460373] i2c /dev entries driver
> [ 0.460995] IR NEC protocol handler initialized
> [ 0.461537] IR RC5(x/sz) protocol handler initialized
> [ 0.461921] IR RC6 protocol handler initialized
> [ 0.462304] IR JVC protocol handler initialized
> [ 0.462679] IR Sony protocol handler initialized
> [ 0.463061] IR SANYO protocol handler initialized
> [ 0.463427] IR Sharp protocol handler initialized
> [ 0.463811] IR MCE Keyboard/mouse protocol handler initialized
> [ 0.464284] IR XMP protocol handler initialized
> [ 0.464901] device-mapper: uevent: version 1.0.3
> [ 0.465724] device-mapper: ioctl: 4.36.0-ioctl (2017-06-09) initialised: dm-devel@redhat.com
> [ 0.466797] pseries_idle_driver registered
> [ 0.467761] usbcore: registered new interface driver usbhid
> [ 0.468401] usbhid: USB HID core driver
> [ 0.469142] ipip: IPv4 and MPLS over IPv4 tunneling driver
> [ 0.469558] NET: Registered protocol family 17
> [ 0.470202] Key type dns_resolver registered
> [ 0.470535] Unable to handle kernel paging request for data at address 0x00000010
> [ 0.471030] Faulting instruction address: 0xc000000000d92d04
> [ 0.471440] Oops: Kernel access of bad area, sig: 11 [#1]
> [ 0.471760] LE SMP NR_CPUS=2048 NUMA pSeries
> [ 0.472081] Modules linked in:
> [ 0.472319] CPU: 7 PID: 1 Comm: swapper/0 Not tainted 4.14.0-rc2-gcc6x-g9e1fc7e #1
> [ 0.472811] task: c0000000fea80000 task.stack: c0000000feb00000
> [ 0.473215] NIP: c000000000d92d04 LR: c000000000d92cfc CTR: 0000000000000000
> [ 0.473706] REGS: c0000000feb038d0 TRAP: 0380 Not tainted (4.14.0-rc2-gcc6x-g9e1fc7e)
> [ 0.474203] MSR: 8000000002009033 <SF,VEC,EE,ME,IR,DR,RI,LE> CR: 84000248 XER: 20000000
> [ 0.474901] CFAR: c000000000deb200 SOFTE: 1
> [ 0.474901] GPR00: c000000000d92cfc c0000000feb03b50 c000000000fca600 0000000000000000
> [ 0.474901] GPR04: c0000000feb03b70 0000000000000000 000000000000002f 0000000000000022
> [ 0.474901] GPR08: 0000000000000000 c0000000017e35a8 0000000000000000 0000000000000220
> [ 0.474901] GPR12: 0000000000000000 c00000000fd42680 c00000000000d778 0000000000000000
> [ 0.474901] GPR16: 0000000000000000 0000000000000000 0000000000000000 0000000000000000
> [ 0.474901] GPR20: 0000000000000000 0000000000000000 0000000000000000 0000000000000000
> [ 0.474901] GPR24: 0000000000000000 c000000000d66f60 c000000000d838a4 c000000000dfd918
> [ 0.474901] GPR28: 0000000000000007 c0000000fffffc30 c0000000feb03bf0 0000000000000010
> [ 0.479304] NIP [c000000000d92d04] read_drconf_v1_cell+0x50/0x9c
> [ 0.479705] LR [c000000000d92cfc] read_drconf_v1_cell+0x48/0x9c
> [ 0.480104] Call Trace:
> [ 0.480244] [c0000000feb03b50] [c000000000d92cfc] read_drconf_v1_cell+0x48/0x9c (unreliable)
> [ 0.480907] [c0000000feb03b90] [c000000000d931a4] drmem_init+0x13c/0x2ec
> [ 0.481352] [c0000000feb03c40] [c00000000000d50c] do_one_initcall+0x6c/0x1d0
> [ 0.481897] [c0000000feb03d00] [c000000000d84600] kernel_init_freeable+0x27c/0x358
> [ 0.482428] [c0000000feb03dc0] [c00000000000d79c] kernel_init+0x2c/0x160
> [ 0.482872] [c0000000feb03e30] [c00000000000bae0] ret_from_kernel_thread+0x5c/0x7c
> [ 0.483416] Instruction dump:
> [ 0.483667] 7c7f1b78 60000000 60000000 7c240b78 3d22ffe5 39296414 e95e0000 e8690002
> [ 0.484216] f9440021 48058495 60000000 e9210020 <f87f0000> 39090004 38e90008 39490010
> [ 0.484926] ---[ end trace 5aca0f2a87d33521 ]---
> [ 0.496557]
> [ 1.496724] Kernel panic - not syncing: Attempted to kill init! exitcode=0x0000000b
> [ 1.496724]
> [ 1.505124] Rebooting in 10 seconds..
>
>
> cheers
>
^ permalink raw reply
* Re: [PATCH] powerpc/via-pmu: Fix section mismatch warning
From: Mathieu Malaterre @ 2018-02-14 21:16 UTC (permalink / raw)
To: Laurent Vivier; +Cc: Michael Ellerman, linuxppc-dev, LKML
In-Reply-To: <dfdca2f9-bf75-cdd3-e149-f3a30944d4ae@redhat.com>
On Tue, Feb 13, 2018 at 7:54 PM, Laurent Vivier <lvivier@redhat.com> wrote:
> On 07/02/2018 20:44, Mathieu Malaterre wrote:
>> Remove the __init annotation from pmu_init() to avoid the
>> following warning.
>>
>> WARNING: vmlinux.o(.data+0x4739c): Section mismatch in reference from the variable via_pmu_driver to the function .init.text:pmu_init()
>> The variable via_pmu_driver references
>> the function __init pmu_init()
>> If the reference is valid then annotate the
>> variable with __init* or __refdata (see linux/init.h) or name the variable:
>> *_template, *_timer, *_sht, *_ops, *_probe, *_probe_one, *_console
>>
>> Signed-off-by: Mathieu Malaterre <malat@debian.org>
>> ---
>> drivers/macintosh/via-pmu.c | 2 +-
>> 1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/drivers/macintosh/via-pmu.c b/drivers/macintosh/via-pmu.c
>> index 08849e33c567..5f378272d5b2 100644
>> --- a/drivers/macintosh/via-pmu.c
>> +++ b/drivers/macintosh/via-pmu.c
>> @@ -378,7 +378,7 @@ static int pmu_probe(void)
>> return vias == NULL? -ENODEV: 0;
>> }
>>
>> -static int __init pmu_init(void)
>> +static int pmu_init(void)
>> {
>> if (vias == NULL)
>> return -ENODEV;
>>
>
> pmu_init() is really an init function only called by another init
> function (adb_init()).
>
> So I think it could be good to let the __init marker.
>
> Did you try:
>
> --- a/drivers/macintosh/via-pmu.c
> +++ b/drivers/macintosh/via-pmu.c
> @@ -198,7 +198,7 @@ static const struct file_operations
> pmu_battery_proc_fops;
> static const struct file_operations pmu_options_proc_fops;
>
> #ifdef CONFIG_ADB
> -struct adb_driver via_pmu_driver = {
> +const struct adb_driver via_pmu_driver = {
> "PMU",
> pmu_probe,
> pmu_init,
>
>
Indeed much better !
Thanks
^ 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