Re: [PATCH 00/16] Remove hash page table slot tracking from linux PTE

2017-10-26 Thread Paul Mackerras
On Fri, Oct 27, 2017 at 10:57:13AM +0530, Aneesh Kumar K.V wrote: > > > On 10/27/2017 10:04 AM, Paul Mackerras wrote: > >How do we interpret these numbers? Are they times, or speed? Is > >larger better or worse? > > Sorry for not including the details. They are time in seconds. Test case is >

Re: [PATCH 00/16] Remove hash page table slot tracking from linux PTE

2017-10-26 Thread Aneesh Kumar K.V
On 10/27/2017 10:04 AM, Paul Mackerras wrote: On Fri, Oct 27, 2017 at 09:38:17AM +0530, Aneesh Kumar K.V wrote: Hi, With hash translation mode we always tracked the hash pte slot details in linux page table. This occupied space in the linux page table and also limitted our ability to suppor

Re: [PATCH 00/16] Remove hash page table slot tracking from linux PTE

2017-10-26 Thread Paul Mackerras
On Fri, Oct 27, 2017 at 09:38:17AM +0530, Aneesh Kumar K.V wrote: > Hi, > > With hash translation mode we always tracked the hash pte slot details in > linux page table. > This occupied space in the linux page table and also limitted our ability to > support > linux features that require additio

[PATCH 14/16] powerpc/mm/pseries: Use HASH_REMOVE hcall in guest

2017-10-26 Thread Aneesh Kumar K.V
Signed-off-by: Aneesh Kumar K.V --- arch/powerpc/platforms/pseries/lpar.c | 24 1 file changed, 24 insertions(+) diff --git a/arch/powerpc/platforms/pseries/lpar.c b/arch/powerpc/platforms/pseries/lpar.c index cd5cf5bd53f1..41512aaa8c8e 100644 --- a/arch/powerpc/platfor

[PATCH 16/16] powerpc/mm/pseries: Use HASH_BULK_REMOVE hcall in guest

2017-10-26 Thread Aneesh Kumar K.V
Signed-off-by: Aneesh Kumar K.V --- arch/powerpc/platforms/pseries/lpar.c | 40 --- 1 file changed, 32 insertions(+), 8 deletions(-) diff --git a/arch/powerpc/platforms/pseries/lpar.c b/arch/powerpc/platforms/pseries/lpar.c index 4ea9224cbeb6..6dffdf654a28 100644

[PATCH 15/16] powerpc/mm/pseries: Move slot based bulk remove to helper

2017-10-26 Thread Aneesh Kumar K.V
--- arch/powerpc/platforms/pseries/lpar.c | 51 +-- 1 file changed, 31 insertions(+), 20 deletions(-) diff --git a/arch/powerpc/platforms/pseries/lpar.c b/arch/powerpc/platforms/pseries/lpar.c index 41512aaa8c8e..4ea9224cbeb6 100644 --- a/arch/powerpc/platforms/ps

[PATCH 09/16] powerpc/mm: Add new firmware feature HASH API

2017-10-26 Thread Aneesh Kumar K.V
We will use this feature to check whether hypervisor implements hash based remove and protect hcalls Signed-off-by: Aneesh Kumar K.V --- arch/powerpc/include/asm/firmware.h | 3 ++- arch/powerpc/kvm/powerpc.c| 4 arch/powerpc/platforms/pseries/firmware.c | 1 + include

[PATCH 13/16] powerpc/mm/pseries: Use HASH_PROTECT hcall in guest

2017-10-26 Thread Aneesh Kumar K.V
Signed-off-by: Aneesh Kumar K.V --- arch/powerpc/platforms/pseries/lpar.c | 7 ++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/arch/powerpc/platforms/pseries/lpar.c b/arch/powerpc/platforms/pseries/lpar.c index 52d2e3038c05..cd5cf5bd53f1 100644 --- a/arch/powerpc/platforms/p

[PATCH 12/16] powerpc/kvm/hash: Implement HASH_BULK_REMOVE hcall

2017-10-26 Thread Aneesh Kumar K.V
This is equivalent to H_BULK_REMOVE hcall, but then takes hash value as the arg instead of hashpte slot number. We will use this later to speed up bulk remove operation in guest. Instead of finding slot number using H_READ4 hcall, we can use hash value directly using this hcall. only support H_AVP

[PATCH 11/16] powerpc/kvm/hash: Implement HASH_PROTECT hcall

2017-10-26 Thread Aneesh Kumar K.V
This is equivalent to H_PROTECT hcall, but then takes hash value as the arg instead of hashpte slot number. We will use this later to speed up invalidate operation in guest. Instead of finding slot number using H_READ4 hcall, we can use hash value directly using this hcall. H_AVPN flag value is ne

[PATCH 10/16] powerpc/kvm/hash: Implement HASH_REMOVE hcall

2017-10-26 Thread Aneesh Kumar K.V
This is equivalent to H_REMOVE hcall, but then takes hash value as the arg instead of hashpte slot number. We will use this later to speed up invalidate operation in guest. Instead of finding slot number using H_READ4 hcall, we can use hash value directly using this hcall. Only support flag value

[PATCH 08/16] powerpc/mm/hash: Don't track hash pte slot number in linux page table.

2017-10-26 Thread Aneesh Kumar K.V
Now that we have updated all MMU hash operations to work with hash value instead of slot, remove slot tracking completely. We also remove real_pte because without slot tracking 4k, 64k and 64k subpages all have similar pte format. One of the side effect of this is, we now don't track whether we ha

[PATCH 07/16] powerpc/mm: Add hash updatepp callback

2017-10-26 Thread Aneesh Kumar K.V
Add hash based updatepp callback and use that during hash pte fault. Signed-off-by: Aneesh Kumar K.V --- arch/powerpc/include/asm/book3s/64/mmu-hash.h | 6 + arch/powerpc/mm/hash64_4k.c | 7 + arch/powerpc/mm/hash64_64k.c | 19 +++--- arch/pow

[PATCH 06/16] powerpc/mm: Switch flush_hash_range to not use slot

2017-10-26 Thread Aneesh Kumar K.V
Signed-off-by: Aneesh Kumar K.V --- arch/powerpc/mm/hash_native_64.c | 28 arch/powerpc/platforms/pseries/lpar.c | 17 - 2 files changed, 16 insertions(+), 29 deletions(-) diff --git a/arch/powerpc/mm/hash_native_64.c b/arch/powerpc/mm/hash_nativ

[PATCH 05/16] powerpc/mm: use hash_invalidate for __kernel_map_pages()

2017-10-26 Thread Aneesh Kumar K.V
Signed-off-by: Aneesh Kumar K.V --- arch/powerpc/mm/hash_utils_64.c | 32 +--- 1 file changed, 5 insertions(+), 27 deletions(-) diff --git a/arch/powerpc/mm/hash_utils_64.c b/arch/powerpc/mm/hash_utils_64.c index b197fe57547e..8635b241e2d5 100644 --- a/arch/powerpc/mm

[PATCH 04/16] powerpc/mm: Add hash invalidate callback

2017-10-26 Thread Aneesh Kumar K.V
Add hash based invalidate callback and use that in flush_hash_page. Note: In a later patch, we will drop the slot tracking completely. At that point we will also loose the __rpte_sub_valid() check in pte_iterate_hashed_subpages(). That means we call the invalidate for all subpages irrespective of w

[PATCH 02/16] powerpc/mm: Update native_hpte_find to return hash pte

2017-10-26 Thread Aneesh Kumar K.V
The helper now also does a secondary hash search so that we can use this in other functions. Signed-off-by: Aneesh Kumar K.V --- arch/powerpc/mm/hash_native_64.c | 73 1 file changed, 44 insertions(+), 29 deletions(-) diff --git a/arch/powerpc/mm/hash_n

[PATCH 03/16] powerpc/pseries: Update hpte find helper to take hash value

2017-10-26 Thread Aneesh Kumar K.V
The helper now also does secondary hash search so that we can use this in other functions. Signed-off-by: Aneesh Kumar K.V --- arch/powerpc/platforms/pseries/lpar.c | 28 +--- 1 file changed, 17 insertions(+), 11 deletions(-) diff --git a/arch/powerpc/platforms/pseries/l

[PATCH 01/16] powerpc/mm/hash: Remove the superfluous bitwise operation when find hpte group

2017-10-26 Thread Aneesh Kumar K.V
When computing the starting slot number for a hash page table group we used to do this hpte_group = ((hash & htab_hash_mask) * HPTES_PER_GROUP) & ~0x7UL; Multiplying with 8 (HPTES_PER_GROUP) imply the last three bits are 0. Hence we really don't need to clear then separately. Signed-off-by: Anees

[PATCH 00/16] Remove hash page table slot tracking from linux PTE

2017-10-26 Thread Aneesh Kumar K.V
Hi, With hash translation mode we always tracked the hash pte slot details in linux page table. This occupied space in the linux page table and also limitted our ability to support linux features that require additional PTE bits. This series attempt to lift this limitation by not tracking slot

[PATCH kernel] vfio/spapr: Add trace points for map/unmap

2017-10-26 Thread Alexey Kardashevskiy
This adds trace_map/trace_unmap tracepoints to spapr driver. Type1 already uses these via the IOMMU API (iommu_map/__iommu_unmap). Signed-off-by: Alexey Kardashevskiy --- Example: qemu-system-ppc-8655 [096] 724.662740: unmap:IOMMU: iova=0x3000 size=4096 unmapped_

[PATCH 4/4] m68k/mac: Add mutual exclusion for IOP interrupt polling

2017-10-26 Thread Finn Thain
The IOP interrupt handler iop_ism_irq() is used by the adb-iop driver to poll for ADB request completion. Unfortunately, it is not re-entrant. Fix the race condition by adding an iop_ism_irq_poll() function with suitable mutual exclusion. Tested-by: Stan Johnson Signed-off-by: Finn Thain Cc: Ben

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

2017-10-26 Thread Mimi Zohar
On Thu, 2017-10-26 at 20:47 -0200, Thiago Jung Bauermann wrote: > Mimi Zohar writes: > > > On Tue, 2017-10-17 at 22:53 -0200, Thiago Jung Bauermann wrote: > >> IMA will use the module_signature format for append signatures, so export > >> the relevant definitions and factor out the code which ver

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

2017-10-26 Thread Thiago Jung Bauermann
Mimi Zohar writes: > On Tue, 2017-10-17 at 22:53 -0200, Thiago Jung Bauermann wrote: >> 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, creat

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

2017-10-26 Thread Thiago Jung Bauermann
Hello Mimi, Thanks for your review. Mimi Zohar writes: > On Tue, 2017-10-17 at 22:53 -0200, Thiago Jung Bauermann wrote: > >> diff --git a/security/integrity/ima/ima_main.c >> b/security/integrity/ima/ima_main.c >> index 6a2d960fbd92..0d3390de7432 100644 >> --- a/security/integrity/ima/ima_ma

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

2017-10-26 Thread Mimi Zohar
On Tue, 2017-10-17 at 22:53 -0200, Thiago Jung Bauermann wrote: > 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. > > A

[PATCH V5 2/2] pseries/initnodes: Ensure nodes initialized for hotplug

2017-10-26 Thread Michael Bringmann
pseries/nodes: On pseries systems 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 bootup. Many different configurations of PowerPC resources may need to be supported depending upon the environment. This pat

[PATCH V5 1/2] pseries/nodes: Ensure enough nodes avail for operations

2017-10-26 Thread Michael Bringmann
pseries/nodes: On pseries systems which allow 'hot-add' of CPU or memory resources, it may occur that the new resources are to be inserted into nodes that were not used for these resources at bootup. In the kernel, any node that is used must be defined and initialized. This patch ensures that suffi

[PATCH V5 0/2] pseries/nodes: Fix issues with memoryless nodes

2017-10-26 Thread Michael Bringmann
pseries/nodes: Ensure enough nodes avail for operations pseries/initnodes: Ensure nodes initialized for hotplug Signed-off-by: Michael Bringmann Michael Bringmann (2): pseries/nodes: Ensure enough nodes avail for operations pseries/initnodes: Ensure nodes initialized for hotplug --- Changes

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

2017-10-26 Thread Mimi Zohar
On Tue, 2017-10-17 at 22:53 -0200, Thiago Jung Bauermann wrote: > 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 p

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

2017-10-26 Thread Mimi Zohar
On Tue, 2017-10-17 at 22:53 -0200, Thiago Jung Bauermann wrote: > 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

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

2017-10-26 Thread Mimi Zohar
On Tue, 2017-10-17 at 22:53 -0200, Thiago Jung Bauermann wrote: > diff --git a/security/integrity/ima/ima_main.c > b/security/integrity/ima/ima_main.c > index 6a2d960fbd92..0d3390de7432 100644 > --- a/security/integrity/ima/ima_main.c > +++ b/security/integrity/ima/ima_main.c > @@ -246,7 +246,35

Re: [PATCH] powerpc/tm: fix live state of vs0/32 in tm_reclaim

2017-10-26 Thread Breno Leitao
Hi Cyril, Mikey, On Thu, Oct 26, 2017 at 03:57:33PM +1100, Cyril Bur wrote: > On Wed, 2017-07-05 at 11:02 +1000, Michael Neuling wrote: > > On Tue, 2017-07-04 at 16:45 -0400, Gustavo Romero wrote: > > > Currently tm_reclaim() can return with a corrupted vs0 (fp0) or vs32 (v0) > > > due to the fact

[RFC PATCH] powerpc/powernv: OPAL do not process events from hard interrupt context

2017-10-26 Thread Nicholas Piggin
Using irq_work for processing OPAL events can cause latency spikes and is not really required. OPAL events are not performance critical, and we already have kopald to poll and run events, so have kopald run them all. Rather than scheduling them as irq_work, just run them directly from kopald. Enabl

Re: [PATCH v5 07/22] mm: Protect VMA modifications using VMA sequence count

2017-10-26 Thread Andrea Arcangeli
Hello Laurent, Message-ID: <7ca80231-fe02-a3a7-84bc-ce81690ea...@intel.com> shows significant slowdown even for brk/malloc ops both single and multi threaded. The single threaded case I think is the most important because it has zero chance of getting back any benefit later during page faults. C

Re: [v5,22/22] powerpc/mm: Add speculative page fault

2017-10-26 Thread kemi
Some regression is found by LKP-tools(linux kernel performance) on this patch series tested on Intel 2s/4s Skylake platform. The regression result is sorted by the metric will-it-scale.per_process_ops. Branch:Laurent-Dufour/Speculative-page-faults/20171011-213456(V4 patch series) Commit id: