[PATCH 1/2] powerpc: reserve memory for capture kernel after hugepages init

2019-06-27 Thread Hari Bathini
Sometimes, memory reservation for KDump/FADump can overlap with memory marked for hugepages. This overlap leads to error, hang in KDump case and copy error reported by f/w in case of FADump, while trying to capture dump. Report error while setting up memory for the capture kernel instead of

Re: [PATCH] powerpc/eeh_cache: fix a W=1 kernel-doc warning

2019-06-27 Thread Qian Cai
Ping. On Wed, 2019-06-05 at 16:46 -0400, Qian Cai wrote: > The opening comment mark "/**" is reserved for kernel-doc comments, so > it will generate a warning with "make W=1". > > arch/powerpc/kernel/eeh_cache.c:37: warning: cannot understand function > prototype: 'struct pci_io_addr_range > >

Re: [PATCH v3 2/3] powerpc/papr_scm: Update drc_pmem_unbind() to use H_SCM_UNBIND_ALL

2019-06-27 Thread Vaibhav Jain
Thanks for reviewing this patch Aneesh, "Aneesh Kumar K.V" writes: > On 6/26/19 7:34 PM, Vaibhav Jain wrote: >> The new hcall named H_SCM_UNBIND_ALL has been introduce that can >> unbind all or specific scm memory assigned to an lpar. This is >> more efficient than using H_SCM_UNBIND_MEM as

Re: [PATCH net] net/ibmvnic: Report last valid speed and duplex values to ethtool

2019-06-27 Thread Andrew Lunn
On Thu, Jun 27, 2019 at 12:09:13PM -0500, Thomas Falcon wrote: > This patch resolves an issue with sensitive bonding modes > that require valid speed and duplex settings to function > properly. Currently, the adapter will report that device > speed and duplex is unknown if the communication link >

[PATCH 2/2] powerpc: avoid adjusting memory_limit for capture kernel memory reservation

2019-06-27 Thread Hari Bathini
Currently, if memory_limit is specified and it overlaps with memory to be reserved for capture kernel, memory_limit is adjusted to accommodate capture kernel. With memory reservation for capture kernel moved later (after enforcing memory limit), this adjustment no longer holds water. So, avoid

Re: [PATCH v2] powerpc/setup_64: fix -Wempty-body warnings

2019-06-27 Thread Qian Cai
Ping. On Wed, 2019-06-05 at 16:53 -0400, Qian Cai wrote: > At the beginning of setup_64.c, it has, > >   #ifdef DEBUG >   #define DBG(fmt...) udbg_printf(fmt) >   #else >   #define DBG(fmt...) >   #endif > > where DBG() could be compiled away, and generate warnings, > >

Re: [PATCH v2] powerpc/setup_64: fix -Wempty-body warnings

2019-06-27 Thread Joe Perches
On Thu, 2019-06-27 at 15:52 -0400, Qian Cai wrote: > On Wed, 2019-06-05 at 16:53 -0400, Qian Cai wrote: > > At the beginning of setup_64.c, it has, > > > > #ifdef DEBUG > > #define DBG(fmt...) udbg_printf(fmt) > > #else > > #define DBG(fmt...) > > #endif > > > > where DBG() could be

Re: [PATCH v2] PCI: rpaphp: Avoid a sometimes-uninitialized warning

2019-06-27 Thread Nathan Chancellor
On Mon, Jun 03, 2019 at 03:11:58PM -0700, Nathan Chancellor wrote: > When building with -Wsometimes-uninitialized, clang warns: > > drivers/pci/hotplug/rpaphp_core.c:243:14: warning: variable 'fndit' is > used uninitialized whenever 'for' loop exits because its condition is > false

Re: [PATCH] powerpc/cacheflush: fix variable set but not used

2019-06-27 Thread Qian Cai
Ping. On Thu, 2019-06-06 at 09:58 -0400, Qian Cai wrote: > The powerpc's flush_cache_vmap() is defined as a macro and never use > both of its arguments, so it will generate a compilation warning, > > lib/ioremap.c: In function 'ioremap_page_range': > lib/ioremap.c:203:16: warning: variable

Re: [PATCH net] net/ibmvnic: Report last valid speed and duplex values to ethtool

2019-06-27 Thread Thomas Falcon
On 6/27/19 12:57 PM, Andrew Lunn wrote: On Thu, Jun 27, 2019 at 12:09:13PM -0500, Thomas Falcon wrote: This patch resolves an issue with sensitive bonding modes that require valid speed and duplex settings to function properly. Currently, the adapter will report that device speed and duplex

power9 NUMA crash while reading debugfs imc_cmd

2019-06-27 Thread Qian Cai
ahci libahci tg3 libphy libata firmware_class dm_mirror dm_region_hash dm_log dm_mod [ 1139.415595][ T5301] CPU: 67 PID: 5301 Comm: cat Not tainted 5.2.0-rc6-next- 20190627+ #19 [ 1139.415634][ T5301] NIP:  c00d0d58 LR: c049aa18 CTR: c00d0d50 [ 1139.415675][ T5301] REGS

Re: [PATCH v3 1/2] pid: add pidfd_open()

2019-06-27 Thread Konstantin Khlebnikov
On 20.05.2019 18:56, Christian Brauner wrote: This adds the pidfd_open() syscall. It allows a caller to retrieve pollable pidfds for a process which did not get created via CLONE_PIDFD, i.e. for a process that is created via traditional fork()/clone() calls that is only referenced by a PID: int

Re: [PATCH v2 4/7] powerpc/ftrace: Additionally nop out the preceding mflr with -mprofile-kernel

2019-06-27 Thread Naveen N. Rao
Naveen N. Rao wrote: With -mprofile-kernel, gcc emits 'mflr r0', followed by 'bl _mcount' to enable function tracing and profiling. So far, with dynamic ftrace, we used to only patch out the branch to _mcount(). However, mflr is executed by the branch unit that can only execute one per cycle on

Re: [PATCH v2 4/7] powerpc/ftrace: Additionally nop out the preceding mflr with -mprofile-kernel

2019-06-27 Thread Steven Rostedt
On Thu, 27 Jun 2019 16:53:52 +0530 "Naveen N. Rao" wrote: > With -mprofile-kernel, gcc emits 'mflr r0', followed by 'bl _mcount' to > enable function tracing and profiling. So far, with dynamic ftrace, we > used to only patch out the branch to _mcount(). However, mflr is > executed by the branch

[PATCH] soc/fsl/qbman: Use index when accessing device tree properties

2019-06-27 Thread Roy Pledge
The index value should be passed to the of_parse_phandle() function to ensure the correct property is read. Signed-off-by: Roy Pledge --- drivers/soc/fsl/qbman/dpaa_sys.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/soc/fsl/qbman/dpaa_sys.c

Re: [PATCH v2 3/7] ftrace: Expose __ftrace_replace_code()

2019-06-27 Thread Steven Rostedt
On Thu, 27 Jun 2019 16:53:51 +0530 "Naveen N. Rao" wrote: > While over-riding ftrace_replace_code(), we still want to reuse the > existing __ftrace_replace_code() function. Rename the function and > make it available for other kernel code. > > Signed-off-by: Naveen N. Rao > --- >

Re: [PATCH v2 4/7] powerpc/ftrace: Additionally nop out the preceding mflr with -mprofile-kernel

2019-06-27 Thread Naveen N. Rao
Hi Steven, Thanks for the review! Steven Rostedt wrote: On Thu, 27 Jun 2019 16:53:52 +0530 "Naveen N. Rao" wrote: With -mprofile-kernel, gcc emits 'mflr r0', followed by 'bl _mcount' to enable function tracing and profiling. So far, with dynamic ftrace, we used to only patch out the branch

Re: [PATCH v2 4/7] powerpc/ftrace: Additionally nop out the preceding mflr with -mprofile-kernel

2019-06-27 Thread Steven Rostedt
On Thu, 27 Jun 2019 20:58:20 +0530 "Naveen N. Rao" wrote: > > > But interesting, I don't see a synchronize_rcu_tasks() call > > there. > > We felt we don't need it in this case. We patch the branch to ftrace > with a nop first. Other cpus should see that first. But, now that I > think

Re: [PATCH v2 2/7] x86/ftrace: Fix use of flags in ftrace_replace_code()

2019-06-27 Thread Naveen N. Rao
Steven Rostedt wrote: On Thu, 27 Jun 2019 16:53:50 +0530 "Naveen N. Rao" wrote: In commit a0572f687fb3c ("ftrace: Allow ftrace_replace_code() to be schedulable), the generic ftrace_replace_code() function was modified to accept a flags argument in place of a single 'enable' flag. However, the

Re: [PATCH 3/4] powerpc/powernv: remove unused NPU DMA code

2019-06-27 Thread Greg Kroah-Hartman
On Thu, Jun 27, 2019 at 09:22:40AM +0200, Christoph Hellwig wrote: > On Thu, Jun 27, 2019 at 10:21:55AM +1000, Alexey Kardashevskiy wrote: > > > Which comment? Last time I asked you complaint "it is still used in > > > exactly the same way as before" which you later clarified that you > > > have

Re: [PATCH v2 7/7] powerpc/kprobes: Allow probing on any ftrace address

2019-06-27 Thread Masami Hiramatsu
On Thu, 27 Jun 2019 16:53:55 +0530 "Naveen N. Rao" wrote: > With KPROBES_ON_FTRACE, kprobe is allowed to be inserted on instructions > that branch to _mcount (referred to as ftrace location). With > -mprofile-kernel, we now include the preceding 'mflr r0' as being part > of the ftrace location.

[PATCH net] net/ibmvnic: Report last valid speed and duplex values to ethtool

2019-06-27 Thread Thomas Falcon
This patch resolves an issue with sensitive bonding modes that require valid speed and duplex settings to function properly. Currently, the adapter will report that device speed and duplex is unknown if the communication link with firmware is unavailable. This decision can break LACP

[PATCH 41/87] sound: ppc: remove memset after dma_alloc_coherent

2019-06-27 Thread Fuqian Huang
In commit af7ddd8a627c ("Merge tag 'dma-mapping-4.21' of git://git.infradead.org/users/hch/dma-mapping"), dma_alloc_coherent has already zeroed the memory. So memset is not needed. Signed-off-by: Fuqian Huang --- sound/ppc/pmac.c | 1 - 1 file changed, 1 deletion(-) diff --git

Re: [PATCH] recordmcount: Fix spurious mcount entries on powerpc

2019-06-27 Thread Michael Ellerman
Steven Rostedt writes: > On Thu, 27 Jun 2019 15:55:47 +1000 > Michael Ellerman wrote: > >> Steve are you OK if I merge this via the powerpc tree? I'll reword the >> commit message so that it makes sense coming prior to the commit >> mentioned above. > > Yes, please add: > > Acked-by: Steven

[PATCHv3 2/2] PCI: layerscape: Add CONFIG_PCI_LAYERSCAPE_EP to build EP/RC separately

2019-06-27 Thread Xiaowei Bao
Add CONFIG_PCI_LAYERSCAPE_EP to build EP/RC separately. Signed-off-by: Xiaowei Bao --- v2: - No change. v3: - modify the commit message. drivers/pci/controller/dwc/Kconfig | 20 ++-- drivers/pci/controller/dwc/Makefile |3 ++- 2 files changed, 20 insertions(+), 3

[PATCH v12 00/11] Appended signatures support for IMA appraisal

2019-06-27 Thread Thiago Jung Bauermann
Hello, This version is essentially identical to the last one. It is only a rebase on top of today's linux-integrity/next-queued-testing, prompted by conflicts with Prakhar Srivastava's patches to measure the kernel command line. It also drops two patches that are already present in that branch.

[PATCH v12 06/11] ima: Factor xattr_verify() out of ima_appraise_measurement()

2019-06-27 Thread Thiago Jung Bauermann
Verify xattr signature in a separate function so that the logic in ima_appraise_measurement() remains clear when it gains the ability to also verify an appended module signature. The code in the switch statement is unchanged except for having to dereference the status and cause variables (since

[PATCH v12 01/11] MODSIGN: Export module signature definitions

2019-06-27 Thread Thiago Jung Bauermann
IMA will use the module_signature format for append signatures, so export the relevant definitions and factor out the code which verifies that the appended signature trailer is valid. Also, create a CONFIG_MODULE_SIG_FORMAT option so that IMA can select it and be able to use mod_check_sig()

[PATCH v12 05/11] ima: Add modsig appraise_type option for module-style appended signatures

2019-06-27 Thread Thiago Jung Bauermann
Introduce the modsig keyword to the IMA policy syntax to specify that a given hook should expect the file to have the IMA signature appended to it. Here is how it can be used in a rule: appraise func=KEXEC_KERNEL_CHECK appraise_type=imasig|modsig With this rule, IMA will accept either a

[PATCH v2 27/27] sound: ppc: remove unneeded memset after dma_alloc_coherent

2019-06-27 Thread Fuqian Huang
In commit af7ddd8a627c ("Merge tag 'dma-mapping-4.21' of git://git.infradead.org/users/hch/dma-mapping"), dma_alloc_coherent has already zeroed the memory. So memset is not needed. Signed-off-by: Fuqian Huang --- sound/ppc/pmac.c | 1 - 1 file changed, 1 deletion(-) diff --git

Re: [PATCH v3 01/16] powerpc/fadump: move internal fadump code to a new file

2019-06-27 Thread Stewart Smith
Hari Bathini writes: > diff --git a/arch/powerpc/kernel/fadump-common.c > b/arch/powerpc/kernel/fadump-common.c > new file mode 100644 > index 000..0182886 > --- /dev/null > +++ b/arch/powerpc/kernel/fadump-common.c > @@ -0,0 +1,184 @@ > +/* > + * Firmware-Assisted Dump internal code. > + *

Re: [PATCH V2] crypto/NX: Set receive window credits to max number of CRBs in RxFIFO

2019-06-27 Thread Herbert Xu
On Fri, Jun 28, 2019 at 11:43:16AM +1000, Michael Ellerman wrote: > > No. I assumed you'd take it because it's in drivers/crypto. > > If you want me to take it that's fine, just let me know. No that's fine Michael. I'll pick it up. Thanks, -- Email: Herbert Xu Home Page:

[PATCH v12 04/11] integrity: Select CONFIG_KEYS instead of depending on it

2019-06-27 Thread Thiago Jung Bauermann
This avoids a dependency cycle in soon-to-be-introduced CONFIG_IMA_APPRAISE_MODSIG: it will select CONFIG_MODULE_SIG_FORMAT which in turn selects CONFIG_KEYS. Kconfig then complains that CONFIG_INTEGRITY_SIGNATURE depends on CONFIG_KEYS. Signed-off-by: Thiago Jung Bauermann Signed-off-by: Mimi

Re: power9 NUMA crash while reading debugfs imc_cmd

2019-06-27 Thread Michael Ellerman
d_mod bnx2x mdio ahci libahci tg3 libphy libata firmware_class dm_mirror > dm_region_hash dm_log dm_mod > [ 1139.415595][ T5301] CPU: 67 PID: 5301 Comm: cat Not tainted 5.2.0-rc6-next- > 20190627+ #19 > [ 1139.415634][ T5301] NIP:  c00d0d58 LR: c049aa18 CTR: > c

Re: [PATCH] powerpc/64s/radix: Define arch_ioremap_p4d_supported()

2019-06-27 Thread Anshuman Khandual
build problem. > > The easiest option is for this to be folded into your patch that creates > the requirement for arch_ioremap_p4d_supported(). > > Andrew might do that for you, or you could send a v2. > > This looks fine from a powerpc POV: > > Acked-by: Michael Ellerman

Re: [PATCH] powerpc/64s/radix: Define arch_ioremap_p4d_supported()

2019-06-27 Thread Stephen Rothwell
Hi Anshuman, On Fri, 28 Jun 2019 09:14:46 +0530 Anshuman Khandual wrote: > > On linux-next (next-20190627) this change has already been applied though a > merge commit 153083a99fe431 ("Merge branch 'akpm-current/current'"). So we > are good on this ? Or shall I send out

Re: [PATCH v3 1/3] powerpc/pseries: Update SCM hcall op-codes in hvcall.h

2019-06-27 Thread Oliver O'Halloran
On Fri, Jun 28, 2019 at 1:39 PM Michael Ellerman wrote: > > Vaibhav Jain writes: > > *snip* > > How can we be changing the meaning of HCALL numbers without breaking all > existing usages? The changed one being changed here were never used by linux or implemented by either hypervisor. > Where

Re: [PATCH RFC] generic ELF support for kexec

2019-06-27 Thread Michael Ellerman
Hi Sven, Sven Schnelle writes: > Hi List, > > i recently started working on kexec for PA-RISC. While doing so, i figured > that powerpc already has support for reading ELF images inside of the Kernel. > My first attempt was to steal the source code and modify it for PA-RISC, but > it turned out

[PATCH v12 02/11] PKCS#7: Refactor verify_pkcs7_signature()

2019-06-27 Thread Thiago Jung Bauermann
IMA will need to verify a PKCS#7 signature which has already been parsed. For this reason, factor out the code which does that from verify_pkcs7_signature() into a new function which takes a struct pkcs7_message instead of a data buffer. Signed-off-by: Thiago Jung Bauermann Reviewed-by: Mimi

[PATCH v12 09/11] ima: Define ima-modsig template

2019-06-27 Thread Thiago Jung Bauermann
Define new "d-modsig" template field which holds the digest that is expected to match the one contained in the modsig, and also new "modsig" template field which holds the appended file signature. Add a new "ima-modsig" defined template descriptor with the new fields as well as the ones from the

[PATCH v12 11/11] ima: Allow template= option for appraise rules as well

2019-06-27 Thread Thiago Jung Bauermann
It's useful being able to specify a different IMA template on appraise policy rules, so allow it. Signed-off-by: Thiago Jung Bauermann Suggested-by: Mimi Zohar --- security/integrity/ima/ima_policy.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git

Re: power9 NUMA crash while reading debugfs imc_cmd

2019-06-27 Thread Qian Cai
MP NR_CPUS=256 >> DEBUG_PAGEALLOC NUMA PowerNV >> [ 1139.415542][ T5301] Modules linked in: i2c_opal i2c_core ip_tables >> x_tables >> xfs sd_mod bnx2x mdio ahci libahci tg3 libphy libata firmware_class dm_mirror >> dm_region_hash dm_log dm_mod >> [ 1139.415595][ T530

Re: [PATCH] recordmcount: Fix spurious mcount entries on powerpc

2019-06-27 Thread Michael Ellerman
Satheesh Rajendran writes: > On Thu, Jun 27, 2019 at 12:08:01AM +0530, Naveen N. Rao wrote: >> The recent change enabling HAVE_C_RECORDMCOUNT on powerpc started >> showing the following issue: >> >> # modprobe kprobe_example >>ftrace-powerpc: Not expected bl: opcode is 3c4c0001 >>

[PATCH v12 08/11] ima: Collect modsig

2019-06-27 Thread Thiago Jung Bauermann
Obtain the modsig and calculate its corresponding hash in ima_collect_measurement(). Signed-off-by: Thiago Jung Bauermann --- security/integrity/ima/ima.h | 8 - security/integrity/ima/ima_api.c | 5 ++- security/integrity/ima/ima_appraise.c | 2 +-

Re: [PATCH] powerpc/eeh_cache: fix a W=1 kernel-doc warning

2019-06-27 Thread Russell Currey
On Wed, 2019-06-05 at 16:46 -0400, Qian Cai wrote: > The opening comment mark "/**" is reserved for kernel-doc comments, > so > it will generate a warning with "make W=1". > > arch/powerpc/kernel/eeh_cache.c:37: warning: cannot understand > function > prototype: 'struct pci_io_addr_range > >

Re: [PATCH v3 1/3] powerpc/pseries: Update SCM hcall op-codes in hvcall.h

2019-06-27 Thread Michael Ellerman
Vaibhav Jain writes: > Update the hvcalls.h to include op-codes for new hcalls introduce to > manage SCM memory. Also update existing hcall definitions to reflect > current papr specification for SCM. > > Signed-off-by: Vaibhav Jain > --- > Change-log: > > v3: > * Added updated opcode for

Re: [PATCH v2] PCI: rpaphp: Avoid a sometimes-uninitialized warning

2019-06-27 Thread Joel Savitz
>On Mon, Jun 03, 2019 at 03:11:58PM -0700, Nathan Chancellor wrote: >> When building with -Wsometimes-uninitialized, clang warns: >> >> drivers/pci/hotplug/rpaphp_core.c:243:14: warning: variable 'fndit' is >> used uninitialized whenever 'for' loop exits because its condition is >> false

Re: [PATCH V2] crypto/NX: Set receive window credits to max number of CRBs in RxFIFO

2019-06-27 Thread Herbert Xu
On Tue, Jun 18, 2019 at 12:09:22PM -0700, Haren Myneni wrote: > > System gets checkstop if RxFIFO overruns with more requests than the > maximum possible number of CRBs in FIFO at the same time. The max number > of requests per window is controlled by window credits. So find max > CRBs from

Re: [PATCH] crypto: talitos - eliminate unneeded 'done' functions at build time

2019-06-27 Thread Herbert Xu
On Mon, Jun 17, 2019 at 09:14:45PM +, Christophe Leroy wrote: > When building for SEC1 only, talitos2_done functions are unneeded > and should go away. > > For this, use has_ftr_sec1() which will always return true when only > SEC1 support is being built, allowing GCC to drop TALITOS2

Re: [PATCH v2] powerpc/power: Expose pfn_is_nosave prototype

2019-06-27 Thread Rafael J. Wysocki
On Friday, May 24, 2019 12:44:18 PM CEST Mathieu Malaterre wrote: > The declaration for pfn_is_nosave is only available in > kernel/power/power.h. Since this function can be override in arch, > expose it globally. Having a prototype will make sure to avoid warning > (sometime treated as error with

pata-macio on PowerBook G3: stuck interrupt with MATSHITA CR-174 CD-ROM

2019-06-27 Thread Finn Thain
Hi All, I've received a bug report concerning the pata-macio driver, when running on a PowerBook G3 (Wallstreet). With CONFIG_PATA_MACIO=n && CONFIG_BLK_DEV_IDE_PMAC=y, everything works. With CONFIG_PATA_MACIO=y && CONFIG_BLK_DEV_IDE_PMAC=n, the CD-ROM fails. When the CD-ROM mediabay module

Re: [PATCH] powerpc/configs: Disable /dev/port in skiroot defconfig

2019-06-27 Thread Michael Ellerman
Daniel Axtens writes: > While reviewing lockdown patches, I discovered that we still enable > /dev/port (CONFIG_DEVPORT) in skiroot. > > We don't need it. Deselect CONFIG_DEVPORT for skiroot. Why don't we need it? :) cheers > diff --git a/arch/powerpc/configs/skiroot_defconfig >

[PATCHv3 1/2] PCI: layerscape: Add the bar_fixed_64bit property in EP driver.

2019-06-27 Thread Xiaowei Bao
The PCIe controller of layerscape just have 4 BARs, BAR0 and BAR1 is 32bit, BAR3 and BAR4 is 64bit, this is determined by hardware, so set the bar_fixed_64bit with 0x14. Signed-off-by: Xiaowei Bao --- v2: - Replace value 0x14 with a macro. v3: - No change.

Re: [RFC PATCH] virtio_ring: Use DMA API if guest memory is encrypted

2019-06-27 Thread Thiago Jung Bauermann
Michael S. Tsirkin writes: > On Mon, Jun 03, 2019 at 10:13:59PM -0300, Thiago Jung Bauermann wrote: >> >> >> Michael S. Tsirkin writes: >> >> > On Wed, Apr 17, 2019 at 06:42:00PM -0300, Thiago Jung Bauermann wrote: >> >> I rephrased it in terms of address translation. What do you think of >>

[PATCH v12 03/11] PKCS#7: Introduce pkcs7_get_digest()

2019-06-27 Thread Thiago Jung Bauermann
IMA will need to access the digest of the PKCS7 message (as calculated by the kernel) before the signature is verified, so introduce pkcs7_get_digest() for that purpose. Also, modify pkcs7_digest() to detect when the digest was already calculated so that it doesn't have to do redundant work.

Re: [PATCH] powerpc/rtas: retry when cpu offline races with suspend/migration

2019-06-27 Thread Juliet Kim
On 6/27/19 12:01 AM, Michael Ellerman wrote: > Juliet Kim writes: >> On 6/25/19 1:51 PM, Nathan Lynch wrote: >>> Juliet Kim writes: >>> There's some concern this could retry forever, resulting in live lock. >>> First of all the system will make progress in other areas even if there >>>

Re: [PATCH V2] crypto/NX: Set receive window credits to max number of CRBs in RxFIFO

2019-06-27 Thread Michael Ellerman
Herbert Xu writes: > Haren Myneni wrote: >> >> System gets checkstop if RxFIFO overruns with more requests than the >> maximum possible number of CRBs in FIFO at the same time. The max number >> of requests per window is controlled by window credits. So find max >> CRBs from FIFO size and

[PATCH v12 07/11] ima: Implement support for module-style appended signatures

2019-06-27 Thread Thiago Jung Bauermann
Implement the appraise_type=imasig|modsig option, allowing IMA to read and verify modsig signatures. In case a file has both an xattr signature and an appended modsig, IMA will only use the appended signature if the key used by the xattr signature isn't present in the IMA or platform keyring.

[PATCH v12 10/11] ima: Store the measurement again when appraising a modsig

2019-06-27 Thread Thiago Jung Bauermann
If the IMA template contains the "modsig" or "d-modsig" field, then the modsig should be added to the measurement list when the file is appraised. And that is what normally happens, but if a measurement rule caused a file containing a modsig to be measured before a different rule causes it to be

[PATCH V2] mm/ioremap: Probe platform for p4d huge map support

2019-06-27 Thread Anshuman Khandual
arch list - Added tags from Michael Ellerman Hello Andrew, This applies and builds on linux-next (next-20190627) which contains d909f9109c30 ("powerpc/64s/radix: Enable HAVE_ARCH_HUGE_VMAP") but after 1. Reverting V1 of this patch d31cf72b92ec ("mm/ioremap: probe platform for

[PATCH v3 06/13] powerpc/64s/exception: simplify hmi windup code

2019-06-27 Thread Nicholas Piggin
Duplicate the hmi windup code for both cases, rather than to put a special case branch in the middle of it. Remove unused label. This helps with later code consolidation. Signed-off-by: Nicholas Piggin --- arch/powerpc/kernel/exceptions-64s.S | 22 ++ 1 file changed, 18

[PATCH v3 11/13] powerpc/64s/exception: denorm handler use standard scratch save macro

2019-06-27 Thread Nicholas Piggin
Although the 0x1500 interrupt only applies to bare metal, it is better to just use the standard macro for scratch save. Runtime code path remains unchanged (due to instruction patching). Signed-off-by: Nicholas Piggin --- arch/powerpc/kernel/exceptions-64s.S | 2 +- 1 file changed, 1

[PATCH v3 05/13] powerpc/64s/exception: move machine check windup in_mce handling

2019-06-27 Thread Nicholas Piggin
Move in_mce decrement earlier before registers are restored (but still after RI=0). This helps with later consolidation. Signed-off-by: Nicholas Piggin --- arch/powerpc/kernel/exceptions-64s.S | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git

[PATCH v3 04/13] powerpc/64s/exception: windup use r9 consistently to restore SPRs

2019-06-27 Thread Nicholas Piggin
Trivial code change, r3->r9. Signed-off-by: Nicholas Piggin --- arch/powerpc/kernel/exceptions-64s.S | 12 ++-- 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/arch/powerpc/kernel/exceptions-64s.S b/arch/powerpc/kernel/exceptions-64s.S index 0804a86f6f28..b1dfd0af0120

Re: [PATCH v3 01/16] powerpc/fadump: move internal fadump code to a new file

2019-06-27 Thread Hari Bathini
On 28/06/19 10:25 AM, Stewart Smith wrote: > Hari Bathini writes: >> diff --git a/arch/powerpc/kernel/fadump-common.c >> b/arch/powerpc/kernel/fadump-common.c >> new file mode 100644 >> index 000..0182886 >> --- /dev/null >> +++ b/arch/powerpc/kernel/fadump-common.c >> @@ -0,0 +1,184 @@ >>

[PATCH v3 01/13] powerpc/64s/exception: clean up system call entry

2019-06-27 Thread Nicholas Piggin
syscall / hcall entry unnecessarily differs between KVM and non-KVM builds. Move the SMT priority instruction to the same location (after INTERRUPT_TO_KERNEL). Signed-off-by: Nicholas Piggin --- arch/powerpc/kernel/exceptions-64s.S | 24 +++- 1 file changed, 7 insertions(+),

[PATCH v3 03/13] powerpc/64s/exception: mtmsrd L=1 cleanup

2019-06-27 Thread Nicholas Piggin
All supported 64s CPUs support mtmsrd L=1 instruction, so a cleanup can be made in sreset and mce handlers. Signed-off-by: Nicholas Piggin --- arch/powerpc/kernel/exceptions-64s.S | 9 ++--- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/arch/powerpc/kernel/exceptions-64s.S

[PATCH v3 02/13] powerpc/64s/exception: avoid SPR RAW scoreboard stall in real mode entry

2019-06-27 Thread Nicholas Piggin
Move SPR reads ahead of writes. Real mode entry that is not a KVM guest is rare these days, but bad practice propagates. Signed-off-by: Nicholas Piggin --- arch/powerpc/kernel/exceptions-64s.S | 14 +++--- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git

[PATCH v3 09/13] powerpc/64s/exception: add dar and dsisr options to exception macro

2019-06-27 Thread Nicholas Piggin
Some exception entry requires DAR and/or DSISR to be saved into the paca exception save area. Add options to the standard exception macros for these. Generated code changes slightly due to code structure. - 554: a6 02 72 7d mfdsisr r11 - 558: a8 00 4d f9 std

[PATCH v3 10/13] powerpc/64s/exception: machine check use standard macros to save dar/dsisr

2019-06-27 Thread Nicholas Piggin
Signed-off-by: Nicholas Piggin --- arch/powerpc/kernel/exceptions-64s.S | 6 +- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/arch/powerpc/kernel/exceptions-64s.S b/arch/powerpc/kernel/exceptions-64s.S index 4427b6820f51..f193a67f02ba 100644 ---

[PATCH v3 00/13] next batch of interrupt handler improvements

2019-06-27 Thread Nicholas Piggin
This is the next set of patches after the previous 26, these change the generated code around a bit more than the first batch, but mostly fairly trivial. End result is making exception written and generated code more common. Next steps are improvements to the "special" real mode handlers (sreset,

[PATCH v3 07/13] powerpc/64s/exception: shuffle windup code around

2019-06-27 Thread Nicholas Piggin
Restore all SPRs and CR up-front, these are longer latency instructions. Move register restore around to maximise pairs of adjacent loads (e.g., restore r0 next to r1). Signed-off-by: Nicholas Piggin --- arch/powerpc/kernel/exceptions-64s.S | 40 +++- 1 file changed, 16

[PATCH v3 08/13] powerpc/64s/exception: use common macro for windup

2019-06-27 Thread Nicholas Piggin
No generated code change. Signed-off-by: Nicholas Piggin --- arch/powerpc/kernel/exceptions-64s.S | 112 +-- 1 file changed, 36 insertions(+), 76 deletions(-) diff --git a/arch/powerpc/kernel/exceptions-64s.S b/arch/powerpc/kernel/exceptions-64s.S index

[PATCH v3 12/13] powerpc/64s/exception: move SET_SCRATCH0 into EXCEPTION_PROLOG_0

2019-06-27 Thread Nicholas Piggin
No generated code change. Signed-off-by: Nicholas Piggin --- arch/powerpc/kernel/exceptions-64s.S | 25 + 1 file changed, 1 insertion(+), 24 deletions(-) diff --git a/arch/powerpc/kernel/exceptions-64s.S b/arch/powerpc/kernel/exceptions-64s.S index

[PATCH v3 13/13] powerpc/tm: update comment about interrupt re-entrancy

2019-06-27 Thread Nicholas Piggin
Since the system reset interrupt began to use its own stack, and machine check interrupts have done so for some time, r1 can be changed without clearing MSR[RI], provided no other interrupts (including SLB misses) are taken. MSR[RI] does have to be cleared when using SCRATCH0, however.

Re: [PATCH] recordmcount: Fix spurious mcount entries on powerpc

2019-06-27 Thread Satheesh Rajendran
On Thu, Jun 27, 2019 at 12:08:01AM +0530, Naveen N. Rao wrote: > The recent change enabling HAVE_C_RECORDMCOUNT on powerpc started > showing the following issue: > > # modprobe kprobe_example >ftrace-powerpc: Not expected bl: opcode is 3c4c0001 >WARNING: CPU: 0 PID: 227 at

Re: [PATCH 0/5] Enable CONFIG_NODES_SPAN_OTHER_NODES by default for NUMA

2019-06-27 Thread Aaron Lindsay OS
On Jun 26 08:28, Linus Torvalds wrote: > This is not a comment on the patch series itself, it is a comment on the > emails. > > Your email is mis-configured and ends up all being marked as spam for > me, because you go through the wrong smtp server (or maybe your smtp > server itself is

[PATCH v2 6/7] kprobes/ftrace: Use ftrace_location() when [dis]arming probes

2019-06-27 Thread Naveen N. Rao
Ftrace location could include more than a single instruction in case of some architectures (powerpc64, for now). In this case, kprobe is permitted on any of those instructions, and uses ftrace infrastructure for functioning. However, [dis]arm_kprobe_ftrace() uses the kprobe address when setting

Re: [PATCH] powerpc/pseries: Fix maximum memory value

2019-06-27 Thread Aravinda Prasad
On Thursday 27 June 2019 04:06 AM, Nathan Lynch wrote: > Aravinda Prasad writes: >> Calculating the maximum memory based on the number of lmbs >> and lmb size does not account for the RMA region. Hence >> use drmem_lmb_memory_max(), which already accounts for the >> RMA region, to fetch the

[PATCH v2 7/7] powerpc/kprobes: Allow probing on any ftrace address

2019-06-27 Thread Naveen N. Rao
With KPROBES_ON_FTRACE, kprobe is allowed to be inserted on instructions that branch to _mcount (referred to as ftrace location). With -mprofile-kernel, we now include the preceding 'mflr r0' as being part of the ftrace location. However, by default, probing on an instruction that is not actually

Re: [PATCH] recordmcount: Fix spurious mcount entries on powerpc

2019-06-27 Thread Steven Rostedt
On Thu, 27 Jun 2019 15:55:47 +1000 Michael Ellerman wrote: > Steve are you OK if I merge this via the powerpc tree? I'll reword the > commit message so that it makes sense coming prior to the commit > mentioned above. Yes, please add: Acked-by: Steven Rostedt (VMware) Thanks, -- Steve

[PATCH v2 3/7] ftrace: Expose __ftrace_replace_code()

2019-06-27 Thread Naveen N. Rao
While over-riding ftrace_replace_code(), we still want to reuse the existing __ftrace_replace_code() function. Rename the function and make it available for other kernel code. Signed-off-by: Naveen N. Rao --- include/linux/ftrace.h | 1 + kernel/trace/ftrace.c | 8 2 files changed, 5

Re: [PATCH v2 2/7] x86/ftrace: Fix use of flags in ftrace_replace_code()

2019-06-27 Thread Naveen N. Rao
Naveen N. Rao wrote: In commit a0572f687fb3c ("ftrace: Allow ftrace_replace_code() to be schedulable), the generic ftrace_replace_code() function was modified to accept a flags argument in place of a single 'enable' flag. However, the x86 version of this function was not updated. Fix the same.

[PATCH v2 4/7] powerpc/ftrace: Additionally nop out the preceding mflr with -mprofile-kernel

2019-06-27 Thread Naveen N. Rao
With -mprofile-kernel, gcc emits 'mflr r0', followed by 'bl _mcount' to enable function tracing and profiling. So far, with dynamic ftrace, we used to only patch out the branch to _mcount(). However, mflr is executed by the branch unit that can only execute one per cycle on POWER9 and shared with

[PATCH v2 5/7] ftrace: Update ftrace_location() for powerpc -mprofile-kernel

2019-06-27 Thread Naveen N. Rao
Now that we are patching the preceding 'mflr r0' instruction with -mprofile-kernel, we need to update ftrace_location() to recognise that as being part of ftrace. To do this, we introduce FTRACE_IP_EXTENSION to denote the length (in bytes) of the mcount caller. By default, this is set to 0. For

[PATCH] powerpc/xmon: Fix disabling tracing while in xmon

2019-06-27 Thread Naveen N. Rao
Commit ed49f7fd6438d ("powerpc/xmon: Disable tracing when entering xmon") added code to disable recording trace entries while in xmon. The commit introduced a variable 'tracing_enabled' to record if tracing was enabled on xmon entry, and used this to conditionally enable tracing during exit from

[PATCH v2 1/7] ftrace: Expose flags used for ftrace_replace_code()

2019-06-27 Thread Naveen N. Rao
Since ftrace_replace_code() is a __weak function and can be overridden, we need to expose the flags that can be set. So, move the flags enum to the header file. Reviewed-by: Steven Rostedt (VMware) Signed-off-by: Naveen N. Rao --- include/linux/ftrace.h | 5 + kernel/trace/ftrace.c | 5

[PATCH v2 0/7] powerpc/ftrace: Patch out -mprofile-kernel instructions

2019-06-27 Thread Naveen N. Rao
Changes since v1 (https://patchwork.ozlabs.org/project/linuxppc-dev/list/?series=114556): - Patches 1,2,3 and 6: No changes - Patch 4: Add smp_call_function() to flush icache on all cpus after patching in the 'mflr r0' instruction. - Patch 5: Changes as per Steven Rostedt's suggestions. -

[PATCH v2 2/7] x86/ftrace: Fix use of flags in ftrace_replace_code()

2019-06-27 Thread Naveen N. Rao
In commit a0572f687fb3c ("ftrace: Allow ftrace_replace_code() to be schedulable), the generic ftrace_replace_code() function was modified to accept a flags argument in place of a single 'enable' flag. However, the x86 version of this function was not updated. Fix the same. Fixes: a0572f687fb3c

Re: [PATCH v2 2/7] x86/ftrace: Fix use of flags in ftrace_replace_code()

2019-06-27 Thread Steven Rostedt
On Thu, 27 Jun 2019 16:53:50 +0530 "Naveen N. Rao" wrote: > In commit a0572f687fb3c ("ftrace: Allow ftrace_replace_code() to be > schedulable), the generic ftrace_replace_code() function was modified to > accept a flags argument in place of a single 'enable' flag. However, the > x86 version of

Re: [PATCH V2] crypto/NX: Set receive window credits to max number of CRBs in RxFIFO

2019-06-27 Thread Herbert Xu
Haren Myneni wrote: > > System gets checkstop if RxFIFO overruns with more requests than the > maximum possible number of CRBs in FIFO at the same time. The max number > of requests per window is controlled by window credits. So find max > CRBs from FIFO size and set it to receive window

Re: [PATCH 3/4] powerpc/powernv: remove unused NPU DMA code

2019-06-27 Thread Christoph Hellwig
On Thu, Jun 27, 2019 at 10:21:55AM +1000, Alexey Kardashevskiy wrote: > > Which comment? Last time I asked you complaint "it is still used in > > exactly the same way as before" which you later clarified that you > > have a hidden out of tree user somewhere, and you only objected to > > It is