* Re: [RFC PATCH kernel] powerpc: Fix early setup to make early_ioremap work
From: Alexey Kardashevskiy @ 2021-05-20 3:33 UTC (permalink / raw)
To: linuxppc-dev
In-Reply-To: <20210520032919.358935-1-aik@ozlabs.ru>
Hm, my thunderbird says it is not cc:'ed but git sendmail says it did cc:
Server: localhost
MAIL FROM:<aik@ozlabs.ru>
RCPT TO:<linuxppc-dev@lists.ozlabs.org>
RCPT TO:<aik@ozlabs.ru>
RCPT TO:<mpe@ellerman.id.au>
RCPT TO:<christophe.leroy@csgroup.eu>
From: Alexey Kardashevskiy <aik@ozlabs.ru>
To: linuxppc-dev@lists.ozlabs.org
Cc: Alexey Kardashevskiy <aik@ozlabs.ru>,
Michael Ellerman <mpe@ellerman.id.au>,
Christophe Leroy <christophe.leroy@csgroup.eu>
Subject: [RFC PATCH kernel] powerpc: Fix early setup to make
early_ioremap work
Not sure what to believe.
On 20/05/2021 13:29, Alexey Kardashevskiy wrote:
> The immediate problem is that after
> 0bd3f9e953bd ("powerpc/legacy_serial: Use early_ioremap()")
> the kernel silently reboots. The reason is that early_ioremap() returns
> broken addresses as it uses slot_virt[] array which initialized with
> offsets from FIXADDR_TOP == IOREMAP_END+FIXADDR_SIZE ==
> KERN_IO_END- FIXADDR_SIZ + FIXADDR_SIZE == __kernel_io_end which is 0
> when early_ioremap_setup() is called. __kernel_io_end is initialized
> little bit later in early_init_mmu().
>
> This fixes the initialization by swapping early_ioremap_setup and
> early_init_mmu.
>
> This also fixes IOREMAP_END to use FIXADDR_SIZE defined just next to it,
> seems to make sense, unless there is some weird logic with redefining
> FIXADDR_SIZE as the compiling goes.
>
> Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
> ---
> arch/powerpc/include/asm/book3s/64/pgtable.h | 2 +-
> arch/powerpc/kernel/setup_64.c | 3 ++-
> 2 files changed, 3 insertions(+), 2 deletions(-)
>
> diff --git a/arch/powerpc/include/asm/book3s/64/pgtable.h b/arch/powerpc/include/asm/book3s/64/pgtable.h
> index a666d561b44d..54a06129794b 100644
> --- a/arch/powerpc/include/asm/book3s/64/pgtable.h
> +++ b/arch/powerpc/include/asm/book3s/64/pgtable.h
> @@ -325,8 +325,8 @@ extern unsigned long pci_io_base;
> #define PHB_IO_END (KERN_IO_START + FULL_IO_SIZE)
> #define IOREMAP_BASE (PHB_IO_END)
> #define IOREMAP_START (ioremap_bot)
> -#define IOREMAP_END (KERN_IO_END - FIXADDR_SIZE)
> #define FIXADDR_SIZE SZ_32M
> +#define IOREMAP_END (KERN_IO_END - FIXADDR_SIZE)
>
> /* Advertise special mapping type for AGP */
> #define HAVE_PAGE_AGP
> diff --git a/arch/powerpc/kernel/setup_64.c b/arch/powerpc/kernel/setup_64.c
> index b779d25761cf..ce09fe5debf4 100644
> --- a/arch/powerpc/kernel/setup_64.c
> +++ b/arch/powerpc/kernel/setup_64.c
> @@ -369,11 +369,12 @@ void __init early_setup(unsigned long dt_ptr)
> apply_feature_fixups();
> setup_feature_keys();
>
> - early_ioremap_setup();
>
> /* Initialize the hash table or TLB handling */
> early_init_mmu();
>
> + early_ioremap_setup();
> +
> /*
> * After firmware and early platform setup code has set things up,
> * we note the SPR values for configurable control/performance
>
--
Alexey
^ permalink raw reply
* Re: [PATCH v3 0/4] P2040/P2041 i2c recovery erratum
From: Chris Packham @ 2021-05-20 3:36 UTC (permalink / raw)
To: wsa@kernel.org, Joakim Tjernlund
Cc: devicetree@vger.kernel.org, linux-kernel@vger.kernel.org,
andy.shevchenko@gmail.com, robh+dt@kernel.org,
linux-i2c@vger.kernel.org, andriy.shevchenko@linux.intel.com,
linuxppc-dev@lists.ozlabs.org
In-Reply-To: <20210512150118.GA1004@ninjato>
On 13/05/21 3:01 am, wsa@kernel.org wrote:
>>> I've been doing my recent work with a P2040 and prior to that I did test
>>> out the recovery on a T2081 (which isn't documented to have this
>>> erratum) when I was re-working the driver. The "new" recovery actually
>>> seems better but I don't have a reliably faulty i2c device so that's
>>> only based on me writing some code to manually trigger the recovery
>>> (using the snippet below) and observing it with an oscilloscope.
>> You don't need a faulty device, just an aborted I2C read/write op.
> If you can wire GPIOs to the bus, you can use the I2C fault injector:
>
> Documentation/i2c/gpio-fault-injection.rst
>
> There are already two "incomplete transfer" injectors.
>
Just giving this thread a poke. I have been looking at my options for
triggering an i2c recovery but haven't really had time to do much. I
think the best option given what I've got access to is a modified SFP
that grounds the SDA line but I need to find a system where I can attach
an oscilloscope (should be a few of these in the office when I can get
on-site).
I can confirm that when manually triggered the existing recovery and the
new erratum workaround produce what I'd expect to observe on an
oscilloscope.
I haven't explored Joakim's alternative recovery but I don't think that
should hold up these changes, any improvement to the existing recovery
can be done later as a follow-up.
^ permalink raw reply
* Re: [PATCH v8 27/30] powerpc/kprobes: Don't allow breakpoints on suffixes
From: Jordan Niethe @ 2021-05-20 3:45 UTC (permalink / raw)
To: Naveen N. Rao
Cc: Alistair Popple, Balamuruhan S, Nicholas Piggin, linuxppc-dev,
Daniel Axtens
In-Reply-To: <1621411610.rhqg7trx2p.naveen@linux.ibm.com>
On Wed, May 19, 2021 at 6:11 PM Naveen N. Rao
<naveen.n.rao@linux.vnet.ibm.com> wrote:
>
> Christophe Leroy wrote:
> >
> >
> > Le 06/05/2020 à 05:40, Jordan Niethe a écrit :
> >> Do not allow inserting breakpoints on the suffix of a prefix instruction
> >> in kprobes.
> >>
> >> Signed-off-by: Jordan Niethe <jniethe5@gmail.com>
> >> ---
> >> v8: Add this back from v3
> >> ---
> >> arch/powerpc/kernel/kprobes.c | 13 +++++++++++++
> >> 1 file changed, 13 insertions(+)
> >>
> >> diff --git a/arch/powerpc/kernel/kprobes.c b/arch/powerpc/kernel/kprobes.c
> >> index 33d54b091c70..227510df8c55 100644
> >> --- a/arch/powerpc/kernel/kprobes.c
> >> +++ b/arch/powerpc/kernel/kprobes.c
> >> @@ -106,7 +106,9 @@ kprobe_opcode_t *kprobe_lookup_name(const char *name, unsigned int offset)
> >> int arch_prepare_kprobe(struct kprobe *p)
> >> {
> >> int ret = 0;
> >> + struct kprobe *prev;
> >> struct ppc_inst insn = ppc_inst_read((struct ppc_inst *)p->addr);
> >> + struct ppc_inst prefix = ppc_inst_read((struct ppc_inst *)(p->addr - 1));
> >
> > What if p->addr is the first word of a page and the previous page is
> > not mapped ?
>
> Good catch!
> I think we can just skip validation if the instruction is at the
> beginning of a page. I have a few cleanups in this area - I will post a
> patchset soon.
Yeah thanks Christophe for noticing that. And thanks Naveen that
sounds like it should fix it.
>
> >
> >>
> >> if ((unsigned long)p->addr & 0x03) {
> >> printk("Attempt to register kprobe at an unaligned address\n");
> >> @@ -114,6 +116,17 @@ int arch_prepare_kprobe(struct kprobe *p)
> >> } else if (IS_MTMSRD(insn) || IS_RFID(insn) || IS_RFI(insn)) {
> >> printk("Cannot register a kprobe on rfi/rfid or mtmsr[d]\n");
> >> ret = -EINVAL;
> >> + } else if (ppc_inst_prefixed(prefix)) {
> >
> > If p->addr - 2 contains a valid prefixed instruction, then p->addr - 1 contains the suffix of that
> > prefixed instruction. Are we sure a suffix can never ever be misinterpreted as the prefix of a
> > prefixed instruction ?
>
> Yes. Per the ISA:
> Bits 0:5 of all prefixes are assigned the primary opcode
> value 0b000001. 0b000001 is not available for use as a
> primary opcode for either word instructions or suffixes
> of prefixed instructions.
Yep, a prefix will never be a valid word instruction or suffix.
>
>
> - Naveen
>
^ permalink raw reply
* Re: [PATCH v14 7/9] powerpc: Set ARCH_HAS_STRICT_MODULE_RWX
From: Jordan Niethe @ 2021-05-20 3:50 UTC (permalink / raw)
To: Christophe Leroy
Cc: ajd, Nicholas Piggin, cmr, Aneesh Kumar K.V, naveen.n.rao,
linuxppc-dev, Daniel Axtens
In-Reply-To: <5c592104-2018-a36d-61a3-e2039b1563eb@csgroup.eu>
On Mon, May 17, 2021 at 4:49 PM Christophe Leroy
<christophe.leroy@csgroup.eu> wrote:
>
>
>
> Le 17/05/2021 à 05:28, Jordan Niethe a écrit :
> > From: Russell Currey <ruscur@russell.cc>
> >
> > To enable strict module RWX on powerpc, set:
> >
> > CONFIG_STRICT_MODULE_RWX=y
> >
> > You should also have CONFIG_STRICT_KERNEL_RWX=y set to have any real
> > security benefit.
> >
> > ARCH_HAS_STRICT_MODULE_RWX is set to require ARCH_HAS_STRICT_KERNEL_RWX.
> > This is due to a quirk in arch/Kconfig and arch/powerpc/Kconfig that
> > makes STRICT_MODULE_RWX *on by default* in configurations where
> > STRICT_KERNEL_RWX is *unavailable*.
> >
> > Since this doesn't make much sense, and module RWX without kernel RWX
> > doesn't make much sense, having the same dependencies as kernel RWX
> > works around this problem.
> >
> > Book32s/32 processors with a hash mmu (i.e. 604 core) can not set memory
> ^^^^^^
>
> Book32s ==> Book3s
Thanks.
>
> > protection on a page by page basis so do not enable.
>
> It is not exactly that. The problem on 604 is for _exec_ protection.
Right.
>
> Note that on book3s/32, on both 603 and 604 core, it is not possible to write protect kernel pages.
> So maybe it would make sense to disable ARCH_HAS_STRICT_MODULE_RWX on CONFIG_PPC_BOOK3S_32
> completely, I'm not sure.
Yeah, that does seem like it would make sense to disable it.
>
>
> >
> > Signed-off-by: Russell Currey <ruscur@russell.cc>
> > [jpn: - predicate on !PPC_BOOK3S_604
> > - make module_alloc() use PAGE_KERNEL protection]
> > Signed-off-by: Jordan Niethe <jniethe5@gmail.com>
>
> Reviewed-by: Christophe Leroy <christophe.leroy@csgroup.eu>
>
> > ---
> > v10: - Predicate on !PPC_BOOK3S_604
> > - Make module_alloc() use PAGE_KERNEL protection
> > v11: - Neaten up
> > v13: Use strict_kernel_rwx_enabled()
> > v14: Make changes to module_alloc() its own commit
> > ---
> > arch/powerpc/Kconfig | 1 +
> > 1 file changed, 1 insertion(+)
> >
> > diff --git a/arch/powerpc/Kconfig b/arch/powerpc/Kconfig
> > index cce0a137b046..cb5d9d862c35 100644
> > --- a/arch/powerpc/Kconfig
> > +++ b/arch/powerpc/Kconfig
> > @@ -140,6 +140,7 @@ config PPC
> > select ARCH_HAS_SCALED_CPUTIME if VIRT_CPU_ACCOUNTING_NATIVE && PPC_BOOK3S_64
> > select ARCH_HAS_SET_MEMORY
> > select ARCH_HAS_STRICT_KERNEL_RWX if ((PPC_BOOK3S_64 || PPC32) && !HIBERNATION)
> > + select ARCH_HAS_STRICT_MODULE_RWX if ARCH_HAS_STRICT_KERNEL_RWX && !PPC_BOOK3S_604
> > select ARCH_HAS_TICK_BROADCAST if GENERIC_CLOCKEVENTS_BROADCAST
> > select ARCH_HAS_UACCESS_FLUSHCACHE
> > select ARCH_HAS_COPY_MC if PPC64
> >
^ permalink raw reply
* Re: [PATCH v14 6/9] powerpc/bpf: Write protect JIT code
From: Jordan Niethe @ 2021-05-20 4:02 UTC (permalink / raw)
To: Christophe Leroy
Cc: ajd, Nicholas Piggin, cmr, Aneesh Kumar K.V, naveen.n.rao,
linuxppc-dev, Daniel Axtens
In-Reply-To: <8bdb3842-5f1c-173f-df6c-3f4245aabea6@csgroup.eu>
On Mon, May 17, 2021 at 4:40 PM Christophe Leroy
<christophe.leroy@csgroup.eu> wrote:
>
>
>
> Le 17/05/2021 à 05:28, Jordan Niethe a écrit :
> > Add the necessary call to bpf_jit_binary_lock_ro() to remove write and
> > add exec permissions to the JIT image after it has finished being
> > written.
> >
> > Without CONFIG_STRICT_MODULE_RWX the image will be writable and
> > executable until the call to bpf_jit_binary_lock_ro().
>
> And _with_ CONFIG_STRICT_MODULE_RWX what will happen ? It will be _writable_ but not _executable_ ?
That's right.
With CONFIG_STRICT_MODULE_RWX the image will initially be PAGE_KERNEL
from bpf_jit_alloc_exec() calling module_alloc(). So not executable.
bpf_jit_binary_lock_ro() will then remove write and add executable.
Without CONFIG_STRICT_MODULE_RWX the image will initially be
PAGE_KERNEL_EXEC from module_alloc().
bpf_jit_binary_lock_ro() will remove write, but until that point it
will have been write + exec.
>
> >
> > Reviewed-by: Christophe Leroy <christophe.leroy@csgroup.eu>
> > Signed-off-by: Jordan Niethe <jniethe5@gmail.com>
> > ---
> > v10: New to series
> > v11: Remove CONFIG_STRICT_MODULE_RWX conditional
> > ---
> > arch/powerpc/net/bpf_jit_comp.c | 1 +
> > 1 file changed, 1 insertion(+)
> >
> > diff --git a/arch/powerpc/net/bpf_jit_comp.c b/arch/powerpc/net/bpf_jit_comp.c
> > index 6c8c268e4fe8..53aefee3fe70 100644
> > --- a/arch/powerpc/net/bpf_jit_comp.c
> > +++ b/arch/powerpc/net/bpf_jit_comp.c
> > @@ -237,6 +237,7 @@ struct bpf_prog *bpf_int_jit_compile(struct bpf_prog *fp)
> > fp->jited_len = alloclen;
> >
> > bpf_flush_icache(bpf_hdr, (u8 *)bpf_hdr + (bpf_hdr->pages * PAGE_SIZE));
> > + bpf_jit_binary_lock_ro(bpf_hdr);
> > if (!fp->is_func || extra_pass) {
> > bpf_prog_fill_jited_linfo(fp, addrs);
> > out_addrs:
> >
^ permalink raw reply
* Re: Linux powerpc new system call instruction and ABI
From: Nicholas Piggin @ 2021-05-20 5:12 UTC (permalink / raw)
To: Dmitry V. Levin
Cc: libc-alpha, Matheus Castanho, musl, linux-api, libc-dev,
linuxppc-dev
In-Reply-To: <20210520030611.GB27081@altlinux.org>
Excerpts from Dmitry V. Levin's message of May 20, 2021 1:06 pm:
> On Thu, May 20, 2021 at 12:40:36PM +1000, Nicholas Piggin wrote:
> [...]
>> > Looks like struct pt_regs.trap already contains the information that could
>> > be used to tell 'sc' from 'scv': if (pt_regs.trap & ~0xf) == 0x3000, then
>> > it's scv. Is my reading of arch/powerpc/include/asm/ptrace.h correct?
>>
>> Hmm, I think it is. Certainly in the kernel regs struct it is, I had in
>> my mind that we put it to 0xc00 when populating the user struct for
>> compatibility, but it seems not. So I guess this would work.
>
> OK, can we state that (pt_regs.trap & ~0xf) == 0x3000 is a part of the scv
> ABI, so it's not going to change and could be relied upon by userspace?
> Could this be documented in Documentation/powerpc/syscall64-abi.rst,
> please?
Yeah I think we can do that. The kernel doesn't care what is put in the
userspace pt_regs.trap too much so if this is your preferred approach
then I will document it in the ABI.
Thanks,
Nick
^ permalink raw reply
* Conflict between arch/powerpc/include/asm/disassemble.h and drivers/staging/rtl8723bs/include/wifi.h
From: Christophe Leroy @ 2021-05-20 5:30 UTC (permalink / raw)
To: Larry Finger, fabioaiuto83, Greg KH,
linuxppc-dev@lists.ozlabs.org, netdev@vger.kernel.org,
Hans de Goede
Hello,
I was trying to include powerpc asm/disassemble.h in some more widely used headers in order to
reduce open coding, and I'm facing the following problem:
drivers/staging/rtl8723bs/include/wifi.h:237:30: error: conflicting types for 'get_ra'
drivers/staging/rtl8723bs/include/wifi.h:237:30: error: conflicting types for 'get_ra'
make[4]: *** [scripts/Makefile.build:272: drivers/staging/rtl8723bs/core/rtw_btcoex.o] Error 1
make[4]: *** [scripts/Makefile.build:272: drivers/staging/rtl8723bs/core/rtw_ap.o] Error 1
make[3]: *** [scripts/Makefile.build:515: drivers/staging/rtl8723bs] Error 2
(More details at http://kisskb.ellerman.id.au/kisskb/head/ee2dedcaaf3fe176e68498018632767d02639d03/)
Taking into account that asm/disassemble.h has been existing since 2008 while
rtl8723bs/include/wifi.h was created in 2017, and that the get_ra() defined in the later is used at
exactly one place only, would it be possible to change it there ?
(https://elixir.bootlin.com/linux/v5.13-rc2/A/ident/get_ra)
Thanks
Christophe
^ permalink raw reply
* Re: [RFC PATCH kernel] powerpc: Fix early setup to make early_ioremap work
From: Christophe Leroy @ 2021-05-20 5:38 UTC (permalink / raw)
To: Alexey Kardashevskiy, linuxppc-dev
In-Reply-To: <74d06e55-62c3-6367-bb33-f6bbeffcac74@ozlabs.ru>
Le 20/05/2021 à 05:33, Alexey Kardashevskiy a écrit :
> Hm, my thunderbird says it is not cc:'ed but git sendmail says it did cc:
>
>
> Server: localhost
> MAIL FROM:<aik@ozlabs.ru>
> RCPT TO:<linuxppc-dev@lists.ozlabs.org>
> RCPT TO:<aik@ozlabs.ru>
> RCPT TO:<mpe@ellerman.id.au>
> RCPT TO:<christophe.leroy@csgroup.eu>
> From: Alexey Kardashevskiy <aik@ozlabs.ru>
> To: linuxppc-dev@lists.ozlabs.org
> Cc: Alexey Kardashevskiy <aik@ozlabs.ru>,
> Michael Ellerman <mpe@ellerman.id.au>,
> Christophe Leroy <christophe.leroy@csgroup.eu>
> Subject: [RFC PATCH kernel] powerpc: Fix early setup to make early_ioremap work
>
>
> Not sure what to believe.
I got the patch.
If you are looking at the mail you received from the ppc list, I think the list removes the members
of the list from the Cc: in order to avoid the mail being received multiple times.
Christophe
>
>
> On 20/05/2021 13:29, Alexey Kardashevskiy wrote:
>> The immediate problem is that after
>> 0bd3f9e953bd ("powerpc/legacy_serial: Use early_ioremap()")
>> the kernel silently reboots. The reason is that early_ioremap() returns
>> broken addresses as it uses slot_virt[] array which initialized with
>> offsets from FIXADDR_TOP == IOREMAP_END+FIXADDR_SIZE ==
>> KERN_IO_END- FIXADDR_SIZ + FIXADDR_SIZE == __kernel_io_end which is 0
>> when early_ioremap_setup() is called. __kernel_io_end is initialized
>> little bit later in early_init_mmu().
>>
>> This fixes the initialization by swapping early_ioremap_setup and
>> early_init_mmu.
>>
>> This also fixes IOREMAP_END to use FIXADDR_SIZE defined just next to it,
>> seems to make sense, unless there is some weird logic with redefining
>> FIXADDR_SIZE as the compiling goes.
>>
>> Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
>> ---
>> arch/powerpc/include/asm/book3s/64/pgtable.h | 2 +-
>> arch/powerpc/kernel/setup_64.c | 3 ++-
>> 2 files changed, 3 insertions(+), 2 deletions(-)
>>
>> diff --git a/arch/powerpc/include/asm/book3s/64/pgtable.h
>> b/arch/powerpc/include/asm/book3s/64/pgtable.h
>> index a666d561b44d..54a06129794b 100644
>> --- a/arch/powerpc/include/asm/book3s/64/pgtable.h
>> +++ b/arch/powerpc/include/asm/book3s/64/pgtable.h
>> @@ -325,8 +325,8 @@ extern unsigned long pci_io_base;
>> #define PHB_IO_END (KERN_IO_START + FULL_IO_SIZE)
>> #define IOREMAP_BASE (PHB_IO_END)
>> #define IOREMAP_START (ioremap_bot)
>> -#define IOREMAP_END (KERN_IO_END - FIXADDR_SIZE)
>> #define FIXADDR_SIZE SZ_32M
>> +#define IOREMAP_END (KERN_IO_END - FIXADDR_SIZE)
>> /* Advertise special mapping type for AGP */
>> #define HAVE_PAGE_AGP
>> diff --git a/arch/powerpc/kernel/setup_64.c b/arch/powerpc/kernel/setup_64.c
>> index b779d25761cf..ce09fe5debf4 100644
>> --- a/arch/powerpc/kernel/setup_64.c
>> +++ b/arch/powerpc/kernel/setup_64.c
>> @@ -369,11 +369,12 @@ void __init early_setup(unsigned long dt_ptr)
>> apply_feature_fixups();
>> setup_feature_keys();
>> - early_ioremap_setup();
>> /* Initialize the hash table or TLB handling */
>> early_init_mmu();
>> + early_ioremap_setup();
>> +
>> /*
>> * After firmware and early platform setup code has set things up,
>> * we note the SPR values for configurable control/performance
>>
>
^ permalink raw reply
* Re: [RFC PATCH kernel] powerpc: Fix early setup to make early_ioremap work
From: Christophe Leroy @ 2021-05-20 5:46 UTC (permalink / raw)
To: Alexey Kardashevskiy, linuxppc-dev; +Cc: Chris Packham
In-Reply-To: <20210520032919.358935-1-aik@ozlabs.ru>
Le 20/05/2021 à 05:29, Alexey Kardashevskiy a écrit :
> The immediate problem is that after
> 0bd3f9e953bd ("powerpc/legacy_serial: Use early_ioremap()")
> the kernel silently reboots. The reason is that early_ioremap() returns
> broken addresses as it uses slot_virt[] array which initialized with
> offsets from FIXADDR_TOP == IOREMAP_END+FIXADDR_SIZE ==
> KERN_IO_END- FIXADDR_SIZ + FIXADDR_SIZE == __kernel_io_end which is 0
> when early_ioremap_setup() is called. __kernel_io_end is initialized
> little bit later in early_init_mmu().
>
> This fixes the initialization by swapping early_ioremap_setup and
> early_init_mmu.
Hum ... Chris tested it on a T2080RDB, that must be a book3e.
So we missed it. I guess your fix is right.
>
> This also fixes IOREMAP_END to use FIXADDR_SIZE defined just next to it,
> seems to make sense, unless there is some weird logic with redefining
> FIXADDR_SIZE as the compiling goes.
Well, I don't think the order of defines matters, the change should be kept out of the fix.
But if you want it anyway, then I'd suggest to move it before IOREMAP_BASE in order to keep the 3
IOREMAP_xxx together.
>
> Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
Reviewed-by: Christophe Leroy <christophe.leroy@csgroup.eu>
> ---
> arch/powerpc/include/asm/book3s/64/pgtable.h | 2 +-
> arch/powerpc/kernel/setup_64.c | 3 ++-
> 2 files changed, 3 insertions(+), 2 deletions(-)
>
> diff --git a/arch/powerpc/include/asm/book3s/64/pgtable.h b/arch/powerpc/include/asm/book3s/64/pgtable.h
> index a666d561b44d..54a06129794b 100644
> --- a/arch/powerpc/include/asm/book3s/64/pgtable.h
> +++ b/arch/powerpc/include/asm/book3s/64/pgtable.h
> @@ -325,8 +325,8 @@ extern unsigned long pci_io_base;
> #define PHB_IO_END (KERN_IO_START + FULL_IO_SIZE)
> #define IOREMAP_BASE (PHB_IO_END)
> #define IOREMAP_START (ioremap_bot)
> -#define IOREMAP_END (KERN_IO_END - FIXADDR_SIZE)
> #define FIXADDR_SIZE SZ_32M
> +#define IOREMAP_END (KERN_IO_END - FIXADDR_SIZE)
>
> /* Advertise special mapping type for AGP */
> #define HAVE_PAGE_AGP
> diff --git a/arch/powerpc/kernel/setup_64.c b/arch/powerpc/kernel/setup_64.c
> index b779d25761cf..ce09fe5debf4 100644
> --- a/arch/powerpc/kernel/setup_64.c
> +++ b/arch/powerpc/kernel/setup_64.c
> @@ -369,11 +369,12 @@ void __init early_setup(unsigned long dt_ptr)
> apply_feature_fixups();
> setup_feature_keys();
>
> - early_ioremap_setup();
>
> /* Initialize the hash table or TLB handling */
> early_init_mmu();
>
> + early_ioremap_setup();
> +
> /*
> * After firmware and early platform setup code has set things up,
> * we note the SPR values for configurable control/performance
>
^ permalink raw reply
* Re: Conflict between arch/powerpc/include/asm/disassemble.h and drivers/staging/rtl8723bs/include/wifi.h
From: Greg KH @ 2021-05-20 5:47 UTC (permalink / raw)
To: Christophe Leroy
Cc: netdev@vger.kernel.org, Hans de Goede, fabioaiuto83,
linuxppc-dev@lists.ozlabs.org, Larry Finger
In-Reply-To: <6954e633-3908-d175-3030-3e913980af78@csgroup.eu>
On Thu, May 20, 2021 at 07:30:49AM +0200, Christophe Leroy wrote:
> Hello,
>
> I was trying to include powerpc asm/disassemble.h in some more widely used
> headers in order to reduce open coding, and I'm facing the following
> problem:
>
> drivers/staging/rtl8723bs/include/wifi.h:237:30: error: conflicting types for 'get_ra'
> drivers/staging/rtl8723bs/include/wifi.h:237:30: error: conflicting types for 'get_ra'
> make[4]: *** [scripts/Makefile.build:272: drivers/staging/rtl8723bs/core/rtw_btcoex.o] Error 1
> make[4]: *** [scripts/Makefile.build:272: drivers/staging/rtl8723bs/core/rtw_ap.o] Error 1
> make[3]: *** [scripts/Makefile.build:515: drivers/staging/rtl8723bs] Error 2
>
> (More details at http://kisskb.ellerman.id.au/kisskb/head/ee2dedcaaf3fe176e68498018632767d02639d03/)
>
> Taking into account that asm/disassemble.h has been existing since 2008
> while rtl8723bs/include/wifi.h was created in 2017, and that the get_ra()
> defined in the later is used at exactly one place only, would it be possible
> to change it there ?
> (https://elixir.bootlin.com/linux/v5.13-rc2/A/ident/get_ra)
Yes, the staging code can change, I'll make a patch for it after
coffee...
^ permalink raw reply
* Re: [RFC PATCH kernel] powerpc: Fix early setup to make early_ioremap work
From: Alexey Kardashevskiy @ 2021-05-20 5:52 UTC (permalink / raw)
To: Christophe Leroy, linuxppc-dev; +Cc: Chris Packham
In-Reply-To: <467a5a5f-7fab-b6b1-e81f-85518378f4b8@csgroup.eu>
On 20/05/2021 15:46, Christophe Leroy wrote:
>
>
> Le 20/05/2021 à 05:29, Alexey Kardashevskiy a écrit :
>> The immediate problem is that after
>> 0bd3f9e953bd ("powerpc/legacy_serial: Use early_ioremap()")
>> the kernel silently reboots. The reason is that early_ioremap() returns
>> broken addresses as it uses slot_virt[] array which initialized with
>> offsets from FIXADDR_TOP == IOREMAP_END+FIXADDR_SIZE ==
>> KERN_IO_END- FIXADDR_SIZ + FIXADDR_SIZE == __kernel_io_end which is 0
>> when early_ioremap_setup() is called. __kernel_io_end is initialized
>> little bit later in early_init_mmu().
>>
>> This fixes the initialization by swapping early_ioremap_setup and
>> early_init_mmu.
>
> Hum ... Chris tested it on a T2080RDB, that must be a book3e.
>
> So we missed it. I guess your fix is right.
Oh cool.
>>
>> This also fixes IOREMAP_END to use FIXADDR_SIZE defined just next to it,
>> seems to make sense, unless there is some weird logic with redefining
>> FIXADDR_SIZE as the compiling goes.
>
> Well, I don't think the order of defines matters, the change should be
> kept out of the fix.
When I see this:
#define IOREMAP_END (KERN_IO_END - FIXADDR_SIZE)
#define FIXADDR_SIZE SZ_32M
... I have to think harder what FIXADDR_SIZE was in the first macro and
in what order the preprocessor expands them.
> But if you want it anyway, then I'd suggest to move it before
> IOREMAP_BASE in order to keep the 3 IOREMAP_xxx together.
Up to Michael, I guess.
>
>>
>> Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
>
> Reviewed-by: Christophe Leroy <christophe.leroy@csgroup.eu>
>
>> ---
>> arch/powerpc/include/asm/book3s/64/pgtable.h | 2 +-
>> arch/powerpc/kernel/setup_64.c | 3 ++-
>> 2 files changed, 3 insertions(+), 2 deletions(-)
>>
>> diff --git a/arch/powerpc/include/asm/book3s/64/pgtable.h
>> b/arch/powerpc/include/asm/book3s/64/pgtable.h
>> index a666d561b44d..54a06129794b 100644
>> --- a/arch/powerpc/include/asm/book3s/64/pgtable.h
>> +++ b/arch/powerpc/include/asm/book3s/64/pgtable.h
>> @@ -325,8 +325,8 @@ extern unsigned long pci_io_base;
>> #define PHB_IO_END (KERN_IO_START + FULL_IO_SIZE)
>> #define IOREMAP_BASE (PHB_IO_END)
>> #define IOREMAP_START (ioremap_bot)
>> -#define IOREMAP_END (KERN_IO_END - FIXADDR_SIZE)
>> #define FIXADDR_SIZE SZ_32M
>> +#define IOREMAP_END (KERN_IO_END - FIXADDR_SIZE)
>> /* Advertise special mapping type for AGP */
>> #define HAVE_PAGE_AGP
>> diff --git a/arch/powerpc/kernel/setup_64.c
>> b/arch/powerpc/kernel/setup_64.c
>> index b779d25761cf..ce09fe5debf4 100644
>> --- a/arch/powerpc/kernel/setup_64.c
>> +++ b/arch/powerpc/kernel/setup_64.c
>> @@ -369,11 +369,12 @@ void __init early_setup(unsigned long dt_ptr)
>> apply_feature_fixups();
>> setup_feature_keys();
>> - early_ioremap_setup();
>> /* Initialize the hash table or TLB handling */
>> early_init_mmu();
>> + early_ioremap_setup();
>> +
>> /*
>> * After firmware and early platform setup code has set things up,
>> * we note the SPR values for configurable control/performance
>>
--
Alexey
^ permalink raw reply
* Re: [RFC PATCH kernel] powerpc: Fix early setup to make early_ioremap work
From: Christophe Leroy @ 2021-05-20 6:03 UTC (permalink / raw)
To: Alexey Kardashevskiy, linuxppc-dev; +Cc: Chris Packham
In-Reply-To: <db846a8e-bc75-244f-5e4a-513e762a875f@ozlabs.ru>
Le 20/05/2021 à 07:52, Alexey Kardashevskiy a écrit :
>
>
> On 20/05/2021 15:46, Christophe Leroy wrote:
>>
>>
>> Le 20/05/2021 à 05:29, Alexey Kardashevskiy a écrit :
>>> The immediate problem is that after
>>> 0bd3f9e953bd ("powerpc/legacy_serial: Use early_ioremap()")
>>> the kernel silently reboots. The reason is that early_ioremap() returns
>>> broken addresses as it uses slot_virt[] array which initialized with
>>> offsets from FIXADDR_TOP == IOREMAP_END+FIXADDR_SIZE ==
>>> KERN_IO_END- FIXADDR_SIZ + FIXADDR_SIZE == __kernel_io_end which is 0
>>> when early_ioremap_setup() is called. __kernel_io_end is initialized
>>> little bit later in early_init_mmu().
>>>
>>> This fixes the initialization by swapping early_ioremap_setup and
>>> early_init_mmu.
>>
>> Hum ... Chris tested it on a T2080RDB, that must be a book3e.
>>
>> So we missed it. I guess your fix is right.
>
>
> Oh cool.
I forgot, your patch should include Fixes: tags.
Fixes: 265c3491c4bc ("powerpc: Add support for GENERIC_EARLY_IOREMAP")
If you still change the FIXADDR_SIZE, then it must also have:
Fixes: 9ccba66d4d2a ("powerpc/64: Fix the definition of the fixmap area")
>
>>>
>>> This also fixes IOREMAP_END to use FIXADDR_SIZE defined just next to it,
>>> seems to make sense, unless there is some weird logic with redefining
>>> FIXADDR_SIZE as the compiling goes.
>>
>> Well, I don't think the order of defines matters, the change should be kept out of the fix.
>
> When I see this:
>
> #define IOREMAP_END (KERN_IO_END - FIXADDR_SIZE)
> #define FIXADDR_SIZE SZ_32M
>
>
> ... I have to think harder what FIXADDR_SIZE was in the first macro and in what order the
> preprocessor expands them.
>
>
>> But if you want it anyway, then I'd suggest to move it before IOREMAP_BASE in order to keep the 3
>> IOREMAP_xxx together.
>
> Up to Michael, I guess.
>
>
>>
>>>
>>> Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
>>
>> Reviewed-by: Christophe Leroy <christophe.leroy@csgroup.eu>
>>
>>> ---
>>> arch/powerpc/include/asm/book3s/64/pgtable.h | 2 +-
>>> arch/powerpc/kernel/setup_64.c | 3 ++-
>>> 2 files changed, 3 insertions(+), 2 deletions(-)
>>>
>>> diff --git a/arch/powerpc/include/asm/book3s/64/pgtable.h
>>> b/arch/powerpc/include/asm/book3s/64/pgtable.h
>>> index a666d561b44d..54a06129794b 100644
>>> --- a/arch/powerpc/include/asm/book3s/64/pgtable.h
>>> +++ b/arch/powerpc/include/asm/book3s/64/pgtable.h
>>> @@ -325,8 +325,8 @@ extern unsigned long pci_io_base;
>>> #define PHB_IO_END (KERN_IO_START + FULL_IO_SIZE)
>>> #define IOREMAP_BASE (PHB_IO_END)
>>> #define IOREMAP_START (ioremap_bot)
>>> -#define IOREMAP_END (KERN_IO_END - FIXADDR_SIZE)
>>> #define FIXADDR_SIZE SZ_32M
>>> +#define IOREMAP_END (KERN_IO_END - FIXADDR_SIZE)
>>> /* Advertise special mapping type for AGP */
>>> #define HAVE_PAGE_AGP
>>> diff --git a/arch/powerpc/kernel/setup_64.c b/arch/powerpc/kernel/setup_64.c
>>> index b779d25761cf..ce09fe5debf4 100644
>>> --- a/arch/powerpc/kernel/setup_64.c
>>> +++ b/arch/powerpc/kernel/setup_64.c
>>> @@ -369,11 +369,12 @@ void __init early_setup(unsigned long dt_ptr)
>>> apply_feature_fixups();
>>> setup_feature_keys();
>>> - early_ioremap_setup();
>>> /* Initialize the hash table or TLB handling */
>>> early_init_mmu();
>>> + early_ioremap_setup();
>>> +
>>> /*
>>> * After firmware and early platform setup code has set things up,
>>> * we note the SPR values for configurable control/performance
>>>
>
^ permalink raw reply
* Re: [PATCH v7 01/15] swiotlb: Refactor swiotlb init functions
From: Claire Chang @ 2021-05-20 6:40 UTC (permalink / raw)
To: Florian Fainelli
Cc: heikki.krogerus, thomas.hellstrom, peterz, joonas.lahtinen,
dri-devel, chris, grant.likely, paulus, Frank Rowand, mingo,
Marek Szyprowski, sstabellini, Saravana Kannan, Joerg Roedel,
Rafael J . Wysocki, Christoph Hellwig, Bartosz Golaszewski,
bskeggs, linux-pci, xen-devel, Thierry Reding, intel-gfx,
matthew.auld, linux-devicetree, Jianxiong Gao, Daniel Vetter,
Will Deacon, Konrad Rzeszutek Wilk, maarten.lankhorst, airlied,
Dan Williams, linuxppc-dev, jani.nikula, Rob Herring,
rodrigo.vivi, Bjorn Helgaas, boris.ostrovsky, Andy Shevchenko,
jgross, Nicolas Boichat, Greg KH, Randy Dunlap, lkml, Tomasz Figa,
list@263.net:IOMMU DRIVERS, Jim Quinlan, xypron.glpk,
Robin Murphy, bauerman
In-Reply-To: <170a54f2-be20-ec29-1d7f-3388e5f928c6@gmail.com>
On Thu, May 20, 2021 at 2:50 AM Florian Fainelli <f.fainelli@gmail.com> wrote:
>
>
>
> On 5/17/2021 11:42 PM, Claire Chang wrote:
> > Add a new function, swiotlb_init_io_tlb_mem, for the io_tlb_mem struct
> > initialization to make the code reusable.
> >
> > Note that we now also call set_memory_decrypted in swiotlb_init_with_tbl.
> >
> > Signed-off-by: Claire Chang <tientzu@chromium.org>
> > ---
> > kernel/dma/swiotlb.c | 51 ++++++++++++++++++++++----------------------
> > 1 file changed, 25 insertions(+), 26 deletions(-)
> >
> > diff --git a/kernel/dma/swiotlb.c b/kernel/dma/swiotlb.c
> > index 8ca7d505d61c..d3232fc19385 100644
> > --- a/kernel/dma/swiotlb.c
> > +++ b/kernel/dma/swiotlb.c
> > @@ -168,9 +168,30 @@ void __init swiotlb_update_mem_attributes(void)
> > memset(vaddr, 0, bytes);
> > }
> >
> > -int __init swiotlb_init_with_tbl(char *tlb, unsigned long nslabs, int verbose)
> > +static void swiotlb_init_io_tlb_mem(struct io_tlb_mem *mem, phys_addr_t start,
> > + unsigned long nslabs, bool late_alloc)
> > {
> > + void *vaddr = phys_to_virt(start);
> > unsigned long bytes = nslabs << IO_TLB_SHIFT, i;
> > +
> > + mem->nslabs = nslabs;
> > + mem->start = start;
> > + mem->end = mem->start + bytes;
> > + mem->index = 0;
> > + mem->late_alloc = late_alloc;
> > + spin_lock_init(&mem->lock);
> > + for (i = 0; i < mem->nslabs; i++) {
> > + mem->slots[i].list = IO_TLB_SEGSIZE - io_tlb_offset(i);
> > + mem->slots[i].orig_addr = INVALID_PHYS_ADDR;
> > + mem->slots[i].alloc_size = 0;
> > + }
> > +
> > + set_memory_decrypted((unsigned long)vaddr, bytes >> PAGE_SHIFT);
> > + memset(vaddr, 0, bytes);
>
> You are doing an unconditional set_memory_decrypted() followed by a
> memset here, and then:
>
> > +}
> > +
> > +int __init swiotlb_init_with_tbl(char *tlb, unsigned long nslabs, int verbose)
> > +{
> > struct io_tlb_mem *mem;
> > size_t alloc_size;
> >
> > @@ -186,16 +207,8 @@ int __init swiotlb_init_with_tbl(char *tlb, unsigned long nslabs, int verbose)
> > if (!mem)
> > panic("%s: Failed to allocate %zu bytes align=0x%lx\n",
> > __func__, alloc_size, PAGE_SIZE);
> > - mem->nslabs = nslabs;
> > - mem->start = __pa(tlb);
> > - mem->end = mem->start + bytes;
> > - mem->index = 0;
> > - spin_lock_init(&mem->lock);
> > - for (i = 0; i < mem->nslabs; i++) {
> > - mem->slots[i].list = IO_TLB_SEGSIZE - io_tlb_offset(i);
> > - mem->slots[i].orig_addr = INVALID_PHYS_ADDR;
> > - mem->slots[i].alloc_size = 0;
> > - }
> > +
> > + swiotlb_init_io_tlb_mem(mem, __pa(tlb), nslabs, false);
>
> You convert this call site with swiotlb_init_io_tlb_mem() which did not
> do the set_memory_decrypted()+memset(). Is this okay or should
> swiotlb_init_io_tlb_mem() add an additional argument to do this
> conditionally?
I'm actually not sure if this it okay. If not, will add an additional
argument for it.
> --
> Florian
^ permalink raw reply
* Re: [PATCH v7 04/15] swiotlb: Add restricted DMA pool initialization
From: Claire Chang @ 2021-05-20 6:39 UTC (permalink / raw)
To: Florian Fainelli
Cc: heikki.krogerus, thomas.hellstrom, peterz, joonas.lahtinen,
dri-devel, chris, grant.likely, paulus, Frank Rowand, mingo,
Marek Szyprowski, sstabellini, Saravana Kannan, Joerg Roedel,
Rafael J . Wysocki, Christoph Hellwig, Bartosz Golaszewski,
bskeggs, linux-pci, xen-devel, Thierry Reding, intel-gfx,
matthew.auld, linux-devicetree, Jianxiong Gao, Daniel Vetter,
Will Deacon, Konrad Rzeszutek Wilk, maarten.lankhorst, airlied,
Dan Williams, linuxppc-dev, jani.nikula, Rob Herring,
rodrigo.vivi, Bjorn Helgaas, boris.ostrovsky, Andy Shevchenko,
jgross, Nicolas Boichat, Greg KH, Randy Dunlap, lkml, Tomasz Figa,
list@263.net:IOMMU DRIVERS, Jim Quinlan, xypron.glpk,
Robin Murphy, bauerman
In-Reply-To: <ae050c36-8179-e465-84f0-e46c361bd71e@gmail.com>
On Thu, May 20, 2021 at 2:54 AM Florian Fainelli <f.fainelli@gmail.com> wrote:
>
>
>
> On 5/17/2021 11:42 PM, Claire Chang wrote:
> > Add the initialization function to create restricted DMA pools from
> > matching reserved-memory nodes.
> >
> > Signed-off-by: Claire Chang <tientzu@chromium.org>
> > ---
> > include/linux/device.h | 4 +++
> > include/linux/swiotlb.h | 3 +-
> > kernel/dma/swiotlb.c | 76 +++++++++++++++++++++++++++++++++++++++++
> > 3 files changed, 82 insertions(+), 1 deletion(-)
> >
> > diff --git a/include/linux/device.h b/include/linux/device.h
> > index 38a2071cf776..4987608ea4ff 100644
> > --- a/include/linux/device.h
> > +++ b/include/linux/device.h
> > @@ -416,6 +416,7 @@ struct dev_links_info {
> > * @dma_pools: Dma pools (if dma'ble device).
> > * @dma_mem: Internal for coherent mem override.
> > * @cma_area: Contiguous memory area for dma allocations
> > + * @dma_io_tlb_mem: Internal for swiotlb io_tlb_mem override.
> > * @archdata: For arch-specific additions.
> > * @of_node: Associated device tree node.
> > * @fwnode: Associated device node supplied by platform firmware.
> > @@ -521,6 +522,9 @@ struct device {
> > #ifdef CONFIG_DMA_CMA
> > struct cma *cma_area; /* contiguous memory area for dma
> > allocations */
> > +#endif
> > +#ifdef CONFIG_DMA_RESTRICTED_POOL
> > + struct io_tlb_mem *dma_io_tlb_mem;
> > #endif
> > /* arch specific additions */
> > struct dev_archdata archdata;
> > diff --git a/include/linux/swiotlb.h b/include/linux/swiotlb.h
> > index 216854a5e513..03ad6e3b4056 100644
> > --- a/include/linux/swiotlb.h
> > +++ b/include/linux/swiotlb.h
> > @@ -72,7 +72,8 @@ extern enum swiotlb_force swiotlb_force;
> > * range check to see if the memory was in fact allocated by this
> > * API.
> > * @nslabs: The number of IO TLB blocks (in groups of 64) between @start and
> > - * @end. This is command line adjustable via setup_io_tlb_npages.
> > + * @end. For default swiotlb, this is command line adjustable via
> > + * setup_io_tlb_npages.
> > * @used: The number of used IO TLB block.
> > * @list: The free list describing the number of free entries available
> > * from each index.
> > diff --git a/kernel/dma/swiotlb.c b/kernel/dma/swiotlb.c
> > index b849b01a446f..1d8eb4de0d01 100644
> > --- a/kernel/dma/swiotlb.c
> > +++ b/kernel/dma/swiotlb.c
> > @@ -39,6 +39,13 @@
> > #ifdef CONFIG_DEBUG_FS
> > #include <linux/debugfs.h>
> > #endif
> > +#ifdef CONFIG_DMA_RESTRICTED_POOL
> > +#include <linux/io.h>
> > +#include <linux/of.h>
> > +#include <linux/of_fdt.h>
> > +#include <linux/of_reserved_mem.h>
> > +#include <linux/slab.h>
> > +#endif
> >
> > #include <asm/io.h>
> > #include <asm/dma.h>
> > @@ -690,3 +697,72 @@ static int __init swiotlb_create_default_debugfs(void)
> > late_initcall(swiotlb_create_default_debugfs);
> >
> > #endif
> > +
> > +#ifdef CONFIG_DMA_RESTRICTED_POOL
> > +static int rmem_swiotlb_device_init(struct reserved_mem *rmem,
> > + struct device *dev)
> > +{
> > + struct io_tlb_mem *mem = rmem->priv;
> > + unsigned long nslabs = rmem->size >> IO_TLB_SHIFT;
> > +
> > + if (dev->dma_io_tlb_mem)
> > + return 0;
> > +
> > + /*
> > + * Since multiple devices can share the same pool, the private data,
> > + * io_tlb_mem struct, will be initialized by the first device attached
> > + * to it.
> > + */
> > + if (!mem) {
> > + mem = kzalloc(struct_size(mem, slots, nslabs), GFP_KERNEL);
> > + if (!mem)
> > + return -ENOMEM;
> > +
> > + if (PageHighMem(pfn_to_page(PHYS_PFN(rmem->base)))) {
> > + kfree(mem);
> > + return -EINVAL;
>
> This could probably deserve a warning here to indicate that the reserved
> area must be accessible within the linear mapping as I would expect a
> lot of people to trip over that.
Ok. Will add it.
>
> Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
> --
> Florian
^ permalink raw reply
* [PATCH v2 net-next resend] ibmvnic: remove default label from to_string switch
From: Michal Suchanek @ 2021-05-20 6:50 UTC (permalink / raw)
To: netdev
Cc: Sukadev Bhattiprolu, Lijun Pan, linux-kernel, Thomas Falcon,
Paul Mackerras, Dany Madden, Jakub Kicinski, Michal Suchanek,
linuxppc-dev, David S. Miller
This way the compiler warns when a new value is added to the enum but
not to the string translation like:
drivers/net/ethernet/ibm/ibmvnic.c: In function 'adapter_state_to_string':
drivers/net/ethernet/ibm/ibmvnic.c:832:2: warning: enumeration value 'VNIC_FOOBAR' not handled in switch [-Wswitch]
switch (state) {
^~~~~~
drivers/net/ethernet/ibm/ibmvnic.c: In function 'reset_reason_to_string':
drivers/net/ethernet/ibm/ibmvnic.c:1935:2: warning: enumeration value 'VNIC_RESET_FOOBAR' not handled in switch [-Wswitch]
switch (reason) {
^~~~~~
Signed-off-by: Michal Suchanek <msuchanek@suse.de>
Acked-by: Lijun Pan <lijunp213@gmail.com>
Link: https://lore.kernel.org/netdev/CAOhMmr701LecfuNM+EozqbiTxFvDiXjFdY2aYeKJYaXq9kqVDg@mail.gmail.com/
---
v2: Fix typo in commit message
---
drivers/net/ethernet/ibm/ibmvnic.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/drivers/net/ethernet/ibm/ibmvnic.c b/drivers/net/ethernet/ibm/ibmvnic.c
index 5788bb956d73..4d439413f6d9 100644
--- a/drivers/net/ethernet/ibm/ibmvnic.c
+++ b/drivers/net/ethernet/ibm/ibmvnic.c
@@ -846,9 +846,8 @@ static const char *adapter_state_to_string(enum vnic_state state)
return "REMOVING";
case VNIC_REMOVED:
return "REMOVED";
- default:
- return "UNKNOWN";
}
+ return "UNKNOWN";
}
static int ibmvnic_login(struct net_device *netdev)
@@ -1946,9 +1945,8 @@ static const char *reset_reason_to_string(enum ibmvnic_reset_reason reason)
return "TIMEOUT";
case VNIC_RESET_CHANGE_PARAM:
return "CHANGE_PARAM";
- default:
- return "UNKNOWN";
}
+ return "UNKNOWN";
}
/*
--
2.26.2
^ permalink raw reply related
* Re: Linux powerpc new system call instruction and ABI
From: Nicholas Piggin @ 2021-05-20 7:20 UTC (permalink / raw)
To: Dmitry V. Levin; +Cc: Rich Felker, musl, linux-api, linuxppc-dev
In-Reply-To: <20210520025948.GA27081@altlinux.org>
Excerpts from Dmitry V. Levin's message of May 20, 2021 12:59 pm:
> On Thu, May 20, 2021 at 12:45:57PM +1000, Nicholas Piggin wrote:
>> Excerpts from Dmitry V. Levin's message of May 20, 2021 11:06 am:
>> > On Wed, May 19, 2021 at 07:48:47PM -0400, Rich Felker wrote:
>> >> On Wed, May 19, 2021 at 06:09:25PM +0000, Joakim Tjernlund wrote:
>> > [...]
>> >> > W.r.t breaking ABI, isn't that what PowerPC is trying to do with the new syscall I/F?
>> >>
>> >> No, it's a new independent interface.
>> >
>> > Unfortunately, being a new independent interface doesn't mean it isn't
>> > an ABI break. In fact, it was a severe ABI break, and this thread is
>> > an attempt to find a hotfix.
>>
>> It is an ABI break, that was known. The ptrace info stuff I fixed with
>> the patch earlier was obviously a bug in my initial implementation and
>> not intended (sorry my ptrace testing was not sufficient, and thanks for
>> reporting it, by the way).
>
> Could you check whether tools/testing/selftests/ptrace/get_syscall_info.c
> passes again with your fix, please?
It does.
Thanks,
Nick
> If yes, then PTRACE_GET_SYSCALL_INFO is fixed.
>
> By the way, kernel tracing and audit subsystems also use those functions
> from asm/syscall.h and asm/ptrace.h, so your ptrace fix is likely to fix
> these subsystems as well.
^ permalink raw reply
* [PATCH] powerpc/kprobes: Pass ppc_inst as a pointer to emulate_step() on ppc32
From: Naveen N. Rao @ 2021-05-20 7:29 UTC (permalink / raw)
To: Michael Ellerman, Christophe Leroy; +Cc: linuxppc-dev
Trying to use a kprobe on ppc32 results in the below splat:
BUG: Unable to handle kernel data access on read at 0x7c0802a6
Faulting instruction address: 0xc002e9f0
Oops: Kernel access of bad area, sig: 11 [#1]
BE PAGE_SIZE=4K PowerPC 44x Platform
Modules linked in:
CPU: 0 PID: 89 Comm: sh Not tainted 5.13.0-rc1-01824-g3a81c0495fdb #7
NIP: c002e9f0 LR: c0011858 CTR: 00008a47
REGS: c292fd50 TRAP: 0300 Not tainted (5.13.0-rc1-01824-g3a81c0495fdb)
MSR: 00009000 <EE,ME> CR: 24002002 XER: 20000000
DEAR: 7c0802a6 ESR: 00000000
<snip>
NIP [c002e9f0] emulate_step+0x28/0x324
LR [c0011858] optinsn_slot+0x128/0x10000
Call Trace:
opt_pre_handler+0x7c/0xb4 (unreliable)
optinsn_slot+0x128/0x10000
ret_from_syscall+0x0/0x28
The offending instruction is:
81 24 00 00 lwz r9,0(r4)
Here, we are trying to load the second argument to emulate_step():
struct ppc_inst, which is the instruction to be emulated. On ppc64,
structures are passed in registers when passed by value. However, per
the ppc32 ABI, structures are always passed to functions as pointers.
This isn't being adhered to when setting up the call to emulate_step()
in the optprobe trampoline. Fix the same.
Fixes: eacf4c0202654a ("powerpc: Enable OPTPROBES on PPC32")
Signed-off-by: Naveen N. Rao <naveen.n.rao@linux.vnet.ibm.com>
---
arch/powerpc/kernel/optprobes.c | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/arch/powerpc/kernel/optprobes.c b/arch/powerpc/kernel/optprobes.c
index cdf87086fa33a0..2bc53fa48a1b33 100644
--- a/arch/powerpc/kernel/optprobes.c
+++ b/arch/powerpc/kernel/optprobes.c
@@ -281,8 +281,12 @@ int arch_prepare_optimized_kprobe(struct optimized_kprobe *op, struct kprobe *p)
/*
* 3. load instruction to be emulated into relevant register, and
*/
- temp = ppc_inst_read((struct ppc_inst *)p->ainsn.insn);
- patch_imm_load_insns(ppc_inst_as_ulong(temp), 4, buff + TMPL_INSN_IDX);
+ if (IS_ENABLED(CONFIG_PPC64)) {
+ temp = ppc_inst_read((struct ppc_inst *)p->ainsn.insn);
+ patch_imm_load_insns(ppc_inst_as_ulong(temp), 4, buff + TMPL_INSN_IDX);
+ } else {
+ patch_imm_load_insns((unsigned long)p->ainsn.insn, 4, buff + TMPL_INSN_IDX);
+ }
/*
* 4. branch back from trampoline
base-commit: 3a81c0495fdb91fd9a9b4f617098c283131eeae1
--
2.30.2
^ permalink raw reply related
* Re: [PATCH v5 5/9] powerpc/mm/book3s64: Update tlb flush routines to take a page walk cache flush argument
From: Michael Ellerman @ 2021-05-20 7:37 UTC (permalink / raw)
To: Segher Boessenkool
Cc: Aneesh Kumar K.V, npiggin, linux-mm, kaleshsingh, joel, akpm,
linuxppc-dev, Guenter Roeck
In-Reply-To: <20210519120306.GD10366@gate.crashing.org>
Segher Boessenkool <segher@kernel.crashing.org> writes:
> On Tue, May 18, 2021 at 07:45:14PM -0500, Segher Boessenkool wrote:
>> On Wed, May 19, 2021 at 10:26:22AM +1000, Michael Ellerman wrote:
>> > Guenter Roeck <linux@roeck-us.net> writes:
>> > > Ah, sorry. I wasn't aware that the following is valid C code
>> > >
>> > > void f1()
>> > > {
>> > > return f2();
>> > > ^^^^^^
>> > > }
>> > >
>> > > as long as f2() is void as well. Confusing, but we live and learn.
>> >
>> > It might be valid, but it's still bad IMHO.
>> >
>> > It's confusing to readers, and serves no useful purpose.
>>
>> And it actually explicitly is undefined behaviour in C90 already
>> (3.6.6.4 in C90, 6.8.6.4 in C99 and later).
We use gnu89, which presumably does not make it UB.
> ... but there is a GCC extension that allows this by default:
> <https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html#index-Wreturn-type>
> For C only, warn about a 'return' statement with an expression in a
> function whose return type is 'void', unless the expression type is
> also 'void'. As a GNU extension, the latter case is accepted
> without a warning unless '-Wpedantic' is used.
There's no chance we'll ever enable -Wpedantic, so I guess it's allowed
for practical purposes. I guess clang must accept it too or we'd be
seeing warnings from it.
cheers
^ permalink raw reply
* Re: [PATCH v4 1/3] audit: replace magic audit syscall class numbers with macros
From: Christian Brauner @ 2021-05-20 7:50 UTC (permalink / raw)
To: Richard Guy Briggs
Cc: linux-s390, linux-ia64, Paul Moore, linux-parisc, Arnd Bergmann,
x86, LKML, Eric Paris, sparclinux, Aleksa Sarai,
Linux-Audit Mailing List, Alexander Viro, linux-alpha,
linux-fsdevel, Eric Paris, Steve Grubb, linuxppc-dev
In-Reply-To: <2300b1083a32aade7ae7efb95826e8f3f260b1df.1621363275.git.rgb@redhat.com>
On Wed, May 19, 2021 at 04:00:20PM -0400, Richard Guy Briggs wrote:
> Replace audit syscall class magic numbers with macros.
>
> This required putting the macros into new header file
> include/linux/auditsc_classmacros.h since the syscall macros were
> included for both 64 bit and 32 bit in any compat code, causing
> redefinition warnings.
>
> Signed-off-by: Richard Guy Briggs <rgb@redhat.com>
> Link: https://lore.kernel.org/r/2300b1083a32aade7ae7efb95826e8f3f260b1df.1621363275.git.rgb@redhat.com
Looks good.
Acked-by: Christian Brauner <christian.brauner@ubuntu.com>
Fwiw, I would explicitly number all enum values in auditsc_class_t not
just the first one.
> ---
> MAINTAINERS | 1 +
> arch/alpha/kernel/audit.c | 8 ++++----
> arch/ia64/kernel/audit.c | 8 ++++----
> arch/parisc/kernel/audit.c | 8 ++++----
> arch/parisc/kernel/compat_audit.c | 9 +++++----
> arch/powerpc/kernel/audit.c | 10 +++++-----
> arch/powerpc/kernel/compat_audit.c | 11 ++++++-----
> arch/s390/kernel/audit.c | 10 +++++-----
> arch/s390/kernel/compat_audit.c | 11 ++++++-----
> arch/sparc/kernel/audit.c | 10 +++++-----
> arch/sparc/kernel/compat_audit.c | 11 ++++++-----
> arch/x86/ia32/audit.c | 11 ++++++-----
> arch/x86/kernel/audit_64.c | 8 ++++----
> include/linux/audit.h | 1 +
> include/linux/auditsc_classmacros.h | 23 +++++++++++++++++++++++
> kernel/auditsc.c | 12 ++++++------
> lib/audit.c | 10 +++++-----
> lib/compat_audit.c | 11 ++++++-----
> 18 files changed, 102 insertions(+), 71 deletions(-)
> create mode 100644 include/linux/auditsc_classmacros.h
>
> diff --git a/MAINTAINERS b/MAINTAINERS
> index bd7aff0c120f..3348d12019f9 100644
> --- a/MAINTAINERS
> +++ b/MAINTAINERS
> @@ -3036,6 +3036,7 @@ W: https://github.com/linux-audit
> T: git git://git.kernel.org/pub/scm/linux/kernel/git/pcmoore/audit.git
> F: include/asm-generic/audit_*.h
> F: include/linux/audit.h
> +F: include/linux/auditsc_classmacros.h
> F: include/uapi/linux/audit.h
> F: kernel/audit*
> F: lib/*audit.c
> diff --git a/arch/alpha/kernel/audit.c b/arch/alpha/kernel/audit.c
> index 96a9d18ff4c4..81cbd804e375 100644
> --- a/arch/alpha/kernel/audit.c
> +++ b/arch/alpha/kernel/audit.c
> @@ -37,13 +37,13 @@ int audit_classify_syscall(int abi, unsigned syscall)
> {
> switch(syscall) {
> case __NR_open:
> - return 2;
> + return AUDITSC_OPEN;
> case __NR_openat:
> - return 3;
> + return AUDITSC_OPENAT;
> case __NR_execve:
> - return 5;
> + return AUDITSC_EXECVE;
> default:
> - return 0;
> + return AUDITSC_NATIVE;
> }
> }
>
> diff --git a/arch/ia64/kernel/audit.c b/arch/ia64/kernel/audit.c
> index 5192ca899fe6..dba6a74c9ab3 100644
> --- a/arch/ia64/kernel/audit.c
> +++ b/arch/ia64/kernel/audit.c
> @@ -38,13 +38,13 @@ int audit_classify_syscall(int abi, unsigned syscall)
> {
> switch(syscall) {
> case __NR_open:
> - return 2;
> + return AUDITSC_OPEN;
> case __NR_openat:
> - return 3;
> + return AUDITSC_OPENAT;
> case __NR_execve:
> - return 5;
> + return AUDITSC_EXECVE;
> default:
> - return 0;
> + return AUDITSC_NATIVE;
> }
> }
>
> diff --git a/arch/parisc/kernel/audit.c b/arch/parisc/kernel/audit.c
> index 9eb47b2225d2..14244e83db75 100644
> --- a/arch/parisc/kernel/audit.c
> +++ b/arch/parisc/kernel/audit.c
> @@ -47,13 +47,13 @@ int audit_classify_syscall(int abi, unsigned syscall)
> #endif
> switch (syscall) {
> case __NR_open:
> - return 2;
> + return AUDITSC_OPEN;
> case __NR_openat:
> - return 3;
> + return AUDITSC_OPENAT;
> case __NR_execve:
> - return 5;
> + return AUDITSC_EXECVE;
> default:
> - return 0;
> + return AUDITSC_NATIVE;
> }
> }
>
> diff --git a/arch/parisc/kernel/compat_audit.c b/arch/parisc/kernel/compat_audit.c
> index 20c39c9d86a9..1d6347d37d92 100644
> --- a/arch/parisc/kernel/compat_audit.c
> +++ b/arch/parisc/kernel/compat_audit.c
> @@ -1,4 +1,5 @@
> // SPDX-License-Identifier: GPL-2.0
> +#include <linux/auditsc_classmacros.h>
> #include <asm/unistd.h>
>
> unsigned int parisc32_dir_class[] = {
> @@ -30,12 +31,12 @@ int parisc32_classify_syscall(unsigned syscall)
> {
> switch (syscall) {
> case __NR_open:
> - return 2;
> + return AUDITSC_OPEN;
> case __NR_openat:
> - return 3;
> + return AUDITSC_OPENAT;
> case __NR_execve:
> - return 5;
> + return AUDITSC_EXECVE;
> default:
> - return 1;
> + return AUDITSC_COMPAT;
> }
> }
> diff --git a/arch/powerpc/kernel/audit.c b/arch/powerpc/kernel/audit.c
> index a2dddd7f3d09..6eb18ef77dff 100644
> --- a/arch/powerpc/kernel/audit.c
> +++ b/arch/powerpc/kernel/audit.c
> @@ -47,15 +47,15 @@ int audit_classify_syscall(int abi, unsigned syscall)
> #endif
> switch(syscall) {
> case __NR_open:
> - return 2;
> + return AUDITSC_OPEN;
> case __NR_openat:
> - return 3;
> + return AUDITSC_OPENAT;
> case __NR_socketcall:
> - return 4;
> + return AUDITSC_SOCKETCALL;
> case __NR_execve:
> - return 5;
> + return AUDITSC_EXECVE;
> default:
> - return 0;
> + return AUDITSC_NATIVE;
> }
> }
>
> diff --git a/arch/powerpc/kernel/compat_audit.c b/arch/powerpc/kernel/compat_audit.c
> index 55c6ccda0a85..b1dc2d1c4bad 100644
> --- a/arch/powerpc/kernel/compat_audit.c
> +++ b/arch/powerpc/kernel/compat_audit.c
> @@ -1,5 +1,6 @@
> // SPDX-License-Identifier: GPL-2.0
> #undef __powerpc64__
> +#include <linux/auditsc_classmacros.h>
> #include <asm/unistd.h>
>
> unsigned ppc32_dir_class[] = {
> @@ -31,14 +32,14 @@ int ppc32_classify_syscall(unsigned syscall)
> {
> switch(syscall) {
> case __NR_open:
> - return 2;
> + return AUDITSC_OPEN;
> case __NR_openat:
> - return 3;
> + return AUDITSC_OPENAT;
> case __NR_socketcall:
> - return 4;
> + return AUDITSC_SOCKETCALL;
> case __NR_execve:
> - return 5;
> + return AUDITSC_EXECVE;
> default:
> - return 1;
> + return AUDITSC_COMPAT;
> }
> }
> diff --git a/arch/s390/kernel/audit.c b/arch/s390/kernel/audit.c
> index d395c6c9944c..7e331e1831d4 100644
> --- a/arch/s390/kernel/audit.c
> +++ b/arch/s390/kernel/audit.c
> @@ -47,15 +47,15 @@ int audit_classify_syscall(int abi, unsigned syscall)
> #endif
> switch(syscall) {
> case __NR_open:
> - return 2;
> + return AUDITSC_OPEN;
> case __NR_openat:
> - return 3;
> + return AUDITSC_OPENAT;
> case __NR_socketcall:
> - return 4;
> + return AUDITSC_SOCKETCALL;
> case __NR_execve:
> - return 5;
> + return AUDITSC_EXECVE;
> default:
> - return 0;
> + return AUDITSC_NATIVE;
> }
> }
>
> diff --git a/arch/s390/kernel/compat_audit.c b/arch/s390/kernel/compat_audit.c
> index 444fb1f66944..fc3d1c7ad21c 100644
> --- a/arch/s390/kernel/compat_audit.c
> +++ b/arch/s390/kernel/compat_audit.c
> @@ -1,5 +1,6 @@
> // SPDX-License-Identifier: GPL-2.0
> #undef __s390x__
> +#include <linux/auditsc_classmacros.h>
> #include <asm/unistd.h>
> #include "audit.h"
>
> @@ -32,14 +33,14 @@ int s390_classify_syscall(unsigned syscall)
> {
> switch(syscall) {
> case __NR_open:
> - return 2;
> + return AUDITSC_OPEN;
> case __NR_openat:
> - return 3;
> + return AUDITSC_OPENAT;
> case __NR_socketcall:
> - return 4;
> + return AUDITSC_SOCKETCALL;
> case __NR_execve:
> - return 5;
> + return AUDITSC_EXECVE;
> default:
> - return 1;
> + return AUDITSC_COMPAT;
> }
> }
> diff --git a/arch/sparc/kernel/audit.c b/arch/sparc/kernel/audit.c
> index a6e91bf34d48..50fab35bdaba 100644
> --- a/arch/sparc/kernel/audit.c
> +++ b/arch/sparc/kernel/audit.c
> @@ -48,15 +48,15 @@ int audit_classify_syscall(int abi, unsigned int syscall)
> #endif
> switch(syscall) {
> case __NR_open:
> - return 2;
> + return AUDITSC_OPEN;
> case __NR_openat:
> - return 3;
> + return AUDITSC_OPENAT;
> case __NR_socketcall:
> - return 4;
> + return AUDITSC_SOCKETCALL;
> case __NR_execve:
> - return 5;
> + return AUDITSC_EXECVE;
> default:
> - return 0;
> + return AUDITSC_NATIVE;
> }
> }
>
> diff --git a/arch/sparc/kernel/compat_audit.c b/arch/sparc/kernel/compat_audit.c
> index 10eeb4f15b20..1c1b6d075421 100644
> --- a/arch/sparc/kernel/compat_audit.c
> +++ b/arch/sparc/kernel/compat_audit.c
> @@ -1,5 +1,6 @@
> // SPDX-License-Identifier: GPL-2.0
> #define __32bit_syscall_numbers__
> +#include <linux/auditsc_classmacros.h>
> #include <asm/unistd.h>
> #include "kernel.h"
>
> @@ -32,14 +33,14 @@ int sparc32_classify_syscall(unsigned int syscall)
> {
> switch(syscall) {
> case __NR_open:
> - return 2;
> + return AUDITSC_OPEN;
> case __NR_openat:
> - return 3;
> + return AUDITSC_OPENAT;
> case __NR_socketcall:
> - return 4;
> + return AUDITSC_SOCKETCALL;
> case __NR_execve:
> - return 5;
> + return AUDITSC_EXECVE;
> default:
> - return 1;
> + return AUDITSC_COMPAT;
> }
> }
> diff --git a/arch/x86/ia32/audit.c b/arch/x86/ia32/audit.c
> index 6efe6cb3768a..eedc37a1ee13 100644
> --- a/arch/x86/ia32/audit.c
> +++ b/arch/x86/ia32/audit.c
> @@ -1,4 +1,5 @@
> // SPDX-License-Identifier: GPL-2.0
> +#include <linux/auditsc_classmacros.h>
> #include <asm/unistd_32.h>
> #include <asm/audit.h>
>
> @@ -31,15 +32,15 @@ int ia32_classify_syscall(unsigned syscall)
> {
> switch (syscall) {
> case __NR_open:
> - return 2;
> + return AUDITSC_OPEN;
> case __NR_openat:
> - return 3;
> + return AUDITSC_OPENAT;
> case __NR_socketcall:
> - return 4;
> + return AUDITSC_SOCKETCALL;
> case __NR_execve:
> case __NR_execveat:
> - return 5;
> + return AUDITSC_EXECVE;
> default:
> - return 1;
> + return AUDITSC_COMPAT;
> }
> }
> diff --git a/arch/x86/kernel/audit_64.c b/arch/x86/kernel/audit_64.c
> index 83d9cad4e68b..2a6cc9c9c881 100644
> --- a/arch/x86/kernel/audit_64.c
> +++ b/arch/x86/kernel/audit_64.c
> @@ -47,14 +47,14 @@ int audit_classify_syscall(int abi, unsigned syscall)
> #endif
> switch(syscall) {
> case __NR_open:
> - return 2;
> + return AUDITSC_OPEN;
> case __NR_openat:
> - return 3;
> + return AUDITSC_OPENAT;
> case __NR_execve:
> case __NR_execveat:
> - return 5;
> + return AUDITSC_EXECVE;
> default:
> - return 0;
> + return AUDITSC_NATIVE;
> }
> }
>
> diff --git a/include/linux/audit.h b/include/linux/audit.h
> index 82b7c1116a85..283bc91a6932 100644
> --- a/include/linux/audit.h
> +++ b/include/linux/audit.h
> @@ -11,6 +11,7 @@
>
> #include <linux/sched.h>
> #include <linux/ptrace.h>
> +#include <linux/auditsc_classmacros.h> /* syscall class macros */
> #include <uapi/linux/audit.h>
> #include <uapi/linux/netfilter/nf_tables.h>
>
> diff --git a/include/linux/auditsc_classmacros.h b/include/linux/auditsc_classmacros.h
> new file mode 100644
> index 000000000000..18757d270961
> --- /dev/null
> +++ b/include/linux/auditsc_classmacros.h
> @@ -0,0 +1,23 @@
> +/* SPDX-License-Identifier: GPL-2.0-or-later */
> +/* auditsc_classmacros.h -- Auditing support syscall macros
> + *
> + * Copyright 2021 Red Hat Inc., Durham, North Carolina.
> + * All Rights Reserved.
> + *
> + * Author: Richard Guy Briggs <rgb@redhat.com>
> + */
> +#ifndef _LINUX_AUDITSCM_H_
> +#define _LINUX_AUDITSCM_H_
> +
> +enum auditsc_class_t {
> + AUDITSC_NATIVE = 0,
> + AUDITSC_COMPAT,
> + AUDITSC_OPEN,
> + AUDITSC_OPENAT,
> + AUDITSC_SOCKETCALL,
> + AUDITSC_EXECVE,
> +
> + AUDITSC_NVALS /* count */
> +};
> +
> +#endif
> diff --git a/kernel/auditsc.c b/kernel/auditsc.c
> index 0a9a1569f1ea..d775ea16505b 100644
> --- a/kernel/auditsc.c
> +++ b/kernel/auditsc.c
> @@ -166,7 +166,7 @@ static int audit_match_perm(struct audit_context *ctx, int mask)
> n = ctx->major;
>
> switch (audit_classify_syscall(ctx->arch, n)) {
> - case 0: /* native */
> + case AUDITSC_NATIVE:
> if ((mask & AUDIT_PERM_WRITE) &&
> audit_match_class(AUDIT_CLASS_WRITE, n))
> return 1;
> @@ -177,7 +177,7 @@ static int audit_match_perm(struct audit_context *ctx, int mask)
> audit_match_class(AUDIT_CLASS_CHATTR, n))
> return 1;
> return 0;
> - case 1: /* 32bit on biarch */
> + case AUDITSC_COMPAT: /* 32bit on biarch */
> if ((mask & AUDIT_PERM_WRITE) &&
> audit_match_class(AUDIT_CLASS_WRITE_32, n))
> return 1;
> @@ -188,13 +188,13 @@ static int audit_match_perm(struct audit_context *ctx, int mask)
> audit_match_class(AUDIT_CLASS_CHATTR_32, n))
> return 1;
> return 0;
> - case 2: /* open */
> + case AUDITSC_OPEN:
> return mask & ACC_MODE(ctx->argv[1]);
> - case 3: /* openat */
> + case AUDITSC_OPENAT:
> return mask & ACC_MODE(ctx->argv[2]);
> - case 4: /* socketcall */
> + case AUDITSC_SOCKETCALL:
> return ((mask & AUDIT_PERM_WRITE) && ctx->argv[0] == SYS_BIND);
> - case 5: /* execve */
> + case AUDITSC_EXECVE:
> return mask & AUDIT_PERM_EXEC;
> default:
> return 0;
> diff --git a/lib/audit.c b/lib/audit.c
> index 5004bff928a7..3ec1a94d8d64 100644
> --- a/lib/audit.c
> +++ b/lib/audit.c
> @@ -45,23 +45,23 @@ int audit_classify_syscall(int abi, unsigned syscall)
> switch(syscall) {
> #ifdef __NR_open
> case __NR_open:
> - return 2;
> + return AUDITSC_OPEN;
> #endif
> #ifdef __NR_openat
> case __NR_openat:
> - return 3;
> + return AUDITSC_OPENAT;
> #endif
> #ifdef __NR_socketcall
> case __NR_socketcall:
> - return 4;
> + return AUDITSC_SOCKETCALL;
> #endif
> #ifdef __NR_execveat
> case __NR_execveat:
> #endif
> case __NR_execve:
> - return 5;
> + return AUDITSC_EXECVE;
> default:
> - return 0;
> + return AUDITSC_NATIVE;
> }
> }
>
> diff --git a/lib/compat_audit.c b/lib/compat_audit.c
> index 77eabad69b4a..a38b282d353f 100644
> --- a/lib/compat_audit.c
> +++ b/lib/compat_audit.c
> @@ -1,6 +1,7 @@
> // SPDX-License-Identifier: GPL-2.0
> #include <linux/init.h>
> #include <linux/types.h>
> +#include <linux/auditsc_classmacros.h>
> #include <asm/unistd32.h>
>
> unsigned compat_dir_class[] = {
> @@ -33,19 +34,19 @@ int audit_classify_compat_syscall(int abi, unsigned syscall)
> switch (syscall) {
> #ifdef __NR_open
> case __NR_open:
> - return 2;
> + return AUDITSC_OPEN;
> #endif
> #ifdef __NR_openat
> case __NR_openat:
> - return 3;
> + return AUDITSC_OPENAT;
> #endif
> #ifdef __NR_socketcall
> case __NR_socketcall:
> - return 4;
> + return AUDITSC_SOCKETCALL;
> #endif
> case __NR_execve:
> - return 5;
> + return AUDITSC_EXECVE;
> default:
> - return 1;
> + return AUDITSC_COMPAT;
> }
> }
> --
> 2.27.0
>
^ permalink raw reply
* Re: [PATCH v4 2/3] audit: add support for the openat2 syscall
From: Christian Brauner @ 2021-05-20 7:58 UTC (permalink / raw)
To: Richard Guy Briggs
Cc: linux-s390, linux-ia64, Paul Moore, linux-parisc, Arnd Bergmann,
x86, LKML, Eric Paris, sparclinux, Aleksa Sarai,
Linux-Audit Mailing List, Alexander Viro, linux-alpha,
linux-fsdevel, Eric Paris, Steve Grubb, linuxppc-dev
In-Reply-To: <f5f1a4d8699613f8c02ce762807228c841c2e26f.1621363275.git.rgb@redhat.com>
On Wed, May 19, 2021 at 04:00:21PM -0400, Richard Guy Briggs wrote:
> The openat2(2) syscall was added in kernel v5.6 with commit fddb5d430ad9
> ("open: introduce openat2(2) syscall")
>
> Add the openat2(2) syscall to the audit syscall classifier.
>
> Link: https://github.com/linux-audit/audit-kernel/issues/67
> Signed-off-by: Richard Guy Briggs <rgb@redhat.com>
> Link: https://lore.kernel.org/r/f5f1a4d8699613f8c02ce762807228c841c2e26f.1621363275.git.rgb@redhat.com
> ---
> arch/alpha/kernel/audit.c | 2 ++
> arch/ia64/kernel/audit.c | 2 ++
> arch/parisc/kernel/audit.c | 2 ++
> arch/parisc/kernel/compat_audit.c | 2 ++
> arch/powerpc/kernel/audit.c | 2 ++
> arch/powerpc/kernel/compat_audit.c | 2 ++
> arch/s390/kernel/audit.c | 2 ++
> arch/s390/kernel/compat_audit.c | 2 ++
> arch/sparc/kernel/audit.c | 2 ++
> arch/sparc/kernel/compat_audit.c | 2 ++
> arch/x86/ia32/audit.c | 2 ++
> arch/x86/kernel/audit_64.c | 2 ++
> include/linux/auditsc_classmacros.h | 1 +
> kernel/auditsc.c | 3 +++
> lib/audit.c | 4 ++++
> lib/compat_audit.c | 4 ++++
> 16 files changed, 36 insertions(+)
>
> diff --git a/arch/alpha/kernel/audit.c b/arch/alpha/kernel/audit.c
> index 81cbd804e375..3ab04709784a 100644
> --- a/arch/alpha/kernel/audit.c
> +++ b/arch/alpha/kernel/audit.c
> @@ -42,6 +42,8 @@ int audit_classify_syscall(int abi, unsigned syscall)
> return AUDITSC_OPENAT;
> case __NR_execve:
> return AUDITSC_EXECVE;
> + case __NR_openat2:
> + return AUDITSC_OPENAT2;
> default:
> return AUDITSC_NATIVE;
> }
> diff --git a/arch/ia64/kernel/audit.c b/arch/ia64/kernel/audit.c
> index dba6a74c9ab3..ec61f20ca61f 100644
> --- a/arch/ia64/kernel/audit.c
> +++ b/arch/ia64/kernel/audit.c
> @@ -43,6 +43,8 @@ int audit_classify_syscall(int abi, unsigned syscall)
> return AUDITSC_OPENAT;
> case __NR_execve:
> return AUDITSC_EXECVE;
> + case __NR_openat2:
> + return AUDITSC_OPENAT2;
> default:
> return AUDITSC_NATIVE;
> }
> diff --git a/arch/parisc/kernel/audit.c b/arch/parisc/kernel/audit.c
> index 14244e83db75..f420b5552140 100644
> --- a/arch/parisc/kernel/audit.c
> +++ b/arch/parisc/kernel/audit.c
> @@ -52,6 +52,8 @@ int audit_classify_syscall(int abi, unsigned syscall)
> return AUDITSC_OPENAT;
> case __NR_execve:
> return AUDITSC_EXECVE;
> + case __NR_openat2:
> + return AUDITSC_OPENAT2;
> default:
> return AUDITSC_NATIVE;
> }
> diff --git a/arch/parisc/kernel/compat_audit.c b/arch/parisc/kernel/compat_audit.c
> index 1d6347d37d92..3ec490c28656 100644
> --- a/arch/parisc/kernel/compat_audit.c
> +++ b/arch/parisc/kernel/compat_audit.c
> @@ -36,6 +36,8 @@ int parisc32_classify_syscall(unsigned syscall)
> return AUDITSC_OPENAT;
> case __NR_execve:
> return AUDITSC_EXECVE;
> + case __NR_openat2:
> + return AUDITSC_OPENAT2;
> default:
> return AUDITSC_COMPAT;
> }
> diff --git a/arch/powerpc/kernel/audit.c b/arch/powerpc/kernel/audit.c
> index 6eb18ef77dff..1bcfca5fdf67 100644
> --- a/arch/powerpc/kernel/audit.c
> +++ b/arch/powerpc/kernel/audit.c
> @@ -54,6 +54,8 @@ int audit_classify_syscall(int abi, unsigned syscall)
> return AUDITSC_SOCKETCALL;
> case __NR_execve:
> return AUDITSC_EXECVE;
> + case __NR_openat2:
> + return AUDITSC_OPENAT2;
> default:
> return AUDITSC_NATIVE;
> }
> diff --git a/arch/powerpc/kernel/compat_audit.c b/arch/powerpc/kernel/compat_audit.c
> index b1dc2d1c4bad..251abf79d536 100644
> --- a/arch/powerpc/kernel/compat_audit.c
> +++ b/arch/powerpc/kernel/compat_audit.c
> @@ -39,6 +39,8 @@ int ppc32_classify_syscall(unsigned syscall)
> return AUDITSC_SOCKETCALL;
> case __NR_execve:
> return AUDITSC_EXECVE;
> + case __NR_openat2:
> + return AUDITSC_OPENAT2;
> default:
> return AUDITSC_COMPAT;
> }
> diff --git a/arch/s390/kernel/audit.c b/arch/s390/kernel/audit.c
> index 7e331e1831d4..02051a596b87 100644
> --- a/arch/s390/kernel/audit.c
> +++ b/arch/s390/kernel/audit.c
> @@ -54,6 +54,8 @@ int audit_classify_syscall(int abi, unsigned syscall)
> return AUDITSC_SOCKETCALL;
> case __NR_execve:
> return AUDITSC_EXECVE;
> + case __NR_openat2:
> + return AUDITSC_OPENAT2;
> default:
> return AUDITSC_NATIVE;
> }
> diff --git a/arch/s390/kernel/compat_audit.c b/arch/s390/kernel/compat_audit.c
> index fc3d1c7ad21c..4b3d463e7d97 100644
> --- a/arch/s390/kernel/compat_audit.c
> +++ b/arch/s390/kernel/compat_audit.c
> @@ -40,6 +40,8 @@ int s390_classify_syscall(unsigned syscall)
> return AUDITSC_SOCKETCALL;
> case __NR_execve:
> return AUDITSC_EXECVE;
> + case __NR_openat2:
> + return AUDITSC_OPENAT2;
> default:
> return AUDITSC_COMPAT;
> }
> diff --git a/arch/sparc/kernel/audit.c b/arch/sparc/kernel/audit.c
> index 50fab35bdaba..b092274eca79 100644
> --- a/arch/sparc/kernel/audit.c
> +++ b/arch/sparc/kernel/audit.c
> @@ -55,6 +55,8 @@ int audit_classify_syscall(int abi, unsigned int syscall)
> return AUDITSC_SOCKETCALL;
> case __NR_execve:
> return AUDITSC_EXECVE;
> + case __NR_openat2:
> + return AUDITSC_OPENAT2;
> default:
> return AUDITSC_NATIVE;
> }
> diff --git a/arch/sparc/kernel/compat_audit.c b/arch/sparc/kernel/compat_audit.c
> index 1c1b6d075421..2a3f71206fc5 100644
> --- a/arch/sparc/kernel/compat_audit.c
> +++ b/arch/sparc/kernel/compat_audit.c
> @@ -40,6 +40,8 @@ int sparc32_classify_syscall(unsigned int syscall)
> return AUDITSC_SOCKETCALL;
> case __NR_execve:
> return AUDITSC_EXECVE;
> + case __NR_openat2:
> + return AUDITSC_OPENAT2;
> default:
> return AUDITSC_COMPAT;
> }
> diff --git a/arch/x86/ia32/audit.c b/arch/x86/ia32/audit.c
> index eedc37a1ee13..efc7d832fefb 100644
> --- a/arch/x86/ia32/audit.c
> +++ b/arch/x86/ia32/audit.c
> @@ -40,6 +40,8 @@ int ia32_classify_syscall(unsigned syscall)
> case __NR_execve:
> case __NR_execveat:
> return AUDITSC_EXECVE;
> + case __NR_openat2:
> + return AUDITSC_OPENAT2;
> default:
> return AUDITSC_COMPAT;
> }
> diff --git a/arch/x86/kernel/audit_64.c b/arch/x86/kernel/audit_64.c
> index 2a6cc9c9c881..44c3601cfdc4 100644
> --- a/arch/x86/kernel/audit_64.c
> +++ b/arch/x86/kernel/audit_64.c
> @@ -53,6 +53,8 @@ int audit_classify_syscall(int abi, unsigned syscall)
> case __NR_execve:
> case __NR_execveat:
> return AUDITSC_EXECVE;
> + case __NR_openat2:
> + return AUDITSC_OPENAT2;
> default:
> return AUDITSC_NATIVE;
> }
> diff --git a/include/linux/auditsc_classmacros.h b/include/linux/auditsc_classmacros.h
> index 18757d270961..dc8e72536dbd 100644
> --- a/include/linux/auditsc_classmacros.h
> +++ b/include/linux/auditsc_classmacros.h
> @@ -16,6 +16,7 @@ enum auditsc_class_t {
> AUDITSC_OPENAT,
> AUDITSC_SOCKETCALL,
> AUDITSC_EXECVE,
> + AUDITSC_OPENAT2,
>
> AUDITSC_NVALS /* count */
> };
> diff --git a/kernel/auditsc.c b/kernel/auditsc.c
> index d775ea16505b..3f59ab209dfd 100644
> --- a/kernel/auditsc.c
> +++ b/kernel/auditsc.c
> @@ -76,6 +76,7 @@
> #include <linux/fsnotify_backend.h>
> #include <uapi/linux/limits.h>
> #include <uapi/linux/netfilter/nf_tables.h>
> +#include <uapi/linux/openat2.h>
>
> #include "audit.h"
>
> @@ -196,6 +197,8 @@ static int audit_match_perm(struct audit_context *ctx, int mask)
> return ((mask & AUDIT_PERM_WRITE) && ctx->argv[0] == SYS_BIND);
> case AUDITSC_EXECVE:
> return mask & AUDIT_PERM_EXEC;
> + case AUDITSC_OPENAT2:
> + return mask & ACC_MODE((u32)((struct open_how *)ctx->argv[2])->flags);
That's a lot of dereferncing, casting and masking all at once. Maybe a
small static inline helper would be good for the sake of legibility? Sm
like:
static inline u32 audit_openat2_acc(struct open_how *how, int mask)
{
u32 flags = how->flags;
return mask & ACC_MODE(flags);
}
but not sure. Just seems more legible to me.
Otherwise.
Acked-by: Christian Brauner <christian.brauner@ubuntu.com>
^ permalink raw reply
* Re: [PATCH 6/9] tty: hvc_console: Fix coding style issues of block comments
From: Johan Hovold @ 2021-05-20 8:21 UTC (permalink / raw)
To: Xiaofei Tan; +Cc: gregkh, linuxppc-dev, jirislaby, linux-kernel, linuxarm
In-Reply-To: <e88b6fcd-bfe1-9812-905a-862825f420ce@huawei.com>
On Tue, May 18, 2021 at 12:01:22PM +0800, Xiaofei Tan wrote:
> Hi Johan,
>
> Thanks for reviewing this patch.
>
> On 2021/5/17 22:15, Johan Hovold wrote:
> > On Mon, May 17, 2021 at 02:37:10PM +0800, Xiaofei Tan wrote:
> >> Fix coding style issues of block comments, reported by checkpatch.pl.
> >> Besides, add a period at the end of the sentenses.
> >>
> >> Signed-off-by: Xiaofei Tan <tanxiaofei@huawei.com>
> >> ---
> >> drivers/tty/hvc/hvc_console.c | 15 ++++++++++-----
> >> 1 file changed, 10 insertions(+), 5 deletions(-)
> >>
> >> diff --git a/drivers/tty/hvc/hvc_console.c b/drivers/tty/hvc/hvc_console.c
> >> index 39018e5..a61cdf0 100644
> >> --- a/drivers/tty/hvc/hvc_console.c
> >> +++ b/drivers/tty/hvc/hvc_console.c
> >> @@ -177,7 +177,8 @@ static void hvc_console_print(struct console *co, const char *b,
> >> r = cons_ops[index]->put_chars(vtermnos[index], c, i);
> >> if (r <= 0) {
> >> /* throw away characters on error
> >> - * but spin in case of -EAGAIN */
> >> + * but spin in case of -EAGAIN.
> >> + */
> >
> > How is this an improvement? First, the multi-line comment style is
> >
> > /*
> > * ...
> > */
> >
>
> Yes, mostly we use this style. I can follow it if new version is needed.
This is the preferred style outside of networking.
> BTW, How about add the '/*' check into checkpatch.pl?
Checkpatch already has too many checks IMO and I'm a bit surprised that
it doesn't check this already. Perhaps it's because you used the -f to
run checkpatch on in-kernel code, which you should not.
> > Second, that sentence is not capitalised so why do add a period?
> >
>
> How about capitalize the sentence, or just remove the period ?
How about just leaving this unchanged?
> > Third, why are you sending checkpatch.pl cleanups for files outside of
> > staging?
> >
>
> I'm sorry, Is this a rule, or kind of tradition? I've never heard of
> this before.
Many subsystems reject pure style changes unless you're also doing some
real changes to the code in question. This is a good default rule, even
if some maintainers may occasionally accept churn like this.
You appear to be paid to do kernel work. Why don't you start fixing bugs
or help out reviewing new code instead of sending trivial patches like
this? We can always need another hand.
But if all you you want is to increase your company patch count then
please go work in drivers/staging where most trivial style changes are
currently accepted.
> > Unless doing some real changes to the files in question as well this is
> > mostly just churn and noise that makes it harder to backport fixes and
> > do code forensics for no real gain.
>
> I'm not sure. But if cleanup patches have made it hard to backport fixes
> and do code forensics, then the code quality may not be
> good enough.
No, that has nothing to do with code quality, it's just that you
introduce noise in the logs and do pointless changes of context which
makes it harder to use tools like git blame and makes backporting harder
for no good reason.
Johan
^ permalink raw reply
* Re: [PATCH v5 3/9] mm/mremap: Use pmd/pud_poplulate to update page table entries
From: Aneesh Kumar K.V @ 2021-05-20 8:26 UTC (permalink / raw)
To: Peter Xu
Cc: npiggin, Nathan Chancellor, linux-mm, kaleshsingh, joel, akpm,
linuxppc-dev
In-Reply-To: <YKXHA8/HmP6HXngO@t490s>
On 5/20/21 7:48 AM, Peter Xu wrote:
> On Wed, May 19, 2021 at 10:16:07AM +0530, Aneesh Kumar K.V wrote:
>>> On Thu, Apr 22, 2021 at 11:13:17AM +0530, Aneesh Kumar K.V wrote:
>>>> pmd/pud_populate is the right interface to be used to set the respective
>>>> page table entries. Some architectures like ppc64 do assume that set_pmd/pud_at
>>>> can only be used to set a hugepage PTE. Since we are not setting up a hugepage
>>>> PTE here, use the pmd/pud_populate interface.
>
> [1]
>
>> Can you try this change?
>>
>> modified mm/mremap.c
>> @@ -279,7 +279,7 @@ static bool move_normal_pmd(struct vm_area_struct *vma, unsigned long old_addr,
>> pmd_clear(old_pmd);
>>
>> VM_BUG_ON(!pmd_none(*new_pmd));
>> - pmd_populate(mm, new_pmd, (pgtable_t)pmd_page_vaddr(pmd));
>> + pmd_populate(mm, new_pmd, pmd_pgtable(pmd));
>>
>> if (new_ptl != old_ptl)
>> spin_unlock(new_ptl);
>
> I reported this issue today somewhere else:
>
> https://lore.kernel.org/linux-mm/YKVemB5DuSqLFmmz@t490s/
>
> And came to this same line after the bisection.
>
> This seems to work at least for my userfaultfd test on shmem, however I don't
> fully understand the commit message [1] on: How do we guarantee we're not
> moving a thp pte?
>
move_page_tables() checks for pmd_trans_huge() and ends up calling
move_huge_pmd if it is a THP entry.
-aneesh
^ permalink raw reply
* Re: [PATCH v2 1/2] kprobes: Allow architectures to override optinsn page allocation
From: Naveen N. Rao @ 2021-05-20 9:18 UTC (permalink / raw)
To: anil.s.keshavamurthy, Benjamin Herrenschmidt, Christophe Leroy,
davem, mhiramat, Michael Ellerman, Paul Mackerras
Cc: clang-built-linux, linuxppc-dev, linux-kernel
In-Reply-To: <40a43d6df1fdf41ade36e9a46e60a4df774ca9f6.1620896780.git.christophe.leroy@csgroup.eu>
Christophe Leroy wrote:
> Some architectures like powerpc require a non standard
> allocation of optinsn page, because module pages are
> too far from the kernel for direct branches.
>
> Define weak alloc_optinsn_page() and free_optinsn_page(), that
> fall back on alloc_insn_page() and free_insn_page() when not
> overriden by the architecture.
^^^^^^^^^
overridden - courtesy of checkpatch.
>
> Suggested-by: Masami Hiramatsu <mhiramat@kernel.org>
> Signed-off-by: Christophe Leroy <christophe.leroy@csgroup.eu>
> Acked-by: Masami Hiramatsu <mhiramat@kernel.org>
> ---
> v2: Added missing prototypes in linux/kprobes.h
> ---
> include/linux/kprobes.h | 3 +++
> kernel/kprobes.c | 14 ++++++++++++--
> 2 files changed, 15 insertions(+), 2 deletions(-)
LGTM. For the series:
Reviewed-by: Naveen N. Rao <naveen.n.rao@linux.vnet.ibm.com>
- Naveen
^ permalink raw reply
* [PATCH 0/3] Rid W=1 warnings from Crypto
From: Lee Jones @ 2021-05-20 9:27 UTC (permalink / raw)
To: lee.jones
Cc: John Allen, Seth Jennings, Herbert Xu, Tom Lendacky, Gary R Hook,
linux-kernel, George Cherian, Paul Mackerras, Robert Jennings,
linuxppc-dev, David S. Miller, linux-crypto
This set is part of a larger effort attempting to clean-up W=1
kernel builds, which are currently overwhelmingly riddled with
niggly little warnings.
Lee Jones (3):
crypto: cavium: Fix a bunch of kernel-doc related issues
crypto: nx: nx-aes-gcm: Kernel-doc formatting should not be used for
headers
crypto: ccp: ccp-dev: Fix a little doc-rot
drivers/crypto/cavium/cpt/cptpf_main.c | 2 +-
drivers/crypto/cavium/cpt/cptvf_reqmanager.c | 4 ++--
drivers/crypto/cavium/nitrox/nitrox_main.c | 4 ++--
drivers/crypto/cavium/nitrox/nitrox_mbx.c | 4 ++--
drivers/crypto/cavium/nitrox/nitrox_reqmgr.c | 12 ++++++----
.../crypto/cavium/nitrox/nitrox_skcipher.c | 2 +-
drivers/crypto/ccp/ccp-dev.c | 2 +-
drivers/crypto/nx/nx-842-pseries.c | 24 +++++++++----------
8 files changed, 27 insertions(+), 27 deletions(-)
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: "David S. Miller" <davem@davemloft.net>
Cc: Gary R Hook <gary.hook@amd.com>
Cc: George Cherian <gcherian@marvell.com>
Cc: Haren Myneni <haren@us.ibm.com>
Cc: Herbert Xu <herbert@gondor.apana.org.au>
Cc: John Allen <john.allen@amd.com>
Cc: linux-crypto@vger.kernel.org
Cc: linuxppc-dev@lists.ozlabs.org
Cc: Michael Ellerman <mpe@ellerman.id.au>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Robert Jennings <rcj@linux.vnet.ibm.com>
Cc: Seth Jennings <sjenning@linux.vnet.ibm.com>
Cc: Tom Lendacky <thomas.lendacky@amd.com>
--
2.31.1
^ permalink raw reply
* [PATCH 2/3] crypto: nx: nx-aes-gcm: Kernel-doc formatting should not be used for headers
From: Lee Jones @ 2021-05-20 9:27 UTC (permalink / raw)
To: lee.jones
Cc: Seth Jennings, Herbert Xu, linux-kernel, Paul Mackerras,
Robert Jennings, linuxppc-dev, David S. Miller, linux-crypto
In-Reply-To: <20210520092733.3434378-1-lee.jones@linaro.org>
Fixes the following W=1 kernel build warning(s):
drivers/crypto/nx/nx-aes-gcm.c:26: warning: Function parameter or member 'tfm' not described in 'gcm_aes_nx_set_key'
drivers/crypto/nx/nx-aes-gcm.c:26: warning: Function parameter or member 'in_key' not described in 'gcm_aes_nx_set_key'
drivers/crypto/nx/nx-aes-gcm.c:26: warning: Function parameter or member 'key_len' not described in 'gcm_aes_nx_set_key'
drivers/crypto/nx/nx-aes-gcm.c:26: warning: expecting prototype for Nest Accelerators driver(). Prototype was for gcm_aes_nx_set_key() instead
drivers/crypto/nx/nx-aes-ecb.c:24: warning: Function parameter or member 'tfm' not described in 'ecb_aes_nx_set_key'
drivers/crypto/nx/nx-aes-ecb.c:24: warning: Function parameter or member 'in_key' not described in 'ecb_aes_nx_set_key'
drivers/crypto/nx/nx-aes-ecb.c:24: warning: Function parameter or member 'key_len' not described in 'ecb_aes_nx_set_key'
drivers/crypto/nx/nx-aes-ecb.c:24: warning: expecting prototype for Nest Accelerators driver(). Prototype was for ecb_aes_nx_set_key() instead
drivers/crypto/nx/nx-aes-ccm.c:26: warning: Function parameter or member 'tfm' not described in 'ccm_aes_nx_set_key'
drivers/crypto/nx/nx-aes-ccm.c:26: warning: Function parameter or member 'in_key' not described in 'ccm_aes_nx_set_key'
drivers/crypto/nx/nx-aes-ccm.c:26: warning: Function parameter or member 'key_len' not described in 'ccm_aes_nx_set_key'
drivers/crypto/nx/nx-aes-ccm.c:26: warning: expecting prototype for Nest Accelerators driver(). Prototype was for ccm_aes_nx_set_key() instead
drivers/crypto/nx/nx-aes-ctr.c:25: warning: Function parameter or member 'tfm' not described in 'ctr_aes_nx_set_key'
drivers/crypto/nx/nx-aes-ctr.c:25: warning: Function parameter or member 'in_key' not described in 'ctr_aes_nx_set_key'
drivers/crypto/nx/nx-aes-ctr.c:25: warning: Function parameter or member 'key_len' not described in 'ctr_aes_nx_set_key'
drivers/crypto/nx/nx-aes-ctr.c:25: warning: expecting prototype for Nest Accelerators driver(). Prototype was for ctr_aes_nx_set_key() instead
drivers/crypto/nx/nx-aes-xcbc.c:22: warning: cannot understand function prototype: 'struct xcbc_state '
drivers/crypto/nx/nx-sha256.c:21: warning: Function parameter or member 'tfm' not described in 'nx_crypto_ctx_sha256_init'
drivers/crypto/nx/nx-sha256.c:21: warning: expecting prototype for SHA(). Prototype was for nx_crypto_ctx_sha256_init() instead
drivers/crypto/nx/nx-sha512.c:20: warning: Function parameter or member 'tfm' not described in 'nx_crypto_ctx_sha512_init'
drivers/crypto/nx/nx-sha512.c:20: warning: expecting prototype for SHA(). Prototype was for nx_crypto_ctx_sha512_init() instead
drivers/crypto/nx/nx-842-pseries.c:280: warning: Function parameter or member 'wmem' not described in 'nx842_pseries_compress'
drivers/crypto/nx/nx-842-pseries.c:280: warning: Excess function parameter 'wrkmem' description in 'nx842_pseries_compress'
drivers/crypto/nx/nx-842-pseries.c:410: warning: Function parameter or member 'wmem' not described in 'nx842_pseries_decompress'
drivers/crypto/nx/nx-842-pseries.c:410: warning: Excess function parameter 'wrkmem' description in 'nx842_pseries_decompress'
drivers/crypto/nx/nx-842-pseries.c:523: warning: Function parameter or member 'devdata' not described in 'nx842_OF_set_defaults'
drivers/crypto/nx/nx-842-pseries.c:548: warning: Function parameter or member 'prop' not described in 'nx842_OF_upd_status'
drivers/crypto/nx/nx-842-pseries.c:582: warning: Function parameter or member 'devdata' not described in 'nx842_OF_upd_maxsglen'
drivers/crypto/nx/nx-842-pseries.c:582: warning: Function parameter or member 'prop' not described in 'nx842_OF_upd_maxsglen'
drivers/crypto/nx/nx-842-pseries.c:630: warning: Function parameter or member 'devdata' not described in 'nx842_OF_upd_maxsyncop'
drivers/crypto/nx/nx-842-pseries.c:630: warning: Function parameter or member 'prop' not described in 'nx842_OF_upd_maxsyncop'
drivers/crypto/nx/nx-842-pseries.c:692: warning: Cannot understand *
drivers/crypto/nx/nx-842-pseries.c:825: warning: Function parameter or member 'data' not described in 'nx842_OF_notifier'
drivers/crypto/nx/nx-842-pseries.c:825: warning: Excess function parameter 'update' description in 'nx842_OF_notifier'
Cc: Haren Myneni <haren@us.ibm.com>
Cc: Herbert Xu <herbert@gondor.apana.org.au>
Cc: "David S. Miller" <davem@davemloft.net>
Cc: Michael Ellerman <mpe@ellerman.id.au>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Robert Jennings <rcj@linux.vnet.ibm.com>
Cc: Seth Jennings <sjenning@linux.vnet.ibm.com>
Cc: linux-crypto@vger.kernel.org
Cc: linuxppc-dev@lists.ozlabs.org
Signed-off-by: Lee Jones <lee.jones@linaro.org>
---
drivers/crypto/nx/nx-842-pseries.c | 24 +++++++++++-------------
1 file changed, 11 insertions(+), 13 deletions(-)
diff --git a/drivers/crypto/nx/nx-842-pseries.c b/drivers/crypto/nx/nx-842-pseries.c
index 8ee547ee378ec..67caff73f058f 100644
--- a/drivers/crypto/nx/nx-842-pseries.c
+++ b/drivers/crypto/nx/nx-842-pseries.c
@@ -264,8 +264,8 @@ static int nx842_validate_result(struct device *dev,
* @inlen: Length of input buffer
* @out: Pointer to output buffer
* @outlen: Length of output buffer
- * @wrkmem: ptr to buffer for working memory, size determined by
- * nx842_pseries_driver.workmem_size
+ * @wmem: ptr to buffer for working memory, size determined by
+ * nx842_pseries_driver.workmem_size
*
* Returns:
* 0 Success, output of length @outlen stored in the buffer at @out
@@ -393,8 +393,8 @@ static int nx842_pseries_compress(const unsigned char *in, unsigned int inlen,
* @inlen: Length of input buffer
* @out: Pointer to output buffer
* @outlen: Length of output buffer
- * @wrkmem: ptr to buffer for working memory, size determined by
- * nx842_pseries_driver.workmem_size
+ * @wmem: ptr to buffer for working memory, size determined by
+ * nx842_pseries_driver.workmem_size
*
* Returns:
* 0 Success, output of length @outlen stored in the buffer at @out
@@ -513,7 +513,7 @@ static int nx842_pseries_decompress(const unsigned char *in, unsigned int inlen,
/**
* nx842_OF_set_defaults -- Set default (disabled) values for devdata
*
- * @devdata - struct nx842_devdata to update
+ * @devdata: struct nx842_devdata to update
*
* Returns:
* 0 on success
@@ -538,7 +538,7 @@ static int nx842_OF_set_defaults(struct nx842_devdata *devdata)
* The status field indicates if the device is enabled when the status
* is 'okay'. Otherwise the device driver will be disabled.
*
- * @prop - struct property point containing the maxsyncop for the update
+ * @prop: struct property point containing the maxsyncop for the update
*
* Returns:
* 0 - Device is available
@@ -571,8 +571,8 @@ static int nx842_OF_upd_status(struct property *prop)
* In this example, the maximum byte length of a scatter list is
* 0x0ff0 (4,080).
*
- * @devdata - struct nx842_devdata to update
- * @prop - struct property point containing the maxsyncop for the update
+ * @devdata: struct nx842_devdata to update
+ * @prop: struct property point containing the maxsyncop for the update
*
* Returns:
* 0 on success
@@ -619,8 +619,8 @@ static int nx842_OF_upd_maxsglen(struct nx842_devdata *devdata,
* 0x1000 (4,096) data byte length and 0x1f3 (510) total scatter list
* elements.
*
- * @devdata - struct nx842_devdata to update
- * @prop - struct property point containing the maxsyncop for the update
+ * @devdata: struct nx842_devdata to update
+ * @prop: struct property point containing the maxsyncop for the update
*
* Returns:
* 0 on success
@@ -689,7 +689,6 @@ static int nx842_OF_upd_maxsyncop(struct nx842_devdata *devdata,
}
/**
- *
* nx842_OF_upd -- Handle OF properties updates for the device.
*
* Set all properties from the OF tree. Optionally, a new property
@@ -812,8 +811,7 @@ static int nx842_OF_upd(struct property *new_prop)
*
* @np: notifier block
* @action: notifier action
- * @update: struct pSeries_reconfig_prop_update pointer if action is
- * PSERIES_UPDATE_PROPERTY
+ * @data: struct of_reconfig_data pointer
*
* Returns:
* NOTIFY_OK on success
--
2.31.1
^ permalink raw reply related
page: next (older) | prev (newer) | latest
- recent:[subjects (threaded)|topics (new)|topics (active)]
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox