Re: [PATCH v8 2/3] tty: hvc: pass DMA capable memory to put_chars()

2021-08-19 Thread Daniel Axtens
Xianting Tian writes: > As well known, hvc backend driver(eg, virtio-console) can register its > operations to hvc framework. The operations can contain put_chars(), > get_chars() and so on. > > Some hvc backend may do dma in its operations. eg, put_chars() of > virtio-console. But in the code of

[PATCH] powerpc: Avoid link stack corruption in {add_}reloc_offset

2021-08-19 Thread Christophe Leroy
reloc_offset() / add_reloc_offset() used bl;mflr to get code position. Use bcl 20,31,+4 instead of bl in order to preserve link stack. See commit c974809a26a1 ("powerpc/vdso: Avoid link stack corruption in __get_datapage()") for details. Signed-off-by: Christophe Leroy --- arch/powerpc/kernel/

[PATCH] powerpc/32: indirect function call use bctrl rather than blrl in ret_from_kernel_thread

2021-08-19 Thread Christophe Leroy
Copied from commit 89bbe4c798bc ("powerpc/64: indirect function call use bctrl rather than blrl in ret_from_kernel_thread") blrl is not recommended to use as an indirect function call, as it may corrupt the link stack predictor. This is not a performance critical path but this should be fixed for

Re: [PATCH v2 2/2] powerpc: rectify selection to ARCH_ENABLE_SPLIT_PMD_PTLOCK

2021-08-19 Thread Michael Ellerman
Daniel Axtens writes: > Lukas Bulwahn writes: > >> Commit 66f24fa766e3 ("mm: drop redundant ARCH_ENABLE_SPLIT_PMD_PTLOCK") >> selects the non-existing config ARCH_ENABLE_PMD_SPLIT_PTLOCK in >> ./arch/powerpc/platforms/Kconfig.cputype, but clearly it intends to select >> ARCH_ENABLE_SPLIT_PMD_PTLO

Re: [PATCH 1/5] KVM: rseq: Update rseq when processing NOTIFY_RESUME on xfer to KVM guest

2021-08-19 Thread Sean Christopherson
On Thu, Aug 19, 2021, Mathieu Desnoyers wrote: > - On Aug 17, 2021, at 8:12 PM, Sean Christopherson sea...@google.com > wrote: > > @@ -250,7 +250,7 @@ static int rseq_ip_fixup(struct pt_regs *regs) > > * If not nested over a rseq critical section, restart is useless. > > * Clear the

Re: [PATCH 4/5] KVM: selftests: Add a test for KVM_RUN+rseq to detect task migration bugs

2021-08-19 Thread Sean Christopherson
On Thu, Aug 19, 2021, Mathieu Desnoyers wrote: > - On Aug 17, 2021, at 8:12 PM, Sean Christopherson sea...@google.com > wrote: > > > Add a test to verify an rseq's CPU ID is updated correctly if the task is > > migrated while the kernel is handling KVM_RUN. This is a regression test > > for

[PATCH linux-next] ps3: remove unneeded semicolon

2021-08-19 Thread jing yangyang
Eliminate the following coccicheck warning: ./arch/powerpc/platforms/ps3/system-bus.c:606:2-3: Unneeded semicolon ./arch/powerpc/platforms/ps3/system-bus.c:765:2-3: Unneeded semicolon Reported-by: Zeal Robot Signed-off-by: jing yangyang --- arch/powerpc/platforms/ps3/system-bus.c | 4 ++-- 1 f

[PATCH linux-next] macintosh: fix warning comparing pointer to 0

2021-08-19 Thread jing yangyang
Fix the following coccicheck warning: ./drivers/macintosh/windfarm_pm91.c:152:12-13:WARNING comparing pointer to 0 Reported-by: Zeal Robot Signed-off-by: jing yangyang --- drivers/macintosh/windfarm_pm91.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/macintosh/wi

[powerpc:fixes-test] BUILD SUCCESS 9f7853d7609d59172eecfc5e7ccf503bc1b690bd

