* Re: [PATCH v2 3/3] powerpc: machine check interrupt is a non-maskable interrupt
From: Christophe LEROY @ 2018-10-08 15:39 UTC (permalink / raw)
To: Nicholas Piggin, linuxppc-dev; +Cc: Mahesh Jagannath Salgaonkar
In-Reply-To: <20170719065912.19183-4-npiggin@gmail.com>
Hi Nick,
Le 19/07/2017 à 08:59, Nicholas Piggin a écrit :
> Use nmi_enter similarly to system reset interrupts. This uses NMI
> printk NMI buffers and turns off various debugging facilities that
> helps avoid tripping on ourselves or other CPUs.
>
> Signed-off-by: Nicholas Piggin <npiggin@gmail.com>
> ---
> arch/powerpc/kernel/traps.c | 9 ++++++---
> 1 file changed, 6 insertions(+), 3 deletions(-)
>
> diff --git a/arch/powerpc/kernel/traps.c b/arch/powerpc/kernel/traps.c
> index 2849c4f50324..6d31f9d7c333 100644
> --- a/arch/powerpc/kernel/traps.c
> +++ b/arch/powerpc/kernel/traps.c
> @@ -789,8 +789,10 @@ int machine_check_generic(struct pt_regs *regs)
>
> void machine_check_exception(struct pt_regs *regs)
> {
> - enum ctx_state prev_state = exception_enter();
> int recover = 0;
> + bool nested = in_nmi();
> + if (!nested)
> + nmi_enter();
This alters preempt_count, then when die() is called
in_interrupt() returns true allthough the trap didn't happen in
interrupt, so oops_end() panics for "fatal exception in interrupt"
instead of gently sending SIGBUS the faulting app.
Any idea on how to fix this ?
Christophe
>
> __this_cpu_inc(irq_stat.mce_exceptions);
>
> @@ -820,10 +822,11 @@ void machine_check_exception(struct pt_regs *regs)
>
> /* Must die if the interrupt is not recoverable */
> if (!(regs->msr & MSR_RI))
> - panic("Unrecoverable Machine check");
> + nmi_panic(regs, "Unrecoverable Machine check");
>
> bail:
> - exception_exit(prev_state);
> + if (!nested)
> + nmi_exit();
> }
>
> void SMIException(struct pt_regs *regs)
>
^ permalink raw reply
* Re: [PATCH 09/16] of: overlay: validate overlay properties #address-cells and #size-cells
From: Alan Tull @ 2018-10-08 15:57 UTC (permalink / raw)
To: Frank Rowand
Cc: open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS,
linux-fpga, Pantelis Antoniou, linux-kernel, Rob Herring,
Moritz Fischer, Paul Mackerras, linuxppc-dev
In-Reply-To: <1538712767-30394-10-git-send-email-frowand.list@gmail.com>
On Thu, Oct 4, 2018 at 11:14 PM <frowand.list@gmail.com> wrote:
>
> From: Frank Rowand <frank.rowand@sony.com>
>
> If overlay properties #address-cells or #size-cells are already in
> the live devicetree for any given node, then the values in the
> overlay must match the values in the live tree.
Hi Frank,
I'm starting some FPGA testing on this patchset applied to v4.19-rc7.
That applied cleanly; if that's not the best base to test against,
please let me know.
On a very simple overlay, I'm seeing this patch's warning catching
things other than #address-cells or #size-cells. I'm just getting
started looking at this, will spend time understanding this better and
I'll test other overlays. The warnings were:
Applying dtbo: socfpga_overlay.dtb
[ 33.117881] fpga_manager fpga0: writing soc_system.rbf to Altera
SOCFPGA FPGA Manager
[ 33.575223] OF: overlay: WARNING: add_changeset_property(), memory
leak will occur if overlay removed. Property:
/soc/base-fpga-region/firmware-name
[ 33.588584] OF: overlay: WARNING: add_changeset_property(), memory
leak will occur if overlay removed. Property:
/soc/base-fpga-region/fpga-bridges
[ 33.601856] OF: overlay: WARNING: add_changeset_property(), memory
leak will occur if overlay removed. Property:
/soc/base-fpga-region/ranges
Here's part of that overlay including the properties it's complaining about:
/dts-v1/;
/plugin/;
/ {
fragment@0 {
target = <&base_fpga_region>;
#address-cells = <1>;
#size-cells = <1>;
__overlay__ {
#address-cells = <1>;
#size-cells = <1>;
firmware-name = "soc_system.rbf";
fpga-bridges = <&fpga_bridge1>;
ranges = <0x20000 0xff200000 0x100000>,
<0x0 0xc0000000 0x20000000>;
gpio@10040 {
so on...
By the way, I didn't get any warnings when I subsequently removed this overlay.
Alan
>
> If the properties are already in the live tree then there is no
> need to create a changeset entry to add them since they must
> have the same value. This reduces the memory used by the
> changeset and eliminates a possible memory leak. This is
> verified by 12 fewer warnings during the devicetree unittest,
> as the possible memory leak warnings about #address-cells and
>
> Signed-off-by: Frank Rowand <frank.rowand@sony.com>
> ---
> drivers/of/overlay.c | 38 +++++++++++++++++++++++++++++++++++---
> 1 file changed, 35 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/of/overlay.c b/drivers/of/overlay.c
> index 29c33a5c533f..e6fb3ffe9d93 100644
> --- a/drivers/of/overlay.c
> +++ b/drivers/of/overlay.c
> @@ -287,7 +287,12 @@ static struct property *dup_and_fixup_symbol_prop(
> * @target may be either in the live devicetree or in a new subtree that
> * is contained in the changeset.
> *
> - * Some special properties are not updated (no error returned).
> + * Some special properties are not added or updated (no error returned):
> + * "name", "phandle", "linux,phandle".
> + *
> + * Properties "#address-cells" and "#size-cells" are not updated if they
> + * are already in the live tree, but if present in the live tree, the values
> + * in the overlay must match the values in the live tree.
> *
> * Update of property in symbols node is not allowed.
> *
> @@ -300,6 +305,7 @@ static int add_changeset_property(struct overlay_changeset *ovcs,
> {
> struct property *new_prop = NULL, *prop;
> int ret = 0;
> + bool check_for_non_overlay_node = false;
>
> if (!of_prop_cmp(overlay_prop->name, "name") ||
> !of_prop_cmp(overlay_prop->name, "phandle") ||
> @@ -322,13 +328,39 @@ static int add_changeset_property(struct overlay_changeset *ovcs,
> if (!new_prop)
> return -ENOMEM;
>
> - if (!prop)
> + if (!prop) {
> +
> + check_for_non_overlay_node = true;
> ret = of_changeset_add_property(&ovcs->cset, target->np,
> new_prop);
> - else
> +
> + } else if (!of_prop_cmp(prop->name, "#address-cells")) {
> +
> + if (prop->length != 4 || new_prop->length != 4 ||
> + *(u32 *)prop->value != *(u32 *)new_prop->value)
> + pr_err("ERROR: overlay and/or live tree #address-cells invalid in node %pOF\n",
> + target->np);
> +
> + } else if (!of_prop_cmp(prop->name, "#size-cells")) {
> +
> + if (prop->length != 4 || new_prop->length != 4 ||
> + *(u32 *)prop->value != *(u32 *)new_prop->value)
> + pr_err("ERROR: overlay and/or live tree #size-cells invalid in node %pOF\n",
> + target->np);
> +
> + } else {
> +
> + check_for_non_overlay_node = true;
> ret = of_changeset_update_property(&ovcs->cset, target->np,
> new_prop);
>
> + }
> +
> + if (check_for_non_overlay_node &&
> + !of_node_check_flag(target->np, OF_OVERLAY))
> + pr_err("WARNING: %s(), memory leak will occur if overlay removed. Property: %pOF/%s\n",
> + __func__, target->np, new_prop->name);
> +
> if (ret) {
> kfree(new_prop->name);
> kfree(new_prop->value);
> --
> Frank Rowand <frank.rowand@sony.com>
>
^ permalink raw reply
* Patch "sched/topology: Set correct NUMA topology type" has been added to the 4.18-stable tree
From: gregkh @ 2018-10-08 15:41 UTC (permalink / raw)
To: 1533920419-17410-1-git-send-email-srikar, alexander.levin, gregkh,
heiko.carstens, linuxppc-dev, mgorman, mingo, mpe, peterz, riel,
srikar, suravee.suthikulpanit, tglx, torvalds, wild
Cc: stable-commits
This is a note to let you know that I've just added the patch titled
sched/topology: Set correct NUMA topology type
to the 4.18-stable tree which can be found at:
http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary
The filename of the patch is:
sched-topology-set-correct-numa-topology-type.patch
and it can be found in the queue-4.18 subdirectory.
If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@vger.kernel.org> know about it.
From foo@baz Mon Oct 8 17:39:53 CEST 2018
From: Srikar Dronamraju <srikar@linux.vnet.ibm.com>
Date: Fri, 10 Aug 2018 22:30:18 +0530
Subject: sched/topology: Set correct NUMA topology type
From: Srikar Dronamraju <srikar@linux.vnet.ibm.com>
[ Upstream commit e5e96fafd9028b1478b165db78c52d981c14f471 ]
With the following commit:
051f3ca02e46 ("sched/topology: Introduce NUMA identity node sched domain")
the scheduler introduced a new NUMA level. However this leads to the NUMA topology
on 2 node systems to not be marked as NUMA_DIRECT anymore.
After this commit, it gets reported as NUMA_BACKPLANE, because
sched_domains_numa_level is now 2 on 2 node systems.
Fix this by allowing setting systems that have up to 2 NUMA levels as
NUMA_DIRECT.
While here remove code that assumes that level can be 0.
Signed-off-by: Srikar Dronamraju <srikar@linux.vnet.ibm.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Cc: Andre Wild <wild@linux.vnet.ibm.com>
Cc: Heiko Carstens <heiko.carstens@de.ibm.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Mel Gorman <mgorman@techsingularity.net>
Cc: Michael Ellerman <mpe@ellerman.id.au>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Rik van Riel <riel@surriel.com>
Cc: Suravee Suthikulpanit <suravee.suthikulpanit@amd.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: linuxppc-dev <linuxppc-dev@lists.ozlabs.org>
Fixes: 051f3ca02e46 "Introduce NUMA identity node sched domain"
Link: http://lkml.kernel.org/r/1533920419-17410-1-git-send-email-srikar@linux.vnet.ibm.com
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
kernel/sched/topology.c | 5 +----
1 file changed, 1 insertion(+), 4 deletions(-)
--- a/kernel/sched/topology.c
+++ b/kernel/sched/topology.c
@@ -1295,7 +1295,7 @@ static void init_numa_topology_type(void
n = sched_max_numa_distance;
- if (sched_domains_numa_levels <= 1) {
+ if (sched_domains_numa_levels <= 2) {
sched_numa_topology_type = NUMA_DIRECT;
return;
}
@@ -1380,9 +1380,6 @@ void sched_init_numa(void)
break;
}
- if (!level)
- return;
-
/*
* 'level' contains the number of unique distances
*
Patches currently in stable-queue which might be from srikar@linux.vnet.ibm.com are
queue-4.18/sched-topology-set-correct-numa-topology-type.patch
^ permalink raw reply
* Re: [PATCH 29/36] dt-bindings: arm: Convert Renesas board/soc bindings to json-schema
From: Geert Uytterhoeven @ 2018-10-08 15:12 UTC (permalink / raw)
To: Rob Herring
Cc: Mark Rutland,
open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS,
Kumar Gala, Grant Likely, Arnd Bergmann, Tom Rini, Simon Horman,
Frank Rowand, Linus Walleij, Pantelis Antoniou,
Linux Kernel Mailing List, Björn Andersson, Linux-Renesas,
Mark Brown, Jonathan Cameron, Olof Johansson, linuxppc-dev,
Linux ARM
In-Reply-To: <CAL_JsqLbh-UhYTWN_nMDVwGSh0amh6OsOK8H-+xiTdVynL3XiA@mail.gmail.com>
Hi Rob,
On Mon, Oct 8, 2018 at 4:57 PM Rob Herring <robh@kernel.org> wrote:
> On Mon, Oct 8, 2018 at 2:47 AM Geert Uytterhoeven <geert@linux-m68k.org> wrote:
> > On Fri, Oct 5, 2018 at 6:59 PM Rob Herring <robh@kernel.org> wrote:
> > > Convert Renesas SoC bindings to DT schema format using json-schema.
> > > --- /dev/null
> > > +++ b/Documentation/devicetree/bindings/arm/shmobile.yaml
> > > @@ -0,0 +1,205 @@
> > > + - description: Kingfisher (SBEV-RCAR-KF-M03)
> > > + items:
> > > + - const: shimafuji,kingfisher
> > > + - enum:
> > > + - renesas,h3ulcb
> > > + - renesas,m3ulcb
> > > + - enum:
> > > + - renesas,r8a7795
> > > + - renesas,r8a7796
> >
> > This looks a bit funny: all other entries have the "const" last, and
> > use it for the
> > SoC number. May be correct, though.
> > To clarify, this is an extension board that can fit both the [HM]3ULCB
> > boards (actually also the new M3NULCB, I think).
>
> This being Kingfisher?
Correct.
> I wrote this based on dts files in the tree. There's 2 combinations that I see:
>
> "shimafuji,kingfisher", "renesas,h3ulcb", "renesas,r8a7795"
> "shimafuji,kingfisher", "renesas,m3ulcb", "renesas,r8a7796"
>
> The schema allows 4 combinations (1 * 2 * 2). I have no idea if the
> other combinations are possible. If not, then we could rewrite this as
> 2 entries with 3 const values each.
I expect there will soon be a third one:
"shimafuji,kingfisher", "renesas,m3nulcb", "renesas,r8a77965"
Technically, {h3,m3,m3n}ulcb are the same board (although there may be
minor revision differences), with a different SiP mounted.
But they are called/marketed depending on which SiP is mounted.
And on top of that, you can plug in a Kingfisher daughterboard. Could be an
overlay ;-)
Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org
In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds
^ permalink raw reply
* Re: [PATCH 05/36] dt-bindings: arm: renesas: Move 'renesas,prr' binding to its own doc
From: Rob Herring @ 2018-10-08 14:59 UTC (permalink / raw)
To: Geert Uytterhoeven, Simon Horman
Cc: Mark Rutland, devicetree, Kumar Gala, Grant Likely, Arnd Bergmann,
Tom Rini, Frank Rowand, Linus Walleij, Pantelis Antoniou,
linux-kernel@vger.kernel.org, Bjorn Andersson,
open list:MEDIA DRIVERS FOR RENESAS - FCP, Mark Brown,
Jonathan Cameron, Olof Johansson, linuxppc-dev,
moderated list:ARM/FREESCALE IMX / MXC ARM ARCHITECTURE
In-Reply-To: <CAMuHMdV=HaVhGf-7-21OHb05dCc0q9MDUNknAcybEiGSxATeEA@mail.gmail.com>
On Mon, Oct 8, 2018 at 2:05 AM Geert Uytterhoeven <geert@linux-m68k.org> wrote:
>
> Hi Rob,
>
> On Fri, Oct 5, 2018 at 6:58 PM Rob Herring <robh@kernel.org> wrote:
> > In preparation to convert board-level bindings to json-schema, move
> > various misc SoC bindings out to their own file.
> >
> > Cc: Mark Rutland <mark.rutland@arm.com>
> > Cc: Simon Horman <horms@verge.net.au>
> > Cc: Magnus Damm <magnus.damm@gmail.com>
> > Cc: devicetree@vger.kernel.org
> > Cc: linux-renesas-soc@vger.kernel.org
> > Signed-off-by: Rob Herring <robh@kernel.org>
>
> Looks good to me, but needs a rebase, as the PRR section has been extended
> in -next.
Is this something you all can apply still for 4.20?
Rob
^ permalink raw reply
* Re: [PATCH 29/36] dt-bindings: arm: Convert Renesas board/soc bindings to json-schema
From: Rob Herring @ 2018-10-08 14:57 UTC (permalink / raw)
To: Geert Uytterhoeven
Cc: Mark Rutland, devicetree, Kumar Gala, Grant Likely, Arnd Bergmann,
Tom Rini, Simon Horman, Frank Rowand, Linus Walleij,
Pantelis Antoniou, linux-kernel@vger.kernel.org, Bjorn Andersson,
open list:MEDIA DRIVERS FOR RENESAS - FCP, Mark Brown,
Jonathan Cameron, Olof Johansson, linuxppc-dev,
moderated list:ARM/FREESCALE IMX / MXC ARM ARCHITECTURE
In-Reply-To: <CAMuHMdU=rBV4b3EcenvtMPevx14pvTDcnQ7VDg02VZFiFuU-uw@mail.gmail.com>
On Mon, Oct 8, 2018 at 2:47 AM Geert Uytterhoeven <geert@linux-m68k.org> wrote:
>
> Hi Rob,
>
> On Fri, Oct 5, 2018 at 6:59 PM Rob Herring <robh@kernel.org> wrote:
> > Convert Renesas SoC bindings to DT schema format using json-schema.
> >
> > Cc: Simon Horman <horms@verge.net.au>
> > Cc: Magnus Damm <magnus.damm@gmail.com>
> > Cc: Mark Rutland <mark.rutland@arm.com>
> > Cc: linux-renesas-soc@vger.kernel.org
> > Cc: devicetree@vger.kernel.org
> > Signed-off-by: Rob Herring <robh@kernel.org>
>
> Thanks for your patch!
>
> Note that this will need a rebase, as more SoCs/boards have been added
> in -next.
>
> > --- /dev/null
> > +++ b/Documentation/devicetree/bindings/arm/shmobile.yaml
> > @@ -0,0 +1,205 @@
> > +# SPDX-License-Identifier: None
>
> The old file didn't have an SPDX header, so it was GPL-2.0, implicitly?
Right. I meant to update this with something. I'd prefer it be dual
licensed as these aren't just kernel files, but I don't really want to
try to gather permissions from all the copyright holders. And who is
the copyright holder when it is implicit? Everyone listed by git
blame?
> > +%YAML 1.2
> > +---
> > +$id: http://devicetree.org/schemas/bindings/arm/shmobile.yaml#
> > +$schema: http://devicetree.org/meta-schemas/core.yaml#
> > +
> > +title: Renesas SH-Mobile, R-Mobile, and R-Car Platform Device Tree Bindings
> > +
> > +maintainers:
> > + - Geert Uytterhoeven <geert+renesas@glider.be>
>
> Simon Horman <horms@verge.net.au> (supporter:ARM/SHMOBILE ARM ARCHITECTURE)
> Magnus Damm <magnus.damm@gmail.com> (supporter:ARM/SHMOBILE ARM ARCHITECTURE)
>
> You had it right in the CC list, though...
I generated it here from git log rather get_maintainers.pl because
get_maintainers.pl just lists me for a bunch of them.
> > + - description: RZ/G1M (R8A77430)
> > + items:
> > + - enum:
> > + # iWave Systems RZ/G1M Qseven Development Platform (iW-RainboW-G20D-Qseven)
> > + - iwave,g20d
> > + - const: iwave,g20m
> > + - const: renesas,r8a7743
> > +
> > + - items:
> > + - enum:
> > + # iWave Systems RZ/G1M Qseven System On Module (iW-RainboW-G20M-Qseven)
> > + - iwave,g20m
> > + - const: renesas,r8a7743
> > +
> > + - description: RZ/G1N (R8A77440)
> > + items:
> > + - enum:
> > + - renesas,sk-rzg1m # SK-RZG1M (YR8A77430S000BE)
>
> This board belongs under the RZ/G1M section above
> (see also the 7743 in the part number).
Indeed. Not sure how I screwed that one up.
> > + - const: renesas,r8a7744
>
> > + - description: Kingfisher (SBEV-RCAR-KF-M03)
> > + items:
> > + - const: shimafuji,kingfisher
> > + - enum:
> > + - renesas,h3ulcb
> > + - renesas,m3ulcb
> > + - enum:
> > + - renesas,r8a7795
> > + - renesas,r8a7796
>
> This looks a bit funny: all other entries have the "const" last, and
> use it for the
> SoC number. May be correct, though.
> To clarify, this is an extension board that can fit both the [HM]3ULCB
> boards (actually also the new M3NULCB, I think).
This being Kingfisher?
I wrote this based on dts files in the tree. There's 2 combinations that I see:
"shimafuji,kingfisher", "renesas,h3ulcb", "renesas,r8a7795"
"shimafuji,kingfisher", "renesas,m3ulcb", "renesas,r8a7796"
The schema allows 4 combinations (1 * 2 * 2). I have no idea if the
other combinations are possible. If not, then we could rewrite this as
2 entries with 3 const values each.
Rob
^ permalink raw reply
* Re: [PATCH 29/36] dt-bindings: arm: Convert Renesas board/soc bindings to json-schema
From: Rob Herring @ 2018-10-08 14:05 UTC (permalink / raw)
To: Simon Horman
Cc: Mark Rutland, devicetree, Kumar Gala, Grant Likely,
Sergei Shtylyov, Arnd Bergmann, Tom Rini, Frank Rowand,
Linus Walleij, Pantelis Antoniou, linux-kernel@vger.kernel.org,
Bjorn Andersson, open list:MEDIA DRIVERS FOR RENESAS - FCP,
Mark Brown, Geert Uytterhoeven, Jonathan Cameron, Olof Johansson,
linuxppc-dev,
moderated list:ARM/FREESCALE IMX / MXC ARM ARCHITECTURE
In-Reply-To: <20181008080220.rmxk57ckdfmwuk62@verge.net.au>
On Mon, Oct 8, 2018 at 3:02 AM Simon Horman <horms@verge.net.au> wrote:
>
> On Fri, Oct 05, 2018 at 11:58:41AM -0500, Rob Herring wrote:
> > Convert Renesas SoC bindings to DT schema format using json-schema.
> >
> > Cc: Simon Horman <horms@verge.net.au>
> > Cc: Magnus Damm <magnus.damm@gmail.com>
> > Cc: Mark Rutland <mark.rutland@arm.com>
> > Cc: linux-renesas-soc@vger.kernel.org
> > Cc: devicetree@vger.kernel.org
> > Signed-off-by: Rob Herring <robh@kernel.org>
>
> This seems fine to me other than that it does not seem
> to apply cleanly to next.
>
> shmobile.txt sees a couple of updates per release cycle so from my point of
> view it would ideal if this change could hit -rc1 to allow patches for
> v4.21 to be accepted smoothly (already one from Sergei will need rebasing).
When we get to the point of merging (which isn't going to be 4.20),
you and other maintainers can probably take all these patches. Other
than the few restructuring patches, the only dependency is the build
support which isn't a dependency to apply it, but build it. I plan to
build any patches as part of reviewing at least early on. OTOH, the
build support is small enough and self contained that maybe it can
just be applied for 4.20.
Rob
^ permalink raw reply
* Re: [PATCH 28/36] dt-bindings: arm: Convert Rockchip board/soc bindings to json-schema
From: Rob Herring @ 2018-10-08 13:46 UTC (permalink / raw)
To: heiko@sntech.de
Cc: Mark Rutland, devicetree, Kumar Gala, Grant Likely, Arnd Bergmann,
Tom Rini, Frank Rowand, Linus Walleij, Pantelis Antoniou,
linux-kernel@vger.kernel.org, Bjorn Andersson,
open list:ARM/Rockchip SoC..., Mark Brown, Geert Uytterhoeven,
Jonathan Cameron, Olof Johansson, linuxppc-dev,
moderated list:ARM/FREESCALE IMX / MXC ARM ARCHITECTURE
In-Reply-To: <1857752.ZLvpeyYpZr@phil>
On Mon, Oct 8, 2018 at 4:45 AM Heiko Stuebner <heiko@sntech.de> wrote:
>
> Hi Rob,
>
> either I'm misunderstanding that, or something did go a bit wrong during
> the conversion, as pointed out below:
>
> Am Freitag, 5. Oktober 2018, 18:58:40 CEST schrieb Rob Herring:
> > Convert Rockchip SoC bindings to DT schema format using json-schema.
> >
> > Cc: Mark Rutland <mark.rutland@arm.com>
> > Cc: Heiko Stuebner <heiko@sntech.de>
> > Cc: devicetree@vger.kernel.org
> > Cc: linux-arm-kernel@lists.infradead.org
> > Cc: linux-rockchip@lists.infradead.org
> > Signed-off-by: Rob Herring <robh@kernel.org>
> > ---
> > .../devicetree/bindings/arm/rockchip.txt | 220 ----------------
> > .../devicetree/bindings/arm/rockchip.yaml | 242 ++++++++++++++++++
> > 2 files changed, 242 insertions(+), 220 deletions(-)
> > delete mode 100644 Documentation/devicetree/bindings/arm/rockchip.txt
> > create mode 100644 Documentation/devicetree/bindings/arm/rockchip.yaml
> >
>
>
>
> > +properties:
> > + $nodename:
> > + const: '/'
> > + compatible:
> > + oneOf:
> > + - items:
> > + - enum:
> > + - amarula,vyasa-rk3288
> > + - asus,rk3288-tinker
> > + - radxa,rock2-square
> > + - chipspark,popmetal-rk3288
> > + - netxeon,r89
> > + - firefly,firefly-rk3288
> > + - firefly,firefly-rk3288-beta
> > + - firefly,firefly-rk3288-reload
> > + - mqmaker,miqi
> > + - rockchip,rk3288-fennec
> > + - const: rockchip,rk3288
>
> These are very much distinct boards, so shouldn't they also get
> individual entries including their existing description like the phytec
> or google boards below?
It is grouped by SoC compatible and # of compatible strings. So this
one is all the cases that have 2 compatible strings. It is simply
saying the 1st compatible string must be one of the enums and the 2nd
compatible string must be "rockchip,rk3288".
>
> Similarly why is it an enum for those, while the Google boards get a
> const for each compatible string?
Because each Google board is a fixed list of strings.
> Most non-google boards below also lost their description and where lumped
> together into combined entries. Was that intentional?
If the description was just repeating the compatible string with
spaces and capitalization, then yes it was intentional. If your
description matches what you have for 'model', then I'd prefer to see
model added as a property schema.
Rob
^ permalink raw reply
* Re: [PATCH 22/36] dt-bindings: arm: Convert FSL board/soc bindings to json-schema
From: Rob Herring @ 2018-10-08 13:30 UTC (permalink / raw)
To: Shawn Guo
Cc: Mark Rutland, devicetree, Kumar Gala, Grant Likely, Arnd Bergmann,
Tom Rini, Frank Rowand, Linus Walleij, Pantelis Antoniou,
linux-kernel@vger.kernel.org, Bjorn Andersson, Mark Brown,
Geert Uytterhoeven, Jonathan Cameron, Olof Johansson,
linuxppc-dev,
moderated list:ARM/FREESCALE IMX / MXC ARM ARCHITECTURE
In-Reply-To: <20181008070142.GM3587@dragon>
On Mon, Oct 8, 2018 at 2:02 AM Shawn Guo <shawnguo@kernel.org> wrote:
>
> On Fri, Oct 05, 2018 at 11:58:34AM -0500, Rob Herring wrote:
> > Convert Freescale SoC bindings to DT schema format using json-schema.
> > +properties:
> > + $nodename:
> > + const: '/'
> > + compatible:
> > + oneOf:
> > + - description: i.MX23 based Boards
> > + items:
> > + - enum:
> > + - fsl,imx23-evk
> > + - olimex,imx23-olinuxino
> > + - const: fsl,imx23
> > +
> > + - description: i.MX25 Product Development Kit
> > + items:
> > + - enum:
> > + - fsl,imx25-pdk
> > + - const: fsl,imx25
> > +
> > + - description: i.MX27 Product Development Kit
> > + items:
> > + - enum:
> > + - fsl,imx27-pdk
> > + - const: fsl,imx27
> > +
> > + - description: i.MX28 based Boards
> > + items:
> > + - enum:
> > + - fsl,imx28-evk
> > + - i2se,duckbill
> > + - i2se,duckbill-2
> > + - technologic,imx28-ts4600
> > + - const: fsl,imx28
> > + - items:
>
> The schema is new to me. This line looks unusual to me, so you may want
> to double check.
It's fine. There's just no description schema on this one as it's a
continuation of the previous one (logically, but not from a schema
perspective). Perhaps add "i.MX28 I2SE Duckbill 2 based boards".
> > + - enum:
> > + - i2se,duckbill-2-485
> > + - i2se,duckbill-2-enocean
> > + - i2se,duckbill-2-spi
> > + - const: i2se,duckbill-2
> > + - const: fsl,imx28
> > +
> > + - description: i.MX51 Babbage Board
^ permalink raw reply
* Re: [PATCH v5 0/9] powerpc: Switch to CONFIG_THREAD_INFO_IN_TASK
From: Christophe Leroy @ 2018-10-08 13:30 UTC (permalink / raw)
To: Michael Ellerman, Benjamin Herrenschmidt, Paul Mackerras
Cc: aneesh.kumar@linux.ibm.com, linuxppc-dev, linux-kernel
In-Reply-To: <87pnwk1yw4.fsf@concordia.ellerman.id.au>
On 10/08/2018 11:06 AM, Michael Ellerman wrote:
> Christophe Leroy <christophe.leroy@c-s.fr> writes:
>
>> The purpose of this serie is to activate CONFIG_THREAD_INFO_IN_TASK which
>> moves the thread_info into task_struct.
>>
>> Moving thread_info into task_struct has the following advantages:
>> - It protects thread_info from corruption in the case of stack
>> overflows.
>> - Its address is harder to determine if stack addresses are
>> leaked, making a number of attacks more difficult.
>
> This is blowing up pretty nicely with CONFIG_KMEMLEAK enabled, haven't
> had time to dig further:
Nice :)
I have the same issue on PPC32.
Seems like when descending the stack, save_context_stack() calls
validate_sp(), which in turn calls valid_irq_stack() when the first test
fails.
But than early, hardirq_ctx[cpu] is NULL.
With sp = 0, valid_irq_stack() used to return false because it expected
sp to be above the thread_info. But now that thread_info is gone, sp = 0
is valid when stack = NULL.
The following fixes it:
diff --git a/arch/powerpc/kernel/process.c b/arch/powerpc/kernel/process.c
index afe76f7f316c..3e534147fd8f 100644
--- a/arch/powerpc/kernel/process.c
+++ b/arch/powerpc/kernel/process.c
@@ -2006,6 +2006,9 @@ int validate_sp(unsigned long sp, struct
task_struct *p,
{
unsigned long stack_page = (unsigned long)task_stack_page(p);
+ if (sp < THREAD_SIZE)
+ return 0;
+
if (sp >= stack_page + sizeof(struct thread_struct)
&& sp <= stack_page + THREAD_SIZE - nbytes)
return 1;
Looking at this I also realise I forgot to remove the sizeof(struct
thread_struct) from here. And this sizeof() was buggy, it should have
been thread_info instead of thread_struct, but nevermind as it is going
away.
Christophe
>
> Unable to handle kernel paging request for data at address 0x00000000
> Faulting instruction address: 0xc000000000022064
> Oops: Kernel access of bad area, sig: 11 [#9]
> LE SMP NR_CPUS=32 NUMA
> Modules linked in:
> CPU: 0 PID: 0 Comm: swapper Not tainted 4.19.0-rc3-gcc-7.3.1-00103-gc795acc08338 #268
> NIP: c000000000022064 LR: c0000000000220c0 CTR: c00000000001f5c0
> REGS: c000000001244a50 TRAP: 0380 Not tainted (4.19.0-rc3-gcc-7.3.1-00103-gc795acc08338)
> MSR: 8000000000001033 <SF,ME,IR,DR,RI,LE> CR: 48022244 XER: 20000000
> CFAR: c0000000000220c4 IRQMASK: 1
> GPR00: c0000000000220c0 c000000001244cd0 c00000000124b200 0000000000000001
> GPR04: c000000001201180 0000000000000070 c000000001275ef8 0000000000000000
> GPR08: 0000000000000000 0000000000000001 0000000000003f90 2b6e6f6d6d6f635f
> GPR12: c00000000001f5c0 c000000001450000 0000000000000000 0000000002e2be38
> GPR16: 000000007dc54c70 0000000002d854b8 0000000000000000 c000000000d87f00
> GPR20: c000000000d87ef0 c000000000d87ee0 c000000000d87f08 c00000000006c1a8
> GPR24: c000000000d87ec8 0000000000000000 7265677368657265 c000000000062a04
> GPR28: 0000000000000006 c000000001201180 0000000000000000 0000000000000000
> NIP [c000000000022064] show_stack+0xe4/0x2b0
> LR [c0000000000220c0] show_stack+0x140/0x2b0
> Call Trace:
> [c000000001244cd0] [c00000000002217c] show_stack+0x1fc/0x2b0 (unreliable)
> [c000000001244da0] [c00000000002245c] show_regs+0x22c/0x430
> [c000000001244e50] [c00000000002ae8c] __die+0xfc/0x140
> [c000000001244ed0] [c00000000002b954] die+0x74/0xf0
> [c000000001244f10] [c00000000006e0f8] bad_page_fault+0xe8/0x180
> [c000000001244f80] [c000000000074f48] slb_miss_large_addr+0x68/0x2e0
> [c000000001244fc0] [c000000000008ce8] large_addr_slb+0x158/0x160
> --- interrupt: 380 at show_stack+0xe4/0x2b0
> LR = show_stack+0x140/0x2b0
> [c0000000012452b0] [c00000000002217c] show_stack+0x1fc/0x2b0 (unreliable)
> [c000000001245380] [c00000000002245c] show_regs+0x22c/0x430
> [c000000001245430] [c00000000002ae8c] __die+0xfc/0x140
> [c0000000012454b0] [c00000000002b954] die+0x74/0xf0
> [c0000000012454f0] [c00000000006e0f8] bad_page_fault+0xe8/0x180
> [c000000001245560] [c000000000074f48] slb_miss_large_addr+0x68/0x2e0
> [c0000000012455a0] [c000000000008ce8] large_addr_slb+0x158/0x160
> --- interrupt: 380 at show_stack+0xe4/0x2b0
> LR = show_stack+0x140/0x2b0
> [c000000001245890] [c00000000002217c] show_stack+0x1fc/0x2b0 (unreliable)
> [c000000001245960] [c00000000002245c] show_regs+0x22c/0x430
> [c000000001245a10] [c00000000002ae8c] __die+0xfc/0x140
> [c000000001245a90] [c00000000002b954] die+0x74/0xf0
> [c000000001245ad0] [c00000000006e0f8] bad_page_fault+0xe8/0x180
> [c000000001245b40] [c000000000074f48] slb_miss_large_addr+0x68/0x2e0
> [c000000001245b80] [c000000000008ce8] large_addr_slb+0x158/0x160
> --- interrupt: 380 at show_stack+0xe4/0x2b0
> LR = show_stack+0x140/0x2b0
> [c000000001245e70] [c00000000002217c] show_stack+0x1fc/0x2b0 (unreliable)
> [c000000001245f40] [c00000000002245c] show_regs+0x22c/0x430
> [c000000001245ff0] [c00000000002ae8c] __die+0xfc/0x140
> [c000000001246070] [c00000000002b954] die+0x74/0xf0
> [c0000000012460b0] [c00000000006e0f8] bad_page_fault+0xe8/0x180
> [c000000001246120] [c000000000074f48] slb_miss_large_addr+0x68/0x2e0
> [c000000001246160] [c000000000008ce8] large_addr_slb+0x158/0x160
> --- interrupt: 380 at show_stack+0xe4/0x2b0
> LR = show_stack+0x140/0x2b0
> [c000000001246450] [c00000000002217c] show_stack+0x1fc/0x2b0 (unreliable)
> [c000000001246520] [c00000000002245c] show_regs+0x22c/0x430
> [c0000000012465d0] [c00000000002ae8c] __die+0xfc/0x140
> [c000000001246650] [c00000000002b954] die+0x74/0xf0
> [c000000001246690] [c00000000006e0f8] bad_page_fault+0xe8/0x180
> [c000000001246700] [c000000000074f48] slb_miss_large_addr+0x68/0x2e0
> [c000000001246740] [c000000000008ce8] large_addr_slb+0x158/0x160
> --- interrupt: 380 at show_stack+0xe4/0x2b0
> LR = show_stack+0x140/0x2b0
> [c000000001246a30] [c00000000002217c] show_stack+0x1fc/0x2b0 (unreliable)
> [c000000001246b00] [c00000000002245c] show_regs+0x22c/0x430
> [c000000001246bb0] [c00000000002ae8c] __die+0xfc/0x140
> [c000000001246c30] [c00000000002b954] die+0x74/0xf0
> [c000000001246c70] [c00000000006e0f8] bad_page_fault+0xe8/0x180
> [c000000001246ce0] [c000000000074f48] slb_miss_large_addr+0x68/0x2e0
> [c000000001246d20] [c000000000008ce8] large_addr_slb+0x158/0x160
> --- interrupt: 380 at show_stack+0xe4/0x2b0
> LR = show_stack+0x140/0x2b0
> [c000000001247010] [c00000000002217c] show_stack+0x1fc/0x2b0 (unreliable)
> [c0000000012470e0] [c00000000002245c] show_regs+0x22c/0x430
> [c000000001247190] [c00000000002ae8c] __die+0xfc/0x140
> [c000000001247210] [c00000000002b954] die+0x74/0xf0
> [c000000001247250] [c00000000006e0f8] bad_page_fault+0xe8/0x180
> [c0000000012472c0] [c000000000074f48] slb_miss_large_addr+0x68/0x2e0
> [c000000001247300] [c000000000008ce8] large_addr_slb+0x158/0x160
> --- interrupt: 380 at show_stack+0xe4/0x2b0
> LR = show_stack+0x140/0x2b0
> [c0000000012475f0] [c00000000002217c] show_stack+0x1fc/0x2b0 (unreliable)
> [c0000000012476c0] [c00000000002245c] show_regs+0x22c/0x430
> [c000000001247770] [c00000000002ae8c] __die+0xfc/0x140
> [c0000000012477f0] [c00000000002b954] die+0x74/0xf0
> [c000000001247830] [c00000000006e0f8] bad_page_fault+0xe8/0x180
> [c0000000012478a0] [c000000000074f48] slb_miss_large_addr+0x68/0x2e0
> [c0000000012478e0] [c000000000008ce8] large_addr_slb+0x158/0x160
> --- interrupt: 380 at save_context_stack+0x70/0x110
> LR = save_context_stack+0x64/0x110
> [c000000001247bd0] [c000000001247c10] init_stack+0x3c10/0x4000 (unreliable)
> [c000000001247c10] [c000000000ee2268] log_early+0xc0/0x100
> [c000000001247c70] [c000000000ede7f8] memblock_virt_alloc_internal+0x1cc/0x210
> [c000000001247d20] [c000000000edec00] memblock_virt_alloc_try_nid+0x94/0xfc
> [c000000001247db0] [c000000000f08efc] early_init_dt_alloc_memory_arch+0x2c/0x40
> [c000000001247dd0] [c000000000991200] __unflatten_device_tree+0xa0/0x1e0
> [c000000001247e60] [c000000000f0a1d8] unflatten_device_tree+0x48/0x68
> [c000000001247e90] [c000000000eab6fc] setup_arch+0x4c/0x3fc
> [c000000001247f00] [c000000000ea3df8] start_kernel+0x88/0x604
> Instruction dump:
> 3ec2ffb4 3b800041 3bc00001 3b600000 3b18ccc8 3a73cd00 3a94ccf0 3ab5cce0
> 635a7265 3ad6cd08 48000054 2e3e0000 <ea5f0000> ebdf0010 419200e8 7fbbf040
> random: get_random_bytes called from print_oops_end_marker+0x6c/0xa0 with crng_init=0
> ---[ end trace 0000000000000000 ]---
>
>
>
> cheers
>
^ permalink raw reply related
* Re: [PATCH 29/36] dt-bindings: arm: Convert Renesas board/soc bindings to json-schema
From: Simon Horman @ 2018-10-08 8:02 UTC (permalink / raw)
To: Rob Herring
Cc: Mark Rutland, devicetree, Kumar Gala, Grant Likely,
Sergei Shtylyov, Arnd Bergmann, Tom Rini, Frank Rowand,
Linus Walleij, Pantelis Antoniou, linux-kernel, Bjorn Andersson,
linux-renesas-soc, Mark Brown, Geert Uytterhoeven,
Jonathan Cameron, Olof Johansson, linuxppc-dev, linux-arm-kernel
In-Reply-To: <20181005165848.3474-30-robh@kernel.org>
On Fri, Oct 05, 2018 at 11:58:41AM -0500, Rob Herring wrote:
> Convert Renesas SoC bindings to DT schema format using json-schema.
>
> Cc: Simon Horman <horms@verge.net.au>
> Cc: Magnus Damm <magnus.damm@gmail.com>
> Cc: Mark Rutland <mark.rutland@arm.com>
> Cc: linux-renesas-soc@vger.kernel.org
> Cc: devicetree@vger.kernel.org
> Signed-off-by: Rob Herring <robh@kernel.org>
This seems fine to me other than that it does not seem
to apply cleanly to next.
shmobile.txt sees a couple of updates per release cycle so from my point of
view it would ideal if this change could hit -rc1 to allow patches for
v4.21 to be accepted smoothly (already one from Sergei will need rebasing).
> ---
> .../devicetree/bindings/arm/shmobile.txt | 143 ------------
> .../devicetree/bindings/arm/shmobile.yaml | 205 ++++++++++++++++++
> 2 files changed, 205 insertions(+), 143 deletions(-)
> delete mode 100644 Documentation/devicetree/bindings/arm/shmobile.txt
> create mode 100644 Documentation/devicetree/bindings/arm/shmobile.yaml
>
> diff --git a/Documentation/devicetree/bindings/arm/shmobile.txt b/Documentation/devicetree/bindings/arm/shmobile.txt
> deleted file mode 100644
> index 619b765e5bee..000000000000
> --- a/Documentation/devicetree/bindings/arm/shmobile.txt
> +++ /dev/null
> @@ -1,143 +0,0 @@
> -Renesas SH-Mobile, R-Mobile, and R-Car Platform Device Tree Bindings
> ---------------------------------------------------------------------
> -
> -SoCs:
> -
> - - Emma Mobile EV2
> - compatible = "renesas,emev2"
> - - RZ/A1H (R7S72100)
> - compatible = "renesas,r7s72100"
> - - SH-Mobile AG5 (R8A73A00/SH73A0)
> - compatible = "renesas,sh73a0"
> - - R-Mobile APE6 (R8A73A40)
> - compatible = "renesas,r8a73a4"
> - - R-Mobile A1 (R8A77400)
> - compatible = "renesas,r8a7740"
> - - RZ/G1H (R8A77420)
> - compatible = "renesas,r8a7742"
> - - RZ/G1M (R8A77430)
> - compatible = "renesas,r8a7743"
> - - RZ/G1N (R8A77440)
> - compatible = "renesas,r8a7744"
> - - RZ/G1E (R8A77450)
> - compatible = "renesas,r8a7745"
> - - RZ/G1C (R8A77470)
> - compatible = "renesas,r8a77470"
> - - R-Car M1A (R8A77781)
> - compatible = "renesas,r8a7778"
> - - R-Car H1 (R8A77790)
> - compatible = "renesas,r8a7779"
> - - R-Car H2 (R8A77900)
> - compatible = "renesas,r8a7790"
> - - R-Car M2-W (R8A77910)
> - compatible = "renesas,r8a7791"
> - - R-Car V2H (R8A77920)
> - compatible = "renesas,r8a7792"
> - - R-Car M2-N (R8A77930)
> - compatible = "renesas,r8a7793"
> - - R-Car E2 (R8A77940)
> - compatible = "renesas,r8a7794"
> - - R-Car H3 (R8A77950)
> - compatible = "renesas,r8a7795"
> - - R-Car M3-W (R8A77960)
> - compatible = "renesas,r8a7796"
> - - R-Car M3-N (R8A77965)
> - compatible = "renesas,r8a77965"
> - - R-Car V3M (R8A77970)
> - compatible = "renesas,r8a77970"
> - - R-Car V3H (R8A77980)
> - compatible = "renesas,r8a77980"
> - - R-Car E3 (R8A77990)
> - compatible = "renesas,r8a77990"
> - - R-Car D3 (R8A77995)
> - compatible = "renesas,r8a77995"
> - - RZ/N1D (R9A06G032)
> - compatible = "renesas,r9a06g032"
> -
> -Boards:
> -
> - - Alt (RTP0RC7794SEB00010S)
> - compatible = "renesas,alt", "renesas,r8a7794"
> - - APE6-EVM
> - compatible = "renesas,ape6evm", "renesas,r8a73a4"
> - - Atmark Techno Armadillo-800 EVA
> - compatible = "renesas,armadillo800eva", "renesas,r8a7740"
> - - Blanche (RTP0RC7792SEB00010S)
> - compatible = "renesas,blanche", "renesas,r8a7792"
> - - BOCK-W
> - compatible = "renesas,bockw", "renesas,r8a7778"
> - - Condor (RTP0RC77980SEB0010SS/RTP0RC77980SEB0010SA01)
> - compatible = "renesas,condor", "renesas,r8a77980"
> - - Draak (RTP0RC77995SEB0010S)
> - compatible = "renesas,draak", "renesas,r8a77995"
> - - Eagle (RTP0RC77970SEB0010S)
> - compatible = "renesas,eagle", "renesas,r8a77970"
> - - Ebisu (RTP0RC77990SEB0010S)
> - compatible = "renesas,ebisu", "renesas,r8a77990"
> - - Genmai (RTK772100BC00000BR)
> - compatible = "renesas,genmai", "renesas,r7s72100"
> - - GR-Peach (X28A-M01-E/F)
> - compatible = "renesas,gr-peach", "renesas,r7s72100"
> - - Gose (RTP0RC7793SEB00010S)
> - compatible = "renesas,gose", "renesas,r8a7793"
> - - H3ULCB (R-Car Starter Kit Premier, RTP0RC7795SKBX0010SA00 (H3 ES1.1))
> - H3ULCB (R-Car Starter Kit Premier, RTP0RC77951SKBX010SA00 (H3 ES2.0))
> - compatible = "renesas,h3ulcb", "renesas,r8a7795"
> - - Henninger
> - compatible = "renesas,henninger", "renesas,r8a7791"
> - - iWave Systems RZ/G1C Single Board Computer (iW-RainboW-G23S)
> - compatible = "iwave,g23s", "renesas,r8a77470"
> - - iWave Systems RZ/G1E SODIMM SOM Development Platform (iW-RainboW-G22D)
> - compatible = "iwave,g22d", "iwave,g22m", "renesas,r8a7745"
> - - iWave Systems RZ/G1E SODIMM System On Module (iW-RainboW-G22M-SM)
> - compatible = "iwave,g22m", "renesas,r8a7745"
> - - iWave Systems RZ/G1M Qseven Development Platform (iW-RainboW-G20D-Qseven)
> - compatible = "iwave,g20d", "iwave,g20m", "renesas,r8a7743"
> - - iWave Systems RZ/G1M Qseven System On Module (iW-RainboW-G20M-Qseven)
> - compatible = "iwave,g20m", "renesas,r8a7743"
> - - Kingfisher (SBEV-RCAR-KF-M03)
> - compatible = "shimafuji,kingfisher"
> - - Koelsch (RTP0RC7791SEB00010S)
> - compatible = "renesas,koelsch", "renesas,r8a7791"
> - - Kyoto Microcomputer Co. KZM-A9-Dual
> - compatible = "renesas,kzm9d", "renesas,emev2"
> - - Kyoto Microcomputer Co. KZM-A9-GT
> - compatible = "renesas,kzm9g", "renesas,sh73a0"
> - - Lager (RTP0RC7790SEB00010S)
> - compatible = "renesas,lager", "renesas,r8a7790"
> - - M3ULCB (R-Car Starter Kit Pro, RTP0RC7796SKBX0010SA09 (M3 ES1.0))
> - compatible = "renesas,m3ulcb", "renesas,r8a7796"
> - - Marzen (R0P7779A00010S)
> - compatible = "renesas,marzen", "renesas,r8a7779"
> - - Porter (M2-LCDP)
> - compatible = "renesas,porter", "renesas,r8a7791"
> - - RSKRZA1 (YR0K77210C000BE)
> - compatible = "renesas,rskrza1", "renesas,r7s72100"
> - - RZN1D-DB (RZ/N1D Demo Board for the RZ/N1D 400 pins package)
> - compatible = "renesas,rzn1d400-db", "renesas,r9a06g032"
> - - Salvator-X (RTP0RC7795SIPB0010S)
> - compatible = "renesas,salvator-x", "renesas,r8a7795"
> - - Salvator-X (RTP0RC7796SIPB0011S)
> - compatible = "renesas,salvator-x", "renesas,r8a7796"
> - - Salvator-X (RTP0RC7796SIPB0011S (M3-N))
> - compatible = "renesas,salvator-x", "renesas,r8a77965"
> - - Salvator-XS (Salvator-X 2nd version, RTP0RC7795SIPB0012S)
> - compatible = "renesas,salvator-xs", "renesas,r8a7795"
> - - Salvator-XS (Salvator-X 2nd version, RTP0RC7796SIPB0012S)
> - compatible = "renesas,salvator-xs", "renesas,r8a7796"
> - - Salvator-XS (Salvator-X 2nd version, RTP0RC77965SIPB012S)
> - compatible = "renesas,salvator-xs", "renesas,r8a77965"
> - - SILK (RTP0RC7794LCB00011S)
> - compatible = "renesas,silk", "renesas,r8a7794"
> - - SK-RZG1E (YR8A77450S000BE)
> - compatible = "renesas,sk-rzg1e", "renesas,r8a7745"
> - - SK-RZG1M (YR8A77430S000BE)
> - compatible = "renesas,sk-rzg1m", "renesas,r8a7743"
> - - Stout (ADAS Starterkit, Y-R-CAR-ADAS-SKH2-BOARD)
> - compatible = "renesas,stout", "renesas,r8a7790"
> - - V3HSK (Y-ASK-RCAR-V3H-WS10)
> - compatible = "renesas,v3hsk", "renesas,r8a77980"
> - - V3MSK (Y-ASK-RCAR-V3M-WS10)
> - compatible = "renesas,v3msk", "renesas,r8a77970"
> - - Wheat (RTP0RC7792ASKB0000JE)
> - compatible = "renesas,wheat", "renesas,r8a7792"
> diff --git a/Documentation/devicetree/bindings/arm/shmobile.yaml b/Documentation/devicetree/bindings/arm/shmobile.yaml
> new file mode 100644
> index 000000000000..31009e7fb0ea
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/arm/shmobile.yaml
> @@ -0,0 +1,205 @@
> +# SPDX-License-Identifier: None
> +%YAML 1.2
> +---
> +$id: http://devicetree.org/schemas/bindings/arm/shmobile.yaml#
> +$schema: http://devicetree.org/meta-schemas/core.yaml#
> +
> +title: Renesas SH-Mobile, R-Mobile, and R-Car Platform Device Tree Bindings
> +
> +maintainers:
> + - Geert Uytterhoeven <geert+renesas@glider.be>
> +
> +properties:
> + $nodename:
> + const: '/'
> + compatible:
> + oneOf:
> + - description: Emma Mobile EV2
> + items:
> + - enum:
> + - renesas,kzm9d # Kyoto Microcomputer Co. KZM-A9-Dual
> + - const: renesas,emev2
> +
> + - description: RZ/A1H (R7S72100)
> + items:
> + - enum:
> + - renesas,genmai # Genmai (RTK772100BC00000BR)
> + - renesas,gr-peach # GR-Peach (X28A-M01-E/F)
> + - renesas,rskrza1 # RSKRZA1 (YR0K77210C000BE)
> + - const: renesas,r7s72100
> +
> + - description: SH-Mobile AG5 (R8A73A00/SH73A0)
> + items:
> + - enum:
> + - renesas,kzm9g # Kyoto Microcomputer Co. KZM-A9-GT
> + - const: renesas,sh73a0
> +
> + - description: R-Mobile APE6 (R8A73A40)
> + items:
> + - enum:
> + - renesas,ape6evm
> + - const: renesas,r8a73a4
> +
> + - description: R-Mobile A1 (R8A77400)
> + items:
> + - enum:
> + - renesas,armadillo800eva # Atmark Techno Armadillo-800 EVA
> + - const: renesas,r8a7740
> +
> + - description: RZ/G1H (R8A77420)
> + items:
> + - const: renesas,r8a7742
> +
> + - description: RZ/G1M (R8A77430)
> + items:
> + - enum:
> + # iWave Systems RZ/G1M Qseven Development Platform (iW-RainboW-G20D-Qseven)
> + - iwave,g20d
> + - const: iwave,g20m
> + - const: renesas,r8a7743
> +
> + - items:
> + - enum:
> + # iWave Systems RZ/G1M Qseven System On Module (iW-RainboW-G20M-Qseven)
> + - iwave,g20m
> + - const: renesas,r8a7743
> +
> + - description: RZ/G1N (R8A77440)
> + items:
> + - enum:
> + - renesas,sk-rzg1m # SK-RZG1M (YR8A77430S000BE)
> + - const: renesas,r8a7744
> +
> + - description: RZ/G1E (R8A77450)
> + items:
> + - enum:
> + - iwave,g22m # iWave Systems RZ/G1E SODIMM System On Module (iW-RainboW-G22M-SM)
> + - renesas,sk-rzg1e # SK-RZG1E (YR8A77450S000BE)
> + - const: renesas,r8a7745
> + - items:
> + # iWave Systems RZ/G1E SODIMM SOM Development Platform (iW-RainboW-G22D)
> + - const: iwave,g22d
> + - const: iwave,g22m
> + - const: renesas,r8a7745
> +
> + - description: RZ/G1C (R8A77470)
> + items:
> + - enum:
> + - iwave,g23s #iWave Systems RZ/G1C Single Board Computer (iW-RainboW-G23S)
> + - const: renesas,r8a77470
> +
> + - description: R-Car M1A (R8A77781)
> + items:
> + - enum:
> + - renesas,bockw
> + - const: renesas,r8a7778
> +
> + - description: R-Car H1 (R8A77790)
> + items:
> + - enum:
> + - renesas,marzen # Marzen (R0P7779A00010S)
> + - renesas,stout # Stout (ADAS Starterkit, Y-R-CAR-ADAS-SKH2-BOARD)
> + - const: renesas,r8a7779
> +
> + - description: R-Car H2 (R8A77900)
> + items:
> + - enum:
> + - renesas,lager # Lager (RTP0RC7790SEB00010S)
> + - const: renesas,r8a7790
> +
> + - description: R-Car M2-W (R8A77910)
> + items:
> + - enum:
> + - renesas,henninger
> + - renesas,koelsch # Koelsch (RTP0RC7791SEB00010S)
> + - renesas,porter # Porter (M2-LCDP)
> + - const: renesas,r8a7791
> +
> + - description: R-Car V2H (R8A77920)
> + items:
> + - enum:
> + - renesas,blanche # Blanche (RTP0RC7792SEB00010S)
> + - renesas,wheat # Wheat (RTP0RC7792ASKB0000JE)
> + - const: renesas,r8a7792
> +
> + - description: R-Car M2-N (R8A77930)
> + items:
> + - enum:
> + - renesas,gose # Gose (RTP0RC7793SEB00010S)
> + - const: renesas,r8a7793
> +
> + - description: R-Car E2 (R8A77940)
> + items:
> + - enum:
> + - renesas,alt # Alt (RTP0RC7794SEB00010S)
> + - renesas,silk # SILK (RTP0RC7794LCB00011S)
> + - const: renesas,r8a7794
> +
> + - description: R-Car H3 (R8A77950)
> + items:
> + - enum:
> + # H3ULCB (R-Car Starter Kit Premier, RTP0RC7795SKBX0010SA00 (H3 ES1.1))
> + # H3ULCB (R-Car Starter Kit Premier, RTP0RC77951SKBX010SA00 (H3 ES2.0))
> + - renesas,h3ulcb
> + - renesas,salvator-x # Salvator-X (RTP0RC7795SIPB0010S)
> + - renesas,salvator-xs # Salvator-XS (Salvator-X 2nd version, RTP0RC7795SIPB0012S)
> + - const: renesas,r8a7795
> +
> + - description: R-Car M3-W (R8A77960)
> + items:
> + - enum:
> + - renesas,m3ulcb # M3ULCB (R-Car Starter Kit Pro, RTP0RC7796SKBX0010SA09 (M3 ES1.0))
> + - renesas,salvator-x # Salvator-X (RTP0RC7796SIPB0011S)
> + - renesas,salvator-xs # Salvator-XS (Salvator-X 2nd version, RTP0RC7796SIPB0012S)
> + - const: renesas,r8a7796
> +
> + - description: Kingfisher (SBEV-RCAR-KF-M03)
> + items:
> + - const: shimafuji,kingfisher
> + - enum:
> + - renesas,h3ulcb
> + - renesas,m3ulcb
> + - enum:
> + - renesas,r8a7795
> + - renesas,r8a7796
> +
> + - description: R-Car M3-N (R8A77965)
> + items:
> + - enum:
> + - renesas,salvator-x # Salvator-X (RTP0RC7796SIPB0011S (M3-N))
> + - renesas,salvator-xs # Salvator-XS (Salvator-X 2nd version, RTP0RC77965SIPB012S)
> + - const: renesas,r8a77965
> +
> + - description: R-Car V3M (R8A77970)
> + items:
> + - enum:
> + - renesas,eagle # Eagle (RTP0RC77970SEB0010S)
> + - renesas,v3msk # V3MSK (Y-ASK-RCAR-V3M-WS10)
> + - const: renesas,r8a77970
> +
> + - description: R-Car V3H (R8A77980)
> + items:
> + - enum:
> + - renesas,condor # Condor (RTP0RC77980SEB0010SS/RTP0RC77980SEB0010SA01)
> + - renesas,v3hsk # V3HSK (Y-ASK-RCAR-V3H-WS10)
> + - const: renesas,r8a77980
> +
> + - description: R-Car E3 (R8A77990)
> + items:
> + - enum:
> + - renesas,ebisu # Ebisu (RTP0RC77990SEB0010S)
> + - const: renesas,r8a77990
> +
> + - description: R-Car D3 (R8A77995)
> + items:
> + - enum:
> + - renesas,draak # Draak (RTP0RC77995SEB0010S)
> + - const: renesas,r8a77995
> +
> + - description: RZ/N1D (R9A06G032)
> + items:
> + - enum:
> + - renesas,rzn1d400-db # RZN1D-DB (RZ/N1D Demo Board for the RZ/N1D 400 pins package)
> + - const: renesas,r9a06g032
> +
> +...
> --
> 2.17.1
>
^ permalink raw reply
* Re: [PATCH v5 0/9] powerpc: Switch to CONFIG_THREAD_INFO_IN_TASK
From: Michael Ellerman @ 2018-10-08 11:06 UTC (permalink / raw)
To: Christophe Leroy, Benjamin Herrenschmidt, Paul Mackerras
Cc: aneesh.kumar, linuxppc-dev, linux-kernel
In-Reply-To: <cover.1538687073.git.christophe.leroy@c-s.fr>
Christophe Leroy <christophe.leroy@c-s.fr> writes:
> The purpose of this serie is to activate CONFIG_THREAD_INFO_IN_TASK which
> moves the thread_info into task_struct.
>
> Moving thread_info into task_struct has the following advantages:
> - It protects thread_info from corruption in the case of stack
> overflows.
> - Its address is harder to determine if stack addresses are
> leaked, making a number of attacks more difficult.
This is blowing up pretty nicely with CONFIG_KMEMLEAK enabled, haven't
had time to dig further:
Unable to handle kernel paging request for data at address 0x00000000
Faulting instruction address: 0xc000000000022064
Oops: Kernel access of bad area, sig: 11 [#9]
LE SMP NR_CPUS=32 NUMA
Modules linked in:
CPU: 0 PID: 0 Comm: swapper Not tainted 4.19.0-rc3-gcc-7.3.1-00103-gc795acc08338 #268
NIP: c000000000022064 LR: c0000000000220c0 CTR: c00000000001f5c0
REGS: c000000001244a50 TRAP: 0380 Not tainted (4.19.0-rc3-gcc-7.3.1-00103-gc795acc08338)
MSR: 8000000000001033 <SF,ME,IR,DR,RI,LE> CR: 48022244 XER: 20000000
CFAR: c0000000000220c4 IRQMASK: 1
GPR00: c0000000000220c0 c000000001244cd0 c00000000124b200 0000000000000001
GPR04: c000000001201180 0000000000000070 c000000001275ef8 0000000000000000
GPR08: 0000000000000000 0000000000000001 0000000000003f90 2b6e6f6d6d6f635f
GPR12: c00000000001f5c0 c000000001450000 0000000000000000 0000000002e2be38
GPR16: 000000007dc54c70 0000000002d854b8 0000000000000000 c000000000d87f00
GPR20: c000000000d87ef0 c000000000d87ee0 c000000000d87f08 c00000000006c1a8
GPR24: c000000000d87ec8 0000000000000000 7265677368657265 c000000000062a04
GPR28: 0000000000000006 c000000001201180 0000000000000000 0000000000000000
NIP [c000000000022064] show_stack+0xe4/0x2b0
LR [c0000000000220c0] show_stack+0x140/0x2b0
Call Trace:
[c000000001244cd0] [c00000000002217c] show_stack+0x1fc/0x2b0 (unreliable)
[c000000001244da0] [c00000000002245c] show_regs+0x22c/0x430
[c000000001244e50] [c00000000002ae8c] __die+0xfc/0x140
[c000000001244ed0] [c00000000002b954] die+0x74/0xf0
[c000000001244f10] [c00000000006e0f8] bad_page_fault+0xe8/0x180
[c000000001244f80] [c000000000074f48] slb_miss_large_addr+0x68/0x2e0
[c000000001244fc0] [c000000000008ce8] large_addr_slb+0x158/0x160
--- interrupt: 380 at show_stack+0xe4/0x2b0
LR = show_stack+0x140/0x2b0
[c0000000012452b0] [c00000000002217c] show_stack+0x1fc/0x2b0 (unreliable)
[c000000001245380] [c00000000002245c] show_regs+0x22c/0x430
[c000000001245430] [c00000000002ae8c] __die+0xfc/0x140
[c0000000012454b0] [c00000000002b954] die+0x74/0xf0
[c0000000012454f0] [c00000000006e0f8] bad_page_fault+0xe8/0x180
[c000000001245560] [c000000000074f48] slb_miss_large_addr+0x68/0x2e0
[c0000000012455a0] [c000000000008ce8] large_addr_slb+0x158/0x160
--- interrupt: 380 at show_stack+0xe4/0x2b0
LR = show_stack+0x140/0x2b0
[c000000001245890] [c00000000002217c] show_stack+0x1fc/0x2b0 (unreliable)
[c000000001245960] [c00000000002245c] show_regs+0x22c/0x430
[c000000001245a10] [c00000000002ae8c] __die+0xfc/0x140
[c000000001245a90] [c00000000002b954] die+0x74/0xf0
[c000000001245ad0] [c00000000006e0f8] bad_page_fault+0xe8/0x180
[c000000001245b40] [c000000000074f48] slb_miss_large_addr+0x68/0x2e0
[c000000001245b80] [c000000000008ce8] large_addr_slb+0x158/0x160
--- interrupt: 380 at show_stack+0xe4/0x2b0
LR = show_stack+0x140/0x2b0
[c000000001245e70] [c00000000002217c] show_stack+0x1fc/0x2b0 (unreliable)
[c000000001245f40] [c00000000002245c] show_regs+0x22c/0x430
[c000000001245ff0] [c00000000002ae8c] __die+0xfc/0x140
[c000000001246070] [c00000000002b954] die+0x74/0xf0
[c0000000012460b0] [c00000000006e0f8] bad_page_fault+0xe8/0x180
[c000000001246120] [c000000000074f48] slb_miss_large_addr+0x68/0x2e0
[c000000001246160] [c000000000008ce8] large_addr_slb+0x158/0x160
--- interrupt: 380 at show_stack+0xe4/0x2b0
LR = show_stack+0x140/0x2b0
[c000000001246450] [c00000000002217c] show_stack+0x1fc/0x2b0 (unreliable)
[c000000001246520] [c00000000002245c] show_regs+0x22c/0x430
[c0000000012465d0] [c00000000002ae8c] __die+0xfc/0x140
[c000000001246650] [c00000000002b954] die+0x74/0xf0
[c000000001246690] [c00000000006e0f8] bad_page_fault+0xe8/0x180
[c000000001246700] [c000000000074f48] slb_miss_large_addr+0x68/0x2e0
[c000000001246740] [c000000000008ce8] large_addr_slb+0x158/0x160
--- interrupt: 380 at show_stack+0xe4/0x2b0
LR = show_stack+0x140/0x2b0
[c000000001246a30] [c00000000002217c] show_stack+0x1fc/0x2b0 (unreliable)
[c000000001246b00] [c00000000002245c] show_regs+0x22c/0x430
[c000000001246bb0] [c00000000002ae8c] __die+0xfc/0x140
[c000000001246c30] [c00000000002b954] die+0x74/0xf0
[c000000001246c70] [c00000000006e0f8] bad_page_fault+0xe8/0x180
[c000000001246ce0] [c000000000074f48] slb_miss_large_addr+0x68/0x2e0
[c000000001246d20] [c000000000008ce8] large_addr_slb+0x158/0x160
--- interrupt: 380 at show_stack+0xe4/0x2b0
LR = show_stack+0x140/0x2b0
[c000000001247010] [c00000000002217c] show_stack+0x1fc/0x2b0 (unreliable)
[c0000000012470e0] [c00000000002245c] show_regs+0x22c/0x430
[c000000001247190] [c00000000002ae8c] __die+0xfc/0x140
[c000000001247210] [c00000000002b954] die+0x74/0xf0
[c000000001247250] [c00000000006e0f8] bad_page_fault+0xe8/0x180
[c0000000012472c0] [c000000000074f48] slb_miss_large_addr+0x68/0x2e0
[c000000001247300] [c000000000008ce8] large_addr_slb+0x158/0x160
--- interrupt: 380 at show_stack+0xe4/0x2b0
LR = show_stack+0x140/0x2b0
[c0000000012475f0] [c00000000002217c] show_stack+0x1fc/0x2b0 (unreliable)
[c0000000012476c0] [c00000000002245c] show_regs+0x22c/0x430
[c000000001247770] [c00000000002ae8c] __die+0xfc/0x140
[c0000000012477f0] [c00000000002b954] die+0x74/0xf0
[c000000001247830] [c00000000006e0f8] bad_page_fault+0xe8/0x180
[c0000000012478a0] [c000000000074f48] slb_miss_large_addr+0x68/0x2e0
[c0000000012478e0] [c000000000008ce8] large_addr_slb+0x158/0x160
--- interrupt: 380 at save_context_stack+0x70/0x110
LR = save_context_stack+0x64/0x110
[c000000001247bd0] [c000000001247c10] init_stack+0x3c10/0x4000 (unreliable)
[c000000001247c10] [c000000000ee2268] log_early+0xc0/0x100
[c000000001247c70] [c000000000ede7f8] memblock_virt_alloc_internal+0x1cc/0x210
[c000000001247d20] [c000000000edec00] memblock_virt_alloc_try_nid+0x94/0xfc
[c000000001247db0] [c000000000f08efc] early_init_dt_alloc_memory_arch+0x2c/0x40
[c000000001247dd0] [c000000000991200] __unflatten_device_tree+0xa0/0x1e0
[c000000001247e60] [c000000000f0a1d8] unflatten_device_tree+0x48/0x68
[c000000001247e90] [c000000000eab6fc] setup_arch+0x4c/0x3fc
[c000000001247f00] [c000000000ea3df8] start_kernel+0x88/0x604
Instruction dump:
3ec2ffb4 3b800041 3bc00001 3b600000 3b18ccc8 3a73cd00 3a94ccf0 3ab5cce0
635a7265 3ad6cd08 48000054 2e3e0000 <ea5f0000> ebdf0010 419200e8 7fbbf040
random: get_random_bytes called from print_oops_end_marker+0x6c/0xa0 with crng_init=0
---[ end trace 0000000000000000 ]---
cheers
^ permalink raw reply
* Re: [PATCH v6 0/9] powerpc: Switch to CONFIG_THREAD_INFO_IN_TASK
From: Benjamin Herrenschmidt @ 2018-10-08 9:59 UTC (permalink / raw)
To: Christophe Leroy, Paul Mackerras, Michael Ellerman
Cc: linuxppc-dev, linux-kernel
In-Reply-To: <cover.1538954166.git.christophe.leroy@c-s.fr>
On Mon, 2018-10-08 at 09:16 +0000, Christophe Leroy wrote:
> The purpose of this serie is to activate CONFIG_THREAD_INFO_IN_TASK which
> moves the thread_info into task_struct.
We need to make sure we don't have code that assumes that we don't take
faults on TI access.
On ppc64, the stack SLB entries are bolted, which means the TI is too.
We might have code that assumes that we don't get SLB faults when
accessing TI. If not, we're fine but that needs a close look.
Ben.
> Moving thread_info into task_struct has the following advantages:
> - It protects thread_info from corruption in the case of stack
> overflows.
> - Its address is harder to determine if stack addresses are
> leaked, making a number of attacks more difficult.
>
> Changes since v5:
> - Fixed livepatch_sp setup by using end_of_stack() instead of hardcoding
> - Fixed PPC_BPF_LOAD_CPU() macro
>
> Changes since v4:
> - Fixed a build failure on 32bits SMP when include/generated/asm-offsets.h is not
> already existing, was due to spaces instead of a tab in the Makefile
>
> Changes since RFC v3: (based on Nick's review)
> - Renamed task_size.h to task_size_user64.h to better relate to what it contains.
> - Handling of the isolation of thread_info cpu field inside CONFIG_SMP #ifdefs moved to a separate patch.
> - Removed CURRENT_THREAD_INFO macro completely.
> - Added a guard in asm/smp.h to avoid build failure before _TASK_CPU is defined.
> - Added a patch at the end to rename 'tp' pointers to 'sp' pointers
> - Renamed 'tp' into 'sp' pointers in preparation patch when relevant
> - Fixed a few commit logs
> - Fixed checkpatch report.
>
> Changes since RFC v2:
> - Removed the modification of names in asm-offsets
> - Created a rule in arch/powerpc/Makefile to append the offset of current->cpu in CFLAGS
> - Modified asm/smp.h to use the offset set in CFLAGS
> - Squashed the renaming of THREAD_INFO to TASK_STACK in the preparation patch
> - Moved the modification of current_pt_regs in the patch activating CONFIG_THREAD_INFO_IN_TASK
>
> Changes since RFC v1:
> - Removed the first patch which was modifying header inclusion order in timer
> - Modified some names in asm-offsets to avoid conflicts when including asm-offsets in C files
> - Modified asm/smp.h to avoid having to include linux/sched.h (using asm-offsets instead)
> - Moved some changes from the activation patch to the preparation patch.
>
> Christophe Leroy (9):
> book3s/64: avoid circular header inclusion in mmu-hash.h
> powerpc: Only use task_struct 'cpu' field on SMP
> powerpc: Prepare for moving thread_info into task_struct
> powerpc: Activate CONFIG_THREAD_INFO_IN_TASK
> powerpc: regain entire stack space
> powerpc: 'current_set' is now a table of task_struct pointers
> powerpc/32: Remove CURRENT_THREAD_INFO and rename TI_CPU
> powerpc/64: Remove CURRENT_THREAD_INFO
> powerpc: clean stack pointers naming
>
> arch/powerpc/Kconfig | 1 +
> arch/powerpc/Makefile | 8 ++-
> arch/powerpc/include/asm/asm-prototypes.h | 4 +-
> arch/powerpc/include/asm/book3s/64/mmu-hash.h | 2 +-
> arch/powerpc/include/asm/exception-64s.h | 4 +-
> arch/powerpc/include/asm/irq.h | 14 ++---
> arch/powerpc/include/asm/livepatch.h | 7 ++-
> arch/powerpc/include/asm/processor.h | 39 +------------
> arch/powerpc/include/asm/ptrace.h | 2 +-
> arch/powerpc/include/asm/reg.h | 2 +-
> arch/powerpc/include/asm/smp.h | 17 +++++-
> arch/powerpc/include/asm/task_size_user64.h | 42 ++++++++++++++
> arch/powerpc/include/asm/thread_info.h | 19 -------
> arch/powerpc/kernel/asm-offsets.c | 10 ++--
> arch/powerpc/kernel/entry_32.S | 66 ++++++++--------------
> arch/powerpc/kernel/entry_64.S | 12 ++--
> arch/powerpc/kernel/epapr_hcalls.S | 5 +-
> arch/powerpc/kernel/exceptions-64e.S | 13 +----
> arch/powerpc/kernel/exceptions-64s.S | 2 +-
> arch/powerpc/kernel/head_32.S | 14 ++---
> arch/powerpc/kernel/head_40x.S | 4 +-
> arch/powerpc/kernel/head_44x.S | 8 +--
> arch/powerpc/kernel/head_64.S | 1 +
> arch/powerpc/kernel/head_8xx.S | 2 +-
> arch/powerpc/kernel/head_booke.h | 12 +---
> arch/powerpc/kernel/head_fsl_booke.S | 16 +++---
> arch/powerpc/kernel/idle_6xx.S | 8 +--
> arch/powerpc/kernel/idle_book3e.S | 2 +-
> arch/powerpc/kernel/idle_e500.S | 8 +--
> arch/powerpc/kernel/idle_power4.S | 2 +-
> arch/powerpc/kernel/irq.c | 77 +++++---------------------
> arch/powerpc/kernel/kgdb.c | 28 ----------
> arch/powerpc/kernel/machine_kexec_64.c | 6 +-
> arch/powerpc/kernel/misc_32.S | 17 +++---
> arch/powerpc/kernel/process.c | 17 +++---
> arch/powerpc/kernel/setup-common.c | 2 +-
> arch/powerpc/kernel/setup_32.c | 15 ++---
> arch/powerpc/kernel/setup_64.c | 41 ++++----------
> arch/powerpc/kernel/smp.c | 16 +++---
> arch/powerpc/kernel/trace/ftrace_64_mprofile.S | 6 +-
> arch/powerpc/kvm/book3s_hv_hmi.c | 1 +
> arch/powerpc/mm/hash_low_32.S | 14 ++---
> arch/powerpc/net/bpf_jit32.h | 5 +-
> arch/powerpc/sysdev/6xx-suspend.S | 5 +-
> arch/powerpc/xmon/xmon.c | 2 +-
> 45 files changed, 230 insertions(+), 368 deletions(-)
> create mode 100644 arch/powerpc/include/asm/task_size_user64.h
>
^ permalink raw reply
* Re: [PATCH 28/36] dt-bindings: arm: Convert Rockchip board/soc bindings to json-schema
From: Heiko Stuebner @ 2018-10-08 9:45 UTC (permalink / raw)
To: Rob Herring
Cc: Mark Rutland, devicetree, Kumar Gala, Grant Likely, Arnd Bergmann,
Tom Rini, Frank Rowand, Linus Walleij, Pantelis Antoniou,
linux-kernel, Bjorn Andersson, linux-rockchip, Mark Brown,
Geert Uytterhoeven, Jonathan Cameron, Olof Johansson,
linuxppc-dev, linux-arm-kernel
In-Reply-To: <20181005165848.3474-29-robh@kernel.org>
Hi Rob,
either I'm misunderstanding that, or something did go a bit wrong during
the conversion, as pointed out below:
Am Freitag, 5. Oktober 2018, 18:58:40 CEST schrieb Rob Herring:
> Convert Rockchip SoC bindings to DT schema format using json-schema.
>
> Cc: Mark Rutland <mark.rutland@arm.com>
> Cc: Heiko Stuebner <heiko@sntech.de>
> Cc: devicetree@vger.kernel.org
> Cc: linux-arm-kernel@lists.infradead.org
> Cc: linux-rockchip@lists.infradead.org
> Signed-off-by: Rob Herring <robh@kernel.org>
> ---
> .../devicetree/bindings/arm/rockchip.txt | 220 ----------------
> .../devicetree/bindings/arm/rockchip.yaml | 242 ++++++++++++++++++
> 2 files changed, 242 insertions(+), 220 deletions(-)
> delete mode 100644 Documentation/devicetree/bindings/arm/rockchip.txt
> create mode 100644 Documentation/devicetree/bindings/arm/rockchip.yaml
>
> +properties:
> + $nodename:
> + const: '/'
> + compatible:
> + oneOf:
> + - items:
> + - enum:
> + - amarula,vyasa-rk3288
> + - asus,rk3288-tinker
> + - radxa,rock2-square
> + - chipspark,popmetal-rk3288
> + - netxeon,r89
> + - firefly,firefly-rk3288
> + - firefly,firefly-rk3288-beta
> + - firefly,firefly-rk3288-reload
> + - mqmaker,miqi
> + - rockchip,rk3288-fennec
> + - const: rockchip,rk3288
These are very much distinct boards, so shouldn't they also get
individual entries including their existing description like the phytec
or google boards below?
Similarly why is it an enum for those, while the Google boards get a
const for each compatible string?
Most non-google boards below also lost their description and where lumped
together into combined entries. Was that intentional?
Thanks
Heiko
> +
> + - description: Phytec phyCORE-RK3288 Rapid Development Kit
> + items:
> + - const: phytec,rk3288-pcm-947
> + - const: phytec,rk3288-phycore-som
> + - const: rockchip,rk3288
> +
> + - description: Google Mickey (Asus Chromebit CS10)
> + items:
> + - const: google,veyron-mickey-rev8
> + - const: google,veyron-mickey-rev7
> + - const: google,veyron-mickey-rev6
> + - const: google,veyron-mickey-rev5
> + - const: google,veyron-mickey-rev4
> + - const: google,veyron-mickey-rev3
> + - const: google,veyron-mickey-rev2
> + - const: google,veyron-mickey-rev1
> + - const: google,veyron-mickey-rev0
> + - const: google,veyron-mickey
> + - const: google,veyron
> + - const: rockchip,rk3288
> +
> + - description: Google Minnie (Asus Chromebook Flip C100P)
> + items:
> + - const: google,veyron-minnie-rev4
> + - const: google,veyron-minnie-rev3
> + - const: google,veyron-minnie-rev2
> + - const: google,veyron-minnie-rev1
> + - const: google,veyron-minnie-rev0
> + - const: google,veyron-minnie
> + - const: google,veyron
> + - const: rockchip,rk3288
> +
> + - description: Google Pinky (dev-board)
> + items:
> + - const: google,veyron-pinky-rev2
> + - const: google,veyron-pinky
> + - const: google,veyron
> + - const: rockchip,rk3288
> +
> + - description: Google Speedy (Asus C201 Chromebook)
> + items:
> + - const: google,veyron-speedy-rev9
> + - const: google,veyron-speedy-rev8
> + - const: google,veyron-speedy-rev7
> + - const: google,veyron-speedy-rev6
> + - const: google,veyron-speedy-rev5
> + - const: google,veyron-speedy-rev4
> + - const: google,veyron-speedy-rev3
> + - const: google,veyron-speedy-rev2
> + - const: google,veyron-speedy
> + - const: google,veyron
> + - const: rockchip,rk3288
> +
> + - description: Google Jaq (Haier Chromebook 11 and more)
> + items:
> + - const: google,veyron-jaq-rev5
> + - const: google,veyron-jaq-rev4
> + - const: google,veyron-jaq-rev3
> + - const: google,veyron-jaq-rev2
> + - const: google,veyron-jaq-rev1
> + - const: google,veyron-jaq
> + - const: google,veyron
> + - const: rockchip,rk3288
> +
> + - description: Google Jerry (Hisense Chromebook C11 and more)
> + items:
> + - const: google,veyron-jerry-rev7
> + - const: google,veyron-jerry-rev6
> + - const: google,veyron-jerry-rev5
> + - const: google,veyron-jerry-rev4
> + - const: google,veyron-jerry-rev3
> + - const: google,veyron-jerry
> + - const: google,veyron
> + - const: rockchip,rk3288
> +
> + - description: Google Brain (dev-board)
> + items:
> + - const: google,veyron-brain-rev0
> + - const: google,veyron-brain
> + - const: google,veyron
> + - const: rockchip,rk3288
> +
> + - items:
> + - enum:
> + - rockchip,kylin-rk3036
> + - const: rockchip,rk3036
> +
> + - items:
> + - enum:
> + - haoyu,marsboard-rk3066
> + - mundoreader,bq-curie2
> + - chipspark,rayeager-px2
> + - rikomagic,mk80
> + - const: rockchip,rk3066a
> +
> + - items:
> + - enum:
> + - radxa,rock
> + - const: rockchip,rk3188
> +
> + - items:
> + - const: rockchip,px3-evb
> + - const: rockchip,px3
> + - const: rockchip,rk3188
> +
> + - items:
> + - enum:
> + - firefly,roc-rk3328-cc
> + - pine64,rock64
> + - rockchip,rk3328-evb
> + - const: rockchip,rk3328
> +
> + - items:
> + - enum:
> + - geekbuying,geekbox
> + - rockchip,rk3368-evb-act8846
> + - rockchip,r88
> + - tsd,rk3368-uq7-haikou
> + - tronsmart,orion-r68-meta
> + - const: rockchip,rk3368
> +
> + - items:
> + - enum:
> + - geekbuying,geekbox
> + - rockchip,rk3368-evb-act8846
> + - rockchip,r88
> + - tsd,rk3368-uq7-haikou
> + - tronsmart,orion-r68-meta
> + - const: rockchip,rk3368
> +
> + - items:
> + - const: rockchip,px5-evb
> + - const: rockchip,px5
> + - const: rockchip,rk3368
> +
> + - items:
> + - enum:
> + - firefly,firefly-rk3399
> + - rockchip,rk3399-evb
> + - rockchip,rk3399-sapphire
> + - rockchip,rk3399-sapphire-excavator
> + - tsd,rk3399-q7-haikou
> + - vamrs,ficus
> + - const: rockchip,rk3399
> +
> + - description: Google Bob (Asus Chromebook Flip C101PA)
> + items:
> + - const: google,bob-rev13
> + - const: google,bob-rev12
> + - const: google,bob-rev11
> + - const: google,bob-rev10
> + - const: google,bob-rev9
> + - const: google,bob-rev8
> + - const: google,bob-rev7
> + - const: google,bob-rev6
> + - const: google,bob-rev5
> + - const: google,bob-rev4
> + - const: google,bob
> + - const: google,gru
> + - const: rockchip,rk3399
> +
> + - description: Google Gru (dev-board)
> + items:
> + - const: google,gru-rev15
> + - const: google,gru-rev14
> + - const: google,gru-rev13
> + - const: google,gru-rev12
> + - const: google,gru-rev11
> + - const: google,gru-rev10
> + - const: google,gru-rev9
> + - const: google,gru-rev8
> + - const: google,gru-rev7
> + - const: google,gru-rev6
> + - const: google,gru-rev5
> + - const: google,gru-rev4
> + - const: google,gru-rev3
> + - const: google,gru-rev2
> + - const: google,gru
> + - const: rockchip,rk3399
> +
> + - description: Google Kevin (Samsung Chromebook Plus)
> + items:
> + - const: google,kevin-rev15
> + - const: google,kevin-rev14
> + - const: google,kevin-rev13
> + - const: google,kevin-rev12
> + - const: google,kevin-rev11
> + - const: google,kevin-rev10
> + - const: google,kevin-rev9
> + - const: google,kevin-rev8
> + - const: google,kevin-rev7
> + - const: google,kevin-rev6
> + - const: google,kevin
> + - const: google,gru
> + - const: rockchip,rk3399
> +
> + - items:
> + - enum:
> + - rockchip,rv1108-evb
> + - const: rockchip,rv1108
> +
> + - items:
> + - enum:
> + - rockchip,rk3228-evb
> + - const: rockchip,rk3228
> +
> + - items:
> + - enum:
> + - rockchip,rk3229-evb
> + - const: rockchip,rk3229
> +...
>
^ permalink raw reply
* Re: [RFC PATCH kernel] vfio/spapr_tce: Get rid of possible infinite loop
From: Michael Ellerman @ 2018-10-08 10:18 UTC (permalink / raw)
To: Serhii Popovych, Alexey Kardashevskiy, linuxppc-dev
Cc: Alex Williamson, kvm-ppc, David Gibson
In-Reply-To: <74ee5fc5-839b-27d6-5731-1b2731f9f95b@redhat.com>
Serhii Popovych <spopovyc@redhat.com> writes:
> Alexey Kardashevskiy wrote:
>> As a part of cleanup, the SPAPR TCE IOMMU subdriver releases preregistered
>> memory. If there is a bug in memory release, the loop in
>> tce_iommu_release() becomes infinite; this actually happened to me.
>>
>> This makes the loop finite and prints a warning on every failure to make
>> the code more bug prone.
>>
>> Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
>> ---
>> drivers/vfio/vfio_iommu_spapr_tce.c | 10 +++-------
>> 1 file changed, 3 insertions(+), 7 deletions(-)
>>
>> diff --git a/drivers/vfio/vfio_iommu_spapr_tce.c b/drivers/vfio/vfio_iommu_spapr_tce.c
>> index b1a8ab3..ece0651 100644
>> --- a/drivers/vfio/vfio_iommu_spapr_tce.c
>> +++ b/drivers/vfio/vfio_iommu_spapr_tce.c
>> @@ -393,13 +394,8 @@ static void tce_iommu_release(void *iommu_data)
>> tce_iommu_free_table(container, tbl);
>> }
>>
>> - while (!list_empty(&container->prereg_list)) {
>> - struct tce_iommu_prereg *tcemem;
>> -
>> - tcemem = list_first_entry(&container->prereg_list,
>> - struct tce_iommu_prereg, next);
>> - WARN_ON_ONCE(tce_iommu_prereg_free(container, tcemem));
>> - }
>> + list_for_each_entry_safe(tcemem, tmtmp, &container->prereg_list, next)
>> + WARN_ON(tce_iommu_prereg_free(container, tcemem));
>
> I'm not sure that tce_iommu_prereg_free() call under WARN_ON() is good
> idea because WARN_ON() is a preprocessor macro:
>
> if CONFIG_WARN=n is added by the analogy with CONFIG_BUG=n defining
> WARN_ON() as empty we will loose call to tce_iommu_prereg_free()
> leaking resources.
I don't think that's likely to ever happen though, we have a large
number of uses that would need to be checked one-by-one:
$ git grep "if (WARN_ON(" | wc -l
2853
So if we ever did add CONFIG_WARN, I think it would still need to
evaluate the condition, just not emit a warning.
cheers
^ permalink raw reply
* Re: [PATCH] powerpc: Fix HMIs on big-endian with CONFIG_RELOCATABLE=y
From: Benjamin Herrenschmidt @ 2018-10-08 9:53 UTC (permalink / raw)
To: Nicholas Piggin; +Cc: linuxppc-dev
In-Reply-To: <20181008170435.0ef2d573@roar.ozlabs.ibm.com>
On Mon, 2018-10-08 at 17:04 +1000, Nicholas Piggin wrote:
> On Mon, 08 Oct 2018 15:08:31 +1100
> Benjamin Herrenschmidt <benh@kernel.crashing.org> wrote:
>
> > HMIs will crash the kernel due to
> >
> > BRANCH_LINK_TO_FAR(hmi_exception_realmode)
> >
> > Calling into the OPD instead of the actual code.
> >
> > Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
> > ---
> >
> > This hack fixes it for me, but it's not great. Nick, any better idea ?
>
> Is it a hack because the ifdef gunk, or because there's something
> deeper wrong with using the .sym?
I'd say ifdef gunk, also the KVM use doesn't need it bcs the kvm entry
isn't an OPD.
> I guess all those handlers that load label address by hand could have
> the bug silently creep in. Can we have them use the DOTSYM() macro?
The KVM one doesnt have a dotsym does it ?
Also should we load the TOC from the OPD ?
> Thanks,
> Nick
>
> >
> > diff --git a/arch/powerpc/kernel/exceptions-64s.S b/arch/powerpc/kernel/exceptions-64s.S
> > index ea04dfb..752709cc8 100644
> > --- a/arch/powerpc/kernel/exceptions-64s.S
> > +++ b/arch/powerpc/kernel/exceptions-64s.S
> > @@ -1119,7 +1119,11 @@ TRAMP_REAL_BEGIN(hmi_exception_early)
> > EXCEPTION_PROLOG_COMMON_2(PACA_EXGEN)
> > EXCEPTION_PROLOG_COMMON_3(0xe60)
> > addi r3,r1,STACK_FRAME_OVERHEAD
> > +#ifdef PPC64_ELF_ABI_v1
> > + BRANCH_LINK_TO_FAR(.hmi_exception_realmode) /* Function call ABI */
> > +#else
> > BRANCH_LINK_TO_FAR(hmi_exception_realmode) /* Function call ABI */
> > +#endif
> > cmpdi cr0,r3,0
> >
> > /* Windup the stack. */
> >
> >
^ permalink raw reply
* [PATCH v6 9/9] powerpc: clean stack pointers naming
From: Christophe Leroy @ 2018-10-08 9:16 UTC (permalink / raw)
To: Benjamin Herrenschmidt, Paul Mackerras, Michael Ellerman
Cc: linuxppc-dev, linux-kernel
In-Reply-To: <cover.1538954166.git.christophe.leroy@c-s.fr>
Some stack pointers used to also be thread_info pointers
and were called tp. Now that they are only stack pointers,
rename them sp.
Signed-off-by: Christophe Leroy <christophe.leroy@c-s.fr>
---
arch/powerpc/kernel/irq.c | 17 +++++++----------
arch/powerpc/kernel/setup_64.c | 20 ++++++++++----------
2 files changed, 17 insertions(+), 20 deletions(-)
diff --git a/arch/powerpc/kernel/irq.c b/arch/powerpc/kernel/irq.c
index 62cfccf4af89..754f0efc507b 100644
--- a/arch/powerpc/kernel/irq.c
+++ b/arch/powerpc/kernel/irq.c
@@ -659,21 +659,21 @@ void __do_irq(struct pt_regs *regs)
void do_IRQ(struct pt_regs *regs)
{
struct pt_regs *old_regs = set_irq_regs(regs);
- void *curtp, *irqtp, *sirqtp;
+ void *cursp, *irqsp, *sirqsp;
/* Switch to the irq stack to handle this */
- curtp = (void *)(current_stack_pointer() & ~(THREAD_SIZE - 1));
- irqtp = hardirq_ctx[raw_smp_processor_id()];
- sirqtp = softirq_ctx[raw_smp_processor_id()];
+ cursp = (void *)(current_stack_pointer() & ~(THREAD_SIZE - 1));
+ irqsp = hardirq_ctx[raw_smp_processor_id()];
+ sirqsp = softirq_ctx[raw_smp_processor_id()];
/* Already there ? */
- if (unlikely(curtp == irqtp || curtp == sirqtp)) {
+ if (unlikely(cursp == irqsp || cursp == sirqsp)) {
__do_irq(regs);
set_irq_regs(old_regs);
return;
}
/* Switch stack and call */
- call_do_irq(regs, irqtp);
+ call_do_irq(regs, irqsp);
set_irq_regs(old_regs);
}
@@ -732,10 +732,7 @@ void irq_ctx_init(void)
void do_softirq_own_stack(void)
{
- void *irqtp;
-
- irqtp = softirq_ctx[smp_processor_id()];
- call_do_softirq(irqtp);
+ call_do_softirq(softirq_ctx[smp_processor_id()]);
}
irq_hw_number_t virq_to_hw(unsigned int virq)
diff --git a/arch/powerpc/kernel/setup_64.c b/arch/powerpc/kernel/setup_64.c
index 6792e9c90689..4912ec0320b8 100644
--- a/arch/powerpc/kernel/setup_64.c
+++ b/arch/powerpc/kernel/setup_64.c
@@ -717,22 +717,22 @@ void __init emergency_stack_init(void)
limit = min(ppc64_bolted_size(), ppc64_rma_size);
for_each_possible_cpu(i) {
- void *ti;
+ void *sp;
- ti = alloc_stack(limit, i);
- memset(ti, 0, THREAD_SIZE);
- paca_ptrs[i]->emergency_sp = ti + THREAD_SIZE;
+ sp = alloc_stack(limit, i);
+ memset(sp, 0, THREAD_SIZE);
+ paca_ptrs[i]->emergency_sp = sp + THREAD_SIZE;
#ifdef CONFIG_PPC_BOOK3S_64
/* emergency stack for NMI exception handling. */
- ti = alloc_stack(limit, i);
- memset(ti, 0, THREAD_SIZE);
- paca_ptrs[i]->nmi_emergency_sp = ti + THREAD_SIZE;
+ sp = alloc_stack(limit, i);
+ memset(sp, 0, THREAD_SIZE);
+ paca_ptrs[i]->nmi_emergency_sp = sp + THREAD_SIZE;
/* emergency stack for machine check exception handling. */
- ti = alloc_stack(limit, i);
- memset(ti, 0, THREAD_SIZE);
- paca_ptrs[i]->mc_emergency_sp = ti + THREAD_SIZE;
+ sp = alloc_stack(limit, i);
+ memset(sp, 0, THREAD_SIZE);
+ paca_ptrs[i]->mc_emergency_sp = sp + THREAD_SIZE;
#endif
}
}
--
2.13.3
^ permalink raw reply related
* [PATCH v6 8/9] powerpc/64: Remove CURRENT_THREAD_INFO
From: Christophe Leroy @ 2018-10-08 9:16 UTC (permalink / raw)
To: Benjamin Herrenschmidt, Paul Mackerras, Michael Ellerman
Cc: linuxppc-dev, linux-kernel
In-Reply-To: <cover.1538954166.git.christophe.leroy@c-s.fr>
Now that current_thread_info is located at the beginning of 'current'
task struct, CURRENT_THREAD_INFO macro is not really needed any more.
This patch replaces it by loads of the value at PACACURRENT(r13).
Signed-off-by: Christophe Leroy <christophe.leroy@c-s.fr>
---
arch/powerpc/include/asm/exception-64s.h | 4 ++--
arch/powerpc/include/asm/thread_info.h | 4 ----
arch/powerpc/kernel/entry_64.S | 10 +++++-----
arch/powerpc/kernel/exceptions-64e.S | 2 +-
arch/powerpc/kernel/exceptions-64s.S | 2 +-
arch/powerpc/kernel/idle_book3e.S | 2 +-
arch/powerpc/kernel/idle_power4.S | 2 +-
arch/powerpc/kernel/trace/ftrace_64_mprofile.S | 6 +++---
8 files changed, 14 insertions(+), 18 deletions(-)
diff --git a/arch/powerpc/include/asm/exception-64s.h b/arch/powerpc/include/asm/exception-64s.h
index a86feddddad0..ca3af3e9015e 100644
--- a/arch/powerpc/include/asm/exception-64s.h
+++ b/arch/powerpc/include/asm/exception-64s.h
@@ -680,7 +680,7 @@ END_FTR_SECTION_NESTED(ftr,ftr,943)
#define RUNLATCH_ON \
BEGIN_FTR_SECTION \
- CURRENT_THREAD_INFO(r3, r1); \
+ ld r3, PACACURRENT(r13); \
ld r4,TI_LOCAL_FLAGS(r3); \
andi. r0,r4,_TLF_RUNLATCH; \
beql ppc64_runlatch_on_trampoline; \
@@ -730,7 +730,7 @@ END_FTR_SECTION_IFSET(CPU_FTR_CTRL)
#ifdef CONFIG_PPC_970_NAP
#define FINISH_NAP \
BEGIN_FTR_SECTION \
- CURRENT_THREAD_INFO(r11, r1); \
+ ld r11, PACACURRENT(r13); \
ld r9,TI_LOCAL_FLAGS(r11); \
andi. r10,r9,_TLF_NAPPING; \
bnel power4_fixup_nap; \
diff --git a/arch/powerpc/include/asm/thread_info.h b/arch/powerpc/include/asm/thread_info.h
index 361bb45b8990..2ee9e248c933 100644
--- a/arch/powerpc/include/asm/thread_info.h
+++ b/arch/powerpc/include/asm/thread_info.h
@@ -17,10 +17,6 @@
#define THREAD_SIZE (1 << THREAD_SHIFT)
-#ifdef CONFIG_PPC64
-#define CURRENT_THREAD_INFO(dest, sp) stringify_in_c(ld dest, PACACURRENT(r13))
-#endif
-
#ifndef __ASSEMBLY__
#include <linux/cache.h>
#include <asm/processor.h>
diff --git a/arch/powerpc/kernel/entry_64.S b/arch/powerpc/kernel/entry_64.S
index 6fce0f8fd8c4..06d9a7c084a1 100644
--- a/arch/powerpc/kernel/entry_64.S
+++ b/arch/powerpc/kernel/entry_64.S
@@ -158,7 +158,7 @@ system_call: /* label this so stack traces look sane */
li r10,IRQS_ENABLED
std r10,SOFTE(r1)
- CURRENT_THREAD_INFO(r11, r1)
+ ld r11, PACACURRENT(r13)
ld r10,TI_FLAGS(r11)
andi. r11,r10,_TIF_SYSCALL_DOTRACE
bne .Lsyscall_dotrace /* does not return */
@@ -205,7 +205,7 @@ system_call: /* label this so stack traces look sane */
ld r3,RESULT(r1)
#endif
- CURRENT_THREAD_INFO(r12, r1)
+ ld r12, PACACURRENT(r13)
ld r8,_MSR(r1)
#ifdef CONFIG_PPC_BOOK3S
@@ -336,7 +336,7 @@ END_FTR_SECTION_IFSET(CPU_FTR_HAS_PPR)
/* Repopulate r9 and r10 for the syscall path */
addi r9,r1,STACK_FRAME_OVERHEAD
- CURRENT_THREAD_INFO(r10, r1)
+ ld r10, PACACURRENT(r13)
ld r10,TI_FLAGS(r10)
cmpldi r0,NR_syscalls
@@ -735,7 +735,7 @@ _GLOBAL(ret_from_except_lite)
mtmsrd r10,1 /* Update machine state */
#endif /* CONFIG_PPC_BOOK3E */
- CURRENT_THREAD_INFO(r9, r1)
+ ld r9, PACACURRENT(r13)
ld r3,_MSR(r1)
#ifdef CONFIG_PPC_BOOK3E
ld r10,PACACURRENT(r13)
@@ -849,7 +849,7 @@ resume_kernel:
1: bl preempt_schedule_irq
/* Re-test flags and eventually loop */
- CURRENT_THREAD_INFO(r9, r1)
+ ld r9, PACACURRENT(r13)
ld r4,TI_FLAGS(r9)
andi. r0,r4,_TIF_NEED_RESCHED
bne 1b
diff --git a/arch/powerpc/kernel/exceptions-64e.S b/arch/powerpc/kernel/exceptions-64e.S
index 231d066b4a3d..dfafcd0af009 100644
--- a/arch/powerpc/kernel/exceptions-64e.S
+++ b/arch/powerpc/kernel/exceptions-64e.S
@@ -469,7 +469,7 @@ exc_##n##_bad_stack: \
* interrupts happen before the wait instruction.
*/
#define CHECK_NAPPING() \
- CURRENT_THREAD_INFO(r11, r1); \
+ ld r11, PACACURRENT(r13); \
ld r10,TI_LOCAL_FLAGS(r11); \
andi. r9,r10,_TLF_NAPPING; \
beq+ 1f; \
diff --git a/arch/powerpc/kernel/exceptions-64s.S b/arch/powerpc/kernel/exceptions-64s.S
index b9239dbf6d59..f776f30ecfcc 100644
--- a/arch/powerpc/kernel/exceptions-64s.S
+++ b/arch/powerpc/kernel/exceptions-64s.S
@@ -1738,7 +1738,7 @@ do_hash_page:
ori r0,r0,DSISR_BAD_FAULT_64S@l
and. r0,r4,r0 /* weird error? */
bne- handle_page_fault /* if not, try to insert a HPTE */
- CURRENT_THREAD_INFO(r11, r1)
+ ld r11, PACACURRENT(r13)
lwz r0,TI_PREEMPT(r11) /* If we're in an "NMI" */
andis. r0,r0,NMI_MASK@h /* (i.e. an irq when soft-disabled) */
bne 77f /* then don't call hash_page now */
diff --git a/arch/powerpc/kernel/idle_book3e.S b/arch/powerpc/kernel/idle_book3e.S
index 4e0d94d02030..31e732c378ad 100644
--- a/arch/powerpc/kernel/idle_book3e.S
+++ b/arch/powerpc/kernel/idle_book3e.S
@@ -63,7 +63,7 @@ _GLOBAL(\name)
1: /* Let's set the _TLF_NAPPING flag so interrupts make us return
* to the right spot
*/
- CURRENT_THREAD_INFO(r11, r1)
+ ld r11, PACACURRENT(r13)
ld r10,TI_LOCAL_FLAGS(r11)
ori r10,r10,_TLF_NAPPING
std r10,TI_LOCAL_FLAGS(r11)
diff --git a/arch/powerpc/kernel/idle_power4.S b/arch/powerpc/kernel/idle_power4.S
index a09b3c7ca176..61ac89fd0a05 100644
--- a/arch/powerpc/kernel/idle_power4.S
+++ b/arch/powerpc/kernel/idle_power4.S
@@ -68,7 +68,7 @@ BEGIN_FTR_SECTION
DSSALL
sync
END_FTR_SECTION_IFSET(CPU_FTR_ALTIVEC)
- CURRENT_THREAD_INFO(r9, r1)
+ ld r9, PACACURRENT(r13)
ld r8,TI_LOCAL_FLAGS(r9) /* set napping bit */
ori r8,r8,_TLF_NAPPING /* so when we take an exception */
std r8,TI_LOCAL_FLAGS(r9) /* it will return to our caller */
diff --git a/arch/powerpc/kernel/trace/ftrace_64_mprofile.S b/arch/powerpc/kernel/trace/ftrace_64_mprofile.S
index 32476a6e4e9c..202bec086e3b 100644
--- a/arch/powerpc/kernel/trace/ftrace_64_mprofile.S
+++ b/arch/powerpc/kernel/trace/ftrace_64_mprofile.S
@@ -229,7 +229,7 @@ ftrace_call:
* - r0, r11 & r12 are free
*/
livepatch_handler:
- CURRENT_THREAD_INFO(r12, r1)
+ ld r12, PACACURRENT(r13)
/* Allocate 3 x 8 bytes */
ld r11, TI_livepatch_sp(r12)
@@ -256,7 +256,7 @@ livepatch_handler:
* restore it.
*/
- CURRENT_THREAD_INFO(r12, r1)
+ ld r12, PACACURRENT(r13)
ld r11, TI_livepatch_sp(r12)
@@ -273,7 +273,7 @@ livepatch_handler:
ld r2, -24(r11)
/* Pop livepatch stack frame */
- CURRENT_THREAD_INFO(r12, r1)
+ ld r12, PACACURRENT(r13)
subi r11, r11, 24
std r11, TI_livepatch_sp(r12)
--
2.13.3
^ permalink raw reply related
* [PATCH v6 7/9] powerpc/32: Remove CURRENT_THREAD_INFO and rename TI_CPU
From: Christophe Leroy @ 2018-10-08 9:16 UTC (permalink / raw)
To: Benjamin Herrenschmidt, Paul Mackerras, Michael Ellerman
Cc: linuxppc-dev, linux-kernel
In-Reply-To: <cover.1538954166.git.christophe.leroy@c-s.fr>
Now that thread_info is similar to task_struct, it's address is in r2
so CURRENT_THREAD_INFO() macro is useless. This patch removes it.
At the same time, as the 'cpu' field is not anymore in thread_info,
this patch renames it to TASK_CPU.
Signed-off-by: Christophe Leroy <christophe.leroy@c-s.fr>
---
arch/powerpc/Makefile | 2 +-
arch/powerpc/include/asm/thread_info.h | 2 --
arch/powerpc/kernel/asm-offsets.c | 2 +-
arch/powerpc/kernel/entry_32.S | 43 ++++++++++++----------------------
arch/powerpc/kernel/epapr_hcalls.S | 5 ++--
arch/powerpc/kernel/head_fsl_booke.S | 5 ++--
arch/powerpc/kernel/idle_6xx.S | 8 +++----
arch/powerpc/kernel/idle_e500.S | 8 +++----
arch/powerpc/kernel/misc_32.S | 3 +--
arch/powerpc/mm/hash_low_32.S | 14 ++++-------
arch/powerpc/sysdev/6xx-suspend.S | 5 ++--
11 files changed, 35 insertions(+), 62 deletions(-)
diff --git a/arch/powerpc/Makefile b/arch/powerpc/Makefile
index 02e7ca1c15d4..f1e2d7f7b022 100644
--- a/arch/powerpc/Makefile
+++ b/arch/powerpc/Makefile
@@ -426,7 +426,7 @@ ifdef CONFIG_SMP
prepare: task_cpu_prepare
task_cpu_prepare: prepare0
- $(eval KBUILD_CFLAGS += -D_TASK_CPU=$(shell awk '{if ($$2 == "TI_CPU") print $$3;}' include/generated/asm-offsets.h))
+ $(eval KBUILD_CFLAGS += -D_TASK_CPU=$(shell awk '{if ($$2 == "TASK_CPU") print $$3;}' include/generated/asm-offsets.h))
endif
# Use the file '.tmp_gas_check' for binutils tests, as gas won't output
diff --git a/arch/powerpc/include/asm/thread_info.h b/arch/powerpc/include/asm/thread_info.h
index 61c8747cd926..361bb45b8990 100644
--- a/arch/powerpc/include/asm/thread_info.h
+++ b/arch/powerpc/include/asm/thread_info.h
@@ -19,8 +19,6 @@
#ifdef CONFIG_PPC64
#define CURRENT_THREAD_INFO(dest, sp) stringify_in_c(ld dest, PACACURRENT(r13))
-#else
-#define CURRENT_THREAD_INFO(dest, sp) stringify_in_c(mr dest, r2)
#endif
#ifndef __ASSEMBLY__
diff --git a/arch/powerpc/kernel/asm-offsets.c b/arch/powerpc/kernel/asm-offsets.c
index 768ce602d624..31be6eb9c0d4 100644
--- a/arch/powerpc/kernel/asm-offsets.c
+++ b/arch/powerpc/kernel/asm-offsets.c
@@ -97,7 +97,7 @@ int main(void)
#endif /* CONFIG_PPC64 */
OFFSET(TASK_STACK, task_struct, stack);
#ifdef CONFIG_SMP
- OFFSET(TI_CPU, task_struct, cpu);
+ OFFSET(TASK_CPU, task_struct, cpu);
#endif
#ifdef CONFIG_LIVEPATCH
diff --git a/arch/powerpc/kernel/entry_32.S b/arch/powerpc/kernel/entry_32.S
index bd3b146e18a3..d0c546ce387e 100644
--- a/arch/powerpc/kernel/entry_32.S
+++ b/arch/powerpc/kernel/entry_32.S
@@ -168,8 +168,7 @@ transfer_to_handler:
tophys(r11,r11)
addi r11,r11,global_dbcr0@l
#ifdef CONFIG_SMP
- CURRENT_THREAD_INFO(r9, r1)
- lwz r9,TI_CPU(r9)
+ lwz r9,TASK_CPU(r2)
slwi r9,r9,3
add r11,r11,r9
#endif
@@ -180,8 +179,7 @@ transfer_to_handler:
stw r12,4(r11)
#endif
#ifdef CONFIG_VIRT_CPU_ACCOUNTING_NATIVE
- CURRENT_THREAD_INFO(r9, r1)
- tophys(r9, r9)
+ tophys(r9, r2)
ACCOUNT_CPU_USER_ENTRY(r9, r11, r12)
#endif
@@ -195,8 +193,7 @@ transfer_to_handler:
ble- stack_ovf /* then the kernel stack overflowed */
5:
#if defined(CONFIG_6xx) || defined(CONFIG_E500)
- CURRENT_THREAD_INFO(r9, r1)
- tophys(r9,r9) /* check local flags */
+ tophys(r9,r2) /* check local flags */
lwz r12,TI_LOCAL_FLAGS(r9)
mtcrf 0x01,r12
bt- 31-TLF_NAPPING,4f
@@ -345,8 +342,7 @@ _GLOBAL(DoSyscall)
mtmsr r11
1:
#endif /* CONFIG_TRACE_IRQFLAGS */
- CURRENT_THREAD_INFO(r10, r1)
- lwz r11,TI_FLAGS(r10)
+ lwz r11,TI_FLAGS(r2)
andi. r11,r11,_TIF_SYSCALL_DOTRACE
bne- syscall_dotrace
syscall_dotrace_cont:
@@ -379,13 +375,12 @@ ret_from_syscall:
lwz r3,GPR3(r1)
#endif
mr r6,r3
- CURRENT_THREAD_INFO(r12, r1)
/* disable interrupts so current_thread_info()->flags can't change */
LOAD_MSR_KERNEL(r10,MSR_KERNEL) /* doesn't include MSR_EE */
/* Note: We don't bother telling lockdep about it */
SYNC
MTMSRD(r10)
- lwz r9,TI_FLAGS(r12)
+ lwz r9,TI_FLAGS(r2)
li r8,-MAX_ERRNO
andi. r0,r9,(_TIF_SYSCALL_DOTRACE|_TIF_SINGLESTEP|_TIF_USER_WORK_MASK|_TIF_PERSYSCALL_MASK)
bne- syscall_exit_work
@@ -432,8 +427,7 @@ END_FTR_SECTION_IFSET(CPU_FTR_NEED_PAIRED_STWCX)
#ifdef CONFIG_VIRT_CPU_ACCOUNTING_NATIVE
andi. r4,r8,MSR_PR
beq 3f
- CURRENT_THREAD_INFO(r4, r1)
- ACCOUNT_CPU_USER_EXIT(r4, r5, r7)
+ ACCOUNT_CPU_USER_EXIT(r2, r5, r7)
3:
#endif
lwz r4,_LINK(r1)
@@ -526,7 +520,7 @@ syscall_exit_work:
/* Clear per-syscall TIF flags if any are set. */
li r11,_TIF_PERSYSCALL_MASK
- addi r12,r12,TI_FLAGS
+ addi r12,r2,TI_FLAGS
3: lwarx r8,0,r12
andc r8,r8,r11
#ifdef CONFIG_IBM405_ERR77
@@ -534,7 +528,6 @@ syscall_exit_work:
#endif
stwcx. r8,0,r12
bne- 3b
- subi r12,r12,TI_FLAGS
4: /* Anything which requires enabling interrupts? */
andi. r0,r9,(_TIF_SYSCALL_DOTRACE|_TIF_SINGLESTEP)
@@ -813,8 +806,7 @@ ret_from_except:
user_exc_return: /* r10 contains MSR_KERNEL here */
/* Check current_thread_info()->flags */
- CURRENT_THREAD_INFO(r9, r1)
- lwz r9,TI_FLAGS(r9)
+ lwz r9,TI_FLAGS(r2)
andi. r0,r9,_TIF_USER_WORK_MASK
bne do_work
@@ -827,8 +819,7 @@ restore_user:
bnel- load_dbcr0
#endif
#ifdef CONFIG_VIRT_CPU_ACCOUNTING_NATIVE
- CURRENT_THREAD_INFO(r9, r1)
- ACCOUNT_CPU_USER_EXIT(r9, r10, r11)
+ ACCOUNT_CPU_USER_EXIT(r2, r10, r11)
#endif
b restore
@@ -836,8 +827,7 @@ restore_user:
/* N.B. the only way to get here is from the beq following ret_from_except. */
resume_kernel:
/* check current_thread_info, _TIF_EMULATE_STACK_STORE */
- CURRENT_THREAD_INFO(r9, r1)
- lwz r8,TI_FLAGS(r9)
+ lwz r8,TI_FLAGS(r2)
andis. r0,r8,_TIF_EMULATE_STACK_STORE@h
beq+ 1f
@@ -863,7 +853,7 @@ resume_kernel:
/* Clear _TIF_EMULATE_STACK_STORE flag */
lis r11,_TIF_EMULATE_STACK_STORE@h
- addi r5,r9,TI_FLAGS
+ addi r5,r2,TI_FLAGS
0: lwarx r8,0,r5
andc r8,r8,r11
#ifdef CONFIG_IBM405_ERR77
@@ -875,7 +865,7 @@ resume_kernel:
#ifdef CONFIG_PREEMPT
/* check current_thread_info->preempt_count */
- lwz r0,TI_PREEMPT(r9)
+ lwz r0,TI_PREEMPT(r2)
cmpwi 0,r0,0 /* if non-zero, just restore regs and return */
bne restore
andi. r8,r8,_TIF_NEED_RESCHED
@@ -891,8 +881,7 @@ resume_kernel:
bl trace_hardirqs_off
#endif
1: bl preempt_schedule_irq
- CURRENT_THREAD_INFO(r9, r1)
- lwz r3,TI_FLAGS(r9)
+ lwz r3,TI_FLAGS(r2)
andi. r0,r3,_TIF_NEED_RESCHED
bne- 1b
#ifdef CONFIG_TRACE_IRQFLAGS
@@ -1191,8 +1180,7 @@ load_dbcr0:
lis r11,global_dbcr0@ha
addi r11,r11,global_dbcr0@l
#ifdef CONFIG_SMP
- CURRENT_THREAD_INFO(r9, r1)
- lwz r9,TI_CPU(r9)
+ lwz r9,TASK_CPU(r2)
slwi r9,r9,3
add r11,r11,r9
#endif
@@ -1232,8 +1220,7 @@ recheck:
LOAD_MSR_KERNEL(r10,MSR_KERNEL)
SYNC
MTMSRD(r10) /* disable interrupts */
- CURRENT_THREAD_INFO(r9, r1)
- lwz r9,TI_FLAGS(r9)
+ lwz r9,TI_FLAGS(r2)
andi. r0,r9,_TIF_NEED_RESCHED
bne- do_resched
andi. r0,r9,_TIF_USER_WORK_MASK
diff --git a/arch/powerpc/kernel/epapr_hcalls.S b/arch/powerpc/kernel/epapr_hcalls.S
index 52ca2471ee1a..d252f4663a23 100644
--- a/arch/powerpc/kernel/epapr_hcalls.S
+++ b/arch/powerpc/kernel/epapr_hcalls.S
@@ -21,10 +21,9 @@
#ifndef CONFIG_PPC64
/* epapr_ev_idle() was derived from e500_idle() */
_GLOBAL(epapr_ev_idle)
- CURRENT_THREAD_INFO(r3, r1)
- PPC_LL r4, TI_LOCAL_FLAGS(r3) /* set napping bit */
+ PPC_LL r4, TI_LOCAL_FLAGS(r2) /* set napping bit */
ori r4, r4,_TLF_NAPPING /* so when we take an exception */
- PPC_STL r4, TI_LOCAL_FLAGS(r3) /* it will return to our caller */
+ PPC_STL r4, TI_LOCAL_FLAGS(r2) /* it will return to our caller */
wrteei 1
diff --git a/arch/powerpc/kernel/head_fsl_booke.S b/arch/powerpc/kernel/head_fsl_booke.S
index 0d27bfff52dd..38918f82bc5b 100644
--- a/arch/powerpc/kernel/head_fsl_booke.S
+++ b/arch/powerpc/kernel/head_fsl_booke.S
@@ -244,8 +244,7 @@ set_ivor:
stwu r0,THREAD_SIZE-STACK_FRAME_OVERHEAD(r1)
#ifdef CONFIG_SMP
- CURRENT_THREAD_INFO(r22, r1)
- stw r24, TI_CPU(r22)
+ stw r24, TASK_CPU(r2)
#endif
bl early_init
@@ -704,7 +703,7 @@ finish_tlb_load:
/* Get the next_tlbcam_idx percpu var */
#ifdef CONFIG_SMP
- lwz r15, TI_CPU-THREAD(r12)
+ lwz r15, TASK_CPU-THREAD(r12)
lis r14, __per_cpu_offset@h
ori r14, r14, __per_cpu_offset@l
rlwinm r15, r15, 2, 0, 29
diff --git a/arch/powerpc/kernel/idle_6xx.S b/arch/powerpc/kernel/idle_6xx.S
index ff026c9d3cab..5afd2e236990 100644
--- a/arch/powerpc/kernel/idle_6xx.S
+++ b/arch/powerpc/kernel/idle_6xx.S
@@ -136,10 +136,9 @@ BEGIN_FTR_SECTION
DSSALL
sync
END_FTR_SECTION_IFSET(CPU_FTR_ALTIVEC)
- CURRENT_THREAD_INFO(r9, r1)
- lwz r8,TI_LOCAL_FLAGS(r9) /* set napping bit */
+ lwz r8,TI_LOCAL_FLAGS(r2) /* set napping bit */
ori r8,r8,_TLF_NAPPING /* so when we take an exception */
- stw r8,TI_LOCAL_FLAGS(r9) /* it will return to our caller */
+ stw r8,TI_LOCAL_FLAGS(r2) /* it will return to our caller */
mfmsr r7
ori r7,r7,MSR_EE
oris r7,r7,MSR_POW@h
@@ -159,8 +158,7 @@ _GLOBAL(power_save_ppc32_restore)
stw r9,_NIP(r11) /* make it do a blr */
#ifdef CONFIG_SMP
- CURRENT_THREAD_INFO(r12, r11)
- lwz r11,TI_CPU(r12) /* get cpu number * 4 */
+ lwz r11,TASK_CPU(r2) /* get cpu number * 4 */
slwi r11,r11,2
#else
li r11,0
diff --git a/arch/powerpc/kernel/idle_e500.S b/arch/powerpc/kernel/idle_e500.S
index 583e55ac7d26..69dfcd2ca011 100644
--- a/arch/powerpc/kernel/idle_e500.S
+++ b/arch/powerpc/kernel/idle_e500.S
@@ -22,10 +22,9 @@
.text
_GLOBAL(e500_idle)
- CURRENT_THREAD_INFO(r3, r1)
- lwz r4,TI_LOCAL_FLAGS(r3) /* set napping bit */
+ lwz r4,TI_LOCAL_FLAGS(r2) /* set napping bit */
ori r4,r4,_TLF_NAPPING /* so when we take an exception */
- stw r4,TI_LOCAL_FLAGS(r3) /* it will return to our caller */
+ stw r4,TI_LOCAL_FLAGS(r2) /* it will return to our caller */
#ifdef CONFIG_PPC_E500MC
wrteei 1
@@ -88,8 +87,7 @@ _GLOBAL(power_save_ppc32_restore)
stw r9,_NIP(r11) /* make it do a blr */
#ifdef CONFIG_SMP
- CURRENT_THREAD_INFO(r12, r1)
- lwz r11,TI_CPU(r12) /* get cpu number * 4 */
+ lwz r11,TASK_CPU(r2) /* get cpu number * 4 */
slwi r11,r11,2
#else
li r11,0
diff --git a/arch/powerpc/kernel/misc_32.S b/arch/powerpc/kernel/misc_32.S
index a3663ad62f16..0e4da0fe5cbf 100644
--- a/arch/powerpc/kernel/misc_32.S
+++ b/arch/powerpc/kernel/misc_32.S
@@ -183,8 +183,7 @@ _GLOBAL(low_choose_750fx_pll)
#ifdef CONFIG_SMP
/* Store new HID1 image */
- CURRENT_THREAD_INFO(r6, r1)
- lwz r6,TI_CPU(r6)
+ lwz r6,TASK_CPU(r2)
slwi r6,r6,2
#else
li r6, 0
diff --git a/arch/powerpc/mm/hash_low_32.S b/arch/powerpc/mm/hash_low_32.S
index 26acf6c8c20c..27edbfddebaa 100644
--- a/arch/powerpc/mm/hash_low_32.S
+++ b/arch/powerpc/mm/hash_low_32.S
@@ -185,8 +185,7 @@ _GLOBAL(add_hash_page)
add r3,r3,r0 /* note create_hpte trims to 24 bits */
#ifdef CONFIG_SMP
- CURRENT_THREAD_INFO(r8, r1) /* use cpu number to make tag */
- lwz r8,TI_CPU(r8) /* to go in mmu_hash_lock */
+ lwz r8,TASK_CPU(r2) /* to go in mmu_hash_lock */
oris r8,r8,12
#endif /* CONFIG_SMP */
@@ -546,9 +545,8 @@ _GLOBAL(flush_hash_pages)
#ifdef CONFIG_SMP
addis r9,r7,mmu_hash_lock@ha
addi r9,r9,mmu_hash_lock@l
- CURRENT_THREAD_INFO(r8, r1)
- add r8,r8,r7
- lwz r8,TI_CPU(r8)
+ add r8,r2,r7
+ lwz r8,TASK_CPU(r8)
oris r8,r8,9
10: lwarx r0,0,r9
cmpi 0,r0,0
@@ -641,8 +639,7 @@ EXPORT_SYMBOL(flush_hash_pages)
*/
_GLOBAL(_tlbie)
#ifdef CONFIG_SMP
- CURRENT_THREAD_INFO(r8, r1)
- lwz r8,TI_CPU(r8)
+ lwz r8,TASK_CPU(r2)
oris r8,r8,11
mfmsr r10
SYNC
@@ -679,8 +676,7 @@ _GLOBAL(_tlbie)
*/
_GLOBAL(_tlbia)
#if defined(CONFIG_SMP)
- CURRENT_THREAD_INFO(r8, r1)
- lwz r8,TI_CPU(r8)
+ lwz r8,TASK_CPU(r2)
oris r8,r8,10
mfmsr r10
SYNC
diff --git a/arch/powerpc/sysdev/6xx-suspend.S b/arch/powerpc/sysdev/6xx-suspend.S
index cf48e9cb2575..6c4aec25c4ba 100644
--- a/arch/powerpc/sysdev/6xx-suspend.S
+++ b/arch/powerpc/sysdev/6xx-suspend.S
@@ -29,10 +29,9 @@ _GLOBAL(mpc6xx_enter_standby)
ori r5, r5, ret_from_standby@l
mtlr r5
- CURRENT_THREAD_INFO(r5, r1)
- lwz r6, TI_LOCAL_FLAGS(r5)
+ lwz r6, TI_LOCAL_FLAGS(r2)
ori r6, r6, _TLF_SLEEPING
- stw r6, TI_LOCAL_FLAGS(r5)
+ stw r6, TI_LOCAL_FLAGS(r2)
mfmsr r5
ori r5, r5, MSR_EE
--
2.13.3
^ permalink raw reply related
* [PATCH v6 6/9] powerpc: 'current_set' is now a table of task_struct pointers
From: Christophe Leroy @ 2018-10-08 9:16 UTC (permalink / raw)
To: Benjamin Herrenschmidt, Paul Mackerras, Michael Ellerman
Cc: linuxppc-dev, linux-kernel
In-Reply-To: <cover.1538954166.git.christophe.leroy@c-s.fr>
The table of pointers 'current_set' has been used for retrieving
the stack and current. They used to be thread_info pointers as
they were pointing to the stack and current was taken from the
'task' field of the thread_info.
Now, the pointers of 'current_set' table are now both pointers
to task_struct and pointers to thread_info.
As they are used to get current, and the stack pointer is
retrieved from current's stack field, this patch changes
their type to task_struct, and renames secondary_ti to
secondary_current.
Reviewed-by: Nicholas Piggin <npiggin@gmail.com>
Signed-off-by: Christophe Leroy <christophe.leroy@c-s.fr>
---
arch/powerpc/include/asm/asm-prototypes.h | 4 ++--
arch/powerpc/kernel/head_32.S | 6 +++---
arch/powerpc/kernel/head_44x.S | 4 ++--
arch/powerpc/kernel/head_fsl_booke.S | 4 ++--
arch/powerpc/kernel/smp.c | 10 ++++------
5 files changed, 13 insertions(+), 15 deletions(-)
diff --git a/arch/powerpc/include/asm/asm-prototypes.h b/arch/powerpc/include/asm/asm-prototypes.h
index 9bc98c239305..ab0541f9da42 100644
--- a/arch/powerpc/include/asm/asm-prototypes.h
+++ b/arch/powerpc/include/asm/asm-prototypes.h
@@ -23,8 +23,8 @@
#include <uapi/asm/ucontext.h>
/* SMP */
-extern struct thread_info *current_set[NR_CPUS];
-extern struct thread_info *secondary_ti;
+extern struct task_struct *current_set[NR_CPUS];
+extern struct task_struct *secondary_current;
void start_secondary(void *unused);
/* kexec */
diff --git a/arch/powerpc/kernel/head_32.S b/arch/powerpc/kernel/head_32.S
index 44dfd73b2a62..ba0341bd5a00 100644
--- a/arch/powerpc/kernel/head_32.S
+++ b/arch/powerpc/kernel/head_32.S
@@ -842,9 +842,9 @@ __secondary_start:
#endif /* CONFIG_6xx */
/* get current's stack and current */
- lis r1,secondary_ti@ha
- tophys(r1,r1)
- lwz r2,secondary_ti@l(r1)
+ lis r2,secondary_current@ha
+ tophys(r2,r2)
+ lwz r2,secondary_current@l(r2)
tophys(r1,r2)
lwz r1,TASK_STACK(r1)
diff --git a/arch/powerpc/kernel/head_44x.S b/arch/powerpc/kernel/head_44x.S
index 2c7e90f36358..48e4de4dfd0c 100644
--- a/arch/powerpc/kernel/head_44x.S
+++ b/arch/powerpc/kernel/head_44x.S
@@ -1021,8 +1021,8 @@ _GLOBAL(start_secondary_47x)
/* Now we can get our task struct and real stack pointer */
/* Get current's stack and current */
- lis r1,secondary_ti@ha
- lwz r2,secondary_ti@l(r1)
+ lis r2,secondary_current@ha
+ lwz r2,secondary_current@l(r2)
lwz r1,TASK_STACK(r2)
/* Current stack pointer */
diff --git a/arch/powerpc/kernel/head_fsl_booke.S b/arch/powerpc/kernel/head_fsl_booke.S
index b8a2b789677e..0d27bfff52dd 100644
--- a/arch/powerpc/kernel/head_fsl_booke.S
+++ b/arch/powerpc/kernel/head_fsl_booke.S
@@ -1076,8 +1076,8 @@ __secondary_start:
bl call_setup_cpu
/* get current's stack and current */
- lis r1,secondary_ti@ha
- lwz r2,secondary_ti@l(r1)
+ lis r2,secondary_current@ha
+ lwz r2,secondary_current@l(r2)
lwz r1,TASK_STACK(r2)
/* stack */
diff --git a/arch/powerpc/kernel/smp.c b/arch/powerpc/kernel/smp.c
index f22fcbeb9898..00193643f0da 100644
--- a/arch/powerpc/kernel/smp.c
+++ b/arch/powerpc/kernel/smp.c
@@ -74,7 +74,7 @@
static DEFINE_PER_CPU(int, cpu_state) = { 0 };
#endif
-struct thread_info *secondary_ti;
+struct task_struct *secondary_current;
DEFINE_PER_CPU(cpumask_var_t, cpu_sibling_map);
DEFINE_PER_CPU(cpumask_var_t, cpu_l2_cache_map);
@@ -644,7 +644,7 @@ void smp_send_stop(void)
}
#endif /* CONFIG_NMI_IPI */
-struct thread_info *current_set[NR_CPUS];
+struct task_struct *current_set[NR_CPUS];
static void smp_store_cpu_info(int id)
{
@@ -724,7 +724,7 @@ void smp_prepare_boot_cpu(void)
paca_ptrs[boot_cpuid]->__current = current;
#endif
set_numa_node(numa_cpu_lookup_table[boot_cpuid]);
- current_set[boot_cpuid] = task_thread_info(current);
+ current_set[boot_cpuid] = current;
}
#ifdef CONFIG_HOTPLUG_CPU
@@ -809,15 +809,13 @@ static bool secondaries_inhibited(void)
static void cpu_idle_thread_init(unsigned int cpu, struct task_struct *idle)
{
- struct thread_info *ti = task_thread_info(idle);
-
#ifdef CONFIG_PPC64
paca_ptrs[cpu]->__current = idle;
paca_ptrs[cpu]->kstack = (unsigned long)task_stack_page(idle) +
THREAD_SIZE - STACK_FRAME_OVERHEAD;
#endif
idle->cpu = cpu;
- secondary_ti = current_set[cpu] = ti;
+ secondary_current = current_set[cpu] = idle;
}
int __cpu_up(unsigned int cpu, struct task_struct *tidle)
--
2.13.3
^ permalink raw reply related
* [PATCH v6 5/9] powerpc: regain entire stack space
From: Christophe Leroy @ 2018-10-08 9:16 UTC (permalink / raw)
To: Benjamin Herrenschmidt, Paul Mackerras, Michael Ellerman
Cc: linuxppc-dev, linux-kernel
In-Reply-To: <cover.1538954166.git.christophe.leroy@c-s.fr>
thread_info is not anymore in the stack, so the entire stack
can now be used.
In the meantime, with the previous patch all pointers to the stacks
are not anymore pointers to thread_info so this patch changes them
to void*
Signed-off-by: Christophe Leroy <christophe.leroy@c-s.fr>
---
arch/powerpc/include/asm/irq.h | 10 +++++-----
arch/powerpc/include/asm/processor.h | 3 +--
arch/powerpc/kernel/asm-offsets.c | 1 -
arch/powerpc/kernel/entry_32.S | 14 ++++----------
arch/powerpc/kernel/irq.c | 19 +++++++++----------
arch/powerpc/kernel/misc_32.S | 6 ++----
arch/powerpc/kernel/process.c | 9 +++------
arch/powerpc/kernel/setup_64.c | 8 ++++----
8 files changed, 28 insertions(+), 42 deletions(-)
diff --git a/arch/powerpc/include/asm/irq.h b/arch/powerpc/include/asm/irq.h
index 2efbae8d93be..966ddd4d2414 100644
--- a/arch/powerpc/include/asm/irq.h
+++ b/arch/powerpc/include/asm/irq.h
@@ -48,9 +48,9 @@ struct pt_regs;
* Per-cpu stacks for handling critical, debug and machine check
* level interrupts.
*/
-extern struct thread_info *critirq_ctx[NR_CPUS];
-extern struct thread_info *dbgirq_ctx[NR_CPUS];
-extern struct thread_info *mcheckirq_ctx[NR_CPUS];
+extern void *critirq_ctx[NR_CPUS];
+extern void *dbgirq_ctx[NR_CPUS];
+extern void *mcheckirq_ctx[NR_CPUS];
extern void exc_lvl_ctx_init(void);
#else
#define exc_lvl_ctx_init()
@@ -59,8 +59,8 @@ extern void exc_lvl_ctx_init(void);
/*
* Per-cpu stacks for handling hard and soft interrupts.
*/
-extern struct thread_info *hardirq_ctx[NR_CPUS];
-extern struct thread_info *softirq_ctx[NR_CPUS];
+extern void *hardirq_ctx[NR_CPUS];
+extern void *softirq_ctx[NR_CPUS];
extern void irq_ctx_init(void);
void call_do_softirq(void *sp);
diff --git a/arch/powerpc/include/asm/processor.h b/arch/powerpc/include/asm/processor.h
index b225c7f7c5a4..e763342265a2 100644
--- a/arch/powerpc/include/asm/processor.h
+++ b/arch/powerpc/include/asm/processor.h
@@ -331,8 +331,7 @@ struct thread_struct {
#define ARCH_MIN_TASKALIGN 16
#define INIT_SP (sizeof(init_stack) + (unsigned long) &init_stack)
-#define INIT_SP_LIMIT \
- (_ALIGN_UP(sizeof(struct thread_info), 16) + (unsigned long)&init_stack)
+#define INIT_SP_LIMIT ((unsigned long)&init_stack)
#ifdef CONFIG_SPE
#define SPEFSCR_INIT \
diff --git a/arch/powerpc/kernel/asm-offsets.c b/arch/powerpc/kernel/asm-offsets.c
index 833d189df04c..768ce602d624 100644
--- a/arch/powerpc/kernel/asm-offsets.c
+++ b/arch/powerpc/kernel/asm-offsets.c
@@ -93,7 +93,6 @@ int main(void)
DEFINE(NMI_MASK, NMI_MASK);
OFFSET(TASKTHREADPPR, task_struct, thread.ppr);
#else
- DEFINE(THREAD_INFO_GAP, _ALIGN_UP(sizeof(struct thread_info), 16));
OFFSET(KSP_LIMIT, thread_struct, ksp_limit);
#endif /* CONFIG_PPC64 */
OFFSET(TASK_STACK, task_struct, stack);
diff --git a/arch/powerpc/kernel/entry_32.S b/arch/powerpc/kernel/entry_32.S
index fa7a69ffb37a..bd3b146e18a3 100644
--- a/arch/powerpc/kernel/entry_32.S
+++ b/arch/powerpc/kernel/entry_32.S
@@ -97,14 +97,11 @@ crit_transfer_to_handler:
mfspr r0,SPRN_SRR1
stw r0,_SRR1(r11)
- /* set the stack limit to the current stack
- * and set the limit to protect the thread_info
- * struct
- */
+ /* set the stack limit to the current stack */
mfspr r8,SPRN_SPRG_THREAD
lwz r0,KSP_LIMIT(r8)
stw r0,SAVED_KSP_LIMIT(r11)
- rlwimi r0,r1,0,0,(31-THREAD_SHIFT)
+ rlwinm r0,r1,0,0,(31 - THREAD_SHIFT)
stw r0,KSP_LIMIT(r8)
/* fall through */
#endif
@@ -121,14 +118,11 @@ crit_transfer_to_handler:
mfspr r0,SPRN_SRR1
stw r0,crit_srr1@l(0)
- /* set the stack limit to the current stack
- * and set the limit to protect the thread_info
- * struct
- */
+ /* set the stack limit to the current stack */
mfspr r8,SPRN_SPRG_THREAD
lwz r0,KSP_LIMIT(r8)
stw r0,saved_ksp_limit@l(0)
- rlwimi r0,r1,0,0,(31-THREAD_SHIFT)
+ rlwinm r0,r1,0,0,(31 - THREAD_SHIFT)
stw r0,KSP_LIMIT(r8)
/* fall through */
#endif
diff --git a/arch/powerpc/kernel/irq.c b/arch/powerpc/kernel/irq.c
index 3fdb6b6973cf..62cfccf4af89 100644
--- a/arch/powerpc/kernel/irq.c
+++ b/arch/powerpc/kernel/irq.c
@@ -618,9 +618,8 @@ static inline void check_stack_overflow(void)
sp = current_stack_pointer() & (THREAD_SIZE-1);
/* check for stack overflow: is there less than 2KB free? */
- if (unlikely(sp < (sizeof(struct thread_info) + 2048))) {
- pr_err("do_IRQ: stack overflow: %ld\n",
- sp - sizeof(struct thread_info));
+ if (unlikely(sp < 2048)) {
+ pr_err("do_IRQ: stack overflow: %ld\n", sp);
dump_stack();
}
#endif
@@ -660,7 +659,7 @@ void __do_irq(struct pt_regs *regs)
void do_IRQ(struct pt_regs *regs)
{
struct pt_regs *old_regs = set_irq_regs(regs);
- struct thread_info *curtp, *irqtp, *sirqtp;
+ void *curtp, *irqtp, *sirqtp;
/* Switch to the irq stack to handle this */
curtp = (void *)(current_stack_pointer() & ~(THREAD_SIZE - 1));
@@ -690,9 +689,9 @@ void __init init_IRQ(void)
}
#if defined(CONFIG_BOOKE) || defined(CONFIG_40x)
-struct thread_info *critirq_ctx[NR_CPUS] __read_mostly;
-struct thread_info *dbgirq_ctx[NR_CPUS] __read_mostly;
-struct thread_info *mcheckirq_ctx[NR_CPUS] __read_mostly;
+void *critirq_ctx[NR_CPUS] __read_mostly;
+void *dbgirq_ctx[NR_CPUS] __read_mostly;
+void *mcheckirq_ctx[NR_CPUS] __read_mostly;
void exc_lvl_ctx_init(void)
{
@@ -718,8 +717,8 @@ void exc_lvl_ctx_init(void)
}
#endif
-struct thread_info *softirq_ctx[NR_CPUS] __read_mostly;
-struct thread_info *hardirq_ctx[NR_CPUS] __read_mostly;
+void *softirq_ctx[NR_CPUS] __read_mostly;
+void *hardirq_ctx[NR_CPUS] __read_mostly;
void irq_ctx_init(void)
{
@@ -733,7 +732,7 @@ void irq_ctx_init(void)
void do_softirq_own_stack(void)
{
- struct thread_info *irqtp;
+ void *irqtp;
irqtp = softirq_ctx[smp_processor_id()];
call_do_softirq(irqtp);
diff --git a/arch/powerpc/kernel/misc_32.S b/arch/powerpc/kernel/misc_32.S
index 32762f4c3458..a3663ad62f16 100644
--- a/arch/powerpc/kernel/misc_32.S
+++ b/arch/powerpc/kernel/misc_32.S
@@ -46,11 +46,10 @@ _GLOBAL(call_do_softirq)
mflr r0
stw r0,4(r1)
lwz r10,THREAD+KSP_LIMIT(r2)
- addi r11,r3,THREAD_INFO_GAP
+ stw r3, THREAD+KSP_LIMIT(r2)
stwu r1,THREAD_SIZE-STACK_FRAME_OVERHEAD(r3)
mr r1,r3
stw r10,8(r1)
- stw r11,THREAD+KSP_LIMIT(r2)
bl __do_softirq
lwz r10,8(r1)
lwz r1,0(r1)
@@ -66,11 +65,10 @@ _GLOBAL(call_do_irq)
mflr r0
stw r0,4(r1)
lwz r10,THREAD+KSP_LIMIT(r2)
- addi r11,r4,THREAD_INFO_GAP
+ stw r4, THREAD+KSP_LIMIT(r2)
stwu r1,THREAD_SIZE-STACK_FRAME_OVERHEAD(r4)
mr r1,r4
stw r10,8(r1)
- stw r11,THREAD+KSP_LIMIT(r2)
bl __do_irq
lwz r10,8(r1)
lwz r1,0(r1)
diff --git a/arch/powerpc/kernel/process.c b/arch/powerpc/kernel/process.c
index a12307ebb7ef..afe76f7f316c 100644
--- a/arch/powerpc/kernel/process.c
+++ b/arch/powerpc/kernel/process.c
@@ -1689,8 +1689,7 @@ int copy_thread(unsigned long clone_flags, unsigned long usp,
sp -= STACK_FRAME_OVERHEAD;
p->thread.ksp = sp;
#ifdef CONFIG_PPC32
- p->thread.ksp_limit = (unsigned long)task_stack_page(p) +
- _ALIGN_UP(sizeof(struct thread_info), 16);
+ p->thread.ksp_limit = (unsigned long)task_stack_page(p);
#endif
#ifdef CONFIG_HAVE_HW_BREAKPOINT
p->thread.ptrace_bps[0] = NULL;
@@ -1992,13 +1991,11 @@ static inline int valid_irq_stack(unsigned long sp, struct task_struct *p,
*/
if (cpu < NR_CPUS && cpu_possible(cpu)) {
stack_page = (unsigned long) hardirq_ctx[cpu];
- if (sp >= stack_page + sizeof(struct thread_struct)
- && sp <= stack_page + THREAD_SIZE - nbytes)
+ if (sp >= stack_page && sp <= stack_page + THREAD_SIZE - nbytes)
return 1;
stack_page = (unsigned long) softirq_ctx[cpu];
- if (sp >= stack_page + sizeof(struct thread_struct)
- && sp <= stack_page + THREAD_SIZE - nbytes)
+ if (sp >= stack_page && sp <= stack_page + THREAD_SIZE - nbytes)
return 1;
}
return 0;
diff --git a/arch/powerpc/kernel/setup_64.c b/arch/powerpc/kernel/setup_64.c
index 2d682f3e31c6..6792e9c90689 100644
--- a/arch/powerpc/kernel/setup_64.c
+++ b/arch/powerpc/kernel/setup_64.c
@@ -717,22 +717,22 @@ void __init emergency_stack_init(void)
limit = min(ppc64_bolted_size(), ppc64_rma_size);
for_each_possible_cpu(i) {
- struct thread_info *ti;
+ void *ti;
ti = alloc_stack(limit, i);
memset(ti, 0, THREAD_SIZE);
- paca_ptrs[i]->emergency_sp = (void *)ti + THREAD_SIZE;
+ paca_ptrs[i]->emergency_sp = ti + THREAD_SIZE;
#ifdef CONFIG_PPC_BOOK3S_64
/* emergency stack for NMI exception handling. */
ti = alloc_stack(limit, i);
memset(ti, 0, THREAD_SIZE);
- paca_ptrs[i]->nmi_emergency_sp = (void *)ti + THREAD_SIZE;
+ paca_ptrs[i]->nmi_emergency_sp = ti + THREAD_SIZE;
/* emergency stack for machine check exception handling. */
ti = alloc_stack(limit, i);
memset(ti, 0, THREAD_SIZE);
- paca_ptrs[i]->mc_emergency_sp = (void *)ti + THREAD_SIZE;
+ paca_ptrs[i]->mc_emergency_sp = ti + THREAD_SIZE;
#endif
}
}
--
2.13.3
^ permalink raw reply related
* [PATCH v6 4/9] powerpc: Activate CONFIG_THREAD_INFO_IN_TASK
From: Christophe Leroy @ 2018-10-08 9:16 UTC (permalink / raw)
To: Benjamin Herrenschmidt, Paul Mackerras, Michael Ellerman
Cc: linuxppc-dev, linux-kernel
In-Reply-To: <cover.1538954166.git.christophe.leroy@c-s.fr>
This patch activates CONFIG_THREAD_INFO_IN_TASK which
moves the thread_info into task_struct.
Moving thread_info into task_struct has the following advantages:
- It protects thread_info from corruption in the case of stack
overflows.
- Its address is harder to determine if stack addresses are
leaked, making a number of attacks more difficult.
This has the following consequences:
- thread_info is now located at the beginning of task_struct.
- The 'cpu' field is now in task_struct, and only exists when
CONFIG_SMP is active.
- thread_info doesn't have anymore the 'task' field.
This patch:
- Removes all recopy of thread_info struct when the stack changes.
- Changes the CURRENT_THREAD_INFO() macro to point to current.
- Selects CONFIG_THREAD_INFO_IN_TASK.
- Modifies raw_smp_processor_id() to get ->cpu from current without
including linux/sched.h to avoid circular inclusion and without
including asm/asm-offsets.h to avoid symbol names duplication
between ASM constants and C constants.
Signed-off-by: Christophe Leroy <christophe.leroy@c-s.fr>
Reviewed-by: Nicholas Piggin <npiggin@gmail.com>
---
arch/powerpc/Kconfig | 1 +
arch/powerpc/Makefile | 8 +++++-
arch/powerpc/include/asm/ptrace.h | 2 +-
arch/powerpc/include/asm/smp.h | 17 +++++++++++-
arch/powerpc/include/asm/thread_info.h | 17 ++----------
arch/powerpc/kernel/asm-offsets.c | 7 +++--
arch/powerpc/kernel/entry_32.S | 9 +++----
arch/powerpc/kernel/exceptions-64e.S | 11 --------
arch/powerpc/kernel/head_32.S | 6 ++---
arch/powerpc/kernel/head_44x.S | 4 +--
arch/powerpc/kernel/head_64.S | 1 +
arch/powerpc/kernel/head_booke.h | 8 +-----
arch/powerpc/kernel/head_fsl_booke.S | 7 +++--
arch/powerpc/kernel/irq.c | 47 +---------------------------------
arch/powerpc/kernel/kgdb.c | 28 --------------------
arch/powerpc/kernel/machine_kexec_64.c | 6 ++---
arch/powerpc/kernel/setup_64.c | 21 ---------------
arch/powerpc/kernel/smp.c | 2 +-
arch/powerpc/net/bpf_jit32.h | 5 ++--
19 files changed, 52 insertions(+), 155 deletions(-)
diff --git a/arch/powerpc/Kconfig b/arch/powerpc/Kconfig
index 602eea723624..3b958cd4e284 100644
--- a/arch/powerpc/Kconfig
+++ b/arch/powerpc/Kconfig
@@ -238,6 +238,7 @@ config PPC
select RTC_LIB
select SPARSE_IRQ
select SYSCTL_EXCEPTION_TRACE
+ select THREAD_INFO_IN_TASK
select VIRT_TO_BUS if !PPC64
#
# Please keep this list sorted alphabetically.
diff --git a/arch/powerpc/Makefile b/arch/powerpc/Makefile
index 81552c7b46eb..02e7ca1c15d4 100644
--- a/arch/powerpc/Makefile
+++ b/arch/powerpc/Makefile
@@ -422,6 +422,13 @@ else
endif
endif
+ifdef CONFIG_SMP
+prepare: task_cpu_prepare
+
+task_cpu_prepare: prepare0
+ $(eval KBUILD_CFLAGS += -D_TASK_CPU=$(shell awk '{if ($$2 == "TI_CPU") print $$3;}' include/generated/asm-offsets.h))
+endif
+
# Use the file '.tmp_gas_check' for binutils tests, as gas won't output
# to stdout and these checks are run even on install targets.
TOUT := .tmp_gas_check
@@ -439,4 +446,3 @@ checkbin:
CLEAN_FILES += $(TOUT)
-
diff --git a/arch/powerpc/include/asm/ptrace.h b/arch/powerpc/include/asm/ptrace.h
index 447cbd1bee99..3a7e5561630b 100644
--- a/arch/powerpc/include/asm/ptrace.h
+++ b/arch/powerpc/include/asm/ptrace.h
@@ -120,7 +120,7 @@ extern int ptrace_put_reg(struct task_struct *task, int regno,
unsigned long data);
#define current_pt_regs() \
- ((struct pt_regs *)((unsigned long)current_thread_info() + THREAD_SIZE) - 1)
+ ((struct pt_regs *)((unsigned long)task_stack_page(current) + THREAD_SIZE) - 1)
/*
* We use the least-significant bit of the trap field to indicate
* whether we have saved the full set of registers, or only a
diff --git a/arch/powerpc/include/asm/smp.h b/arch/powerpc/include/asm/smp.h
index 95b66a0c639b..93a8cd120663 100644
--- a/arch/powerpc/include/asm/smp.h
+++ b/arch/powerpc/include/asm/smp.h
@@ -83,7 +83,22 @@ int is_cpu_dead(unsigned int cpu);
/* 32-bit */
extern int smp_hw_index[];
-#define raw_smp_processor_id() (current_thread_info()->cpu)
+/*
+ * This is particularly ugly: it appears we can't actually get the definition
+ * of task_struct here, but we need access to the CPU this task is running on.
+ * Instead of using task_struct we're using _TASK_CPU which is extracted from
+ * asm-offsets.h by kbuild to get the current processor ID.
+ *
+ * This also needs to be safeguarded when building asm-offsets.s because at
+ * that time _TASK_CPU is not defined yet. It could have been guarded by
+ * _TASK_CPU itself, but we want the build to fail if _TASK_CPU is missing
+ * when building something else than asm-offsets.s
+ */
+#ifdef GENERATING_ASM_OFFSETS
+#define raw_smp_processor_id() (0)
+#else
+#define raw_smp_processor_id() (*(unsigned int *)((void *)current + _TASK_CPU))
+#endif
#define hard_smp_processor_id() (smp_hw_index[smp_processor_id()])
static inline int get_hard_smp_processor_id(int cpu)
diff --git a/arch/powerpc/include/asm/thread_info.h b/arch/powerpc/include/asm/thread_info.h
index 3185f8ac1182..61c8747cd926 100644
--- a/arch/powerpc/include/asm/thread_info.h
+++ b/arch/powerpc/include/asm/thread_info.h
@@ -18,9 +18,9 @@
#define THREAD_SIZE (1 << THREAD_SHIFT)
#ifdef CONFIG_PPC64
-#define CURRENT_THREAD_INFO(dest, sp) stringify_in_c(clrrdi dest, sp, THREAD_SHIFT)
+#define CURRENT_THREAD_INFO(dest, sp) stringify_in_c(ld dest, PACACURRENT(r13))
#else
-#define CURRENT_THREAD_INFO(dest, sp) stringify_in_c(rlwinm dest, sp, 0, 0, 31-THREAD_SHIFT)
+#define CURRENT_THREAD_INFO(dest, sp) stringify_in_c(mr dest, r2)
#endif
#ifndef __ASSEMBLY__
@@ -33,8 +33,6 @@
* low level task data.
*/
struct thread_info {
- struct task_struct *task; /* main task structure */
- int cpu; /* cpu we're on */
int preempt_count; /* 0 => preemptable,
<0 => BUG */
unsigned long local_flags; /* private flags for thread */
@@ -53,8 +51,6 @@ struct thread_info {
*/
#define INIT_THREAD_INFO(tsk) \
{ \
- .task = &tsk, \
- .cpu = 0, \
.preempt_count = INIT_PREEMPT_COUNT, \
.flags = 0, \
}
@@ -62,15 +58,6 @@ struct thread_info {
#define THREAD_SIZE_ORDER (THREAD_SHIFT - PAGE_SHIFT)
/* how to get the thread information struct from C */
-static inline struct thread_info *current_thread_info(void)
-{
- unsigned long val;
-
- asm (CURRENT_THREAD_INFO(%0,1) : "=r" (val));
-
- return (struct thread_info *)val;
-}
-
extern int arch_dup_task_struct(struct task_struct *dst, struct task_struct *src);
#endif /* __ASSEMBLY__ */
diff --git a/arch/powerpc/kernel/asm-offsets.c b/arch/powerpc/kernel/asm-offsets.c
index c583a02e5a21..833d189df04c 100644
--- a/arch/powerpc/kernel/asm-offsets.c
+++ b/arch/powerpc/kernel/asm-offsets.c
@@ -13,6 +13,8 @@
* 2 of the License, or (at your option) any later version.
*/
+#define GENERATING_ASM_OFFSETS /* asm/smp.h */
+
#include <linux/compat.h>
#include <linux/signal.h>
#include <linux/sched.h>
@@ -95,6 +97,9 @@ int main(void)
OFFSET(KSP_LIMIT, thread_struct, ksp_limit);
#endif /* CONFIG_PPC64 */
OFFSET(TASK_STACK, task_struct, stack);
+#ifdef CONFIG_SMP
+ OFFSET(TI_CPU, task_struct, cpu);
+#endif
#ifdef CONFIG_LIVEPATCH
OFFSET(TI_livepatch_sp, thread_info, livepatch_sp);
@@ -162,8 +167,6 @@ int main(void)
OFFSET(TI_FLAGS, thread_info, flags);
OFFSET(TI_LOCAL_FLAGS, thread_info, local_flags);
OFFSET(TI_PREEMPT, thread_info, preempt_count);
- OFFSET(TI_TASK, thread_info, task);
- OFFSET(TI_CPU, thread_info, cpu);
#ifdef CONFIG_PPC64
OFFSET(DCACHEL1BLOCKSIZE, ppc64_caches, l1d.block_size);
diff --git a/arch/powerpc/kernel/entry_32.S b/arch/powerpc/kernel/entry_32.S
index 7ea1d71f4546..fa7a69ffb37a 100644
--- a/arch/powerpc/kernel/entry_32.S
+++ b/arch/powerpc/kernel/entry_32.S
@@ -1166,10 +1166,6 @@ ret_from_debug_exc:
mfspr r9,SPRN_SPRG_THREAD
lwz r10,SAVED_KSP_LIMIT(r1)
stw r10,KSP_LIMIT(r9)
- lwz r9,TASK_STACK-THREAD(r9)
- CURRENT_THREAD_INFO(r10, r1)
- lwz r10,TI_PREEMPT(r10)
- stw r10,TI_PREEMPT(r9)
RESTORE_xSRR(SRR0,SRR1);
RESTORE_xSRR(CSRR0,CSRR1);
RESTORE_MMU_REGS;
@@ -1292,10 +1288,13 @@ BEGIN_FTR_SECTION
END_FTR_SECTION_IFSET(CPU_FTR_601)
lwz r3,_TRAP(r1)
andi. r0,r3,1
- beq 4f
+ beq 5f
SAVE_NVGPRS(r1)
rlwinm r3,r3,0,0,30
stw r3,_TRAP(r1)
+5: mfspr r2,SPRN_SPRG_THREAD
+ addi r2,r2,-THREAD
+ tovirt(r2,r2) /* set back r2 to current */
4: addi r3,r1,STACK_FRAME_OVERHEAD
bl unrecoverable_exception
/* shouldn't return */
diff --git a/arch/powerpc/kernel/exceptions-64e.S b/arch/powerpc/kernel/exceptions-64e.S
index 6d6e144a28ce..231d066b4a3d 100644
--- a/arch/powerpc/kernel/exceptions-64e.S
+++ b/arch/powerpc/kernel/exceptions-64e.S
@@ -77,17 +77,6 @@ special_reg_save:
andi. r3,r3,MSR_PR
bnelr
- /* Copy info into temporary exception thread info */
- ld r11,PACAKSAVE(r13)
- CURRENT_THREAD_INFO(r11, r11)
- CURRENT_THREAD_INFO(r12, r1)
- ld r10,TI_FLAGS(r11)
- std r10,TI_FLAGS(r12)
- ld r10,TI_PREEMPT(r11)
- std r10,TI_PREEMPT(r12)
- ld r10,TI_TASK(r11)
- std r10,TI_TASK(r12)
-
/*
* Advance to the next TLB exception frame for handler
* types that don't do it automatically.
diff --git a/arch/powerpc/kernel/head_32.S b/arch/powerpc/kernel/head_32.S
index dce6f2ff07e5..44dfd73b2a62 100644
--- a/arch/powerpc/kernel/head_32.S
+++ b/arch/powerpc/kernel/head_32.S
@@ -844,9 +844,9 @@ __secondary_start:
/* get current's stack and current */
lis r1,secondary_ti@ha
tophys(r1,r1)
- lwz r1,secondary_ti@l(r1)
- tophys(r2,r1)
- lwz r2,TI_TASK(r2)
+ lwz r2,secondary_ti@l(r1)
+ tophys(r1,r2)
+ lwz r1,TASK_STACK(r1)
/* stack */
addi r1,r1,THREAD_SIZE-STACK_FRAME_OVERHEAD
diff --git a/arch/powerpc/kernel/head_44x.S b/arch/powerpc/kernel/head_44x.S
index 15d39b2499de..2c7e90f36358 100644
--- a/arch/powerpc/kernel/head_44x.S
+++ b/arch/powerpc/kernel/head_44x.S
@@ -1022,8 +1022,8 @@ _GLOBAL(start_secondary_47x)
/* Get current's stack and current */
lis r1,secondary_ti@ha
- lwz r1,secondary_ti@l(r1)
- lwz r2,TI_TASK(r1)
+ lwz r2,secondary_ti@l(r1)
+ lwz r1,TASK_STACK(r2)
/* Current stack pointer */
addi r1,r1,THREAD_SIZE-STACK_FRAME_OVERHEAD
diff --git a/arch/powerpc/kernel/head_64.S b/arch/powerpc/kernel/head_64.S
index 4898e9491a1c..c6a9bf7b34bf 100644
--- a/arch/powerpc/kernel/head_64.S
+++ b/arch/powerpc/kernel/head_64.S
@@ -805,6 +805,7 @@ __secondary_start:
LOAD_REG_ADDR(r3, current_set)
sldi r28,r24,3 /* get current_set[cpu#] */
ldx r14,r3,r28
+ ld r14,TASK_STACK(r14)
addi r14,r14,THREAD_SIZE-STACK_FRAME_OVERHEAD
std r14,PACAKSAVE(r13)
diff --git a/arch/powerpc/kernel/head_booke.h b/arch/powerpc/kernel/head_booke.h
index 175f812066dc..f0c254ab9703 100644
--- a/arch/powerpc/kernel/head_booke.h
+++ b/arch/powerpc/kernel/head_booke.h
@@ -143,13 +143,7 @@
stw r10,GPR11(r11); \
b 2f; \
/* COMING FROM PRIV MODE */ \
-1: lwz r9,TI_FLAGS-EXC_LVL_FRAME_OVERHEAD(r11); \
- lwz r10,TI_PREEMPT-EXC_LVL_FRAME_OVERHEAD(r11); \
- stw r9,TI_FLAGS-EXC_LVL_FRAME_OVERHEAD(r8); \
- stw r10,TI_PREEMPT-EXC_LVL_FRAME_OVERHEAD(r8); \
- lwz r9,TI_TASK-EXC_LVL_FRAME_OVERHEAD(r11); \
- stw r9,TI_TASK-EXC_LVL_FRAME_OVERHEAD(r8); \
- mr r11,r8; \
+1: mr r11, r8; \
2: mfspr r8,SPRN_SPRG_RSCRATCH_##exc_level; \
stw r12,GPR12(r11); /* save various registers */\
mflr r10; \
diff --git a/arch/powerpc/kernel/head_fsl_booke.S b/arch/powerpc/kernel/head_fsl_booke.S
index 239ad8a4754e..b8a2b789677e 100644
--- a/arch/powerpc/kernel/head_fsl_booke.S
+++ b/arch/powerpc/kernel/head_fsl_booke.S
@@ -704,8 +704,7 @@ finish_tlb_load:
/* Get the next_tlbcam_idx percpu var */
#ifdef CONFIG_SMP
- lwz r12, TASK_STACK-THREAD(r12)
- lwz r15, TI_CPU(r12)
+ lwz r15, TI_CPU-THREAD(r12)
lis r14, __per_cpu_offset@h
ori r14, r14, __per_cpu_offset@l
rlwinm r15, r15, 2, 0, 29
@@ -1078,8 +1077,8 @@ __secondary_start:
/* get current's stack and current */
lis r1,secondary_ti@ha
- lwz r1,secondary_ti@l(r1)
- lwz r2,TI_TASK(r1)
+ lwz r2,secondary_ti@l(r1)
+ lwz r1,TASK_STACK(r2)
/* stack */
addi r1,r1,THREAD_SIZE-STACK_FRAME_OVERHEAD
diff --git a/arch/powerpc/kernel/irq.c b/arch/powerpc/kernel/irq.c
index 9e7dc4468c8c..3fdb6b6973cf 100644
--- a/arch/powerpc/kernel/irq.c
+++ b/arch/powerpc/kernel/irq.c
@@ -673,24 +673,9 @@ void do_IRQ(struct pt_regs *regs)
set_irq_regs(old_regs);
return;
}
-
- /* Prepare the thread_info in the irq stack */
- irqtp->task = curtp->task;
- irqtp->flags = 0;
-
- /* Copy the preempt_count so that the [soft]irq checks work. */
- irqtp->preempt_count = curtp->preempt_count;
-
/* Switch stack and call */
call_do_irq(regs, irqtp);
- /* Restore stack limit */
- irqtp->task = NULL;
-
- /* Copy back updates to the thread_info */
- if (irqtp->flags)
- set_bits(irqtp->flags, &curtp->flags);
-
set_irq_regs(old_regs);
}
@@ -711,7 +696,6 @@ struct thread_info *mcheckirq_ctx[NR_CPUS] __read_mostly;
void exc_lvl_ctx_init(void)
{
- struct thread_info *tp;
int i, cpu_nr;
for_each_possible_cpu(i) {
@@ -726,20 +710,9 @@ void exc_lvl_ctx_init(void)
#endif
memset((void *)critirq_ctx[cpu_nr], 0, THREAD_SIZE);
- tp = critirq_ctx[cpu_nr];
- tp->cpu = cpu_nr;
- tp->preempt_count = 0;
-
#ifdef CONFIG_BOOKE
memset((void *)dbgirq_ctx[cpu_nr], 0, THREAD_SIZE);
- tp = dbgirq_ctx[cpu_nr];
- tp->cpu = cpu_nr;
- tp->preempt_count = 0;
-
memset((void *)mcheckirq_ctx[cpu_nr], 0, THREAD_SIZE);
- tp = mcheckirq_ctx[cpu_nr];
- tp->cpu = cpu_nr;
- tp->preempt_count = HARDIRQ_OFFSET;
#endif
}
}
@@ -750,38 +723,20 @@ struct thread_info *hardirq_ctx[NR_CPUS] __read_mostly;
void irq_ctx_init(void)
{
- struct thread_info *tp;
int i;
for_each_possible_cpu(i) {
memset((void *)softirq_ctx[i], 0, THREAD_SIZE);
- tp = softirq_ctx[i];
- tp->cpu = i;
- klp_init_thread_info(tp);
-
memset((void *)hardirq_ctx[i], 0, THREAD_SIZE);
- tp = hardirq_ctx[i];
- tp->cpu = i;
- klp_init_thread_info(tp);
}
}
void do_softirq_own_stack(void)
{
- struct thread_info *curtp, *irqtp;
+ struct thread_info *irqtp;
- curtp = current_thread_info();
irqtp = softirq_ctx[smp_processor_id()];
- irqtp->task = curtp->task;
- irqtp->flags = 0;
call_do_softirq(irqtp);
- irqtp->task = NULL;
-
- /* Set any flag that may have been set on the
- * alternate stack
- */
- if (irqtp->flags)
- set_bits(irqtp->flags, &curtp->flags);
}
irq_hw_number_t virq_to_hw(unsigned int virq)
diff --git a/arch/powerpc/kernel/kgdb.c b/arch/powerpc/kernel/kgdb.c
index 59c578f865aa..5056e54b5239 100644
--- a/arch/powerpc/kernel/kgdb.c
+++ b/arch/powerpc/kernel/kgdb.c
@@ -151,41 +151,13 @@ static int kgdb_handle_breakpoint(struct pt_regs *regs)
return 1;
}
-static DEFINE_PER_CPU(struct thread_info, kgdb_thread_info);
static int kgdb_singlestep(struct pt_regs *regs)
{
- struct thread_info *thread_info, *exception_thread_info;
- struct thread_info *backup_current_thread_info =
- this_cpu_ptr(&kgdb_thread_info);
-
if (user_mode(regs))
return 0;
- /*
- * On Book E and perhaps other processors, singlestep is handled on
- * the critical exception stack. This causes current_thread_info()
- * to fail, since it it locates the thread_info by masking off
- * the low bits of the current stack pointer. We work around
- * this issue by copying the thread_info from the kernel stack
- * before calling kgdb_handle_exception, and copying it back
- * afterwards. On most processors the copy is avoided since
- * exception_thread_info == thread_info.
- */
- thread_info = (struct thread_info *)(regs->gpr[1] & ~(THREAD_SIZE-1));
- exception_thread_info = current_thread_info();
-
- if (thread_info != exception_thread_info) {
- /* Save the original current_thread_info. */
- memcpy(backup_current_thread_info, exception_thread_info, sizeof *thread_info);
- memcpy(exception_thread_info, thread_info, sizeof *thread_info);
- }
-
kgdb_handle_exception(0, SIGTRAP, 0, regs);
- if (thread_info != exception_thread_info)
- /* Restore current_thread_info lastly. */
- memcpy(exception_thread_info, backup_current_thread_info, sizeof *thread_info);
-
return 1;
}
diff --git a/arch/powerpc/kernel/machine_kexec_64.c b/arch/powerpc/kernel/machine_kexec_64.c
index a0f6f45005bd..75692c327ba0 100644
--- a/arch/powerpc/kernel/machine_kexec_64.c
+++ b/arch/powerpc/kernel/machine_kexec_64.c
@@ -317,10 +317,8 @@ void default_machine_kexec(struct kimage *image)
* We setup preempt_count to avoid using VMX in memcpy.
* XXX: the task struct will likely be invalid once we do the copy!
*/
- kexec_stack.thread_info.task = current_thread_info()->task;
- kexec_stack.thread_info.flags = 0;
- kexec_stack.thread_info.preempt_count = HARDIRQ_OFFSET;
- kexec_stack.thread_info.cpu = current_thread_info()->cpu;
+ current_thread_info()->flags = 0;
+ current_thread_info()->preempt_count = HARDIRQ_OFFSET;
/* We need a static PACA, too; copy this CPU's PACA over and switch to
* it. Also poison per_cpu_offset and NULL lppaca to catch anyone using
diff --git a/arch/powerpc/kernel/setup_64.c b/arch/powerpc/kernel/setup_64.c
index faf00222b324..2d682f3e31c6 100644
--- a/arch/powerpc/kernel/setup_64.c
+++ b/arch/powerpc/kernel/setup_64.c
@@ -691,24 +691,6 @@ void __init exc_lvl_early_init(void)
#endif
/*
- * Emergency stacks are used for a range of things, from asynchronous
- * NMIs (system reset, machine check) to synchronous, process context.
- * We set preempt_count to zero, even though that isn't necessarily correct. To
- * get the right value we'd need to copy it from the previous thread_info, but
- * doing that might fault causing more problems.
- * TODO: what to do with accounting?
- */
-static void emerg_stack_init_thread_info(struct thread_info *ti, int cpu)
-{
- ti->task = NULL;
- ti->cpu = cpu;
- ti->preempt_count = 0;
- ti->local_flags = 0;
- ti->flags = 0;
- klp_init_thread_info(ti);
-}
-
-/*
* Stack space used when we detect a bad kernel stack pointer, and
* early in SMP boots before relocation is enabled. Exclusive emergency
* stack for machine checks.
@@ -739,20 +721,17 @@ void __init emergency_stack_init(void)
ti = alloc_stack(limit, i);
memset(ti, 0, THREAD_SIZE);
- emerg_stack_init_thread_info(ti, i);
paca_ptrs[i]->emergency_sp = (void *)ti + THREAD_SIZE;
#ifdef CONFIG_PPC_BOOK3S_64
/* emergency stack for NMI exception handling. */
ti = alloc_stack(limit, i);
memset(ti, 0, THREAD_SIZE);
- emerg_stack_init_thread_info(ti, i);
paca_ptrs[i]->nmi_emergency_sp = (void *)ti + THREAD_SIZE;
/* emergency stack for machine check exception handling. */
ti = alloc_stack(limit, i);
memset(ti, 0, THREAD_SIZE);
- emerg_stack_init_thread_info(ti, i);
paca_ptrs[i]->mc_emergency_sp = (void *)ti + THREAD_SIZE;
#endif
}
diff --git a/arch/powerpc/kernel/smp.c b/arch/powerpc/kernel/smp.c
index 19dd0ea55714..f22fcbeb9898 100644
--- a/arch/powerpc/kernel/smp.c
+++ b/arch/powerpc/kernel/smp.c
@@ -816,7 +816,7 @@ static void cpu_idle_thread_init(unsigned int cpu, struct task_struct *idle)
paca_ptrs[cpu]->kstack = (unsigned long)task_stack_page(idle) +
THREAD_SIZE - STACK_FRAME_OVERHEAD;
#endif
- ti->cpu = cpu;
+ idle->cpu = cpu;
secondary_ti = current_set[cpu] = ti;
}
diff --git a/arch/powerpc/net/bpf_jit32.h b/arch/powerpc/net/bpf_jit32.h
index 6f4daacad296..dc50a8d4b3b9 100644
--- a/arch/powerpc/net/bpf_jit32.h
+++ b/arch/powerpc/net/bpf_jit32.h
@@ -106,9 +106,8 @@ DECLARE_LOAD_FUNC(sk_load_byte_msh);
} while (0)
#else
#define PPC_BPF_LOAD_CPU(r) \
- do { BUILD_BUG_ON(FIELD_SIZEOF(struct thread_info, cpu) != 4); \
- PPC_LHZ_OFFS(r, (1 & ~(THREAD_SIZE - 1)), \
- offsetof(struct thread_info, cpu)); \
+ do { BUILD_BUG_ON(FIELD_SIZEOF(struct task_struct, cpu) != 4); \
+ PPC_LHZ_OFFS(r, 2, offsetof(struct task_struct, cpu)); \
} while(0)
#endif
#else
--
2.13.3
^ permalink raw reply related
* [PATCH v6 3/9] powerpc: Prepare for moving thread_info into task_struct
From: Christophe Leroy @ 2018-10-08 9:16 UTC (permalink / raw)
To: Benjamin Herrenschmidt, Paul Mackerras, Michael Ellerman
Cc: linuxppc-dev, linux-kernel
In-Reply-To: <cover.1538954166.git.christophe.leroy@c-s.fr>
This patch cleans the powerpc kernel before activating
CONFIG_THREAD_INFO_IN_TASK:
- The purpose of the pointer given to call_do_softirq() and
call_do_irq() is to point the new stack ==> change it to void* and
rename it 'sp'
- Don't use CURRENT_THREAD_INFO() to locate the stack.
- Fix a few comments.
- Replace current_thread_info()->task by current
- Remove unnecessary casts to thread_info, as they'll become invalid
once thread_info is not in stack anymore.
- Rename THREAD_INFO to TASK_STASK: as it is in fact the offset of the
pointer to the stack in task_struct, this pointer will not be impacted
by the move of THREAD_INFO.
- Makes TASK_STACK available to PPC64. PPC64 will need it to get the
stack pointer from current once the thread_info have been moved.
- Modifies klp_init_thread_info() to take task_struct pointer argument.
Signed-off-by: Christophe Leroy <christophe.leroy@c-s.fr>
Reviewed-by: Nicholas Piggin <npiggin@gmail.com>
---
arch/powerpc/include/asm/irq.h | 4 ++--
arch/powerpc/include/asm/livepatch.h | 7 ++++---
arch/powerpc/include/asm/processor.h | 4 ++--
arch/powerpc/include/asm/reg.h | 2 +-
arch/powerpc/kernel/asm-offsets.c | 2 +-
arch/powerpc/kernel/entry_32.S | 2 +-
arch/powerpc/kernel/entry_64.S | 2 +-
arch/powerpc/kernel/head_32.S | 4 ++--
arch/powerpc/kernel/head_40x.S | 4 ++--
arch/powerpc/kernel/head_44x.S | 2 +-
arch/powerpc/kernel/head_8xx.S | 2 +-
arch/powerpc/kernel/head_booke.h | 4 ++--
arch/powerpc/kernel/head_fsl_booke.S | 4 ++--
arch/powerpc/kernel/irq.c | 2 +-
arch/powerpc/kernel/misc_32.S | 4 ++--
arch/powerpc/kernel/process.c | 8 ++++----
arch/powerpc/kernel/setup-common.c | 2 +-
arch/powerpc/kernel/setup_32.c | 15 +++++----------
arch/powerpc/kernel/smp.c | 4 +++-
19 files changed, 38 insertions(+), 40 deletions(-)
diff --git a/arch/powerpc/include/asm/irq.h b/arch/powerpc/include/asm/irq.h
index ee39ce56b2a2..2efbae8d93be 100644
--- a/arch/powerpc/include/asm/irq.h
+++ b/arch/powerpc/include/asm/irq.h
@@ -63,8 +63,8 @@ extern struct thread_info *hardirq_ctx[NR_CPUS];
extern struct thread_info *softirq_ctx[NR_CPUS];
extern void irq_ctx_init(void);
-extern void call_do_softirq(struct thread_info *tp);
-extern void call_do_irq(struct pt_regs *regs, struct thread_info *tp);
+void call_do_softirq(void *sp);
+void call_do_irq(struct pt_regs *regs, void *sp);
extern void do_IRQ(struct pt_regs *regs);
extern void __init init_IRQ(void);
extern void __do_irq(struct pt_regs *regs);
diff --git a/arch/powerpc/include/asm/livepatch.h b/arch/powerpc/include/asm/livepatch.h
index 47a03b9b528b..8a81d10ccc82 100644
--- a/arch/powerpc/include/asm/livepatch.h
+++ b/arch/powerpc/include/asm/livepatch.h
@@ -43,13 +43,14 @@ static inline unsigned long klp_get_ftrace_location(unsigned long faddr)
return ftrace_location_range(faddr, faddr + 16);
}
-static inline void klp_init_thread_info(struct thread_info *ti)
+static inline void klp_init_thread_info(struct task_struct *p)
{
+ struct thread_info *ti = task_thread_info(p);
/* + 1 to account for STACK_END_MAGIC */
- ti->livepatch_sp = (unsigned long *)(ti + 1) + 1;
+ ti->livepatch_sp = end_of_stack(p) + 1;
}
#else
-static void klp_init_thread_info(struct thread_info *ti) { }
+static inline void klp_init_thread_info(struct task_struct *p) { }
#endif /* CONFIG_LIVEPATCH */
#endif /* _ASM_POWERPC_LIVEPATCH_H */
diff --git a/arch/powerpc/include/asm/processor.h b/arch/powerpc/include/asm/processor.h
index 13589274fe9b..b225c7f7c5a4 100644
--- a/arch/powerpc/include/asm/processor.h
+++ b/arch/powerpc/include/asm/processor.h
@@ -40,7 +40,7 @@
#ifndef __ASSEMBLY__
#include <linux/types.h>
-#include <asm/thread_info.h>
+#include <linux/thread_info.h>
#include <asm/ptrace.h>
#include <asm/hw_breakpoint.h>
@@ -332,7 +332,7 @@ struct thread_struct {
#define INIT_SP (sizeof(init_stack) + (unsigned long) &init_stack)
#define INIT_SP_LIMIT \
- (_ALIGN_UP(sizeof(init_thread_info), 16) + (unsigned long) &init_stack)
+ (_ALIGN_UP(sizeof(struct thread_info), 16) + (unsigned long)&init_stack)
#ifdef CONFIG_SPE
#define SPEFSCR_INIT \
diff --git a/arch/powerpc/include/asm/reg.h b/arch/powerpc/include/asm/reg.h
index 640a4d818772..d2528a0b2f5b 100644
--- a/arch/powerpc/include/asm/reg.h
+++ b/arch/powerpc/include/asm/reg.h
@@ -1058,7 +1058,7 @@
* - SPRG9 debug exception scratch
*
* All 32-bit:
- * - SPRG3 current thread_info pointer
+ * - SPRG3 current thread_struct physical addr pointer
* (virtual on BookE, physical on others)
*
* 32-bit classic:
diff --git a/arch/powerpc/kernel/asm-offsets.c b/arch/powerpc/kernel/asm-offsets.c
index a6d70fd2e499..c583a02e5a21 100644
--- a/arch/powerpc/kernel/asm-offsets.c
+++ b/arch/powerpc/kernel/asm-offsets.c
@@ -91,10 +91,10 @@ int main(void)
DEFINE(NMI_MASK, NMI_MASK);
OFFSET(TASKTHREADPPR, task_struct, thread.ppr);
#else
- OFFSET(THREAD_INFO, task_struct, stack);
DEFINE(THREAD_INFO_GAP, _ALIGN_UP(sizeof(struct thread_info), 16));
OFFSET(KSP_LIMIT, thread_struct, ksp_limit);
#endif /* CONFIG_PPC64 */
+ OFFSET(TASK_STACK, task_struct, stack);
#ifdef CONFIG_LIVEPATCH
OFFSET(TI_livepatch_sp, thread_info, livepatch_sp);
diff --git a/arch/powerpc/kernel/entry_32.S b/arch/powerpc/kernel/entry_32.S
index 77decded1175..7ea1d71f4546 100644
--- a/arch/powerpc/kernel/entry_32.S
+++ b/arch/powerpc/kernel/entry_32.S
@@ -1166,7 +1166,7 @@ ret_from_debug_exc:
mfspr r9,SPRN_SPRG_THREAD
lwz r10,SAVED_KSP_LIMIT(r1)
stw r10,KSP_LIMIT(r9)
- lwz r9,THREAD_INFO-THREAD(r9)
+ lwz r9,TASK_STACK-THREAD(r9)
CURRENT_THREAD_INFO(r10, r1)
lwz r10,TI_PREEMPT(r10)
stw r10,TI_PREEMPT(r9)
diff --git a/arch/powerpc/kernel/entry_64.S b/arch/powerpc/kernel/entry_64.S
index ed6f6c7f4264..6fce0f8fd8c4 100644
--- a/arch/powerpc/kernel/entry_64.S
+++ b/arch/powerpc/kernel/entry_64.S
@@ -684,7 +684,7 @@ END_FTR_SECTION_IFCLR(CPU_FTR_ARCH_207S)
2:
#endif /* CONFIG_PPC_BOOK3S_64 */
- CURRENT_THREAD_INFO(r7, r8) /* base of new stack */
+ clrrdi r7, r8, THREAD_SHIFT /* base of new stack */
/* Note: this uses SWITCH_FRAME_SIZE rather than INT_FRAME_SIZE
because we don't need to leave the 288-byte ABI gap at the
top of the kernel stack. */
diff --git a/arch/powerpc/kernel/head_32.S b/arch/powerpc/kernel/head_32.S
index 61ca27929355..dce6f2ff07e5 100644
--- a/arch/powerpc/kernel/head_32.S
+++ b/arch/powerpc/kernel/head_32.S
@@ -261,7 +261,7 @@ __secondary_hold_acknowledge:
tophys(r11,r1); /* use tophys(r1) if kernel */ \
beq 1f; \
mfspr r11,SPRN_SPRG_THREAD; \
- lwz r11,THREAD_INFO-THREAD(r11); \
+ lwz r11,TASK_STACK-THREAD(r11); \
addi r11,r11,THREAD_SIZE; \
tophys(r11,r11); \
1: subi r11,r11,INT_FRAME_SIZE /* alloc exc. frame */
@@ -841,7 +841,7 @@ __secondary_start:
bl init_idle_6xx
#endif /* CONFIG_6xx */
- /* get current_thread_info and current */
+ /* get current's stack and current */
lis r1,secondary_ti@ha
tophys(r1,r1)
lwz r1,secondary_ti@l(r1)
diff --git a/arch/powerpc/kernel/head_40x.S b/arch/powerpc/kernel/head_40x.S
index b19d78410511..3088c9f29f5e 100644
--- a/arch/powerpc/kernel/head_40x.S
+++ b/arch/powerpc/kernel/head_40x.S
@@ -115,7 +115,7 @@ _ENTRY(saved_ksp_limit)
andi. r11,r11,MSR_PR; \
beq 1f; \
mfspr r1,SPRN_SPRG_THREAD; /* if from user, start at top of */\
- lwz r1,THREAD_INFO-THREAD(r1); /* this thread's kernel stack */\
+ lwz r1,TASK_STACK-THREAD(r1); /* this thread's kernel stack */\
addi r1,r1,THREAD_SIZE; \
1: subi r1,r1,INT_FRAME_SIZE; /* Allocate an exception frame */\
tophys(r11,r1); \
@@ -158,7 +158,7 @@ _ENTRY(saved_ksp_limit)
beq 1f; \
/* COMING FROM USER MODE */ \
mfspr r11,SPRN_SPRG_THREAD; /* if from user, start at top of */\
- lwz r11,THREAD_INFO-THREAD(r11); /* this thread's kernel stack */\
+ lwz r11,TASK_STACK-THREAD(r11); /* this thread's kernel stack */\
1: addi r11,r11,THREAD_SIZE-INT_FRAME_SIZE; /* Alloc an excpt frm */\
tophys(r11,r11); \
stw r10,_CCR(r11); /* save various registers */\
diff --git a/arch/powerpc/kernel/head_44x.S b/arch/powerpc/kernel/head_44x.S
index 37e4a7cf0065..15d39b2499de 100644
--- a/arch/powerpc/kernel/head_44x.S
+++ b/arch/powerpc/kernel/head_44x.S
@@ -1020,7 +1020,7 @@ _GLOBAL(start_secondary_47x)
/* Now we can get our task struct and real stack pointer */
- /* Get current_thread_info and current */
+ /* Get current's stack and current */
lis r1,secondary_ti@ha
lwz r1,secondary_ti@l(r1)
lwz r2,TI_TASK(r1)
diff --git a/arch/powerpc/kernel/head_8xx.S b/arch/powerpc/kernel/head_8xx.S
index 6582f824d620..e56e36aa2b3d 100644
--- a/arch/powerpc/kernel/head_8xx.S
+++ b/arch/powerpc/kernel/head_8xx.S
@@ -124,7 +124,7 @@ turn_on_mmu:
tophys(r11,r1); /* use tophys(r1) if kernel */ \
beq 1f; \
mfspr r11,SPRN_SPRG_THREAD; \
- lwz r11,THREAD_INFO-THREAD(r11); \
+ lwz r11,TASK_STACK-THREAD(r11); \
addi r11,r11,THREAD_SIZE; \
tophys(r11,r11); \
1: subi r11,r11,INT_FRAME_SIZE /* alloc exc. frame */
diff --git a/arch/powerpc/kernel/head_booke.h b/arch/powerpc/kernel/head_booke.h
index d0862a100d29..175f812066dc 100644
--- a/arch/powerpc/kernel/head_booke.h
+++ b/arch/powerpc/kernel/head_booke.h
@@ -44,7 +44,7 @@
mr r11, r1; \
beq 1f; \
/* if from user, start at top of this thread's kernel stack */ \
- lwz r11, THREAD_INFO-THREAD(r10); \
+ lwz r11, TASK_STACK - THREAD(r10); \
ALLOC_STACK_FRAME(r11, THREAD_SIZE); \
1 : subi r11, r11, INT_FRAME_SIZE; /* Allocate exception frame */ \
stw r13, _CCR(r11); /* save various registers */ \
@@ -130,7 +130,7 @@
DO_KVM BOOKE_INTERRUPT_##intno exc_level_srr1; \
andi. r11,r11,MSR_PR; \
mfspr r11,SPRN_SPRG_THREAD; /* if from user, start at top of */\
- lwz r11,THREAD_INFO-THREAD(r11); /* this thread's kernel stack */\
+ lwz r11, TASK_STACK - THREAD(r11); /* this thread's kernel stack */\
addi r11,r11,EXC_LVL_FRAME_OVERHEAD; /* allocate stack frame */\
beq 1f; \
/* COMING FROM USER MODE */ \
diff --git a/arch/powerpc/kernel/head_fsl_booke.S b/arch/powerpc/kernel/head_fsl_booke.S
index 05b574f416b3..239ad8a4754e 100644
--- a/arch/powerpc/kernel/head_fsl_booke.S
+++ b/arch/powerpc/kernel/head_fsl_booke.S
@@ -704,7 +704,7 @@ finish_tlb_load:
/* Get the next_tlbcam_idx percpu var */
#ifdef CONFIG_SMP
- lwz r12, THREAD_INFO-THREAD(r12)
+ lwz r12, TASK_STACK-THREAD(r12)
lwz r15, TI_CPU(r12)
lis r14, __per_cpu_offset@h
ori r14, r14, __per_cpu_offset@l
@@ -1076,7 +1076,7 @@ __secondary_start:
mr r4,r24 /* Why? */
bl call_setup_cpu
- /* get current_thread_info and current */
+ /* get current's stack and current */
lis r1,secondary_ti@ha
lwz r1,secondary_ti@l(r1)
lwz r2,TI_TASK(r1)
diff --git a/arch/powerpc/kernel/irq.c b/arch/powerpc/kernel/irq.c
index 916ddc4aac44..9e7dc4468c8c 100644
--- a/arch/powerpc/kernel/irq.c
+++ b/arch/powerpc/kernel/irq.c
@@ -663,7 +663,7 @@ void do_IRQ(struct pt_regs *regs)
struct thread_info *curtp, *irqtp, *sirqtp;
/* Switch to the irq stack to handle this */
- curtp = current_thread_info();
+ curtp = (void *)(current_stack_pointer() & ~(THREAD_SIZE - 1));
irqtp = hardirq_ctx[raw_smp_processor_id()];
sirqtp = softirq_ctx[raw_smp_processor_id()];
diff --git a/arch/powerpc/kernel/misc_32.S b/arch/powerpc/kernel/misc_32.S
index 2f0fe8bfc078..32762f4c3458 100644
--- a/arch/powerpc/kernel/misc_32.S
+++ b/arch/powerpc/kernel/misc_32.S
@@ -60,7 +60,7 @@ _GLOBAL(call_do_softirq)
blr
/*
- * void call_do_irq(struct pt_regs *regs, struct thread_info *irqtp);
+ * void call_do_irq(struct pt_regs *regs, void *sp);
*/
_GLOBAL(call_do_irq)
mflr r0
@@ -603,7 +603,7 @@ EXPORT_SYMBOL(__bswapdi2)
#ifdef CONFIG_SMP
_GLOBAL(start_secondary_resume)
/* Reset stack */
- CURRENT_THREAD_INFO(r1, r1)
+ rlwinm r1, r1, 0, 0, 31 - THREAD_SHIFT
addi r1,r1,THREAD_SIZE-STACK_FRAME_OVERHEAD
li r3,0
stw r3,0(r1) /* Zero the stack frame pointer */
diff --git a/arch/powerpc/kernel/process.c b/arch/powerpc/kernel/process.c
index d9d4eb2ea6c9..a12307ebb7ef 100644
--- a/arch/powerpc/kernel/process.c
+++ b/arch/powerpc/kernel/process.c
@@ -1237,8 +1237,8 @@ struct task_struct *__switch_to(struct task_struct *prev,
batch->active = 1;
}
- if (current_thread_info()->task->thread.regs) {
- restore_math(current_thread_info()->task->thread.regs);
+ if (current->thread.regs) {
+ restore_math(current->thread.regs);
/*
* The copy-paste buffer can only store into foreign real
@@ -1248,7 +1248,7 @@ struct task_struct *__switch_to(struct task_struct *prev,
* mappings, we must issue a cp_abort to clear any state and
* prevent snooping, corruption or a covert channel.
*/
- if (current_thread_info()->task->thread.used_vas)
+ if (current->thread.used_vas)
asm volatile(PPC_CP_ABORT);
}
#endif /* CONFIG_PPC_BOOK3S_64 */
@@ -1632,7 +1632,7 @@ int copy_thread(unsigned long clone_flags, unsigned long usp,
unsigned long sp = (unsigned long)task_stack_page(p) + THREAD_SIZE;
struct thread_info *ti = task_thread_info(p);
- klp_init_thread_info(ti);
+ klp_init_thread_info(p);
/* Copy registers */
sp -= sizeof(struct pt_regs);
diff --git a/arch/powerpc/kernel/setup-common.c b/arch/powerpc/kernel/setup-common.c
index 9ca9db707bcb..8054a7b9e026 100644
--- a/arch/powerpc/kernel/setup-common.c
+++ b/arch/powerpc/kernel/setup-common.c
@@ -940,7 +940,7 @@ void __init setup_arch(char **cmdline_p)
/* Reserve large chunks of memory for use by CMA for KVM. */
kvm_cma_reserve();
- klp_init_thread_info(&init_thread_info);
+ klp_init_thread_info(&init_task);
init_mm.start_code = (unsigned long)_stext;
init_mm.end_code = (unsigned long) _etext;
diff --git a/arch/powerpc/kernel/setup_32.c b/arch/powerpc/kernel/setup_32.c
index 8c507be12c3c..81ebf7d6f526 100644
--- a/arch/powerpc/kernel/setup_32.c
+++ b/arch/powerpc/kernel/setup_32.c
@@ -205,10 +205,8 @@ void __init irqstack_early_init(void)
/* interrupt stacks must be in lowmem, we get that for free on ppc32
* as the memblock is limited to lowmem by default */
for_each_possible_cpu(i) {
- softirq_ctx[i] = (struct thread_info *)
- __va(memblock_alloc(THREAD_SIZE, THREAD_SIZE));
- hardirq_ctx[i] = (struct thread_info *)
- __va(memblock_alloc(THREAD_SIZE, THREAD_SIZE));
+ softirq_ctx[i] = __va(memblock_alloc(THREAD_SIZE, THREAD_SIZE));
+ hardirq_ctx[i] = __va(memblock_alloc(THREAD_SIZE, THREAD_SIZE));
}
}
@@ -226,13 +224,10 @@ void __init exc_lvl_early_init(void)
hw_cpu = 0;
#endif
- critirq_ctx[hw_cpu] = (struct thread_info *)
- __va(memblock_alloc(THREAD_SIZE, THREAD_SIZE));
+ critirq_ctx[hw_cpu] = __va(memblock_alloc(THREAD_SIZE, THREAD_SIZE));
#ifdef CONFIG_BOOKE
- dbgirq_ctx[hw_cpu] = (struct thread_info *)
- __va(memblock_alloc(THREAD_SIZE, THREAD_SIZE));
- mcheckirq_ctx[hw_cpu] = (struct thread_info *)
- __va(memblock_alloc(THREAD_SIZE, THREAD_SIZE));
+ dbgirq_ctx[hw_cpu] = __va(memblock_alloc(THREAD_SIZE, THREAD_SIZE));
+ mcheckirq_ctx[hw_cpu] = __va(memblock_alloc(THREAD_SIZE, THREAD_SIZE));
#endif
}
}
diff --git a/arch/powerpc/kernel/smp.c b/arch/powerpc/kernel/smp.c
index 61c1fadbc644..19dd0ea55714 100644
--- a/arch/powerpc/kernel/smp.c
+++ b/arch/powerpc/kernel/smp.c
@@ -20,6 +20,7 @@
#include <linux/kernel.h>
#include <linux/export.h>
#include <linux/sched/mm.h>
+#include <linux/sched/task_stack.h>
#include <linux/sched/topology.h>
#include <linux/smp.h>
#include <linux/interrupt.h>
@@ -812,7 +813,8 @@ static void cpu_idle_thread_init(unsigned int cpu, struct task_struct *idle)
#ifdef CONFIG_PPC64
paca_ptrs[cpu]->__current = idle;
- paca_ptrs[cpu]->kstack = (unsigned long)ti + THREAD_SIZE - STACK_FRAME_OVERHEAD;
+ paca_ptrs[cpu]->kstack = (unsigned long)task_stack_page(idle) +
+ THREAD_SIZE - STACK_FRAME_OVERHEAD;
#endif
ti->cpu = cpu;
secondary_ti = current_set[cpu] = ti;
--
2.13.3
^ permalink raw reply related
* [PATCH v6 2/9] powerpc: Only use task_struct 'cpu' field on SMP
From: Christophe Leroy @ 2018-10-08 9:16 UTC (permalink / raw)
To: Benjamin Herrenschmidt, Paul Mackerras, Michael Ellerman
Cc: linuxppc-dev, linux-kernel
In-Reply-To: <cover.1538954166.git.christophe.leroy@c-s.fr>
When moving to CONFIG_THREAD_INFO_IN_TASK, the thread_info 'cpu' field
gets moved into task_struct and only defined when CONFIG_SMP is set.
This patch ensures that TI_CPU is only used when CONFIG_SMP is set and
that task_struct 'cpu' field is not used directly out of SMP code.
Signed-off-by: Christophe Leroy <christophe.leroy@c-s.fr>
Reviewed-by: Nicholas Piggin <npiggin@gmail.com>
---
arch/powerpc/kernel/head_fsl_booke.S | 2 ++
arch/powerpc/kernel/misc_32.S | 4 ++++
arch/powerpc/xmon/xmon.c | 2 +-
3 files changed, 7 insertions(+), 1 deletion(-)
diff --git a/arch/powerpc/kernel/head_fsl_booke.S b/arch/powerpc/kernel/head_fsl_booke.S
index e2750b856c8f..05b574f416b3 100644
--- a/arch/powerpc/kernel/head_fsl_booke.S
+++ b/arch/powerpc/kernel/head_fsl_booke.S
@@ -243,8 +243,10 @@ set_ivor:
li r0,0
stwu r0,THREAD_SIZE-STACK_FRAME_OVERHEAD(r1)
+#ifdef CONFIG_SMP
CURRENT_THREAD_INFO(r22, r1)
stw r24, TI_CPU(r22)
+#endif
bl early_init
diff --git a/arch/powerpc/kernel/misc_32.S b/arch/powerpc/kernel/misc_32.S
index 695b24a2d954..2f0fe8bfc078 100644
--- a/arch/powerpc/kernel/misc_32.S
+++ b/arch/powerpc/kernel/misc_32.S
@@ -183,10 +183,14 @@ _GLOBAL(low_choose_750fx_pll)
or r4,r4,r5
mtspr SPRN_HID1,r4
+#ifdef CONFIG_SMP
/* Store new HID1 image */
CURRENT_THREAD_INFO(r6, r1)
lwz r6,TI_CPU(r6)
slwi r6,r6,2
+#else
+ li r6, 0
+#endif
addis r6,r6,nap_save_hid1@ha
stw r4,nap_save_hid1@l(r6)
diff --git a/arch/powerpc/xmon/xmon.c b/arch/powerpc/xmon/xmon.c
index c70d17c9a6ba..1731793e1277 100644
--- a/arch/powerpc/xmon/xmon.c
+++ b/arch/powerpc/xmon/xmon.c
@@ -2986,7 +2986,7 @@ static void show_task(struct task_struct *tsk)
printf("%px %016lx %6d %6d %c %2d %s\n", tsk,
tsk->thread.ksp,
tsk->pid, tsk->parent->pid,
- state, task_thread_info(tsk)->cpu,
+ state, task_cpu(tsk),
tsk->comm);
}
--
2.13.3
^ permalink raw reply related
* [PATCH v6 0/9] powerpc: Switch to CONFIG_THREAD_INFO_IN_TASK
From: Christophe Leroy @ 2018-10-08 9:16 UTC (permalink / raw)
To: Benjamin Herrenschmidt, Paul Mackerras, Michael Ellerman
Cc: linuxppc-dev, linux-kernel
The purpose of this serie is to activate CONFIG_THREAD_INFO_IN_TASK which
moves the thread_info into task_struct.
Moving thread_info into task_struct has the following advantages:
- It protects thread_info from corruption in the case of stack
overflows.
- Its address is harder to determine if stack addresses are
leaked, making a number of attacks more difficult.
Changes since v5:
- Fixed livepatch_sp setup by using end_of_stack() instead of hardcoding
- Fixed PPC_BPF_LOAD_CPU() macro
Changes since v4:
- Fixed a build failure on 32bits SMP when include/generated/asm-offsets.h is not
already existing, was due to spaces instead of a tab in the Makefile
Changes since RFC v3: (based on Nick's review)
- Renamed task_size.h to task_size_user64.h to better relate to what it contains.
- Handling of the isolation of thread_info cpu field inside CONFIG_SMP #ifdefs moved to a separate patch.
- Removed CURRENT_THREAD_INFO macro completely.
- Added a guard in asm/smp.h to avoid build failure before _TASK_CPU is defined.
- Added a patch at the end to rename 'tp' pointers to 'sp' pointers
- Renamed 'tp' into 'sp' pointers in preparation patch when relevant
- Fixed a few commit logs
- Fixed checkpatch report.
Changes since RFC v2:
- Removed the modification of names in asm-offsets
- Created a rule in arch/powerpc/Makefile to append the offset of current->cpu in CFLAGS
- Modified asm/smp.h to use the offset set in CFLAGS
- Squashed the renaming of THREAD_INFO to TASK_STACK in the preparation patch
- Moved the modification of current_pt_regs in the patch activating CONFIG_THREAD_INFO_IN_TASK
Changes since RFC v1:
- Removed the first patch which was modifying header inclusion order in timer
- Modified some names in asm-offsets to avoid conflicts when including asm-offsets in C files
- Modified asm/smp.h to avoid having to include linux/sched.h (using asm-offsets instead)
- Moved some changes from the activation patch to the preparation patch.
Christophe Leroy (9):
book3s/64: avoid circular header inclusion in mmu-hash.h
powerpc: Only use task_struct 'cpu' field on SMP
powerpc: Prepare for moving thread_info into task_struct
powerpc: Activate CONFIG_THREAD_INFO_IN_TASK
powerpc: regain entire stack space
powerpc: 'current_set' is now a table of task_struct pointers
powerpc/32: Remove CURRENT_THREAD_INFO and rename TI_CPU
powerpc/64: Remove CURRENT_THREAD_INFO
powerpc: clean stack pointers naming
arch/powerpc/Kconfig | 1 +
arch/powerpc/Makefile | 8 ++-
arch/powerpc/include/asm/asm-prototypes.h | 4 +-
arch/powerpc/include/asm/book3s/64/mmu-hash.h | 2 +-
arch/powerpc/include/asm/exception-64s.h | 4 +-
arch/powerpc/include/asm/irq.h | 14 ++---
arch/powerpc/include/asm/livepatch.h | 7 ++-
arch/powerpc/include/asm/processor.h | 39 +------------
arch/powerpc/include/asm/ptrace.h | 2 +-
arch/powerpc/include/asm/reg.h | 2 +-
arch/powerpc/include/asm/smp.h | 17 +++++-
arch/powerpc/include/asm/task_size_user64.h | 42 ++++++++++++++
arch/powerpc/include/asm/thread_info.h | 19 -------
arch/powerpc/kernel/asm-offsets.c | 10 ++--
arch/powerpc/kernel/entry_32.S | 66 ++++++++--------------
arch/powerpc/kernel/entry_64.S | 12 ++--
arch/powerpc/kernel/epapr_hcalls.S | 5 +-
arch/powerpc/kernel/exceptions-64e.S | 13 +----
arch/powerpc/kernel/exceptions-64s.S | 2 +-
arch/powerpc/kernel/head_32.S | 14 ++---
arch/powerpc/kernel/head_40x.S | 4 +-
arch/powerpc/kernel/head_44x.S | 8 +--
arch/powerpc/kernel/head_64.S | 1 +
arch/powerpc/kernel/head_8xx.S | 2 +-
arch/powerpc/kernel/head_booke.h | 12 +---
arch/powerpc/kernel/head_fsl_booke.S | 16 +++---
arch/powerpc/kernel/idle_6xx.S | 8 +--
arch/powerpc/kernel/idle_book3e.S | 2 +-
arch/powerpc/kernel/idle_e500.S | 8 +--
arch/powerpc/kernel/idle_power4.S | 2 +-
arch/powerpc/kernel/irq.c | 77 +++++---------------------
arch/powerpc/kernel/kgdb.c | 28 ----------
arch/powerpc/kernel/machine_kexec_64.c | 6 +-
arch/powerpc/kernel/misc_32.S | 17 +++---
arch/powerpc/kernel/process.c | 17 +++---
arch/powerpc/kernel/setup-common.c | 2 +-
arch/powerpc/kernel/setup_32.c | 15 ++---
arch/powerpc/kernel/setup_64.c | 41 ++++----------
arch/powerpc/kernel/smp.c | 16 +++---
arch/powerpc/kernel/trace/ftrace_64_mprofile.S | 6 +-
arch/powerpc/kvm/book3s_hv_hmi.c | 1 +
arch/powerpc/mm/hash_low_32.S | 14 ++---
arch/powerpc/net/bpf_jit32.h | 5 +-
arch/powerpc/sysdev/6xx-suspend.S | 5 +-
arch/powerpc/xmon/xmon.c | 2 +-
45 files changed, 230 insertions(+), 368 deletions(-)
create mode 100644 arch/powerpc/include/asm/task_size_user64.h
--
2.13.3
^ permalink raw reply
page: next (older) | prev (newer) | latest
- recent:[subjects (threaded)|topics (new)|topics (active)]
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox