[PATCH] MIPS: R2-on-R6 emulation bugfix of BLEZL and BGTZL instructions

2016-11-07 Thread Leonid Yegoshin
f one instruction it picks up a next candidate. In single pass strategy it does not happen because CPU doesn't trap on branch-compacts which share opcode space with BLEZL/BGTZL (but has RT != 0, of course). Signed-off-by: Leonid Yegoshin Reported-by: Douglas Leung --- arch/mips/kernel/mips-r2-to

Re: [4/4] MIPS: Sync icache & dcache in set_pte_at

2016-03-02 Thread Leonid Yegoshin
Paul Burton wrote: It is, however, used in such a way by others & seems to me like the only correct way to implement the lazy cache flushing. The alternative would be to adjust all generic code to ensure flush_icache_page gets called before set_pte_at ... which is an exact case right now. Both

Re: [v3,11/41] mips: reuse asm-generic/barrier.h

2016-01-27 Thread Leonid Yegoshin
On 01/27/2016 03:26 AM, Maciej W. Rozycki wrote: On Fri, 15 Jan 2016, Leonid Yegoshin wrote: So you need to build a different kernel for some types of MIPS systems? Or do you do boot-time rewriting, like a number of other arches do? I don't know. I would like to have responses. Ralf

[PATCH] MIPS: remove aliasing alignment if HW has antialising support

2015-11-19 Thread Leonid Yegoshin
. Signed-off-by: Leonid Yegoshin --- arch/mips/mm/c-r4k.c |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/mips/mm/c-r4k.c b/arch/mips/mm/c-r4k.c index 5d3a25e1cfae..493f5226da10 100644 --- a/arch/mips/mm/c-r4k.c +++ b/arch/mips/mm/c-r4k.c @@ -1670,7 +1670,7 @@ void

Re: [v3, 3/3] MIPS: VDSO: Add implementations of gettimeofday() and clock_gettime()

2015-10-28 Thread Leonid Yegoshin
On 10/28/2015 12:55 PM, Alex Smith wrote: On 28 October 2015 at 19:28, Leonid Yegoshin wrote: . Clocksources are not per-CPU. If the CP0 counter is the current clocksource, then both the kernel and VDSO implementations of gettimeofday will read out the CP0 counter from whatever CPU they run

Re: [v3, 3/3] MIPS: VDSO: Add implementations of gettimeofday() and clock_gettime()

2015-10-28 Thread Leonid Yegoshin
On 10/28/2015 12:04 PM, Alex Smith wrote: On 28 October 2015 at 18:57, Leonid Yegoshin wrote: As I've explained the VDSO will only use the CP0 counter in the same situations that the kernel would when it is the active clocksource. Any issue that makes the counter unreliable affect

Re: [v3, 3/3] MIPS: VDSO: Add implementations of gettimeofday() and clock_gettime()

2015-10-28 Thread Leonid Yegoshin
On 10/28/2015 11:30 AM, Alex Smith wrote: On 28 October 2015 at 18:21, Leonid Yegoshin wrote: 1) I don't see that in code - there is no check that kernel uses actually uses R4K clocksource as primary (A), and if kernel uses R4K count as a clocksource and later switches to some more pr

Re: [v3, 3/3] MIPS: VDSO: Add implementations of gettimeofday() and clock_gettime()

2015-10-28 Thread Leonid Yegoshin
On 10/28/2015 03:20 AM, Alex Smith wrote: On 27 October 2015 at 20:46, Leonid Yegoshin wrote: I believe, until this issue is fixed the R4K only CPU should be excluded from VDSO timing acceleration. The VDSO code will currently use the CP0 count whenever the kernel is using it as its primary

Re: [v3, 3/3] MIPS: VDSO: Add implementations of gettimeofday() and clock_gettime()

2015-10-27 Thread Leonid Yegoshin
For example, On OCTEON single-chip systems we synchronize the the counters and they don't drift. So, we can use CPO.Count. However, on two-chip NUMA configurations there may be clock drift between the two chips, so CPO.Count cannot be used as a clocksource. We have a single kernel image tha

Re: [v3, 3/3] MIPS: VDSO: Add implementations of gettimeofday() and clock_gettime()

2015-10-27 Thread Leonid Yegoshin
On 10/27/2015 02:02 PM, David Daney wrote: On 10/27/2015 01:46 PM, Leonid Yegoshin wrote: [...] And finally. clock scaling - what we would do if there are two CPUs with different clock ratios in system? It seems like common kernel timing subsystem can handle that. The code that executes in

Re: [v3, 3/3] MIPS: VDSO: Add implementations of gettimeofday() and clock_gettime()

2015-10-27 Thread Leonid Yegoshin
On 10/27/2015 07:47 AM, Ralf Baechle wrote: On Thu, Oct 22, 2015 at 06:41:30PM -0700, Leonid Yegoshin wrote: You can not use R4K CP0_count in SMP (multicore) without core-specific adjustment. After first power-saving with core clock off or core down the values in CP0_count in different cores

Re: [v3, 3/3] MIPS: VDSO: Add implementations of gettimeofday() and clock_gettime()

2015-10-22 Thread Leonid Yegoshin
You can not use R4K CP0_count in SMP (multicore) without core-specific adjustment. After first power-saving with core clock off or core down the values in CP0_count in different cores are absolutely different. Until you include in system a patch like http://patchwork.linux-mips.org/patch/10871

Re: [PATCH v3] MIPS64: signal: n64 kernel bugfix of MIPS32 o32 ABI sigaction syscall

2015-10-20 Thread Leonid Yegoshin
On 10/20/2015 01:35 AM, Markos Chandras wrote: What tree did you use for this patch? It does not seem to apply to mainline or Ralf's upstream-sfr. May I ask you to elaborate more and send me a concern details? I definitely rebased it to mips-for-linux-next of upstream-sfr from LMO. - Leonid

Re: [PATCH v3] MIPS64: signal: n64 kernel bugfix of MIPS32 o32 ABI sigaction syscall

2015-10-20 Thread Leonid Yegoshin
I mailed it from LMO 'upstream-sfr'. I pulled it last week. I will check it again. - Leonid.

[PATCH v3] MIPS64: signal: n64 kernel bugfix of MIPS32 o32 ABI sigaction syscall

2015-10-19 Thread Leonid Yegoshin
(introduced by v1). Tested on all 3 ABIs. -- Signed-off-by: Leonid Yegoshin --- arch/mips/include/asm/signal.h | 12 +--- arch/mips/kernel/signal.c |2 +- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/arch/mips/include/asm/signal.h b/arch/mips/include/asm

[PATCH v2] MIPS64: signal: n64 kernel bugfix of MIPS32 o32 ABI sigaction syscall

2015-10-16 Thread Leonid Yegoshin
MIPS32 o32 ABI sigaction() processing on MIPS64 n64 kernel was incorrectly set to processing aka rt_sigaction() variant only. Fixed. -- v2: Taken in account CONFIG vars interdependencies and conditional expression simplified. As a result, the reverse problem fixed (introduced by v1). Teste

[PATCH v2] MIPS64: signal: n64 kernel bugfix of MIPS32 o32 ABI sigaction syscall

2015-10-16 Thread Leonid Yegoshin
MIPS32 o32 ABI sigaction() processing on MIPS64 n64 kernel was incorrectly set to processing aka rt_sigaction() variant only. Fixed. -- v2: Taken in account CONFIG vars interdependencies and conditional expression simplified. As a result, the reverse problem fixed (introduced by v1). Teste

Re: [PATCH] MIPS64: signal: n64 kernel bugfix of MIPS32 o32 ABI sigaction syscall

2015-10-16 Thread Leonid Yegoshin
On 10/16/2015 01:11 AM, Markos Chandras wrote: On 10/15/2015 07:50 PM, Leonid Yegoshin wrote: MIPS32 o32 ABI sigaction() processing on MIPS64 n64 kernel was incorrectly set to processing aka rt_sigaction() variant only. Fixed. Signed-off-by: Leonid Yegoshin --- arch/mips/include/asm

[PATCH] MIPS64: signal: n64 kernel bugfix of MIPS32 o32 ABI sigaction syscall

2015-10-15 Thread Leonid Yegoshin
MIPS32 o32 ABI sigaction() processing on MIPS64 n64 kernel was incorrectly set to processing aka rt_sigaction() variant only. Fixed. Signed-off-by: Leonid Yegoshin --- arch/mips/include/asm/signal.h | 15 --- arch/mips/kernel/signal.c |2 +- 2 files changed, 13

[PATCH] MIPS64: signal: n64 kernel bugfix of MIPS32 o32 ABI sigaction syscall

2015-10-15 Thread Leonid Yegoshin
MIPS32 o32 ABI sigaction() processing on MIPS64 n64 kernel was incorrectly set to processing aka rt_sigaction() variant only. Fixed. Signed-off-by: Leonid Yegoshin --- arch/mips/include/asm/signal.h | 15 --- arch/mips/kernel/signal.c |2 +- 2 files changed, 13

Re: [PATCH] MIPS: R6: emulation of PC-relative instructions

2015-08-11 Thread Leonid Yegoshin
On 08/11/2015 07:41 AM, Markos Chandras wrote: Hi, On Wed, Aug 05, 2015 at 04:53:43PM -0700, Leonid Yegoshin wrote: if (nir) { err = mipsr6_emul(regs, nir); if (err >

Re: [4.1,013/123] MIPS: c-r4k: Fix cache flushing for MT cores

2015-08-10 Thread Leonid Yegoshin
On 08/10/2015 12:19 PM, gre...@linuxfoundation.org wrote: On Mon, Aug 10, 2015 at 12:12:05PM -0700, Leonid Yegoshin wrote: On 08/10/2015 11:49 AM, gre...@linuxfoundation.org wrote: On Mon, Aug 10, 2015 at 11:36:34AM -0700, Leonid Yegoshin wrote: So, this is broken in Linus's tree too?

Re: [4.1,013/123] MIPS: c-r4k: Fix cache flushing for MT cores

2015-08-10 Thread Leonid Yegoshin
On 08/10/2015 11:49 AM, gre...@linuxfoundation.org wrote: On Mon, Aug 10, 2015 at 11:36:34AM -0700, Leonid Yegoshin wrote: So, this is broken in Linus's tree too? Yes. Or is it fixed there, and if so, what is the git commit id? There is no an accepted fix. My old patch is in

Re: [4.1,013/123] MIPS: c-r4k: Fix cache flushing for MT cores

2015-08-10 Thread Leonid Yegoshin
ange size. Because of that reasons it is a separate patch from EVA support. Signed-off-by: Leonid Yegoshin Signed-off-by: Steven J. Hill (cherry picked from commit 6b05dd71da1136fbad0ce642790c4c99343f05e7) (history is skipped) Note: the replacement of if (config_ena

Re: [PATCH v4 3/3] MIPS: set stack/data protection as non-executable

2015-08-05 Thread Leonid Yegoshin
On 08/05/2015 05:37 PM, David Daney wrote: This just means that your userspace is broken. If GLibC cannot do the right thing then it should be fixed. Let's skip this until you explain how to create a fully non-executable-stack process. GLIBC people is ready to do something but after we remov

Re: [PATCH v4 3/3] MIPS: set stack/data protection as non-executable

2015-08-05 Thread Leonid Yegoshin
On 08/05/2015 05:14 PM, David Daney wrote: On 08/05/2015 05:06 PM, Leonid Yegoshin wrote: On 08/05/2015 04:55 PM, Paul Burton wrote: As was pointed out last time you posted this, it breaks backwards compatibility with userland & thus cannot be applied. Never observed since first ver

Re: [PATCH v4 3/3] MIPS: set stack/data protection as non-executable

2015-08-05 Thread Leonid Yegoshin
On 08/05/2015 04:55 PM, Paul Burton wrote: As was pointed out last time you posted this, it breaks backwards compatibility with userland & thus cannot be applied. Never observed since first version. In other side, the problem with apps like ssh_keygen is observed in absence of executable st

Re: [PATCH v4 0/3] MIPS executable stack protection

2015-08-05 Thread Leonid Yegoshin
On 08/05/2015 05:00 PM, David Daney wrote: Does it handle nested emulation? Yes, it does since v2: "- Added unwinding of VDSO emulation stack at signal handler invocation, hiding an emulation page (Andy Lutomirski note in other patch comments)" - Leonid. -- To unsubscribe from this li

[PATCH] MIPS: R6: emulation of PC-relative instructions

2015-08-05 Thread Leonid Yegoshin
filling some emulation block in stack or special area and jump to it. This is not suitable for PC-relative instructions. So, this patch introduces a universal emulation of that instructions directly by kernel emulator. Signed-off-by: Leonid Yegoshin --- arch/mips/include/uapi/asm/inst.h | 42

[PATCH v4 1/3] MIPS: mips_flush_cache_range is added

2015-08-05 Thread Leonid Yegoshin
page is flushed by flush_cache_page in ptrace(). Signed-off-by: Leonid Yegoshin --- arch/mips/include/asm/cacheflush.h |3 +++ arch/mips/mm/c-octeon.c|8 +++ arch/mips/mm/c-r3k.c |8 +++ arch/mips/mm/c-r4k.c | 43

[PATCH v4 2/3] MIPS: Setup an instruction emulation in VDSO protected page instead of user stack

2015-08-05 Thread Leonid Yegoshin
eeps stack non-executable but things fails at FPU emulation later. Here are two issues which are bind together and to solve an incorrect behaviour of GLIBC (ignoring X ssh-keygen intention) the split of both issues is needed. So, I did a kernel emulation protected and out of stack. Signed-off-

[PATCH v4 3/3] MIPS: set stack/data protection as non-executable

2015-08-05 Thread Leonid Yegoshin
This is a last step of 3 patches which shift FPU emulation out of stack into protected area. So, it disables a default executable stack. Additionally, it sets a default data area non-executable protection. Signed-off-by: Leonid Yegoshin --- arch/mips/include/asm/page.h |2 +- 1 file

[PATCH v4 0/3] MIPS executable stack protection

2015-08-05 Thread Leonid Yegoshin
eemption friendly. V4 changes: - Fixed bug in supplementary TLB flush (change KVA to user address space) - Rebased to 4.X kernel --- Leonid Yegoshin (3): MIPS: mips_flush_cache_range is added MIPS: Setup an instruction emulation in VDSO protected page instead of user stack MIPS

Re: [PATCH] MIPS: bugfix of local_r4k_flush_icache_range - added L2 flush

2015-06-10 Thread Leonid Yegoshin
On 06/10/2015 03:28 AM, Ralf Baechle wrote: On Thu, May 28, 2015 at 01:37:24PM -0700, Leonid Yegoshin wrote: ... I was wondering why there was a cache flush at all so I dove into git history and found: commit 4676f9359fa5190ee6f42bbf2c27d28beb14d26a Author: Leonid Yegoshin Date: Tue Jan

Re: [PATCH 1/3] MIPS: R6: Use lightweight SYNC instruction in smp_* memory barriers

2015-06-02 Thread Leonid Yegoshin
On 06/02/2015 04:56 PM, David Daney wrote: On 06/02/2015 09:15 AM, Maciej W. Rozycki wrote: On Tue, 2 Jun 2015, James Hogan wrote: binutils appears to support the sync_mb, sync_rmb, sync_wmb aliases since version 2.21. Can we safely use them? I suggest that we don't -- we still officially

Re: [PATCH 2/3] MIPS: enforce LL-SC loop enclosing with SYNC (ACQUIRE and RELEASE)

2015-06-02 Thread Leonid Yegoshin
On 06/02/2015 04:39 AM, James Hogan wrote: Hi Leonid, On 02/06/15 01:09, Leonid Yegoshin wrote: CPUs may occasionally have problems in accordance with HW team. "have problems in accordance with HW team" is a bit confusing. What do you mean? I wrote about memory barriers and pr

Re: [PATCH 1/3] MIPS: R6: Use lightweight SYNC instruction in smp_* memory barriers

2015-06-02 Thread Leonid Yegoshin
On 06/02/2015 05:12 AM, Luc Van Oostenryck wrote: On Tue, Jun 02, 2015 at 11:08:35AM +0100, Paul Burton wrote: I think this would read better as something like: If a processor does not implement the lightweight sync operations then the architecture requires that they interpret the corres

[PATCH 3/3] MIPS: bugfix - replace smp_mb with release barrier function in unlocks

2015-06-01 Thread Leonid Yegoshin
uot; semantics. Signed-off-by: Leonid Yegoshin --- arch/mips/include/asm/bitops.h |2 +- arch/mips/include/asm/spinlock.h |2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/mips/include/asm/bitops.h b/arch/mips/include/asm/bitops.h index 0cf29bd5dc5c..ce9666cf1499 1006

[PATCH 1/3] MIPS: R6: Use lightweight SYNC instruction in smp_* memory barriers

2015-06-01 Thread Leonid Yegoshin
only for MIPS R6 and other MIPS32/64 R2/R5 processors have it configurable. Signed-off-by: Leonid Yegoshin --- arch/mips/Kconfig | 22 ++ arch/mips/include/asm/barrier.h |6 ++ 2 files changed, 28 insertions(+) diff --git a/arch/mips/Kconfig b/arch

[PATCH 2/3] MIPS: enforce LL-SC loop enclosing with SYNC (ACQUIRE and RELEASE)

2015-06-01 Thread Leonid Yegoshin
5KEs has a pretty short pipeline. Using memory barriers in MIPS R6 is mandatory, all that processors have a speculative memory read which can inflict a trouble without a correct use of barriers in LL-SC loop cycles. The same is actually for MIPS32 R5 I5600 processor. Signed-off-by: Leonid Yegoshin

[PATCH 0/3] MIPS: SMP memory barriers: lightweight sync, acquire-release

2015-06-01 Thread Leonid Yegoshin
wever, it is considered safe do not implement some or any lightweight SYNC in specific core because Architecture requires HW map of unimplemented SYNCs to SYNC 0. --- Leonid Yegoshin (3): MIPS: R6: Use lightweight SYNC instruction in smp_* memory barriers MIPS: enforce LL-SC loop encl

[PATCH] MIPS: bugfix of local_r4k_flush_icache_range - added L2 flush

2015-05-28 Thread Leonid Yegoshin
This function is used to flush code used in NMI and EJTAG debug exceptions. However, during that exceptions the Status.ERL bit is set, which means that code runs as UNCACHABLE. So, flush code down to memory is needed. Signed-off-by: Leonid Yegoshin --- arch/mips/mm/c-r4k.c | 10 +- 1

Re: [PATCH 1/2] MIPS: MSA: bugfix - disable MSA during thread switch correctly

2015-05-22 Thread Leonid Yegoshin
On 05/22/2015 04:20 PM, Ralf Baechle wrote: On Fri, May 22, 2015 at 11:37:34AM -0700, Leonid Yegoshin wrote: On 05/22/2015 02:38 AM, Ralf Baechle wrote: Just move the call to finish_arch_switch(). It might be a problem later, then a correct MSA partiton starts working. It should be tight to

Re: [PATCH 1/2] MIPS: MSA: bugfix - disable MSA during thread switch correctly

2015-05-22 Thread Leonid Yegoshin
Ralf, If there was TIF_USEDMSA in "prev" task then it means that all MSA HW is in use. And switch_to() checks this and transfers it to resume() to indicate that MSA processing should be done. Macro call "msa_save_alla0" right before disabling MSA in Config5 does a save of MSA registers.

Re: [PATCH 1/2] MIPS: MSA: bugfix - disable MSA during thread switch correctly

2015-05-22 Thread Leonid Yegoshin
On 05/22/2015 02:38 AM, Ralf Baechle wrote: Just move the call to finish_arch_switch(). It might be a problem later, then a correct MSA partiton starts working. It should be tight to saving MSA registers in that case. Your rewrite also dropped the if (cpu_has_msa) condition from disable_msa

Re: [PATCH 1/2] MIPS: MSA: bugfix - disable MSA during thread switch correctly

2015-05-21 Thread Leonid Yegoshin
Yes, I have a program but it is binary only. If you want to understand why disable_DMA() after resume() doesn't work, search for restoring RA register in resume() after changing SP. - Leonid. Paul Burton wrote: On Tue, May 19, 2015 at 02:13:51PM -0700, Leonid Yegoshin wrote: > Durin

Re: [PATCH 2/2] MIPS: MSA: bugfix of keeping MSA live context through clone or fork

2015-05-20 Thread Leonid Yegoshin
Cancel this, please. Reason - MSA registers are not supposed to be preserved through caller-called interface, including syscall. In other side, keeping MSA context is expensive. - Leonid. -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to ma

[PATCH 2/2] MIPS: MSA: bugfix of keeping MSA live context through clone or fork

2015-05-19 Thread Leonid Yegoshin
in team, I guess. Well, in this case it should prevent clearing TIF_MSA_CTX_LIVE in copy_thread(). Signed-off-by: Leonid Yegoshin --- arch/mips/kernel/process.c |1 - 1 file changed, 1 deletion(-) diff --git a/arch/mips/kernel/process.c b/arch/mips/kernel/process.c index f2975d4d1e44..a16e62d40

[PATCH 1/2] MIPS: MSA: bugfix - disable MSA during thread switch correctly

2015-05-19 Thread Leonid Yegoshin
e_msa' after 'resume' in 'switch_to' macro never called a first time entry into thread. Signed-off-by: Leonid Yegoshin --- arch/mips/include/asm/switch_to.h |1 - arch/mips/kernel/r4k_switch.S |6 ++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --

[PATCH 0/2] MIPS: MSA: bugfixes of context switch

2015-05-19 Thread Leonid Yegoshin
Two bug fixes of MSA registers set handling during context switch. This fixes are respones to multithreading MSA application crash. It was traced to incorrect handling of MSA registers set during thread cloning. See inside. --- Leonid Yegoshin (2): MIPS: MSA: bugfix - disable MSA during

Re: [PATCH v2] MIPS64: Support of at least 48 bits of SEGBITS

2015-05-15 Thread Leonid Yegoshin
On 05/15/2015 02:53 PM, Ralf Baechle wrote: On Thu, May 14, 2015 at 06:34:43PM -0700, Leonid Yegoshin wrote: The order 1 allocation for the PGD are concerning me a little. On a system under even moderate memory pressure that might become a bit of a reliability or performance issue. With 4kB

Re: [PATCH v2] MIPS64: Support of at least 48 bits of SEGBITS

2015-05-15 Thread Leonid Yegoshin
On 05/15/2015 01:49 PM, David Daney wrote: On 05/14/2015 06:34 PM, Leonid Yegoshin wrote: SEGBITS default is 40 bits or less, depending from CPU type. This patch introduces 48bits of application virtual address (SEGBITS) support. It is defined only for 16K and 64K pages and is optional

Re: [PATCH v2] MIPS64: Support of at least 48 bits of SEGBITS

2015-05-15 Thread Leonid Yegoshin
On 05/15/2015 09:28 AM, David Daney wrote: On 05/14/2015 06:34 PM, Leonid Yegoshin wrote: SEGBITS default is 40 bits or less, depending from CPU type. This patch introduces 48bits of application virtual address (SEGBITS) support. It is defined only for 16K and 64K pages and is optional

[PATCH v2] MIPS64: Support of at least 48 bits of SEGBITS

2015-05-14 Thread Leonid Yegoshin
for 64K pages it adds 3rd level of PTE structure, which has a little impact during software TLB refill. This patch is needed because MIPS I6XXX and P6XXX cores have 48 bit of virtual address in each segment (SEGBITS). Signed-off-by: Leonid Yegoshin --- V2: Added correction for defintion of

[PATCH] MIPS64: Support of at least 48 bits of SEGBITS

2015-05-14 Thread Leonid Yegoshin
for 64K pages it adds 3rd level of PTE structure, which has a little impact during software TLB refill. This patch is needed because MIPS I6XXX and P6XXX cores have 48 bit of virtual address in each segment (SEGBITS). Signed-off-by: Leonid Yegoshin --- arch/mips/Kconfig | 10

[PATCH] MIPS: Flush cache after DMA_FROM_DEVICE for agressively speculative CPUs

2015-05-13 Thread Leonid Yegoshin
ned-off-by: Leonid Yegoshin --- arch/mips/mm/dma-default.c | 10 ++ 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/arch/mips/mm/dma-default.c b/arch/mips/mm/dma-default.c index 609d1241b0c4..ccf49ecfbf8c 100644 --- a/arch/mips/mm/dma-default.c +++ b/arch/mips/mm/dma-default.c

Re: [PATCH] MIPS64: 48 bit physaddr support in memory maps

2015-05-13 Thread Leonid Yegoshin
On 05/13/2015 02:47 PM, David Daney wrote: On 05/13/2015 11:55 AM, Leonid Yegoshin wrote: Originally, it was set to 40bits only but I6400 has 48bits of physaddr. Why not go to the architectural limit of 59 bits? Because any physaddr should fit PTE and EntryLo register and we also need 5

[PATCH] MIPS64: 48 bit physaddr support in memory maps

2015-05-13 Thread Leonid Yegoshin
Originally, it was set to 40bits only but I6400 has 48bits of physaddr. Signed-off-by: Leonid Yegoshin --- arch/mips/include/asm/addrspace.h |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/mips/include/asm/addrspace.h b/arch/mips/include/asm/addrspace.h index

Re: [PATCH] MIPS64: R6: R2 emulation bugfix

2015-04-30 Thread Leonid Yegoshin
On 04/29/2015 02:49 AM, Maciej W. Rozycki wrote: On Wed, 29 Apr 2015, James Hogan wrote: Error recovery pointers for fixups was improperly set as ".word" which is unsuitable for MIPS64. Replaced by __stringify(PTR) Every other case of this sort of thing uses STR(PTR) (or __UA_ADDR in uaccess.

[PATCH] MIPS64: R6: R2 emulation bugfix

2015-04-28 Thread Leonid Yegoshin
Error recovery pointers for fixups was improperly set as ".word" which is unsuitable for MIPS64. Replaced by __stringify(PTR) Signed-off-by: Leonid Yegoshin --- arch/mips/kernel/mips-r2-to-r6-emul.c | 104 + 1 file changed, 52 insertions(+), 52

Re: [PATCH] MIPS: R6: memcpy bugfix - zero length overwrites memory

2015-04-28 Thread Leonid Yegoshin
You right, I am debugging new core and got a wrong backtrace. Please cancel it, sorry for noise. - Leonid. Jonas Gorski wrote: Hi, On Tue, Apr 28, 2015 at 1:35 AM, Leonid Yegoshin wrote: > MIPS R6 version of memcpy has bug - then length to copy is zero > and addresses are not a

[PATCH] MIPS: R6: memcpy bugfix - zero length overwrites memory

2015-04-27 Thread Leonid Yegoshin
MIPS R6 version of memcpy has bug - then length to copy is zero and addresses are not aligned then it can overwrite a whole memory. Signed-off-by: Leonid Yegoshin --- arch/mips/lib/memcpy.S |2 ++ 1 file changed, 2 insertions(+) diff --git a/arch/mips/lib/memcpy.S b/arch/mips/lib/memcpy.S

Re: [PATCH] MIPS: MSA: misaligned support

2015-03-19 Thread Leonid Yegoshin
On 03/19/2015 02:51 AM, James Hogan wrote: On 18/03/15 23:25, Leonid Yegoshin wrote: On 03/18/2015 03:12 PM, James Hogan wrote: Hi Leonid, On Wed, Mar 18, 2015 at 12:46:51PM -0700, Leonid Yegoshin wrote: thread_msa_context_live() == check of TIF_MSA_CTX_LIVE == existence of MSA context for

Re: [PATCH] MIPS: MSA: misaligned support

2015-03-18 Thread Leonid Yegoshin
On 03/18/2015 03:12 PM, James Hogan wrote: Hi Leonid, On Wed, Mar 18, 2015 at 12:46:51PM -0700, Leonid Yegoshin wrote: thread_msa_context_live() == check of TIF_MSA_CTX_LIVE == existence of MSA context for thread. It differs from MSA is owned by thread, it just says that thread has already

Re: [PATCH] net: ethernet: pcnet32: Setup the SRAM and UFLO on Am79C97{3,5}

2015-03-18 Thread Leonid Yegoshin
Confirmed - your fix solves TX problem in kernel. - Leonid. On 03/18/2015 10:34 AM, Leonid Yegoshin wrote: Thank you, Markos! It seems like one Samurai problem may be solved by your work - right now I experience TX problem while I use NFS root. Will test today. - Leonid. Markos Chandras

Re: [PATCH] MIPS: MSA: misaligned support

2015-03-18 Thread Leonid Yegoshin
On 03/18/2015 04:27 AM, James Hogan wrote: + .align 4 doesn't this mean the first one & label might not be suitably aligned. Would it be better to put this before the ld_d (no need for it after $w31 case) and putting another .align 4 before the Lmsa_to and Lmsa_from labels (so the label i

[PATCH v2] MIPS: MSA: misaligned support

2015-03-18 Thread Leonid Yegoshin
ead still owns MSA unit then it loads and stores directly with MSA unit and only one MSA register. Saving and restoring the full MSA context (512bytes) on each misalign exception is expensive! Preemption is disabled, of course. Signed-off-by: Leonid Yegoshin --- V2: - added a missed assignment

[PATCH] MIPS: MSA: misaligned support

2015-03-17 Thread Leonid Yegoshin
ead still ownes MSA unit then it loads and stores directly with MSA unit and only one MSA register. Saving and restoring the full MSA context (512bytes) on each misalign exception is expensive! Preemption is disabled, of course. Signed-off-by: Leonid Yegoshin --- arch/mips/include/asm/processo

Re: MIPS: CONFIG_CPU_MIPS_R6?

2015-02-14 Thread Leonid Yegoshin
On 02/14/2015 09:26 AM, Paul Bolle wrote: Your commit 33d73a3d4159 ("MIPS: lib: memset: Add MIPS R6 support") is included in yesterday's linux next (ie, next-20150213). I noticed because a script I use to check linux-next spotted a trivial problem with it. It added a reference to CONFIG_CPU_MIPS

Re: MIPS: CONFIG_MIPS_R6?

2015-02-14 Thread Leonid Yegoshin
On 02/14/2015 09:21 AM, Paul Bolle wrote: Your commits 430857eae56c ("MIPS: mm: Add MIPS R6 instruction encodings") and 90163242784b ("MIPS: kernel: unaligned: Add support for the MIPS R6") are included in yesterday's linux-next (ie, next-20150213). I noticed because a script I use to check linux

Re: mips: Re-introduce copy_user_page

2015-02-03 Thread Leonid Yegoshin
On 01/30/2015 09:23 PM, Guenter Roeck wrote: Commit bcd022801ee5 ("MIPS: Fix COW D-cache aliasing on fork") replaced the inline function copy_user_page for mips with an external reference, but neglected to introduce the actual non-inline function. Restore it. Fixes: bcd022801ee5 ("MIPS: Fix COW

Re: [PATCH] arch: mips: kernel: traps: Remove some unused functions

2015-01-01 Thread Leonid Yegoshin
Is it a New Year joke? Did you try to build vmlinux MIPS binary? - Leonid

Re: [PATCH] Revert "MIPS: Remove race window in page fault handling"

2014-12-05 Thread Leonid Yegoshin
. - Lars On Fri, 2014-12-05 at 03:16 +0100, Leonid Yegoshin wrote: (repeat mesg, first one went to wrong place) Lars, Do you have a stack trace or so then you found the second VPE between set_pte_at and update_mmu_cache? It would be interesting how it happens - generally, to get a consistent SIGILL

Re: [PATCH v3 3/3] MIPS: set stack/data protection as non-executable

2014-12-05 Thread Leonid Yegoshin
On 12/05/2014 11:06 AM, David Daney wrote: On 12/05/2014 10:51 AM, Kees Cook wrote: On Fri, Dec 5, 2014 at 9:28 AM, David Daney wrote: Some programs require an executable stack, this patch will break them. Have you tested this? Do you require empirical evidence that the patch is incorrect

Re: [PATCH] Revert "MIPS: Remove race window in page fault handling"

2014-12-04 Thread Leonid Yegoshin
bug in FS is not enough. Hold on - do you use non-DMA file system? If so, I advice you to try this simple patch: Author: Leonid Yegoshin Date: Tue Apr 2 14:20:37 2013 -0700 MIPS: (opt) Fix of reading I-pages from non-DMA FS devices for ID cache separation This optional

Re: [PATCH 2/3] MIPS: Add full ISA emulator.

2014-12-03 Thread Leonid Yegoshin
On 12/03/2014 04:20 PM, David Daney wrote: On 12/03/2014 03:55 PM, Leonid Yegoshin wrote: On 12/03/2014 03:44 PM, David Daney wrote: (...) Big work Not really, although by number of lines of code, it is about 3x the size of your patch, it only touches the existing code in one place. It

Re: [PATCH 2/3] MIPS: Add full ISA emulator.

2014-12-03 Thread Leonid Yegoshin
On 12/03/2014 03:44 PM, David Daney wrote: (...) Big work but it doesn't support customized instructions, multiple ASEs, MIPS R6 etc. Well, it is still not a replacement of XOL emulation. Even close. -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a

Re: [PATCH] Revert "MIPS: Remove race window in page fault handling"

2014-12-03 Thread Leonid Yegoshin
use non-DMA file system? If so, I advice you to try this simple patch: Author: Leonid Yegoshin Date: Tue Apr 2 14:20:37 2013 -0700 MIPS: (opt) Fix of reading I-pages from non-DMA FS devices for ID cache separation This optional fix provides a D-cache flush for instruction code pages

[PATCH] Revert "MIPS: Remove race window in page fault handling"

2014-12-02 Thread Leonid Yegoshin
en that problem on 3.10 kernel. Signed-off-by: Leonid Yegoshin --- arch/mips/include/asm/pgtable.h |8 +--- arch/mips/mm/cache.c| 27 --- 2 files changed, 13 insertions(+), 22 deletions(-) diff --git a/arch/mips/include/asm/pgtable.h b/arch/mips/include/as

[PATCH v3 1/3] MIPS: mips_flush_cache_range is added

2014-12-02 Thread Leonid Yegoshin
page is flushed by flush_cache_page in ptrace(). Signed-off-by: Leonid Yegoshin --- arch/mips/include/asm/cacheflush.h |3 +++ arch/mips/mm/c-octeon.c|8 +++ arch/mips/mm/c-r3k.c |8 +++ arch/mips/mm/c-r4k.c | 43

[PATCH v3 2/3] MIPS: Setup an instruction emulation in VDSO protected page instead of user stack

2014-12-02 Thread Leonid Yegoshin
eeps stack non-executable but things fails at FPU emulation later. Here are two issues which are bind together and to solve an incorrect behaviour of GLIBC (ignoring X ssh-keygen intention) the splitting both issues is needed. So, I did a kernel emulation protected and out of stack. Signed-off-

[PATCH v3 3/3] MIPS: set stack/data protection as non-executable

2014-12-02 Thread Leonid Yegoshin
This is a last step of 3 patches which shift FPU emulation out of stack into protected area. So, it disables a default executable stack. Additionally, it sets a default data area non-executable protection. Signed-off-by: Leonid Yegoshin --- arch/mips/include/asm/page.h |2 +- 1 file

[PATCH v3 0/3] Series short description

2014-12-02 Thread Leonid Yegoshin
thread is rescheduled and other threads don't intervene (Peter Zijlstra) - Fixed uMIPS support (Paul Burton) - Added unwinding of VDSO emulation stack at signal handler invocation, hiding an emulation page (Andy Lutomirski note in other patch comments) V3 change: heavy preemption f

Re: [PATCH] MIPS: DMA: fix coherent alloc in non-coherent systems

2014-10-30 Thread Leonid Yegoshin
On 10/30/2014 03:07 AM, James Hogan wrote: Hi Leonid, On 30/10/14 01:48, Leonid Yegoshin wrote: A default dma_alloc_coherent() fails to alloc a coherent memory on non-coherent systems in case of device->coherent_dma_mask covering the whole memory space. In case of non-coherent systems

[PATCH] MIPS: DMA: fix coherent alloc in non-coherent systems

2014-10-29 Thread Leonid Yegoshin
DMA. Added __GFP_DMA flag in case of non-coherent systems to enforce an allocation of coherent memory in ZONE_DMA. Signed-off-by: Leonid Yegoshin --- .../include/asm/mach-cavium-octeon/dma-coherence.h |2 +- arch/mips/include/asm/mach-generic/dma-coherence.h |2 +- arch/mips/include/asm/m

Re: [PATCH v2 2/3] MIPS: Setup an instruction emulation in VDSO protected page instead of user stack

2014-10-10 Thread Leonid Yegoshin
On 10/10/2014 03:56 PM, David Daney wrote: > Right, look at uprobes, it does exactly all this with a single page. > Slot allocation will block waiting for a free slot when all are in use. I don't see a reason to change my 300 lines design into much more lengthy code. That code has more lin

Re: [PATCH v2 2/3] MIPS: Setup an instruction emulation in VDSO protected page instead of user stack

2014-10-10 Thread Leonid Yegoshin
On 10/10/2014 03:03 AM, James Hogan wrote: I just mean an (illegal/undefined) sequence of FPU branch instructions in one anothers delay slots shouldn't be able to crash the kernel. Actually 2 of them would be enough to verify the kernel didn't get too confused. Maybe the second will be detected

Re: [PATCH v2 2/3] MIPS: Setup an instruction emulation in VDSO protected page instead of user stack

2014-10-09 Thread Leonid Yegoshin
On 10/09/2014 04:40 PM, James Hogan wrote: It may be a case for mix of FPU and MIPS R6 emulations. I just keep both emulators separate as much as possible but I assume that without prove it may be stackable - some rollback is needed to join both and it may (probably) cause a double emulation se

Re: [PATCH v2 0/3] MIPS executable stack protection

2014-10-09 Thread Leonid Yegoshin
On 10/09/2014 03:59 PM, David Daney wrote: Note: actual execute-protection depends from HW capability, of course. This patch is required for MIPS32/64 R2 emulation on MIPS R6 architecture. Without it 'ssh-keygen' crashes pretty fast on attempt to execute instruction in stack. There is muc

Re: [PATCH v2 2/3] MIPS: Setup an instruction emulation in VDSO protected page instead of user stack

2014-10-09 Thread Leonid Yegoshin
Small stack of emulation blocks is supported because nested traps are possible in MIPS32/64 R6 emulation mix with FPU emulation. Could you please clarify how this nesting of emulation blocks could happen now that signals are handled more cleanly. I.e. isn't the emuframe stuff only required for i

Re: [PATCH v2 0/3] MIPS executable stack protection

2014-10-09 Thread Leonid Yegoshin
On 10/09/2014 02:42 PM, David Daney wrote: On 10/09/2014 01:00 PM, Leonid Yegoshin wrote: The following series implements an executable stack protection in MIPS. It sets up a per-thread 'VDSO' page and appropriate TLB support. Page is set write-protected from user and is maintained

[PATCH v2 3/3] MIPS: set stack/data protection as non-executable

2014-10-09 Thread Leonid Yegoshin
This is a last step of 3 patches which shift FPU emulation out of stack into protected area. So, it disables a default executable stack. Additionally, it sets a default data area non-executable protection. Signed-off-by: Leonid Yegoshin --- arch/mips/include/asm/page.h |2 +- 1 files

[PATCH v2 2/3] MIPS: Setup an instruction emulation in VDSO protected page instead of user stack

2014-10-09 Thread Leonid Yegoshin
eeps stack non-executable but things fails at FPU emulation later. Here are two issues which are bind together and to solve an incorrect behaviour of GLIBC (ignoring X ssh-keygen intention) the splitting both issues is needed. So, I did a kernel emulation protected and out of stack. Signed-off-

[PATCH v2 1/3] MIPS: mips_flush_cache_range is added

2014-10-09 Thread Leonid Yegoshin
page is flushed by flush_cache_page in ptrace(). Signed-off-by: Leonid Yegoshin --- arch/mips/include/asm/cacheflush.h |3 +++ arch/mips/mm/c-octeon.c|8 +++ arch/mips/mm/c-r3k.c |8 +++ arch/mips/mm/c-r4k.c | 43

[PATCH v2 0/3] MIPS executable stack protection

2014-10-09 Thread Leonid Yegoshin
thread is rescheduled and other threads don't intervene (Peter Zijlstra) - Fixed uMIPS support (Paul Burton) - Added unwinding of VDSO emulation stack at signal handler invocation, hiding an emulation page (Andy Lutomirski note in other patch comments) --- L

Re: [PATCH resend] MIPS: Allow FPU emulator to use non-stack area.

2014-10-07 Thread Leonid Yegoshin
On 10/07/2014 12:21 PM, Rich Felker wrote: The in-stack trampoline support could be left but used only for emulating instructions the kernel doesn't know. This would make all normal binaries immediately usable with non-executable stack, and would avoid the only potential source of regressions.

Re: [PATCH resend] MIPS: Allow FPU emulator to use non-stack area.

2014-10-07 Thread Leonid Yegoshin
On 10/07/2014 12:09 PM, Rich Felker wrote: I agree completely here. We should not break things (or, as it seems, leave them broken) for common usage cases that affect everyone just to coddle proprietary vendor-specific instructions. The latter just should not be used in delay slots unless the c

Re: [PATCH resend] MIPS: Allow FPU emulator to use non-stack area.

2014-10-07 Thread Leonid Yegoshin
(repeat it because of some e-mail failure, sorry) On 10/07/2014 11:43 AM, David Daney wrote: Five lines per instruction. But you must be able to emulate them, so you need an emulator, not XOL. I feel I didn't say clear - emulation of ADDIUPC (after second look it is the only instruction requ

Re: [PATCH resend] MIPS: Allow FPU emulator to use non-stack area.

2014-10-07 Thread Leonid Yegoshin
Well, I am not a subscriber to mail-list, so I read it the first time and some notes: 1) David's approach would likely work for FPU emulation but unlikely works for MIPS Rel 2/Rel 1/ MIPS I emulation in MIPS R6 architecture. The reason is that the first MIPS R2 instruction (removed from MIPS

Re: [PATCH 2/3] MIPS: Setup an instruction emulation in VDSO protected page instead of user stack

2014-10-06 Thread Leonid Yegoshin
On 10/06/2014 05:29 AM, Paul Burton wrote: First some general questions: is there any reason to need the page used to be at the same virtual address for each thread? I can't think of one, and if that's the case then why not simply allocate a series of pages per-thread via mmap_region or similar

  1   2   >