Re: [PATCH v5 1/5] powerpc: Move idle_loop_prolog()/epilog() functions to header file

2020-05-05 Thread Michael Ellerman
On Tue, 2020-04-07 at 08:47:39 UTC, "Gautham R. Shenoy" wrote: > From: "Gautham R. Shenoy" > > Currently prior to entering an idle state on a Linux Guest, the > pseries cpuidle driver implement an idle_loop_prolog() and > idle_loop_epilog() functions which ensure that idle_purr is correctly > com

Re: [PATCH] powerpc/ps3: Move static keyword to the front of declaration

2020-05-05 Thread Michael Ellerman
On Wed, 2020-04-29 at 10:00:48 UTC, Xiongfeng Wang wrote: > Move the static keyword to the front of declaration of 'vuart_bus_priv', > and resolve the following compiler warning that can be seen when > building with warnings enabled (W=1): > > drivers/ps3/ps3-vuart.c:867:1: warning: ‘static’ i

Re: [PATCH v4 1/2] powerpc/uaccess: Implement unsafe_put_user() using 'asm goto'

2020-05-05 Thread Michael Ellerman
Segher Boessenkool writes: > On Tue, May 05, 2020 at 05:40:21PM +0200, Christophe Leroy wrote: >> >>+#define __put_user_asm_goto(x, addr, label, op) \ >> >>+ asm volatile goto( \ >> >>+ "1: " op "%U1%X1 %0,%1 # put_user\n"

Re: [PATCH v4 1/2] powerpc/uaccess: Implement unsafe_put_user() using 'asm goto'

2020-05-05 Thread Michael Ellerman
Segher Boessenkool writes: > Hi! > > On Wed, May 06, 2020 at 12:27:58AM +1000, Michael Ellerman wrote: >> Christophe Leroy writes: >> > unsafe_put_user() is designed to take benefit of 'asm goto'. >> > >> > Instead of using the standard __put_u

Re: [PATCH v4 1/2] powerpc/uaccess: Implement unsafe_put_user() using 'asm goto'

2020-05-05 Thread Michael Ellerman
Christophe Leroy writes: > unsafe_put_user() is designed to take benefit of 'asm goto'. > > Instead of using the standard __put_user() approach and branch > based on the returned error, use 'asm goto' and make the > exception code branch directly to the error label. There is > no code anymore in t

Re: [PATCH v2 1/2] init/kconfig: Add LD_VERSION Kconfig

2020-05-05 Thread Michael Ellerman
Will Deacon writes: > On Mon, May 04, 2020 at 09:11:12AM +0200, Geert Uytterhoeven wrote: >> On Mon, Mar 30, 2020 at 1:42 PM Amit Daniel Kachhap >> wrote: >> > This option can be used in Kconfig files to compare the ld version >> > and enable/disable incompatible config options if required. >> >

Re: [PATCH v7 5/5] powerpc/hv-24x7: Update post_mobility_fixup() to handle migration

2020-05-05 Thread Michael Ellerman
kajoljain writes: > On 4/29/20 5:07 PM, Michael Ellerman wrote: >> Kajol Jain writes: >>> Function 'read_sys_info_pseries()' is added to get system parameter >>> values like number of sockets and chips per socket. >>> and it gets these details via r

Re: [PATCH] powerpc/5200: update contact email

2020-05-04 Thread Michael Ellerman
Wolfram Sang writes: > My 'pengutronix' address is defunct for years. Merge the entries and use > the proper contact address. Is there any point adding the new address? It's just likely to bit-rot one day too. I figure the git history is a better source for more up-to-date emails. cheers > dif

Re: [PATCH 2/7] crypto: powerpc/sha1 - remove unused temporary workspace

2020-05-04 Thread Michael Ellerman
ions=1000 > cryptomgr.panic_on_fail=1" Thanks for testing. I gave it a quick spin on a Power9 and it showed no issues. Acked-by: Michael Ellerman (powerpc) cheers

Re: [PATCH V1 00/10] Remove duplicated kmap code

2020-04-30 Thread Michael Ellerman
ira.we...@intel.com writes: > From: Ira Weiny > > The kmap infrastructure has been copied almost verbatim to every architecture. > This series consolidates obvious duplicated code by defining core functions > which call into the architectures only when needed. > > Some of the k[un]map_atomic() imp

Re: [PATCH v5 0/5] Track and expose idle PURR and SPURR ticks

2020-04-29 Thread Michael Ellerman
Gautham R Shenoy writes: > On Mon, Apr 20, 2020 at 03:46:35PM -0700, Tyrel Datwyler wrote: >> On 4/7/20 1:47 AM, Gautham R. Shenoy wrote: >> > From: "Gautham R. Shenoy" >> > >> > Hi, >> > >> > This is the fifth version of the patches to track and expose idle PURR >> > and SPURR ticks. These pat

Re: [PATCH] powerpc/spufs: Add rcu_read_lock() around fcheck()

2020-04-29 Thread Michael Ellerman
Christoph Hellwig writes: > On Tue, Apr 28, 2020 at 09:48:11PM +1000, Michael Ellerman wrote: >> >> This comes from fcheck_files() via fcheck(). >> >> It's pretty clearly documented that fcheck() must be wrapped with >> rcu_read_lock(), so fix it. > &

Re: [PATCH v7 5/5] powerpc/hv-24x7: Update post_mobility_fixup() to handle migration

2020-04-29 Thread Michael Ellerman
Kajol Jain writes: > Function 'read_sys_info_pseries()' is added to get system parameter > values like number of sockets and chips per socket. > and it gets these details via rtas_call with token > "PROCESSOR_MODULE_INFO". > > Incase lpar migrate from one system to another, system > parameter deta

