LinuxPPC-Dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
* Re: powerpc/xmon: Add RFI flush related fields to paca dump
From: Michael Ellerman @ 2018-01-17 13:25 UTC (permalink / raw)
  To: Michael Ellerman, linuxppc-dev
In-Reply-To: <20180110132856.12446-1-mpe@ellerman.id.au>

On Wed, 2018-01-10 at 13:28:56 UTC, Michael Ellerman wrote:
> Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>

Applied to powerpc fixes.

https://git.kernel.org/powerpc/c/274920a3ecd5f43af0cc380bc0a9ee

cheers

^ permalink raw reply

* Re: powerpc/xmon: Don't print hashed pointers in paca dump
From: Michael Ellerman @ 2018-01-17 13:25 UTC (permalink / raw)
  To: Michael Ellerman, linuxppc-dev
In-Reply-To: <20180110141946.20127-1-mpe@ellerman.id.au>

On Wed, 2018-01-10 at 14:19:46 UTC, Michael Ellerman wrote:
> Remember when the biggest problem we had to worry about was hashed
> pointers, those were the days.
> 
> These were missed in my earlier patch because they don't match "%p",
> but the macro is hiding a "%p", so these all end up being hashed,
> which is not what we want in xmon. Convert them to "%px".
> 
> Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>

Applied to powerpc fixes.

https://git.kernel.org/powerpc/c/2248fade965a5f1ba2a8e6e63f84df

cheers

^ permalink raw reply

* Re: powerpc/pseries: include linux/types.h in asm/hvcall.h
From: Michael Ellerman @ 2018-01-17 13:25 UTC (permalink / raw)
  To: Michal Suchanek, Benjamin Herrenschmidt, Paul Mackerras,
	Philippe Ombredanne, Cédric Le Goater, David Gibson,
	Thomas Falcon, Michal Suchanek, Tobin C. Harding, Michael Neuling,
	linuxppc-dev, linux-kernel
In-Reply-To: <20180115133003.3447-1-msuchanek@suse.de>

On Mon, 2018-01-15 at 13:30:03 UTC, Michal Suchanek wrote:
> Commit 6e032b350cd1 ("powerpc/powernv: Check device-tree for RFI flush
> settings") uses u64 in asm/hvcall.h without including linux/types.h
> 
> This breaks hvcall.h users that do not include the header themselves.
> 
> Fixes: 6e032b350cd1 ("powerpc/powernv: Check device-tree for RFI flush
>     settings")
> 
> Signed-off-by: Michal Suchanek <msuchanek@suse.de>

Applied to powerpc fixes, thanks.

https://git.kernel.org/powerpc/c/1b689a95ce7427075f9ac9fb4aea1a

cheers

^ permalink raw reply

* Re: powerpc/64s: Wire up cpu_show_meltdown()
From: Michael Ellerman @ 2018-01-17 13:25 UTC (permalink / raw)
  To: Michael Ellerman, linuxppc-dev
In-Reply-To: <20180116112401.942-1-mpe@ellerman.id.au>

On Tue, 2018-01-16 at 11:24:01 UTC, Michael Ellerman wrote:
> The recent commit 87590ce6e373 ("sysfs/cpu: Add vulnerability folder")
> added a generic folder and set of files for reporting information on
> CPU vulnerabilities. One of those was for meltdown:
> 
>   /sys/devices/system/cpu/vulnerabilities/meltdown
> 
> This commit wires up that file for 64-bit Book3S powerpc.
> 
> For now we default to "Vulnerable" unless the RFI flush is enabled.
> That may not actually be true on all hardware, further patches will
> refine the reporting based on the CPU/platform etc. But for now we
> default to being pessimists.
> 
> Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>

Applied to powerpc fixes.

https://git.kernel.org/powerpc/c/fd6e440f20b1a4304553775fc55938

cheers

^ permalink raw reply

* Re: powerpc/64s: Allow control of RFI flush via debugfs
From: Michael Ellerman @ 2018-01-17 13:25 UTC (permalink / raw)
  To: Michael Ellerman, linuxppc-dev; +Cc: npiggin
In-Reply-To: <20180116112431.1737-1-mpe@ellerman.id.au>

On Tue, 2018-01-16 at 11:24:31 UTC, Michael Ellerman wrote:
> Expose the state of the RFI flush (enabled/disabled) via debugfs, and
> allow it to be enabled/disabled at runtime.
> 
> eg: $ cat /sys/kernel/debug/powerpc/rfi_flush
>     1
>     $ echo 0 > /sys/kernel/debug/powerpc/rfi_flush
>     $ cat /sys/kernel/debug/powerpc/rfi_flush
>     0
> 
> Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
> Reviewed-by: Nicholas Piggin <npiggin@gmail.com>

Applied to powerpc fixes.

https://git.kernel.org/powerpc/c/236003e6b5443c45c18e613d2b0d77

cheers

^ permalink raw reply

* Re: [2/2] powerpc: make use of for_each_node_by_type() instead of open-coding it
From: Michael Ellerman @ 2018-01-17 13:29 UTC (permalink / raw)
  To: Dmitry Torokhov, Benjamin Herrenschmidt, Paul Mackerras
  Cc: Arnd Bergmann, linux-kernel, Scott Wood, linuxppc-dev
In-Reply-To: <20170201015438.18826-2-dmitry.torokhov@gmail.com>

On Wed, 2017-02-01 at 01:54:38 UTC, Dmitry Torokhov wrote:
> Instead of manually coding the loop with of_find_node_by_type(), let's
> switch to the standard macro for iterating over nodes with given type.
> 
> Also fixed a couple of refcount leaks in the aforementioned loops.
> 
> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>

Applied to powerpc next, thanks.

https://git.kernel.org/powerpc/c/9625e69a3818cc00fd85632719b4c6

cheers

^ permalink raw reply

* Re: [v9,1/8] powerpc: introduce pte_set_hidx() helper
From: Michael Ellerman @ 2018-01-17 13:30 UTC (permalink / raw)
  To: Ram Pai
  Cc: ebiederm, linuxram, mhocko, paulus, aneesh.kumar, bauerman,
	linuxppc-dev, khandual
In-Reply-To: <1509958252-18302-2-git-send-email-linuxram@us.ibm.com>

On Mon, 2017-11-06 at 08:50:45 UTC, Ram Pai wrote:
> Introduce pte_set_hidx().It sets the (H_PAGE_F_SECOND|H_PAGE_F_GIX) bits
> at the appropriate location in the PTE of 4K PTE. For 64K PTE, it sets
> the bits in the second part of the PTE. Though the implementation for
> the former just needs the slot parameter, it does take some additional
> parameters to keep the prototype consistent.
> 
> This function will be handy as we work towards re-arranging the bits in
> the subsequent patches.
> 
> Acked-by: Balbir Singh <bsingharora@gmail.com>
> Reviewed-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
> Signed-off-by: Ram Pai <linuxram@us.ibm.com>

Series applied to powerpc next, thanks.

https://git.kernel.org/powerpc/c/59aa31fd6f964ac63ac9cb90c8468f

cheers

^ permalink raw reply

* Re: [V3, 1/9] powerpc/numa: Look up device node in of_get_assoc_arrays()
From: Michael Ellerman @ 2018-01-17 13:30 UTC (permalink / raw)
  To: Nathan Fontenot, linuxppc-dev
In-Reply-To: <151214679127.64022.14518537993458821242.stgit@ltcalpine2-lp14.aus.stglabs.ibm.com>

On Fri, 2017-12-01 at 16:46:35 UTC, Nathan Fontenot wrote:
> Look up the device node for the associativity array property instead
> of having it passed in as a parameter. This changes precedes an update
> in which the calling routines for of_get_assoc_arrays() will not have
> the device node pointer to pass in.
> 
> Signed-off-by: Nathan Fontenot <nfont@linux.vnet.ibm.com>

Series applied to powerpc next, thanks.

https://git.kernel.org/powerpc/c/35f80debaef07bdaeffbbb20a6e999

cheers

^ permalink raw reply

* Re: [V3, 8/9] powerpc/drmem: Add support for ibm, dynamic-memory-v2 property
From: Michael Ellerman @ 2018-01-17 13:30 UTC (permalink / raw)
  To: Nathan Fontenot, linuxppc-dev
In-Reply-To: <151214686823.64022.14062853099614941612.stgit@ltcalpine2-lp14.aus.stglabs.ibm.com>

On Fri, 2017-12-01 at 16:47:53 UTC, Nathan Fontenot wrote:
> The Power Hypervisor has introduced a new device tree format for
> the property describing the dynamic reconfiguration LMBs for a system,
> ibm,dynamic-memory-v2. This new format condenses the size of the
> property, especially on large memory systems, by reporting sets
> of LMBs that have the same properties (flags and associativity array
> index).
> 
> This patch updates the powerpc/mm/drmem.c code to provide routines
> that can parse the new device tree format during the walk_drmem_lmb*
> routines used during boot, the creation of the LMB array, and updating
> the device tree to create a new property in the proper format for
> ibm,dynamic-memory-v2.
> 
> Signed-off-by: Nathan Fontenot <nfont@linux.vnet.ibm.com>

Applied to powerpc next, thanks.

https://git.kernel.org/powerpc/c/2b31e3aec1dbaae5f0a6f0e485fcb1

cheers

^ permalink raw reply

* Re: [V3,9/9] powerpc: Enable support of ibm,dynamic-memory-v2
From: Michael Ellerman @ 2018-01-17 13:30 UTC (permalink / raw)
  To: Nathan Fontenot, linuxppc-dev
In-Reply-To: <151214687950.64022.15779582389677722807.stgit@ltcalpine2-lp14.aus.stglabs.ibm.com>

On Fri, 2017-12-01 at 16:48:03 UTC, Nathan Fontenot wrote:
> Add required bits to the architecture vector to enable support
> of the ibm,dynamic-memory-v2 device tree property.
> 
> Signed-off-by: Nathan Fontenot <nfont@linux.vnet.ibm.com>

Applied to powerpc next, thanks.

https://git.kernel.org/powerpc/c/0c38ed6f6f0b78a404fe46767d2150

cheers

^ permalink raw reply

* Re: [1/3] arch/powerpc/hugetlb: Use pte_access_permitted for hugetlb access check
From: Michael Ellerman @ 2018-01-17 13:30 UTC (permalink / raw)
  To: Aneesh Kumar K.V, benh, paulus; +Cc: linuxppc-dev, Aneesh Kumar K.V
In-Reply-To: <20171204021912.25974-1-aneesh.kumar@linux.vnet.ibm.com>

On Mon, 2017-12-04 at 02:19:10 UTC, "Aneesh Kumar K.V" wrote:
> No functional change in this patch. This update gup_hugepte to use the
> helper. This will help later when we add memory keys.
> 
> Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>

Series applied to powerpc next, thanks.

https://git.kernel.org/powerpc/c/5fa5b16be5b319184378870467352e

cheers

^ permalink raw reply

* Re: [v4, 1/2] powerpc/crash: Remove the test for cpu_online in the IPI callback
From: Michael Ellerman @ 2018-01-17 13:30 UTC (permalink / raw)
  To: Balbir Singh, linuxppc-dev; +Cc: npiggin
In-Reply-To: <20171215081455.11941-1-bsingharora@gmail.com>

On Fri, 2017-12-15 at 08:14:54 UTC, Balbir Singh wrote:
> Our check was extra cautious, we've audited crash_send_ipi
> and it sends an IPI only to online CPU's. Removal of this
> check should have not functional impact on crash kdump.
> 
> Signed-off-by: Balbir Singh <bsingharora@gmail.com>
> Reviewed-by: Nicholas Piggin <npiggin@gmail.com>

Series applied to powerpc next, thanks.

https://git.kernel.org/powerpc/c/04b9c96eae72d862726f2f4bfcec20

cheers

^ permalink raw reply

* Re: powerpc: Add aacraid and nvme to powernv_defconfig
From: Michael Ellerman @ 2018-01-17 13:30 UTC (permalink / raw)
  To: Benjamin Herrenschmidt, linuxppc-dev
In-Reply-To: <1513734660.2743.14.camel@kernel.crashing.org>

On Wed, 2017-12-20 at 01:51:00 UTC, Benjamin Herrenschmidt wrote:
> These adapters can be found in a number of our systems, so let's
> enable the corresponding drivers by default.
> 
> Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>

Applied to powerpc next, thanks.

https://git.kernel.org/powerpc/c/bba9bc89b9e72bcf26632877b4823a

cheers

^ permalink raw reply

* Re: selftests/powerpc: Add a test of SEGV error behaviour
From: Michael Ellerman @ 2018-01-17 13:30 UTC (permalink / raw)
  To: Michael Ellerman, linuxppc-dev; +Cc: jsperbeck
In-Reply-To: <20180102110324.31978-1-mpe@ellerman.id.au>

On Tue, 2018-01-02 at 11:03:24 UTC, Michael Ellerman wrote:
> Add a test case of the error code reported when we take a SEGV on a
> mapped but inaccessible area. We broke this recently.
> 
> Based on a test case from John Sperbeck <jsperbeck@google.com>.
> 
> Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
> Acked-by: John Sperbeck <jsperbeck@google.com>

Applied to powerpc next.

https://git.kernel.org/powerpc/c/6ed361586b323e576fd5536078fe9f

cheers

^ permalink raw reply

* Re: [3/3] powerpc: Cosmetic cleanup of cpuinfo_op
From: Michael Ellerman @ 2018-01-17 13:30 UTC (permalink / raw)
  To: Benjamin Herrenschmidt, linuxppc-dev
In-Reply-To: <20180110061014.29181-3-benh@kernel.crashing.org>

On Wed, 2018-01-10 at 06:10:14 UTC, Benjamin Herrenschmidt wrote:
> Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>

Applied to powerpc next, thanks.

https://git.kernel.org/powerpc/c/fbadeb6bb1685f7a53869e240284ff

cheers

^ permalink raw reply

* Re: [2/3] powerpc: Make newline in cpuinfo unconditional
From: Michael Ellerman @ 2018-01-17 13:30 UTC (permalink / raw)
  To: Benjamin Herrenschmidt, linuxppc-dev
In-Reply-To: <20180110061014.29181-2-benh@kernel.crashing.org>

On Wed, 2018-01-10 at 06:10:13 UTC, Benjamin Herrenschmidt wrote:
> We used to not put the newline between the CPU part and the summary
> part on UP kernels. This is a rather pointless ifdef so take it out.
> 
> Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>

Applied to powerpc next, thanks.

https://git.kernel.org/powerpc/c/f5f563012a7002e64853c61d293d65

cheers

^ permalink raw reply

* Re: [PATCH v7 1/2] powerpc/powernv: Enable tunneled operations
From: Frederic Barrat @ 2018-01-17 13:30 UTC (permalink / raw)
  To: Philippe Bergheaud, linuxppc-dev; +Cc: clombard, benh
In-Reply-To: <20180115133937.13063-1-felix@linux.vnet.ibm.com>



Le 15/01/2018 à 14:39, Philippe Bergheaud a écrit :
> P9 supports PCI tunneled operations (atomics and as_notify). This
> patch adds support for tunneled operations on powernv, with a new
> API, to be called by device drivers:
> 
> pnv_pci_get_tunnel_ind()
>     Tell driver the 16-bit ASN indication used by kernel.
> 
> pnv_pci_set_tunnel_bar()
>     Tell kernel the Tunnel BAR Response address used by driver.
>     This function uses two new OPAL calls, as the PBCQ Tunnel BAR
>     register is configured by skiboot.
> 
> pnv_pci_get_as_notify_info()
>     Return the ASN info of the thread to be woken up.
> 
> Signed-off-by: Philippe Bergheaud <felix@linux.vnet.ibm.com>
> ---
> Changelog:
> 
> v2: Do not set the ASN indication. Get it from the device tree.
> 
> v3: Make pnv_pci_get_phb_node() available when compiling without cxl.
> 
> v4: Add pnv_pci_get_as_notify_info().
>      Rebase opal call numbers on skiboot 5.9.6.
> 
> v5: pnv_pci_get_tunnel_ind():
>        - fix node reference count
>      pnv_pci_get_as_notify_info():
>        - fail if task == NULL
>        - read pid from mm->context.id
>        - explain that thread.tidr require CONFIG_PPC64
> 
> v6: pnv_pci_get_tunnel_ind():
>        - check if radix is enabled, or else return an error
>      pnv_pci_get_as_notify_info():
>        - remove a capi-specific comment, irrelevant for pci
> 
> v7: pnv_pci_set_tunnel_bar():
>        - setting the tunnel bar more than once with the same value
>          is not an error

I'm ok with the change.

Reviewed-by: Frederic Barrat <fbarrat@linux.vnet.ibm.com>



> This patch depends on the following skiboot patches:
>    https://patchwork.ozlabs.org/patch/858324/
>    https://patchwork.ozlabs.org/patch/858325/
> ---
>   arch/powerpc/include/asm/opal-api.h            |   4 +-
>   arch/powerpc/include/asm/opal.h                |   2 +
>   arch/powerpc/include/asm/pnv-pci.h             |   5 ++
>   arch/powerpc/platforms/powernv/opal-wrappers.S |   2 +
>   arch/powerpc/platforms/powernv/pci-cxl.c       |   8 --
>   arch/powerpc/platforms/powernv/pci.c           | 107 +++++++++++++++++++++++++
>   6 files changed, 119 insertions(+), 9 deletions(-)
> 
> diff --git a/arch/powerpc/include/asm/opal-api.h b/arch/powerpc/include/asm/opal-api.h
> index 233c7504b1f2..b901f4d9f009 100644
> --- a/arch/powerpc/include/asm/opal-api.h
> +++ b/arch/powerpc/include/asm/opal-api.h
> @@ -201,7 +201,9 @@
>   #define OPAL_SET_POWER_SHIFT_RATIO		155
>   #define OPAL_SENSOR_GROUP_CLEAR			156
>   #define OPAL_PCI_SET_P2P			157
> -#define OPAL_LAST				157
> +#define OPAL_PCI_GET_PBCQ_TUNNEL_BAR		159
> +#define OPAL_PCI_SET_PBCQ_TUNNEL_BAR		160
> +#define OPAL_LAST				160
> 
>   /* Device tree flags */
> 
> diff --git a/arch/powerpc/include/asm/opal.h b/arch/powerpc/include/asm/opal.h
> index 0c545f7fc77b..8705e422b893 100644
> --- a/arch/powerpc/include/asm/opal.h
> +++ b/arch/powerpc/include/asm/opal.h
> @@ -198,6 +198,8 @@ int64_t opal_unregister_dump_region(uint32_t id);
>   int64_t opal_slw_set_reg(uint64_t cpu_pir, uint64_t sprn, uint64_t val);
>   int64_t opal_config_cpu_idle_state(uint64_t state, uint64_t flag);
>   int64_t opal_pci_set_phb_cxl_mode(uint64_t phb_id, uint64_t mode, uint64_t pe_number);
> +int64_t opal_pci_get_pbcq_tunnel_bar(uint64_t phb_id, uint64_t *addr);
> +int64_t opal_pci_set_pbcq_tunnel_bar(uint64_t phb_id, uint64_t addr);
>   int64_t opal_ipmi_send(uint64_t interface, struct opal_ipmi_msg *msg,
>   		uint64_t msg_len);
>   int64_t opal_ipmi_recv(uint64_t interface, struct opal_ipmi_msg *msg,
> diff --git a/arch/powerpc/include/asm/pnv-pci.h b/arch/powerpc/include/asm/pnv-pci.h
> index 3e5cf251ad9a..c69de3276b5e 100644
> --- a/arch/powerpc/include/asm/pnv-pci.h
> +++ b/arch/powerpc/include/asm/pnv-pci.h
> @@ -29,6 +29,11 @@ extern int pnv_pci_set_power_state(uint64_t id, uint8_t state,
>   extern int pnv_pci_set_p2p(struct pci_dev *initiator, struct pci_dev *target,
>   			   u64 desc);
> 
> +extern int pnv_pci_get_tunnel_ind(struct pci_dev *dev, uint64_t *ind);
> +extern int pnv_pci_set_tunnel_bar(struct pci_dev *dev, uint64_t addr,
> +				  int enable);
> +extern int pnv_pci_get_as_notify_info(struct task_struct *task, u32 *lpid,
> +				      u32 *pid, u32 *tid);
>   int pnv_phb_to_cxl_mode(struct pci_dev *dev, uint64_t mode);
>   int pnv_cxl_ioda_msi_setup(struct pci_dev *dev, unsigned int hwirq,
>   			   unsigned int virq);
> diff --git a/arch/powerpc/platforms/powernv/opal-wrappers.S b/arch/powerpc/platforms/powernv/opal-wrappers.S
> index 6f4b00a2ac46..5da790fb7fef 100644
> --- a/arch/powerpc/platforms/powernv/opal-wrappers.S
> +++ b/arch/powerpc/platforms/powernv/opal-wrappers.S
> @@ -320,3 +320,5 @@ OPAL_CALL(opal_set_powercap,			OPAL_SET_POWERCAP);
>   OPAL_CALL(opal_get_power_shift_ratio,		OPAL_GET_POWER_SHIFT_RATIO);
>   OPAL_CALL(opal_set_power_shift_ratio,		OPAL_SET_POWER_SHIFT_RATIO);
>   OPAL_CALL(opal_sensor_group_clear,		OPAL_SENSOR_GROUP_CLEAR);
> +OPAL_CALL(opal_pci_get_pbcq_tunnel_bar,		OPAL_PCI_GET_PBCQ_TUNNEL_BAR);
> +OPAL_CALL(opal_pci_set_pbcq_tunnel_bar,		OPAL_PCI_SET_PBCQ_TUNNEL_BAR);
> diff --git a/arch/powerpc/platforms/powernv/pci-cxl.c b/arch/powerpc/platforms/powernv/pci-cxl.c
> index 94498a04558b..cee003de63af 100644
> --- a/arch/powerpc/platforms/powernv/pci-cxl.c
> +++ b/arch/powerpc/platforms/powernv/pci-cxl.c
> @@ -16,14 +16,6 @@
> 
>   #include "pci.h"
> 
> -struct device_node *pnv_pci_get_phb_node(struct pci_dev *dev)
> -{
> -	struct pci_controller *hose = pci_bus_to_host(dev->bus);
> -
> -	return of_node_get(hose->dn);
> -}
> -EXPORT_SYMBOL(pnv_pci_get_phb_node);
> -
>   int pnv_phb_to_cxl_mode(struct pci_dev *dev, uint64_t mode)
>   {
>   	struct pci_controller *hose = pci_bus_to_host(dev->bus);
> diff --git a/arch/powerpc/platforms/powernv/pci.c b/arch/powerpc/platforms/powernv/pci.c
> index 5422f4a6317c..ac454c6ef08c 100644
> --- a/arch/powerpc/platforms/powernv/pci.c
> +++ b/arch/powerpc/platforms/powernv/pci.c
> @@ -18,6 +18,7 @@
>   #include <linux/io.h>
>   #include <linux/msi.h>
>   #include <linux/iommu.h>
> +#include <linux/sched/mm.h>
> 
>   #include <asm/sections.h>
>   #include <asm/io.h>
> @@ -38,6 +39,7 @@
>   #include "pci.h"
> 
>   static DEFINE_MUTEX(p2p_mutex);
> +static DEFINE_MUTEX(tunnel_mutex);
> 
>   int pnv_pci_get_slot_id(struct device_node *np, uint64_t *id)
>   {
> @@ -1092,6 +1094,111 @@ int pnv_pci_set_p2p(struct pci_dev *initiator, struct pci_dev *target, u64 desc)
>   }
>   EXPORT_SYMBOL_GPL(pnv_pci_set_p2p);
> 
> +struct device_node *pnv_pci_get_phb_node(struct pci_dev *dev)
> +{
> +	struct pci_controller *hose = pci_bus_to_host(dev->bus);
> +
> +	return of_node_get(hose->dn);
> +}
> +EXPORT_SYMBOL(pnv_pci_get_phb_node);
> +
> +int pnv_pci_get_tunnel_ind(struct pci_dev *dev, u64 *asnind)
> +{
> +	struct device_node *np;
> +	const __be32 *prop;
> +
> +	if (!radix_enabled())
> +		return -ENXIO;
> +
> +	if (!(np = pnv_pci_get_phb_node(dev)))
> +		return -ENXIO;
> +
> +	prop = of_get_property(np, "ibm,phb-indications", NULL);
> +	of_node_put(np);
> +
> +	if (!prop || !prop[1])
> +		return -ENXIO;
> +
> +	*asnind = (u64)be32_to_cpu(prop[1]);
> +	return 0;
> +}
> +EXPORT_SYMBOL_GPL(pnv_pci_get_tunnel_ind);
> +
> +int pnv_pci_set_tunnel_bar(struct pci_dev *dev, u64 addr, int enable)
> +{
> +	__be64 val;
> +	struct pci_controller *hose;
> +	struct pnv_phb *phb;
> +	u64 tunnel_bar;
> +	int rc;
> +
> +	if (!opal_check_token(OPAL_PCI_GET_PBCQ_TUNNEL_BAR))
> +		return -ENXIO;
> +	if (!opal_check_token(OPAL_PCI_SET_PBCQ_TUNNEL_BAR))
> +		return -ENXIO;
> +
> +	hose = pci_bus_to_host(dev->bus);
> +	phb = hose->private_data;
> +
> +	mutex_lock(&tunnel_mutex);
> +	rc = opal_pci_get_pbcq_tunnel_bar(phb->opal_id, &val);
> +	if (rc != OPAL_SUCCESS) {
> +		rc = -EIO;
> +		goto out;
> +	}
> +	tunnel_bar = be64_to_cpu(val);
> +	if (enable) {
> +		/*
> +		* Only one device per PHB can use atomics.
> +		* Our policy is first-come, first-served.
> +		*/
> +		if (tunnel_bar) {
> +			if (tunnel_bar != addr)
> +				rc = -EBUSY;
> +			goto out;
> +		}
> +	} else {
> +		/*
> +		* The device that owns atomics and wants to release
> +		* them must pass the same address with enable == 0.
> +		*/
> +		if (tunnel_bar != addr) {
> +			rc = -EPERM;
> +			goto out;
> +		}
> +		addr = 0x0ULL;
> +	}
> +	rc = opal_pci_set_pbcq_tunnel_bar(phb->opal_id, addr);
> +	rc = opal_error_code(rc);
> +out:
> +	mutex_unlock(&tunnel_mutex);
> +	return rc;
> +}
> +EXPORT_SYMBOL_GPL(pnv_pci_set_tunnel_bar);
> +
> +#ifdef CONFIG_PPC64	/* for thread.tidr */
> +int pnv_pci_get_as_notify_info(struct task_struct *task, u32 *lpid, u32 *pid,
> +			       u32 *tid)
> +{
> +	struct mm_struct *mm = NULL;
> +
> +	if (task == NULL)
> +		return -EINVAL;
> +
> +	mm = get_task_mm(task);
> +	if (mm == NULL)
> +		return -EINVAL;
> +
> +	*pid = mm->context.id;
> +	mmput(mm);
> +
> +	*tid = task->thread.tidr;
> +	*lpid = mfspr(SPRN_LPID);
> +	return 0;
> +}
> +EXPORT_SYMBOL_GPL(pnv_pci_get_as_notify_info);
> +#endif
> +
>   void pnv_pci_shutdown(void)
>   {
>   	struct pci_controller *hose;
> 

^ permalink raw reply

* Re: [1/5] powerpc/xive: Remove incorrect debug code
From: Michael Ellerman @ 2018-01-17 13:30 UTC (permalink / raw)
  To: Benjamin Herrenschmidt, linuxppc-dev
In-Reply-To: <20180112022849.30899-1-benh@kernel.crashing.org>

On Fri, 2018-01-12 at 02:28:45 UTC, Benjamin Herrenschmidt wrote:
> WORD2 if the TIMA isn't byte accessible and
> isn't that useful to know about, take out the
> pr_devel statement.
> 
> Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>

Applied to powerpc next, thanks.

https://git.kernel.org/powerpc/c/f5abe14f88e8259494d69614768789

cheers

^ permalink raw reply

* Re: [4/5] powerpc: Remove useless EXC_COMMON_HV
From: Michael Ellerman @ 2018-01-17 13:30 UTC (permalink / raw)
  To: Benjamin Herrenschmidt, linuxppc-dev
In-Reply-To: <20180112022849.30899-4-benh@kernel.crashing.org>

On Fri, 2018-01-12 at 02:28:48 UTC, Benjamin Herrenschmidt wrote:
> The only difference between EXC_COMMON_HV and EXC_COMMON is that the
> former adds "2" to the trap number which is supposed to represent the
> fact that this is an "HV" interrupt which uses HSRR0/1.
> 
> However KVM is the only one who cares and it has its own separate macros.
> 
> In fact, we only have one user of EXC_COMMON_HV and it's for an
> unknown interrupt case. All the other ones already using EXC_COMMON.
> 
> Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>

Applied to powerpc next, thanks.

https://git.kernel.org/powerpc/c/872e2ae4bdd4c244f7617ffc08c394

cheers

^ permalink raw reply

* Re: [1/8] powerpc/8xx: Remove CPU6 ERRATA Workaround
From: Michael Ellerman @ 2018-01-17 13:30 UTC (permalink / raw)
  To: Christophe Leroy, Benjamin Herrenschmidt, Paul Mackerras,
	Scott Wood
  Cc: linuxppc-dev, linux-kernel
In-Reply-To: <bb30d80cc985d7307fa1286c9e6824230698919b.1515759812.git.christophe.leroy@c-s.fr>

On Fri, 2018-01-12 at 12:45:19 UTC, Christophe Leroy wrote:
> CPU6 ERRATA affects only MPC860 revisions prior to C.0. Manufacturing
> of those revisiosn was stopped in 1999-2000.
> Therefore, it has been almost 20 years since this ERRATA has been
> fixed in the silicon.
> 
> This patch removes the workaround for that ERRATA.
> 
> Signed-off-by: Christophe Leroy <christophe.leroy@c-s.fr>

Series applied to powerpc next, thanks.

https://git.kernel.org/powerpc/c/2a45addd21de25f41c8f21a6f08f09

cheers

^ permalink raw reply

* Re: [5/5] powerpc: Use the TRAP macro whenever comparing a trap number
From: Michael Ellerman @ 2018-01-17 13:30 UTC (permalink / raw)
  To: Benjamin Herrenschmidt, linuxppc-dev
In-Reply-To: <20180112022849.30899-5-benh@kernel.crashing.org>

On Fri, 2018-01-12 at 02:28:49 UTC, Benjamin Herrenschmidt wrote:
> Trap numbers can have extra bits at the bottom that need to
> be filtered out. There are a few cases where we don't do that.
> 
> It's possible that we got lucky but better safe than sorry.
> 
> Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>

Applied to powerpc next, thanks.

https://git.kernel.org/powerpc/c/2271db20e4b362405bacc0e4095df4

cheers

^ permalink raw reply

* Re: powerpc/8xx: do not select CONFIG_PPC_LIB_RHEAP
From: Michael Ellerman @ 2018-01-17 13:30 UTC (permalink / raw)
  To: Christophe Leroy, Benjamin Herrenschmidt, Paul Mackerras,
	Scott Wood
  Cc: linuxppc-dev, linux-kernel
In-Reply-To: <20180116072950.0B8F86EEC2@localhost.localdomain>

On Tue, 2018-01-16 at 07:29:49 UTC, Christophe Leroy wrote:
> Since commit 0e6e01ff694ee ("CPM/QE: use genalloc to manage CPM/QE
> muram"), rheap is not used anymore.
> 
> Signed-off-by: Christophe Leroy <christophe.leroy@c-s.fr>

Applied to powerpc next, thanks.

https://git.kernel.org/powerpc/c/9a3b849bfe5cba18492acf5add6ba5

cheers

^ permalink raw reply

* Re: powerpc/32: book3s - fix compile error with CONFIG_PPC_PTDUMP
From: Michael Ellerman @ 2018-01-17 13:32 UTC (permalink / raw)
  To: Christophe Leroy, Benjamin Herrenschmidt, Paul Mackerras,
	Scott Wood
  Cc: linuxppc-dev, linux-kernel
In-Reply-To: <20171208163430.1B20C6B864@localhost.localdomain>

On Fri, 2017-12-08 at 16:34:29 UTC, Christophe Leroy wrote:
> This patch remove CONFIG_PPC_HTDUMP if not PPC_BOOK3S_64 to avoid
> below compile failure on BOOK3S_32:
> 
>   CC      arch/powerpc/mm/dump_linuxpagetables.o
>   CC      arch/powerpc/mm/dump_hashpagetable.o
> In file included from arch/powerpc/mm/dump_hashpagetable.c:27:0:
> ./arch/powerpc/include/asm/plpar_wrappers.h: In function 'get_cede_latency_hint':
...
> 
> Fixes: dd5ac03e09554 ("powerpc/mm: Fix page table dump build
> on non-Book3S")
> 
> Signed-off-by: Christophe Leroy <christophe.leroy@c-s.fr>

Applied to powerpc next, thanks.

https://git.kernel.org/powerpc/c/94d3084a0f8cbca9ceea2835ac842c

cheers

^ permalink raw reply

* Re: [PATCH v7 2/2] cxl: read PHB indications from the device tree
From: Frederic Barrat @ 2018-01-17 13:36 UTC (permalink / raw)
  To: Philippe Bergheaud, linuxppc-dev; +Cc: clombard, benh
In-Reply-To: <20180115133937.13063-2-felix@linux.vnet.ibm.com>



Le 15/01/2018 à 14:39, Philippe Bergheaud a écrit :
> Configure the P9 XSL_DSNCTL register with PHB indications found
> in the device tree, or else use legacy hard-coded values.
> 
> Signed-off-by: Philippe Bergheaud <felix@linux.vnet.ibm.com>
> ---

I'm still ok with v7, thanks for fixing the errno.
Acked-by: Frederic Barrat <fbarrat@linux.vnet.ibm.com>


> Changelog:
> 
> v2: New patch. Use the new device tree property "ibm,phb-indications".
> 
> v3: No change.
> 
> v4: No functional change.
>      Drop cosmetic fix in comment.
> 
> v5: get_phb_indications():
>        - make static variables local to function.
>        - return static variable values by arguments.
> 
> v6: get_phb_indications():
>        - acquire a mutex before setting the phb indications.
> 
> v7: get_phb_indications():
>      cxl_get_xsl9_dsnctl():
>        - return -ENODEV instead of -1.
> 
> This patch depends on the following skiboot patch:
>    https://patchwork.ozlabs.org/patch/858324/
> ---
>   drivers/misc/cxl/cxl.h    |  2 +-
>   drivers/misc/cxl/cxllib.c |  2 +-
>   drivers/misc/cxl/pci.c    | 50 ++++++++++++++++++++++++++++++++++++++++++-----
>   3 files changed, 47 insertions(+), 7 deletions(-)
> 
> diff --git a/drivers/misc/cxl/cxl.h b/drivers/misc/cxl/cxl.h
> index e46a4062904a..5a6e9a921c2b 100644
> --- a/drivers/misc/cxl/cxl.h
> +++ b/drivers/misc/cxl/cxl.h
> @@ -1062,7 +1062,7 @@ int cxl_psl_purge(struct cxl_afu *afu);
>   int cxl_calc_capp_routing(struct pci_dev *dev, u64 *chipid,
>   			  u32 *phb_index, u64 *capp_unit_id);
>   int cxl_slot_is_switched(struct pci_dev *dev);
> -int cxl_get_xsl9_dsnctl(u64 capp_unit_id, u64 *reg);
> +int cxl_get_xsl9_dsnctl(struct pci_dev *dev, u64 capp_unit_id, u64 *reg);
>   u64 cxl_calculate_sr(bool master, bool kernel, bool real_mode, bool p9);
> 
>   void cxl_native_irq_dump_regs_psl9(struct cxl_context *ctx);
> diff --git a/drivers/misc/cxl/cxllib.c b/drivers/misc/cxl/cxllib.c
> index dc9bc1807fdf..61f80d586279 100644
> --- a/drivers/misc/cxl/cxllib.c
> +++ b/drivers/misc/cxl/cxllib.c
> @@ -99,7 +99,7 @@ int cxllib_get_xsl_config(struct pci_dev *dev, struct cxllib_xsl_config *cfg)
>   	if (rc)
>   		return rc;
> 
> -	rc = cxl_get_xsl9_dsnctl(capp_unit_id, &cfg->dsnctl);
> +	rc = cxl_get_xsl9_dsnctl(dev, capp_unit_id, &cfg->dsnctl);
>   	if (rc)
>   		return rc;
>   	if (cpu_has_feature(CPU_FTR_POWER9_DD1)) {
> diff --git a/drivers/misc/cxl/pci.c b/drivers/misc/cxl/pci.c
> index 19969ee86d6f..89840181fc03 100644
> --- a/drivers/misc/cxl/pci.c
> +++ b/drivers/misc/cxl/pci.c
> @@ -409,21 +409,61 @@ int cxl_calc_capp_routing(struct pci_dev *dev, u64 *chipid,
>   	return 0;
>   }
> 
> -int cxl_get_xsl9_dsnctl(u64 capp_unit_id, u64 *reg)
> +static DEFINE_MUTEX(indications_mutex);
> +
> +static int get_phb_indications(struct pci_dev *dev, u64* capiind, u64 *asnind,
> +			       u64 *nbwind)
> +{
> +	static u64 nbw, asn, capi = 0;
> +	struct device_node *np;
> +	const __be32 *prop;
> +
> +	if (!capi) {
> +		mutex_lock(&indications_mutex);
> +		if (!capi) {
> +			if (!(np = pnv_pci_get_phb_node(dev))) {
> +				mutex_unlock(&indications_mutex);
> +				return -ENODEV;
> +			}
> +
> +			prop = of_get_property(np, "ibm,phb-indications", NULL);
> +			if (!prop) {
> +				nbw = 0x0300UL; /* legacy values */
> +				asn = 0x0400UL;
> +				capi = 0x0200UL;
> +			} else {
> +				nbw = (u64)be32_to_cpu(prop[2]);
> +				asn = (u64)be32_to_cpu(prop[1]);
> +				capi = (u64)be32_to_cpu(prop[0]);
> +			}
> +			of_node_put(np);
> +		}
> +		mutex_unlock(&indications_mutex);
> +	}
> +	*capiind = capi;
> +	*asnind = asn;
> +	*nbwind = nbw;
> +	return 0;
> +}
> +
> +int cxl_get_xsl9_dsnctl(struct pci_dev *dev, u64 capp_unit_id, u64 *reg)
>   {
>   	u64 xsl_dsnctl;
> +	u64 capiind, asnind, nbwind;
> 
>   	/*
>   	 * CAPI Identifier bits [0:7]
>   	 * bit 61:60 MSI bits --> 0
>   	 * bit 59 TVT selector --> 0
>   	 */
> +	if (get_phb_indications(dev, &capiind, &asnind, &nbwind))
> +		return -ENODEV;
> 
>   	/*
>   	 * Tell XSL where to route data to.
>   	 * The field chipid should match the PHB CAPI_CMPM register
>   	 */
> -	xsl_dsnctl = ((u64)0x2 << (63-7)); /* Bit 57 */
> +	xsl_dsnctl = (capiind << (63-15)); /* Bit 57 */
>   	xsl_dsnctl |= (capp_unit_id << (63-15));
> 
>   	/* nMMU_ID Defaults to: b’000001001’*/
> @@ -437,14 +477,14 @@ int cxl_get_xsl9_dsnctl(u64 capp_unit_id, u64 *reg)
>   		 * nbwind=0x03, bits [57:58], must include capi indicator.
>   		 * Not supported on P9 DD1.
>   		 */
> -		xsl_dsnctl |= ((u64)0x03 << (63-47));
> +		xsl_dsnctl |= (nbwind << (63-55));
> 
>   		/*
>   		 * Upper 16b address bits of ASB_Notify messages sent to the
>   		 * system. Need to match the PHB’s ASN Compare/Mask Register.
>   		 * Not supported on P9 DD1.
>   		 */
> -		xsl_dsnctl |= ((u64)0x04 << (63-55));
> +		xsl_dsnctl |= asnind;
>   	}
> 
>   	*reg = xsl_dsnctl;
> @@ -464,7 +504,7 @@ static int init_implementation_adapter_regs_psl9(struct cxl *adapter,
>   	if (rc)
>   		return rc;
> 
> -	rc = cxl_get_xsl9_dsnctl(capp_unit_id, &xsl_dsnctl);
> +	rc = cxl_get_xsl9_dsnctl(dev, capp_unit_id, &xsl_dsnctl);
>   	if (rc)
>   		return rc;
> 

^ permalink raw reply

* Re: DPAA Ethernet traffice troubles with Linux kernel
From: Andrew Lunn @ 2018-01-17 13:43 UTC (permalink / raw)
  To: Joakim Tjernlund
  Cc: linuxppc-dev@lists.ozlabs.org, netdev@vger.kernel.org,
	madalin.bucur@nxp.com, madskateman@gmail.com
In-Reply-To: <1516189651.18795.99.camel@infinera.com>

> That doesn't work really, having users to hit the bug, debug it, fix it and then
> find it fixed already in upstream, then specifically request it to be backported to stable. 
> I don't need this fix to be backported, already got it. Someone else might though.

The "someone else might though" is a big point of asking for it to
added to stable. The other reason is it means one less patch you need
to maintain in your build.

> I would be interested in bug fixes upstream which fixes:

Did you try upstream? Does it give the same errors?

    Andrew

^ permalink raw reply


This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox