[PATCH v3 01/17] crypto: talitos - Use zero entry to init descriptors ptrs to zero

2015-04-17 Thread Christophe Leroy
Do use zero_entry value to init the descriptors ptrs to zero instead of writing 0 in each field Signed-off-by: Christophe Leroy --- drivers/crypto/talitos.c | 8 ++-- 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/drivers/crypto/talitos.c b/drivers/crypto/talitos.c index

[PATCH v3 00/17] crypto: talitos - Add support for SEC1

2015-04-17 Thread Christophe Leroy
time, talitos driver shall support both SEC1 and SEC2+ at the same time. Based on cryptodev-2.6 tree Christophe Leroy (17): crypto: talitos - Use zero entry to init descriptors ptrs to zero crypto: talitos - Refactor the sg in/out chain allocation crypto: talitos - talitos_ptr renamed ptr

[PATCH v3 03/17] crypto: talitos - talitos_ptr renamed ptr for more lisibility

2015-04-17 Thread Christophe Leroy
Linux CodyingStyle recommends to use short variables for local variables. ptr is just good enough for those 3 lines functions. It helps keep single lines shorter than 80 characters. Signed-off-by: Christophe Leroy --- drivers/crypto/talitos.c | 20 ++-- 1 file changed, 10

[PATCH v3 02/17] crypto: talitos - Refactor the sg in/out chain allocation

2015-04-17 Thread Christophe Leroy
This patch refactors the handling of the input and output data that is quite similar in several functions Signed-off-by: Christophe Leroy --- drivers/crypto/talitos.c | 159 --- 1 file changed, 81 insertions(+), 78 deletions(-) diff --git a/drivers

[PATCH v3 06/17] crypto: talitos - helper function for ptr len

2015-04-17 Thread Christophe Leroy
This patch adds a helper function for reads and writes of the len param of the talitos descriptor. This will help implement SEC1 later. Signed-off-by: Christophe Leroy --- drivers/crypto/talitos.c | 24 +--- 1 file changed, 17 insertions(+), 7 deletions(-) diff --git a

[PATCH v3 05/17] crypto: talitos - remove param 'extent' in map_single_talitos_ptr()

2015-04-17 Thread Christophe Leroy
map_single_talitos_ptr() is always called with extent == 0, so lets remove this unused parameter Signed-off-by: Christophe Leroy --- drivers/crypto/talitos.c | 21 ++--- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/drivers/crypto/talitos.c b/drivers/crypto

[PATCH v3 04/17] crypto: talitos - Add a helper function to clear j_extent field

2015-04-17 Thread Christophe Leroy
j_extent field is specific to SEC2 so we add a helper function to clear it so that SEC1 can redefine that function as nop Signed-off-by: Christophe Leroy --- drivers/crypto/talitos.c | 11 --- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/drivers/crypto/talitos.c b

[PATCH v3 07/17] crypto: talitos - enhanced talitos_desc struct for SEC1

2015-04-17 Thread Christophe Leroy
This patch enhances the talitos_desc struct with fields for SEC1. SEC1 has only one header field, and has a 'next_desc' field in addition. This mixed descriptor will continue to fit SEC2, and for SEC1 we will recopy hdr value into hdr1 value in talitos_submit() Signed-off-by: Christ

[PATCH v3 08/17] crypto: talitos - add sub-choice in talitos CONFIG for SEC1

2015-04-17 Thread Christophe Leroy
This patch adds a CONFIG option to select SEC1, SEC2+ or both. Signed-off-by: Christophe Leroy --- drivers/crypto/Kconfig | 18 ++ 1 file changed, 18 insertions(+) diff --git a/drivers/crypto/Kconfig b/drivers/crypto/Kconfig index 800bf41..8a76a01 100644 --- a/drivers/crypto

[PATCH v3 09/17] crypto: talitos - Add a feature to tag SEC1

2015-04-17 Thread Christophe Leroy
value. If both are compiled in, feature field is checked. Signed-off-by: Christophe Leroy --- drivers/crypto/talitos.c | 3 +++ drivers/crypto/talitos.h | 17 + 2 files changed, 20 insertions(+) diff --git a/drivers/crypto/talitos.c b/drivers/crypto/talitos.c index bca6ded..db95

[PATCH v3 10/17] crypto: talitos - fill in talitos descriptor iaw SEC1 or SEC2+

2015-04-17 Thread Christophe Leroy
talitos descriptor is slightly different for SEC1 and SEC2+, so lets the helper function that fills the descriptor take into account the type of SEC. Signed-off-by: Christophe Leroy --- drivers/crypto/talitos.c | 105 ++- 1 file changed, 67 insertions

[PATCH v3 11/17] crypto: talitos - adaptation of talitos_submit() for SEC1

2015-04-17 Thread Christophe Leroy
SEC1 descriptor is a bit different to SEC2+ descriptor. talitos_submit() will have to copy hdr field into hdr1 field and send the descriptor starting at hdr1 up to next_desc. For SEC2, it remains unchanged and next_desc is just ignored. Signed-off-by: Christophe Leroy --- drivers/crypto

[PATCH v3 12/17] crypto: talitos - base address for Execution Units

2015-04-17 Thread Christophe Leroy
SEC 1.0, 1.2 and 2.x+ have different EU base addresses, so we need to define pointers for each EU in the driver private data structure. The proper address is set by the probe function depending on the SEC type, in order to provide access to the proper address. Signed-off-by: Christophe Leroy

[PATCH v3 13/17] crypto: talitos - adapt interrupts and reset functions to SEC1

2015-04-17 Thread Christophe Leroy
SEC1. Signed-off-by: Christophe Leroy --- drivers/crypto/talitos.c | 227 +++ drivers/crypto/talitos.h | 39 +--- 2 files changed, 199 insertions(+), 67 deletions(-) diff --git a/drivers/crypto/talitos.c b/drivers/crypto/talitos.c index 6d77699

[PATCH v3 14/17] crypto: talitos - implement scatter/gather copy for SEC1

2015-04-17 Thread Christophe Leroy
iptors We also adapt the max buffer size which is only 32k on SEC1 while it is 64k on SEC2+ Signed-off-by: Christophe Leroy --- drivers/crypto/talitos.c | 138 ++- drivers/crypto/talitos.h | 3 +- 2 files changed, 103 insertions(+), 38 deletions(-)

[PATCH v3 15/17] crypto: talitos - SEC1 bugs on 0 data hash

2015-04-17 Thread Christophe Leroy
SEC1 bugs on 0 data hash, so we submit an already padded block representing 0 data Signed-off-by: Christophe Leroy --- drivers/crypto/talitos.c | 24 1 file changed, 24 insertions(+) diff --git a/drivers/crypto/talitos.c b/drivers/crypto/talitos.c index dddf4b3

[PATCH v3 16/17] crypto: talitos - Add fsl,sec1.0 compatible

2015-04-17 Thread Christophe Leroy
We add a specific compatible for SEC1, to handle the differences between SEC1 and SEC2+ Signed-off-by: Christophe Leroy --- drivers/crypto/talitos.c | 7 +++ 1 file changed, 7 insertions(+) diff --git a/drivers/crypto/talitos.c b/drivers/crypto/talitos.c index f1406d7b..c04074d 100644

[PATCH v3 17/17] crypto: talitos - Update DT bindings with SEC1

2015-04-17 Thread Christophe Leroy
This patch updates the documentation by including SEC1 into SEC2/3 doc Signed-off-by: Christophe Leroy --- Documentation/devicetree/bindings/crypto/fsl-sec2.txt | 6 -- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Documentation/devicetree/bindings/crypto/fsl-sec2.txt b

[PATCH v3 00/17] crypto: talitos - Add support for SEC1

2015-04-17 Thread Christophe Leroy
time, talitos driver shall support both SEC1 and SEC2+ at the same time. Based on cryptodev-2.6 tree Christophe Leroy (17): crypto: talitos - Use zero entry to init descriptors ptrs to zero crypto: talitos - Refactor the sg in/out chain allocation crypto: talitos - talitos_ptr renamed ptr

[PATCH v3 01/17] crypto: talitos - Use zero entry to init descriptors ptrs to zero

2015-04-17 Thread Christophe Leroy
Do use zero_entry value to init the descriptors ptrs to zero instead of writing 0 in each field Signed-off-by: Christophe Leroy --- drivers/crypto/talitos.c | 8 ++-- 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/drivers/crypto/talitos.c b/drivers/crypto/talitos.c index

[PATCH v3 02/17] crypto: talitos - Refactor the sg in/out chain allocation

2015-04-17 Thread Christophe Leroy
This patch refactors the handling of the input and output data that is quite similar in several functions Signed-off-by: Christophe Leroy --- drivers/crypto/talitos.c | 159 --- 1 file changed, 81 insertions(+), 78 deletions(-) diff --git a/drivers

[PATCH v3 03/17] crypto: talitos - talitos_ptr renamed ptr for more lisibility

2015-04-17 Thread Christophe Leroy
Linux CodyingStyle recommends to use short variables for local variables. ptr is just good enough for those 3 lines functions. It helps keep single lines shorter than 80 characters. Signed-off-by: Christophe Leroy --- drivers/crypto/talitos.c | 20 ++-- 1 file changed, 10

[PATCH v3 04/17] crypto: talitos - Add a helper function to clear j_extent field

2015-04-17 Thread Christophe Leroy
j_extent field is specific to SEC2 so we add a helper function to clear it so that SEC1 can redefine that function as nop Signed-off-by: Christophe Leroy --- drivers/crypto/talitos.c | 11 --- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/drivers/crypto/talitos.c b

[PATCH v3 05/17] crypto: talitos - remove param 'extent' in map_single_talitos_ptr()

2015-04-17 Thread Christophe Leroy
map_single_talitos_ptr() is always called with extent == 0, so lets remove this unused parameter Signed-off-by: Christophe Leroy --- drivers/crypto/talitos.c | 21 ++--- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/drivers/crypto/talitos.c b/drivers/crypto

[PATCH v3 06/17] crypto: talitos - helper function for ptr len

2015-04-17 Thread Christophe Leroy
This patch adds a helper function for reads and writes of the len param of the talitos descriptor. This will help implement SEC1 later. Signed-off-by: Christophe Leroy --- drivers/crypto/talitos.c | 24 +--- 1 file changed, 17 insertions(+), 7 deletions(-) diff --git a

[PATCH v3 07/17] crypto: talitos - enhanced talitos_desc struct for SEC1

2015-04-17 Thread Christophe Leroy
This patch enhances the talitos_desc struct with fields for SEC1. SEC1 has only one header field, and has a 'next_desc' field in addition. This mixed descriptor will continue to fit SEC2, and for SEC1 we will recopy hdr value into hdr1 value in talitos_submit() Signed-off-by: Christ

[PATCH v3 08/17] crypto: talitos - add sub-choice in talitos CONFIG for SEC1

2015-04-17 Thread Christophe Leroy
This patch adds a CONFIG option to select SEC1, SEC2+ or both. Signed-off-by: Christophe Leroy --- drivers/crypto/Kconfig | 18 ++ 1 file changed, 18 insertions(+) diff --git a/drivers/crypto/Kconfig b/drivers/crypto/Kconfig index 800bf41..8a76a01 100644 --- a/drivers/crypto

[PATCH v3 09/17] crypto: talitos - Add a feature to tag SEC1

2015-04-17 Thread Christophe Leroy
value. If both are compiled in, feature field is checked. Signed-off-by: Christophe Leroy --- drivers/crypto/talitos.c | 3 +++ drivers/crypto/talitos.h | 17 + 2 files changed, 20 insertions(+) diff --git a/drivers/crypto/talitos.c b/drivers/crypto/talitos.c index bca6ded..db95

[PATCH v3 10/17] crypto: talitos - fill in talitos descriptor iaw SEC1 or SEC2+

2015-04-17 Thread Christophe Leroy
talitos descriptor is slightly different for SEC1 and SEC2+, so lets the helper function that fills the descriptor take into account the type of SEC. Signed-off-by: Christophe Leroy --- drivers/crypto/talitos.c | 105 ++- 1 file changed, 67 insertions

[PATCH v3 11/17] crypto: talitos - adaptation of talitos_submit() for SEC1

2015-04-17 Thread Christophe Leroy
SEC1 descriptor is a bit different to SEC2+ descriptor. talitos_submit() will have to copy hdr field into hdr1 field and send the descriptor starting at hdr1 up to next_desc. For SEC2, it remains unchanged and next_desc is just ignored. Signed-off-by: Christophe Leroy --- drivers/crypto

[PATCH v3 12/17] crypto: talitos - base address for Execution Units

2015-04-17 Thread Christophe Leroy
SEC 1.0, 1.2 and 2.x+ have different EU base addresses, so we need to define pointers for each EU in the driver private data structure. The proper address is set by the probe function depending on the SEC type, in order to provide access to the proper address. Signed-off-by: Christophe Leroy

[PATCH v3 13/17] crypto: talitos - adapt interrupts and reset functions to SEC1

2015-04-17 Thread Christophe Leroy
SEC1. Signed-off-by: Christophe Leroy --- drivers/crypto/talitos.c | 227 +++ drivers/crypto/talitos.h | 39 +--- 2 files changed, 199 insertions(+), 67 deletions(-) diff --git a/drivers/crypto/talitos.c b/drivers/crypto/talitos.c index 6d77699

[PATCH v3 14/17] crypto: talitos - implement scatter/gather copy for SEC1

2015-04-17 Thread Christophe Leroy
iptors We also adapt the max buffer size which is only 32k on SEC1 while it is 64k on SEC2+ Signed-off-by: Christophe Leroy --- drivers/crypto/talitos.c | 138 ++- drivers/crypto/talitos.h | 3 +- 2 files changed, 103 insertions(+), 38 deletions(-)

[PATCH v3 15/17] crypto: talitos - SEC1 bugs on 0 data hash

2015-04-17 Thread Christophe Leroy
SEC1 bugs on 0 data hash, so we submit an already padded block representing 0 data Signed-off-by: Christophe Leroy --- drivers/crypto/talitos.c | 24 1 file changed, 24 insertions(+) diff --git a/drivers/crypto/talitos.c b/drivers/crypto/talitos.c index dddf4b3

[PATCH v3 16/17] crypto: talitos - Add fsl,sec1.0 compatible

2015-04-17 Thread Christophe Leroy
We add a specific compatible for SEC1, to handle the differences between SEC1 and SEC2+ Signed-off-by: Christophe Leroy --- drivers/crypto/talitos.c | 7 +++ 1 file changed, 7 insertions(+) diff --git a/drivers/crypto/talitos.c b/drivers/crypto/talitos.c index f1406d7b..c04074d 100644

[PATCH v3 17/17] crypto: talitos - Update DT bindings with SEC1

2015-04-17 Thread Christophe Leroy
This patch updates the documentation by including SEC1 into SEC2/3 doc Signed-off-by: Christophe Leroy --- Documentation/devicetree/bindings/crypto/fsl-sec2.txt | 6 -- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Documentation/devicetree/bindings/crypto/fsl-sec2.txt b

[PATCH] powerpc/8xx: mmu_virtual_psize incorrect for 16k pages

2015-04-17 Thread Christophe Leroy
mmu_virtual_psize shall be set to MMU_PAGE_16K when 16k pages have been selected Signed-off-by: Christophe Leroy --- arch/powerpc/include/asm/mmu-8xx.h | 7 +++ 1 file changed, 7 insertions(+) diff --git a/arch/powerpc/include/asm/mmu-8xx.h b/arch/powerpc/include/asm/mmu-8xx.h index

[PATCH 00/11] powerpc8xx: Further optimisation of TLB handling

2015-04-19 Thread Christophe Leroy
11 - powerpc/8xx: Add support for TASK_SIZE greater than 0x8000 All changes have been successfully tested on MPC885 Signed-off-by: Christophe Leroy Tested-by: Christophe Leroy --- arch/powerpc/include/asm/page.h | 8 +++ arch/powerpc/include/asm/pgtable-ppc32.h | 37

[PATCH 01/11] powerpc/8xx: remove remaining unnecessary code in FixupDAR

2015-04-19 Thread Christophe Leroy
Since commit 33fb845a6f01 ("powerpc/8xx: Don't use MD_TWC for walk"), MD_EPN and MD_TWC are not writen anymore in FixupDAR so saving r3 has become useless. Signed-off-by: Christophe Leroy --- arch/powerpc/kernel/head_8xx.S | 6 -- 1 file changed, 6 deletions(-) diff --git

[PATCH 02/11] powerpc/8xx: remove tests on PGDIR entry validity

2015-04-19 Thread Christophe Leroy
tries, remove all those tests and let the 8xx handle it. This reduce the number of cycle when the entries are valid which is the case most of the time, and doesn't significantly increase the time for handling invalid entries. Signed-off-by: Christophe Leroy --- arch/powerpc/kernel/head_

[PATCH 03/11] powerpc32: Use kmem_cache memory for PGDIR

2015-04-19 Thread Christophe Leroy
When pages are not 4K, PGDIR table is allocated with kmalloc(). In order to optimise TLB handlers, aligned memory is needed. kmalloc() doesn't provide aligned memory blocks, so lets use a kmem_cache pool instead. Signed-off-by: Christophe Leroy --- arch/powerpc/include/asm/pgtable-ppc32.h

[PATCH 04/11] powerpc/8xx: Take benefit of aligned PGDIR

2015-04-19 Thread Christophe Leroy
L1 base address is now aligned so we can insert L1 index into r11 directly and then preserve r10 Signed-off-by: Christophe Leroy --- arch/powerpc/kernel/head_8xx.S | 34 +++--- 1 file changed, 15 insertions(+), 19 deletions(-) diff --git a/arch/powerpc/kernel

[PATCH 05/11] powerpc/8xx: Optimise access to swapper_pg_dir

2015-04-19 Thread Christophe Leroy
All accessed to PGD entries are done via 0(r11). By using lower part of swapper_pg_dir as load index to r11, we can remove the ori instruction. Signed-off-by: Christophe Leroy --- arch/powerpc/kernel/head_8xx.S | 22 ++ 1 file changed, 10 insertions(+), 12 deletions

[PATCH 06/11] powerpc/8xx: Remove duplicated code in set_context()

2015-04-19 Thread Christophe Leroy
Signed-off-by: Christophe Leroy --- arch/powerpc/kernel/head_8xx.S | 10 -- 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/arch/powerpc/kernel/head_8xx.S b/arch/powerpc/kernel/head_8xx.S index aa45225..b227902e 100644 --- a/arch/powerpc/kernel/head_8xx.S +++ b/arch

[PATCH 07/11] powerpc/8xx: macro for handling CPU15 errata

2015-04-19 Thread Christophe Leroy
Having a macro will help keep clear code. Signed-off-by: Christophe Leroy --- arch/powerpc/kernel/head_8xx.S | 18 -- 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/arch/powerpc/kernel/head_8xx.S b/arch/powerpc/kernel/head_8xx.S index b227902e..b3f3cb5 100644

[PATCH 08/11] powerpc/8xx: Handle CR out of exception PROLOG/EPILOG

2015-04-19 Thread Christophe Leroy
In order to be able to reduce scope during which CR is saved, we take CR saving/restoring out of exception PROLOG and EPILOG Signed-off-by: Christophe Leroy --- arch/powerpc/kernel/head_8xx.S | 10 +++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/arch/powerpc/kernel

[PATCH 09/11] powerpc/8xx: dont save CR in SCRATCH registers

2015-04-19 Thread Christophe Leroy
e for saving CR - Otherwise, we use r10, then we reload SRR0/MD_EPN into r10 when CR is restored Signed-off-by: Christophe Leroy --- arch/powerpc/kernel/head_8xx.S | 53 +- 1 file changed, 37 insertions(+), 16 deletions(-) diff --git a/arch/powerpc/k

[PATCH 10/11] powerpc/8xx: Use SPRG2 instead of DAR for saving r3

2015-04-19 Thread Christophe Leroy
We now have SPRG2 available as in it not used anymore for saving CR, so we don't need to crash DAR anymore for saving r3 for CPU6 ERRATA handling. Signed-off-by: Christophe Leroy --- arch/powerpc/kernel/head_8xx.S | 9 - 1 file changed, 4 insertions(+), 5 deletions(-) diff --

[PATCH 11/11] powerpc/8xx: Add support for TASK_SIZE greater than 0x80000000

2015-04-19 Thread Christophe Leroy
By default, TASK_SIZE is set to 0x8000 for PPC_8xx, which is most likely sufficient for most cases. However, kernel configuration allows to set TASK_SIZE to another value, so the 8xx shall handle it. Signed-off-by: Christophe Leroy --- arch/powerpc/kernel/head_8xx.S | 29

[PATCH RESEND v5 0/5] powerpc8xx: Further optimisation of TLB handling

2015-04-19 Thread Christophe Leroy
This patchset provides a further optimisation of TLB handling in the 8xx. Changes are: - Not saving registers like CR when not needed - Adding support to any TASK_SIZE Only the last patch of the set is changed compared to v4 Resending with proper From: this time. Christophe Leroy (5): powerpc

[PATCH RESEND v5 1/5] powerpc/8xx: macro for handling CPU15 errata

2015-04-19 Thread Christophe Leroy
Having a macro will help keep clear code. Signed-off-by: Christophe Leroy --- arch/powerpc/kernel/head_8xx.S | 18 -- 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/arch/powerpc/kernel/head_8xx.S b/arch/powerpc/kernel/head_8xx.S index 9b53fe1..1279018 100644

[PATCH RESEND v5 2/5] powerpc/8xx: Handle CR out of exception PROLOG/EPILOG

2015-04-19 Thread Christophe Leroy
In order to be able to reduce scope during which CR is saved, we take CR saving/restoring out of exception PROLOG and EPILOG Signed-off-by: Christophe Leroy --- arch/powerpc/kernel/head_8xx.S | 10 +++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/arch/powerpc/kernel

[PATCH RESEND v5 3/5] powerpc/8xx: dont save CR in SCRATCH registers

2015-04-19 Thread Christophe Leroy
en CR is restored Signed-off-by: Christophe Leroy --- arch/powerpc/kernel/head_8xx.S | 29 +++-- 1 file changed, 15 insertions(+), 14 deletions(-) diff --git a/arch/powerpc/kernel/head_8xx.S b/arch/powerpc/kernel/head_8xx.S index 5a69c5e..150d03f 100644 --- a/arch/powerpc/k

[PATCH RESEND v5 4/5] powerpc/8xx: Use SPRG2 instead of DAR for saving r3

2015-04-19 Thread Christophe Leroy
We now have SPRG2 available as in it not used anymore for saving CR, so we don't need to crash DAR anymore for saving r3 for CPU6 ERRATA handling. Signed-off-by: Christophe Leroy --- arch/powerpc/kernel/head_8xx.S | 9 - 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a

[PATCH RESEND v5 5/5] powerpc/8xx: Add support for TASK_SIZE greater than 0x80000000

2015-04-19 Thread Christophe Leroy
most of the time it is equal to 0xC000 Signed-off-by: Christophe Leroy --- arch/powerpc/kernel/head_8xx.S | 25 +++-- 1 file changed, 19 insertions(+), 6 deletions(-) diff --git a/arch/powerpc/kernel/head_8xx.S b/arch/powerpc/kernel/head_8xx.S index ba2dc53..c640bbb

[PATCH 1/3] powerpc/8xx: mark _PAGE_SHARED all types of kernel pages

2015-04-22 Thread Christophe Leroy
All kernel pages have to be marked as shared in order to not perform CASID verification. Signed-off-by: Christophe Leroy --- arch/powerpc/include/asm/pte-8xx.h | 7 ++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/arch/powerpc/include/asm/pte-8xx.h b/arch/powerpc/include

[PATCH 2/3] powerpc/8xx: Handle PAGE_USER via APG bits

2015-04-22 Thread Christophe Leroy
erformed as supervisor according to page definition) This removes the special 8xx handling in pte_update() Signed-off-by: Christophe Leroy --- arch/powerpc/include/asm/pgtable-ppc32.h | 19 --- arch/powerpc/include/asm/pte-8xx.h | 27 +-

[PATCH 3/3] powerpc/8xx: Implementation of PAGE_EXEC

2015-04-22 Thread Christophe Leroy
User, exec => 01 (rights according to page definition) GP3 (11) => User, exec => 00 (all accesses performed as supervisor) Signed-off-by: Christophe Leroy --- arch/powerpc/include/asm/cputable.h | 2 +- arch/powerpc/include/asm/mmu-8xx.h | 26 ++ arch/powerpc/i

[PATCH 0/3] powerpc/8xx: Implementation of execute protection

2015-04-22 Thread Christophe Leroy
This patchset implements execute protection on the 8xx. It also simplifies the handling of PAGE_USER and PAGE_RO, and adds a small fix to the kernel pages definition. This patchset goes on to of my previous patchset named "[v5] powerpc8xx: Further optimisation of TLB handling" Christ

[PATCH v2] spi: fsl-spi: use of_iomap() to map parameter ram on CPM1

2015-04-22 Thread Christophe Leroy
e CPM UART: when the CPM is of type CPM1, we simply do an of_iomap() of the area provided via the device tree. Signed-off-by: Christophe Leroy --- v2: Use devm_ioremap_resource() instead of_iomap() drivers/spi/spi-fsl-cpm.c | 35 ++- 1 file changed, 18 inser

[PATCH v3] spi: fsl-spi: use devm_ioremap_resource() to map parameter ram on CPM1

2015-04-22 Thread Christophe Leroy
r the same principle as for the CPM UART: when the CPM is of type CPM1, we simply do an devm_ioremap_resource() of the area provided via the device tree. Signed-off-by: Christophe Leroy --- v2: Use devm_ioremap_resource() instead of_iomap() v3: Replaced of_iomap() by devm_ioremap_resource() in the

[PATCH] spi: fsl-spi: fix devm_ioremap_resource() error case

2015-04-23 Thread Christophe Leroy
devm_ioremap_resource() doesn't return NULL but an ERR_PTR on error. Reported-by: Jonas Gorsky Signed-off-by: Christophe Leroy --- drivers/spi/spi-fsl-cpm.c | 7 ++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/drivers/spi/spi-fsl-cpm.c b/drivers/spi/spi-fsl-cpm.c

Re: powerpc32: rearrange instructions order in ip_fast_csum()

2015-04-28 Thread christophe leroy
Le 25/03/2015 02:22, Scott Wood a écrit : On Tue, Feb 03, 2015 at 12:39:27PM +0100, LEROY Christophe wrote: Signed-off-by: Christophe Leroy --- arch/powerpc/lib/checksum_32.S | 10 +++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/arch/powerpc/lib/checksum_32.S b

Re: [PATCH v2 1/2] powerpc32: put csum_tcpudp_magic inline

2015-04-28 Thread christophe leroy
Le 25/03/2015 03:10, Scott Wood a écrit : On Tue, 2015-02-03 at 12:39 +0100, Christophe Leroy wrote: csum_tcpudp_magic() is only a few instructions, and does not modifies any other register than the returned result. So it is not worth having it as a separate function and suffer function

Re: [v2,2/2] powerpc32: add support for csum_add()

2015-04-28 Thread christophe leroy
Le 25/03/2015 02:30, Scott Wood a écrit : On Tue, Feb 03, 2015 at 12:39:27PM +0100, LEROY Christophe wrote: The C version of csum_add() as defined in include/net/checksum.h gives the following assembly: 0: 7c 04 1a 14 add r0,r4,r3 4: 7c 64 00 10 subfc

[PATCH 0/4] powerpc32: use cacheable alternatives of memcpy and memset

2015-05-12 Thread Christophe Leroy
This patchset implements use of cacheable versions of memset and memcpy when the len is greater than the cacheline size and the destination is in RAM. On MPC885, we observe a 7% rate increase on FTP transfer Christophe Leroy (4): Partially revert "powerpc: Remove duplicate cacheable_m

[PATCH 1/4] Partially revert "powerpc: Remove duplicate cacheable_memcpy/memzero functions"

2015-05-12 Thread Christophe Leroy
heline with the data that we will overwrite. Signed-off-by: Christophe Leroy --- arch/powerpc/lib/copy_32.S | 127 + 1 file changed, 127 insertions(+) diff --git a/arch/powerpc/lib/copy_32.S b/arch/powerpc/lib/copy_32.S index 6813f80..55f19f9 100644 --

[PATCH 2/4] powerpc32: swap r4 and r5 in cacheable_memzero

2015-05-12 Thread Christophe Leroy
We swap r4 and r5, this avoids having to move the len contained in r4 into r5 Signed-off-by: Christophe Leroy --- arch/powerpc/lib/copy_32.S | 29 ++--- 1 file changed, 14 insertions(+), 15 deletions(-) diff --git a/arch/powerpc/lib/copy_32.S b/arch/powerpc/lib/copy_32

[PATCH 3/4] powerpc32: memset(0): use cacheable_memzero

2015-05-12 Thread Christophe Leroy
back to generic_memcpy() Signed-off-by: Christophe Leroy --- arch/powerpc/lib/copy_32.S | 15 ++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/arch/powerpc/lib/copy_32.S b/arch/powerpc/lib/copy_32.S index cbca76c..d8a9a86 100644 --- a/arch/powerpc/lib/copy_32.S +++ b

[PATCH 4/4] powerpc32: memcpy: use cacheable_memcpy

2015-05-12 Thread Christophe Leroy
, we get approximatly 7% increase of the transfer rate on an FTP reception Signed-off-by: Christophe Leroy --- arch/powerpc/lib/copy_32.S | 23 --- 1 file changed, 16 insertions(+), 7 deletions(-) diff --git a/arch/powerpc/lib/copy_32.S b/arch/powerpc/lib/copy_32.S index

Re: [PATCH 3/4] powerpc32: memset(0): use cacheable_memzero

2015-05-14 Thread christophe leroy
Le 14/05/2015 02:55, Scott Wood a écrit : On Tue, 2015-05-12 at 15:32 +0200, Christophe Leroy wrote: cacheable_memzero uses dcbz instruction and is more efficient than memset(0) when the destination is in RAM This patch renames memset as generic_memset, and defines memset as a prolog to

Re: [PATCH 1/4] Partially revert "powerpc: Remove duplicate cacheable_memcpy/memzero functions"

2015-05-15 Thread christophe leroy
Le 14/05/2015 02:49, Scott Wood a écrit : On Tue, 2015-05-12 at 15:32 +0200, Christophe Leroy wrote: This partially reverts commit 'powerpc: Remove duplicate cacheable_memcpy/memzero functions ("f909a35bdfb7cb350d078a2cf888162eeb20381c")' I don't ha

[PATCH v2 0/6] powerpc32: replace memcpy and memset by cacheable alternatives

2015-05-19 Thread Christophe Leroy
This patchset implements use of cacheable versions of memset and memcpy since when the destination is not cacheable, memset_io and memcpy_toio are used. On MPC885, we observe a 7% rate increase on FTP transfer Christophe Leroy (6): powerpc: use memset_io() to clear CPM Muram Partially revert

[PATCH v2 1/6] powerpc: use memset_io() to clear CPM Muram

2015-05-19 Thread Christophe Leroy
CPM muram is not cached, so use memset_io() instead of memset() Signed-off-by: Christophe Leroy --- arch/powerpc/sysdev/cpm_common.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/powerpc/sysdev/cpm_common.c b/arch/powerpc/sysdev/cpm_common.c index 4f78695..e2ea519

[PATCH v2 2/6] Partially revert "powerpc: Remove duplicate cacheable_memcpy/memzero functions"

2015-05-19 Thread Christophe Leroy
heline with the data that we will overwrite. Signed-off-by: Christophe Leroy --- arch/powerpc/lib/copy_32.S | 127 + 1 file changed, 127 insertions(+) diff --git a/arch/powerpc/lib/copy_32.S b/arch/powerpc/lib/copy_32.S index 6813f80..55f19f9 100644 --

[PATCH v2 3/6] powerpc32: memset(0): use cacheable_memzero

2015-05-19 Thread Christophe Leroy
() cacheable_memzero disappears as it is not referenced anywhere anymore Signed-off-by: Christophe Leroy --- arch/powerpc/lib/copy_32.S | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/arch/powerpc/lib/copy_32.S b/arch/powerpc/lib/copy_32.S index 55f19f9..0b4f954 100644 --- a

[PATCH v2 4/6] powerpc32: Merge the new memset() with the old one

2015-05-19 Thread Christophe Leroy
cacheable_memzero() which has become the new memset() and the old memset() are quite similar, so just merge them. Signed-off-by: Christophe Leroy --- arch/powerpc/lib/copy_32.S | 34 +++--- 1 file changed, 7 insertions(+), 27 deletions(-) diff --git a/arch/powerpc

[PATCH v2 5/6] powerpc32: cacheable_memcpy becomes memcpy

2015-05-19 Thread Christophe Leroy
approximatly 7% increase of the transfer rate on an FTP reception Signed-off-by: Christophe Leroy --- arch/powerpc/lib/copy_32.S | 16 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/arch/powerpc/lib/copy_32.S b/arch/powerpc/lib/copy_32.S index 9262071..1d49c74 100644 --- a

[PATCH v2 6/6] powerpc32: Few optimisations in memcpy

2015-05-19 Thread Christophe Leroy
This patch adds a few optimisations in memcpy functions by using lbzu/stbu instead of lxb/stb and by re-ordering insn inside a loop to reduce latency due to loading Signed-off-by: Christophe Leroy --- arch/powerpc/lib/copy_32.S | 10 +- 1 file changed, 5 insertions(+), 5 deletions

[PATCH v3 0/2] Optimise some IP checksum functions.

2015-05-19 Thread Christophe Leroy
This patchset provides a few optimisations related to IP checksum functions. Christophe Leroy (2): powerpc: put csum_tcpudp_magic inline powerpc: add support for csum_add() arch/powerpc/include/asm/checksum.h | 37 - arch/powerpc/lib/checksum_32.S

[PATCH v3 1/2] powerpc: put csum_tcpudp_magic inline

2015-05-19 Thread Christophe Leroy
. Signed-off-by: Christophe Leroy --- arch/powerpc/include/asm/checksum.h | 21 - arch/powerpc/lib/checksum_32.S | 16 arch/powerpc/lib/checksum_64.S | 21 - 3 files changed, 12 insertions(+), 46 deletions(-) diff --git a/arch/powerpc

[PATCH v3 2/2] powerpc: add support for csum_add()

2015-05-19 Thread Christophe Leroy
r3,r4,r3 0xc0001b0c <+20>:clrldi r3,r3,32 0xc0001b10 <+24>:blr include/net/checksum.h also offers the possibility to define an arch specific function. This patch provides a specific csum_add() inline function. Signed-off-by: Christophe Leroy ---

[PATCH v2 00/19] powerpc/8xx: Optimise MMU TLB handling and add support of 16k pages

2014-08-29 Thread Christophe Leroy
implementing a 16 bit alignment of the PGDIR. It is not worth potentially wasting up to 64k of memory just for removing one instruction (ori). 2) I managed to preserve r11 while calculating the level 2 address, therefore no more need to save r11 into CR. Signed-off-by: Christophe Leroy Tested

[PATCH v2 01/19] powerpc/8xx: Declare SPRG2 as a SCRATCH register

2014-08-29 Thread Christophe Leroy
Since coming 469d62be9263b92f2c3329540cbb1c076111f4f3, SPRG2 is used as a scratch register just like SPRG0 and SPRG1. So Declare it as such and fix the comment which is not valid anymore since that commit. Signed-off-by: Christophe Leroy --- arch/powerpc/include/asm/reg.h |3 ++- arch

[PATCH v2 02/19] powerpc/8xx: Use SCRATCH0 and SCRATCH1 also for TLB handlers

2014-08-29 Thread Christophe Leroy
-off-by: Christophe Leroy --- arch/powerpc/kernel/head_8xx.S | 104 -- 1 files changed, 36 insertions(+), 68 deletions(-) diff --git a/arch/powerpc/kernel/head_8xx.S b/arch/powerpc/kernel/head_8xx.S index 1329c5a..3af6db1 100644 --- a/arch/powerpc/kernel

[PATCH v2 03/19] powerpc/8xx: exception InstructionAccess does not exist on MPC8xx

2014-08-29 Thread Christophe Leroy
Exception InstructionAccess does not exist on MPC8xx. No need to branch there from somewhere else. Handling can be done directly in InstructionTLBError Exception. Signed-off-by: Christophe Leroy --- arch/powerpc/kernel/head_8xx.S | 17 +++-- 1 files changed, 7 insertions(+), 10

[PATCH v2 05/19] powerpc/8xx: Fix comment about DIRTY update

2014-08-29 Thread Christophe Leroy
Since commit 2321f33790a6c5b80322d907a92d5739e7521a13, dirty handling is not handled here anymore. So we fix the comment. Signed-off-by: Christophe Leroy --- arch/powerpc/kernel/head_8xx.S |8 ++-- 1 files changed, 2 insertions(+), 6 deletions(-) diff --git a/arch/powerpc/kernel

[PATCH v2 04/19] powerpc/8xx: Remove loading of r10 at end of FixupDAR

2014-08-29 Thread Christophe Leroy
Since commit 2321f33790a6c5b80322d907a92d5739e7521a13, r10 is not used anymore after FixupDAR. There is therefore no need to set it up with the value of DAR. Signed-off-by: Christophe Leroy --- arch/powerpc/kernel/head_8xx.S |7 +++ 1 files changed, 3 insertions(+), 4 deletions

[PATCH v2 10/19] powerpc/8xx: Duplicate two insns instead of branching

2014-08-29 Thread Christophe Leroy
Branching takes two cycles on MPC8xx. Lets duplicate the two instructions and avoid the branching. Signed-off-by: Christophe Leroy --- arch/powerpc/kernel/head_8xx.S |6 -- 1 files changed, 4 insertions(+), 2 deletions(-) diff --git a/arch/powerpc/kernel/head_8xx.S b/arch/powerpc

[PATCH v2 06/19] powerpc/8xx: No need to save r10 and r3 when not calling FixupDAR

2014-08-29 Thread Christophe Leroy
r10 and r3 are only used inside FixupDAR function. So lets save them inside that function only. Signed-off-by: Christophe Leroy --- arch/powerpc/kernel/head_8xx.S | 27 +-- 1 files changed, 13 insertions(+), 14 deletions(-) diff --git a/arch/powerpc/kernel/head_8xx.S

[PATCH v2 15/19] powerpc/8xx: Implement 16k pages

2014-08-29 Thread Christophe Leroy
This patch activates the handling of 16k pages on the MPC8xx. Signed-off-by: Christophe Leroy --- arch/powerpc/Kconfig |2 +- arch/powerpc/include/asm/mmu-8xx.h |2 ++ arch/powerpc/kernel/head_8xx.S |4 3 files changed, 7 insertions(+), 1 deletions(-) diff

[PATCH v2 18/19] powerpc/8xx: _PMD_PRESENT already set in level 1 entries

2014-08-29 Thread Christophe Leroy
When a PMD entry is valid, _PMD_PRESENT is set. Therefore, forcing that bit during TLB loading is useless. Signed-off-by: Christophe Leroy --- arch/powerpc/kernel/head_8xx.S |2 -- 1 files changed, 0 insertions(+), 2 deletions(-) diff --git a/arch/powerpc/kernel/head_8xx.S b/arch/powerpc

[PATCH v2 09/19] powerpc/8xx: Optimize verification in FixupDAR

2014-08-29 Thread Christophe Leroy
By XORing the upper part of the instruction code, we get a value that can directly be verified with the second test and we can remove the first test. Signed-off-by: Christophe Leroy --- arch/powerpc/kernel/head_8xx.S |6 ++ 1 files changed, 2 insertions(+), 4 deletions(-) diff --git a

[PATCH v2 19/19] powerpc/8xx: Don't restore regs to save them again.

2014-08-29 Thread Christophe Leroy
There is not need to restore r10, r11 and cr registers at this end of ITLBmiss handler as they are saved again to the same place in ITLBError handler we are jumping to. Signed-off-by: Christophe Leroy --- arch/powerpc/kernel/head_8xx.S |8 +--- 1 files changed, 5 insertions(+), 3

[PATCH v2 17/19] powerpc/8xx: set PTE bit 22 off TLBmiss

2014-08-29 Thread Christophe Leroy
No need to re-set this bit at each TLB miss. Let's set it in the PTE. Signed-off-by: Christophe Leroy --- arch/powerpc/include/asm/pgtable-ppc32.h | 21 + arch/powerpc/include/asm/pte-8xx.h |7 +-- arch/powerpc/kernel/head_8xx.S |

[PATCH v2 12/19] powerpc/8xx: Don't use MD_TWC for walk

2014-08-29 Thread Christophe Leroy
MD_TWC can only be used properly with 4k pages. So lets calculate level 2 table index by ourselves. Signed-off-by: Christophe Leroy --- arch/powerpc/kernel/head_8xx.S | 28 1 files changed, 12 insertions(+), 16 deletions(-) diff --git a/arch/powerpc/kernel

[PATCH v2 08/19] powerpc/8xx: No need to restore registers and save them again.

2014-08-29 Thread Christophe Leroy
In DTLBError handler there is not need to restore r10, r11 and cr registers after fixing DAR as they are saved again to the same place just after. Signed-off-by: Christophe Leroy --- arch/powerpc/kernel/head_8xx.S |4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/arch

[PATCH v2 07/19] powerpc/8xx: DataAccess exception not generated by MPC8xx

2014-08-29 Thread Christophe Leroy
DataAccess exception is never generated by MPC8xx so do the job directly where it is used to avoid an unnecessary branching. Signed-off-by: Christophe Leroy --- arch/powerpc/kernel/head_8xx.S | 23 ++- 1 files changed, 10 insertions(+), 13 deletions(-) diff --git a/arch

[PATCH v2 13/19] powerpc/8xx: Use PAGE size related consts

2014-08-29 Thread Christophe Leroy
For PAGE size related operations, use PAGE size consts in order to be able to use different page size in the futur. Signed-off-by: Christophe Leroy --- arch/powerpc/kernel/head_8xx.S | 30 ++ 1 files changed, 18 insertions(+), 12 deletions(-) diff --git a/arch

[PATCH v2 14/19] powerpc/8xx: Const for TLB RPN forced value

2014-08-29 Thread Christophe Leroy
Value 0x00f0 is used to force bits in TLB level 2 entry. This value is linked to the page size and will vary when we change the page size. Lets define a const for it in order to have it at only one place. Signed-off-by: Christophe Leroy --- arch/powerpc/kernel/head_8xx.S | 19

  1   2   3   4   5   6   7   8   9   10   >