Re: [PATCH v7 3/5] powerpc/hv-24x7: Add sysfs files inside hv-24x7 device to show processor details

2020-04-29 Thread Michael Ellerman
Michael Ellerman writes: > Kajol Jain writes: >> To expose the system dependent parameter like total number of >> sockets and numbers of chips per socket, patch adds two sysfs files. >> "sockets" and "chips" are added to /sys/devices/hv_24x7/interface/

Re: [PATCH v7 3/5] powerpc/hv-24x7: Add sysfs files inside hv-24x7 device to show processor details

2020-04-29 Thread Michael Ellerman
Kajol Jain writes: > To expose the system dependent parameter like total number of > sockets and numbers of chips per socket, patch adds two sysfs files. > "sockets" and "chips" are added to /sys/devices/hv_24x7/interface/ > of the "hv_24x7" pmu. > > Signed-off-by: Kajol Jain > --- > arch/powerp

Re: [PATCH v7 2/5] powerpc/hv-24x7: Add rtas call in hv-24x7 driver to get processor details

2020-04-29 Thread Michael Ellerman
Hi Kajol, Some comments inline ... Kajol Jain writes: > For hv_24x7 socket/chip level events, specific chip-id to which > the data requested should be added as part of pmu events. > But number of chips/socket in the system details are not exposed. > > Patch implements read_sys_info_pseries() to

[PATCH] powerpc/spufs: Add rcu_read_lock() around fcheck()

2020-04-28 Thread Michael Ellerman
/0xd88 .do_notify_resume+0x158/0x3c8 .interrupt_exit_user_prepare+0x19c/0x208 interrupt_return+0x14/0x1c0 This comes from fcheck_files() via fcheck(). It's pretty clearly documented that fcheck() must be wrapped with rcu_read_lock(), so fix it. Signed-off-by: Michael Ellerman ---

Re: [PATCH v2] usercopy: Avoid soft lockups in test_check_nonzero_user()

2019-10-22 Thread Michael Ellerman
Christian Brauner writes: > On Thu, Oct 17, 2019 at 09:00:48AM +1100, Michael Ellerman wrote: >> Christian Brauner writes: >> > On Wed, Oct 16, 2019 at 11:27:32PM +1100, Michael Ellerman wrote: >> >> On a machine with a 64K PAGE_SIZE, the nested for loops in >&

Re: [PATCH v8 3/8] powerpc: detect the trusted boot state of the system

2019-10-22 Thread Michael Ellerman
Nayna Jain writes: > diff --git a/arch/powerpc/kernel/secure_boot.c > b/arch/powerpc/kernel/secure_boot.c > index 99bba7915629..9753470ab08a 100644 > --- a/arch/powerpc/kernel/secure_boot.c > +++ b/arch/powerpc/kernel/secure_boot.c > @@ -28,3 +39,16 @@ bool is_ppc_secureboot_enabled(void) >

Re: [PATCH] powerpc/32s: fix allow/prevent_user_access() when crossing segment boundaries.

2019-10-20 Thread Michael Ellerman
On Mon, 2019-10-14 at 16:51:28 UTC, Christophe Leroy wrote: > Make sure starting addr is aligned to segment boundary so that when > incrementing the segment, the starting address of the new segment is > below the end address. Otherwise the last segment might get missed. > > Fixes: a68c31fc01ef ("

Re: [PATCH v2] usercopy: Avoid soft lockups in test_check_nonzero_user()

2019-10-16 Thread Michael Ellerman
Christian Brauner writes: > On Wed, Oct 16, 2019 at 11:27:32PM +1100, Michael Ellerman wrote: >> On a machine with a 64K PAGE_SIZE, the nested for loops in >> test_check_nonzero_user() can lead to soft lockups, eg: >> >> watchdog: BUG: soft lockup - CPU#4 s

Re: [PATCH] usercopy: Avoid soft lockups in test_check_nonzero_user()

2019-10-16 Thread Michael Ellerman
Christian Brauner writes: > On Fri, Oct 11, 2019 at 02:48:10PM +1100, Aleksa Sarai wrote: >> On 2019-10-11, Michael Ellerman wrote: >> > On a machine with a 64K PAGE_SIZE, the nested for loops in >> > test_check_nonzero_user() can lead to soft lockups, eg: >> >

[PATCH v2] usercopy: Avoid soft lockups in test_check_nonzero_user()

2019-10-16 Thread Michael Ellerman
: f5a1a536fa14 ("lib: introduce copy_struct_from_user() helper") Suggested-by: Aleksa Sarai Signed-off-by: Michael Ellerman --- lib/test_user_copy.c | 22 +++--- 1 file changed, 19 insertions(+), 3 deletions(-) v2: Rework calculation to just use PAGE_SIZE directly. R

Re: [PATCH 03/34] powerpc: Use CONFIG_PREEMPTION

2019-10-16 Thread Michael Ellerman
Christophe Leroy writes: > Le 15/10/2019 à 21:17, Sebastian Andrzej Siewior a écrit : >> From: Thomas Gleixner >> >> CONFIG_PREEMPTION is selected by CONFIG_PREEMPT and by CONFIG_PREEMPT_RT. >> Both PREEMPT and PREEMPT_RT require the same functionality which today >> depends on CONFIG_PREEMPT. >

Re: [PATCH v2] selftests: Add kselftest-all and kselftest-install targets

2019-10-15 Thread Michael Ellerman
Hi Shuah, I know this has been merged already, so this is just FYI and in case it helps anyone else who's tracking down build failures. Sorry I didn't reply before you merged it, I was on leave. Shuah Khan writes: > Add kselftest-all target to build tests from the top level > Makefile. This is

Re: [PATCH] Convert filldir[64]() from __put_user() to unsafe_put_user()

2019-10-14 Thread Michael Ellerman
Linus Torvalds writes: > On Sun, Oct 13, 2019 at 12:59 PM Al Viro wrote: >> Re plotting: how strongly would you object against passing the range to >> user_access_end()? Powerpc folks have a very close analogue of stac/clac, >> currently buried inside their __get_user()/__put_user()/etc. - the s

[GIT PULL] Please pull powerpc/linux.git powerpc-5.4-3 tag

2019-10-12 Thread Michael Ellerman
-BEGIN PGP SIGNED MESSAGE- Hash: SHA256 Hi Linus, Please pull some more powerpc fixes for 5.4: The following changes since commit da0c9ea146cbe92b832f1b0f694840ea8eb33cce: Linux 5.4-rc2 (2019-10-06 14:27:30 -0700) are available in the git repository at: https://git.kernel.org/pub/

Re: [PATCH] usercopy: Avoid soft lockups in test_check_nonzero_user()

2019-10-12 Thread Michael Ellerman
Aleksa Sarai writes: > On 2019-10-11, Michael Ellerman wrote: >> On a machine with a 64K PAGE_SIZE, the nested for loops in >> test_check_nonzero_user() can lead to soft lockups, eg: ... >> diff --git a/lib/test_user_copy.c b/lib/test_user_copy.c >> index 950ee8

Re: linux-next: build failure after merge of the powerpc tree

2019-10-11 Thread Michael Ellerman
On Mon, 2019-09-30 at 00:13:42 UTC, Stephen Rothwell wrote: > Hi all, > > After merging the powerpc tree, today's linux-next build (powerpc64 > allnoconfig) failed like this: > > arch/powerpc/mm/book3s64/pgtable.c: In function 'flush_partition': > arch/powerpc/mm/book3s64/pgtable.c:216:3: error:

Re: [PATCH] powerpc/pseries: Remove confusing warning message.

2019-10-11 Thread Michael Ellerman
On Tue, 2019-10-01 at 13:29:28 UTC, Laurent Dufour wrote: > Since the commit 1211ee61b4a8 ("powerpc/pseries: Read TLB Block Invalidate > Characteristics"), a warning message is displayed when booting a guest on > top of KVM: > > lpar: arch/powerpc/platforms/pseries/lpar.c > pseries_lpar_read_hblk

[PATCH] usercopy: Avoid soft lockups in test_check_nonzero_user()

2019-10-10 Thread Michael Ellerman
: f5a1a536fa14 ("lib: introduce copy_struct_from_user() helper") Suggested-by: Aleksa Sarai Signed-off-by: Michael Ellerman --- lib/test_user_copy.c | 23 --- 1 file changed, 20 insertions(+), 3 deletions(-) How does this look? It runs in < 1s on my machine here. cheers

Re: [PATCH v4 1/4] lib: introduce copy_struct_from_user() helper

2019-10-10 Thread Michael Ellerman
Hi Aleksa, Aleksa Sarai writes: > A common pattern for syscall extensions is increasing the size of a > struct passed from userspace, such that the zero-value of the new fields > result in the old kernel behaviour (allowing for a mix of userspace and > kernel vintages to operate on one another in

Re: linux-next: build failure after merge of the powerpc tree

2019-10-03 Thread Michael Ellerman
On Mon, 2019-09-30 at 00:13:42 UTC, Stephen Rothwell wrote: > Hi all, > > After merging the powerpc tree, today's linux-next build (powerpc64 > allnoconfig) failed like this: > > arch/powerpc/mm/book3s64/pgtable.c: In function 'flush_partition': > arch/powerpc/mm/book3s64/pgtable.c:216:3: error:

Re: [PATCH] powerpc/pseries: Remove confusing warning message.

2019-10-03 Thread Michael Ellerman
On Tue, 2019-10-01 at 13:29:28 UTC, Laurent Dufour wrote: > Since the commit 1211ee61b4a8 ("powerpc/pseries: Read TLB Block Invalidate > Characteristics"), a warning message is displayed when booting a guest on > top of KVM: > > lpar: arch/powerpc/platforms/pseries/lpar.c > pseries_lpar_read_hblk

[GIT PULL] Please pull powerpc/linux.git powerpc-5.4-2 tag

2019-09-28 Thread Michael Ellerman
-BEGIN PGP SIGNED MESSAGE- Hash: SHA256 Hi Linus, Please pull some more powerpc updates for 5.4: The following changes since commit 45824fc0da6e46cc5d563105e1eaaf3098a686f9: Merge tag 'powerpc-5.4-1' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux (2019-09-20 11:48:06

Re: [PATCH v1] powerpc/pseries: CMM: Drop page array

2019-09-27 Thread Michael Ellerman
e_set_active() >were >>> called with __pa(page_address()) for now, I assume we can simply >switch >>> to page_to_phys() here. The pfn_to_kaddr() handling is now mostly >gone. >>> >>> Cc: Benjamin Herrenschmidt >>> Cc: Paul Mackerras >&g

Re: [PATCH v3 1/2] powperc/mm: read TLB Block Invalidate Characteristics

2019-09-25 Thread Michael Ellerman
On Fri, 2019-09-20 at 13:05:22 UTC, Laurent Dufour wrote: > The PAPR document specifies the TLB Block Invalidate Characteristics which > tells for each pair of segment base page size, actual page size, the size > of the block the hcall H_BLOCK_REMOVE supports. > > These characteristics are loaded

Re: [PATCH 1/2] powerpc/mm: Add a helper to select PAGE_KERNEL_RO or PAGE_READONLY

2019-09-25 Thread Michael Ellerman
On Wed, 2019-08-21 at 10:20:00 UTC, Christophe Leroy wrote: > In a couple of places there is a need to select whether read-only > protection of shadow pages is performed with PAGE_KERNEL_RO or with > PAGE_READONLY. > > Add a helper to avoid duplicating the choice. > > Signed-off-by: Christophe Le

Re: "Pick the right alignment default when creating dax devices" failed to build on powerpc

2019-09-22 Thread Michael Ellerman
r 2 >> > > >> > > [1] https://patchwork.kernel.org/patch/11133445/ >> > > [2] >https://raw.githubusercontent.com/cailca/linux-mm/master/powerpc.config >> > >> > Sorry for breaking the build. How about? >> >> It works fine. > &g

[GIT PULL] Please pull powerpc/linux.git powerpc-5.4-1 tag

2019-09-20 Thread Michael Ellerman
xiwell S. Garcia (1): Documentation/powerpc: Add ELF note documentation Michael Anderson (1): powerpc/mm: Use UV_WRITE_PATE ucall to register a PATE Michael Ellerman (11): Merge branch 'fixes' into next Merge branch 'topic/ppc-kvm' into next Merge bra

Re: [PATCH v2] powerpc/watchpoint: Disable watchpoint hit by larx/stcx instructions

2019-09-19 Thread Michael Ellerman
On Tue, 2019-09-10 at 13:15:13 UTC, Ravi Bangoria wrote: > If watchpoint exception is generated by larx/stcx instructions, the > reservation created by larx gets lost while handling exception, and > thus stcx instruction always fails. Generally these instructions are > used in a while(1) loop, for

Re: [PATCH 1/3] ftrace: Look up the address of return_to_handler() using helpers

2019-09-19 Thread Michael Ellerman
On Thu, 2019-09-05 at 18:20:28 UTC, "Naveen N. Rao" wrote: > This ensures that we use the right address on architectures that use > function descriptors. > > Signed-off-by: Naveen N. Rao Series applied to powerpc next, thanks. https://git.kernel.org/powerpc/c/a3db31ff6ce31f5a544a66b61613a098029

Re: [PATCH v2] powerpc/xive: Fix bogus error code returned by OPAL

2019-09-19 Thread Michael Ellerman
On Wed, 2019-09-11 at 15:52:18 UTC, Greg Kurz wrote: > There's a bug in skiboot that causes the OPAL_XIVE_ALLOCATE_IRQ call > to return the 32-bit value 0x when OPAL has run out of IRQs. > Unfortunatelty, OPAL return values are signed 64-bit entities and > errors are supposed to be negative

Re: [PATCH] powerpc: improve prom_init_check rule

2019-09-19 Thread Michael Ellerman
On Thu, 2019-09-12 at 07:40:37 UTC, Masahiro Yamada wrote: > This slightly improves the prom_init_check rule. > > [1] Avoid needless check > > Currently, prom_init_check.sh is invoked every time you run 'make' > even if you have changed nothing in prom_init.c. With this commit, > the script is re

Re: [PATCH] powerpc/mm/radix: remove useless kernel messages

2019-09-19 Thread Michael Ellerman
On Fri, 2019-08-23 at 14:22:00 UTC, Qian Cai wrote: > Booting a POWER9 PowerNV system generates a few messages below with > "ptrval" due to the pointers printed without a specifier > extension (i.e unadorned %p) are hashed to prevent leaking information > about the kernel memory layout. >

Re: [PATCH?] powerpc: Hard wire PT_SOFTE value to 1 in gpr_get() too

2019-09-19 Thread Michael Ellerman
Hi Oleg, Thanks for the patch. Oleg Nesterov writes: > I don't have a ppc machine, this patch wasn't even compile tested, > could you please review? > > The commit a8a4b03ab95f ("powerpc: Hard wire PT_SOFTE value to 1 in > ptrace & signals") changed ptrace_get_reg(PT_SOFTE) to report 0x1, > but

Re: [PATCH v3 1/5] powerpc: Allow flush_icache_range to work across ranges >4GB

2019-09-18 Thread Michael Ellerman
"Alastair D'Silva" writes: > From: Alastair D'Silva > > When calling flush_icache_range with a size >4GB, we were masking > off the upper 32 bits, so we would incorrectly flush a range smaller > than intended. > > __kernel_sync_dicache in the 64 bit VDSO has the same bug. Please fix that in a se

Re: [PATCH v2 2/2] powerpc/mm: call H_BLOCK_REMOVE when supported

2019-09-18 Thread Michael Ellerman
Hi Laurent, Few comments ... Laurent Dufour writes: > Now we do not call _BLOCK_REMOVE all the time when the feature is > exhibited. This isn't true until after the patch is applied, ie. the tense is wrong. The rest of the change log explains things fine, so just drop that sentence I think. Ca

Re: [PATCH v2 1/2] powperc/mm: read TLB Block Invalidate Characteristics

2019-09-18 Thread Michael Ellerman
Hi Laurent, Comments below ... Laurent Dufour writes: > The PAPR document specifies the TLB Block Invalidate Characteristics which > tells for each couple segment base page size, actual page size, the size of ^ "pair of" again > the block the hcall H_BLOCK_REMO

Re: [PATCH v2 0/2] powerpc/mm: Conditionally call H_BLOCK_REMOVE

2019-09-18 Thread Michael Ellerman
Hi Laurent, Thanks for fixing this, just a few comments. Laurent Dufour writes: > Since the commit ba2dd8a26baa ("powerpc/pseries/mm: call H_BLOCK_REMOVE"), > the call to H_BLOCK_REMOVE is always done if the feature is exhibited. > > However, the hypervisor may not support all the block size for

Re: [PATCH 0/2] pseries/hotplug: Change the default behaviour of cede_offline

2019-09-18 Thread Michael Ellerman
"Naveen N. Rao" writes: > Michael Ellerman wrote: >> "Gautham R. Shenoy" writes: >>> From: "Gautham R. Shenoy" >>> >>> Currently on Pseries Linux Guests, the offlined CPU can be put to one >>> of the followi

Re: [PATCH v2 1/8] powerpc/32: Add VDSO version of getcpu

2019-09-17 Thread Michael Ellerman
Hi Christophe, Sorry I'm late replying to this. Christophe Leroy writes: > Commit 18ad51dd342a ("powerpc: Add VDSO version of getcpu") added > getcpu() for PPC64 only, by making use of a user readable general > purpose SPR. > > PPC32 doesn't have any such SPR, a full system call can still be > a

Re: [PATCH v7 5/6] powerpc/64: Make COMPAT user-selectable disabled on littleendian by default.

2019-09-17 Thread Michael Ellerman
Michal Suchánek writes: > On Tue, 03 Sep 2019 10:00:57 +1000 > Michael Ellerman wrote: >> Michal Suchánek writes: >> > On Mon, 02 Sep 2019 12:03:12 +1000 >> > Michael Ellerman wrote: >> > >> >> Michal Suchanek writes: >> >>

Re: [PATCH 0/2] pseries/hotplug: Change the default behaviour of cede_offline

2019-09-17 Thread Michael Ellerman
Nathan Lynch writes: > Gautham R Shenoy writes: >> On Thu, Sep 12, 2019 at 10:39:45AM -0500, Nathan Lynch wrote: >>> "Gautham R. Shenoy" writes: >>> > The patchset also defines a new sysfs attribute >>> > "/sys/device/system/cpu/cede_offline_enabled" on PSeries Linux guests >>> > to allow usersp

Re: [PATCH 0/2] pseries/hotplug: Change the default behaviour of cede_offline

2019-09-17 Thread Michael Ellerman
"Gautham R. Shenoy" writes: > From: "Gautham R. Shenoy" > > Currently on Pseries Linux Guests, the offlined CPU can be put to one > of the following two states: >- Long term processor cede (also called extended cede) >- Returned to the Hypervisor via RTAS "stop-self" call. > > This is con

Re: [PATCH] powerpc/xive: Fix bogus error code returned by OPAL

2019-09-11 Thread Michael Ellerman
Hi Greg, Couple of comments ... Greg Kurz writes: > There's a bug in skiboot that causes the OPAL_XIVE_ALLOCATE_IRQ call > to return the 32-bit value 0x when OPAL has run out of IRQs. > Unfortunatelty, OPAL return values are signed 64-bit entities and > errors are supposed to be negative

Re: [PATCH] powerpc: Avoid clang warnings around setjmp and longjmp

2019-09-10 Thread Michael Ellerman
Nathan Chancellor writes: > On Wed, Sep 04, 2019 at 08:01:35AM -0500, Segher Boessenkool wrote: >> On Wed, Sep 04, 2019 at 08:16:45AM +, David Laight wrote: >> > From: Nathan Chancellor [mailto:natechancel...@gmail.com] >> > > Fair enough so I guess we are back to just outright disabling the >

Re: [PATCH v3] powerpc/lockdep: fix a false positive warning

2019-09-10 Thread Michael Ellerman
Hi Qian, Sorry I haven't replied sooner, I've been travelling. Qian Cai writes: > The commit 108c14858b9e ("locking/lockdep: Add support for dynamic > keys") introduced a boot warning on powerpc below, because since the > commit 2d4f567103ff ("KVM: PPC: Introduce kvm_tmp framework") adds > kvm_t

[GIT PULL] Please pull powerpc/linux.git powerpc-5.3-5 tag

2019-09-05 Thread Michael Ellerman
-BEGIN PGP SIGNED MESSAGE- Hash: SHA256 Hi Linus, Please pull some more powerpc fixes for 5.3: The following changes since commit ed4289e8b48845888ee46377bd2b55884a55e60b: Revert "powerpc: slightly improve cache helpers" (2019-07-31 22:56:27 +1000) are available in the git repository

Re: [PATCH v4 02/16] powerpc/pseries: Introduce option to build secure virtual machines

2019-09-04 Thread Michael Ellerman
Thiago Jung Bauermann writes: > Michael Ellerman writes: >> On Tue, 2019-08-20 at 02:13:12 UTC, Thiago Jung Bauermann wrote: >>> Introduce CONFIG_PPC_SVM to control support for secure guests and include >>> Ultravisor-related helpers when it is selected >>

Re: lockdep warning while booting POWER9 PowerNV

2019-09-04 Thread Michael Ellerman
Bart Van Assche writes: > On 8/30/19 2:13 PM, Qian Cai wrote: >> https://raw.githubusercontent.com/cailca/linux-mm/master/powerpc.config >> >> Once in a while, booting an IBM POWER9 PowerNV system (8335-GTH) would >> generate >> a warning in lockdep_register_key() at, >> >> if (WARN_ON_ONCE(sta

Re: [PATCH v2 3/6] powerpc: Convert flush_icache_range & friends to C

2019-09-03 Thread Michael Ellerman
Christophe Leroy writes: > Le 03/09/2019 à 07:23, Alastair D'Silva a écrit : >> From: Alastair D'Silva >> >> Similar to commit 22e9c88d486a >> ("powerpc/64: reuse PPC32 static inline flush_dcache_range()") >> this patch converts the following ASM symbols to C: >> flush_icache_range() >>

Re: [PATCH v7 5/6] powerpc/64: Make COMPAT user-selectable disabled on littleendian by default.

2019-09-02 Thread Michael Ellerman
Michal Suchánek writes: > On Mon, 02 Sep 2019 12:03:12 +1000 > Michael Ellerman wrote: > >> Michal Suchanek writes: >> > On bigendian ppc64 it is common to have 32bit legacy binaries but much >> > less so on littleendian. >> >> I think the toolc

Re: [PATCH v7 5/6] powerpc/64: Make COMPAT user-selectable disabled on littleendian by default.

2019-09-02 Thread Michael Ellerman
Segher Boessenkool writes: > On Mon, Sep 02, 2019 at 12:03:12PM +1000, Michael Ellerman wrote: >> Michal Suchanek writes: >> > On bigendian ppc64 it is common to have 32bit legacy binaries but much >> > less so on littleendian. >> >> I think the toolchai

Re: [PATCH v7 3/6] powerpc/perf: consolidate read_user_stack_32

2019-09-02 Thread Michael Ellerman
Michal Suchánek writes: > On Mon, 02 Sep 2019 14:01:17 +1000 > Michael Ellerman wrote: >> Michael Ellerman writes: >> > Michal Suchanek writes: >> ... >> >> @@ -295,6 +279,12 @@ static inline int current_is_64bit(void) >> >> } >>

Re: [PATCH v5 2/2] powerpc: Add support to initialize ima policy rules

2019-09-02 Thread Michael Ellerman
Hi Nayna, Some more comments below. Nayna Jain writes: > POWER secure boot relies on the kernel IMA security subsystem to > perform the OS kernel image signature verification. Again this is just a design choice we've made, it's not specified anywhere or anything like that. And it only applies t

Re: [PATCH v5 1/2] powerpc: detect the secure boot mode of the system

2019-09-02 Thread Michael Ellerman
Hi Nayna, Sorry I've taken so long to get to this series, there's just too many patches that need reviewing :/ Nayna Jain writes: > Secure boot on POWER defines different IMA policies based on the secure > boot state of the system. The terminology throughout is a bit vague, we have POWER, Power

Re: linux-next: manual merge of the powerpc tree with the arm64 tree

2019-09-02 Thread Michael Ellerman
Catalin Marinas writes: > On Mon, Sep 02, 2019 at 11:44:43AM +1000, Michael Ellerman wrote: >> Stephen Rothwell writes: >> > Hi all, >> > >> > Today's linux-next merge of the powerpc tree got a conflict in: >> > >> > arch/Kconfig >

Re: [PATCH v7 3/6] powerpc/perf: consolidate read_user_stack_32

2019-09-01 Thread Michael Ellerman
Michael Ellerman writes: > Michal Suchanek writes: ... >> @@ -295,6 +279,12 @@ static inline int current_is_64bit(void) >> } >> >> #else /* CONFIG_PPC64 */ >> +static int read_user_stack_slow(void __user *ptr, void *buf, int nb) >> +{ >> +

Re: [PATCH v7 3/6] powerpc/perf: consolidate read_user_stack_32

2019-09-01 Thread Michael Ellerman
Michal Suchanek writes: > There are two almost identical copies for 32bit and 64bit. > > The function is used only in 32bit code which will be split out in next > patch so consolidate to one function. > > Signed-off-by: Michal Suchanek > Reviewed-by: Christophe Leroy > --- > new patch in v6 > -

Re: [PATCH 1/6] powerpc/32s: add an option to exclusively select powerpc 601

2019-09-01 Thread Michael Ellerman
On Mon, 2019-08-26 at 15:52:13 UTC, Christophe Leroy wrote: > Powerpc 601 is rather old powerpc which as some important > limitations compared to other book3s/32 powerpcs: > - No Timebase. > - Common BATs for instruction and data. > - No execution protection in segment registers. > - No RI bit in M

Re: [PATCH v4 02/16] powerpc/pseries: Introduce option to build secure virtual machines

2019-09-01 Thread Michael Ellerman
On Tue, 2019-08-20 at 02:13:12 UTC, Thiago Jung Bauermann wrote: > Introduce CONFIG_PPC_SVM to control support for secure guests and include > Ultravisor-related helpers when it is selected > > Signed-off-by: Thiago Jung Bauermann Patch 2-14 & 16 applied to powerpc next, thanks. https://git.ker

Re: [PATCH] powerpc/8xx: drop unused self-modifying code alternative to FixupDAR.

2019-09-01 Thread Michael Ellerman
On Wed, 2019-08-21 at 20:00:34 UTC, Christophe Leroy wrote: > The code which fixups the DAR on TLB errors for dbcX instructions > has a self-modifying code alternative that has never been used. > > Drop it. > > Signed-off-by: Christophe Leroy Applied to powerpc next, thanks. https://git.kernel

Re: [PATCH] powerpc/8xx: set STACK_END_MAGIC earlier on the init_stack

2019-09-01 Thread Michael Ellerman
On Wed, 2019-08-21 at 10:20:51 UTC, Christophe Leroy wrote: > Today, the STACK_END_MAGIC is set on init_stack in start_kernel(). > > To avoid a false 'Thread overran stack, or stack corrupted' message > on early Oopses, setup STACK_END_MAGIC as soon as possible. > > Signed-off-by: Christophe Lero

Re: [PATCH] powerpc/prom: convert PROM_BUG() to standard trap

2019-09-01 Thread Michael Ellerman
On Mon, 2019-08-26 at 11:10:23 UTC, Christophe Leroy wrote: > Prior to commit 1bd98d7fbaf5 ("ppc64: Update BUG handling based on > ppc32"), BUG() family was using BUG_ILLEGAL_INSTRUCTION which > was an invalid instruction opcode to trap into program check > exception. > > That commit converted the

Re: [PATCH v2 1/2] powerpc: Add PowerPC Capabilities ELF note

2019-09-01 Thread Michael Ellerman
On Thu, 2019-08-29 at 15:50:20 UTC, "Maxiwell S. Garcia" wrote: > From: Claudio Carvalho > > Add the PowerPC name and the PPC_ELFNOTE_CAPABILITIES type in the > kernel binary ELF note. This type is a bitmap that can be used to > advertise kernel capabilities to userland. > > This patch also defi

Re: [PATCH v6 6/6] powerpc/perf: split callchain.c by bitness

2019-09-01 Thread Michael Ellerman
Michal Suchánek writes: > On Fri, 30 Aug 2019 20:57:57 +0200 > Michal Suchanek wrote: > >> Building callchain.c with !COMPAT proved quite ugly with all the >> defines. Splitting out the 32bit and 64bit parts looks better. >> > > BTW the powerpc callchain.c does not match any of the patterns of P

Re: [PATCH v7 5/6] powerpc/64: Make COMPAT user-selectable disabled on littleendian by default.

2019-09-01 Thread Michael Ellerman
Michal Suchanek writes: > On bigendian ppc64 it is common to have 32bit legacy binaries but much > less so on littleendian. I think the toolchain people will tell you that there is no 32-bit little endian ABI defined at all, if anything works it's by accident. So I think we should not make this

RE: [RFC PATCH] powerpc: Convert ____flush_dcache_icache_phys() to C

2019-09-01 Thread Michael Ellerman
"Alastair D'Silva" writes: > On Wed, 2019-08-21 at 22:27 +0200, Christophe Leroy wrote: >> >> Le 20/08/2019 à 06:36, Alastair D'Silva a écrit : >> > On Fri, 2019-08-16 at 15:52 +, Christophe Leroy wrote: >> >> [...] >> >> > >> > Thanks Christophe, >> > >> > I'm trying a somewhat different

Re: linux-next: manual merge of the powerpc tree with the arm64 tree

2019-09-01 Thread Michael Ellerman
Stephen Rothwell writes: > Hi all, > > Today's linux-next merge of the powerpc tree got a conflict in: > > arch/Kconfig > > between commit: > > 5cf896fb6be3 ("arm64: Add support for relocating the kernel with RELR > relocations") > > from the arm64 tree and commit: > > 0c9c1d563975 ("x86, s

Re: [PATCH] powerpc/mm: tell if a bad page fault on data is read or write.

2019-08-29 Thread Michael Ellerman
Christophe Leroy writes: > DSISR has a bit to tell if the fault is due to a read or a write. Except some CPUs don't have a DSISR? Which is why we have page_fault_is_write() that's used in __do_page_fault(). Or is that old cruft? I see eg. in head_40x.S we pass r5=0 for error code, and we don't

Re: [PATCH v2 1/2] powerpc: permanently include 8xx registers in reg.h

2019-08-28 Thread Michael Ellerman
Christophe Leroy writes: > Most 8xx registers have specific names, so just include > reg_8xx.h all the time in reg.h in order to have them defined > even when CONFIG_PPC_8xx is not selected. This will avoid > the need for #ifdefs in C code. > > Guard SPRN_ICTRL in an #ifdef CONFIG_PPC_8xx as this

Re: [PATCH] powerpc: Avoid clang warnings around setjmp and longjmp

2019-08-28 Thread Michael Ellerman
Nathan Chancellor writes: > Commit aea447141c7e ("powerpc: Disable -Wbuiltin-requires-header when > setjmp is used") disabled -Wbuiltin-requires-header because of a warning > about the setjmp and longjmp declarations. > > r367387 in clang added another diagnostic around this, complaining that > t

Re: [PATCH v6 00/12] implement KASLR for powerpc/fsl_booke/32

2019-08-28 Thread Michael Ellerman
Scott Wood writes: > On Tue, 2019-08-27 at 11:33 +1000, Michael Ellerman wrote: >> Jason Yan writes: >> > A polite ping :) >> > >> > What else should I do now? >> >> That's a good question. >> >> Scott, are you still maintaini

Re: [PATCH v2 01/12] powerpc: remove the ppc44x ocm.c file

2019-08-27 Thread Michael Ellerman
On Tue, 2019-08-20 at 14:07:09 UTC, Christophe Leroy wrote: > From: Christoph Hellwig > > The on chip memory allocator is entirely unused in the kernel tree. > > Signed-off-by: Christoph Hellwig > Acked-by: Christophe Leroy > Signed-off-by: Christophe Leroy Series applied to powerpc next, th

Re: [PATCH] powerpc/64: don't select ARCH_HAS_SCALED_CPUTIME on book3E

2019-08-27 Thread Michael Ellerman
On Thu, 2019-08-22 at 16:44:05 UTC, Christophe Leroy wrote: > Book3E doesn't have SPRN_SPURR/SPRN_PURR. > > Activating ARCH_HAS_SCALED_CPUTIME is just wasting CPU time. > > Signed-off-by: Christophe Leroy > Link: https://github.com/linuxppc/issues/issues/171 Applied to powerpc next, thanks. ht

Re: [PATCH v4 1/3] powerpc: rewrite LOAD_REG_IMMEDIATE() as an intelligent macro

2019-08-27 Thread Michael Ellerman
On Tue, 2019-08-20 at 14:34:12 UTC, Christophe Leroy wrote: > Today LOAD_REG_IMMEDIATE() is a basic #define which loads all > parts on a value into a register, including the parts that are NUL. > > This means always 2 instructions on PPC32 and always 5 instructions > on PPC64. And those instructio

Re: [PATCH] powerpc: remove meaningless KBUILD_ARFLAGS addition

2019-08-27 Thread Michael Ellerman
On Sat, 2019-07-13 at 03:21:06 UTC, Masahiro Yamada wrote: > The KBUILD_ARFLAGS addition in arch/powerpc/Makefile has never worked > in a useful way because it is always overridden by the following code > in the top Makefile: > > # use the deterministic mode of AR if available > KBUILD_ARFLAGS

Re: [PATCH] powerpc/time: use feature fixup in __USE_RTC() instead of cpu feature.

2019-08-26 Thread Michael Ellerman
Christophe Leroy writes: > Le 26/08/2019 à 13:41, Michael Ellerman a écrit : >> Christophe Leroy writes: >>> sched_clock(), used by printk(), calls __USE_RTC() to know >>> whether to use realtime clock or timebase. >>> >>> __USE_RTC() u

Re: [PATCH] powerpc/time: use feature fixup in __USE_RTC() instead of cpu feature.

2019-08-26 Thread Michael Ellerman
Benjamin Herrenschmidt writes: > On Mon, 2019-08-26 at 21:41 +1000, Michael Ellerman wrote: >> Christophe Leroy writes: >> > sched_clock(), used by printk(), calls __USE_RTC() to know >> > whether to use realtime clock or timebase. >> > >> >

Re: [PATCH v2] powerpc: Allow flush_(inval_)dcache_range to work across ranges >4GB

2019-08-26 Thread Michael Ellerman
maller > than intended. > > This patch replaces the 32 bit shifts with 64 bit ones, so that > the full size is accounted for. > > Changelog: > v2 > - Add related upstream commit > > Signed-off-by: Alastair D'Silva > --- > arch/powerpc/kernel/misc_64.S | 4

Re: [PATCH v6 00/12] implement KASLR for powerpc/fsl_booke/32

2019-08-26 Thread Michael Ellerman
Jason Yan writes: > A polite ping :) > > What else should I do now? That's a good question. Scott, are you still maintaining FSL bits, and if so any comments? Or should I take this. cheers > On 2019/8/19 14:12, Jason Yan wrote: >> Hi Michael, >> >> Is there anything more I should do to get th

Re: [PATCH] powerpc/time: use feature fixup in __USE_RTC() instead of cpu feature.

2019-08-26 Thread Michael Ellerman
Christophe Leroy writes: > sched_clock(), used by printk(), calls __USE_RTC() to know > whether to use realtime clock or timebase. > > __USE_RTC() uses cpu_has_feature() which is initialised by > machine_init(). Before machine_init(), __USE_RTC() returns true, > leading to a program check exceptio

Re: [PATCH] powerpc/futex: fix warning: 'oldval' may be used uninitialized in this function

2019-08-22 Thread Michael Ellerman
On Wed, 2019-08-14 at 09:25:52 UTC, Christophe Leroy wrote: > CC kernel/futex.o > kernel/futex.c: In function 'do_futex': > kernel/futex.c:1676:17: warning: 'oldval' may be used uninitialized in this > function [-Wmaybe-uninitialized] >return oldval == cmparg; > ^ > kerne

Re: [PATCH 1/5] powerpc/ptdump: fix addresses display on PPC32

2019-08-22 Thread Michael Ellerman
On Wed, 2019-08-14 at 12:36:09 UTC, Christophe Leroy wrote: > Commit 453d87f6a8ae ("powerpc/mm: Warn if W+X pages found on boot") > wrongly changed KERN_VIRT_START from 0 to PAGE_OFFSET, leading to a > shift in the displayed addresses. > > Lets revert that change to resync walk_pagetables()'s addr

Re: [PATCH] powerpc/mm: don't display empty early ioremap area

2019-08-22 Thread Michael Ellerman
On Wed, 2019-08-14 at 14:36:10 UTC, Christophe Leroy wrote: > On the 8xx, the layout displayed at boot is: > > [0.00] Memory: 121856K/131072K available (5728K kernel code, 592K > rwdata, 1248K rodata, 560K init, 448K bss, 9216K reserved, 0K cma-reserved) > [0.00] Kernel virtual me

Re: [PATCH v11 1/7] powerpc/mce: Schedule work from irq_work

2019-08-22 Thread Michael Ellerman
On Tue, 2019-08-20 at 08:13:46 UTC, Santosh Sivaraj wrote: > schedule_work() cannot be called from MCE exception context as MCE can > interrupt even in interrupt disabled context. > > fixes: 733e4a4c ("powerpc/mce: hookup memory_failure for UE errors") > Reviewed-by: Mahesh Salgaonkar > Reviewed-

Re: [PATCH 1/5] powerpc/mm: define empty update_mmu_cache() as static inline

2019-08-22 Thread Michael Ellerman
On Fri, 2019-08-16 at 05:41:40 UTC, Christophe Leroy wrote: > Only BOOK3S and FSL_BOOK3E have a usefull update_mmu_cache(). > > For the others, just define it static inline. > > In the meantime, simplify the FSL_BOOK3E related ifdef as > book3e_hugetlb_preload() only exists when CONFIG_PPC_FSL_BO

Re: [PATCH] powerpc/603: fix handling of the DIRTY flag

2019-08-22 Thread Michael Ellerman
On Mon, 2019-08-19 at 06:40:25 UTC, Christophe Leroy wrote: > If a page is already mapped RW without the DIRTY flag, the DIRTY > flag is never set and a TLB store miss exception is taken forever. > > This is easily reproduced with the following app: > > void main(void) > { > volatile char *

Re: [PATCH] powerpc/32: Add warning on misaligned copy_page() or clear_page()

2019-08-22 Thread Michael Ellerman
On Fri, 2019-08-16 at 07:52:20 UTC, Christophe Leroy wrote: > copy_page() and clear_page() expect page aligned destination, and > use dcbz instruction to clear entire cache lines based on the > assumption that the destination is cache aligned. > > As shown during analysis of a bug in BTRFS filesys

<    3   4   5   6   7   8   9   10   11   12   >