[PATCH] ARC: add hugetlb definitions

2023-12-13 Thread Pavel Kozlov
From: Pavel Kozlov Add hugetlb definitions if THP enabled. ARC doesn't support HugeTLB FS but it supports THP. Some kernel code such as pagemap uses hugetlb definitions with THP. This patch fixes ARC build issue (HPAGE_SIZE undeclared error) with TRANSPARENT_HUGEPAGE enabled. Signed-off

Re: [PATCH 0/5] ARC updates

2023-12-11 Thread Pavel . Kozlov
Hi Vineet, > A pile of accrued changes, compile tested only. > Please test. > Thx, > -Vineet I'm testing you patches. At first glance everything is fine, no obvious regressions. But I've found an ARC build issue with the latest upstream source (tag: v6.7-rc5). It is not linked with your

Re: [PATCH 00/20] ARC updates

2023-08-22 Thread Pavel Kozlov
> -Vineet The entire "ARC updates" patch series (with all subsequent patches with updates) has been tested on the HSDK borard for ARCv2 using the glibc and ksefltest test framworks and on nSIM for ARCompact using the uclibc tests. No regressions found.

Re: [PATCH 16/20] ARC: entry: Add more common chores to EXCEPTION_PROLOGUE

2023-08-18 Thread Pavel . Kozlov
Hi Vineet, > Subject: [PATCH 16/20] ARC: entry: Add more common chores to > EXCEPTION_PROLOGUE > > THe high level structure of most ARC exception handlers is > 1. save regfile with EXCEPTION_PROLOGUE > 2. setup r0: EFA (not part of pt_regs) > 3. setup r1: pointer to pt_regs (SP) > 4.

Re: [PATCH 20/20] ARC: pt_regs: create seperate type for ecr

2023-08-17 Thread Pavel . Kozlov
Hi Vineet, I'm testing your updates and ran into the same build issue reported by the build robot. http://lists.infradead.org/pipermail/linux-snps-arc/2023-August/007522.html > #ifdef CONFIG_ISA_ARCOMPACT > @@ -40,18 +51,7 @@ struct pt_regs { > *Last word used by Linux for

[PATCH] ARC: avoid unwanted gcc optimizations in atomic operations

2023-08-15 Thread Pavel . Kozlov
From: Pavel Kozlov Notify a compiler about write operations and prevent unwanted optimizations. Add the "memory" clobber to the clobber list. An obvious problem with unwanted compiler optimizations appeared after the cpumask optimization commit 596ff4a09b89 ("cpumask: re-int

[PATCH 2/2] ARC: run child from the separate start block in __clone

2023-03-02 Thread Pavel . Kozlov
From: Pavel Kozlov For better debug experience use separate code block with extra cfi_* directives to run child (same as in __clone3). --- sysdeps/unix/sysv/linux/arc/clone.S | 40 ++--- 1 file changed, 25 insertions(+), 15 deletions(-) diff --git a/sysdeps/unix/sysv

[PATCH 1/2] ARC: Add the clone3 wrapper

2023-03-02 Thread Pavel . Kozlov
From: Pavel Kozlov Use the clone3 wrapper on ARC. It doesn't care about stack alignment. All callers should provide an aligned stack. It follows the internal signature: extern int clone3 (struct clone_args *__cl_args, size_t __size, int (*__func) (void *__arg), void *__arg); --- Checked on arc

Pavel new maintainer of ARC port

2023-02-21 Thread Pavel Kozlov
to the community. I'm always looking for opportunities to connect with other developers and learn from their experiences. As a final step of setup, I've updated wiki and added myself as ARC maintainer. Also, thanks Carlos, for help with my setup. Best regards, Pavel Kozlov

[PATCH] ARC: fix compile time assert fail for the config with PAE40 and 4K pages

2023-02-10 Thread Pavel . Kozlov
From: Pavel Kozlov Add support for the configuration with 4K Page Size and enabled ARC_PAE40. Set two-level Page Table to 10:9:12, as with PAE40 a 4k page can settle only 512 entries (with PAE40 size of PTE entry increases from 4 to 8 bytes). In this configuration the Page Table can describe

Re: Pavel steping up for ARC glibc maintenance

2023-02-01 Thread Pavel Kozlov
verification or review will be required, all concerning ARC. I've requested the sourceware.org account. Looking forward to the next steps. Thank you, Pavel From: Carlos O'Donell Sent: Wednesday, February 1, 2023 12:33 AM To: Vineet Gupta Cc: arcml ; Pavel Kozlov ; GNU C Library Subject: Re

Re: [PATCH] ARC: align child stack in clone

2023-01-25 Thread Pavel Kozlov
> LGTM, although I can't really test it since the Synopsys qemu tree does not > have qemu-user support [1]. Thank you for the review. I've checked this patch on QEMU with Linux system and on the ARC HSDK board. Also, I can say that it is possible to run ARC binaries on QEMU [1] in user mode.

Re: [PATCH] ARC:fpu: add extra capability check before use of sqrt and fma builtins

2023-01-17 Thread Pavel Kozlov
> This is wrong, sqrt use macro do not belong for the fma switch file. Thank you for the review and your notice. I was inattentive when moving changes from the branch I had. This has been fixed in v2 of the patch [1]. I've manually checked (by objdump -d output review) that now expected code

[PATCH v2] ARC:fpu: add extra capability check before use of sqrt and fma builtins

2023-01-17 Thread Pavel . Kozlov
From: Pavel Kozlov Add extra check for compiler definitions to ensure that compiler provides sqrt and fma hw fpu instructions else use software implementation. As divide/sqrt and FMA hw support from CPU side is optional, the compiler can be configured by options to generate hw FPU instructions

[PATCH] ARC:fpu: add extra capability check before use of sqrt and fma builtins

2022-12-21 Thread Pavel . Kozlov
From: Pavel Kozlov Add extra check for compiler definitions to ensure that compiler provides sqrt and fma hw fpu instructions else use software implementation. As divide/sqrt and FMA hw support from CPU side is optional, the compiler can be configured by options to generate hw FPU instructions

[PATCH] ARC: align child stack in clone

2022-12-21 Thread Pavel . Kozlov
From: Pavel Kozlov The ARCv2 ABI requires 4 byte stack pointer alignment. Don't allow to use unaligned child stack in clone. As the stack grows down, align it down. This was pointed by misc/tst-misalign-clone-internal and misc/tst-misalign-clone tests. Stack alignmet fixes these tests fails

Re: [PATCH] ARC: mm: fix leakage of memory allocated for PTE

2022-10-19 Thread Pavel Kozlov
> Good catch. Curious how did you find it. KMEMCHECK or some such or just oom. I've run glibc tests with 5.16 kernel and got many oom-killer messages and even kernel panic because lack of memory. These symptoms pointed to an issue. kmemleak didn't show anything. Didn't try kmemcheck. I

[PATCH] ARC: mm: fix leakage of memory allocated for PTE

2022-10-17 Thread Pavel . Kozlov
From: Pavel Kozlov Since commit d9820ff ("ARC: mm: switch pgtable_t back to struct page *") a memory leakage problem occurs. Memory allocated for page table entries not released during process termination. This issue can be reproduced by a small program that allocates a large amount