Re: [PATCH v2 1/7] drivers: dio: Avoids building driver if CONFIG_DIO is disabled

2018-09-27 Thread Leonardo Bras
Dear Rolf, On Thu, Sep 27, 2018 at 3:35 AM, Rolf Eike Beer wrote: > Am Donnerstag, 27. September 2018, 03:39:56 CEST schrieb Leonardo Brás: >> Avoids building driver if 'make drivers/dio/' is called and >> CONFIG_DIO is disabled. >> >> Signed-off-by: Leonardo Brás >> --- >> drivers/dio/Makefile

Re: [PATCH v2 6/7] drivers: oprofile: Avoids building driver from direct make command

2018-09-27 Thread Leonardo Bras
CH/ tree. >> + > > Now there is a blank line where it does not need to be. > > Eike Oh, it's a Makefile, and as all text files, it have to end with newline. If I am wrong, please let me know. Thanks for your feedback, Leonardo Bras,

Re: [PATCH v3 3/7] drivers: parisc: Avoids building driver if CONFIG_PARISC is disabled

2018-10-09 Thread Leonardo Bras
ts. I don't believe they care how it's spent if its used to build/deploy the project. They even allow using several 'jobs' in parallel in order to speed up the process. Thanks for your help, Leonardo Bras

Re: [PATCH 1/1] kbuild: Optimize tests and remove shadowed local variable.

2018-10-09 Thread Leonardo Bras
Thank you! Please let me know if it needs any rework! Leonardo Bras On Sat, Oct 6, 2018 at 4:50 PM Masahiro Yamada wrote: > > Hi Leonardo, David, > > > > On Fri, Oct 5, 2018 at 11:32 AM Leonardo Bras wrote: > > > > Hello David, > > > > My name is L

Re: [PATCH v3 0/7] Remove errors building drivers/DRIVERNAME

2018-10-09 Thread Leonardo Bras
Thanks Finn, I will take a good look at that and try to use it in my build. Thank you, Leonardo Bras On Wed, Oct 3, 2018 at 11:00 PM Finn Thain wrote: > > On Wed, 3 Oct 2018, Leonardo Bras wrote: > > > Both ccache and distcc seem very interesting, I will take my time to > >

Re: [PATCH v3 2/5] kbuild: Removes unnecessary shadowed local variable.

2018-10-29 Thread Leonardo Bras
Sorry, I will take care next time. Thank you, Leonardo Bras On Sun, Oct 28, 2018 at 1:37 PM Masahiro Yamada wrote: > > On Wed, Oct 24, 2018 at 1:04 PM Leonardo Bras wrote: > > > > Removes an unnecessary shadowed local variable (start). > > It was used only once, wi

Re: [PATCH v2 3/5] Creates macro to avoid variable shadowing

2018-10-29 Thread Leonardo Bras
Thank you! On Sun, Oct 28, 2018 at 1:38 PM Masahiro Yamada wrote: > > On Tue, Oct 23, 2018 at 10:11 AM Leonardo Brás wrote: > > > > Creates DEF_FIELD_ADDR_VAR as a more generic version of the DEF_FIELD_ADD > > macro, allowing usage of a variable name other than the struct element name. > > Also,

Re: [PATCH v3 4/5] modpost: Changes parameter name to avoid shadowing.

2018-10-31 Thread Leonardo Bras
Em seg, 2018-10-29 às 01:42 +0900, Masahiro Yamada escreveu: > On Wed, Oct 24, 2018 at 1:05 PM Leonardo Bras > wrote: > > Changes the parameter name to avoid shadowing a variable. > > > > Signed-off-by: Leonardo Bras > > For this one, I'd rather like to see c

[PATCH 1/3] modpost: Refactor and removes global variable *modules

2018-10-31 Thread Leonardo Bras
Refactors the code to accept the modules list as a parameter in the functions that need it, and moves the variable from the global scope to the main function scope. This also fixes the parameter shadowing of add_depends. Signed-off-by: Leonardo Bras --- scripts/mod/modpost.c | 39

[PATCH 1/1] modpost: Refactor and removes global variable *modules

2018-10-31 Thread Leonardo Bras
Refactors the code to accept the modules list as a parameter in the functions that need it, and moves the variable from the global scope to the main function scope. This also fixes the parameter shadowing of add_depends. Signed-off-by: Leonardo Bras --- scripts/mod/modpost.c | 39

Re: [PATCH v3 4/5] modpost: Changes parameter name to avoid shadowing.

2018-10-31 Thread Leonardo Bras
Em qua, 2018-10-31 às 20:24 -0300, Leonardo Bras escreveu: > Em seg, 2018-10-29 às 01:42 +0900, Masahiro Yamada escreveu: > > On Wed, Oct 24, 2018 at 1:05 PM Leonardo Bras > > wrote: > > > Changes the parameter name to avoid shadowing a variable. > > > &

Re: [Lkcamp] [PATCH 2/4] Renames variable to fix shadow warning.

2018-10-17 Thread Leonardo Bras
change will be available on v2. > > > > > for (k = 0; k < NSYMS; k++) { > > - if (!strcmp(name, required_syms[k].name)) { > > + if (!strcmp(name2, required_syms[k].name)) { > > if (syms[k]) { > > fail("duplicate symbol %s\n", > >required_syms[k].name); > > > > Regards > Helen Regards, Leonardo Bras

Re: [PATCH 2/4] Renames variable to fix shadow warning.

2018-10-17 Thread Leonardo Bras
Thanks Ingo, On Wed, Oct 17, 2018 at 3:01 AM Ingo Molnar wrote: > > > * Leonardo Brás wrote: > > > Renames the char variable to avoid shadowing a variable previously > > declared on this function. > > > > Signed-off-by: Leonardo Brás > > --- > > arch/x86/entry/vdso/vdso2c.h | 4 ++-- > > 1 file

Re: [PATCH 2/4] Renames variable to fix shadow warning.

2018-10-17 Thread Leonardo Bras
Hello Andy, Thanks for the suggestion. I renamed them as suggested and it will be available on v2. Regards, Leonardo On Wed, Oct 17, 2018 at 2:54 PM Andy Lutomirski wrote: > > On Tue, Oct 16, 2018 at 11:01 PM Ingo Molnar wrote: > > > > > > * Leonardo Brás wrote: > > > > > Renames the char var

Re: [Lkcamp] [PATCH 1/4] Adds -Wshadow=local on KBUILD_HOSTCFLAGS

2018-10-17 Thread Leonardo Bras
Hello Helen, On Wed, Oct 17, 2018 at 1:32 AM Helen Koike wrote: > > Hi Leonardo, > > Thanks for the patch. > > On 10/16/18 9:08 PM, Leonardo Brás wrote: > > Adds -Wshadow=local on KBUILD_HOSTCFLAGS to show shadow warnings > > on tools built for HOST. > > > > Signed-off-by: Leonardo Brás > > ---

Re: [PATCH 1/4] Adds -Wshadow=local on KBUILD_HOSTCFLAGS

2018-10-17 Thread Leonardo Bras
; $(HOSTCFLAGS) > > > KBUILD_HOSTCXXFLAGS := -O2 $(HOST_LFS_CFLAGS) $(HOSTCXXFLAGS) > > > -- > > > > You might wanna take a look at scripts/Makefile.extrawarn which already > > has -Wshadow. > > > scripts/Makefile.extrawarn provides options for the target compiler (CC), > whereas this patch adds -Wshadow=local for the host compiler (HOSTCC). > > Thanks for helping, :) Leonardo Bras > > -- > Best Regards > Masahiro Yamada

Re: [PATCH 1/4] Adds -Wshadow=local on KBUILD_HOSTCFLAGS

2018-10-17 Thread Leonardo Bras
he shadowing warnings. What do you think? I am open to suggestions. Thank you, Leonardo Bras > -- > Regards/Gruss, > Boris. > > Good mailing practices for 400: avoid top-posting and trim the reply.

Re: [Lkcamp] [PATCH 4/4] Changes macro usage to avoid shadowing a variable.

2018-10-17 Thread Leonardo Bras
y you don't need to change the logic, just the name of the > variable. > Good suggestion. Is it ok to create a macro for using only once? It looks like its not worth the trouble. > > > > for (j2 = 0; j2 < PNP_MAX_DEVICES; j2++) { > > -

Re: [Lkcamp] [PATCH 3/4] kbuild: Removes unnecessary shadowed local variable and optimize testing.

2018-10-17 Thread Leonardo Bras
Hello Helen, On Wed, Oct 17, 2018 at 12:06 AM Helen Koike wrote: > > Hi Leonardo, > > On 10/16/18 9:09 PM, Leonardo Brás wrote: > > Removes an unnecessary shadowed local variable (start). > > Optimize test of isdigit: > > - If isalpha returns true, isdigit will return false, so no nee

Re: [PATCH v3 3/7] drivers: parisc: Avoids building driver if CONFIG_PARISC is disabled

2018-10-03 Thread Leonardo Bras
thing like I did in zorro/Makefile would fix this all. (For reference, https://lkml.org/lkml/2018/9/28/150 ) If you agree, I will send the next patchset with this change. Thanks for your help! Leonardo Bras

Re: [PATCH v3 5/7] drivers: s390: Avoids building drivers if ARCH is not s390.

2018-10-03 Thread Leonardo Bras
n't build when "make drivers/s390/" was called. Sorry I didn't send the e-mail with the reason earlier. For solving my problem it was not necessary, but if you think it's interesting, I could refactor all drivers/s390 Makefiles to make them all build only if we are dealing with the s390 architecture. What do you think? Thanks for the reply, Leonardo Bras

Re: [PATCH v3 0/7] Remove errors building drivers/DRIVERNAME

2018-10-03 Thread Leonardo Bras
On Wed, Oct 3, 2018 at 8:27 PM Finn Thain wrote: > > On Wed, 3 Oct 2018, Leonardo Bras wrote: > > > > > Sorry, I was not very clear at my reasons why this change is important, > > I will try to briefly explain the whole story. > > > > Some weeks ago I wa

Re: [PATCH v3 3/7] drivers: parisc: Avoids building driver if CONFIG_PARISC is disabled

2018-10-04 Thread Leonardo Bras
t least, solve my problem with the 3h limit, and enable the tool I am building on GiltabCI to help other developers. Thanks for reading, Leonardo Bras

Re: [PATCH 1/1] kbuild: Optimize tests and remove shadowed local variable.

2018-10-04 Thread Leonardo Bras
Hello David, My name is Leonardo and I am new to kernel development. Is this patch acceptable? Do it need some rework? The change makes sense? Is there a way to better follow the workflow for this patch? Please let me know if it needs anything. Best regards, Leonardo Bras On Wed, Sep 19

Re: [PATCH v2 3/5] Creates macro to avoid variable shadowing

2018-10-23 Thread Leonardo Bras
Hello Helen, On Tue, Oct 23, 2018 at 6:35 PM Helen Koike wrote: > Like this you are not changing the logic in this file, you are just > renaming the variable which is more then enough to solve the -Wshadow > warning. > I don't it is worthy changing the logic. You are right, that was what the patc

Re: [PATCH v2 1/5] x86/vdso: Renames variable to fix shadow warning.

2018-10-23 Thread Leonardo Bras
Hello Andy, Yeah, it's much better. I will replace this part of the commit message. It will be fixed for v3. Thank you! On Mon, Oct 22, 2018 at 11:13 PM Andy Lutomirski wrote: > How about “The go32() and go64() functions has an argument and a local > variable called ‘name’. Rename both to c

[PATCH v3 1/5] x86/vdso: Renames variable to fix shadow warning.

2018-10-23 Thread Leonardo Bras
The go32() and go64() functions have an argument and a local variable called ‘name’. Rename both to clarify the code and to fix a warning with -Wshadow. Signed-off-by: Leonardo Bras --- arch/x86/entry/vdso/vdso2c.h | 13 +++-- 1 file changed, 7 insertions(+), 6 deletions(-) diff --git

[PATCH v3 4/5] modpost: Changes parameter name to avoid shadowing.

2018-10-23 Thread Leonardo Bras
Changes the parameter name to avoid shadowing a variable. Signed-off-by: Leonardo Bras --- scripts/mod/modpost.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/mod/modpost.c b/scripts/mod/modpost.c index 0d998c54564d..368fe42340df 100644 --- a/scripts/mod

[PATCH v3 2/5] kbuild: Removes unnecessary shadowed local variable.

2018-10-23 Thread Leonardo Bras
Removes an unnecessary shadowed local variable (start). It was used only once, with the same value it was started before the if block. Signed-off-by: Leonardo Bras --- scripts/asn1_compiler.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/asn1_compiler.c b/scripts

[PATCH v3 3/5] Creates macro to avoid variable shadowing

2018-10-23 Thread Leonardo Bras
DEF_FIELD_ADDR_VAR to create a variable of another name, in order to avoid variable shadowing. Signed-off-by: Leonardo Bras --- scripts/mod/file2alias.c | 19 +++ 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/scripts/mod/file2alias.c b/scripts/mod/file2alias.c

[PATCH v3 5/5] Adds -Wshadow on KBUILD_HOSTCFLAGS

2018-10-23 Thread Leonardo Bras
Adds -Wshadow on KBUILD_HOSTCFLAGS to show shadow warnings on tools built for HOST. Signed-off-by: Leonardo Bras --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index e8b599b4dcde..3edae5d359b5 100644 --- a/Makefile +++ b/Makefile @@ -360,7

[PATCH v3 0/5] Adds -Wshadow on KBUILD_HOSTCFLAGS and fix warnings

2018-10-23 Thread Leonardo Bras
://lkml.org/lkml/2018/10/23/151 v1: https://lkml.org/lkml/2018/10/17/169 Leonardo Bras (5): x86/vdso: Renames variable to fix shadow warning. kbuild: Removes unnecessary shadowed local variable. Creates macro to avoid variable shadowing modpost: Changes parameter name to avoid shadowing. Adds

Re: [PATCH 1/4] Adds -Wshadow=local on KBUILD_HOSTCFLAGS

2018-10-18 Thread Leonardo Bras
o think this option is a kind of harsh... The v2 it's almost done. You think it will be useful, or should I drop it? Regards, Leonardo Bras

Re: [PATCH V12 03/14] riscv: errata: Move errata vendor func-id into vendorid_list.h

2024-01-03 Thread Leonardo Bras
On Mon, Dec 25, 2023 at 07:58:36AM -0500, guo...@kernel.org wrote: > From: Guo Ren > > Move errata vendor func-id definitions from errata_list into > vendorid_list.h. Unifying these definitions is also for following > rwonce errata implementation. > > Suggested-by: Leonard

Re: [PATCH V12 06/14] riscv: qspinlock: Introduce combo spinlock

2024-01-03 Thread Leonardo Bras
On Mon, Dec 25, 2023 at 07:58:39AM -0500, guo...@kernel.org wrote: > From: Guo Ren > > Combo spinlock could support queued and ticket in one Linux Image and > select them during boot time via command line. Here is the func > size (Bytes) comparison table below: > > TYPE : COMBO

Re: [PATCH V12 07/14] riscv: qspinlock: Add virt_spin_lock() support for VM guest

2024-01-03 Thread Leonardo Bras
if (no_virt_spin) > + static_branch_disable(&virt_spin_lock_key); > + else > + pr_info("Enable virt_spin_lock\n"); > +} > +#endif > + > static void __init riscv_spinlock_init(void) > { > if (!enable_qspinlock) { > @@ -274,6 +296,10 @@ static void __init riscv_spinlock_init(void) > } else { > pr_info("Queued spinlock: enabled\n"); > } > + > +#ifdef CONFIG_QUEUED_SPINLOCKS > + virt_spin_lock_init(); > +#endif > } > #endif > > -- > 2.40.1 > LGTM: Reviewed-by: Leonardo Bras

Re: [PATCH V12 08/14] riscv: qspinlock: Force virt_spin_lock for KVM guests

2024-01-03 Thread Leonardo Bras
On Mon, Dec 25, 2023 at 07:58:41AM -0500, guo...@kernel.org wrote: > From: Guo Ren > > Force to enable virt_spin_lock when KVM guest, because fair locks > have horrible lock 'holder' preemption issues. > > Suggested-by: Leonardo Bras > Link: https://lk

Re: [PATCH net-next] virtio_net: Fix napi_skb_cache_put warning

2024-09-03 Thread Leonardo Bras
On Mon, Jul 15, 2024 at 04:25:06AM -0700, Breno Leitao wrote: > Hello Michael, > > On Sun, Jul 14, 2024 at 03:38:42AM -0400, Michael S. Tsirkin wrote: > > On Fri, Jul 12, 2024 at 04:53:25AM -0700, Breno Leitao wrote: > > > After the commit bdacf3e34945 ("net: Use nested-BH locking for > > > napi_a

[PATCH v2 1/1] powerpc/iommu: Enable remaining IOMMU Pagesizes present in LoPAR

2021-04-07 Thread Leonardo Bras
r 32M, 64M, 128M, 256M and 16G. Enabling bigger pages would be interesting for direct mapping systems with a lot of RAM, while using less TCE entries. Signed-off-by: Leonardo Bras --- arch/powerpc/platforms/pseries/iommu.c | 49 ++ 1 file changed, 42 insertions(+), 7

Re: [PATCH 1/1] powerpc/iommu: Enable remaining IOMMU Pagesizes present in LoPAR

2021-04-07 Thread Leonardo Bras
; > OTOH the PAPR page sizes need macros as they are the ones which are > weird and screaming for macros. > > I'd steal/rework spapr_page_mask_to_query_mask() from QEMU. Thanks, > Thanks for this feedback! I just sent a v2 applying your suggestions. Best regards, Leonardo Bras

Re: [PATCH v2 1/1] powerpc/iommu: Enable remaining IOMMU Pagesizes present in LoPAR

2021-04-07 Thread Leonardo Bras
Hello Michael, thank you for this feedback! Comments inline: On Thu, 2021-04-08 at 15:37 +1000, Michael Ellerman wrote: > Leonardo Bras writes: > > According to LoPAR, ibm,query-pe-dma-window output named "IO Page Sizes" > > will let the OS know all possible pages

Re: [PATCH v2 1/1] powerpc/iommu: Enable remaining IOMMU Pagesizes present in LoPAR

2021-04-07 Thread Leonardo Bras
On Thu, 2021-04-08 at 03:20 -0300, Leonardo Bras wrote: > > > +#define QUERY_DDW_PGSIZE_4K 0x01 > > > +#define QUERY_DDW_PGSIZE_64K 0x02 > > > +#define QUERY_DDW_PGSIZE_16M 0x04 > > > +#define QUERY_DDW_PGSIZE_32M 0x08 > > > +#define

[PATCH v3 1/1] powerpc/iommu: Enable remaining IOMMU Pagesizes present in LoPAR

2021-04-08 Thread Leonardo Bras
r 32M, 64M, 128M, 256M and 16G. Enabling bigger pages would be interesting for direct mapping systems with a lot of RAM, while using less TCE entries. Signed-off-by: Leonardo Bras --- Changes since v2: - Restore 'int array & shift' strategy - Remove defines for RTAS "IO Page

Re: [PATCH 1/3] powerpc/mm/hash: Avoid resizing-down HPT on first memory hotplug

2021-04-08 Thread Leonardo Bras
avoid multiple > resize attempts first. This batching is something I had thought a lot about. Problem is that there are a lot of generic interfaces between memory hotplug and actually resizing HPT. I tried a simpler approach in patches 2 & 3, so I don't touch much stuff there. Best regards, Leonardo Bras

Re: [PATCH 2/3] powerpc/mm/hash: Avoid multiple HPT resize-ups on memory hotplug

2021-04-08 Thread Leonardo Bras
g any existing HPT > resizes. Won't this just resize to the right size for the full add, > then resize several times again as we perform the add? Or.. I guess > that will be suppressed by patch 1/3.  Correct. > That's seems kinda fragile, though. What do you mean by fragile here? What would you suggest doing different? Best regards, Leonardo Bras

Re: [PATCH 3/3] powerpc/mm/hash: Avoid multiple HPT resize-downs on memory hotunplug

2021-04-08 Thread Leonardo Bras
> > > The effect of these on the memory grow path is far from clear. > On hotplug, HPT is resized-up before adding LMBs. On hotunplug, HPT is resized-down after removing LMBs. And each one has it's own mechanism to batch HPT resizes... I can't understand exactly how using it on hotplug fail path can be any different than using it on hotunplug. > Can you please help me understanding this? Best regards, Leonardo Bras

[PATCH 1/1] powerpc/kvm: Save Timebase Offset to fix sched_clock() while running guest code.

2021-02-04 Thread Leonardo Bras
nt in kvmppc_guest_entry_inject_int(), which depending on last tracepoint acquired could actually cause the host to crash. Save the Timebase Offset to PACA and use it on sched_clock() to always get the correct timestamp. Signed-off-by: Leonardo Bras --- arch/powerpc/include/asm/kvm_book3s_asm.

[PATCH v2 1/1] powerpc/kvm: Save Timebase Offset to fix sched_clock() while running guest code.

2021-02-04 Thread Leonardo Bras
nt in kvmppc_guest_entry_inject_int(), which depending on last tracepoint acquired could actually cause the host to crash. Save the Timebase Offset to PACA and use it on sched_clock() to always get the correct timestamp. Signed-off-by: Leonardo Bras Suggested-by: Paul Mackerras --- Changes sin

Re: [PATCH v2 1/1] powerpc/kvm: Save Timebase Offset to fix sched_clock() while running guest code.

2021-02-04 Thread Leonardo Bras
you really need it upstream > could you put it under a debug config option? You mean something that is automatically selected whenever those configs are enabled? CONFIG_TRACEPOINT && CONFIG_KVM_BOOK3S_HANDLER && CONFIG_PPC_BOOK3S_64 Or something the user need to select hi

Re: [PATCH v2 1/1] powerpc/kvm: Save Timebase Offset to fix sched_clock() while running guest code.

2021-02-05 Thread Leonardo Bras
Hello Fabiano, Thanks for reviewing!  (answers inline) On Fri, 2021-02-05 at 10:09 -0300, Fabiano Rosas wrote: > Leonardo Bras writes: > > > Before guest entry, TBU40 register is changed to reflect guest timebase. > > After exitting guest, the register is reverted to i

Re: [PATCH v2 1/1] powerpc/kvm: Save Timebase Offset to fix sched_clock() while running guest code.

2021-02-08 Thread Leonardo Bras
;& CONFIG_KVM_BOOK3S_HANDLER && CONFIG_PPC_BOOK3S_64 > > > > Or something the user need to select himself in menuconfig? > > Yeah I meant a default n thing under powerpc kernel debugging somewhere. So, IIUC all we can do is split this in 2 changes: 1 - Adding notrace to those functions 2 - Introducing a kernel debug config that reverts (1) and 'fixes' mftb If that's correct, I have some ideas we can use. For debug option, should we add the offset on get_tb() or mftb()? Another option would be to adding this tb_offset only in the routines used by tracing. But this could probably mean having to add a function in arch-generic code, but still an option. What do you think? > > Thanks, > Nick Thank you! Leonardo Bras

Re: [PATCH 1/1] kernel/smp: Split call_single_queue into 3 queues

2021-02-08 Thread Leonardo Bras
Hello Sebastian, Thanks for the feedback! On Thu, 2021-01-28 at 11:33 +0100, Sebastian Andrzej Siewior wrote: > On 2021-01-28 03:55:06 [-0300], Leonardo Bras wrote: > > Currently, during flush_smp_call_function_queue(): > > - All items are transversed once, for inverting. >

Re: [PATCH v5 2/2] powerpc/rtas: Implement reentrant rtas call

2020-05-18 Thread Leonardo Bras
s_? Sure, replacing reentrant_args with rtas_args_reentrant. > > Thanks, > Nick Thank you for the feedback! Leonardo Bras

[PATCH v6 1/2] powerpc/rtas: Move type/struct definitions from rtas.h into rtas-types.h

2020-05-18 Thread Leonardo Bras
checkpath.pl, replace uint8_t for u8, and keep the same type pattern for the whole file, as they are the same according to powerpc/boot/types.h. Signed-off-by: Leonardo Bras --- arch/powerpc/include/asm/rtas-types.h | 126 ++ arch/powerpc/include/asm/rtas.h | 118

[PATCH v6 0/2] Implement reentrant rtas call

2020-05-18 Thread Leonardo Bras
achine_crash_shutdown #6 machine_crash_shutdown #7 __crash_kexec #8 crash_kexec #9 oops_end Signed-off-by: Leonardo Bras Special thanks to Nick Piggin, who have been helping me a lot with this series! --- Changes since v5: - Renames new paca member from reentrant_args to rtas_a

[PATCH v6 2/2] powerpc/rtas: Implement reentrant rtas call

2020-05-18 Thread Leonardo Bras
cs_rtas_mask_real_irq (hw_irq=4100) #4 machine_kexec_mask_interrupts #5 default_machine_crash_shutdown #6 machine_crash_shutdown #7 __crash_kexec #8 crash_kexec #9 oops_end Signed-off-by: Leonardo Bras --- arch/powerpc/include/asm/paca.h | 4 +++ arch/powerpc/include/asm/rtas.h | 1 +

[PATCH v3 1/1] powerpc/crash: Use NMI context for printk when starting to crash

2020-05-18 Thread Leonardo Bras
the message, and avoid locking logbuf_lock. Suggested-by: Michael Ellerman Signed-off-by: Leonardo Bras --- Changes since v2: - Changes usage of printk_nmi_enter() to nmi_enter() (Suggested by Nick Piggin) Changes since v1: - Added in-code comment explaining the need of context change

Re: [PATCH v5 0/4] Allow bigger 64bit window by removing default DMA window

2020-08-11 Thread Leonardo Bras
Hello Michael, Do you suggest any change for this patchset? Any chance it can get in this merge window? Best regards, Leonardo Bras On Wed, 2020-08-05 at 00:04 -0300, Leonardo Bras wrote: > There are some devices in which a hypervisor may only allow 1 DMA window > to exist at a time,

Re: [PATCH v5 0/4] Allow bigger 64bit window by removing default DMA window

2020-08-05 Thread Leonardo Bras
Travis reported successful compilation with mpe/merge: https://travis-ci.org/github/LeoBras/linux-ppc/builds/715028857

[PATCH v2 1/1] powerpc/kvm: Fix mask size for emulated msgsndp

2020-12-08 Thread Leonardo Bras
6, missing bit 32 t: (arg &= 0x3f) : Gets (RB) 58:63, missing bit 57 Fixes this by applying the correct mask. Signed-off-by: Leonardo Bras --- Changes since v1: - Commit message 's/LSB/MSB/', because ISA ordering is big-endian. arch/powerpc/kvm/book3s_hv.c | 6 +++---

[PATCH 1/1] powerpc/kernel/iommu: Align size for IOMMU_PAGE_SIZE() to save TCEs

2021-03-18 Thread Leonardo Bras
mu_*_coherent() to make sure the size alignment happens only for IOMMU_PAGE_SIZE() before calling iommu_alloc() and iommu_free(). Also, on iommu_range_alloc(), replace ALIGN(n, 1 << tbl->it_page_shift) with IOMMU_PAGE_ALIGN(n, tbl), which is easier to read and does the same. Signed-off-by: L

[PATCH 1/1] powerpc/kernel/iommu: Use largepool as a last resort when !largealloc

2021-03-18 Thread Leonardo Bras
Add pages on largepool as a last resort for !largealloc, making all pages of the DMA window available. Signed-off-by: Leonardo Bras Reviewed-by: Alexey Kardashevskiy --- arch/powerpc/kernel/iommu.c | 9 + 1 file changed, 9 insertions(+) diff --git a/arch/powerpc/kernel/iommu.c b/a

[PATCH 1/1] powerpc/iommu: Enable remaining IOMMU Pagesizes present in LoPAR

2021-03-22 Thread Leonardo Bras
r 32M, 64M, 128M, 256M and 16G. Enabling bigger pages would be interesting for direct mapping systems with a lot of RAM, while using less TCE entries. Signed-off-by: Leonardo Bras --- arch/powerpc/include/asm/iommu.h | 8 arch/powerpc/platforms/pseries/io

[PATCH 1/1] of/pci: Add IORESOURCE_MEM_64 to resource flags for 64-bit memory addresses

2021-04-15 Thread Leonardo Bras
know which one is which. Signed-off-by: Leonardo Bras --- drivers/of/address.c | 5 - 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/of/address.c b/drivers/of/address.c index 73ddf2540f3f..dc7147843783 100644 --- a/drivers/of/address.c +++ b/drivers/of/address.c @@ -1

Re: [PATCH 1/1] of/pci: Add IORESOURCE_MEM_64 to resource flags for 64-bit memory addresses

2021-04-16 Thread Leonardo Bras
Hello Rob, thanks for this feedback! On Thu, 2021-04-15 at 13:59 -0500, Rob Herring wrote: > +PPC and PCI lists > > On Thu, Apr 15, 2021 at 1:01 PM Leonardo Bras wrote: > > > > Many other resource flag parsers already add this flag when the input > > has bits 24 &

Re: [PATCH 1/1] of/pci: Add IORESOURCE_MEM_64 to resource flags for 64-bit memory addresses

2021-04-16 Thread Leonardo Bras
Hello Rob, thanks for this feedback! On Thu, 2021-04-15 at 13:59 -0500, Rob Herring wrote: > +PPC and PCI lists > > On Thu, Apr 15, 2021 at 1:01 PM Leonardo Bras wrote: > > > > Many other resource flag parsers already add this flag when the input > > has bits 24 &

Re: [PATCH v2 1/1] powerpc/iommu: Enable remaining IOMMU Pagesizes present in LoPAR

2021-04-13 Thread Leonardo Bras
hing reduces the mental load a lot. You can add > a comment at the single spot you use them, explaining what this is, in a > much better way! > > Comments are *good*. > > > Segher Thanks for the feedback Alexey, Michael and Segher! I have sent a v3 for this patch.  http://patchwork.ozlabs.org/project/linuxppc-dev/patch/20210408201915.174217-1-leobra...@gmail.com/ Please let me know of your feedback in it. Best regards, Leonardo Bras

Re: [PATCH 1/1] of/pci: Add IORESOURCE_MEM_64 to resource flags for 64-bit memory addresses

2021-04-19 Thread Leonardo Bras
On Mon, 2021-04-19 at 10:44 -0500, Rob Herring wrote: > On Fri, Apr 16, 2021 at 3:58 PM Leonardo Bras wrote: > > > > Hello Rob, thanks for this feedback! > > > > On Thu, 2021-04-15 at 13:59 -0500, Rob Herring wrote: > > > +PPC and PCI lists > > > &

Re: [PATCH 1/1] of/pci: Add IORESOURCE_MEM_64 to resource flags for 64-bit memory addresses

2021-04-19 Thread Leonardo Bras
On Mon, 2021-04-19 at 20:39 -0500, Rob Herring wrote: > On Mon, Apr 19, 2021 at 7:35 PM Leonardo Bras wrote: > > > > On Mon, 2021-04-19 at 10:44 -0500, Rob Herring wrote: > > > On Fri, Apr 16, 2021 at 3:58 PM Leonardo Bras wrote: > > > > > &g

[PATCH 1/1] powerpc/pseries/iommu: Fix window size for direct mapping with pmem

2021-04-19 Thread Leonardo Bras
be created, being insufficient for correct usage. Fix this so the correct window size is used in this case. Fixes: bf6e2d562bbc4("powerpc/dma: Fallback to dma_ops when persistent memory present") Signed-off-by: Leonardo Bras --- arch/powerpc/platforms/pseries/iommu.c | 2 +- 1 file

Re: [PATCH 1/1] powerpc/pseries/iommu: Fix window size for direct mapping with pmem

2021-04-19 Thread Leonardo Bras
On Tue, 2021-04-20 at 15:18 +1000, Alexey Kardashevskiy wrote: > > On 20/04/2021 14:54, Leonardo Bras wrote: > > As of today, if the DDW is big enough to fit (1 << MAX_PHYSMEM_BITS) it's > > possible to use direct DMA mapping even with pmem region. > > > &

[PATCH 0/3] powerpc/mm/hash: Time improvements for memory hot(un)plug

2021-03-11 Thread Leonardo Bras
lug = 21s, hotunplug = 100s. Any feedback will be appreciated! I believe the code may not be very well placed in available files, so please give some feedback on that. Best regards, Leonardo Bras (3): powerpc/mm/hash: Avoid resizing-down HPT on first memory hotplug powerpc/mm/hash: Avoid mu

[PATCH 1/3] powerpc/mm/hash: Avoid resizing-down HPT on first memory hotplug

2021-03-11 Thread Leonardo Bras
memory hotplug times. As an example, hotplugging 256GB on a 129GB guest took 710s without this patch, and 21s after applied. Signed-off-by: Leonardo Bras --- arch/powerpc/mm/book3s64/hash_utils.c | 36 --- 1 file changed, 21 insertions(+), 15 deletions(-) diff --git a/arch

[PATCH 3/3] powerpc/mm/hash: Avoid multiple HPT resize-downs on memory hotunplug

2021-03-11 Thread Leonardo Bras
ry to temporarily disable all HPT resize-downs before hotunplug, re-enable them after hotunplug ends, and then resize-down HPT to the current memory size. As an example, hotunplugging 256GB from a 385GB guest took 621s without this patch, and 100s after applied. Signed-off-by: Leonardo Bras ---

[PATCH 2/3] powerpc/mm/hash: Avoid multiple HPT resize-ups on memory hotplug

2021-03-11 Thread Leonardo Bras
memory: Adding 256G to a 2GB guest, for example will require 8 HPT resizes. Perform an HPT resize before memory hotplug, updating HPT to its final size (considering a successful hotplug), taking the number of HPT resizes to at most one per memory hotplug action. Signed-off-by: Leonardo Bras --- arch

[PATCH 1/1] kernel/smp: Split call_single_queue into 3 queues

2021-01-27 Thread Leonardo Bras
t ignores the cpu-offlining case, in which all items would be transversed again, in both cases.) Signed-off-by: Leonardo Bras --- kernel/smp.c | 173 ++- 1 file changed, 87 insertions(+), 86 deletions(-) diff --git a/kernel/smp.c b/kernel/sm

Re: [PATCH v2 1/1] netfilter: nf_tables: fib: Drop IPV6 packages if IPv6 is disabled on boot

2019-08-29 Thread Leonardo Bras
> Thats a good point -- Leonardo, is the > "net.bridge.bridge-nf-call-ip6tables" sysctl on? Running # sudo sysctl -a I can see: net.bridge.bridge-nf-call-ip6tables = 1 So this packets are sent to host iptables for processing? (Sorry for the delay, I did not received the previous e-mails. Pleas

Re: [PATCH v2 1/1] netfilter: nf_tables: fib: Drop IPV6 packages if IPv6 is disabled on boot

2019-08-29 Thread Leonardo Bras
On Thu, 2019-08-29 at 17:04 -0300, Leonardo Bras wrote: > > Thats a good point -- Leonardo, is the > > "net.bridge.bridge-nf-call-ip6tables" sysctl on? > > Running > # sudo sysctl -a > I can see: > net.bridge.bridge-nf-call-ip6tables = 1 Also, doing # ech

Re: [PATCH v2 1/1] netfilter: nf_tables: fib: Drop IPV6 packages if IPv6 is disabled on boot

2019-08-30 Thread Leonardo Bras
bridge/br_netfilter_hooks.c, br_nf_pre_routing() to >make sure ipv6_mod_enabled() is true before doing the ipv6 stack >"emulation". > > Makes sense? IMHO sure. Shortly, I will send a couple patches proposing the above changes. (Or my best understanding about them :) ) > >

Re: [PATCH v2 1/1] netfilter: nf_tables: fib: Drop IPV6 packages if IPv6 is disabled on boot

2019-08-30 Thread Leonardo Bras
ype. Both are already protected by this current patch. Is your 1st suggestion about this patch, or you think it's better to move this change to nft_fib_netdev_eval ? Best regards, Leonardo Bras signature.asc Description: This is a digitally signed message part

Re: [PATCH v2 1/1] netfilter: nf_tables: fib: Drop IPV6 packages if IPv6 is disabled on boot

2019-08-30 Thread Leonardo Bras
On Thu, 2019-08-29 at 22:58 +0200, Florian Westphal wrote: > Ah, it was the latter. > Making bridge netfilter not pass packets up with ipv6 off closes > the problem for fib_ipv6 and inet, so only _netdev.c needs fixing. Ok then, preparing a v4. https://lkml.org/lkml/2019/8/30/843 signature.asc

Re: [PATCH 1/1] netfilter: nf_tables: fib: Drop IPV6 packages if IPv6 is disabled on boot

2019-08-21 Thread Leonardo Bras
On Wed, 2019-08-21 at 11:58 +0200, Pablo Neira Ayuso wrote: > On Tue, Aug 20, 2019 at 01:15:58PM -0300, Leonardo Bras wrote: > > On Tue, 2019-08-20 at 07:36 +0200, Florian Westphal wrote: > > > Wouldn't fib_netdev.c have the same problem? > > Probably, but

[PATCH v2 1/1] netfilter: nf_tables: fib: Drop IPV6 packages if IPv6 is disabled on boot

2019-08-21 Thread Leonardo Bras
: Kernel NULL pointer dereference at 0x0038 Fix this behavior by dropping IPv6 packages if !ipv6_mod_enabled(). Signed-off-by: Leonardo Bras --- Changes from v1: - Move drop logic from nft_fib_inet_eval() to nft_fib6_eval{,_type} so it can affect other usages of these functions. net/ipv6

Re: [PATCH 1/1] fs/splice.c: Fix old documentation about moving pages

2019-08-16 Thread Leonardo Bras
On Thu, 2019-08-08 at 15:19 -0300, Leonardo Bras wrote: > On Thu, 2019-08-01 at 19:38 -0300, Leonardo Bras wrote: > > Since commit 485ddb4b9741 ("1/2 splice: dont steal")' (2007), > > the SPLICE_F_MOVE support was removed (became a no-op according > > to

Re: [PATCH v2 1/1] netfilter: nf_tables: fib: Drop IPV6 packages if IPv6 is disabled on boot

2019-08-27 Thread Leonardo Bras
On Tue, 2019-08-27 at 12:35 +0200, Pablo Neira Ayuso wrote: > On Wed, Aug 21, 2019 at 11:15:06AM -0300, Leonardo Bras wrote: > > If IPv6 is disabled on boot (ipv6.disable=1), but nft_fib_inet ends up > > dealing with a IPv6 package, it causes a kernel panic in > > fib6_node_lo

Re: [PATCH v2 1/1] netfilter: nf_tables: fib: Drop IPV6 packages if IPv6 is disabled on boot

2019-08-27 Thread Leonardo Bras
On Tue, 2019-08-27 at 20:51 +0200, Pablo Neira Ayuso wrote: > > > The drop case at the bottom of the fib eval function never actually > > > never happens. > > > > Which one do you mean? > > Line 31 of net/netfilter/nft_fib_inet.c. Oh, yeah, I was thinking about that when I wrote the patch. Thanks

[PATCH v3 1/1] netfilter: nf_tables: fib: Drop IPV6 packets if IPv6 is disabled on boot

2019-08-27 Thread Leonardo Bras
: Kernel NULL pointer dereference at 0x0038 Fix this behavior by dropping IPv6 packets if !ipv6_mod_enabled(). Signed-off-by: Leonardo Bras --- Changes from v2: - Replace veredict.code from NF_DROP to NFT_BREAK - Updated commit message (s/package/packet) Changes from v1: - Move drop logic from

Re: [PATCH 1/1] netfilter: nf_tables: fib: Drop IPV6 packages if IPv6 is disabled on boot

2019-08-26 Thread Leonardo Bras
Hello Pablo, Florian, I implemented a V2 of this patch with the changes you proposed. Could you please give your feedback on that patch? https://lkml.org/lkml/2019/8/21/527 Thanks! On Wed, 2019-08-21 at 11:58 +0200, Pablo Neira Ayuso wrote: > On Tue, Aug 20, 2019 at 01:15:58PM -0300, Leona

[PATCH 1/1] powerpc: mm: Check if serialize_against_pte_lookup() really needs to run

2019-09-16 Thread Leonardo Bras
ust skip smp_call_function_many(). On my workload (qemu), I could see munmap's time reduction from 275 seconds to 418ms. Signed-off-by: Leonardo Bras --- I need more experienced people's help in order to understand if this is really a valid improvement, and if mm_struct is the best place to put suc

Re: [PATCH 1/1] powerpc: mm: Check if serialize_against_pte_lookup() really needs to run

2019-09-17 Thread Leonardo Bras
by current behavior. > Move that to ppc64 specific mm_context_t. Ok, fixed! I will send that on v2. Best regards, Leonardo Bras signature.asc Description: This is a digitally signed message part

Re: [PATCH v5 00/11] Introduces new count-based method for tracking lockless pagetable walks

2019-10-03 Thread Leonardo Bras
Hello Peter, thanks for the feedback! On Thu, 2019-10-03 at 09:29 +0200, Peter Zijlstra wrote: > On Wed, Oct 02, 2019 at 10:33:14PM -0300, Leonardo Bras wrote: > > If a process (qemu) with a lot of CPUs (128) try to munmap() a large > > chunk of memory (496GB) mapped with THP, it t

Re: [PATCH v5 10/11] mm/Kconfig: Adds config option to track lockless pagetable walks

2019-10-03 Thread Leonardo Bras
On Thu, 2019-10-03 at 09:44 +0200, Peter Zijlstra wrote: > This shouldn't be a user visible option at all. Either the arch needs > it and selects it or not. You are right. I will do that on v6. Thanks for the feedback! signature.asc Description: This is a digitally signed message part

Re: [PATCH v5 01/11] asm-generic/pgtable: Adds generic functions to monitor lockless pgtable walks

2019-10-03 Thread Leonardo Bras
Hello Peter, thanks for the feedback! On Thu, 2019-10-03 at 13:51 +0200, Peter Zijlstra wrote: > On Thu, Oct 03, 2019 at 09:11:45AM +0200, Peter Zijlstra wrote: > > On Wed, Oct 02, 2019 at 10:33:15PM -0300, Leonardo Bras wrote: > > > diff --git a/include/asm-generic/pgtab

Re: [PATCH v5 00/11] Introduces new count-based method for tracking lockless pagetable walks

2019-10-03 Thread Leonardo Bras
On Thu, 2019-10-03 at 13:49 -0700, John Hubbard wrote: > Yes. And to clarify, I was assuming that the changes to mm/gup.c were > required in order to accomplish your goals. Given that assumption, I > wanted the generic code to be "proper", and that's what that feedback > is about. You assumed ri

Re: [PATCH v3 00/11] Introduces new count-based method for monitoring lockless pagetable walks

2019-09-27 Thread Leonardo Bras
On Fri, 2019-09-27 at 11:46 -0300, Leonardo Bras wrote: > I am not sure if it would be ok to use irq_{save,restore} in real mode, > I will do some more reading of the docs before addressing this. It looks like it's unsafe to merge irq_{save,restore} in {start,end}_lockless_pgtbl_walk(

[PATCH v4 01/11] powerpc/mm: Adds counting method to monitor lockless pgtable walks

2019-09-27 Thread Leonardo Bras
walk end_lockless_pgtbl_walk(mm) Insert after the end of any lockless pgtable walk (Mostly after the ptep is last used) running_lockless_pgtbl_walk(mm) Returns the number of lockless pgtable walks running Signed-off-by: Leonardo Bras --- arch/powerpc/include/asm/book3s/64/mmu.h

[PATCH v4 00/11] Introduces new count-based method for monitoring lockless pagetable walks

2019-09-27 Thread Leonardo Bras
tions in functions *_lockless_pgtbl_walk() Fixed behavior of decrementing before last ptep was used Link: http://patchwork.ozlabs.org/patch/1163093/ Leonardo Bras (11): powerpc/mm: Adds counting method to monitor lockless pgtable walks asm-generic/pgtable: Adds dummy functions to monito

[PATCH v4 09/11] powerpc/kvm/book3s_64: Applies counting method to monitor lockless pgtbl walks

2019-09-27 Thread Leonardo Bras
lmode + MSR_EE = 0. Signed-off-by: Leonardo Bras --- arch/powerpc/kvm/book3s_64_mmu_hv.c| 2 ++ arch/powerpc/kvm/book3s_64_mmu_radix.c | 30 ++ arch/powerpc/kvm/book3s_64_vio_hv.c| 3 +++ 3 files changed, 35 insertions(+) diff --git a/arch/powerpc/kvm/book3s_64_mmu

[PATCH v4 02/11] asm-generic/pgtable: Adds dummy functions to monitor lockless pgtable walks

2019-09-27 Thread Leonardo Bras
approach, that counts the number of lockless pagetable walks happening on the process. Given that there are lockless pagetable walks on generic code, it's necessary to create dummy functions for archs that won't use the approach. Signed-off-by: Leonardo Bras --- include/asm-generic

[PATCH v4 03/11] mm/gup: Applies counting method to monitor gup_pgd_range

2019-09-27 Thread Leonardo Bras
t use this method. Signed-off-by: Leonardo Bras --- mm/gup.c | 8 1 file changed, 8 insertions(+) diff --git a/mm/gup.c b/mm/gup.c index 98f13ab37bac..7105c829cf44 100644 --- a/mm/gup.c +++ b/mm/gup.c @@ -2325,6 +2325,7 @@ static bool gup_fast_permitted(unsigned long start, unsigned long

  1   2   3   4   >