Re: [PATCH 2/3] powernv/pci: Use common code in pnv_ioda_pick_m64_pe()

2017-10-17 Thread Alexey Kardashevskiy
On 18/10/17 02:39, SF Markus Elfring wrote: > From: Markus Elfring > Date: Tue, 17 Oct 2017 17:07:54 +0200 > > Add a jump target so that a bit of code can be better reused > at the end of this function. Rather than moving bits around, I'd rather allocate pe_alloc

Re: [PATCH 3/3] powernv/pci: Improve a size determination in pnv_pci_init_ioda_phb()

2017-10-17 Thread Alexey Kardashevskiy
On 18/10/17 02:40, SF Markus Elfring wrote: > From: Markus Elfring > Date: Tue, 17 Oct 2017 17:18:10 +0200 > > Replace the specification of a data structure by a pointer dereference > as the parameter for the operator "sizeof" to make the corresponding size >

Re: [PATCH 1/3] powernv/pci: Delete an error message for a failed memory allocation in pnv_ioda_pick_m64_pe()

2017-10-17 Thread Alexey Kardashevskiy
On 18/10/17 02:37, SF Markus Elfring wrote: > From: Markus Elfring > Date: Tue, 17 Oct 2017 16:52:43 +0200 > > Omit an extra message for a memory allocation failure in this function. > > This issue was detected by using the Coccinelle software. > > Signed-off-by:

Re: [PATCH 09/25] powerpc: ability to create execute-disabled pkeys

2017-10-17 Thread Ram Pai
On Wed, Oct 18, 2017 at 02:42:56PM +1100, Balbir Singh wrote: > On Fri, 8 Sep 2017 15:44:57 -0700 > Ram Pai wrote: > > > powerpc has hardware support to disable execute on a pkey. > > This patch enables the ability to create execute-disabled > > keys. > > > >

Re: [PATCH v3] KVM: PPC: Book3S PR: only install valid SLBs during KVM_SET_SREGS

2017-10-17 Thread David Gibson
On Mon, Oct 16, 2017 at 12:29:44PM +0200, Greg Kurz wrote: > Userland passes an array of 64 SLB descriptors to KVM_SET_SREGS, > some of which are valid (ie, SLB_ESID_V is set) and the rest are > likely all-zeroes (with QEMU at least). > > Each of them is then passed to

Re: [PATCH 17/25] powerpc: helper to validate key-access permissions of a pte

2017-10-17 Thread Balbir Singh
On Fri, 8 Sep 2017 15:45:05 -0700 Ram Pai wrote: > helper function that checks if the read/write/execute is allowed > on the pte. > > Signed-off-by: Ram Pai > --- > arch/powerpc/include/asm/book3s/64/pgtable.h |4 +++ >

Re: [PATCH 16/25] powerpc: Program HPTE key protection bits

2017-10-17 Thread Balbir Singh
On Fri, 8 Sep 2017 15:45:04 -0700 Ram Pai wrote: > Map the PTE protection key bits to the HPTE key protection bits, > while creating HPTE entries. > > Signed-off-by: Ram Pai > --- > arch/powerpc/include/asm/book3s/64/mmu-hash.h |5 + >

Re: [PATCH 14/25] powerpc: map vma key-protection bits to pte key bits.

2017-10-17 Thread Balbir Singh
On Fri, 8 Sep 2017 15:45:02 -0700 Ram Pai wrote: > map the key protection bits of the vma to the pkey bits in > the PTE. > > The Pte bits used for pkey are 3,4,5,6 and 57. The first > four bits are the same four bits that were freed up initially > in this patch

Re: [PATCH 13/25] powerpc: implementation for arch_override_mprotect_pkey()

2017-10-17 Thread Balbir Singh
On Fri, 8 Sep 2017 15:45:01 -0700 Ram Pai wrote: > arch independent code calls arch_override_mprotect_pkey() > to return a pkey that best matches the requested protection. > > This patch provides the implementation. > > Signed-off-by: Ram Pai > --- >

Re: [PATCH 12/25] powerpc: ability to associate pkey to a vma

2017-10-17 Thread Balbir Singh
On Fri, 8 Sep 2017 15:45:00 -0700 Ram Pai wrote: > arch-independent code expects the arch to map > a pkey into the vma's protection bit setting. > The patch provides that ability. > > Signed-off-by: Ram Pai > --- > arch/powerpc/include/asm/mman.h

Re: [PATCH 11/25] powerpc: introduce execute-only pkey

2017-10-17 Thread Balbir Singh
On Fri, 8 Sep 2017 15:44:59 -0700 Ram Pai wrote: > This patch provides the implementation of execute-only pkey. > The architecture-independent layer expects the arch-dependent > layer, to support the ability to create and enable a special > key which has execute-only

Re: [PATCH 10/25] powerpc: store and restore the pkey state across context switches

2017-10-17 Thread Balbir Singh
On Fri, 8 Sep 2017 15:44:58 -0700 Ram Pai wrote: > Store and restore the AMR, IAMR and UAMOR register state of the task > before scheduling out and after scheduling in, respectively. > > Signed-off-by: Ram Pai > --- > arch/powerpc/include/asm/pkeys.h

Re: [PATCH 09/25] powerpc: ability to create execute-disabled pkeys

2017-10-17 Thread Balbir Singh
On Fri, 8 Sep 2017 15:44:57 -0700 Ram Pai wrote: > powerpc has hardware support to disable execute on a pkey. > This patch enables the ability to create execute-disabled > keys. > > Signed-off-by: Ram Pai > --- > arch/powerpc/include/uapi/asm/mman.h

Re: [PATCH 04/25] powerpc: helper function to read,write AMR,IAMR,UAMOR registers

2017-10-17 Thread Ram Pai
On Wed, Oct 18, 2017 at 02:17:35PM +1100, Balbir Singh wrote: > On Fri, 8 Sep 2017 15:44:52 -0700 > Ram Pai wrote: > > > Implements helper functions to read and write the key related > > registers; AMR, IAMR, UAMOR. > > > > AMR register tracks the read,write permission of

Re: [RFC v7 02/25] powerpc: track allocation status of all pkeys

2017-10-17 Thread Ram Pai
On Wed, Oct 18, 2017 at 01:42:49PM +1100, Balbir Singh wrote: > On Sun, 30 Jul 2017 17:12:03 -0700 > Ram Pai wrote: > > > Total 32 keys are available on power7 and above. However > > pkey 0,1 are reserved. So effectively we have 30 pkeys. > > > > On 4K kernels, we do not

Re: [PATCH 06/25] powerpc: cleaup AMR,iAMR when a key is allocated or freed

2017-10-17 Thread Balbir Singh
On Fri, 8 Sep 2017 15:44:54 -0700 Ram Pai wrote: > cleanup the bits corresponding to a key in the AMR, and IAMR > register, when the key is newly allocated/activated or is freed. > We dont want some residual bits cause the hardware enforce > unintended behavior when the key

Re: [PATCH 05/25] powerpc: helper functions to initialize AMR, IAMR and UAMOR registers

2017-10-17 Thread Balbir Singh
On Fri, 8 Sep 2017 15:44:53 -0700 Ram Pai wrote: > Introduce helper functions that can initialize the bits in the AMR, > IAMR and UAMOR register; the bits that correspond to the given pkey. > > Signed-off-by: Ram Pai > --- >

Re: [PATCH 0/4] char-TPM: Adjustments for ten function implementations

2017-10-17 Thread Michael Ellerman
Mimi Zohar writes: > On Tue, 2017-10-17 at 12:11 +0200, Julia Lawall wrote: >> On Tue, 17 Oct 2017, Dan Carpenter wrote: >> > On Tue, Oct 17, 2017 at 10:56:42AM +0200, Julia Lawall wrote: >> > > On Tue, 17 Oct 2017, Dan Carpenter wrote: >> > > > On Mon, Oct 16, 2017 at

Re: [PATCH 04/25] powerpc: helper function to read,write AMR,IAMR,UAMOR registers

2017-10-17 Thread Balbir Singh
On Fri, 8 Sep 2017 15:44:52 -0700 Ram Pai wrote: > Implements helper functions to read and write the key related > registers; AMR, IAMR, UAMOR. > > AMR register tracks the read,write permission of a key > IAMR register tracks the execute permission of a key > UAMOR

Re: [RFC v7 24/25] powerpc: Deliver SEGV signal on pkey violation

2017-10-17 Thread Ram Pai
On Wed, Oct 18, 2017 at 01:25:48PM +1100, Balbir Singh wrote: > On Fri, 18 Aug 2017 15:36:55 -0700 > Ram Pai wrote: > > > On Sat, Aug 19, 2017 at 07:54:20AM +1000, Benjamin Herrenschmidt wrote: > > > On Fri, 2017-08-18 at 10:04 -0700, Ram Pai wrote: > > > > Assume two

Re: [PATCH 03/25] powerpc: track allocation status of all pkeys

2017-10-17 Thread Balbir Singh
On Fri, 8 Sep 2017 15:44:51 -0700 Ram Pai wrote: > Total 32 keys are available on power7 and above. However > pkey 0,1 are reserved. So effectively we have 30 pkeys. > > On 4K kernels, we do not have 5 bits in the PTE to > represent all the keys; we only have

Re: [PATCH] powerpc/mm/radix: Drop unneeded NULL check

2017-10-17 Thread Aneesh Kumar K.V
On 10/17/2017 05:24 PM, Nicholas Piggin wrote: On Mon, 16 Oct 2017 12:41:00 +0530 "Aneesh Kumar K.V" wrote: @@ -175,10 +175,9 @@ void radix__local_flush_tlb_page(struct vm_area_struct *vma, unsigned long vmadd #ifdef CONFIG_HUGETLB_PAGE /* need

Re: [RFC v7 02/25] powerpc: track allocation status of all pkeys

2017-10-17 Thread Balbir Singh
On Sun, 30 Jul 2017 17:12:03 -0700 Ram Pai wrote: > Total 32 keys are available on power7 and above. However > pkey 0,1 are reserved. So effectively we have 30 pkeys. > > On 4K kernels, we do not have 5 bits in the PTE to > represent all the keys; we only have

Re: [RFC v7 24/25] powerpc: Deliver SEGV signal on pkey violation

2017-10-17 Thread Balbir Singh
On Fri, 18 Aug 2017 15:36:55 -0700 Ram Pai wrote: > On Sat, Aug 19, 2017 at 07:54:20AM +1000, Benjamin Herrenschmidt wrote: > > On Fri, 2017-08-18 at 10:04 -0700, Ram Pai wrote: > > > Assume two threads of a task. > > > > > > T1: mprotect_key(foo, PAGE_SIZE, pkey=4); > >

Re: [PATCH v3 2/2] pseries/eeh: Add Pseries pcibios_bus_add_device

2017-10-17 Thread Alexey Kardashevskiy
On 18/10/17 12:01, Alexey Kardashevskiy wrote: > On 18/10/17 01:11, Bryant G. Ly wrote: >> Adding Juan back into the cc: jjalv...@linux.vnet.ibm.com >> >> >> On 10/16/17 10:38 PM, Michael Ellerman wrote: >>> "Bryant G. Ly" writes: On 10/12/17 1:29 PM, Bjorn

Re: [PATCH v3 2/2] pseries/eeh: Add Pseries pcibios_bus_add_device

2017-10-17 Thread Alexey Kardashevskiy
On 18/10/17 01:11, Bryant G. Ly wrote: > Adding Juan back into the cc: jjalv...@linux.vnet.ibm.com > > > On 10/16/17 10:38 PM, Michael Ellerman wrote: >> "Bryant G. Ly" writes: >>> On 10/12/17 1:29 PM, Bjorn Helgaas wrote: >> ... If that's the case, how to you

[PATCH v5 18/18] ima: Write modsig to the measurement list

2017-10-17 Thread Thiago Jung Bauermann
Add modsig support for templates which require the contents of the file signature to be included in the measurement list. Suggested-by: Mimi Zohar Signed-off-by: Thiago Jung Bauermann --- security/integrity/ima/ima.h | 8

[PATCH v5 17/18] ima: Implement support for module-style appended signatures

2017-10-17 Thread Thiago Jung Bauermann
This patch actually implements the appraise_type=modsig option, allowing IMA to read and verify modsig signatures Signed-off-by: Thiago Jung Bauermann --- security/integrity/ima/ima.h | 17 +++-- security/integrity/ima/ima_appraise.c | 119

[PATCH v5 16/18] ima: Add functions to read and verify a modsig signature

2017-10-17 Thread Thiago Jung Bauermann
This is the code needed by IMA-appraise to work with modsig signatures. It will be used by the next patch. Signed-off-by: Thiago Jung Bauermann --- security/integrity/ima/Kconfig | 3 + security/integrity/ima/ima.h| 34 +++

[PATCH v5 15/18] ima: Add modsig appraise_type option for module-style appended signatures

2017-10-17 Thread Thiago Jung Bauermann
This patch introduces 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=modsig|imasig With this rule, IMA will accept

[PATCH v5 14/18] integrity: Introduce integrity_keyring_from_id

2017-10-17 Thread Thiago Jung Bauermann
IMA will need to obtain the keyring used to verify file signatures so that it can verify the module-style signature appended to files. Signed-off-by: Thiago Jung Bauermann --- security/integrity/digsig.c| 28 +++-

[PATCH v5 13/18] PKCS#7: Introduce pkcs7_get_message_sig and verify_pkcs7_message_sig

2017-10-17 Thread Thiago Jung Bauermann
IMA will need to access the digest used in the signature so that it can verify files containing module-style appended signatures. For this purpose, add function pkcs7_get_message_sig. It will also need to verify an already parsed PKCS#7 message. For this purpose, add function

[PATCH v5 12/18] MODSIGN: Export module signature definitions

2017-10-17 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

[PATCH v5 11/18] ima: Export func_tokens

2017-10-17 Thread Thiago Jung Bauermann
ima_read_modsig will need it so that it can show an error message. Signed-off-by: Thiago Jung Bauermann --- security/integrity/ima/ima.h| 2 ++ security/integrity/ima/ima_policy.c | 12 ++-- 2 files changed, 8 insertions(+), 6 deletions(-) diff

[PATCH v5 10/18] ima: Store measurement after appraisal

2017-10-17 Thread Thiago Jung Bauermann
When module-style signatures appended at the end of files are supported for IMA appraisal, the code will fallback to the xattr signature if the appended one fails to verify. The problem is that we don't know whether we need to fallback to the xattr signature until the appraise step, and by then

[PATCH v5 09/18] ima: Don't pass xattr value to EVM xattr verification.

2017-10-17 Thread Thiago Jung Bauermann
The patch implementing modsig support will retry verifying the xattr signature if the modsig verification fails, and if we have already passed the modsig as the xattr_value we'll have problems if we pass the xattr sig in the second call to evm_verifyxattr. Since this is an optimization and not

[PATCH v5 08/18] integrity: Select CONFIG_KEYS instead of depending on it

2017-10-17 Thread Thiago Jung Bauermann
This avoids a dependency cycle in CONFIG_IMA_APPRAISE_MODSIG (introduced by a later patch in this series): 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

[PATCH v5 07/18] integrity: Introduce struct evm_xattr

2017-10-17 Thread Thiago Jung Bauermann
Even though struct evm_ima_xattr_data includes a fixed-size array to hold a SHA1 digest, most of the code ignores the array and uses the struct to mean "type indicator followed by data of unspecified size" and tracks the real size of what the struct represents in a separate length variable. The

[PATCH v5 06/18] ima: Improvements in ima_appraise_measurement

2017-10-17 Thread Thiago Jung Bauermann
Replace nested ifs in the EVM xattr verification logic with a switch statement, making the code easier to understand. Also, add comments to the if statements in the out section. Signed-off-by: Mimi Zohar Signed-off-by: Thiago Jung Bauermann

[PATCH v5 05/18] ima: Simplify ima_eventsig_init

2017-10-17 Thread Thiago Jung Bauermann
The "goto out" statement doesn't have any purpose since there's no cleanup to be done when returning early, so remove it. This also makes the rc variable unnecessary so remove it as well. Also, the xattr_len and fmt variables are redundant so remove them as well. Signed-off-by: Thiago Jung

[PATCH v5 04/18] evm, ima: Remove more superfluous parentheses

2017-10-17 Thread Thiago Jung Bauermann
This patch removes unnecessary parentheses from all EVM and IMA files not yet cleaned up by the previous patches. It is separate from the previous one so that it can be easily dropped if the churn and conflict potential is deemed not worth it. Confirmed that the patch is correct by comparing the

[PATCH v5 03/18] evm, ima: Remove superfluous parentheses

2017-10-17 Thread Thiago Jung Bauermann
This patch removes unnecessary parentheses from all EVM and IMA files touched by this patch series. The difference from the previous patch is that it cleans up the files as a whole, not just the lines that were already going to be modified by other patches. It is separate from the previous one so

[PATCH v5 02/18] ima: Remove some superfluous parentheses

2017-10-17 Thread Thiago Jung Bauermann
Superfluous parentheses just add clutter to the code, making it harder to read and to understand. In order to avoid churn and minimize conflicts with other patches from the community, this patch only removes superfluous parentheses from lines that are modified by other patches in this series.

[PATCH v5 01/18] ima: Remove redundant conditional operator

2017-10-17 Thread Thiago Jung Bauermann
A non-zero value is converted to 1 when assigned to a bool variable, so the conditional operator in is_ima_appraise_enabled is redundant. The value of a comparison operator is either 1 or 0 so the conditional operator in ima_inode_setxattr is redundant as well. Confirmed that the patch is

[PATCH v5 00/18] Appended signatures support for IMA appraisal

2017-10-17 Thread Thiago Jung Bauermann
Hello, The main highlight in this version is that it fixes a bug where the modsig wasn't being included in the measurement list if the appraised file was already measured by another rule. The fix is in the last patch. Another change is that the last patch in the v4 series ("ima: Support

Re: [PATCH v3 2/2] pseries/eeh: Add Pseries pcibios_bus_add_device

2017-10-17 Thread Juan Alvarez
On 10/17/17 1:52 PM, Bjorn Helgaas wrote: > Right. But that patch isn't really on the path to inclusion (mainly > because it's test framework and doesn't fix a bug or add support for > new hardware or features). I was not aware of this decision and this will cause changes to this patch. > > I'm

Re: [PATCH v2 5/5] of/fdt: only store the device node basename in full_name

2017-10-17 Thread Alan Tull
On Mon, Aug 21, 2017 at 10:16 AM, Rob Herring wrote: Hi Rob, > With dependencies on a statically allocated full path name converted to > use %pOF format specifier, we can store just the basename of node, and > the unflattening of the FDT can be simplified. > > This commit will

Re: [PATCH v3 2/2] pseries/eeh: Add Pseries pcibios_bus_add_device

2017-10-17 Thread Juan Alvarez
On 10/17/17 11:26 AM, Bjorn Helgaas wrote: > To pop back up to the top of the stack, I think the main point of this > patch is to keep from binding a driver to the VFs in the kernel that > set PCI_SRIOV_CTRL_VFE. This patch does that by setting > pdev->match_driver to -1 in powerpc-specific code.

RE: [PATCH 3/4] char/tpm: Improve a size determination in nine functions

2017-10-17 Thread Alexander.Steffen
> On Tue, 2017-10-17 at 11:50 +, alexander.stef...@infineon.com > wrote: > > > > Replace the specification of data structures by pointer dereferences > > > > as the parameter for the operator "sizeof" to make the corresponding > > > > size > > > > determination a bit safer according to the

Re: [PATCH v3 2/2] pseries/eeh: Add Pseries pcibios_bus_add_device

2017-10-17 Thread Juan Alvarez
On 10/17/17 8:51 AM, Bjorn Helgaas wrote: > This is where I get confused. I guess the Linux that sets > PCI_SRIOV_CTRL_VFE to enable the VFs can also perform config accesses > to the VFs, since it can enumerate them and build pci_dev structs for > them, right? Correct, we are not changing

Re: [PATCH v3 2/2] pseries/eeh: Add Pseries pcibios_bus_add_device

2017-10-17 Thread Juan Alvarez
On 10/17/17 8:51 AM, Bjorn Helgaas wrote: > This is where I get confused. I guess the Linux that sets > PCI_SRIOV_CTRL_VFE to enable the VFs can also perform config accesses > to the VFs, since it can enumerate them and build pci_dev structs for > them, right? Correct, we are not changing

[PATCH] powerpc/40x: acadia: Fix the 'interrupt-parent' property

2017-10-17 Thread Fabio Estevam
'interrupts-parent' property does not exist. Fix the typo. Fixes: 00f3ca740a9c26 ("powerpc/40x: AMCC PowerPC 405EZ Acadia DTS") Signed-off-by: Fabio Estevam --- arch/powerpc/boot/dts/acadia.dts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git

RE: [PATCH 3/4] char/tpm: Improve a size determination in nine functions

2017-10-17 Thread Alexander.Steffen
> > Replace the specification of data structures by pointer dereferences > > as the parameter for the operator "sizeof" to make the corresponding > > size > > determination a bit safer according to the Linux coding style > > convention. > > > This patch does one style in favor of the other. I

Re: [PATCH v2 2/2] vgaarb: Factor out EFI and fallback default device selection

2017-10-17 Thread Daniel Axtens
Hi Daniel, >> Initially I wondered if this info printk could be moved into >> vga_arbiter_check_bridge_sharing(), but it's been separated out since >> 3448a19da479b ("vgaarb: use bridges to control VGA routing where >> possible."), and upon closer examination, it seems you can't be sure a >>

Re: [PATCH v2 5/5] of/fdt: only store the device node basename in full_name

2017-10-17 Thread Frank Rowand
On 10/17/17 14:46, Rob Herring wrote: > On Tue, Oct 17, 2017 at 4:32 PM, Alan Tull wrote: >> On Mon, Aug 21, 2017 at 10:16 AM, Rob Herring wrote: >> >> Hi Rob, >> >>> With dependencies on a statically allocated full path name converted to >>> use %pOF format

Re: [PATCH 0/4] char-TPM: Adjustments for ten function implementations

2017-10-17 Thread Joe Perches
On Tue, 2017-10-17 at 08:57 -0700, James Bottomley wrote: > On Tue, 2017-10-17 at 11:25 +0200, SF Markus Elfring wrote: > > > > > > Fixes is only for bug fixes.  These don't fix any bugs. > > > > How do you distinguish these in questionable source code > > from other error categories or software

Re: [PATCH v2 5/5] of/fdt: only store the device node basename in full_name

2017-10-17 Thread Rob Herring
On Tue, Oct 17, 2017 at 4:32 PM, Alan Tull wrote: > On Mon, Aug 21, 2017 at 10:16 AM, Rob Herring wrote: > > Hi Rob, > >> With dependencies on a statically allocated full path name converted to >> use %pOF format specifier, we can store just the basename of

Re: lpar issue for ZONE_DEVICE p2pmem in 4.14-rc

2017-10-17 Thread Balbir Singh
On Wed, Oct 18, 2017 at 7:38 AM, Stephen Bates wrote: > Hi All > > I am hoping someone can help shed some light on an issue I am seeing with my > attempt to add p2pmem [1] to the ppc64el kernel. p2pmem is a (currently) > out-of-tree patchset that allows one to add device

lpar issue for ZONE_DEVICE p2pmem in 4.14-rc

2017-10-17 Thread Stephen Bates
Hi All I am hoping someone can help shed some light on an issue I am seeing with my attempt to add p2pmem [1] to the ppc64el kernel. p2pmem is a (currently) out-of-tree patchset that allows one to add device memory with struct page backing into the Linux kernel. It leverages MEMORY_HOTPLUG and

Re: char/tpm: Improve a size determination in nine functions

2017-10-17 Thread SF Markus Elfring
>> I imagine that a corresponding source code analysis variant could be applied >> in more cases if sufficient acceptance could be achieved. > > So, then instead of still keeping people busy with this noise you better > start doing something like CI integration with that for *new* code? There

Re: char/tpm: Improve a size determination in nine functions

2017-10-17 Thread SF Markus Elfring
>> Do you find my wording “This issue was detected by using the >> Coccinelle software.” insufficient? > > The question is not whether it is insufficient, but whether it is appropriate. I am curious on how our corresponding discussion will evolve further. > Detecting Coccinelle issues is one

Re: char/tpm: Improve a size determination in nine functions

2017-10-17 Thread Andy Shevchenko
On Tue, 2017-10-17 at 20:41 +0200, SF Markus Elfring wrote: > > > p = kmalloc(sizeof(*p), ...); > > > > > > The alternative form where struct name is spelled out hurts > > > readability and > > > introduces an opportunity for a bug when the pointer variable type > > > is changed > > > but the

Re: char/tpm: Improve a size determination in nine functions

2017-10-17 Thread Mimi Zohar
On Tue, 2017-10-17 at 20:41 +0200, SF Markus Elfring wrote: > Do you find my wording “This issue was detected by using the > Coccinelle software.” insufficient? The question is not whether it is insufficient, but whether it is appropriate.  Detecting Coccinelle issues is one step.  The next step

[PATCH 2/2] powerpc-ps3: Improve a size determination in two functions

2017-10-17 Thread SF Markus Elfring
From: Markus Elfring Date: Tue, 17 Oct 2017 20:15:17 +0200 Replace the specification of data structures by pointer dereferences as the parameter for the operator "sizeof" to make the corresponding size determination a bit safer according to the Linux coding style

[PATCH 1/2] powerpc-ps3: Delete an error message for a failed memory allocation in update_flash_db()

2017-10-17 Thread SF Markus Elfring
From: Markus Elfring Date: Tue, 17 Oct 2017 20:00:31 +0200 Omit an extra message for a memory allocation failure in this function. This issue was detected by using the Coccinelle software. Signed-off-by: Markus Elfring ---

[PATCH 0/2] PowerPC-PS3: Adjustments for three function implementations

2017-10-17 Thread SF Markus Elfring
From: Markus Elfring Date: Tue, 17 Oct 2017 20:22:44 +0200 Two update suggestions were taken into account from static source code analysis. Markus Elfring (2): Delete an error message for a failed memory allocation in update_flash_db() Improve a size

Re: [PATCH v3 2/2] pseries/eeh: Add Pseries pcibios_bus_add_device

2017-10-17 Thread Bjorn Helgaas
On Tue, Oct 17, 2017 at 12:23:01PM -0500, Juan Alvarez wrote: > On 10/17/17 11:26 AM, Bjorn Helgaas wrote: > > To pop back up to the top of the stack, I think the main point of this > > patch is to keep from binding a driver to the VFs in the kernel that > > set PCI_SRIOV_CTRL_VFE. This patch

Re: char/tpm: Improve a size determination in nine functions

2017-10-17 Thread SF Markus Elfring
>> p = kmalloc(sizeof(*p), ...); >> >> The alternative form where struct name is spelled out hurts readability and >> introduces an opportunity for a bug when the pointer variable type is changed >> but the corresponding sizeof that is passed to a memory allocator is not. > > True, thanks

[PATCH] powerpc/xmon: check before calling xive functions

2017-10-17 Thread Breno Leitao
Currently xmon could call XIVE functions from OPAL even if the XIVE is disabled or does not exist in the system, as in POWER8 machines. This causes the following exception: 1:mon> dx cpu 0x1: Vector: 700 (Program Check) at [c00423c93450] pc: c009cfa4: opal_xive_dump+0x50/0x68

Re: [PATCH 1/2] powerpc/nodes: Ensure enough nodes avail for operations

2017-10-17 Thread Nathan Fontenot
On 10/17/2017 12:22 PM, Michael Bringmann wrote: > > > On 10/17/2017 12:02 PM, Nathan Fontenot wrote: >> On 10/17/2017 11:14 AM, Michael Bringmann wrote: >>> See below. >>> >>> On 10/16/2017 07:33 AM, Michael Ellerman wrote: Michael Bringmann writes: >

Re: [PATCH 1/2] powerpc/nodes: Ensure enough nodes avail for operations

2017-10-17 Thread Michael Bringmann
On 10/17/2017 12:02 PM, Nathan Fontenot wrote: > On 10/17/2017 11:14 AM, Michael Bringmann wrote: >> See below. >> >> On 10/16/2017 07:33 AM, Michael Ellerman wrote: >>> Michael Bringmann writes: >>> powerpc/nodes: On systems like PowerPC which allow 'hot-add' of

Re: [PATCH kernel v2] powerpc/powernv: Reserve a hole which appears after enabling IOV

2017-10-17 Thread Bjorn Helgaas
On Wed, Sep 27, 2017 at 04:52:31PM +1000, Alexey Kardashevskiy wrote: > In order to make generic IOV code work, the physical function IOV BAR > should start from offset of the first VF. Since M64 segments share > PE number space across PHB, and some PEs may be in use at the time > when IOV is

Re: [PATCH 1/2] powerpc/nodes: Ensure enough nodes avail for operations

2017-10-17 Thread Nathan Fontenot
On 10/17/2017 11:14 AM, Michael Bringmann wrote: > See below. > > On 10/16/2017 07:33 AM, Michael Ellerman wrote: >> Michael Bringmann writes: >> >>> powerpc/nodes: On systems like PowerPC which allow 'hot-add' of CPU >> >> This is a powerpc-only patch, so saying

Re: [PATCH 0/4] char-TPM: Adjustments for ten function implementations

2017-10-17 Thread SF Markus Elfring
>>> Fixes is only for bug fixes.  These don't fix any bugs. >> >> How do you distinguish these in questionable source code >> from other error categories or software weaknesses? > > A style change is one that doesn't change the effect of the execution. This can occasionally be fine, can't it?

Re: [PATCH v3 2/2] pseries/eeh: Add Pseries pcibios_bus_add_device

2017-10-17 Thread Bjorn Helgaas
On Tue, Oct 17, 2017 at 09:33:34AM -0500, Juan Alvarez wrote: > On 10/17/17 8:51 AM, Bjorn Helgaas wrote: > > This is where I get confused. I guess the Linux that sets > > PCI_SRIOV_CTRL_VFE to enable the VFs can also perform config accesses > > to the VFs, since it can enumerate them and build

Re: [PATCH 1/2] powerpc/nodes: Ensure enough nodes avail for operations

2017-10-17 Thread Michael Bringmann
See below. On 10/16/2017 07:33 AM, Michael Ellerman wrote: > Michael Bringmann writes: > >> powerpc/nodes: On systems like PowerPC which allow 'hot-add' of CPU > > This is a powerpc-only patch, so saying "systems like PowerPC" is > confusing. What you should be saying

Re: [PATCH 0/4] char-TPM: Adjustments for ten function implementations

2017-10-17 Thread James Bottomley
On Tue, 2017-10-17 at 11:25 +0200, SF Markus Elfring wrote: > > > > Fixes is only for bug fixes.  These don't fix any bugs. > > How do you distinguish these in questionable source code > from other error categories or software weaknesses? A style change is one that doesn't change the effect of

[PATCH 3/3] powernv/pci: Improve a size determination in pnv_pci_init_ioda_phb()

2017-10-17 Thread SF Markus Elfring
From: Markus Elfring Date: Tue, 17 Oct 2017 17:18:10 +0200 Replace the specification of a data structure by a pointer dereference as the parameter for the operator "sizeof" to make the corresponding size determination a bit safer according to the Linux coding style

[PATCH 2/3] powernv/pci: Use common code in pnv_ioda_pick_m64_pe()

2017-10-17 Thread SF Markus Elfring
From: Markus Elfring Date: Tue, 17 Oct 2017 17:07:54 +0200 Add a jump target so that a bit of code can be better reused at the end of this function. Signed-off-by: Markus Elfring --- arch/powerpc/platforms/powernv/pci-ioda.c | 10

[PATCH 1/3] powernv/pci: Delete an error message for a failed memory allocation in pnv_ioda_pick_m64_pe()

2017-10-17 Thread SF Markus Elfring
From: Markus Elfring Date: Tue, 17 Oct 2017 16:52:43 +0200 Omit an extra message for a memory allocation failure in this function. This issue was detected by using the Coccinelle software. Signed-off-by: Markus Elfring ---

[PATCH 0/3] PowerNV-PCI: Adjustments for two function implementations

2017-10-17 Thread SF Markus Elfring
From: Markus Elfring Date: Tue, 17 Oct 2017 17:27:37 +0200 Three update suggestions were taken into account from static source code analysis. Markus Elfring (3): Delete an error message for a failed memory allocation in pnv_ioda_pick_m64_pe() Use common code

Re: [PATCH 3/4] char/tpm: Improve a size determination in nine functions

2017-10-17 Thread Julia Lawall
On Tue, 17 Oct 2017, Mimi Zohar wrote: > On Tue, 2017-10-17 at 14:58 +0200, Julia Lawall wrote: > > > > On Tue, 17 Oct 2017, Mimi Zohar wrote: > > > > > On Tue, 2017-10-17 at 11:50 +, alexander.stef...@infineon.com > > > wrote: > > > > > > Replace the specification of data structures by

Re: [PATCH] powerpc/watchdog: Convert timers to use timer_setup()

2017-10-17 Thread Kees Cook
On Tue, Oct 17, 2017 at 5:29 AM, Michael Ellerman wrote: > Nicholas Piggin writes: > >> On Mon, 16 Oct 2017 16:47:10 -0700 >> Kees Cook wrote: >> >>> In preparation for unconditionally passing the struct timer_list pointer to >>>

Re: [PATCH 3/4] char/tpm: Improve a size determination in nine functions

2017-10-17 Thread Mimi Zohar
On Tue, 2017-10-17 at 14:58 +0200, Julia Lawall wrote: > > On Tue, 17 Oct 2017, Mimi Zohar wrote: > > > On Tue, 2017-10-17 at 11:50 +, alexander.stef...@infineon.com > > wrote: > > > > > Replace the specification of data structures by pointer dereferences > > > > > as the parameter for the

Re: [PATCH v12 01/11] mm: deferred_init_memmap improvements

2017-10-17 Thread Pavel Tatashin
This really begs to have two patches... I will not insist though. I also suspect the code can be further simplified but again this is nothing to block this to go. Perhaps "page" can be avoided in deferred_init_range(), as pfn is converted to page in deferred_free_range, but I have not studied

Re: [PATCH 2/2] powerpc/hotplug: Ensure nodes initialized for hotplug

2017-10-17 Thread Michael Bringmann
On 10/16/2017 07:54 AM, Michael Ellerman wrote: > Michael Bringmann writes: > >> powerpc/hotplug: On systems like PowerPC which allow 'hot-add' of CPU, >> it may occur that the new resources are to be inserted into nodes >> that were not used for memory resources at

Re: [PATCH v2] kernel/module_64.c: Add REL24 relocation support of livepatch symbols

2017-10-17 Thread Torsten Duwe
On Fri, Oct 06, 2017 at 11:27:42AM +0530, Kamalesh Babulal wrote: > > Consider the livepatch sequence[1]. Where function A calls B, B is the > function which has been livepatched and the call to function B is > redirected to patched version P. P calls the function C in M2, whereas > C was local to

Re: [PATCH v3 2/2] pseries/eeh: Add Pseries pcibios_bus_add_device

2017-10-17 Thread Bryant G. Ly
Adding Juan back into the cc: jjalv...@linux.vnet.ibm.com On 10/16/17 10:38 PM, Michael Ellerman wrote: > "Bryant G. Ly" writes: >> On 10/12/17 1:29 PM, Bjorn Helgaas wrote: > ... >>> If that's the case, how to you ever bind a driver to these VFs? The >>> changelog

Re: [PATCH v3 2/2] pseries/eeh: Add Pseries pcibios_bus_add_device

2017-10-17 Thread Bjorn Helgaas
On Fri, Oct 13, 2017 at 02:12:32PM -0500, Bryant G. Ly wrote: > > > On 10/13/17 1:05 PM, Alex Williamson wrote: > >On Fri, 13 Oct 2017 07:01:48 -0500 > >Steven Royer wrote: > > > >>On 2017-10-13 06:53, Steven Royer wrote: > >>>On 2017-10-12 22:34, Bjorn Helgaas

Re: [bug report] out of bounds read parsing vmode commandline option

2017-10-17 Thread Bartlomiej Zolnierkiewicz
Hi, On Wednesday, October 04, 2017 06:42:37 PM Geert Uytterhoeven wrote: > Hi Dan, > > On Wed, Oct 4, 2017 at 2:50 PM, Dan Carpenter > wrote: > > This bug predates git but it looks like it might be simple to fix if the > > right person looked at the code. > > > >

Re: [PATCH 3/4] char/tpm: Improve a size determination in nine functions

2017-10-17 Thread Andy Shevchenko
On Tue, 2017-10-17 at 08:52 -0400, Mimi Zohar wrote: > On Tue, 2017-10-17 at 11:50 +, alexander.stef...@infineon.com > wrote: > > > > Replace the specification of data structures by pointer > > > > dereferences > > > > as the parameter for the operator "sizeof" to make the > > > >

Re: [PATCH 3/4] char/tpm: Improve a size determination in nine functions

2017-10-17 Thread Julia Lawall
On Tue, 17 Oct 2017, Mimi Zohar wrote: > On Tue, 2017-10-17 at 11:50 +, alexander.stef...@infineon.com > wrote: > > > > Replace the specification of data structures by pointer dereferences > > > > as the parameter for the operator "sizeof" to make the corresponding > > > > size > > > >

Re: [PATCH 3/4] char/tpm: Improve a size determination in nine functions

2017-10-17 Thread Mimi Zohar
On Tue, 2017-10-17 at 11:50 +, alexander.stef...@infineon.com wrote: > > > Replace the specification of data structures by pointer dereferences > > > as the parameter for the operator "sizeof" to make the corresponding > > > size > > > determination a bit safer according to the Linux coding

Re: [PATCH] powerpc/watchdog: Convert timers to use timer_setup()

2017-10-17 Thread Michael Ellerman
Nicholas Piggin writes: > On Mon, 16 Oct 2017 16:47:10 -0700 > Kees Cook wrote: > >> In preparation for unconditionally passing the struct timer_list pointer to >> all timer callbacks, switch to using the new timer_setup() and from_timer() >> to pass

Re: [PATCH 0/4] char-TPM: Adjustments for ten function implementations

2017-10-17 Thread Michael Ellerman
Dan Carpenter writes: > On Tue, Oct 17, 2017 at 10:56:42AM +0200, Julia Lawall wrote: >> >> >> On Tue, 17 Oct 2017, Dan Carpenter wrote: >> >> > On Mon, Oct 16, 2017 at 09:35:12PM +0300, Jarkko Sakkinen wrote: >> > > >> > > A minor complaint: all commits are missing

Re: [PATCH v2 2/2] vgaarb: Factor out EFI and fallback default device selection

2017-10-17 Thread Ard Biesheuvel
On 17 October 2017 at 13:05, Daniel Vetter wrote: > On Tue, Oct 17, 2017 at 01:03:46PM +1100, Daniel Axtens wrote: >> Bjorn Helgaas writes: >> >> > The default VGA device is normally set in vga_arbiter_add_pci_device() when >> > we call it for the first

[PATCH 3/3] powerpc-opal: Fix a typo in a comment line of two file headers

2017-10-17 Thread SF Markus Elfring
From: Markus Elfring Date: Tue, 17 Oct 2017 13:31:42 +0200 Fix a word in these descriptions. Signed-off-by: Markus Elfring --- arch/powerpc/platforms/powernv/opal-hmi.c | 2 +-

[PATCH 2/3] powerpc-opal: Improve 12 size determinations

2017-10-17 Thread SF Markus Elfring
From: Markus Elfring Date: Tue, 17 Oct 2017 13:20:19 +0200 Replace the specification of data types by variable references as the parameter for the operator "sizeof" to make the corresponding size determination a bit safer according to the Linux coding style

[PATCH 1/3] powerpc-opal: Delete ten error messages for a failed memory allocation

2017-10-17 Thread SF Markus Elfring
From: Markus Elfring Date: Tue, 17 Oct 2017 12:21:40 +0200 Omit extra messages for a memory allocation failure in these functions. This issue was detected by using the Coccinelle software. Signed-off-by: Markus Elfring ---

[PATCH 0/3] PowerPC-OPAL: Adjustments for some function implementations

2017-10-17 Thread SF Markus Elfring
From: Markus Elfring Date: Tue, 17 Oct 2017 13:45:54 +0200 Three update suggestions were taken into account from static source code analysis. Markus Elfring (3): Delete ten error messages for a failed memory allocation Improve 12 size determinations Fix a

  1   2   >