[Bug 203571] New: may_use_simd() returns false in kworkers

2019-05-10 Thread bugzilla-daemon
https://bugzilla.kernel.org/show_bug.cgi?id=203571 Bug ID: 203571 Summary: may_use_simd() returns false in kworkers Product: Platform Specific/Hardware Version: 2.5 Kernel Version: 4.19 Hardware: All OS: Linux

Re: [PATCH 2/2] powerpc/perf: Fix mmcra corruption by bhrb_filter

2019-05-10 Thread Ravi Bangoria
On 5/11/19 8:12 AM, Ravi Bangoria wrote: > Consider a scenario where user creates two events: > > 1st event: > attr.sample_type |= PERF_SAMPLE_BRANCH_STACK; > attr.branch_sample_type = PERF_SAMPLE_BRANCH_ANY; > fd = perf_event_open(attr, 0, 1, -1, 0); > > This sets cpuhw->bhrb_

[PATCH 2/2] powerpc/perf: Fix mmcra corruption by bhrb_filter

2019-05-10 Thread Ravi Bangoria
Consider a scenario where user creates two events: 1st event: attr.sample_type |= PERF_SAMPLE_BRANCH_STACK; attr.branch_sample_type = PERF_SAMPLE_BRANCH_ANY; fd = perf_event_open(attr, 0, 1, -1, 0); This sets cpuhw->bhrb_filter to 0 and returns valid fd. 2nd event: attr.sam

[PATCH 1/2] perf ioctl: Add check for the sample_period value

2019-05-10 Thread Ravi Bangoria
Add a check for sample_period value sent from userspace. Negative value does not make sense. And in powerpc arch code this could cause a recursive PMI leading to a hang (reported when running perf-fuzzer). Signed-off-by: Ravi Bangoria --- kernel/events/core.c | 3 +++ 1 file changed, 3 insertion

Re: [PATCH, RFC] byteorder: sanity check toolchain vs kernel endianess

2019-05-10 Thread Arnd Bergmann
On Fri, May 10, 2019 at 6:53 AM Dmitry Vyukov wrote: > > > > I think it's good to have a sanity check in-place for consistency. > > > Hi, > > This broke our cross-builds from x86. I am using: > > $ powerpc64le-linux-gnu-gcc --version > powerpc64le-linux-gnu-gcc (Debian 7.2.0-7) 7.2.0 > > and it sa

Re: [PATCH kernel 2/2] powerpc/pseries/dma: Enable swiotlb

2019-05-10 Thread Thiago Jung Bauermann
Hello Alexey, Thanks! I have similar changes in my "Secure Virtual Machine Enablement" patches, which I am currently preparing for posting again real soon now. This is the last version: https://lore.kernel.org/linuxppc-dev/20180824162535.22798-1-bauer...@linux.ibm.com/ Alexey Kardashevskiy

Re: [PATCH kernel 1/2] powerpc/pseries/dma: Allow swiotlb

2019-05-10 Thread Thiago Jung Bauermann
Alexey Kardashevskiy writes: > The commit 8617a5c5bc00 ("powerpc/dma: handle iommu bypass in > dma_iommu_ops") merged direct DMA ops into the IOMMU DMA ops allowing > SWIOTLB as well but only for mapping; the unmapping and bouncing parts > were left unmodified. > > This adds missing direct unma

Re: [PATCH 0/4] Enabling secure boot on PowerNV systems

2019-05-10 Thread Claudio Carvalho
Hi Matthew, Thanks for the feedback and sorry for the delay in responding. On 4/10/19 2:36 PM, Matthew Garrett wrote: > (Cc:ing Peter Jones) > > On Tue, Apr 9, 2019 at 3:55 PM Claudio Carvalho > wrote: >> >> On 4/5/19 7:19 PM, Matthew Garrett wrote: >>> Based on our experience doing this in UE

Re: [PATCH] EDAC, mpc85xx: Prevent building as a module

2019-05-10 Thread Borislav Petkov
On Fri, May 10, 2019 at 04:13:20PM +0200, Borislav Petkov wrote: > On Fri, May 10, 2019 at 08:50:52PM +1000, Michael Ellerman wrote: > > Yeah that looks better to me. I didn't think about the case where EDAC > > core is modular. > > > > Do you want me to send a new patch? > > Nah, I'll fix it up.

Re: [PATCH] vsprintf: Do not break early boot with probing addresses

2019-05-10 Thread christophe leroy
Le 10/05/2019 à 18:24, Steven Rostedt a écrit : On Fri, 10 May 2019 10:42:13 +0200 Petr Mladek wrote: static const char *check_pointer_msg(const void *ptr) { - char byte; - if (!ptr) return "(null)"; - if (probe_kernel_address(ptr, byte)) + if ((u

Re: [PATCH] vsprintf: Do not break early boot with probing addresses

2019-05-10 Thread Martin Schwidefsky
On Fri, 10 May 2019 12:40:58 -0400 Steven Rostedt wrote: > On Fri, 10 May 2019 18:32:58 +0200 > Martin Schwidefsky wrote: > > > On Fri, 10 May 2019 12:24:01 -0400 > > Steven Rostedt wrote: > > > > > On Fri, 10 May 2019 10:42:13 +0200 > > > Petr Mladek wrote: > > > > > > > static cons

Re: [PATCH] vsprintf: Do not break early boot with probing addresses

2019-05-10 Thread Andy Shevchenko
On Fri, May 10, 2019 at 12:24:01PM -0400, Steven Rostedt wrote: > On Fri, 10 May 2019 10:42:13 +0200 > Petr Mladek wrote: > > > static const char *check_pointer_msg(const void *ptr) > > { > > - char byte; > > - > > if (!ptr) > > return "(null)"; > > > > - if (probe_kernel_

Re: [PATCH] vsprintf: Do not break early boot with probing addresses

2019-05-10 Thread Steven Rostedt
On Fri, 10 May 2019 18:32:58 +0200 Martin Schwidefsky wrote: > On Fri, 10 May 2019 12:24:01 -0400 > Steven Rostedt wrote: > > > On Fri, 10 May 2019 10:42:13 +0200 > > Petr Mladek wrote: > > > > > static const char *check_pointer_msg(const void *ptr) > > > { > > > - char byte; > > > - > >

Re: [PATCH] vsprintf: Do not break early boot with probing addresses

2019-05-10 Thread Martin Schwidefsky
On Fri, 10 May 2019 12:24:01 -0400 Steven Rostedt wrote: > On Fri, 10 May 2019 10:42:13 +0200 > Petr Mladek wrote: > > > static const char *check_pointer_msg(const void *ptr) > > { > > - char byte; > > - > > if (!ptr) > > return "(null)"; > > > > - if (probe_kernel_addre

[PATCH 8/8] powerpc/pseries: Add documentation for vcpudispatch_stats

2019-05-10 Thread Naveen N. Rao
Add a document describing the fields provided by /proc/powerpc/vcpudispatch_stats. Signed-off-by: Naveen N. Rao --- Documentation/powerpc/vcpudispatch_stats.txt | 68 1 file changed, 68 insertions(+) create mode 100644 Documentation/powerpc/vcpudispatch_stats.txt diff --gi

[PATCH 4/8] powerpc/pseries: Generalize hcall_vphn()

2019-05-10 Thread Naveen N. Rao
H_HOME_NODE_ASSOCIATIVITY hcall can take two different flags and return different associativity information in each case. Generalize the existing hcall_vphn() function to take flags as an argument and to return the result. Update the only existing user to pass the proper arguments. Signed-off-by:

[PATCH 6/8] powerpc/pseries: Provide vcpu dispatch statistics

2019-05-10 Thread Naveen N. Rao
For Shared Processor LPARs, the POWER Hypervisor maintains a relatively static mapping of the LPAR processors (vcpus) to physical processor chips (representing the "home" node) and tries to always dispatch vcpus on their associated physical processor chip. However, under certain scenarios, vcpus ma

[PATCH 5/8] powerpc/pseries: Introduce helpers to gatekeep DTLB usage

2019-05-10 Thread Naveen N. Rao
Since we would be introducing a new user of the DTL buffer in a subsequent patch, add helpers to gatekeep use of the DTL buffer. The current usage of the DTL buffer from debugfs is at a per-cpu level (corresponding to the cpu debugfs file that is opened). Subsequently, we will have users enabling/a

[PATCH 7/8] powerpc/pseries: Protect against hogging the cpu while setting up the stats

2019-05-10 Thread Naveen N. Rao
When enabling or disabling the vcpu dispatch statistics, we do a lot of work including allocating/deallocating memory across all possible cpus for the DTL buffer. In order to guard against hogging the cpu for too long, track the time we're taking and yield the processor if necessary. Signed-off-by

[PATCH 2/8] powerpc/pseries: Do not save the previous DTL mask value

2019-05-10 Thread Naveen N. Rao
When CONFIG_VIRT_CPU_ACCOUNTING_NATIVE is enabled, we always initialize DTL enable mask to DTL_LOG_PREEMPT (0x2). There are no other places where the mask is changed. As such, when reading the DTL log buffer through debugfs, there is no need to save and restore the previous mask value. We don't ne

[PATCH 3/8] powerpc/pseries: Factor out DTL buffer allocation and registration routines

2019-05-10 Thread Naveen N. Rao
Introduce new helpers for DTL buffer allocation and registration and have the existing code use those. Signed-off-by: Naveen N. Rao --- arch/powerpc/include/asm/plpar_wrappers.h | 2 + arch/powerpc/platforms/pseries/lpar.c | 66 --- arch/powerpc/platforms/pseries/setup.c

[PATCH 1/8] powerpc/pseries: Use macros for referring to the DTL enable mask

2019-05-10 Thread Naveen N. Rao
Introduce macros to encode the DTL enable mask fields and use those instead of hardcoding numbers. Signed-off-by: Naveen N. Rao --- arch/powerpc/include/asm/lppaca.h | 11 +++ arch/powerpc/platforms/pseries/dtl.c | 8 +--- arch/powerpc/platforms/pseries/lpar.c | 2 +- arch/

[PATCH 0/8] Provide vcpu dispatch statistics

2019-05-10 Thread Naveen N. Rao
This series adds a new procfs file /proc/powerpc/vcpudispatch_stats for providing statistics around how the LPAR processors are dispatched by the POWER Hypervisor, in a shared LPAR environment. Patch 6/8 has more details on how the statistics are gathered. An example output: $ sudo cat /pro

Re: [PATCH] vsprintf: Do not break early boot with probing addresses

2019-05-10 Thread Steven Rostedt
On Fri, 10 May 2019 10:42:13 +0200 Petr Mladek wrote: > static const char *check_pointer_msg(const void *ptr) > { > - char byte; > - > if (!ptr) > return "(null)"; > > - if (probe_kernel_address(ptr, byte)) > + if ((unsigned long)ptr < PAGE_SIZE || IS_ERR_VALUE

[PATCH v11 5/7] powerpc: define syscall_get_error()

2019-05-10 Thread Dmitry V. Levin
syscall_get_error() is required to be implemented on this architecture in addition to already implemented syscall_get_nr(), syscall_get_arguments(), syscall_get_return_value(), and syscall_get_arch() functions in order to extend the generic ptrace API with PTRACE_GET_SYSCALL_INFO request. Acked-by

[PATCH v11 0/7] ptrace: add PTRACE_GET_SYSCALL_INFO request

2019-05-10 Thread Dmitry V. Levin
[Andrew, could you take this patchset into your tree, please? Besides the patch for hexagon, all patches in this series have Acked-by or Reviewed-by tags already. I have been waiting and pinging the hexagon maintainer since November without any visible effect. The last Acked-by from the hexagon

Re: [PATCH] vsprintf: Do not break early boot with probing addresses

2019-05-10 Thread Petr Mladek
On Fri 2019-05-10 10:42:13, Petr Mladek wrote: > The commit 3e5903eb9cff70730 ("vsprintf: Prevent crash when dereferencing > invalid pointers") broke boot on several architectures. The common > pattern is that probe_kernel_read() is not working during early > boot because userspace access framework

Re: [PATCH 03/16] lib,treewide: add new match_string() helper/macro

2019-05-10 Thread andriy.shevche...@linux.intel.com
On Fri, May 10, 2019 at 09:15:27AM +, Ardelean, Alexandru wrote: > On Wed, 2019-05-08 at 16:22 +0300, Alexandru Ardelean wrote: > > On Wed, 2019-05-08 at 15:18 +0200, Greg KH wrote: > > > On Wed, May 08, 2019 at 04:11:28PM +0300, Andy Shevchenko wrote: > > > > On Wed, May 08, 2019 at 02:28:29PM

[PATCH] powerpc/imc: Add documentation for IMC and trace-mode

2019-05-10 Thread Anju T Sudhakar
Documentation for IMC(In-Memory Collection Counters) infrastructure and trace-mode of IMC. Signed-off-by: Anju T Sudhakar --- Documentation/powerpc/imc.txt | 195 ++ 1 file changed, 195 insertions(+) create mode 100644 Documentation/powerpc/imc.txt diff --git a/

Re: [PATCH] EDAC, mpc85xx: Prevent building as a module

2019-05-10 Thread Borislav Petkov
On Fri, May 10, 2019 at 08:50:52PM +1000, Michael Ellerman wrote: > Yeah that looks better to me. I didn't think about the case where EDAC > core is modular. > > Do you want me to send a new patch? Nah, I'll fix it up. Thx. -- Regards/Gruss, Boris. Good mailing practices for 400: avoid to

Re: [GIT PULL] Please pull powerpc/linux.git powerpc-5.2-1 tag

2019-05-10 Thread pr-tracker-bot
The pull request you sent on Fri, 10 May 2019 22:20:55 +1000: > https://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux.git > tags/powerpc-5.2-1 has been merged into torvalds/linux.git: https://git.kernel.org/torvalds/c/b970afcfcabd63cd3832e95db096439c177c3592 Thank you! -- Deet-doot-do

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

2019-05-10 Thread Michael Ellerman
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Hi Linus, Please pull powerpc updates for 5.2. Slightly delayed due to the issue with printk() calling probe_kernel_read() interacting with our new user access prevention stuff, but all fixed now. The only out-of-area changes are the addition of a c

[PATCH 1/2] powerpc/8xx: move CPM1 related files from sysdev/ to platforms/8xx

2019-05-10 Thread Christophe Leroy
Only 8xx selects CPM1 and related CONFIG options are already in platforms/8xx/Kconfig This patch moves the related C files to platforms/8xx/. Signed-off-by: Christophe Leroy --- arch/powerpc/platforms/8xx/Makefile | 3 +++ arch/powerpc/{sysdev => platforms/8xx}/cpm1.c | 0

[PATCH 2/2] powerpc/8xx: Add microcode patch to move SMC parameter RAM.

2019-05-10 Thread Christophe Leroy
Some SCC functions like the QMC requires an extended parameter RAM. On modern 8xx (ie 866 and 885), SPI area can already be relocated, allowing the use of those functions on SCC2. But SCC3 and SCC4 parameter RAM collide with SMC1 and SMC2 parameter RAMs. This patch adds microcode to allow the relo

Re: [PATCH 09/16] mmc: sdhci-xenon: use new match_string() helper/macro

2019-05-10 Thread Dan Carpenter
On Fri, May 10, 2019 at 09:13:26AM +, Ardelean, Alexandru wrote: > On Wed, 2019-05-08 at 16:26 +0300, Alexandru Ardelean wrote: > > On Wed, 2019-05-08 at 15:20 +0300, Dan Carpenter wrote: > > > > > > > > > On Wed, May 08, 2019 at 02:28:35PM +0300, Alexandru Ardelean wrote: > > > > -static con

Re: [PATCH 09/16] mmc: sdhci-xenon: use new match_string() helper/macro

2019-05-10 Thread Ardelean, Alexandru
On Fri, 2019-05-10 at 14:01 +0300, Dan Carpenter wrote: > [External] > > > On Fri, May 10, 2019 at 09:13:26AM +, Ardelean, Alexandru wrote: > > On Wed, 2019-05-08 at 16:26 +0300, Alexandru Ardelean wrote: > > > On Wed, 2019-05-08 at 15:20 +0300, Dan Carpenter wrote: > > > > > > > > > > > >

Re: [PATCH] EDAC, mpc85xx: Prevent building as a module

2019-05-10 Thread Michael Ellerman
Borislav Petkov writes: > On Thu, May 09, 2019 at 04:55:34PM +0200, Borislav Petkov wrote: >> On Fri, May 10, 2019 at 12:52:05AM +1000, Michael Ellerman wrote: >> > Thanks. It would be nice if you could send it as a fix for 5.2, it's the >> > last thing blocking one of my allmodconfig builds. But

RE: [PATCH] vsprintf: Do not break early boot with probing addresses

2019-05-10 Thread Michael Ellerman
David Laight writes: > From: Michal Suchánek >> Sent: 09 May 2019 14:38 > ... >> > The problem is the combination of some new code called via printk(), >> > check_pointer() which calls probe_kernel_read(). That then calls >> > allow_user_access() (PPC_KUAP) and that uses mmu_has_feature() too earl

[PATCH net 4/5] net: ethernet: fix similar warning reported by kbuild test robot

2019-05-10 Thread Petr Štetiar
This patch fixes following (similar) warning reported by kbuild test robot: In function ‘memcpy’, inlined from ‘smsc75xx_init_mac_address’ at drivers/net/usb/smsc75xx.c:778:3, inlined from ‘smsc75xx_bind’ at drivers/net/usb/smsc75xx.c:1501:2: ./include/linux/string.h:355:9: warning: argumen

[PATCH net 3/5] powerpc: tsi108: fix similar warning reported by kbuild test robot

2019-05-10 Thread Petr Štetiar
This patch fixes following (similar) warning reported by kbuild test robot: In function ‘memcpy’, inlined from ‘smsc75xx_init_mac_address’ at drivers/net/usb/smsc75xx.c:778:3, inlined from ‘smsc75xx_bind’ at drivers/net/usb/smsc75xx.c:1501:2: ./include/linux/string.h:355:9: warning: argumen

[RESEND PATCH] powerpc/pseries: Fix cpu_hotplug_lock acquisition in resize_hpt

2019-05-10 Thread Gautham R. Shenoy
From: "Gautham R. Shenoy" During a memory hotplug operations involving resizing of the HPT, we invoke a stop_machine() to perform the resizing. In this code path, we end up recursively taking the cpu_hotplug_lock, first in memory_hotplug_begin() and then subsequently in stop_machine(). This cause

[PATCH v2] powerpc: slightly improve cache helpers

2019-05-10 Thread Christophe Leroy
Cache instructions (dcbz, dcbi, dcbf and dcbst) take two registers that are summed to obtain the target address. Using 'Z' constraint and '%y0' argument gives GCC the opportunity to use both registers instead of only one with the second being forced to 0. Suggested-by: Segher Boessenkool Signed-o

Re: [PATCH 03/16] lib,treewide: add new match_string() helper/macro

2019-05-10 Thread Ardelean, Alexandru
On Wed, 2019-05-08 at 16:22 +0300, Alexandru Ardelean wrote: > On Wed, 2019-05-08 at 15:18 +0200, Greg KH wrote: > > > > > > On Wed, May 08, 2019 at 04:11:28PM +0300, Andy Shevchenko wrote: > > > On Wed, May 08, 2019 at 02:28:29PM +0300, Alexandru Ardelean wrote: > > > > This change re-introduces

Re: [PATCH 09/16] mmc: sdhci-xenon: use new match_string() helper/macro

2019-05-10 Thread Ardelean, Alexandru
On Wed, 2019-05-08 at 16:26 +0300, Alexandru Ardelean wrote: > On Wed, 2019-05-08 at 15:20 +0300, Dan Carpenter wrote: > > > > > > On Wed, May 08, 2019 at 02:28:35PM +0300, Alexandru Ardelean wrote: > > > -static const char * const phy_types[] = { > > > - "emmc 5.0 phy", > > > - "emmc 5.1

[PATCH] powerpc/pseries: Fix cpu_hotplug_lock acquisition in resize_hpt

2019-05-10 Thread Gautham R. Shenoy
From: "Gautham R. Shenoy" During a memory hotplug operations involving resizing of the HPT, we invoke a stop_machine() to perform the resizing. In this code path, we end up recursively taking the cpu_hotplug_lock, first in memory_hotplug_begin() and then subsequently in stop_machine(). This cause

Re: [PATCH] vsprintf: Do not break early boot with probing addresses

2019-05-10 Thread Sergey Senozhatsky
On (05/10/19 10:42), Petr Mladek wrote: [..] > Fixes: 3e5903eb9cff70730 ("vsprintf: Prevent crash when dereferencing invalid > pointers") > Signed-off-by: Petr Mladek FWIW Reviewed-by: Sergey Senozhatsky -ss

[PATCH] vsprintf: Do not break early boot with probing addresses

2019-05-10 Thread Petr Mladek
The commit 3e5903eb9cff70730 ("vsprintf: Prevent crash when dereferencing invalid pointers") broke boot on several architectures. The common pattern is that probe_kernel_read() is not working during early boot because userspace access framework is not ready. It is a generic problem. We have to avo

Re: [PATCH] vsprintf: Do not break early boot with probing addresses

2019-05-10 Thread Sergey Senozhatsky
On (05/10/19 10:06), Petr Mladek wrote: [..] > I am going to send a patch replacing probe_kernel_address() with > a simple check: > > if ((unsigned long)ptr < PAGE_SIZE || IS_ERR_VALUE(ptr)) > return "(efault)"; I'm OK with this. Probing ptrs was a good idea, it just didn't wo

Re: [PATCH] vsprintf: Do not break early boot with probing addresses

2019-05-10 Thread Petr Mladek
On Fri 2019-05-10 14:07:09, Sergey Senozhatsky wrote: > On (05/09/19 21:47), Linus Torvalds wrote: > >[ Sorry about html and mobile crud, I'm not at the computer right now ] > >How about we just undo the whole misguided probe_kernel_address() thing? > > But the problem will remain - %pS/%p