2021-08-19 Thread kernel test robot
allmodconfig i386 randconfig-c001-20210819 i386 randconfig-c001-20210818 powerpc pcm030_defconfig arm socfpga_defconfig m68k m5275evb_defconfig sh se7619_defconfig

[Bug 213079] [bisected] IRQ problems and crashes on a PowerMac G5 with 5.12.3

2021-08-19 Thread bugzilla-daemon
https://bugzilla.kernel.org/show_bug.cgi?id=213079 Erhard F. (erhar...@mailbox.org) changed: What|Removed |Added Attachment #297439|0 |1 is obsolete|

[Bug 213079] [bisected] IRQ problems and crashes on a PowerMac G5 with 5.12.3

2021-08-19 Thread bugzilla-daemon
https://bugzilla.kernel.org/show_bug.cgi?id=213079 Erhard F. (erhar...@mailbox.org) changed: What|Removed |Added Attachment #297473|0 |1 is obsolete|

Re: [PATCH v2 2/2] powerpc: rectify selection to ARCH_ENABLE_SPLIT_PMD_PTLOCK

2021-08-19 Thread Daniel Axtens
Lukas Bulwahn writes: > Commit 66f24fa766e3 ("mm: drop redundant ARCH_ENABLE_SPLIT_PMD_PTLOCK") > selects the non-existing config ARCH_ENABLE_PMD_SPLIT_PTLOCK in > ./arch/powerpc/platforms/Kconfig.cputype, but clearly it intends to select > ARCH_ENABLE_SPLIT_PMD_PTLOCK here (notice the word swapp

Re: [PATCH v2 1/2] powerpc: kvm: remove obsolete and unneeded select

2021-08-19 Thread Daniel Axtens
Hi Lukas, > diff --git a/arch/powerpc/kvm/Kconfig b/arch/powerpc/kvm/Kconfig > index e45644657d49..ff581d70f20c 100644 > --- a/arch/powerpc/kvm/Kconfig > +++ b/arch/powerpc/kvm/Kconfig > @@ -38,7 +38,6 @@ config KVM_BOOK3S_32_HANDLER > config KVM_BOOK3S_64_HANDLER > bool > select KVM_

Re: [PATCH 4/5] KVM: selftests: Add a test for KVM_RUN+rseq to detect task migration bugs

2021-08-19 Thread Mathieu Desnoyers
- On Aug 17, 2021, at 8:12 PM, Sean Christopherson sea...@google.com wrote: > Add a test to verify an rseq's CPU ID is updated correctly if the task is > migrated while the kernel is handling KVM_RUN. This is a regression test > for a bug introduced by commit 72c3c0fe54a3 ("x86/kvm: Use gener

Re: [PATCH 1/5] KVM: rseq: Update rseq when processing NOTIFY_RESUME on xfer to KVM guest

2021-08-19 Thread Mathieu Desnoyers
- On Aug 17, 2021, at 8:12 PM, Sean Christopherson sea...@google.com wrote: > Invoke rseq's NOTIFY_RESUME handler when processing the flag prior to > transferring to a KVM guest, which is roughly equivalent to an exit to > userspace and processes many of the same pending actions. While the ta

Re: [PATCH 2/5] entry: rseq: Call rseq_handle_notify_resume() in tracehook_notify_resume()

2021-08-19 Thread Mathieu Desnoyers
- On Aug 17, 2021, at 8:12 PM, Sean Christopherson sea...@google.com wrote: > Invoke rseq_handle_notify_resume() from tracehook_notify_resume() now > that the two function are always called back-to-back by architectures > that have rseq. The rseq helper is stubbed out for architectures that >

Re: [PATCH 3/7] powerpc: replace cc-option-yn uses with cc-option

2021-08-19 Thread Masahiro Yamada
On Tue, Aug 17, 2021 at 11:31 AM Michael Ellerman wrote: > > Nick Desaulniers writes: > > cc-option-yn can be replaced with cc-option. ie. > > Checking for support: > > ifeq ($(call cc-option-yn,$(FLAG)),y) > > becomes: > > ifneq ($(call cc-option,$(FLAG)),) > > > > Checking for lack of support:

Re: [PATCH v2 03/12] x86/sev: Add an x86 version of prot_guest_has()

2021-08-19 Thread Kuppuswamy, Sathyanarayanan
On 8/19/21 11:33 AM, Tom Lendacky wrote: There was some talk about this on the mailing list where TDX and SEV may need to be differentiated, so we wanted to reserve a range of values per technology. I guess I can remove them until they are actually needed. In TDX also we have similar require

Re: [PATCH 5/6] audit: Declare ppc32_classify_syscall()

2021-08-19 Thread Christophe Leroy
Le 19/08/2021 à 16:56, Christophe Leroy a écrit : Le 19/08/2021 à 14:56, Cédric Le Goater a écrit : This fixes a compile error with W=1. Cc: Christophe Leroy Signed-off-by: Cédric Le Goater ---   I don't think this is correct. Which file could we use ? I think you can completely remov

Re: [PATCH v2 04/12] powerpc/pseries/svm: Add a powerpc version of prot_guest_has()

2021-08-19 Thread Tom Lendacky
On 8/19/21 4:55 AM, Christoph Hellwig wrote: > On Fri, Aug 13, 2021 at 11:59:23AM -0500, Tom Lendacky wrote: >> +static inline bool prot_guest_has(unsigned int attr) > > No reall need to have this inline. In fact I'd suggest we havea the > prototype in a common header so that everyone must implem

Re: [PATCH v2 03/12] x86/sev: Add an x86 version of prot_guest_has()

2021-08-19 Thread Tom Lendacky
On 8/19/21 4:52 AM, Christoph Hellwig wrote: > On Fri, Aug 13, 2021 at 11:59:22AM -0500, Tom Lendacky wrote: >> While the name suggests this is intended mainly for guests, it will >> also be used for host memory encryption checks in place of sme_active(). > > Which suggest that the name is not goo

Re: [PATCH v2 03/12] x86/sev: Add an x86 version of prot_guest_has()

2021-08-19 Thread Borislav Petkov
On Thu, Aug 19, 2021 at 10:52:53AM +0100, Christoph Hellwig wrote: > Which suggest that the name is not good to start with. Maybe protected > hardware, system or platform might be a better choice? Yah, coming up with a proper name here hasn't been easy. prot_guest_has() is not the first variant.

Re: [PATCH v2 02/12] mm: Introduce a function to check for virtualization protection features

2021-08-19 Thread Tom Lendacky
On 8/19/21 4:46 AM, Christoph Hellwig wrote: > On Fri, Aug 13, 2021 at 11:59:21AM -0500, Tom Lendacky wrote: >> +#define PATTR_MEM_ENCRYPT 0 /* Encrypted memory */ >> +#define PATTR_HOST_MEM_ENCRYPT 1 /* Host encrypted >> memory */ >> +#define PATTR_GUEST_MEM_ENC

[PATCH v2 3/3] powerpc: Define and use MSR_RI only on non booke/40x

2021-08-19 Thread Christophe Leroy
40x and BOOKE don't have MSR_RI. Define MSR_RI only for platforms where it exists. For the other ones, defines it as BUILD_BUG for C and do not define it for ASM. Signed-off-by: Christophe Leroy --- arch/powerpc/include/asm/reg.h | 4 arch/powerpc/include/asm/reg_booke.h | 6 +++---

[PATCH v2 2/3] powerpc: Refactor verification of MSR_RI

2021-08-19 Thread Christophe Leroy
40x and BOOKE don't have MSR_RI therefore all tests involving MSR_RI may be problematic on those plateforms. Create helpers to check or set MSR_RI in regs, and use them in common code. Signed-off-by: Christophe Leroy --- v2: Remove superflous { --- arch/powerpc/include/asm/ptrace.h

[PATCH v2 1/3] powerpc: Remove MSR_PR check in interrupt_exit_{user/kernel}_prepare()

2021-08-19 Thread Christophe Leroy
In those hot functions that are called at every interrupt, any saved cycle is worth it. interrupt_exit_user_prepare() and interrupt_exit_kernel_prepare() are called from three places: - From entry_32.S - From interrupt_64.S - From interrupt_exit_user_restart() and interrupt_exit_kernel_restart()

Re: [PATCH 5/6] audit: Declare ppc32_classify_syscall()

2021-08-19 Thread Christophe Leroy
Le 19/08/2021 à 14:56, Cédric Le Goater a écrit : This fixes a compile error with W=1. Cc: Christophe Leroy Signed-off-by: Cédric Le Goater --- I don't think this is correct. Which file could we use ? I think you can completely remove ppc32_classify_syscall(), and instead add the follo

Re: [PATCH 3/6] KVM: PPC: Book3S PR: Declare kvmppc_handle_exit_pr()

2021-08-19 Thread Christophe Leroy
Le 19/08/2021 à 14:56, Cédric Le Goater a écrit : This fixes a compile error with W=1. Signed-off-by: Cédric Le Goater --- arch/powerpc/kvm/book3s.h | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/powerpc/kvm/book3s.h b/arch/powerpc/kvm/book3s.h index 740e51def5a5..c08f93b7f523 1

Re: [PATCH 1/6] powerpc/prom: Introduce early_reserve_mem_old()

2021-08-19 Thread Christophe Leroy
Le 19/08/2021 à 14:56, Cédric Le Goater a écrit : and condition its call with IS_ENABLED(CONFIG_PPC32). This fixes a compile error with W=1. arch/powerpc/kernel/prom.c: In function ‘early_reserve_mem’: arch/powerpc/kernel/prom.c:625:10: error: variable ‘reserve_map’ set but not used [-Werror

Re: [PATCH 2/3] powerpc: Refactor verification of MSR_RI

2021-08-19 Thread kernel test robot
Hi Christophe, I love your patch! Perhaps something to improve: [auto build test WARNING on powerpc/next] [also build test WARNING on v5.14-rc6 next-20210819] [If your patch is applied to the wrong git tree, kindly drop us a note. And when submitting patch, we suggest to use '--bas

[PATCH 4/6] KVM: PPC: Book3S PR: Remove unused variable

2021-08-19 Thread Cédric Le Goater
This fixes a compile error with W=1. Signed-off-by: Cédric Le Goater --- May be, this was sent already ? arch/powerpc/kvm/book3s_64_mmu.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/arch/powerpc/kvm/book3s_64_mmu.c b/arch/powerpc/kvm/book3s_64_mmu.c index 26b8b27a37

[PATCH 0/6] W=1 fixes

2021-08-19 Thread Cédric Le Goater
Hello, With this small series, I could compile the ppc kernel with W=1. There are certainly other configs which will need more fixes but it's a good start. The last 2 patches look hacky. Christophe, could you help with these to find a better place to include the declarations ? Thanks, C. Cédr

[PATCH 2/6] powerpc/pseries/vas: Declare pseries_vas_fault_thread_fn() as static

2021-08-19 Thread Cédric Le Goater
This fixes a compile error with W=1. Fixes: 6d0aaf5e0de0 ("powerpc/pseries/vas: Setup IRQ and fault handling") Cc: Haren Myneni Signed-off-by: Cédric Le Goater --- arch/powerpc/platforms/pseries/vas.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/powerpc/platforms/pse

[PATCH 5/6] audit: Declare ppc32_classify_syscall()

2021-08-19 Thread Cédric Le Goater
This fixes a compile error with W=1. Cc: Christophe Leroy Signed-off-by: Cédric Le Goater --- I don't think this is correct. Which file could we use ? arch/powerpc/include/asm/unistd.h | 3 +++ arch/powerpc/kernel/audit.c | 1 - 2 files changed, 3 insertions(+), 1 deletion(-) diff --

[PATCH 6/6] powerpc/compat_sys: Declare syscalls

2021-08-19 Thread Cédric Le Goater
This fixes a compile error with W=1. Cc: Christophe Leroy Signed-off-by: Cédric Le Goater --- arch/powerpc/include/asm/syscalls.h | 31 + 1 file changed, 31 insertions(+) diff --git a/arch/powerpc/include/asm/syscalls.h b/arch/powerpc/include/asm/syscalls.h index 3

[PATCH 3/6] KVM: PPC: Book3S PR: Declare kvmppc_handle_exit_pr()

2021-08-19 Thread Cédric Le Goater
This fixes a compile error with W=1. Signed-off-by: Cédric Le Goater --- arch/powerpc/kvm/book3s.h | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/powerpc/kvm/book3s.h b/arch/powerpc/kvm/book3s.h index 740e51def5a5..c08f93b7f523 100644 --- a/arch/powerpc/kvm/book3s.h +++ b/arch/powerpc/

[PATCH 1/6] powerpc/prom: Introduce early_reserve_mem_old()

2021-08-19 Thread Cédric Le Goater
and condition its call with IS_ENABLED(CONFIG_PPC32). This fixes a compile error with W=1. arch/powerpc/kernel/prom.c: In function ‘early_reserve_mem’: arch/powerpc/kernel/prom.c:625:10: error: variable ‘reserve_map’ set but not used [-Werror=unused-but-set-variable] __be64 *reserve_map;

Re: [PATCH v2 0/2] Kconfig symbol fixes on powerpc

2021-08-19 Thread Christophe Leroy
Le 19/08/2021 à 13:39, Lukas Bulwahn a écrit : Dear powerpc maintainers, The script ./scripts/checkkconfigsymbols.py warns on invalid references to Kconfig symbols (often, minor typos, name confusions or outdated references). This patch series addresses all issues reported by ./scripts/check

[PATCH v2 2/2] powerpc: rectify selection to ARCH_ENABLE_SPLIT_PMD_PTLOCK

2021-08-19 Thread Lukas Bulwahn
Commit 66f24fa766e3 ("mm: drop redundant ARCH_ENABLE_SPLIT_PMD_PTLOCK") selects the non-existing config ARCH_ENABLE_PMD_SPLIT_PTLOCK in ./arch/powerpc/platforms/Kconfig.cputype, but clearly it intends to select ARCH_ENABLE_SPLIT_PMD_PTLOCK here (notice the word swapping!), as this commit does selec

[PATCH v2 0/2] Kconfig symbol fixes on powerpc

2021-08-19 Thread Lukas Bulwahn
Dear powerpc maintainers, The script ./scripts/checkkconfigsymbols.py warns on invalid references to Kconfig symbols (often, minor typos, name confusions or outdated references). This patch series addresses all issues reported by ./scripts/checkkconfigsymbols.py in ./drivers/usb/ for Kconfig and

[PATCH v2 1/2] powerpc: kvm: remove obsolete and unneeded select

2021-08-19 Thread Lukas Bulwahn
Commit a278e7ea608b ("powerpc: Fix compile issue with force DAWR") selects the non-existing config PPC_DAWR_FORCE_ENABLE for config KVM_BOOK3S_64_HANDLER. As this commit also introduces a config PPC_DAWR and this config PPC_DAWR is selected with PPC if PPC64, there is no need for any further select

Re: [PATCH v2 04/12] powerpc/pseries/svm: Add a powerpc version of prot_guest_has()

2021-08-19 Thread Christoph Hellwig
On Fri, Aug 13, 2021 at 11:59:23AM -0500, Tom Lendacky wrote: > +static inline bool prot_guest_has(unsigned int attr) No reall need to have this inline. In fact I'd suggest we havea the prototype in a common header so that everyone must implement it out of line.

Re: [PATCH 2/2] powerpc: rectify selection to ARCH_ENABLE_SPLIT_PMD_PTLOCK

2021-08-19 Thread Anshuman Khandual
On 8/19/21 3:02 PM, Lukas Bulwahn wrote: > Commit 66f24fa766e3 ("mm: drop redundant ARCH_ENABLE_SPLIT_PMD_PTLOCK") > selects the non-existing config ARCH_ENABLE_PMD_SPLIT_PTLOCK in > ./arch/powerpc/platforms/Kconfig.cputype, but clearly it intends to select > ARCH_ENABLE_SPLIT_PMD_PTLOCK here (n

Re: [PATCH v2 03/12] x86/sev: Add an x86 version of prot_guest_has()

2021-08-19 Thread Christoph Hellwig
On Fri, Aug 13, 2021 at 11:59:22AM -0500, Tom Lendacky wrote: > While the name suggests this is intended mainly for guests, it will > also be used for host memory encryption checks in place of sme_active(). Which suggest that the name is not good to start with. Maybe protected hardware, system or

Re: [PATCH 1/2] powerpc: kvm: rectify selection to PPC_DAWR

2021-08-19 Thread Lukas Bulwahn
On Thu, Aug 19, 2021 at 11:45 AM Christophe Leroy wrote: > > > > Le 19/08/2021 à 11:32, Lukas Bulwahn a écrit : > > Commit a278e7ea608b ("powerpc: Fix compile issue with force DAWR") > > selects the non-existing config PPC_DAWR_FORCE_ENABLE for config > > KVM_BOOK3S_64_HANDLER. As this commit also

Re: [PATCH v2 02/12] mm: Introduce a function to check for virtualization protection features

2021-08-19 Thread Christoph Hellwig
On Fri, Aug 13, 2021 at 11:59:21AM -0500, Tom Lendacky wrote: > +#define PATTR_MEM_ENCRYPT0 /* Encrypted memory */ > +#define PATTR_HOST_MEM_ENCRYPT 1 /* Host encrypted > memory */ > +#define PATTR_GUEST_MEM_ENCRYPT 2 /* Guest encrypted > m

Re: [PATCH 1/2] powerpc: kvm: rectify selection to PPC_DAWR

2021-08-19 Thread Christophe Leroy
Le 19/08/2021 à 11:32, Lukas Bulwahn a écrit : Commit a278e7ea608b ("powerpc: Fix compile issue with force DAWR") selects the non-existing config PPC_DAWR_FORCE_ENABLE for config KVM_BOOK3S_64_HANDLER. As this commit also introduces a config PPC_DAWR, it probably intends to select PPC_DAWR ins

[PATCH 2/2] powerpc: rectify selection to ARCH_ENABLE_SPLIT_PMD_PTLOCK

2021-08-19 Thread Lukas Bulwahn
Commit 66f24fa766e3 ("mm: drop redundant ARCH_ENABLE_SPLIT_PMD_PTLOCK") selects the non-existing config ARCH_ENABLE_PMD_SPLIT_PTLOCK in ./arch/powerpc/platforms/Kconfig.cputype, but clearly it intends to select ARCH_ENABLE_SPLIT_PMD_PTLOCK here (notice the word swapping!), as this commit does selec

[PATCH 1/2] powerpc: kvm: rectify selection to PPC_DAWR

2021-08-19 Thread Lukas Bulwahn
Commit a278e7ea608b ("powerpc: Fix compile issue with force DAWR") selects the non-existing config PPC_DAWR_FORCE_ENABLE for config KVM_BOOK3S_64_HANDLER. As this commit also introduces a config PPC_DAWR, it probably intends to select PPC_DAWR instead. Rectify the selection in config KVM_BOOK3S_64

[PATCH 0/2] Kconfig symbol fixes on powerpc

2021-08-19 Thread Lukas Bulwahn
Dear powerpc maintainers, The script ./scripts/checkkconfigsymbols.py warns on invalid references to Kconfig symbols (often, minor typos, name confusions or outdated references). This patch series addresses all issues reported by ./scripts/checkkconfigsymbols.py in ./drivers/usb/ for Kconfig and