* [PATCH 17/18] arm64: convert compat wrappers to C
From: Christoph Hellwig @ 2018-05-14 12:10 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <20180514094640.27569-18-mark.rutland@arm.com>
> +COMPAT_SYSCALL_DEFINE3(aarch32_statfs64, const char __user *, pathname,
> + compat_size_t, sz, struct compat_statfs64 __user *, buf)
> +{
> + if (sz == 88)
> + sz = 84;
> +
> + return kcompat_sys_statfs64(pathname, sz, buf);
This really needs a comment, and it looks very obviously bogus.
In case it isn't it needs a very good explanation.
^ permalink raw reply
* [PATCH 12/18] kernel: add ksys_personality()
From: Christoph Hellwig @ 2018-05-14 12:07 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <20180514094640.27569-13-mark.rutland@arm.com>
On Mon, May 14, 2018 at 10:46:34AM +0100, Mark Rutland wrote:
> Using this helper allows us to avoid the in-kernel call to the
> sys_personality() syscall. The ksys_ prefix denotes that this function
> is meant as a drop-in replacement for the syscall. In particular, it
> uses the same calling convention as sys_personality().
>
> This is necessary to enable conversion of arm64's syscall handling to
> use pt_regs wrappers.
Plese just opencode the trivial sys_personality logic instead.
^ permalink raw reply
* [PATCH 02/18] arm64: move SCTLR_EL{1,2} assertions to <asm/sysreg.h>
From: Mark Rutland @ 2018-05-14 12:06 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <8d66d231-d8a2-07c1-6c5b-24c9474c851f@arm.com>
On Mon, May 14, 2018 at 12:56:09PM +0100, Robin Murphy wrote:
> On 14/05/18 12:20, Dave Martin wrote:
> > On Mon, May 14, 2018 at 11:08:59AM +0100, Mark Rutland wrote:
> > > On Mon, May 14, 2018 at 11:00:53AM +0100, Dave Martin wrote:
> > > > On Mon, May 14, 2018 at 10:46:24AM +0100, Mark Rutland wrote:
> > > > > -/* Check all the bits are accounted for */
> > > > > -#define SCTLR_EL2_BUILD_BUG_ON_MISSING_BITS BUILD_BUG_ON((SCTLR_EL2_SET ^ SCTLR_EL2_CLEAR) != ~0)
> > > > > -
> > > > > +#if (SCTLR_EL2_SET ^ SCTLR_EL2_CLEAR) != 0xffffffff
> > > > > +#error "Inconsistent SCTLR_EL2 set/clear bits"
> > > > > +#endif
> > > >
> > > > Can we have a comment on the != 0xffffffff versus != ~0 here?
> > > >
> > > > The subtle differences in evaluation semantics between #if and
> > > > other contexts here may well trip people up during maintenance...
> > >
> > > Do you have any suggestion as to the wording?
> > >
> > > I'm happy to add a comment, but I don't really know what to say.
> >
> >
> > How about the following?
> >
> > /* Watch out for #if evaluation rules: ~0 is not ~(int)0! */
>
> Or, more formally, perhaps something even less vague like "Note that in
> preprocessor arithmetic these constants are effectively of type intmax_t,
> which is 64-bit, thus ~0 is not what we want."
I'll drop something in the commit message to that effect, rather than a
comment.
A comment will end up terse and vague or large and bloatsome (and
redundant as we have this pattern twice).
Anyone attempting to "clean" this up will find things break, and they can
look at the git log to find out why it is the way it is...
Thanks,
Mark.
^ permalink raw reply
* [PATCH RESEND net-next v2 1/8] dt-bindings: net: dwmac-sun8i: Clean up clock delay chain descriptions
From: Andrew Lunn @ 2018-05-14 12:03 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <20180514072113.yts3shbojvbxj4tq@flea>
> > Currently no other board requires this, but this is already part of the
> > binding. The new stuff limits the range for a specific SoC, simply because
> > that is the range supported by the control register. Not implementing, i.e.
> > supporting the whole range from the property, which might get truncated,
> > doesn't make much sense to me.
>
> With that driver we don't, but the previous design had the same
> feature and it was used on more boards. It was simply initialized
> statically in U-Boot, and not in Linux through the DT like it is done
> here.
If there are boards which do need it, then i'm fine with it. I would
also prefer that Linux does set it, and don't rely on U-boot.
Andrew
^ permalink raw reply
* [PATCH 10/18] arm64: convert native/compat syscall entry to C
From: Mark Rutland @ 2018-05-14 11:58 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <20180514110729.GF7753@e103592.cambridge.arm.com>
On Mon, May 14, 2018 at 12:07:30PM +0100, Dave Martin wrote:
> On Mon, May 14, 2018 at 10:46:32AM +0100, Mark Rutland wrote:
> > diff --git a/arch/arm64/kernel/syscall.c b/arch/arm64/kernel/syscall.c
> > index 5df857e32b48..4706f841e758 100644
> > --- a/arch/arm64/kernel/syscall.c
> > +++ b/arch/arm64/kernel/syscall.c
> > @@ -6,7 +6,9 @@
> > #include <linux/ptrace.h>
> >
> > #include <asm/daifflags.h>
> > +#include <asm/fpsimd.h>
> > #include <asm/thread_info.h>
> > +#include <asm/unistd.h>
> >
> > long do_ni_syscall(struct pt_regs *regs);
> >
> > @@ -41,8 +43,8 @@ static inline bool has_syscall_work(unsigned long flags)
> > int syscall_trace_enter(struct pt_regs *regs);
> > void syscall_trace_exit(struct pt_regs *regs);
> >
> > -asmlinkage void el0_svc_common(struct pt_regs *regs, int scno, int sc_nr,
> > - syscall_fn_t syscall_table[])
> > +static void el0_svc_common(struct pt_regs *regs, int scno, int sc_nr,
> > + syscall_fn_t syscall_table[])
> > {
> > unsigned long flags = current_thread_info()->flags;
> >
> > @@ -79,3 +81,37 @@ asmlinkage void el0_svc_common(struct pt_regs *regs, int scno, int sc_nr,
> > trace_exit:
> > syscall_trace_exit(regs);
> > }
> > +
> > +static inline void sve_user_reset(void)
>
> Static function with no caller...
Ugh, this was intended to be called below in el0_svc_handler().
> > +{
> > + if (!system_supports_sve())
> > + return;
> > +
> > + /*
> > + * task_fpsimd_load() won't be called to update CPACR_EL1 in
> > + * ret_to_user unless TIF_FOREIGN_FPSTATE is still set, which only
> > + * happens if a context switch or kernel_neon_begin() or context
> > + * modification (sigreturn, ptrace) intervenes.
> > + * So, ensure that CPACR_EL1 is already correct for the fast-path case.
> > + */
> > + if (test_and_clear_thread_flag(TIF_SVE))
> > + sve_user_disable();
>
> sve_user_disable() is already inline, and incorporates the if()
> internally via sysreg_clear_set().
>
> So, should this just be
>
> clear_thread_flag(TIF_SVE);
> sve_user_disable();
Sure. That does mean we'll unconditionally read cpacr_el1, but I assume
you're happy with that. I'll note the difference in the commit message.
> > +}
> > +
> > +extern syscall_fn_t sys_call_table[];
> > +
> > +asmlinkage void el0_svc_handler(struct pt_regs *regs)
> > +{
>
> if (system_supports_sve()) ?
>
> > + sve_user_disable();
>
> Or should this be replaced by a call to sve_user_reset()?
>
> I suspect the latter, since we do want to be clearing TIF_SVE here too.
Yes, this was mean to be sve_user_reset().
Thanks,
Mark.
^ permalink raw reply
* [PATCH 02/18] arm64: move SCTLR_EL{1,2} assertions to <asm/sysreg.h>
From: Robin Murphy @ 2018-05-14 11:56 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <20180514112036.GI7753@e103592.cambridge.arm.com>
On 14/05/18 12:20, Dave Martin wrote:
> On Mon, May 14, 2018 at 11:08:59AM +0100, Mark Rutland wrote:
>> On Mon, May 14, 2018 at 11:00:53AM +0100, Dave Martin wrote:
>>> On Mon, May 14, 2018 at 10:46:24AM +0100, Mark Rutland wrote:
>>>> -/* Check all the bits are accounted for */
>>>> -#define SCTLR_EL2_BUILD_BUG_ON_MISSING_BITS BUILD_BUG_ON((SCTLR_EL2_SET ^ SCTLR_EL2_CLEAR) != ~0)
>>>> -
>>>> +#if (SCTLR_EL2_SET ^ SCTLR_EL2_CLEAR) != 0xffffffff
>>>> +#error "Inconsistent SCTLR_EL2 set/clear bits"
>>>> +#endif
>>>
>>> Can we have a comment on the != 0xffffffff versus != ~0 here?
>>>
>>> The subtle differences in evaluation semantics between #if and
>>> other contexts here may well trip people up during maintenance...
>>
>> Do you have any suggestion as to the wording?
>>
>> I'm happy to add a comment, but I don't really know what to say.
>
>
> How about the following?
>
> /* Watch out for #if evaluation rules: ~0 is not ~(int)0! */
Or, more formally, perhaps something even less vague like "Note that in
preprocessor arithmetic these constants are effectively of type
intmax_t, which is 64-bit, thus ~0 is not what we want."
Robin.
^ permalink raw reply
* [PATCH 2/2] ARM: dts: armada-xp-98dx: Add NAND pinctrl information
From: Gregory CLEMENT @ 2018-05-14 11:49 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <20180504030638.31521-2-chris.packham@alliedtelesis.co.nz>
Hi Chris,
On ven., mai 04 2018, Chris Packham <chris.packham@alliedtelesis.co.nz> wrote:
> Add pin control information for the NAND interface on the Armada
> 98DX3236 and variants.
>
Applied on mvebu/dt
Thanks,
Gregory
> Signed-off-by: Chris Packham <chris.packham@alliedtelesis.co.nz>
> ---
> arch/arm/boot/dts/armada-xp-98dx3236.dtsi | 13 +++++++++++++
> 1 file changed, 13 insertions(+)
>
> diff --git a/arch/arm/boot/dts/armada-xp-98dx3236.dtsi b/arch/arm/boot/dts/armada-xp-98dx3236.dtsi
> index 9a589abd0379..099dc2520082 100644
> --- a/arch/arm/boot/dts/armada-xp-98dx3236.dtsi
> +++ b/arch/arm/boot/dts/armada-xp-98dx3236.dtsi
> @@ -312,6 +312,19 @@
> &pinctrl {
> compatible = "marvell,98dx3236-pinctrl";
>
> + nand_pins: nand-pins {
> + marvell,pins = "mpp20", "mpp21", "mpp22",
> + "mpp23", "mpp24", "mpp25",
> + "mpp26", "mpp27", "mpp28",
> + "mpp29", "mpp30";
> + marvell,function = "dev";
> + };
> +
> + nand_rb: nand-rb {
> + marvell,pins = "mpp19";
> + marvell,function = "nand";
> + };
> +
> spi0_pins: spi0-pins {
> marvell,pins = "mpp0", "mpp1",
> "mpp2", "mpp3";
> --
> 2.17.0
>
>
> _______________________________________________
> linux-arm-kernel mailing list
> linux-arm-kernel at lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
--
Gregory Clement, Bootlin (formerly Free Electrons)
Embedded Linux and Kernel engineering
http://bootlin.com
^ permalink raw reply
* [PATCH 1/2] pinctrl: mvebu: update use "nand" function for "rb" pin
From: Gregory CLEMENT @ 2018-05-14 11:49 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <20180504030638.31521-1-chris.packham@alliedtelesis.co.nz>
Hi Chris,
On ven., mai 04 2018, Chris Packham <chris.packham@alliedtelesis.co.nz> wrote:
> The Armada 98dx3236 SoCs don't have a different MPP sel value for nand
> specific pins so "dev" was technically correct. But all the other Armada
> SoCs use "nand" in their dts and the pin is specific to the nand
> interface so use "nand" for the function name.
>
> Signed-off-by: Chris Packham <chris.packham@alliedtelesis.co.nz>
Acked-by: Gregory CLEMENT <gregory.clement@bootlin.com>
Thanks,
Gregory
> ---
> drivers/pinctrl/mvebu/pinctrl-armada-xp.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/pinctrl/mvebu/pinctrl-armada-xp.c b/drivers/pinctrl/mvebu/pinctrl-armada-xp.c
> index b854f1ee5de5..28b199796fae 100644
> --- a/drivers/pinctrl/mvebu/pinctrl-armada-xp.c
> +++ b/drivers/pinctrl/mvebu/pinctrl-armada-xp.c
> @@ -431,7 +431,7 @@ static struct mvebu_mpp_mode mv98dx3236_mpp_modes[] = {
> MPP_MODE(19,
> MPP_VAR_FUNCTION(0x0, "gpio", NULL, V_98DX3236_PLUS),
> MPP_VAR_FUNCTION(0x3, "uart1", "rxd", V_98DX3236_PLUS),
> - MPP_VAR_FUNCTION(0x4, "dev", "rb", V_98DX3236_PLUS)),
> + MPP_VAR_FUNCTION(0x4, "nand", "rb", V_98DX3236_PLUS)),
> MPP_MODE(20,
> MPP_VAR_FUNCTION(0x0, "gpo", NULL, V_98DX3236_PLUS),
> MPP_VAR_FUNCTION(0x4, "dev", "we0", V_98DX3236_PLUS)),
> --
> 2.17.0
>
>
> _______________________________________________
> linux-arm-kernel mailing list
> linux-arm-kernel at lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
--
Gregory Clement, Bootlin (formerly Free Electrons)
Embedded Linux and Kernel engineering
http://bootlin.com
^ permalink raw reply
* [PATCH 0/4] arm64: SMCCC conduit cleanup
From: Lorenzo Pieralisi @ 2018-05-14 11:43 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <20180503170330.5591-1-mark.rutland@arm.com>
On Thu, May 03, 2018 at 06:03:26PM +0100, Mark Rutland wrote:
> Currently, the cpu errata code goes digging into PSCI internals to
> discover the SMCCC conduit, using the (arguably misnamed) PSCI_CONDUIT_*
> definitions. This lack of abstraction is somewhat unfortunate.
>
> Further, the SDEI code has an almost identical set of CONDUIT_*
> definitions, and the duplication is rather unfortunate.
>
> Let's unify things behind a common set of SMCCC_CONDUIT_* definitions,
> and expose the SMCCCv1.1 conduit via a new helper that hides the PSCI
> driver internals.
>
> Mark.
>
> Mark Rutland (4):
> arm/arm64: smccc/psci: add arm_smccc_get_conduit()
> arm64: errata: use arm_smccc_get_conduit()
> firmware/psci: use common SMCCC_CONDUIT_*
> firmware: arm_sdei: use common SMCCC_CONDUIT_*
>
> arch/arm64/kernel/cpu_errata.c | 11 +++--------
> arch/arm64/kernel/sdei.c | 3 ++-
> drivers/firmware/arm_sdei.c | 12 ++++++------
> drivers/firmware/psci.c | 24 ++++++++++++++++--------
> include/linux/arm-smccc.h | 16 ++++++++++++++++
> include/linux/arm_sdei.h | 6 ------
> include/linux/psci.h | 9 ++-------
> 7 files changed, 45 insertions(+), 36 deletions(-)
For the series:
Acked-by: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
^ permalink raw reply
* [PATCH 08/18] arm64: convert raw syscall invocation to C
From: Mark Rutland @ 2018-05-14 11:41 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <20180514110717.GE7753@e103592.cambridge.arm.com>
On Mon, May 14, 2018 at 12:07:18PM +0100, Dave Martin wrote:
> On Mon, May 14, 2018 at 10:46:30AM +0100, Mark Rutland wrote:
> > As a first step towards invoking syscalls with a pt_regs argument,
> > convert the raw syscall invocation logic to C. We end up with a bit more
> > register shuffling, but the unified invocation logic means we can unify
> > the tracing paths, too.
> >
> > This only converts the invocation of the syscall. The rest of the
> > syscall triage and tracing is left in assembly for now, and will be
> > converted in subsequent patches.
> >
> > Signed-off-by: Mark Rutland <mark.rutland@arm.com>
> > Cc: Catalin Marinas <catalin.marinas@arm.com>
> > Cc: Will Deacon <will.deacon@arm.com>
> > ---
> > arch/arm64/kernel/Makefile | 3 ++-
> > arch/arm64/kernel/entry.S | 36 ++++++++++--------------------------
> > arch/arm64/kernel/syscall.c | 29 +++++++++++++++++++++++++++++
> > 3 files changed, 41 insertions(+), 27 deletions(-)
> > create mode 100644 arch/arm64/kernel/syscall.c
> >
> > diff --git a/arch/arm64/kernel/Makefile b/arch/arm64/kernel/Makefile
> > index bf825f38d206..c22e8ace5ea3 100644
> > --- a/arch/arm64/kernel/Makefile
> > +++ b/arch/arm64/kernel/Makefile
> > @@ -18,7 +18,8 @@ arm64-obj-y := debug-monitors.o entry.o irq.o fpsimd.o \
> > hyp-stub.o psci.o cpu_ops.o insn.o \
> > return_address.o cpuinfo.o cpu_errata.o \
> > cpufeature.o alternative.o cacheinfo.o \
> > - smp.o smp_spin_table.o topology.o smccc-call.o
> > + smp.o smp_spin_table.o topology.o smccc-call.o \
> > + syscall.o
> >
> > extra-$(CONFIG_EFI) := efi-entry.o
> >
> > diff --git a/arch/arm64/kernel/entry.S b/arch/arm64/kernel/entry.S
> > index 08ea3cbfb08f..d6e057500eaf 100644
> > --- a/arch/arm64/kernel/entry.S
> > +++ b/arch/arm64/kernel/entry.S
> > @@ -873,7 +873,6 @@ ENDPROC(el0_error)
> > */
> > ret_fast_syscall:
> > disable_daif
> > - str x0, [sp, #S_X0] // returned x0
> > ldr x1, [tsk, #TSK_TI_FLAGS] // re-check for syscall tracing
> > and x2, x1, #_TIF_SYSCALL_WORK
> > cbnz x2, ret_fast_syscall_trace
> > @@ -946,15 +945,11 @@ el0_svc_naked: // compat entry point
> >
> > tst x16, #_TIF_SYSCALL_WORK // check for syscall hooks
> > b.ne __sys_trace
> > - cmp wscno, wsc_nr // check upper syscall limit
> > - b.hs ni_sys
> > - mask_nospec64 xscno, xsc_nr, x19 // enforce bounds for syscall number
> > - ldr x16, [stbl, xscno, lsl #3] // address in the syscall table
> > - blr x16 // call sys_* routine
> > - b ret_fast_syscall
> > -ni_sys:
> > mov x0, sp
> > - bl do_ni_syscall
> > + mov w1, wscno
> > + mov w2, wsc_nr
> > + mov x3, stbl
> > + bl invoke_syscall
> > b ret_fast_syscall
> > ENDPROC(el0_svc)
> >
> > @@ -971,29 +966,18 @@ __sys_trace:
> > bl syscall_trace_enter
> > cmp w0, #NO_SYSCALL // skip the syscall?
> > b.eq __sys_trace_return_skipped
> > - mov wscno, w0 // syscall number (possibly new)
> > - mov x1, sp // pointer to regs
> > - cmp wscno, wsc_nr // check upper syscall limit
> > - b.hs __ni_sys_trace
> > - ldp x0, x1, [sp] // restore the syscall args
> > - ldp x2, x3, [sp, #S_X2]
> > - ldp x4, x5, [sp, #S_X4]
> > - ldp x6, x7, [sp, #S_X6]
> > - ldr x16, [stbl, xscno, lsl #3] // address in the syscall table
> > - blr x16 // call sys_* routine
> >
> > -__sys_trace_return:
> > - str x0, [sp, #S_X0] // save returned x0
> > + mov x0, sp
> > + mov w1, wscno
> > + mov w2, wsc_nr
> > + mov x3, stbl
> > + bl invoke_syscall
> > +
> > __sys_trace_return_skipped:
> > mov x0, sp
> > bl syscall_trace_exit
> > b ret_to_user
> >
> > -__ni_sys_trace:
> > - mov x0, sp
> > - bl do_ni_syscall
> > - b __sys_trace_return
> > -
>
> Can you explain why ni_syscall is special here,
This is for out-of-range syscall numbers, instances of ni_syscall in the
syscall table are handled by the regular path. When the syscall number
is out-of-range, we can't index the syscall table, and have to call
ni_sys directly.
The c invoke_syscall() wrapper handles that case internally so that we
don't have to open-code it everywhere.
> why __sys_trace_return existed,
The __sys_trace_return label existed so that the special __ni_sys_trace
path could return into a common tracing return path.
> and why its disappearance doesn't break anything?
Now that invoke_syscall() handles out-of-range syscall numbers, and we
can remove the __ni_sys_trace path, nothing branches to
__sys_trace_return.
Only the label has been removed, not the usual return path.
> Not saying there's a bug, just that I'm a little confuse -- I see no
> real reason for ni_syscall being special, and this may be a good
> opportunity to decruft it. (See also comments below.)
Hopefully the above clarifies things?
I've updated the commit message with a description.
[...]
> > +asmlinkage void invoke_syscall(struct pt_regs *regs, int scno, int sc_nr,
> > + syscall_fn_t syscall_table[])
> > +{
> > + if (scno < sc_nr) {
>
> What if (int)scno < 0? Should those args both by unsigned ints?
Yes, they should -- I've fixed that up locally.
That is a *very* good point, thanks!
> "sc_nr" sounds too much like "syscall number" to me. Might
> "syscall_table_size" might be clearer? Similarly, we could have
> "stbl_size" or similar in the asm. This is purely cosmetic,
> though.
I'd tried to stick to the naming used in assembly to keep the conversion
clearer for those familiar with the asm.
I agree the names aren't great.
> > + syscall_fn_t syscall_fn;
> > + syscall_fn = syscall_table[array_index_nospec(scno, sc_nr)];
> > + __invoke_syscall(regs, syscall_fn);
> > + } else {
> > + regs->regs[0] = do_ni_syscall(regs);
>
> Can we make __invoke_syscall() the universal syscall wrapper, and give
> do_ni_syscall() the same interface as any other syscall body?
Not at this point in time, since the prototype (in core code) differs.
I agree that would be nicer, but there are a number of complications;
more details below.
> Then you could factor this as
>
> static syscall_fn_t syscall_fn(syscall_fn_t const syscall_table[],
> (unsigned) int scno, (unsigned) int sc_nr)
> {
> if (sc_no >= sc_nr)
> return sys_ni_syscall;
>
> return syscall_table[array_index_nospec(scno, sc_nr)];
> }
>
> ...
> __invoke_syscall(regs, syscall_fn(syscall_table, scno, sc_nr);
>
>
>
> This is cosmetic too, of course.
>
> do_ni_syscall() should be given a pt_regs-based wrapper like all the
> rest.
I agree it would be nicer if it had a wrapper that took a pt_regs, even
if it does nothing with it.
We can't use SYSCALL_DEFINE0() due to the fault injection muck, we'd
need a ksys_ni_syscall() for our traps.c logic, and adding this
uniformly would involve some arch-specific rework for x86, too, so I
decided it was not worth the effort.
Thanks,
Mark.
^ permalink raw reply
* [PATCH v3 2/3] platform: move the early platform device support to arch/sh
From: Greg Kroah-Hartman @ 2018-05-14 11:38 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <20180504132731.14574-3-brgl@bgdev.pl>
On Fri, May 04, 2018 at 03:27:30PM +0200, Bartosz Golaszewski wrote:
> From: Bartosz Golaszewski <bgolaszewski@baylibre.com>
>
> SuperH is the only user of the current implementation of early platform
> device support. We want to introduce a more robust approach to early
> probing. As the first step - move all the current early platform code
> to arch/sh.
>
> In order not to export internal drivers/base functions to arch code for
> this temporary solution - copy the two needed routines for driver
> matching from drivers/base/platform.c to arch/sh/drivers/platform_early.c.
>
> Also: call early_platform_cleanup() from subsys_initcall() so that it's
> called after all early devices are probed.
>
> Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
^ permalink raw reply
* [PATCH 00/12] introduce support for early platform drivers
From: Bartosz Golaszewski @ 2018-05-14 11:38 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <CAL_JsqL3CWFSpKEGoGwQDxCQ04g4uT1hiDTxXzjz4XTjPbfsoQ@mail.gmail.com>
2018-05-11 22:13 GMT+02:00 Rob Herring <robh+dt@kernel.org>:
> On Fri, May 11, 2018 at 11:20 AM, Bartosz Golaszewski <brgl@bgdev.pl> wrote:
>> This series is a follow-up to the RFC[1] posted a couple days ago.
>>
>> NOTE: this series applies on top of my recent patches[2] that move the previous
>> implementation of early platform devices to arch/sh.
>>
>> Problem:
>>
>> Certain class of devices, such as timers, certain clock drivers and irq chip
>> drivers need to be probed early in the boot sequence. The currently preferred
>> approach is using one of the OF_DECLARE() macros. This however does not create
>> a platform device which has many drawbacks - such as not being able to use
>> devres routines, dev_ log functions or no way of deferring the init OF function
>> if some other resources are missing.
>
> I skimmed though this and it doesn't look horrible (how's that for
> positive feedback? ;) ). But before going into the details, I think
> first there needs to be agreement this is the right direction.
>
> The question does remain though as to whether this class of devices
> should be platform drivers. They can't be modules. They can't be
> hotplugged. Can they be runtime-pm enabled? So the advantage is ...
>
The main (but not the only) advantage for drivers that can both be
platform drivers and OF_DECLARE drivers is that we get a single entry
point and can reuse code without resorting to checking if (!dev). It
results in more consistent code base. Another big advantage is
consolidation of device tree and machine code for SoC drivers used in
different boards of which some are still using board files and others
are defined in DT (see: DaVinci).
> I assume that the clock maintainers had some reason to move clocks to
> be platform drivers. It's just not clear to me what that was.
>
>> For drivers that use both platform drivers and OF_DECLARE the situation is even
>> more complicated as the code needs to take into account that there can possibly
>> be no struct device present. For a specific use case that we're having problems
>> with, please refer to the recent DaVinci common-clock conversion patches and
>> the nasty workaround that this problem implies[3].
>
> So devm_kzalloc will work with this solution? Why did we need
> devm_kzalloc in the first place? The clocks can never be removed and
> cleaning up on error paths is kind of pointless. The system would be
> hosed, right?
>
It depends - not all clocks are necessary for system to boot.
>> We also used to have an early platform drivers implementation but they were not
>> integrated with the linux device model at all - they merely used the same data
>> structures. The users could not use devres, defer probe and the early devices
>> never became actual platform devices later on.
>>
>> Proposed solution:
>>
>> This series aims at solving this problem by (re-)introducing the concept of
>> early platform drivers and devices - this time however in a way that seamlessly
>> integrates with the existing platform drivers and also offers device-tree
>> support.
>>
>> The idea is to provide a way for users to probe devices early, while already
>> being able to use devres, devices resources and properties and also deferred
>> probing.
>>
>> New structures are introduced: the early platform driver contains the
>> early_probe callback which has the same signature as regular platform_device
>> probe. This callback is called early on. The user can have both the early and
>> regular probe speficied or only one of them and they both receive the same
>> platform device object as argument. Any device data allocated early will be
>> carried over to the normal probe.
>>
>> The architecture code is responsible for calling early_platform_start() in
>> which the early drivers will be registered and devices populated from DT.
>
> Can we really do this in one spot for different devices (clk, timers,
> irq). The sequence is all very carefully crafted. Platform specific
> hooks is another thing to consider.
>
This is why I added support for early probe deferral - so that we can
stop caring for the order as long as the drivers are aware of other
resources they need and we call early_platform_start() the moment the
earliest of the early devices is needed.
>> Once the device and kobject mechanisms are ready, all early drivers and devices
>> will be converted into real platform drivers and devices. Also: if any of the
>> early platform registration functions will be called once early initialization
>> is done, these functions will work like regular platform_device/driver ones.
>
> This could leave devices in a weird state. They've successfully probed
> early, but then are on the deferred list for normal probe for example.
>
It's not really a weird state - once we're past the 'early' stage, the
drivers' "earlyness" no longer plays any role. An early deferred
device wouldn't be any different from other deferred devices. It's
possible that we enabled some crucial resources in the early stage and
then failed to fully probe the device later. I don't see a problem
with that.
Best regards,
Bartosz Golaszewski
^ permalink raw reply
* [GIT PULL] ARM: mediatek: soc driver updates for v4.18
From: Matthias Brugger @ 2018-05-14 11:32 UTC (permalink / raw)
To: linux-arm-kernel
Hi Arnd and Olof,
Below the commits for mediatek soc drivers.
Please beware that we need the regmap-ktime-fix [1] from Mark Browns static tag.
I merged that into my branch, but I wanted to let you know, so that you don't
hit any breakage when pulling in my branch.
Regards,
Matthias
[1] https://git.kernel.org/pub/scm/linux/kernel/git/broonie/regmap.git
tags/regmap-ktime-fix
---
The following changes since commit 60cc43fc888428bb2f18f08997432d426a243338:
Linux 4.17-rc1 (2018-04-15 18:24:20 -0700)
are available in the Git repository at:
https://git.kernel.org/pub/scm/linux/kernel/git/matthias.bgg/linux.git/
tags/v4.17-next-soc
for you to fetch changes up to 0afd32c6bb59e41b6692dec4473efaffffcad67b:
Merge commit 'f15cd6d99198e9c15229aefec639a34a6e8174c6' into
v.4.17-next/soc-test (2018-05-14 12:22:03 +0200)
----------------------------------------------------------------
- use timeout helpers for scpsys and infracfg drivers
- use of_device_get_match_data in pmic wrapper and scpsys
----------------------------------------------------------------
Matthias Brugger (1):
Merge commit 'f15cd6d99198e9c15229aefec639a34a6e8174c6' into
v.4.17-next/soc-test
Ryder Lee (1):
soc: mediatek: use of_device_get_match_data()
Sean Wang (6):
soc: mediatek: reuse read[l,x]_poll_timeout helpers
regmap: include <linux/ktime.h> from include/linux/regmap.h
soc: mediatek: reuse regmap_read_poll_timeout helpers
soc: mediatek: introduce a CAPS flag for scp_domain_data
soc: mediatek: add a fixed wait for SRAM stable
soc: mediatek: remove unneeded semicolon
drivers/soc/mediatek/mtk-infracfg.c | 46 +++-------
drivers/soc/mediatek/mtk-pmic-wrap.c | 13 +--
drivers/soc/mediatek/mtk-scpsys.c | 167 ++++++++++++++---------------------
include/linux/regmap.h | 1 +
4 files changed, 83 insertions(+), 144 deletions(-)
^ permalink raw reply
* [GIT PULL] ARM: mediatek: dts64 updates for v4.18
From: Matthias Brugger @ 2018-05-14 11:28 UTC (permalink / raw)
To: linux-arm-kernel
Hi you two,
Please take into account the following commit to 64-bit DTS.
Thanks a lot,
Matthias
---
The following changes since commit 60cc43fc888428bb2f18f08997432d426a243338:
Linux 4.17-rc1 (2018-04-15 18:24:20 -0700)
are available in the Git repository at:
https://git.kernel.org/pub/scm/linux/kernel/git/matthias.bgg/linux.git/
tags/v4.17-next-dts64
for you to fetch changes up to f1e0d0d8cf454202d21140aace184cc5512a9fdd:
arm64: dts: mt7622: add audio related device nodes (2018-05-11 18:42:20 +0200)
----------------------------------------------------------------
- add clock and pinctrl nodes for mt2712e
- add High-Speed DMA and audio nodes for mt7622
----------------------------------------------------------------
Ryder Lee (1):
arm64: dts: mt7622: add audio related device nodes
Sean Wang (1):
arm64: dts: mt7622: add High-Speed DMA device nodes
Zhiyong Tao (2):
arm64: dts: mt2712: add pintcrl file
arm64: dts: mt2712: add pintcrl device node.
weiyi.lu at mediatek.com (1):
arm64: dts: add clock device nodes of MT2712
arch/arm64/boot/dts/mediatek/mt2712-pinfunc.h | 1123 +++++++++++++++++++++++++
arch/arm64/boot/dts/mediatek/mt2712e.dtsi | 46 +
arch/arm64/boot/dts/mediatek/mt7622-rfb1.dts | 11 +-
arch/arm64/boot/dts/mediatek/mt7622.dtsi | 99 +++
4 files changed, 1277 insertions(+), 2 deletions(-)
create mode 100644 arch/arm64/boot/dts/mediatek/mt2712-pinfunc.h
^ permalink raw reply
* [GIT PULL] ARM: mediatek: updates of dts32 for v4.18
From: Matthias Brugger @ 2018-05-14 11:26 UTC (permalink / raw)
To: linux-arm-kernel
Hi Arnd,
Hi Olof,
please have a look on the following updates for 32-bit DTS files.
Thanks,
Matthias
---
The following changes since commit 60cc43fc888428bb2f18f08997432d426a243338:
Linux 4.17-rc1 (2018-04-15 18:24:20 -0700)
are available in the Git repository at:
https://git.kernel.org/pub/scm/linux/kernel/git/matthias.bgg/linux.git/
tags/v4.17-next-dts32
for you to fetch changes up to dd0dcf003dd86caba7726cc1e2ef268f1cf11aae:
arm: dts: mt7623: add MT7623N reference board with eMMC (2018-05-11 17:52:28
+0200)
----------------------------------------------------------------
convert to SPDX IDs
mt7623:
- add audio, bluetooth, highspees DMA and SPI-NOR nodes
- fix invalid memory nodes by not using skeleton64.dtsi
- fix memory size for bananapi-r2
- fix dtc warnings
- refactor dts and dtsi to aviod code duplication
- add mt7623n and mt7623a reference boards
----------------------------------------------------------------
Ryder Lee (1):
arm: dts: mediatek: modify audio related nodes for both MT2701 and MT7623
Sean Wang (10):
arm: dts: mediatek: converted to using SPDX identifiers
arm: dts: mt7623: fix invalid memory node being generated
arm: dts: mt7623: fix available memory size on bananapi-r2
arm: dts: mt7623: fix all Warnings (unit_address_vs_reg)
arm: dts: mt7623: add BTIF, HSDMA and SPI-NOR device nodes
arm: dts: mt6323: move node mt6323 leds to mt6323.dtsi
arm: dts: mt7623: extend common file reused by all boards with MT7623 SoCs
arm: dts: mt7623: add MT7623A SoC level DTS
arm: dts: mt7623: add MT7623A reference boards
arm: dts: mt7623: add MT7623N reference board with eMMC
arch/arm/boot/dts/Makefile | 3 +
arch/arm/boot/dts/mt2701-evb.dts | 9 +-
arch/arm/boot/dts/mt2701.dtsi | 197 +++++-----
arch/arm/boot/dts/mt6323.dtsi | 17 +-
arch/arm/boot/dts/mt6580-evbp1.dts | 9 +-
arch/arm/boot/dts/mt6580.dtsi | 9 +-
arch/arm/boot/dts/mt6589-aquaris5.dts | 10 +-
arch/arm/boot/dts/mt6589.dtsi | 12 +-
arch/arm/boot/dts/mt6592-evb.dts | 9 +-
arch/arm/boot/dts/mt6592.dtsi | 9 +-
arch/arm/boot/dts/mt7623.dtsi | 537 ++++++++++++++++++++------
arch/arm/boot/dts/mt7623a-rfb-emmc.dts | 291 ++++++++++++++
arch/arm/boot/dts/mt7623a-rfb-nand.dts | 337 ++++++++++++++++
arch/arm/boot/dts/mt7623a.dtsi | 44 +++
arch/arm/boot/dts/mt7623n-bananapi-bpi-r2.dts | 279 ++-----------
arch/arm/boot/dts/mt7623n-rfb-emmc.dts | 326 ++++++++++++++++
arch/arm/boot/dts/mt7623n-rfb-nand.dts | 40 +-
arch/arm/boot/dts/mt7623n-rfb.dtsi | 12 +-
arch/arm/boot/dts/mt8127-moose.dts | 9 +-
arch/arm/boot/dts/mt8127.dtsi | 9 +-
arch/arm/boot/dts/mt8135-evbp1.dts | 9 +-
arch/arm/boot/dts/mt8135.dtsi | 9 +-
22 files changed, 1573 insertions(+), 613 deletions(-)
create mode 100644 arch/arm/boot/dts/mt7623a-rfb-emmc.dts
create mode 100644 arch/arm/boot/dts/mt7623a-rfb-nand.dts
create mode 100644 arch/arm/boot/dts/mt7623a.dtsi
create mode 100644 arch/arm/boot/dts/mt7623n-rfb-emmc.dts
^ permalink raw reply
* [PATCH v4 5/6] bus: fsl-mc: supoprt dma configure for devices on fsl-mc bus
From: Greg KH @ 2018-05-14 11:24 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <1525069641-8523-6-git-send-email-nipun.gupta@nxp.com>
On Mon, Apr 30, 2018 at 11:57:20AM +0530, Nipun Gupta wrote:
> Signed-off-by: Nipun Gupta <nipun.gupta@nxp.com>
> ---
I can't take patches without any changelog text at all, sorry. Please
fix up and resend.
greg k-h
^ permalink raw reply
* [GIT PULL] defconfig updates for v4.18
From: Matthias Brugger @ 2018-05-14 11:24 UTC (permalink / raw)
To: linux-arm-kernel
Hi Olof and Arnd,
Please merge the following patch for defconfig.
Thanks,
Matthias
---
The following changes since commit 60cc43fc888428bb2f18f08997432d426a243338:
Linux 4.17-rc1 (2018-04-15 18:24:20 -0700)
are available in the Git repository at:
https://git.kernel.org/pub/scm/linux/kernel/git/matthias.bgg/linux.git/
tags/v4.17-next-defconfig
for you to fetch changes up to 1e31927aa64545ee97a2a41db9984c9931afc50a:
arm64: defconfig: Enable CONFIG_PINCTRL_MT7622 by default (2018-04-27 11:48:37
+0200)
----------------------------------------------------------------
enable mt7622 pinctrl to fix boot issue
----------------------------------------------------------------
Sean Wang (1):
arm64: defconfig: Enable CONFIG_PINCTRL_MT7622 by default
arch/arm64/configs/defconfig | 1 +
1 file changed, 1 insertion(+)
^ permalink raw reply
* [PATCH 02/18] arm64: move SCTLR_EL{1,2} assertions to <asm/sysreg.h>
From: Dave Martin @ 2018-05-14 11:20 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <20180514100858.4xjp5d3axbyy74ap@lakrids.cambridge.arm.com>
On Mon, May 14, 2018 at 11:08:59AM +0100, Mark Rutland wrote:
> On Mon, May 14, 2018 at 11:00:53AM +0100, Dave Martin wrote:
> > On Mon, May 14, 2018 at 10:46:24AM +0100, Mark Rutland wrote:
> > > -/* Check all the bits are accounted for */
> > > -#define SCTLR_EL2_BUILD_BUG_ON_MISSING_BITS BUILD_BUG_ON((SCTLR_EL2_SET ^ SCTLR_EL2_CLEAR) != ~0)
> > > -
> > > +#if (SCTLR_EL2_SET ^ SCTLR_EL2_CLEAR) != 0xffffffff
> > > +#error "Inconsistent SCTLR_EL2 set/clear bits"
> > > +#endif
> >
> > Can we have a comment on the != 0xffffffff versus != ~0 here?
> >
> > The subtle differences in evaluation semantics between #if and
> > other contexts here may well trip people up during maintenance...
>
> Do you have any suggestion as to the wording?
>
> I'm happy to add a comment, but I don't really know what to say.
How about the following?
/* Watch out for #if evaluation rules: ~0 is not ~(int)0! */
Cheers
---Dave
^ permalink raw reply
* [PATCH V4] ARM: dts: da850-evm: Enable LCD and Backlight
From: Adam Ford @ 2018-05-14 11:19 UTC (permalink / raw)
To: linux-arm-kernel
When using the board files the LCD works, but not with the DT.
This adds enables the original da850-evm to work with the same
LCD in device tree mode.
The EVM has a gpios for the lcd_panel_pwr, lcd_backlight_pwr,
and lcd_pwm0. Both lcd_backlight_pwr and lcd_pwm0 must be driven
to enable the backlight, so a gpio-regulator is used to drive
lcd_backlight_prw.
The LCD and the vpif display pins are mutually exclusive, so if
using the LCD, disable the vpif. If using the vpif, disable panel.
Extra code comments are inserted to further explain this
Signed-off-by: Adam Ford <aford173@gmail.com>
---
V4: Add comments into the code explaining the LCD and VPIF are mutually
exclusive with instructions on how to enable/disable each. Rename
GPIO pins based on schematic net name. Fix gpio enable in backlight
V3: Fix errant GPIO, label GPIO pins, and rename the regulator to be
more explict to backlight which better matches the schematic.
Updated the description to explain that it cannot be used at the
same time as the vpif driver.
V2: Add regulator and GPIO enable pins. Remove PWM backlight and
replace with GPIO
diff --git a/arch/arm/boot/dts/da850-evm.dts b/arch/arm/boot/dts/da850-evm.dts
index 2e817da37fdb..f6a5497d9c97 100644
--- a/arch/arm/boot/dts/da850-evm.dts
+++ b/arch/arm/boot/dts/da850-evm.dts
@@ -27,6 +27,53 @@
spi0 = &spi1;
};
+ backlight {
+ compatible = "gpio-backlight";
+ gpios = <&gpio 7 GPIO_ACTIVE_HIGH>; /* lcd_pwm0 */
+ };
+
+ panel {
+ compatible = "ti,tilcdc,panel";
+ pinctrl-names = "default";
+ pinctrl-0 = <&lcd_pins>;
+ /* The vpif and the LCD are mutually exclusive.
+ * To enable VPIF, change the status below to 'disabled' then
+ * then change the status of the vpif below to 'okay' */
+ status = "okay";
+ enable-gpios = <&gpio 40 GPIO_ACTIVE_HIGH>; /* lcd_panel_pwr */
+
+ panel-info {
+ ac-bias = <255>;
+ ac-bias-intrpt = <0>;
+ dma-burst-sz = <16>;
+ bpp = <16>;
+ fdd = <0x80>;
+ sync-edge = <0>;
+ sync-ctrl = <1>;
+ raster-order = <0>;
+ fifo-th = <0>;
+ };
+
+ display-timings {
+ native-mode = <&timing0>;
+ timing0: 480x272 {
+ clock-frequency = <9000000>;
+ hactive = <480>;
+ vactive = <272>;
+ hfront-porch = <3>;
+ hback-porch = <2>;
+ hsync-len = <42>;
+ vback-porch = <3>;
+ vfront-porch = <4>;
+ vsync-len = <11>;
+ hsync-active = <0>;
+ vsync-active = <0>;
+ de-active = <1>;
+ pixelclk-active = <1>;
+ };
+ };
+ };
+
vbat: fixedregulator0 {
compatible = "regulator-fixed";
regulator-name = "vbat";
@@ -35,6 +82,16 @@
regulator-boot-on;
};
+ backlight_reg: backlight-regulator {
+ compatible = "regulator-fixed";
+ regulator-name = "lcd_backlight_pwr";
+ regulator-min-microvolt = <3300000>;
+ regulator-max-microvolt = <3300000>;
+ gpio = <&gpio 47 GPIO_ACTIVE_HIGH>; /* lcd_backlight_pwr */
+ regulator-always-on;
+ enable-active-high;
+ };
+
sound {
compatible = "simple-audio-card";
simple-audio-card,name = "DA850/OMAP-L138 EVM";
@@ -109,6 +166,10 @@
status = "okay";
};
+&lcdc {
+ status = "okay";
+};
+
&i2c0 {
status = "okay";
clock-frequency = <100000>;
@@ -339,5 +400,8 @@
&vpif {
pinctrl-names = "default";
pinctrl-0 = <&vpif_capture_pins>, <&vpif_display_pins>;
- status = "okay";
+ /* The vpif and the LCD are mutually exclusive.
+ * To enable VPIF, disable the ti,tilcdc,panel then
+ * changed the status below to 'okay' */
+ status = "disabled";
};
--
2.17.0
^ permalink raw reply related
* Allwinner A64: Issue on external rtc clock to wifi chip
From: Maxime Ripard @ 2018-05-14 11:17 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <CAMty3ZCAWBHtemeeWcgLy5PoYLn10MwxpHdirqpsxFY3BA7=4g@mail.gmail.com>
On Mon, May 14, 2018 at 03:12:49PM +0530, Jagan Teki wrote:
> On Mon, May 14, 2018 at 2:36 PM, Maxime Ripard
> <maxime.ripard@bootlin.com> wrote:
> > On Mon, May 14, 2018 at 02:34:22PM +0530, Jagan Teki wrote:
> >> On Mon, May 14, 2018 at 1:57 PM, Maxime Ripard
> >> <maxime.ripard@bootlin.com> wrote:
> >> > On Mon, May 14, 2018 at 01:34:56PM +0530, Jagan Teki wrote:
> >> >> On Mon, May 14, 2018 at 1:27 PM, Maxime Ripard
> >> >> <maxime.ripard@bootlin.com> wrote:
> >> >> > Hi,
> >> >> >
> >> >> > On Mon, May 14, 2018 at 12:37:49PM +0530, Jagan Teki wrote:
> >> >> >> Hi Maxime and All,
> >> >> >>
> >> >> >> We are trying to bring-up AP6330 Wifi chip for A64 board. We noticed
> >> >> >> to have an external rtc clock has driven from wifi chip.
> >> >> >>
> >> >> >> So the devicetree is configured according to this as below.
> >> >> >>
> >> >> >> / {
> >> >> >> wifi_pwrseq: wifi-pwrseq {
> >> >> >> compatible = "mmc-pwrseq-simple";
> >> >> >> clocks = <&rtc 1>;
> >> >> >> clock-names = "ext_clock";
> >> >> >> reset-gpios = <&r_pio 0 2 GPIO_ACTIVE_LOW>; /* PL2 */
> >> >> >> post-power-on-delay-ms = <400>;
> >> >> >> };
> >> >> >> };
> >> >> >>
> >> >> >> &rtc {
> >> >> >> clock-output-names = "rtc-osc32k", "rtc-osc32k-out";
> >> >> >> clocks = <&osc32k>;
> >> >> >> #clock-cells = <1>;
> >> >> >> };
> >> >> >>
> >> >> >> &mmc1 {
> >> >> >> pinctrl-names = "default";
> >> >> >> pinctrl-0 = <&mmc1_pins>;
> >> >> >> vmmc-supply = <®_dcdc1>;
> >> >> >> vqmmc-supply = <®_eldo1>;
> >> >> >> mmc-pwrseq = <&wifi_pwrseq>;
> >> >> >> bus-width = <4>;
> >> >> >> non-removable;
> >> >> >> status = "okay";
> >> >> >>
> >> >> >> brcmf: wifi at 1 {
> >> >> >> reg = <1>;
> >> >> >> compatible = "brcm,bcm4329-fmac";
> >> >> >> interrupt-parent = <&r_pio>;
> >> >> >> interrupts = <0 3 IRQ_TYPE_LEVEL_LOW>; /* WL-WAKE-AP: PL3 */
> >> >> >> interrupt-names = "host-wake";
> >> >> >> };
> >> >> >> };
> >> >> >>
> >> >> >> And observed rtc-osc32k-out clock is never enabled[1] and the value of
> >> >> >> LOSC_OUT_GATING is 0x0 which eventually not enabling
> >> >> >> LOSC_OUT_GATING_EN
> >> >> >>
> >> >> >> Pls. let us know if we miss anything here?
> >> >> >>
> >> >> >> [1] https://paste.ubuntu.com/p/X2By4q8kD2/
> >> >> >
> >> >> > Could you paste your config and the logs from a boot to?
> >> >>
> >> >> .config
> >> >> https://paste.ubuntu.com/p/w9w2KB7RFc/
> >> >>
> >> >> dmesg
> >> >> https://paste.ubuntu.com/p/mrZGk5bWRR/
> >> >
> >> > This is kind of weird. Have you tested with a 4.17 kernel? We have
> >> > runtime_pm changes lined up in next, so that might be a regression
> >> > there, even though we tested it with Quentin at some point.
> >>
> >> This is 4.17-rc4 do you want to try it on 4.16 ?
> >
> > No, this is next-20180503. Please try with 4.17-rc4
>
> Couldn't find any different in behaviour [2]
>
> [2] https://paste.ubuntu.com/p/m3PGBwrv6W/
It's hard to tell without the board, but have you looked at the return
value of devm_clk_get in the pwrseq code?
Enabling the clk ftrace events would also help.
Maxime
--
Maxime Ripard, Bootlin (formerly Free Electrons)
Embedded Linux and Kernel engineering
https://bootlin.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20180514/4e65385a/attachment.sig>
^ permalink raw reply
* [PATCH 12/18] kernel: add ksys_personality()
From: Dave Martin @ 2018-05-14 11:08 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <20180514094640.27569-13-mark.rutland@arm.com>
On Mon, May 14, 2018 at 10:46:34AM +0100, Mark Rutland wrote:
> Using this helper allows us to avoid the in-kernel call to the
> sys_personality() syscall. The ksys_ prefix denotes that this function
> is meant as a drop-in replacement for the syscall. In particular, it
> uses the same calling convention as sys_personality().
>
> This is necessary to enable conversion of arm64's syscall handling to
> use pt_regs wrappers.
>
> Signed-off-by: Mark Rutland <mark.rutland@arm.com>
> Cc: Al Viro <viro@zeniv.linux.org.uk>
> Cc: Dominik Brodowski <linux@dominikbrodowski.net>
Reviewed-by: Dave Martin <Dave.Martin@arm.com>
> ---
> include/linux/syscalls.h | 1 +
> kernel/exec_domain.c | 7 ++++++-
> 2 files changed, 7 insertions(+), 1 deletion(-)
>
> diff --git a/include/linux/syscalls.h b/include/linux/syscalls.h
> index 70fcda1a9049..6723ea51ec99 100644
> --- a/include/linux/syscalls.h
> +++ b/include/linux/syscalls.h
> @@ -1148,6 +1148,7 @@ unsigned long ksys_mmap_pgoff(unsigned long addr, unsigned long len,
> unsigned long prot, unsigned long flags,
> unsigned long fd, unsigned long pgoff);
> ssize_t ksys_readahead(int fd, loff_t offset, size_t count);
> +unsigned int ksys_personality(unsigned int personality);
>
> /*
> * The following kernel syscall equivalents are just wrappers to fs-internal
> diff --git a/kernel/exec_domain.c b/kernel/exec_domain.c
> index a5697119290e..4ba2b404cba2 100644
> --- a/kernel/exec_domain.c
> +++ b/kernel/exec_domain.c
> @@ -47,7 +47,7 @@ static int __init proc_execdomains_init(void)
> module_init(proc_execdomains_init);
> #endif
>
> -SYSCALL_DEFINE1(personality, unsigned int, personality)
> +unsigned int ksys_personality(unsigned int personality)
> {
> unsigned int old = current->personality;
>
> @@ -56,3 +56,8 @@ SYSCALL_DEFINE1(personality, unsigned int, personality)
>
> return old;
> }
> +
> +SYSCALL_DEFINE1(personality, unsigned int, personality)
> +{
> + return ksys_personality(personality);
> +}
> --
> 2.11.0
>
>
> _______________________________________________
> linux-arm-kernel mailing list
> linux-arm-kernel at lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply
* [PATCH 11/18] arm64: zero GPRs upon entry from EL0
From: Dave Martin @ 2018-05-14 11:07 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <20180514094640.27569-12-mark.rutland@arm.com>
On Mon, May 14, 2018 at 10:46:33AM +0100, Mark Rutland wrote:
> We can zero GPRs x0 - x29 upon entry from EL0 to make it harder for
> userspace to control values consumed by speculative gadgets.
>
> We don't blat x30, since this is stashed much later, and we'll blat it
> before invoking C code.
>
> Signed-off-by: Mark Rutland <mark.rutland@arm.com>
> Cc: Catalin Marinas <catalin.marinas@arm.com>
> Cc: Will Deacon <will.deacon@arm.com>
> ---
> arch/arm64/kernel/entry.S | 9 +++++++--
> 1 file changed, 7 insertions(+), 2 deletions(-)
>
> diff --git a/arch/arm64/kernel/entry.S b/arch/arm64/kernel/entry.S
> index 13afefbf608f..4dd529fd03fd 100644
> --- a/arch/arm64/kernel/entry.S
> +++ b/arch/arm64/kernel/entry.S
> @@ -62,6 +62,12 @@
> #endif
> .endm
>
> + .macro clear_gp_regs
> + .irp n,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29
> + mov x\n, xzr
> + .endr
> + .endm
> +
Looks OK, but consider moving _for from fpsimdmacros.h to assembler.h
and just writing
_for n, 0, 29, mov x\n, xzr
(could even omit the wrapper macro, since this is a one-liner).
The implementation of _for is a bit gross, but since we already have it,
we might as well use it.
[...]
Cheers
---Dave
^ permalink raw reply
* [PATCH 10/18] arm64: convert native/compat syscall entry to C
From: Dave Martin @ 2018-05-14 11:07 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <20180514094640.27569-11-mark.rutland@arm.com>
On Mon, May 14, 2018 at 10:46:32AM +0100, Mark Rutland wrote:
> Now that the syscall invocation logic is in C, we can migrate the rest
> of the syscall entry logic over, so that the entry assembly needn't look
> at the register values at all.
>
> Signed-off-by: Mark Rutland <mark.rutland@arm.com>
> Cc: Catalin Marinas <catalin.marinas@arm.com>
> Cc: Will Deacon <will.deacon@arm.com>
> ---
> arch/arm64/kernel/entry.S | 42 ++++--------------------------------------
> arch/arm64/kernel/syscall.c | 40 ++++++++++++++++++++++++++++++++++++++--
> 2 files changed, 42 insertions(+), 40 deletions(-)
>
> diff --git a/arch/arm64/kernel/entry.S b/arch/arm64/kernel/entry.S
> index 5c60369b52fc..13afefbf608f 100644
> --- a/arch/arm64/kernel/entry.S
> +++ b/arch/arm64/kernel/entry.S
> @@ -690,14 +690,9 @@ el0_sync_compat:
> b.ge el0_dbg
> b el0_inv
> el0_svc_compat:
> - /*
> - * AArch32 syscall handling
> - */
> - ldr x16, [tsk, #TSK_TI_FLAGS] // load thread flags
> - adrp stbl, compat_sys_call_table // load compat syscall table pointer
> - mov wscno, w7 // syscall number in w7 (r7)
> - mov wsc_nr, #__NR_compat_syscalls
> - b el0_svc_naked
> + mov x0, sp
> + bl el0_svc_compat_handler
> + b ret_to_user
>
> .align 6
> el0_irq_compat:
> @@ -895,37 +890,8 @@ ENDPROC(ret_to_user)
> */
> .align 6
> el0_svc:
> - ldr x16, [tsk, #TSK_TI_FLAGS] // load thread flags
> - adrp stbl, sys_call_table // load syscall table pointer
> - mov wscno, w8 // syscall number in w8
> - mov wsc_nr, #__NR_syscalls
> -
> -#ifdef CONFIG_ARM64_SVE
> -alternative_if_not ARM64_SVE
> - b el0_svc_naked
> -alternative_else_nop_endif
> - tbz x16, #TIF_SVE, el0_svc_naked // Skip unless TIF_SVE set:
> - bic x16, x16, #_TIF_SVE // discard SVE state
> - str x16, [tsk, #TSK_TI_FLAGS]
> -
> - /*
> - * task_fpsimd_load() won't be called to update CPACR_EL1 in
> - * ret_to_user unless TIF_FOREIGN_FPSTATE is still set, which only
> - * happens if a context switch or kernel_neon_begin() or context
> - * modification (sigreturn, ptrace) intervenes.
> - * So, ensure that CPACR_EL1 is already correct for the fast-path case:
> - */
> - mrs x9, cpacr_el1
> - bic x9, x9, #CPACR_EL1_ZEN_EL0EN // disable SVE for el0
> - msr cpacr_el1, x9 // synchronised by eret to el0
> -#endif
> -
> -el0_svc_naked: // compat entry point
> mov x0, sp
> - mov w1, wscno
> - mov w2, wsc_nr
> - mov x3, stbl
> - bl el0_svc_common
> + bl el0_svc_handler
> b ret_to_user
> ENDPROC(el0_svc)
>
> diff --git a/arch/arm64/kernel/syscall.c b/arch/arm64/kernel/syscall.c
> index 5df857e32b48..4706f841e758 100644
> --- a/arch/arm64/kernel/syscall.c
> +++ b/arch/arm64/kernel/syscall.c
> @@ -6,7 +6,9 @@
> #include <linux/ptrace.h>
>
> #include <asm/daifflags.h>
> +#include <asm/fpsimd.h>
> #include <asm/thread_info.h>
> +#include <asm/unistd.h>
>
> long do_ni_syscall(struct pt_regs *regs);
>
> @@ -41,8 +43,8 @@ static inline bool has_syscall_work(unsigned long flags)
> int syscall_trace_enter(struct pt_regs *regs);
> void syscall_trace_exit(struct pt_regs *regs);
>
> -asmlinkage void el0_svc_common(struct pt_regs *regs, int scno, int sc_nr,
> - syscall_fn_t syscall_table[])
> +static void el0_svc_common(struct pt_regs *regs, int scno, int sc_nr,
> + syscall_fn_t syscall_table[])
> {
> unsigned long flags = current_thread_info()->flags;
>
> @@ -79,3 +81,37 @@ asmlinkage void el0_svc_common(struct pt_regs *regs, int scno, int sc_nr,
> trace_exit:
> syscall_trace_exit(regs);
> }
> +
> +static inline void sve_user_reset(void)
Static function with no caller...
> +{
> + if (!system_supports_sve())
> + return;
> +
> + /*
> + * task_fpsimd_load() won't be called to update CPACR_EL1 in
> + * ret_to_user unless TIF_FOREIGN_FPSTATE is still set, which only
> + * happens if a context switch or kernel_neon_begin() or context
> + * modification (sigreturn, ptrace) intervenes.
> + * So, ensure that CPACR_EL1 is already correct for the fast-path case.
> + */
> + if (test_and_clear_thread_flag(TIF_SVE))
> + sve_user_disable();
sve_user_disable() is already inline, and incorporates the if()
internally via sysreg_clear_set().
So, should this just be
clear_thread_flag(TIF_SVE);
sve_user_disable();
> +}
> +
> +extern syscall_fn_t sys_call_table[];
> +
> +asmlinkage void el0_svc_handler(struct pt_regs *regs)
> +{
if (system_supports_sve()) ?
> + sve_user_disable();
Or should this be replaced by a call to sve_user_reset()?
I suspect the latter, since we do want to be clearing TIF_SVE here too.
[...]
Cheers
---Dave
^ permalink raw reply
* [PATCH 08/18] arm64: convert raw syscall invocation to C
From: Dave Martin @ 2018-05-14 11:07 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <20180514094640.27569-9-mark.rutland@arm.com>
On Mon, May 14, 2018 at 10:46:30AM +0100, Mark Rutland wrote:
> As a first step towards invoking syscalls with a pt_regs argument,
> convert the raw syscall invocation logic to C. We end up with a bit more
> register shuffling, but the unified invocation logic means we can unify
> the tracing paths, too.
>
> This only converts the invocation of the syscall. The rest of the
> syscall triage and tracing is left in assembly for now, and will be
> converted in subsequent patches.
>
> Signed-off-by: Mark Rutland <mark.rutland@arm.com>
> Cc: Catalin Marinas <catalin.marinas@arm.com>
> Cc: Will Deacon <will.deacon@arm.com>
> ---
> arch/arm64/kernel/Makefile | 3 ++-
> arch/arm64/kernel/entry.S | 36 ++++++++++--------------------------
> arch/arm64/kernel/syscall.c | 29 +++++++++++++++++++++++++++++
> 3 files changed, 41 insertions(+), 27 deletions(-)
> create mode 100644 arch/arm64/kernel/syscall.c
>
> diff --git a/arch/arm64/kernel/Makefile b/arch/arm64/kernel/Makefile
> index bf825f38d206..c22e8ace5ea3 100644
> --- a/arch/arm64/kernel/Makefile
> +++ b/arch/arm64/kernel/Makefile
> @@ -18,7 +18,8 @@ arm64-obj-y := debug-monitors.o entry.o irq.o fpsimd.o \
> hyp-stub.o psci.o cpu_ops.o insn.o \
> return_address.o cpuinfo.o cpu_errata.o \
> cpufeature.o alternative.o cacheinfo.o \
> - smp.o smp_spin_table.o topology.o smccc-call.o
> + smp.o smp_spin_table.o topology.o smccc-call.o \
> + syscall.o
>
> extra-$(CONFIG_EFI) := efi-entry.o
>
> diff --git a/arch/arm64/kernel/entry.S b/arch/arm64/kernel/entry.S
> index 08ea3cbfb08f..d6e057500eaf 100644
> --- a/arch/arm64/kernel/entry.S
> +++ b/arch/arm64/kernel/entry.S
> @@ -873,7 +873,6 @@ ENDPROC(el0_error)
> */
> ret_fast_syscall:
> disable_daif
> - str x0, [sp, #S_X0] // returned x0
> ldr x1, [tsk, #TSK_TI_FLAGS] // re-check for syscall tracing
> and x2, x1, #_TIF_SYSCALL_WORK
> cbnz x2, ret_fast_syscall_trace
> @@ -946,15 +945,11 @@ el0_svc_naked: // compat entry point
>
> tst x16, #_TIF_SYSCALL_WORK // check for syscall hooks
> b.ne __sys_trace
> - cmp wscno, wsc_nr // check upper syscall limit
> - b.hs ni_sys
> - mask_nospec64 xscno, xsc_nr, x19 // enforce bounds for syscall number
> - ldr x16, [stbl, xscno, lsl #3] // address in the syscall table
> - blr x16 // call sys_* routine
> - b ret_fast_syscall
> -ni_sys:
> mov x0, sp
> - bl do_ni_syscall
> + mov w1, wscno
> + mov w2, wsc_nr
> + mov x3, stbl
> + bl invoke_syscall
> b ret_fast_syscall
> ENDPROC(el0_svc)
>
> @@ -971,29 +966,18 @@ __sys_trace:
> bl syscall_trace_enter
> cmp w0, #NO_SYSCALL // skip the syscall?
> b.eq __sys_trace_return_skipped
> - mov wscno, w0 // syscall number (possibly new)
> - mov x1, sp // pointer to regs
> - cmp wscno, wsc_nr // check upper syscall limit
> - b.hs __ni_sys_trace
> - ldp x0, x1, [sp] // restore the syscall args
> - ldp x2, x3, [sp, #S_X2]
> - ldp x4, x5, [sp, #S_X4]
> - ldp x6, x7, [sp, #S_X6]
> - ldr x16, [stbl, xscno, lsl #3] // address in the syscall table
> - blr x16 // call sys_* routine
>
> -__sys_trace_return:
> - str x0, [sp, #S_X0] // save returned x0
> + mov x0, sp
> + mov w1, wscno
> + mov w2, wsc_nr
> + mov x3, stbl
> + bl invoke_syscall
> +
> __sys_trace_return_skipped:
> mov x0, sp
> bl syscall_trace_exit
> b ret_to_user
>
> -__ni_sys_trace:
> - mov x0, sp
> - bl do_ni_syscall
> - b __sys_trace_return
> -
Can you explain why ni_syscall is special here, why __sys_trace_return
existed, and why its disappearance doesn't break anything?
Not saying there's a bug, just that I'm a little confuse -- I see no
real reason for ni_syscall being special, and this may be a good
opportunity to decruft it. (See also comments below.)
> .popsection // .entry.text
>
> #ifdef CONFIG_UNMAP_KERNEL_AT_EL0
> diff --git a/arch/arm64/kernel/syscall.c b/arch/arm64/kernel/syscall.c
> new file mode 100644
> index 000000000000..58d7569f47df
> --- /dev/null
> +++ b/arch/arm64/kernel/syscall.c
> @@ -0,0 +1,29 @@
> +// SPDX-License-Identifier: GPL-2.0
> +
> +#include <linux/nospec.h>
> +#include <linux/ptrace.h>
> +
> +long do_ni_syscall(struct pt_regs *regs);
> +
> +typedef long (*syscall_fn_t)(unsigned long, unsigned long,
> + unsigned long, unsigned long,
> + unsigned long, unsigned long);
> +
> +static void __invoke_syscall(struct pt_regs *regs, syscall_fn_t syscall_fn)
> +{
> + regs->regs[0] = syscall_fn(regs->regs[0], regs->regs[1],
> + regs->regs[2], regs->regs[3],
> + regs->regs[4], regs->regs[5]);
> +}
> +
> +asmlinkage void invoke_syscall(struct pt_regs *regs, int scno, int sc_nr,
> + syscall_fn_t syscall_table[])
> +{
> + if (scno < sc_nr) {
What if (int)scno < 0? Should those args both by unsigned ints?
"sc_nr" sounds too much like "syscall number" to me. Might
"syscall_table_size" might be clearer? Similarly, we could have
"stbl_size" or similar in the asm. This is purely cosmetic,
though.
> + syscall_fn_t syscall_fn;
> + syscall_fn = syscall_table[array_index_nospec(scno, sc_nr)];
> + __invoke_syscall(regs, syscall_fn);
> + } else {
> + regs->regs[0] = do_ni_syscall(regs);
Can we make __invoke_syscall() the universal syscall wrapper, and give
do_ni_syscall() the same interface as any other syscall body?
Then you could factor this as
static syscall_fn_t syscall_fn(syscall_fn_t const syscall_table[],
(unsigned) int scno, (unsigned) int sc_nr)
{
if (sc_no >= sc_nr)
return sys_ni_syscall;
return syscall_table[array_index_nospec(scno, sc_nr)];
}
...
__invoke_syscall(regs, syscall_fn(syscall_table, scno, sc_nr);
This is cosmetic too, of course.
do_ni_syscall() should be given a pt_regs-based wrapper like all the
rest.
This is still cosmetic, but reduces unnecessary special-case-ness
for ni_syscall.
Cheers
---Dave
^ permalink raw reply
* [PATCH 07/18] arm64: remove sigreturn wrappers
From: Dave Martin @ 2018-05-14 11:07 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <20180514094640.27569-8-mark.rutland@arm.com>
On Mon, May 14, 2018 at 10:46:29AM +0100, Mark Rutland wrote:
> The arm64 sigreturn* syscall handlers are non-standard. Rather than
> taking a number of user parameters in registers as per the AAPCS,
> they expect the pt_regs as their sole argument.
>
> To make this work, we override the syscall definitions to invoke
> wrappers written in assembly, which mov the SP into x0, and branch to
> their respective C functions.
>
> On other architectures (such as x86), the sigreturn* functions take no
> argument and instead use current_pt_regs() to acquire the user
> registers. This requires less boilerplate code, and allows for other
> features such as interposing C code in this path.
Hmmm, I always wondered why rt_sigreturn() et al. were handled
specially.
If there's effectively no underlying reason for that, it makes sense
to regularise the interface to these syscalls.
Tentatively-reviewed-by: Dave Martin <Dave.Martin@arm.com>
>
> This patch takes the same approach for arm64.
>
> Signed-off-by: Mark Rutland <mark.rutland@arm.com>
> Cc: Catalin Marinas <catalin.marinas@arm.com>
> Cc: Will Deacon <will.deacon@arm.com>
> ---
> arch/arm64/include/asm/unistd32.h | 4 ++--
> arch/arm64/kernel/entry.S | 8 --------
> arch/arm64/kernel/entry32.S | 10 ----------
> arch/arm64/kernel/signal.c | 3 ++-
> arch/arm64/kernel/signal32.c | 6 ++++--
> arch/arm64/kernel/sys.c | 3 +--
> arch/arm64/kernel/sys32.c | 4 ++--
> 7 files changed, 11 insertions(+), 27 deletions(-)
>
> diff --git a/arch/arm64/include/asm/unistd32.h b/arch/arm64/include/asm/unistd32.h
> index ef292160748c..ab95554b1734 100644
> --- a/arch/arm64/include/asm/unistd32.h
> +++ b/arch/arm64/include/asm/unistd32.h
> @@ -260,7 +260,7 @@ __SYSCALL(117, sys_ni_syscall)
> #define __NR_fsync 118
> __SYSCALL(__NR_fsync, sys_fsync)
> #define __NR_sigreturn 119
> -__SYSCALL(__NR_sigreturn, compat_sys_sigreturn_wrapper)
> +__SYSCALL(__NR_sigreturn, compat_sys_sigreturn)
> #define __NR_clone 120
> __SYSCALL(__NR_clone, sys_clone)
> #define __NR_setdomainname 121
> @@ -368,7 +368,7 @@ __SYSCALL(__NR_getresgid, sys_getresgid16)
> #define __NR_prctl 172
> __SYSCALL(__NR_prctl, sys_prctl)
> #define __NR_rt_sigreturn 173
> -__SYSCALL(__NR_rt_sigreturn, compat_sys_rt_sigreturn_wrapper)
> +__SYSCALL(__NR_rt_sigreturn, compat_sys_rt_sigreturn)
> #define __NR_rt_sigaction 174
> __SYSCALL(__NR_rt_sigaction, compat_sys_rt_sigaction)
> #define __NR_rt_sigprocmask 175
> diff --git a/arch/arm64/kernel/entry.S b/arch/arm64/kernel/entry.S
> index ec2ee720e33e..08ea3cbfb08f 100644
> --- a/arch/arm64/kernel/entry.S
> +++ b/arch/arm64/kernel/entry.S
> @@ -1108,14 +1108,6 @@ __entry_tramp_data_start:
> #endif /* CONFIG_UNMAP_KERNEL_AT_EL0 */
>
> /*
> - * Special system call wrappers.
> - */
> -ENTRY(sys_rt_sigreturn_wrapper)
> - mov x0, sp
> - b sys_rt_sigreturn
> -ENDPROC(sys_rt_sigreturn_wrapper)
> -
> -/*
> * Register switch for AArch64. The callee-saved registers need to be saved
> * and restored. On entry:
> * x0 = previous task_struct (must be preserved across the switch)
> diff --git a/arch/arm64/kernel/entry32.S b/arch/arm64/kernel/entry32.S
> index f332d5d1f6b4..f9461696dde4 100644
> --- a/arch/arm64/kernel/entry32.S
> +++ b/arch/arm64/kernel/entry32.S
> @@ -30,16 +30,6 @@
> * System call wrappers for the AArch32 compatibility layer.
> */
>
> -ENTRY(compat_sys_sigreturn_wrapper)
> - mov x0, sp
> - b compat_sys_sigreturn
> -ENDPROC(compat_sys_sigreturn_wrapper)
> -
> -ENTRY(compat_sys_rt_sigreturn_wrapper)
> - mov x0, sp
> - b compat_sys_rt_sigreturn
> -ENDPROC(compat_sys_rt_sigreturn_wrapper)
> -
> ENTRY(compat_sys_statfs64_wrapper)
> mov w3, #84
> cmp w1, #88
> diff --git a/arch/arm64/kernel/signal.c b/arch/arm64/kernel/signal.c
> index 8e624fec4707..caa7a68cf2d2 100644
> --- a/arch/arm64/kernel/signal.c
> +++ b/arch/arm64/kernel/signal.c
> @@ -538,8 +538,9 @@ static int restore_sigframe(struct pt_regs *regs,
> return err;
> }
>
> -asmlinkage long sys_rt_sigreturn(struct pt_regs *regs)
> +asmlinkage long sys_rt_sigreturn(void)
> {
> + struct pt_regs *regs = current_pt_regs();
> struct rt_sigframe __user *frame;
>
> /* Always make any pending restarted system calls return -EINTR */
> diff --git a/arch/arm64/kernel/signal32.c b/arch/arm64/kernel/signal32.c
> index 77b91f478995..cb10588a7cb2 100644
> --- a/arch/arm64/kernel/signal32.c
> +++ b/arch/arm64/kernel/signal32.c
> @@ -282,8 +282,9 @@ static int compat_restore_sigframe(struct pt_regs *regs,
> return err;
> }
>
> -asmlinkage int compat_sys_sigreturn(struct pt_regs *regs)
> +asmlinkage int compat_sys_sigreturn(void)
> {
> + struct pt_regs *regs = current_pt_regs();
> struct compat_sigframe __user *frame;
>
> /* Always make any pending restarted system calls return -EINTR */
> @@ -312,8 +313,9 @@ asmlinkage int compat_sys_sigreturn(struct pt_regs *regs)
> return 0;
> }
>
> -asmlinkage int compat_sys_rt_sigreturn(struct pt_regs *regs)
> +asmlinkage int compat_sys_rt_sigreturn(void)
> {
> + struct pt_regs *regs = current_pt_regs();
> struct compat_rt_sigframe __user *frame;
>
> /* Always make any pending restarted system calls return -EINTR */
> diff --git a/arch/arm64/kernel/sys.c b/arch/arm64/kernel/sys.c
> index 72981bae10eb..31045f3fed92 100644
> --- a/arch/arm64/kernel/sys.c
> +++ b/arch/arm64/kernel/sys.c
> @@ -48,8 +48,7 @@ SYSCALL_DEFINE1(arm64_personality, unsigned int, personality)
> /*
> * Wrappers to pass the pt_regs argument.
> */
> -asmlinkage long sys_rt_sigreturn_wrapper(void);
> -#define sys_rt_sigreturn sys_rt_sigreturn_wrapper
> +asmlinkage long sys_rt_sigreturn(void);
> #define sys_personality sys_arm64_personality
>
> #undef __SYSCALL
> diff --git a/arch/arm64/kernel/sys32.c b/arch/arm64/kernel/sys32.c
> index a40b1343b819..1ef103c95410 100644
> --- a/arch/arm64/kernel/sys32.c
> +++ b/arch/arm64/kernel/sys32.c
> @@ -25,8 +25,8 @@
> #include <linux/compiler.h>
> #include <linux/syscalls.h>
>
> -asmlinkage long compat_sys_sigreturn_wrapper(void);
> -asmlinkage long compat_sys_rt_sigreturn_wrapper(void);
> +asmlinkage long compat_sys_sigreturn(void);
> +asmlinkage long compat_sys_rt_sigreturn(void);
> asmlinkage long compat_sys_statfs64_wrapper(void);
> asmlinkage long compat_sys_fstatfs64_wrapper(void);
> asmlinkage long compat_sys_pread64_wrapper(void);
> --
> 2.11.0
>
>
> _______________________________________________
> linux-arm-kernel mailing list
> linux-arm-kernel at lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ 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