* Re: [PATCH 03/10] mm: Convert p[te|md]_numa users to p[te|md]_protnone_numa
From: Benjamin Herrenschmidt @ 2014-12-03 21:01 UTC (permalink / raw)
To: Mel Gorman
Cc: Rik van Riel, Linus Torvalds, Hugh Dickins, Linux Kernel,
Linux-MM, Ingo Molnar, Paul Mackerras, Aneesh Kumar K.V,
Sasha Levin, Dave Jones, LinuxPPC-dev, Kirill Shutemov
In-Reply-To: <20141203155242.GE6043@suse.de>
On Wed, 2014-12-03 at 15:52 +0000, Mel Gorman wrote:
>
> It's implied but can I assume it passed? If so, Ben and Paul, can I
> consider the series to be acked by you other than the minor comment
> updates?
Yes. Assuming it passed :-)
Acked-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cheers,
Ben.
^ permalink raw reply
* Re: [PATCH] powerpc: add little endian flag to syscall_get_arch()
From: Paul Moore @ 2014-12-03 21:59 UTC (permalink / raw)
To: Tony Jones
Cc: Richard Guy Briggs, linux-api, linux-kernel, linux-audit, eparis,
sgrubb, linuxppc-dev
In-Reply-To: <547E3508.2080500@suse.de>
On Tuesday, December 02, 2014 01:54:16 PM Tony Jones wrote:
> On 12/02/2014 01:27 PM, Richard Guy Briggs wrote:
> > Since both ppc and ppc64 have LE variants which are now reported by uname,
> > add that flag (__AUDIT_ARCH_LE) to syscall_get_arch() and add
> > AUDIT_ARCH_PPC*LE variants.
> >
> > Without this, perf trace and auditctl fail.
> >
> > Mainline kernel reports ppc64le (per a058801) but there is no matching
> > AUDIT_ARCH_PPC64LE.
> >
> > See:
> > https://www.redhat.com/archives/linux-audit/2014-August/msg00082.html
> > https://www.redhat.com/archives/linux-audit/2014-December/msg00004.html
> >
> > Signed-off-by: Richard Guy Briggs <rgb@redhat.com>
> > ---
> >
> > arch/powerpc/include/asm/syscall.h | 6 +++++-
> > include/uapi/linux/audit.h | 2 ++
> > 2 files changed, 7 insertions(+), 1 deletions(-)
> >
> > diff --git a/arch/powerpc/include/asm/syscall.h
> > b/arch/powerpc/include/asm/syscall.h index 6fa2708..a58acab 100644
> > --- a/arch/powerpc/include/asm/syscall.h
> > +++ b/arch/powerpc/include/asm/syscall.h
> > @@ -90,6 +90,10 @@ static inline void syscall_set_arguments(struct
> > task_struct *task,>
> > static inline int syscall_get_arch(void)
> > {
> >
> > - return is_32bit_task() ? AUDIT_ARCH_PPC : AUDIT_ARCH_PPC64;
> > + int arch = is_32bit_task() ? AUDIT_ARCH_PPC : AUDIT_ARCH_PPC64;
> > +#ifdef __LITTLE_ENDIAN__
> > + arch |= __AUDIT_ARCH_LE
> > +#endif
> > + return arch;
> >
> > }
> > #endif /* _ASM_SYSCALL_H */
> >
> > diff --git a/include/uapi/linux/audit.h b/include/uapi/linux/audit.h
> > index 4d100c8..fe29a99 100644
> > --- a/include/uapi/linux/audit.h
> > +++ b/include/uapi/linux/audit.h
> > @@ -364,7 +364,9 @@ enum {
> >
> > #define AUDIT_ARCH_PARISC (EM_PARISC)
> > #define AUDIT_ARCH_PARISC64 (EM_PARISC|__AUDIT_ARCH_64BIT)
> > #define AUDIT_ARCH_PPC (EM_PPC)
> >
> > +#define AUDIT_ARCH_PPCLE (EM_PPC|__AUDIT_ARCH_LE)
> >
> > #define AUDIT_ARCH_PPC64 (EM_PPC64|__AUDIT_ARCH_64BIT)
> >
> > +#define AUDIT_ARCH_PPC64LE (EM_PPC64|__AUDIT_ARCH_64BIT|__AUDIT_ARCH_LE)
> >
> > #define AUDIT_ARCH_S390 (EM_S390)
> > #define AUDIT_ARCH_S390X (EM_S390|__AUDIT_ARCH_64BIT)
> > #define AUDIT_ARCH_SH (EM_SH)
>
> IBM would know for certain but I wasn't aware there was a PPCLE (32bit
> compat).
FWIW, I've heard the same thing from IBM folks off-list.
--
paul moore
security and virtualization @ redhat
^ permalink raw reply
* Re: [PATCH] Documentation: bindings: net: DPAA corenet binding document
From: Scott Wood @ 2014-12-03 22:01 UTC (permalink / raw)
To: Bucur Madalin-Cristian-B32716
Cc: devicetree@vger.kernel.org, Shaohui Xie, netdev@vger.kernel.org,
Medve Emilian-EMMEDVE1, Liberman Igal-B31950,
galak@codeaurora.org, linuxppc-dev@lists.ozlabs.org
In-Reply-To: <1417561420.15957.221.camel@freescale.com>
On Tue, 2014-12-02 at 17:03 -0600, Scott Wood wrote:
> On Tue, 2014-12-02 at 06:12 -0600, Bucur Madalin-Cristian-B32716 wrote:
> > > -----Original Message-----
> > > From: Wood Scott-B07421
> > > Sent: Tuesday, December 02, 2014 6:40 AM
> > >
> > > No need for the <SoC> part. As we previously discussed, the only
> > > purpose of this node is backwards compatibility with the U-Boot MAC
> > > address fixup -- if U-Boot doesn't look for the <SoC> version, then
> > > don't complicate things.
> > >
> > > Though, I can't find where U-Boot references this node. Are you sure
> > > it's not using the ethernet%d aliases like everything else, in which
> > > case why do we need this node at all?
> > >
> > > -Scott
> > >
> >
> > The initial (Freescale SDK) binding document contained those compatibles,
> > not sure what the initial intent was for the <SoC> variants.
> >
> > The "fsl,dpaa" node is of interest to the DPAA Ethernet because it is
> > the parent of the "fsl,dpa-ethernet" nodes.
>
> I'm not interested in what the SDK binding says, or what the SDK kernel
> does. I'm interested in whether there's a U-Boot compatibility issue,
> as was previously alleged. If there isn't, then there's no need for
> fsl,dpaa *or* fsl,dpa-ethernet.
OK, I found the U-Boot fixup in question. It's not for MAC addresses,
but for marking disabled ports as disabled. It marks the dpa-ethernet
node as disabled, based on it having an fsl,fman-mac property that
points to the MAC node.
U-Boot also disables the MAC node itself, so it doesn't matter if it
doesn't find fsl,fman-mac -- except for the special case of fm1-dtsec1,
which is always kept enabled because it's used for MDIO for all ports.
Based on http://patchwork.ozlabs.org/patch/410770/ there's a separate
node for mdio, so why can't we mark the MAC disabled? Assuming that
there's no real problem in marking the fm1-dtsec1 MAC node disabled, we
can consider this to be a bug in U-Boot which can be worked around by
having the fm1-dtsec1 mac node have an fsl,fman-mac property that points
to itself. This property would only go on the fm1-dtsec1 mac node and
would only be in device trees for SoCs that are supported by U-Boots old
enough to not have had the bug be fixed.
-Scott
^ permalink raw reply
* Re: [PATCH] powerpc: drop useless warning in eeh_init()
From: Gavin Shan @ 2014-12-03 22:14 UTC (permalink / raw)
To: Greg Kurz; +Cc: linuxppc-dev, Gavin Shan
In-Reply-To: <20141203152046.5c109d1f@bahia.local>
On Wed, Dec 03, 2014 at 03:20:46PM +0100, Greg Kurz wrote:
>On Wed, 26 Nov 2014 09:28:47 +1100
>Gavin Shan <gwshan@linux.vnet.ibm.com> wrote:
>> On Tue, Nov 25, 2014 at 05:10:06PM +0100, Greg Kurz wrote:
>> >This is what we get in dmesg when booting a pseries guest and
>> >the hypervisor doesn't provide EEH support.
>> >
>> >[ 0.166655] EEH functionality not supported
>> >[ 0.166778] eeh_init: Failed to call platform init function (-22)
>> >
>> >Since both powernv_eeh_init() and pseries_eeh_init() already complain when
>> >hitting an error, it is not needed to print more (especially such an
>> >uninformative message).
>> >
>> >Signed-off-by: Greg Kurz <gkurz@linux.vnet.ibm.com>
>>
>> Acked-by: Gavin Shan <gwshan@linux.vnet.ibm.com>
>>
>> Thanks,
>> Gavin
>>
>
>Ping ?
>
It's already in Michael's git tree.
shangw@shangw:~/sandbox/linux.ppc$ git remote -v
origin git://git.kernel.org/pub/scm/linux/kernel/git/mpe/linux.git (fetch)
origin git://git.kernel.org/pub/scm/linux/kernel/git/mpe/linux.git (push)
shangw@shangw:~/sandbox/linux.ppc$ git branch
master
* next
shangw@shangw:~/sandbox/linux.ppc$ git log --author="Greg Kurz" --oneline
1 221195f powerpc: Drop useless warning in eeh_init()
Thanks,
Gavin
>> >---
>> > arch/powerpc/kernel/eeh.c | 5 +----
>> > 1 file changed, 1 insertion(+), 4 deletions(-)
>> >
>> >diff --git a/arch/powerpc/kernel/eeh.c b/arch/powerpc/kernel/eeh.c
>> >index 2248a19..7d62018 100644
>> >--- a/arch/powerpc/kernel/eeh.c
>> >+++ b/arch/powerpc/kernel/eeh.c
>> >@@ -920,11 +920,8 @@ int eeh_init(void)
>> > pr_warn("%s: Platform EEH operation not found\n",
>> > __func__);
>> > return -EEXIST;
>> >- } else if ((ret = eeh_ops->init())) {
>> >- pr_warn("%s: Failed to call platform init function (%d)\n",
>> >- __func__, ret);
>> >+ } else if ((ret = eeh_ops->init()))
>> > return ret;
>> >- }
>> >
>> > /* Initialize EEH event */
>> > ret = eeh_event_init();
>> >
>> >_______________________________________________
>> >Linuxppc-dev mailing list
>> >Linuxppc-dev@lists.ozlabs.org
>> >https://lists.ozlabs.org/listinfo/linuxppc-dev
>>
>> _______________________________________________
>> Linuxppc-dev mailing list
>> Linuxppc-dev@lists.ozlabs.org
>> https://lists.ozlabs.org/listinfo/linuxppc-dev
^ permalink raw reply
* Re: [PATCH] powerpc: drop useless warning in eeh_init()
From: Michael Ellerman @ 2014-12-04 0:32 UTC (permalink / raw)
To: Gavin Shan; +Cc: linuxppc-dev, Greg Kurz
In-Reply-To: <20141203221422.GA4927@shangw>
On Thu, 2014-12-04 at 09:14 +1100, Gavin Shan wrote:
> On Wed, Dec 03, 2014 at 03:20:46PM +0100, Greg Kurz wrote:
> >On Wed, 26 Nov 2014 09:28:47 +1100
> >Gavin Shan <gwshan@linux.vnet.ibm.com> wrote:
> >> On Tue, Nov 25, 2014 at 05:10:06PM +0100, Greg Kurz wrote:
> >> >This is what we get in dmesg when booting a pseries guest and
> >> >the hypervisor doesn't provide EEH support.
> >
> >Ping ?
>
> It's already in Michael's git tree.
Indeed.
It's also marked as "Under Review" in patchwork, which basically means I've
seen it and it's on its way into my tree unless you hear otherwise.
http://patchwork.ozlabs.org/patch/414753/
cheers
^ permalink raw reply
* [PATCH] powerpc/pci: remove pci device on a bus in reverse order
From: Wei Yang @ 2014-12-04 3:04 UTC (permalink / raw)
To: linuxppc-dev; +Cc: Wei Yang, gwshan
As in commit ac205b7b (PCI: make sriov work with hotplug remove) indicates,
when removing pci devices on a bus which has VFs, we need to remove them in
the reverse order.
This patch applies this patten on the hotplug remove patch on powerpc arch.
Signed-off-by: Wei Yang <weiyang@linux.vnet.ibm.com>
---
arch/powerpc/kernel/pci-hotplug.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/powerpc/kernel/pci-hotplug.c b/arch/powerpc/kernel/pci-hotplug.c
index 5b78917..f0f00d9 100644
--- a/arch/powerpc/kernel/pci-hotplug.c
+++ b/arch/powerpc/kernel/pci-hotplug.c
@@ -50,7 +50,7 @@ void pcibios_remove_pci_devices(struct pci_bus *bus)
pr_debug("PCI: Removing devices on bus %04x:%02x\n",
pci_domain_nr(bus), bus->number);
- list_for_each_entry_safe(dev, tmp, &bus->devices, bus_list) {
+ list_for_each_entry_safe_reverse(dev, tmp, &bus->devices, bus_list) {
pr_debug(" Removing %s...\n", pci_name(dev));
pci_stop_and_remove_bus_device(dev);
}
--
1.7.9.5
^ permalink raw reply related
* Re: Right location in sysfs for dlpar file
From: Nathan Fontenot @ 2014-12-04 3:06 UTC (permalink / raw)
To: Michael Ellerman; +Cc: linuxppc-dev, Greg KH
In-Reply-To: <1417496963.31336.6.camel@concordia>
On 12/01/2014 11:09 PM, Michael Ellerman wrote:
> On Mon, 2014-12-01 at 09:41 -0600, Nathan Fontenot wrote:
>> On 11/26/2014 09:12 PM, Benjamin Herrenschmidt wrote:
>>> Hi Greg,
>>>
>>> So Nathan is working on a patch series to cleanup and improve our
>>> "DLPAR" infrastructure which is basically our hotplug mechanism when
>>> running under the PowerVM (aka pHyp) and KVM hypervisors.
>>
>> The cleanup to the dlpar infrastructure will move the entire operation
>> of hotplugging a device to the kernel instead of doing it partially in
>> userspace and partially in the kernel as is currently done.
>>
> ...
>>
>> For PowerVM systems we need this sysfs file to deliver what is
>> essentially a binary blob (specifically a rtas error log) to the
>> kernel.
>
> Those two statements don't really agree with each other. ie. "move the entire
> operation .. to the kernel", but then we need a sysfs file so userspace can
> deliver us a blob?
>
> I think what you mean is that all the actual logic will move into the kernel,
> and the only thing userspace will do (on PowerVM) is write the blog to kick off
> the process.
>
> On PowerKVM the entire process will be handled in the kernel (after some
> additional patches to hook up the rtas event to the hotplug).
>
This is correct. I should have explained it better.
>
> As ugly as it is, we already have /proc/rtas, which includes a bunch of files,
> including error_log, which is where you can *read* the RTAS error logs from.
>
I have no problem making this a writeable file. I think keeping all of the rtas
error log communication between the kernel userspace in one place would be a good
idea.
> So maybe we just extend that, either a new file, or just by making error_log
> writable?
>
> It'd be nice to drop all that rtas gunk and move to something cleaner in /sys,
> but I don't think we can realistically do that any time soon anyway?
>
Perhaps doing this at a later time would be worthwhile.
-Nathan
^ permalink raw reply
* Re: Right location in sysfs for dlpar file
From: Nathan Fontenot @ 2014-12-04 3:07 UTC (permalink / raw)
To: Greg KH; +Cc: linuxppc-dev
In-Reply-To: <20141202042626.GC9271@kroah.com>
On 12/01/2014 10:26 PM, Greg KH wrote:
> On Mon, Dec 01, 2014 at 09:41:03AM -0600, Nathan Fontenot wrote:
>> On 11/26/2014 09:12 PM, Benjamin Herrenschmidt wrote:
>>> Hi Greg,
>>>
>>> So Nathan is working on a patch series to cleanup and improve our
>>> "DLPAR" infrastructure which is basically our hotplug mechanism when
>>> running under the PowerVM (aka pHyp) and KVM hypervisors.
>>
>> The cleanup to the dlpar infrastructure will move the entire operation
>> of hotplugging a device to the kernel instead of doing it partially in
>> userspace and partially in the kernel as is currently done.
>>
>>>
>>> I'll let Nathan give you a bit more details/background and answer
>>> subsequent question you might have as this is really his area of
>>> expertise.
>>>
>>> To cut a long story short, we need a sysfs file that allows our
>>> userspace tools to notify the kernel of hotplug events coming from
>>> the management console (which talks to userspace daemons using a
>>> proprietary protocol) to "initiate" the hotplug operations, which in
>>> turn get dispatched internally in the kernel to the right subsystem
>>> (memory, cpu, pci, ...) based on the resource type.
>>>
>>> On IRC, Greg suggested /sys/firmware and /sys/hypervisor which both
>>> look like a reasonable option to me, probably better than dlpar...
>>
>> For PowerVM systems we need this sysfs file to deliver what is
>> essentially a binary blob (specifically a rtas error log) to the
>> kernel. The current patch set is creating /sys/kernel/dlpar. As Ben
>> mentioned we would like your input on what would be the proper place
>> to create this file.
>
> And what is the kernel supposed to do with such a binary blob? Parse
> it? Or pass it to something else?
The kernel will parse it and perform the requested hotplug operation.
>
> Anyway, let's see the patches before I guess anything else, that will
> determine how things work out best.
I'll cc you on the next version of the patch set.
-Nathan
^ permalink raw reply
* [PATCH] powerpc/pci: remove pci device on a bus in reverse order
From: Wei Yang @ 2014-12-04 3:24 UTC (permalink / raw)
To: linuxppc-dev; +Cc: Wei Yang, gwshan
In-Reply-To: <1417662272-8444-1-git-send-email-weiyang@linux.vnet.ibm.com>
As in commit ac205b7b (PCI: make sriov work with hotplug remove) indicates,
when removing pci devices on a bus which has VFs, we need to remove them in
the reverse order.
This patch applies this pattern on the hotplug remove path on powerpc arch.
Signed-off-by: Wei Yang <weiyang@linux.vnet.ibm.com>
Acked-by: Gavin Shan <gwshan@linux.vnet.ibm.com>
---
arch/powerpc/kernel/pci-hotplug.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/powerpc/kernel/pci-hotplug.c b/arch/powerpc/kernel/pci-hotplug.c
index 5b78917..f0f00d9 100644
--- a/arch/powerpc/kernel/pci-hotplug.c
+++ b/arch/powerpc/kernel/pci-hotplug.c
@@ -50,7 +50,7 @@ void pcibios_remove_pci_devices(struct pci_bus *bus)
pr_debug("PCI: Removing devices on bus %04x:%02x\n",
pci_domain_nr(bus), bus->number);
- list_for_each_entry_safe(dev, tmp, &bus->devices, bus_list) {
+ list_for_each_entry_safe_reverse(dev, tmp, &bus->devices, bus_list) {
pr_debug(" Removing %s...\n", pci_name(dev));
pci_stop_and_remove_bus_device(dev);
}
--
1.7.9.5
^ permalink raw reply related
* Re: [PATCH] powerpc/pci: remove pci device on a bus in reverse order
From: Wei Yang @ 2014-12-04 3:26 UTC (permalink / raw)
To: Wei Yang; +Cc: linuxppc-dev, gwshan
In-Reply-To: <1417662272-8444-1-git-send-email-weiyang@linux.vnet.ibm.com>
Please ignore this one, I create an old version of the patch.
The new one is sent.
On Thu, Dec 04, 2014 at 11:04:32AM +0800, Wei Yang wrote:
>As in commit ac205b7b (PCI: make sriov work with hotplug remove) indicates,
>when removing pci devices on a bus which has VFs, we need to remove them in
>the reverse order.
>
>This patch applies this patten on the hotplug remove patch on powerpc arch.
>
>Signed-off-by: Wei Yang <weiyang@linux.vnet.ibm.com>
>---
> arch/powerpc/kernel/pci-hotplug.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
>diff --git a/arch/powerpc/kernel/pci-hotplug.c b/arch/powerpc/kernel/pci-hotplug.c
>index 5b78917..f0f00d9 100644
>--- a/arch/powerpc/kernel/pci-hotplug.c
>+++ b/arch/powerpc/kernel/pci-hotplug.c
>@@ -50,7 +50,7 @@ void pcibios_remove_pci_devices(struct pci_bus *bus)
>
> pr_debug("PCI: Removing devices on bus %04x:%02x\n",
> pci_domain_nr(bus), bus->number);
>- list_for_each_entry_safe(dev, tmp, &bus->devices, bus_list) {
>+ list_for_each_entry_safe_reverse(dev, tmp, &bus->devices, bus_list) {
> pr_debug(" Removing %s...\n", pci_name(dev));
> pci_stop_and_remove_bus_device(dev);
> }
>--
>1.7.9.5
--
Richard Yang
Help you, Help me
^ permalink raw reply
* Re: [PATCH v3 3/4] powerpc/mpc85xx: Add FSL QorIQ DPAA BMan support to device tree(s)
From: Scott Wood @ 2014-12-04 4:04 UTC (permalink / raw)
To: Arnd Bergmann
Cc: devicetree, Poonam Aggrwal, Geoff Thorpe, Emil Medve,
linuxppc-dev, Chunhe Lan
In-Reply-To: <7923839.hEiWgLtlCl@wuerfel>
On Wed, 2014-12-03 at 20:42 +0100, Arnd Bergmann wrote:
> On Wednesday 03 December 2014 01:53:39 Emil Medve wrote:
> > On 12/02/2014 06:32 PM, Scott Wood wrote:
> > > On Mon, 2014-12-01 at 04:02 -0600, Emil Medve wrote:
> > >> diff --git a/arch/powerpc/boot/dts/t4240rdb.dts b/arch/powerpc/boot/dts/t4240rdb.dts
> > >> index 53761d4..431bf4e 100644
> > >> --- a/arch/powerpc/boot/dts/t4240rdb.dts
> > >> +++ b/arch/powerpc/boot/dts/t4240rdb.dts
> > >> @@ -69,10 +69,27 @@
> > >> device_type = "memory";
> > >> };
> > >>
> > >> + reserved-memory {
> > >> + #address-cells = <2>;
> > >> + #size-cells = <2>;
> > >> + ranges;
> > >> +
> > >> + bman_fbpr: bman-fbpr {
> > >> + compatible = "fsl,bman-fbpr";
> > >> + alloc-ranges = <0 0 0xffff 0xffffffff>;
> > >> + size = <0 0x1000000>;
> > >> + alignment = <0 0x1000000>;
> > >> + };
> > >> + };
> > >
> > > Can't this be done at the SoC level rather than board level?
> >
> > The size of the memory is not SoC specific. Among other things is
> > determined by the number of MACs that are pinned-out on the board
> >
Oh, right.
> Is this really a hardware property then, or some setting?
It's sort of a gray area (as is the reserved-memory mechanism itself)...
The hardware technically allows software to choose the size of the
memory, but the size required to perform optimally is primarily
determined by the ethernet ports that are pinned out on a given board --
except for any extra memory required by accelerators.
I previously suggested an extension to the reserved-memory binding to
convey the fact that the region can potentially be sized differently:
https://lists.ozlabs.org/pipermail/linuxppc-dev/2014-October/122300.html
In most cases the size calculated from the board's ethernet ports is
what is desired, so I think providing a sane default counts as hardware
description.
-Scott
^ permalink raw reply
* Re: [PATCH v3 1/3] Revert "clk: ppc-corenet: Fix Section mismatch warning"
From: Scott Wood @ 2014-12-04 4:04 UTC (permalink / raw)
To: Kevin Hao
Cc: Mike Turquette, Gerhard Sittig, Yuantian Tang, Jingchang Lu,
linuxppc-dev
In-Reply-To: <1417596833-31456-2-git-send-email-haokexin@gmail.com>
On Wed, 2014-12-03 at 16:53 +0800, Kevin Hao wrote:
> This reverts commit da788acb28386aa896224e784954bb73c99ff26c.
>
> That commit tried to fix the section mismatch warning by moving the
> ppc_corenet_clk_driver struct to init section. This is definitely wrong
> because the kernel would free the memories occupied by this struct
> after boot while this driver is still registered in the driver core.
> The kernel would panic when accessing this driver struct.
>
> Cc: stable@vger.kernel.org # 3.17
I don't see stable@vger.kernel.org in the actual CC list.
-Scott
^ permalink raw reply
* Re: Right location in sysfs for dlpar file
From: Greg KH @ 2014-12-04 4:31 UTC (permalink / raw)
To: Nathan Fontenot; +Cc: linuxppc-dev
In-Reply-To: <547FCFEF.8090001@linux.vnet.ibm.com>
On Wed, Dec 03, 2014 at 09:07:27PM -0600, Nathan Fontenot wrote:
> On 12/01/2014 10:26 PM, Greg KH wrote:
> > On Mon, Dec 01, 2014 at 09:41:03AM -0600, Nathan Fontenot wrote:
> >> On 11/26/2014 09:12 PM, Benjamin Herrenschmidt wrote:
> >>> Hi Greg,
> >>>
> >>> So Nathan is working on a patch series to cleanup and improve our
> >>> "DLPAR" infrastructure which is basically our hotplug mechanism when
> >>> running under the PowerVM (aka pHyp) and KVM hypervisors.
> >>
> >> The cleanup to the dlpar infrastructure will move the entire operation
> >> of hotplugging a device to the kernel instead of doing it partially in
> >> userspace and partially in the kernel as is currently done.
> >>
> >>>
> >>> I'll let Nathan give you a bit more details/background and answer
> >>> subsequent question you might have as this is really his area of
> >>> expertise.
> >>>
> >>> To cut a long story short, we need a sysfs file that allows our
> >>> userspace tools to notify the kernel of hotplug events coming from
> >>> the management console (which talks to userspace daemons using a
> >>> proprietary protocol) to "initiate" the hotplug operations, which in
> >>> turn get dispatched internally in the kernel to the right subsystem
> >>> (memory, cpu, pci, ...) based on the resource type.
> >>>
> >>> On IRC, Greg suggested /sys/firmware and /sys/hypervisor which both
> >>> look like a reasonable option to me, probably better than dlpar...
> >>
> >> For PowerVM systems we need this sysfs file to deliver what is
> >> essentially a binary blob (specifically a rtas error log) to the
> >> kernel. The current patch set is creating /sys/kernel/dlpar. As Ben
> >> mentioned we would like your input on what would be the proper place
> >> to create this file.
> >
> > And what is the kernel supposed to do with such a binary blob? Parse
> > it? Or pass it to something else?
>
> The kernel will parse it and perform the requested hotplug operation.
Oh I was hoping you would not say that :(
Seriously? Parsing binary blobs from userspace? Don't do that, you
know better.
greg k-h
^ permalink raw reply
* Re: [PATCH v3 1/3] Revert "clk: ppc-corenet: Fix Section mismatch warning"
From: Kevin Hao @ 2014-12-04 4:38 UTC (permalink / raw)
To: Scott Wood
Cc: Mike Turquette, Gerhard Sittig, Yuantian Tang, Jingchang Lu,
linuxppc-dev
In-Reply-To: <1417665891.15957.238.camel@freescale.com>
[-- Attachment #1: Type: text/plain, Size: 1036 bytes --]
On Wed, Dec 03, 2014 at 10:04:51PM -0600, Scott Wood wrote:
> On Wed, 2014-12-03 at 16:53 +0800, Kevin Hao wrote:
> > This reverts commit da788acb28386aa896224e784954bb73c99ff26c.
> >
> > That commit tried to fix the section mismatch warning by moving the
> > ppc_corenet_clk_driver struct to init section. This is definitely wrong
> > because the kernel would free the memories occupied by this struct
> > after boot while this driver is still registered in the driver core.
> > The kernel would panic when accessing this driver struct.
> >
> > Cc: stable@vger.kernel.org # 3.17
>
> I don't see stable@vger.kernel.org in the actual CC list.
With the above cc tag, Won't this get automatically included in the stable
tree once it is merged into mainline? As I know, we only need to explicitly
send the patch to stable@vger.kernel.org only when that patch was already
merged into mainline without the corresponding cc stable tag and we also want
the stable tree include it. Did I miss something?
Thanks,
Kevin
[-- Attachment #2: Type: application/pgp-signature, Size: 473 bytes --]
^ permalink raw reply
* Re: [PATCH v3 1/3] Revert "clk: ppc-corenet: Fix Section mismatch warning"
From: Scott Wood @ 2014-12-04 4:46 UTC (permalink / raw)
To: Kevin Hao
Cc: Mike Turquette, Gerhard Sittig, Yuantian Tang, Jingchang Lu,
linuxppc-dev
In-Reply-To: <20141204043816.GB14597@pek-khao-d1.corp.ad.wrs.com>
On Thu, 2014-12-04 at 12:38 +0800, Kevin Hao wrote:
> On Wed, Dec 03, 2014 at 10:04:51PM -0600, Scott Wood wrote:
> > On Wed, 2014-12-03 at 16:53 +0800, Kevin Hao wrote:
> > > This reverts commit da788acb28386aa896224e784954bb73c99ff26c.
> > >
> > > That commit tried to fix the section mismatch warning by moving the
> > > ppc_corenet_clk_driver struct to init section. This is definitely wrong
> > > because the kernel would free the memories occupied by this struct
> > > after boot while this driver is still registered in the driver core.
> > > The kernel would panic when accessing this driver struct.
> > >
> > > Cc: stable@vger.kernel.org # 3.17
> >
> > I don't see stable@vger.kernel.org in the actual CC list.
>
> With the above cc tag, Won't this get automatically included in the stable
> tree once it is merged into mainline? As I know, we only need to explicitly
> send the patch to stable@vger.kernel.org only when that patch was already
> merged into mainline without the corresponding cc stable tag and we also want
> the stable tree include it. Did I miss something?
I reread stable_kernel_rules.txt and it looks like you're right, though
usually it ends up on the real CC list anyway due to how git send-email
works.
Since only this first patch is a critical bugfix, and there's no
arch/powerpc content in that patch, I think it should go via Mike's tree
if it's to go in for 3.18 (if it's not already too late). Or, to keep
things simple given the dependency of the following patches, we could
batch them all together for -next and add a # 3.18 stable request.
-Scott
^ permalink raw reply
* Re: [PATCH v4 1/6] dt/bindings: bman: Add phandle to the portals
From: Scott Wood @ 2014-12-04 4:51 UTC (permalink / raw)
To: Emil Medve; +Cc: linuxppc-dev, devicetree
In-Reply-To: <1417600964-24647-2-git-send-email-Emilian.Medve@Freescale.com>
On Wed, 2014-12-03 at 04:02 -0600, Emil Medve wrote:
> This supports SoC(s) with multiple BMan instances
>
> Signed-off-by: Emil Medve <Emilian.Medve@Freescale.com>
> ---
> Documentation/devicetree/bindings/soc/fsl/bman.txt | 10 ++++++++++
> 1 file changed, 10 insertions(+)
>
> diff --git a/Documentation/devicetree/bindings/soc/fsl/bman.txt b/Documentation/devicetree/bindings/soc/fsl/bman.txt
> index 9f80bf8..4fc4a6e 100644
> --- a/Documentation/devicetree/bindings/soc/fsl/bman.txt
> +++ b/Documentation/devicetree/bindings/soc/fsl/bman.txt
> @@ -36,6 +36,11 @@ are located at offsets 0xbf8 and 0xbfc
> Value type: <prop-encoded-array>
> Definition: Standard property. The error interrupt
>
> +- fsl,bman-portals
> + Usage: Required
> + Value type: <phandle>
> + Definition: Phandle to this BMan's instance portals
s/BMan's instance/BMan instance's/
Likewise for QMan
-Scott
^ permalink raw reply
* Re: [PATCH 5/8] PCI/hotplug/rpa: Create PCI slot properly
From: Gavin Shan @ 2014-12-04 5:24 UTC (permalink / raw)
To: Benjamin Herrenschmidt
Cc: linux-pci, linuxppc-dev, Gavin Shan, Nathan Fontenot
In-Reply-To: <1416956697.5089.11.camel@kernel.crashing.org>
On Wed, Nov 26, 2014 at 10:04:57AM +1100, Benjamin Herrenschmidt wrote:
>On Tue, 2014-11-25 at 09:49 +1100, Gavin Shan wrote:
>> When loading rpaphp.ko on a P7 box, I didn't see any PCI slots
>> created under /sys/bus/pci/slots as expected. It seems that the
>> RPA PCI slot stuff has been broken for long time. The driver
>> doesn't use the properties of PCI device-tree nodes properly to
>> populate PCI slots: device-tree node property "ibm,my-drc-index"
>> is the identifier of hotpluggable PCI slot. The (direct or indirect)
>> parent device-tree node should have properties associated with the
>> "ibm,my-drc-index", which are "ibm,drc-indexes","ibm,drc-names",
>> "ibm,drc-types", "ibm,drc-power-domains".
>>
>> The patch parses above device-tree node properties to create PCI
>> slots properly. One PCI slot is created for PCI device-tree node,
>> which has meaningful "ibm,my-drc-index".
>
>Nathan, can you review this ?
>
Ben had the suggestion to have separate drivers for pSeries and PowerNV.
So this patch isn't related to PowerNV PCI hotplug any more. I'll send
reworked patch (including the cleanup one) separately and put Nathan to
the cc list.
Thanks,
Gavin
>Cheers,
>Ben.
>
>> Signed-off-by: Gavin Shan <gwshan@linux.vnet.ibm.com>
>> ---
>> drivers/pci/hotplug/rpaphp.h | 2 +-
>> drivers/pci/hotplug/rpaphp_core.c | 205 ++++++++++++++------------------------
>> 2 files changed, 74 insertions(+), 133 deletions(-)
>>
>> diff --git a/drivers/pci/hotplug/rpaphp.h b/drivers/pci/hotplug/rpaphp.h
>> index b2593e8..39ddbdf 100644
>> --- a/drivers/pci/hotplug/rpaphp.h
>> +++ b/drivers/pci/hotplug/rpaphp.h
>> @@ -92,7 +92,7 @@ int rpaphp_get_sensor_state(struct slot *slot, int *state);
>> /* rpaphp_core.c */
>> int rpaphp_add_slot(struct device_node *dn);
>> int rpaphp_get_drc_props(struct device_node *dn, int *drc_index,
>> - char **drc_name, char **drc_type, int *drc_power_domain);
>> + char **drc_name, char **drc_type, int *drc_power);
>>
>> /* rpaphp_slot.c */
>> void dealloc_slot_struct(struct slot *slot);
>> diff --git a/drivers/pci/hotplug/rpaphp_core.c b/drivers/pci/hotplug/rpaphp_core.c
>> index ff800df..a639c5c 100644
>> --- a/drivers/pci/hotplug/rpaphp_core.c
>> +++ b/drivers/pci/hotplug/rpaphp_core.c
>> @@ -165,119 +165,76 @@ static enum pci_bus_speed get_max_bus_speed(struct slot *slot)
>> return speed;
>> }
>>
>> -static int get_children_props(struct device_node *dn, const int **drc_indexes,
>> - const int **drc_names, const int **drc_types,
>> - const int **drc_power_domains)
>> +static int parse_drc_props(struct device_node *dn, u32 drc_index,
>> + char **drc_name, char **drc_type, u32 *drc_power)
>> {
>> - const int *indexes, *names, *types, *domains;
>> + const u32 *indexes, *names, *types, *domains;
>> + char *name, *type;
>> + struct device_node *parent = dn;
>> + u32 i;
>> +
>> + while ((parent = of_get_parent(parent))) {
>> + indexes = of_get_property(parent, "ibm,drc-indexes", NULL);
>> + names = of_get_property(parent, "ibm,drc-names", NULL);
>> + types = of_get_property(parent, "ibm,drc-types", NULL);
>> + domains = of_get_property(parent, "ibm,drc-power-domains", NULL);
>> +
>> + if (!indexes || !names || !types || !domains) {
>> + of_node_put(parent);
>> + continue;
>> + }
>>
>> - indexes = of_get_property(dn, "ibm,drc-indexes", NULL);
>> - names = of_get_property(dn, "ibm,drc-names", NULL);
>> - types = of_get_property(dn, "ibm,drc-types", NULL);
>> - domains = of_get_property(dn, "ibm,drc-power-domains", NULL);
>> + name = (char *)&names[1];
>> + type = (char *)&types[1];
>> + for (i = 0; i < be32_to_cpu(indexes[0]); i++) {
>> + if (be32_to_cpu(indexes[i + 1]) != drc_index) {
>> + name += (strlen(name) + 1);
>> + type += (strlen(type) + 1);
>> + continue;
>> + }
>>
>> - /* Slot does not have dynamically-removable children */
>> - if (!indexes || !names || !types || !domains)
>> - return -EINVAL;
>> + /* Matched index */
>> + if (drc_name)
>> + *drc_name = name;
>> + if (drc_type)
>> + *drc_type = type;
>> + if (drc_power)
>> + *drc_power = be32_to_cpu(domains[i + 1]);
>> +
>> + of_node_put(parent);
>> + return 0;
>> + }
>>
>> - if (drc_indexes)
>> - *drc_indexes = indexes;
>> - /* &drc_names[1] contains NULL terminated slot names */
>> - if (drc_names)
>> - *drc_names = names;
>> - /* &drc_types[1] contains NULL terminated slot types */
>> - if (drc_types)
>> - *drc_types = types;
>> - if (drc_power_domains)
>> - *drc_power_domains = domains;
>> + /* Next level parent */
>> + of_node_put(parent);
>> + }
>>
>> - return 0;
>> + return -ENODEV;
>> }
>>
>> -/* To get the DRC props describing the current node, first obtain it's
>> +/*
>> + * To get the DRC props describing the current node, first obtain it's
>> * my-drc-index property. Next obtain the DRC list from it's parent. Use
>> * the my-drc-index for correlation, and obtain the requested properties.
>> */
>> int rpaphp_get_drc_props(struct device_node *dn, int *drc_index,
>> - char **drc_name, char **drc_type, int *drc_power_domain)
>> + char **drc_name, char **drc_type, int *drc_power)
>> {
>> - const int *indexes, *names;
>> - const int *types, *domains;
>> - const unsigned int *my_index;
>> - char *name_tmp, *type_tmp;
>> - int i, rc;
>> + const u32 *my_index;
>>
>> + /* Check if node is capable of hotplug */
>> my_index = of_get_property(dn, "ibm,my-drc-index", NULL);
>> - /* Node isn't DLPAR/hotplug capable */
>> if (!my_index)
>> return -EINVAL;
>> + if (drc_index)
>> + *drc_index = be32_to_cpu(*my_index);
>>
>> - rc = get_children_props(dn->parent, &indexes, &names, &types, &domains);
>> - if (rc < 0)
>> - return -EINVAL;
>> -
>> - name_tmp = (char *) &names[1];
>> - type_tmp = (char *) &types[1];
>> -
>> - /* Iterate through parent properties, looking for my-drc-index */
>> - for (i = 0; i < be32_to_cpu(indexes[0]); i++) {
>> - if ((unsigned int) indexes[i + 1] == *my_index) {
>> - if (drc_name)
>> - *drc_name = name_tmp;
>> - if (drc_type)
>> - *drc_type = type_tmp;
>> - if (drc_index)
>> - *drc_index = be32_to_cpu(*my_index);
>> - if (drc_power_domain)
>> - *drc_power_domain = be32_to_cpu(domains[i+1]);
>> - return 0;
>> - }
>> - name_tmp += (strlen(name_tmp) + 1);
>> - type_tmp += (strlen(type_tmp) + 1);
>> - }
>> -
>> - return -EINVAL;
>> + return parse_drc_props(dn, be32_to_cpu(*my_index),
>> + drc_name, drc_type, drc_power);
>> }
>> EXPORT_SYMBOL_GPL(rpaphp_get_drc_props);
>>
>> /**
>> - * is_php_dn() - return true if this is a hotpluggable pci slot, else false
>> - * @dn: target &device_node
>> - * @indexes: passed to get_children_props()
>> - * @names: passed to get_children_props()
>> - * @types: returned from get_children_props()
>> - * @power_domains:
>> - *
>> - * This routine will return true only if the device node is
>> - * a hotpluggable slot. This routine will return false
>> - * for built-in pci slots (even when the built-in slots are
>> - * dlparable.)
>> - */
>> -static bool is_php_dn(struct device_node *dn,
>> - const int **indexes, const int **names,
>> - const int **types, const int **power_domains)
>> -{
>> - const int *drc_types;
>> - const char *drc_type_str;
>> - char *endptr;
>> - unsigned long val;
>> - int rc;
>> -
>> - rc = get_children_props(dn, indexes, names, &drc_types, power_domains);
>> - if (rc < 0)
>> - return false;
>> -
>> - /* PCI Hotplug nodes have an integer for drc_type */
>> - drc_type_str = (char *)&drc_types[1];
>> - val = simple_strtoul(drc_type_str, &endptr, 10);
>> - if (endptr == drc_type_str)
>> - return false;
>> -
>> - *types = drc_types;
>> - return true;
>> -}
>> -
>> -/**
>> * rpaphp_add_slot -- declare a hotplug slot to the hotplug subsystem.
>> * @dn: device node of slot
>> *
>> @@ -295,52 +252,36 @@ static bool is_php_dn(struct device_node *dn,
>> */
>> int rpaphp_add_slot(struct device_node *dn)
>> {
>> + char *name, *type, *endptr;
>> + int index, power_domain;
>> struct slot *slot;
>> - int retval = 0;
>> - int i;
>> - const int *indexes, *names, *types, *power_domains;
>> - char *name, *type;
>> -
>> - if (!dn->name || strcmp(dn->name, "pci"))
>> - return 0;
>> + int val, ret;
>>
>> - /* If this is not a hotplug slot, return without doing anything. */
>> - if (!is_php_dn(dn, &indexes, &names, &types, &power_domains))
>> - return 0;
>> -
>> - dbg("Entry %s: dn->full_name=%s\n", __func__, dn->full_name);
>> -
>> - /* register PCI devices */
>> - name = (char *) &names[1];
>> - type = (char *) &types[1];
>> - for (i = 0; i < be32_to_cpu(indexes[0]); i++) {
>> - int index;
>> -
>> - index = be32_to_cpu(indexes[i + 1]);
>> - slot = alloc_slot_struct(dn, index, name,
>> - be32_to_cpu(power_domains[i + 1]));
>> - if (!slot)
>> - return -ENOMEM;
>> -
>> - slot->type = simple_strtoul(type, NULL, 10);
>> -
>> - dbg("Found drc-index:0x%x drc-name:%s drc-type:%s\n",
>> - index, name, type);
>> + /* Get and parse the hotplug properties */
>> + ret = rpaphp_get_drc_props(dn, &index, &name, &type, &power_domain);
>> + if (ret)
>> + return ret;
>>
>> - retval = rpaphp_enable_slot(slot);
>> - if (!retval)
>> - retval = rpaphp_register_slot(slot);
>> + /* PCI Hotplug nodes have an integer for drc_type */
>> + val = simple_strtoul(type, &endptr, 10);
>> + if (endptr == type)
>> + return -EINVAL;
>>
>> - if (retval)
>> - dealloc_slot_struct(slot);
>> + slot = alloc_slot_struct(dn, index, name, power_domain);
>> + if (!slot)
>> + return -ENOMEM;
>>
>> - name += strlen(name) + 1;
>> - type += strlen(type) + 1;
>> - }
>> - dbg("%s - Exit: rc[%d]\n", __func__, retval);
>> + slot->type = val;
>> + ret = rpaphp_enable_slot(slot);
>> + if (!ret)
>> + ret = rpaphp_register_slot(slot);
>> + if (ret)
>> + goto fail;
>>
>> - /* XXX FIXME: reports a failure only if last entry in loop failed */
>> - return retval;
>> + return 0;
>> +fail:
>> + dealloc_slot_struct(slot);
>> + return ret;
>> }
>> EXPORT_SYMBOL_GPL(rpaphp_add_slot);
>>
>
>
^ permalink raw reply
* Re: [PATCH v1 0/5] powerpc/pci: PCI slot unified reset
From: Gavin Shan @ 2014-12-04 5:25 UTC (permalink / raw)
To: Gavin Shan; +Cc: linuxppc-dev
In-Reply-To: <1416868727-5814-1-git-send-email-gwshan@linux.vnet.ibm.com>
On Tue, Nov 25, 2014 at 09:38:42AM +1100, Gavin Shan wrote:
Please ignore this revision. v2 is on the way...
Thanks,
Gavin
>The patchset corresponds to skiboot changes, which manages PCI slots
>in a unified way: OPAL APIs used to do slot reset, power management,
>presence status retrival. The patchset shouldn't be merged before
>the OPAL firmware counterpart is merged.
>
>The kernel changes have been split into 2 parts: (A) Use the unified
>PCI slot reset OPAL API - this patchset; (B) Changes to rpaphp.ko to
>support PCI slot hotplug via sysfs entries for PowerPC PowerNV platform.
>
>This patchset affects EEH, PCI reset logics, which is used mainly by
>VFIO. A couple of cases have been tested out on P7/P8 boxes and looks
>good: EEH on PowerNV, EEH support for guest, PCI passthrou.
>
>Gavin Shan (5):
> powerpc/powernv: Use PCI slot reset infrastructure
> powerpc/powernv: Refactor ioda_eeh_reset()
> powerpc/powernv: Avoid do complete reset for twice
> powerpc/powernv: Issue fundamental reset if required
> powerpc/powernv: Drop opal_pci_reinit()
>
> arch/powerpc/include/asm/eeh.h | 2 +-
> arch/powerpc/include/asm/opal.h | 31 +---
> arch/powerpc/kernel/eeh_pe.c | 3 -
> arch/powerpc/platforms/powernv/eeh-ioda.c | 230 ++++++++++++++-----------
> arch/powerpc/platforms/powernv/eeh-powernv.c | 24 +--
> arch/powerpc/platforms/powernv/opal-wrappers.S | 1 -
> arch/powerpc/platforms/powernv/pci-ioda.c | 5 +-
> arch/powerpc/platforms/pseries/eeh_pseries.c | 3 +-
> 8 files changed, 139 insertions(+), 160 deletions(-)
>
>Thanks,
>Gavin
^ permalink raw reply
* Re: [PATCH v5 6/6] powerpc/perf/hv-24x7: Document sysfs event description entries
From: Cody P Schafer @ 2014-12-04 5:36 UTC (permalink / raw)
To: Sukadev Bhattiprolu
Cc: Michael Ellerman, Peter Zijlstra, Linux PPC, LKML,
Arnaldo Carvalho de Melo, Paul Mackerras, Jiri Olsa
In-Reply-To: <1417572235-8197-7-git-send-email-sukadev@linux.vnet.ibm.com>
> diff --git a/Documentation/ABI/testing/sysfs-bus-event_source-devices-hv_24x7 b/Documentation/ABI/testing/sysfs-bus-event_source-devices-hv_24x7
> index 32f3f5f..cf70084 100644
> --- a/Documentation/ABI/testing/sysfs-bus-event_source-devices-hv_24x7
> +++ b/Documentation/ABI/testing/sysfs-bus-event_source-devices-hv_24x7
> @@ -21,3 +21,25 @@ Contact: Linux on PowerPC Developer List <linuxppc-dev@lists.ozlabs.org>
> +Contact: Cody P Schafer <cody@linux.vnet.ibm.com>
Probably want someone else to be the contact here.
^ permalink raw reply
* Re: [2/2] pstore: add pstore support on powernv
From: Michael Ellerman @ 2014-12-04 5:37 UTC (permalink / raw)
To: Hari Bathini, linuxppc-dev
In-Reply-To: <20141203110315.25444.88272.stgit@localhost.localdomain>
On Wed, 2014-03-12 at 11:03:15 UTC, Hari Bathini wrote:
> This patch extends pstore, a generic interface to platform dependent
> persistent storage, support for powernv platform to capture certain
> useful information, during dying moments. Such support is already in
> place for pseries platform. This patch while adding pstore support
> for powernv platform, moves common code for pseries and powernv to
> arch/powerpc/kernel/nvram_64.c file.
Please move the common code first in a separate patch. Unless there's some
reason you absolutely can't do that.
cheers
^ permalink raw reply
* [PATCH V3] powerpc/mm: don't do tlbie for updatepp request with NO HPTE fault
From: Aneesh Kumar K.V @ 2014-12-04 5:30 UTC (permalink / raw)
To: benh, paulus, mpe; +Cc: linuxppc-dev, Aneesh Kumar K.V
upatepp can get called for a nohpte fault when we find from the linux
page table that the translation was hashed before. In that case
we are sure that there is no existing translation, hence we could
avoid doing tlbie.
We could possibly race with a parallel fault filling the TLB. But
that should be ok because updatepp is only ever relaxing permissions.
We also look at linux pte permission bits when filling hash pte
permission bits. We also hold the linux pte busy bits while
inserting/updating a hashpte entry, hence a paralle update of
linux pte is not possible. On the other hand mprotect involves
ptep_modify_prot_start which cause a hpte invalidate and not updatepp.
Performance number:
We use randbox_access_bench written by Anton.
Kernel with THP disabled and smaller hash page table size.
86.60% random_access_b [kernel.kallsyms] [k] .native_hpte_updatepp
2.10% random_access_b random_access_bench [.] doit
1.99% random_access_b [kernel.kallsyms] [k] .do_raw_spin_lock
1.85% random_access_b [kernel.kallsyms] [k] .native_hpte_insert
1.26% random_access_b [kernel.kallsyms] [k] .native_flush_hash_range
1.18% random_access_b [kernel.kallsyms] [k] .__delay
0.69% random_access_b [kernel.kallsyms] [k] .native_hpte_remove
0.37% random_access_b [kernel.kallsyms] [k] .clear_user_page
0.34% random_access_b [kernel.kallsyms] [k] .__hash_page_64K
0.32% random_access_b [kernel.kallsyms] [k] fast_exception_return
0.30% random_access_b [kernel.kallsyms] [k] .hash_page_mm
With Fix:
27.54% random_access_b random_access_bench [.] doit
22.90% random_access_b [kernel.kallsyms] [k] .native_hpte_insert
5.76% random_access_b [kernel.kallsyms] [k] .native_hpte_remove
5.20% random_access_b [kernel.kallsyms] [k] fast_exception_return
5.12% random_access_b [kernel.kallsyms] [k] .__hash_page_64K
4.80% random_access_b [kernel.kallsyms] [k] .hash_page_mm
3.31% random_access_b [kernel.kallsyms] [k] data_access_common
1.84% random_access_b [kernel.kallsyms] [k] .trace_hardirqs_on_caller
Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
---
Changes from V2:
* update commit message.
arch/powerpc/include/asm/machdep.h | 2 +-
arch/powerpc/include/asm/mmu-hash64.h | 22 ++++++++++------
arch/powerpc/include/asm/tlbflush.h | 4 +--
arch/powerpc/kernel/exceptions-64s.S | 2 ++
arch/powerpc/mm/hash_low_64.S | 15 ++++++-----
arch/powerpc/mm/hash_native_64.c | 15 ++++++++---
arch/powerpc/mm/hash_utils_64.c | 44 ++++++++++++++++++++-----------
arch/powerpc/mm/hugepage-hash64.c | 8 +++---
arch/powerpc/mm/hugetlbpage-hash64.c | 6 ++---
arch/powerpc/mm/pgtable_64.c | 7 ++---
arch/powerpc/platforms/cell/beat_htab.c | 4 +--
arch/powerpc/platforms/cell/spu_base.c | 5 ++--
arch/powerpc/platforms/cell/spufs/fault.c | 2 +-
arch/powerpc/platforms/ps3/htab.c | 2 +-
arch/powerpc/platforms/pseries/lpar.c | 2 +-
drivers/misc/cxl/fault.c | 8 ++++--
16 files changed, 91 insertions(+), 57 deletions(-)
diff --git a/arch/powerpc/include/asm/machdep.h b/arch/powerpc/include/asm/machdep.h
index e5c0919acca4..c8175a3fe560 100644
--- a/arch/powerpc/include/asm/machdep.h
+++ b/arch/powerpc/include/asm/machdep.h
@@ -42,7 +42,7 @@ struct machdep_calls {
unsigned long newpp,
unsigned long vpn,
int bpsize, int apsize,
- int ssize, int local);
+ int ssize, unsigned long flags);
void (*hpte_updateboltedpp)(unsigned long newpp,
unsigned long ea,
int psize, int ssize);
diff --git a/arch/powerpc/include/asm/mmu-hash64.h b/arch/powerpc/include/asm/mmu-hash64.h
index aeebc94b2bce..4f13c3ed7acf 100644
--- a/arch/powerpc/include/asm/mmu-hash64.h
+++ b/arch/powerpc/include/asm/mmu-hash64.h
@@ -316,27 +316,33 @@ static inline unsigned long hpt_hash(unsigned long vpn,
return hash & 0x7fffffffffUL;
}
+#define HPTE_LOCAL_UPDATE 0x1
+#define HPTE_NOHPTE_UPDATE 0x2
+
extern int __hash_page_4K(unsigned long ea, unsigned long access,
unsigned long vsid, pte_t *ptep, unsigned long trap,
- unsigned int local, int ssize, int subpage_prot);
+ unsigned long flags, int ssize, int subpage_prot);
extern int __hash_page_64K(unsigned long ea, unsigned long access,
unsigned long vsid, pte_t *ptep, unsigned long trap,
- unsigned int local, int ssize);
+ unsigned long flags, int ssize);
struct mm_struct;
unsigned int hash_page_do_lazy_icache(unsigned int pp, pte_t pte, int trap);
-extern int hash_page_mm(struct mm_struct *mm, unsigned long ea, unsigned long access, unsigned long trap);
-extern int hash_page(unsigned long ea, unsigned long access, unsigned long trap);
+extern int hash_page_mm(struct mm_struct *mm, unsigned long ea,
+ unsigned long access, unsigned long trap,
+ unsigned long flags);
+extern int hash_page(unsigned long ea, unsigned long access, unsigned long trap,
+ unsigned long dsisr);
int __hash_page_huge(unsigned long ea, unsigned long access, unsigned long vsid,
- pte_t *ptep, unsigned long trap, int local, int ssize,
- unsigned int shift, unsigned int mmu_psize);
+ pte_t *ptep, unsigned long trap, unsigned long flags,
+ int ssize, unsigned int shift, unsigned int mmu_psize);
#ifdef CONFIG_TRANSPARENT_HUGEPAGE
extern int __hash_page_thp(unsigned long ea, unsigned long access,
unsigned long vsid, pmd_t *pmdp, unsigned long trap,
- int local, int ssize, unsigned int psize);
+ unsigned long flags, int ssize, unsigned int psize);
#else
static inline int __hash_page_thp(unsigned long ea, unsigned long access,
unsigned long vsid, pmd_t *pmdp,
- unsigned long trap, int local,
+ unsigned long trap, unsigned long flags,
int ssize, unsigned int psize)
{
BUG();
diff --git a/arch/powerpc/include/asm/tlbflush.h b/arch/powerpc/include/asm/tlbflush.h
index 4d3ecd8d8929..23d351ca0303 100644
--- a/arch/powerpc/include/asm/tlbflush.h
+++ b/arch/powerpc/include/asm/tlbflush.h
@@ -125,11 +125,11 @@ static inline void arch_leave_lazy_mmu_mode(void)
extern void flush_hash_page(unsigned long vpn, real_pte_t pte, int psize,
- int ssize, int local);
+ int ssize, unsigned long flags);
extern void flush_hash_range(unsigned long number, int local);
extern void flush_hash_hugepage(unsigned long vsid, unsigned long addr,
pmd_t *pmdp, unsigned int psize, int ssize,
- int local);
+ unsigned long flags);
static inline void local_flush_tlb_mm(struct mm_struct *mm)
{
diff --git a/arch/powerpc/kernel/exceptions-64s.S b/arch/powerpc/kernel/exceptions-64s.S
index ad62f4d6ce31..6213f494f40b 100644
--- a/arch/powerpc/kernel/exceptions-64s.S
+++ b/arch/powerpc/kernel/exceptions-64s.S
@@ -1565,9 +1565,11 @@ do_hash_page:
* r3 contains the faulting address
* r4 contains the required access permissions
* r5 contains the trap number
+ * r6 contains dsisr
*
* at return r3 = 0 for success, 1 for page fault, negative for error
*/
+ ld r6,_DSISR(r1)
bl hash_page /* build HPTE if possible */
cmpdi r3,0 /* see if hash_page succeeded */
diff --git a/arch/powerpc/mm/hash_low_64.S b/arch/powerpc/mm/hash_low_64.S
index 5094f32b706e..463174a4a647 100644
--- a/arch/powerpc/mm/hash_low_64.S
+++ b/arch/powerpc/mm/hash_low_64.S
@@ -46,7 +46,8 @@
/*
* _hash_page_4K(unsigned long ea, unsigned long access, unsigned long vsid,
- * pte_t *ptep, unsigned long trap, int local, int ssize)
+ * pte_t *ptep, unsigned long trap, unsigned long flags,
+ * int ssize)
*
* Adds a 4K page to the hash table in a segment of 4K pages only
*/
@@ -298,7 +299,7 @@ htab_modify_pte:
li r6,MMU_PAGE_4K /* base page size */
li r7,MMU_PAGE_4K /* actual page size */
ld r8,STK_PARAM(R9)(r1) /* segment size */
- ld r9,STK_PARAM(R8)(r1) /* get "local" param */
+ ld r9,STK_PARAM(R8)(r1) /* get "flags" param */
.globl htab_call_hpte_updatepp
htab_call_hpte_updatepp:
bl . /* Patched by htab_finish_init() */
@@ -338,8 +339,8 @@ htab_pte_insert_failure:
*****************************************************************************/
/* _hash_page_4K(unsigned long ea, unsigned long access, unsigned long vsid,
- * pte_t *ptep, unsigned long trap, int local, int ssize,
- * int subpg_prot)
+ * pte_t *ptep, unsigned long trap, unsigned local flags,
+ * int ssize, int subpg_prot)
*/
/*
@@ -594,7 +595,7 @@ htab_inval_old_hpte:
li r5,0 /* PTE.hidx */
li r6,MMU_PAGE_64K /* psize */
ld r7,STK_PARAM(R9)(r1) /* ssize */
- ld r8,STK_PARAM(R8)(r1) /* local */
+ ld r8,STK_PARAM(R8)(r1) /* flags */
bl flush_hash_page
/* Clear out _PAGE_HPTE_SUB bits in the new linux PTE */
lis r0,_PAGE_HPTE_SUB@h
@@ -666,7 +667,7 @@ htab_modify_pte:
li r6,MMU_PAGE_4K /* base page size */
li r7,MMU_PAGE_4K /* actual page size */
ld r8,STK_PARAM(R9)(r1) /* segment size */
- ld r9,STK_PARAM(R8)(r1) /* get "local" param */
+ ld r9,STK_PARAM(R8)(r1) /* get "flags" param */
.globl htab_call_hpte_updatepp
htab_call_hpte_updatepp:
bl . /* patched by htab_finish_init() */
@@ -962,7 +963,7 @@ ht64_modify_pte:
li r6,MMU_PAGE_64K /* base page size */
li r7,MMU_PAGE_64K /* actual page size */
ld r8,STK_PARAM(R9)(r1) /* segment size */
- ld r9,STK_PARAM(R8)(r1) /* get "local" param */
+ ld r9,STK_PARAM(R8)(r1) /* get "flags" param */
.globl ht64_call_hpte_updatepp
ht64_call_hpte_updatepp:
bl . /* patched by htab_finish_init() */
diff --git a/arch/powerpc/mm/hash_native_64.c b/arch/powerpc/mm/hash_native_64.c
index 13700911b522..9c4880ddecd6 100644
--- a/arch/powerpc/mm/hash_native_64.c
+++ b/arch/powerpc/mm/hash_native_64.c
@@ -283,11 +283,11 @@ static long native_hpte_remove(unsigned long hpte_group)
static long native_hpte_updatepp(unsigned long slot, unsigned long newpp,
unsigned long vpn, int bpsize,
- int apsize, int ssize, int local)
+ int apsize, int ssize, unsigned long flags)
{
struct hash_pte *hptep = htab_address + slot;
unsigned long hpte_v, want_v;
- int ret = 0;
+ int ret = 0, local = 0;
want_v = hpte_encode_avpn(vpn, bpsize, ssize);
@@ -322,8 +322,15 @@ static long native_hpte_updatepp(unsigned long slot, unsigned long newpp,
}
native_unlock_hpte(hptep);
}
- /* Ensure it is out of the tlb too. */
- tlbie(vpn, bpsize, apsize, ssize, local);
+
+ if (flags & HPTE_LOCAL_UPDATE)
+ local = 1;
+ /*
+ * Ensure it is out of the tlb too if it is not a nohpte fault
+ */
+ if (!(flags & HPTE_NOHPTE_UPDATE))
+ tlbie(vpn, bpsize, apsize, ssize, local);
+
return ret;
}
diff --git a/arch/powerpc/mm/hash_utils_64.c b/arch/powerpc/mm/hash_utils_64.c
index 68211d398fdb..e56a307bc676 100644
--- a/arch/powerpc/mm/hash_utils_64.c
+++ b/arch/powerpc/mm/hash_utils_64.c
@@ -989,7 +989,9 @@ static void check_paca_psize(unsigned long ea, struct mm_struct *mm,
* -1 - critical hash insertion error
* -2 - access not permitted by subpage protection mechanism
*/
-int hash_page_mm(struct mm_struct *mm, unsigned long ea, unsigned long access, unsigned long trap)
+int hash_page_mm(struct mm_struct *mm, unsigned long ea,
+ unsigned long access, unsigned long trap,
+ unsigned long flags)
{
enum ctx_state prev_state = exception_enter();
pgd_t *pgdir;
@@ -997,7 +999,7 @@ int hash_page_mm(struct mm_struct *mm, unsigned long ea, unsigned long access, u
pte_t *ptep;
unsigned hugeshift;
const struct cpumask *tmp;
- int rc, user_region = 0, local = 0;
+ int rc, user_region = 0;
int psize, ssize;
DBG_LOW("hash_page(ea=%016lx, access=%lx, trap=%lx\n",
@@ -1049,7 +1051,7 @@ int hash_page_mm(struct mm_struct *mm, unsigned long ea, unsigned long access, u
/* Check CPU locality */
tmp = cpumask_of(smp_processor_id());
if (user_region && cpumask_equal(mm_cpumask(mm), tmp))
- local = 1;
+ flags |= HPTE_LOCAL_UPDATE;
#ifndef CONFIG_PPC_64K_PAGES
/* If we use 4K pages and our psize is not 4K, then we might
@@ -1086,11 +1088,11 @@ int hash_page_mm(struct mm_struct *mm, unsigned long ea, unsigned long access, u
if (hugeshift) {
if (pmd_trans_huge(*(pmd_t *)ptep))
rc = __hash_page_thp(ea, access, vsid, (pmd_t *)ptep,
- trap, local, ssize, psize);
+ trap, flags, ssize, psize);
#ifdef CONFIG_HUGETLB_PAGE
else
rc = __hash_page_huge(ea, access, vsid, ptep, trap,
- local, ssize, hugeshift, psize);
+ flags, ssize, hugeshift, psize);
#else
else {
/*
@@ -1149,7 +1151,8 @@ int hash_page_mm(struct mm_struct *mm, unsigned long ea, unsigned long access, u
#ifdef CONFIG_PPC_HAS_HASH_64K
if (psize == MMU_PAGE_64K)
- rc = __hash_page_64K(ea, access, vsid, ptep, trap, local, ssize);
+ rc = __hash_page_64K(ea, access, vsid, ptep, trap,
+ flags, ssize);
else
#endif /* CONFIG_PPC_HAS_HASH_64K */
{
@@ -1158,7 +1161,7 @@ int hash_page_mm(struct mm_struct *mm, unsigned long ea, unsigned long access, u
rc = -2;
else
rc = __hash_page_4K(ea, access, vsid, ptep, trap,
- local, ssize, spp);
+ flags, ssize, spp);
}
/* Dump some info in case of hash insertion failure, they should
@@ -1181,14 +1184,19 @@ bail:
}
EXPORT_SYMBOL_GPL(hash_page_mm);
-int hash_page(unsigned long ea, unsigned long access, unsigned long trap)
+int hash_page(unsigned long ea, unsigned long access, unsigned long trap,
+ unsigned long dsisr)
{
+ unsigned long flags = 0;
struct mm_struct *mm = current->mm;
if (REGION_ID(ea) == VMALLOC_REGION_ID)
mm = &init_mm;
- return hash_page_mm(mm, ea, access, trap);
+ if (dsisr & DSISR_NOHPTE)
+ flags |= HPTE_NOHPTE_UPDATE;
+
+ return hash_page_mm(mm, ea, access, trap, flags);
}
EXPORT_SYMBOL_GPL(hash_page);
@@ -1200,7 +1208,7 @@ void hash_preload(struct mm_struct *mm, unsigned long ea,
pgd_t *pgdir;
pte_t *ptep;
unsigned long flags;
- int rc, ssize, local = 0;
+ int rc, ssize, update_flags = 0;
BUG_ON(REGION_ID(ea) != USER_REGION_ID);
@@ -1251,16 +1259,17 @@ void hash_preload(struct mm_struct *mm, unsigned long ea,
/* Is that local to this CPU ? */
if (cpumask_equal(mm_cpumask(mm), cpumask_of(smp_processor_id())))
- local = 1;
+ update_flags |= HPTE_LOCAL_UPDATE;
/* Hash it in */
#ifdef CONFIG_PPC_HAS_HASH_64K
if (mm->context.user_psize == MMU_PAGE_64K)
- rc = __hash_page_64K(ea, access, vsid, ptep, trap, local, ssize);
+ rc = __hash_page_64K(ea, access, vsid, ptep, trap,
+ update_flags, ssize);
else
#endif /* CONFIG_PPC_HAS_HASH_64K */
- rc = __hash_page_4K(ea, access, vsid, ptep, trap, local, ssize,
- subpage_protection(mm, ea));
+ rc = __hash_page_4K(ea, access, vsid, ptep, trap, update_flags,
+ ssize, subpage_protection(mm, ea));
/* Dump some info in case of hash insertion failure, they should
* never happen so it is really useful to know if/when they do
@@ -1278,9 +1287,10 @@ out_exit:
* do not forget to update the assembly call site !
*/
void flush_hash_page(unsigned long vpn, real_pte_t pte, int psize, int ssize,
- int local)
+ unsigned long flags)
{
unsigned long hash, index, shift, hidx, slot;
+ int local = flags & HPTE_LOCAL_UPDATE;
DBG_LOW("flush_hash_page(vpn=%016lx)\n", vpn);
pte_iterate_hashed_subpages(pte, psize, vpn, index, shift) {
@@ -1317,12 +1327,14 @@ void flush_hash_page(unsigned long vpn, real_pte_t pte, int psize, int ssize,
#ifdef CONFIG_TRANSPARENT_HUGEPAGE
void flush_hash_hugepage(unsigned long vsid, unsigned long addr,
- pmd_t *pmdp, unsigned int psize, int ssize, int local)
+ pmd_t *pmdp, unsigned int psize, int ssize,
+ unsigned long flags)
{
int i, max_hpte_count, valid;
unsigned long s_addr;
unsigned char *hpte_slot_array;
unsigned long hidx, shift, vpn, hash, slot;
+ int local = flags & HPTE_LOCAL_UPDATE;
s_addr = addr & HPAGE_PMD_MASK;
hpte_slot_array = get_hpte_slot_array(pmdp);
diff --git a/arch/powerpc/mm/hugepage-hash64.c b/arch/powerpc/mm/hugepage-hash64.c
index 3a648cd363ae..86686514ae13 100644
--- a/arch/powerpc/mm/hugepage-hash64.c
+++ b/arch/powerpc/mm/hugepage-hash64.c
@@ -19,8 +19,8 @@
#include <asm/machdep.h>
int __hash_page_thp(unsigned long ea, unsigned long access, unsigned long vsid,
- pmd_t *pmdp, unsigned long trap, int local, int ssize,
- unsigned int psize)
+ pmd_t *pmdp, unsigned long trap, unsigned long flags,
+ int ssize, unsigned int psize)
{
unsigned int index, valid;
unsigned char *hpte_slot_array;
@@ -95,7 +95,7 @@ int __hash_page_thp(unsigned long ea, unsigned long access, unsigned long vsid,
*/
if ((old_pmd & _PAGE_HASHPTE) && !(old_pmd & _PAGE_COMBO))
flush_hash_hugepage(vsid, ea, pmdp, MMU_PAGE_64K,
- ssize, local);
+ ssize, flags);
}
valid = hpte_valid(hpte_slot_array, index);
@@ -108,7 +108,7 @@ int __hash_page_thp(unsigned long ea, unsigned long access, unsigned long vsid,
slot += hidx & _PTEIDX_GROUP_IX;
ret = ppc_md.hpte_updatepp(slot, rflags, vpn,
- psize, lpsize, ssize, local);
+ psize, lpsize, ssize, flags);
/*
* We failed to update, try to insert a new entry.
*/
diff --git a/arch/powerpc/mm/hugetlbpage-hash64.c b/arch/powerpc/mm/hugetlbpage-hash64.c
index a5bcf9301196..d94b1af53a93 100644
--- a/arch/powerpc/mm/hugetlbpage-hash64.c
+++ b/arch/powerpc/mm/hugetlbpage-hash64.c
@@ -19,8 +19,8 @@ extern long hpte_insert_repeating(unsigned long hash, unsigned long vpn,
unsigned long vflags, int psize, int ssize);
int __hash_page_huge(unsigned long ea, unsigned long access, unsigned long vsid,
- pte_t *ptep, unsigned long trap, int local, int ssize,
- unsigned int shift, unsigned int mmu_psize)
+ pte_t *ptep, unsigned long trap, unsigned long flags,
+ int ssize, unsigned int shift, unsigned int mmu_psize)
{
unsigned long vpn;
unsigned long old_pte, new_pte;
@@ -81,7 +81,7 @@ int __hash_page_huge(unsigned long ea, unsigned long access, unsigned long vsid,
slot += (old_pte & _PAGE_F_GIX) >> 12;
if (ppc_md.hpte_updatepp(slot, rflags, vpn, mmu_psize,
- mmu_psize, ssize, local) == -1)
+ mmu_psize, ssize, flags) == -1)
old_pte &= ~_PAGE_HPTEFLAGS;
}
diff --git a/arch/powerpc/mm/pgtable_64.c b/arch/powerpc/mm/pgtable_64.c
index eea9fa1f8ae7..4fe5f64cc179 100644
--- a/arch/powerpc/mm/pgtable_64.c
+++ b/arch/powerpc/mm/pgtable_64.c
@@ -739,9 +739,10 @@ void pmdp_invalidate(struct vm_area_struct *vma, unsigned long address,
void hpte_do_hugepage_flush(struct mm_struct *mm, unsigned long addr,
pmd_t *pmdp, unsigned long old_pmd)
{
- int ssize, local = 0;
+ int ssize;
unsigned int psize;
unsigned long vsid;
+ unsigned long flags = 0;
const struct cpumask *tmp;
/* get the base page size,vsid and segment size */
@@ -765,9 +766,9 @@ void hpte_do_hugepage_flush(struct mm_struct *mm, unsigned long addr,
tmp = cpumask_of(smp_processor_id());
if (cpumask_equal(mm_cpumask(mm), tmp))
- local = 1;
+ flags |= HPTE_LOCAL_UPDATE;
- return flush_hash_hugepage(vsid, addr, pmdp, psize, ssize, local);
+ return flush_hash_hugepage(vsid, addr, pmdp, psize, ssize, flags);
}
static pmd_t pmd_set_protbits(pmd_t pmd, pgprot_t pgprot)
diff --git a/arch/powerpc/platforms/cell/beat_htab.c b/arch/powerpc/platforms/cell/beat_htab.c
index d4d245c0d787..bee9232fe619 100644
--- a/arch/powerpc/platforms/cell/beat_htab.c
+++ b/arch/powerpc/platforms/cell/beat_htab.c
@@ -186,7 +186,7 @@ static long beat_lpar_hpte_updatepp(unsigned long slot,
unsigned long newpp,
unsigned long vpn,
int psize, int apsize,
- int ssize, int local)
+ int ssize, unsigned long flags)
{
unsigned long lpar_rc;
u64 dummy0, dummy1;
@@ -369,7 +369,7 @@ static long beat_lpar_hpte_updatepp_v3(unsigned long slot,
unsigned long newpp,
unsigned long vpn,
int psize, int apsize,
- int ssize, int local)
+ int ssize, unsigned long flags)
{
unsigned long lpar_rc;
unsigned long want_v;
diff --git a/arch/powerpc/platforms/cell/spu_base.c b/arch/powerpc/platforms/cell/spu_base.c
index ffcbd242e669..f7af74f83693 100644
--- a/arch/powerpc/platforms/cell/spu_base.c
+++ b/arch/powerpc/platforms/cell/spu_base.c
@@ -181,7 +181,8 @@ static int __spu_trap_data_seg(struct spu *spu, unsigned long ea)
return 0;
}
-extern int hash_page(unsigned long ea, unsigned long access, unsigned long trap); //XXX
+extern int hash_page(unsigned long ea, unsigned long access,
+ unsigned long trap, unsigned long dsisr); //XXX
static int __spu_trap_data_map(struct spu *spu, unsigned long ea, u64 dsisr)
{
int ret;
@@ -196,7 +197,7 @@ static int __spu_trap_data_map(struct spu *spu, unsigned long ea, u64 dsisr)
(REGION_ID(ea) != USER_REGION_ID)) {
spin_unlock(&spu->register_lock);
- ret = hash_page(ea, _PAGE_PRESENT, 0x300);
+ ret = hash_page(ea, _PAGE_PRESENT, 0x300, dsisr);
spin_lock(&spu->register_lock);
if (!ret) {
diff --git a/arch/powerpc/platforms/cell/spufs/fault.c b/arch/powerpc/platforms/cell/spufs/fault.c
index e45894a08118..d98f845ac777 100644
--- a/arch/powerpc/platforms/cell/spufs/fault.c
+++ b/arch/powerpc/platforms/cell/spufs/fault.c
@@ -144,7 +144,7 @@ int spufs_handle_class1(struct spu_context *ctx)
access = (_PAGE_PRESENT | _PAGE_USER);
access |= (dsisr & MFC_DSISR_ACCESS_PUT) ? _PAGE_RW : 0UL;
local_irq_save(flags);
- ret = hash_page(ea, access, 0x300);
+ ret = hash_page(ea, access, 0x300, dsisr);
local_irq_restore(flags);
/* hashing failed, so try the actual fault handler */
diff --git a/arch/powerpc/platforms/ps3/htab.c b/arch/powerpc/platforms/ps3/htab.c
index 3e270e3412ae..2f95d33cf34a 100644
--- a/arch/powerpc/platforms/ps3/htab.c
+++ b/arch/powerpc/platforms/ps3/htab.c
@@ -110,7 +110,7 @@ static long ps3_hpte_remove(unsigned long hpte_group)
static long ps3_hpte_updatepp(unsigned long slot, unsigned long newpp,
unsigned long vpn, int psize, int apsize,
- int ssize, int local)
+ int ssize, unsigned long inv_flags)
{
int result;
u64 hpte_v, want_v, hpte_rs;
diff --git a/arch/powerpc/platforms/pseries/lpar.c b/arch/powerpc/platforms/pseries/lpar.c
index 832f221840f2..469751d92004 100644
--- a/arch/powerpc/platforms/pseries/lpar.c
+++ b/arch/powerpc/platforms/pseries/lpar.c
@@ -284,7 +284,7 @@ static long pSeries_lpar_hpte_updatepp(unsigned long slot,
unsigned long newpp,
unsigned long vpn,
int psize, int apsize,
- int ssize, int local)
+ int ssize, unsigned long inv_flags)
{
unsigned long lpar_rc;
unsigned long flags = (newpp & 7) | H_AVPN;
diff --git a/drivers/misc/cxl/fault.c b/drivers/misc/cxl/fault.c
index c99e896604ee..f8684bca2d79 100644
--- a/drivers/misc/cxl/fault.c
+++ b/drivers/misc/cxl/fault.c
@@ -133,7 +133,7 @@ static void cxl_handle_page_fault(struct cxl_context *ctx,
{
unsigned flt = 0;
int result;
- unsigned long access, flags;
+ unsigned long access, flags, inv_flags = 0;
if ((result = copro_handle_mm_fault(mm, dar, dsisr, &flt))) {
pr_devel("copro_handle_mm_fault failed: %#x\n", result);
@@ -149,8 +149,12 @@ static void cxl_handle_page_fault(struct cxl_context *ctx,
access |= _PAGE_RW;
if ((!ctx->kernel) || ~(dar & (1ULL << 63)))
access |= _PAGE_USER;
+
+ if (dsisr & DSISR_NOHPTE)
+ inv_flags |= HPTE_NOHPTE_UPDATE;
+
local_irq_save(flags);
- hash_page_mm(mm, dar, access, 0x300);
+ hash_page_mm(mm, dar, access, 0x300, inv_flags);
local_irq_restore(flags);
pr_devel("Page fault successfully handled for pe: %i!\n", ctx->pe);
--
2.1.0
^ permalink raw reply related
* Re: powerpc/pci: remove pci device on a bus in reverse order
From: Michael Ellerman @ 2014-12-04 5:40 UTC (permalink / raw)
To: Wei Yang, linuxppc-dev; +Cc: Wei Yang, gwshan
In-Reply-To: <1417663477-9124-1-git-send-email-weiyang@linux.vnet.ibm.com>
On Thu, 2014-04-12 at 03:24:37 UTC, Wei Yang wrote:
> As in commit ac205b7b (PCI: make sriov work with hotplug remove) indicates,
> when removing pci devices on a bus which has VFs, we need to remove them in
> the reverse order.
>
> This patch applies this pattern on the hotplug remove path on powerpc arch.
So is this is a bug fix?
Where/how have you tested this?
cheers
^ permalink raw reply
* [PATCH 3/3] powerpc/powernv: Issue fundamental reset if required
From: Gavin Shan @ 2014-12-04 5:50 UTC (permalink / raw)
To: linuxppc-dev; +Cc: Gavin Shan
In-Reply-To: <1417672253-26692-1-git-send-email-gwshan@linux.vnet.ibm.com>
Function pnv_pci_reset_secondary_bus() is used to reset specified
PCI bus, which is leaded by root complex or PCI bridge. That means
the function shouldn't be called on PCI root bus and the patch
removes the logic for the case.
Also, some adapters may require fundamental reset to reload their
firmwares. Otherwise, they will fail to load their firmwares and
those adapters can't work properly after reset, as being reported
in VFIO pass-through scenario. The patch checks the reset type
required by the child adapters of the PCI bus and issue fundamental
reset if necessary.
Signed-off-by: Gavin Shan <gwshan@linux.vnet.ibm.com>
---
arch/powerpc/platforms/powernv/eeh-ioda.c | 34 +++++++++++++++++++++++--------
1 file changed, 25 insertions(+), 9 deletions(-)
diff --git a/arch/powerpc/platforms/powernv/eeh-ioda.c b/arch/powerpc/platforms/powernv/eeh-ioda.c
index 78d94df..cf38781 100644
--- a/arch/powerpc/platforms/powernv/eeh-ioda.c
+++ b/arch/powerpc/platforms/powernv/eeh-ioda.c
@@ -636,18 +636,34 @@ static int ioda_eeh_bridge_reset(struct pci_dev *dev, int option)
return (rc == OPAL_SUCCESS) ? 0 : -EIO;
}
-void pnv_pci_reset_secondary_bus(struct pci_dev *dev)
+static int pnv_pci_dev_reset_type(struct pci_dev *pdev, void *data)
{
- struct pci_controller *hose;
+ int *freset = data;
- if (pci_is_root_bus(dev->bus)) {
- hose = pci_bus_to_host(dev->bus);
- ioda_eeh_phb_reset(hose, EEH_RESET_HOT);
- ioda_eeh_phb_reset(hose, EEH_RESET_DEACTIVATE);
- } else {
- ioda_eeh_bridge_reset(dev, EEH_RESET_HOT);
- ioda_eeh_bridge_reset(dev, EEH_RESET_DEACTIVATE);
+ /*
+ * Stop the iteration immediately if any one PCI
+ * device requires fundamental reset
+ */
+ *freset |= pdev->needs_freset;
+ return *freset;
+}
+
+void pnv_pci_reset_secondary_bus(struct pci_dev *pdev)
+{
+ int option = EEH_RESET_HOT;
+ int freset = 0;
+
+ /* Check if we need issue fundamental reset */
+ if (pdev->subordinate) {
+ pci_walk_bus(pdev->subordinate,
+ pnv_pci_dev_reset_type, &freset);
+ if (freset)
+ option = EEH_RESET_FUNDAMENTAL;
}
+
+ /* Issue required reset type */
+ ioda_eeh_bridge_reset(pdev, option);
+ ioda_eeh_bridge_reset(pdev, EEH_RESET_DEACTIVATE);
}
/**
--
1.8.3.2
^ permalink raw reply related
* [PATCH v2 0/3] powerpc/pci: PCI slot unified reset
From: Gavin Shan @ 2014-12-04 5:50 UTC (permalink / raw)
To: linuxppc-dev; +Cc: Gavin Shan
The patchset corresponds to skiboot changes, which manages PCI slots
in a unified way: OPAL APIs used to do slot reset, power management,
presence status retrival. The patchset shouldn't be merged before
the OPAL firmware counterpart is merged.
The kernel changes have been split into 2 parts: (A) Use the unified
PCI slot reset OPAL API - this patchset; (B) powernv-php driver to
support PCI hotplug for PowerNV platform, which will be sent separately.
This patchset affects EEH, PCI reset logics, which is used mainly by
VFIO. A couple of cases have been tested out on P7/P8 boxes and looks
good: EEH on PowerNV, EEH support for guest, PCI passthrou.
Changelog
=========
v1 -> v2
* Keep opal_pci_reinit(). In case the slot is resetted by kernel,
instead of skiboot, this API should be called to restore states
for those affected devices.
* Reworked slot ID scheme so that old/new kernel can work with
skiboot with or without unified PCI slot management support.
* Code cleanup here and there.
Gavin Shan (3):
powerpc/powernv: Use PCI slot reset infrastructure
powerpc/powernv: Refactor ioda_eeh_reset()
powerpc/powernv: Issue fundamental reset if required
arch/powerpc/include/asm/eeh.h | 1 +
arch/powerpc/include/asm/opal.h | 9 +-
arch/powerpc/platforms/powernv/eeh-ioda.c | 240 ++++++++++++++++--------------
3 files changed, 132 insertions(+), 118 deletions(-)
Thanks,
Gavin
^ permalink raw reply
* [PATCH 2/3] powerpc/powernv: Refactor ioda_eeh_reset()
From: Gavin Shan @ 2014-12-04 5:50 UTC (permalink / raw)
To: linuxppc-dev; +Cc: Gavin Shan
In-Reply-To: <1417672253-26692-1-git-send-email-gwshan@linux.vnet.ibm.com>
The patch refactors ioda_eeh_reset() to eliminate unnecessary
nested if statements to improve code readability. Except printing
the PHB index in the error message when failing to clear PHB error
injection registers, no logic changed.
Signed-off-by: Gavin Shan <gwshan@linux.vnet.ibm.com>
---
arch/powerpc/platforms/powernv/eeh-ioda.c | 65 ++++++++++++++-----------------
1 file changed, 29 insertions(+), 36 deletions(-)
diff --git a/arch/powerpc/platforms/powernv/eeh-ioda.c b/arch/powerpc/platforms/powernv/eeh-ioda.c
index 825da60..78d94df 100644
--- a/arch/powerpc/platforms/powernv/eeh-ioda.c
+++ b/arch/powerpc/platforms/powernv/eeh-ioda.c
@@ -665,8 +665,8 @@ void pnv_pci_reset_secondary_bus(struct pci_dev *dev)
static int ioda_eeh_reset(struct eeh_pe *pe, int option)
{
struct pci_controller *hose = pe->phb;
+ struct pnv_phb *phb = hose->private_data;
struct pci_bus *bus;
- int ret;
/*
* For PHB reset, we always have complete reset. For those PEs whose
@@ -687,50 +687,43 @@ static int ioda_eeh_reset(struct eeh_pe *pe, int option)
case EEH_RESET_HOT:
case EEH_RESET_FUNDAMENTAL:
case EEH_RESET_COMPLETE:
- ret = ioda_eeh_phb_reset(hose, EEH_RESET_COMPLETE);
- break;
+ return ioda_eeh_phb_reset(hose, EEH_RESET_COMPLETE);
case EEH_RESET_DEACTIVATE:
- ret = 0;
- break;
+ return 0;
default:
- ret = -EINVAL;
+ return -EINVAL;
}
+ }
- return ret;
- } else {
- struct pnv_phb *phb;
+ /*
+ * The frozen PE might be caused by PAPR error injection
+ * registers, which are expected to be cleared after hitting
+ * frozen PE as stated in the hardware spec. Unfortunately,
+ * that's not true on P7IOC. So we have to clear it manually
+ * to avoid recursive EEH errors during recovery.
+ */
+ if (phb->model == PNV_PHB_MODEL_P7IOC &&
+ (option == EEH_RESET_HOT ||
+ option == EEH_RESET_FUNDAMENTAL)) {
s64 rc;
- /*
- * The frozen PE might be caused by PAPR error injection
- * registers, which are expected to be cleared after hitting
- * frozen PE as stated in the hardware spec. Unfortunately,
- * that's not true on P7IOC. So we have to clear it manually
- * to avoid recursive EEH errors during recovery.
- */
- phb = hose->private_data;
- if (phb->model == PNV_PHB_MODEL_P7IOC &&
- (option == EEH_RESET_HOT ||
- option == EEH_RESET_FUNDAMENTAL)) {
- rc = opal_pci_reset(phb->opal_id,
- OPAL_RESET_PHB_ERROR,
- OPAL_ASSERT_RESET);
- if (rc != OPAL_SUCCESS) {
- pr_warn("%s: Failure %lld clearing "
- "error injection registers\n",
- __func__, rc);
- return -EIO;
- }
+ rc = opal_pci_reset(phb->opal_id,
+ OPAL_RESET_PHB_ERROR,
+ OPAL_ASSERT_RESET);
+ if (rc != OPAL_SUCCESS) {
+ pr_warn("%s: Failure %lld clearing PHB#%x "
+ "error injection registers\n",
+ __func__, rc, hose->global_number);
+ return -EIO;
}
-
- bus = eeh_pe_bus_get(pe);
- if (pci_is_root_bus(bus))
- ret = ioda_eeh_phb_reset(hose, option);
- else
- ret = ioda_eeh_bridge_reset(bus->self, option);
}
- return ret;
+ /* Route PE reset request */
+ bus = eeh_pe_bus_get(pe);
+ if (pci_is_root_bus(bus))
+ return ioda_eeh_phb_reset(hose, option);
+
+ return ioda_eeh_bridge_reset(bus->self, option);
}
/**
--
1.8.3.2
^ permalink raw reply related
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