Re: [linux-yocto] [PATCH] perf: Alias SYS_futex with SYS_futex_time64 on 32-bit arches with 64bit time_t

2020-11-16 Thread Khem Raj
Hi Bruce

Thanks, I am interested in 5.8 onwards. since that's what is in
master. Perhaps will be good to have it in dunfell versions too, but
don't sweat over it.

On Mon, Nov 16, 2020 at 5:13 PM Bruce Ashfield  wrote:
>
>
>
> On Mon, Nov 16, 2020 at 2:07 PM Khem Raj  wrote:
>>
>> glibc does not define SYS_futex for 32bit architectures using 64bit
>> time_t e.g. riscv32, therefore perf fails to compile as it does not find
>> SYS_futex in C library headers, define it to SYS_futex_time64 when it
>> exists
>
>
> I've queued this on linux-yocto.
>
> But which versions were you interested in ? I did -dev and 5.8.
>
> Bruce
>
>
>>
>>
>> Upstream-Status: Pending
>> Signed-off-by: Khem Raj 
>> ---
>>  tools/perf/bench/futex.h | 13 +
>>  1 file changed, 13 insertions(+)
>>
>> diff --git a/tools/perf/bench/futex.h b/tools/perf/bench/futex.h
>> index 31b53cc7d5bc..33f3f3230ae1 100644
>> --- a/tools/perf/bench/futex.h
>> +++ b/tools/perf/bench/futex.h
>> @@ -13,6 +13,19 @@
>>  #include 
>>  #include 
>>
>> +/**
>> + * SYS_futex is expected from system C library,
>> + * in glibc (/usr/include/bits/syscall.h defines it in terms of of NR_futex)
>> + * some newer 32bit architectures e.g. RISCV32 is using 64bit time_t from
>> + * get go unlike other 32bit architectures in glibc, therefore it wont have
>> + * NR_futex defined but just NR_futex_time64 this aliases it to NR_futex
>> + * so that SYS_futex is then defined for rv32
>> +*/
>> +
>> +#if !defined(SYS_futex) && defined(SYS_futex_time64)
>> +#define SYS_futex SYS_futex_time64
>> +#endif
>> +
>>  /**
>>   * futex() - SYS_futex syscall wrapper
>>   * @uaddr: address of first futex
>> --
>> 2.29.2
>>
>
>
> --
> - Thou shalt not follow the NULL pointer, for chaos and madness await thee at 
> its end
> - "Use the force Harry" - Gandalf, Star Trek II
>

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#9166): 
https://lists.yoctoproject.org/g/linux-yocto/message/9166
Mute This Topic: https://lists.yoctoproject.org/mt/78299646/21656
Group Owner: linux-yocto+ow...@lists.yoctoproject.org
Unsubscribe: https://lists.yoctoproject.org/g/linux-yocto/unsub 
[arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-



Re: [linux-yocto] [PATCH] perf: Alias SYS_futex with SYS_futex_time64 on 32-bit arches with 64bit time_t

2020-11-16 Thread Bruce Ashfield
On Mon, Nov 16, 2020 at 2:07 PM Khem Raj  wrote:

> glibc does not define SYS_futex for 32bit architectures using 64bit
> time_t e.g. riscv32, therefore perf fails to compile as it does not find
> SYS_futex in C library headers, define it to SYS_futex_time64 when it
> exists
>

I've queued this on linux-yocto.

But which versions were you interested in ? I did -dev and 5.8.

Bruce



>
> Upstream-Status: Pending
> Signed-off-by: Khem Raj 
> ---
>  tools/perf/bench/futex.h | 13 +
>  1 file changed, 13 insertions(+)
>
> diff --git a/tools/perf/bench/futex.h b/tools/perf/bench/futex.h
> index 31b53cc7d5bc..33f3f3230ae1 100644
> --- a/tools/perf/bench/futex.h
> +++ b/tools/perf/bench/futex.h
> @@ -13,6 +13,19 @@
>  #include 
>  #include 
>
> +/**
> + * SYS_futex is expected from system C library,
> + * in glibc (/usr/include/bits/syscall.h defines it in terms of of
> NR_futex)
> + * some newer 32bit architectures e.g. RISCV32 is using 64bit time_t from
> + * get go unlike other 32bit architectures in glibc, therefore it wont
> have
> + * NR_futex defined but just NR_futex_time64 this aliases it to NR_futex
> + * so that SYS_futex is then defined for rv32
> +*/
> +
> +#if !defined(SYS_futex) && defined(SYS_futex_time64)
> +#define SYS_futex SYS_futex_time64
> +#endif
> +
>  /**
>   * futex() - SYS_futex syscall wrapper
>   * @uaddr: address of first futex
> --
> 2.29.2
>
>

-- 
- Thou shalt not follow the NULL pointer, for chaos and madness await thee
at its end
- "Use the force Harry" - Gandalf, Star Trek II

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#9165): 
https://lists.yoctoproject.org/g/linux-yocto/message/9165
Mute This Topic: https://lists.yoctoproject.org/mt/78299646/21656
Group Owner: linux-yocto+ow...@lists.yoctoproject.org
Unsubscribe: https://lists.yoctoproject.org/g/linux-yocto/unsub 
[arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-



Re: [linux-yocto] [PATCH] perf: Alias SYS_futex with SYS_futex_time64 on 32-bit arches with 64bit time_t

2020-11-16 Thread Alistair Francis
On Mon, Nov 16, 2020 at 11:07 AM Khem Raj  wrote:
>
> glibc does not define SYS_futex for 32bit architectures using 64bit
> time_t e.g. riscv32, therefore perf fails to compile as it does not find
> SYS_futex in C library headers, define it to SYS_futex_time64 when it
> exists
>
> Upstream-Status: Pending
> Signed-off-by: Khem Raj 

Reviewed-by: Alistair Francis 

Alistair

> ---
>  tools/perf/bench/futex.h | 13 +
>  1 file changed, 13 insertions(+)
>
> diff --git a/tools/perf/bench/futex.h b/tools/perf/bench/futex.h
> index 31b53cc7d5bc..33f3f3230ae1 100644
> --- a/tools/perf/bench/futex.h
> +++ b/tools/perf/bench/futex.h
> @@ -13,6 +13,19 @@
>  #include 
>  #include 
>
> +/**
> + * SYS_futex is expected from system C library,
> + * in glibc (/usr/include/bits/syscall.h defines it in terms of of NR_futex)
> + * some newer 32bit architectures e.g. RISCV32 is using 64bit time_t from
> + * get go unlike other 32bit architectures in glibc, therefore it wont have
> + * NR_futex defined but just NR_futex_time64 this aliases it to NR_futex
> + * so that SYS_futex is then defined for rv32
> +*/
> +
> +#if !defined(SYS_futex) && defined(SYS_futex_time64)
> +#define SYS_futex SYS_futex_time64
> +#endif
> +
>  /**
>   * futex() - SYS_futex syscall wrapper
>   * @uaddr: address of first futex
> --
> 2.29.2
>

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#9164): 
https://lists.yoctoproject.org/g/linux-yocto/message/9164
Mute This Topic: https://lists.yoctoproject.org/mt/78299646/21656
Group Owner: linux-yocto+ow...@lists.yoctoproject.org
Unsubscribe: https://lists.yoctoproject.org/g/linux-yocto/unsub 
[arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-



[linux-yocto] [yocto-kernel-cache master PATCH] meta: Add CONFIG_SERIAL_OF_PLATFORM to 8250.cfg

2020-11-16 Thread Vasyl Vavrychuk
On some embedded systems 8250 compatible serial ports meant to be
defined in devicetree. Config SERIAL_OF_PLATFORM enables probing of
them.

Signed-off-by: Vasyl Vavrychuk 
---
 cfg/8250.cfg | 1 +
 1 file changed, 1 insertion(+)

diff --git a/cfg/8250.cfg b/cfg/8250.cfg
index fe2d270c..403c736e 100644
--- a/cfg/8250.cfg
+++ b/cfg/8250.cfg
@@ -7,3 +7,4 @@ CONFIG_SERIAL_8250_NR_UARTS=4
 CONFIG_SERIAL_8250_RUNTIME_UARTS=4
 CONFIG_SERIAL_CORE=y
 CONFIG_SERIAL_CORE_CONSOLE=y
+CONFIG_SERIAL_OF_PLATFORM=y
--
2.23.0


Please mind our privacy 
notice
 pursuant to Art. 13 GDPR. // Unsere Hinweise zum Datenschutz gem. Art. 13 
DSGVO finden Sie 
hier.

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#9163): 
https://lists.yoctoproject.org/g/linux-yocto/message/9163
Mute This Topic: https://lists.yoctoproject.org/mt/78302000/21656
Group Owner: linux-yocto+ow...@lists.yoctoproject.org
Unsubscribe: https://lists.yoctoproject.org/g/linux-yocto/unsub 
[arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-



[linux-yocto] [PATCH] perf: Alias SYS_futex with SYS_futex_time64 on 32-bit arches with 64bit time_t

2020-11-16 Thread Khem Raj
glibc does not define SYS_futex for 32bit architectures using 64bit
time_t e.g. riscv32, therefore perf fails to compile as it does not find
SYS_futex in C library headers, define it to SYS_futex_time64 when it
exists

Upstream-Status: Pending
Signed-off-by: Khem Raj 
---
 tools/perf/bench/futex.h | 13 +
 1 file changed, 13 insertions(+)

diff --git a/tools/perf/bench/futex.h b/tools/perf/bench/futex.h
index 31b53cc7d5bc..33f3f3230ae1 100644
--- a/tools/perf/bench/futex.h
+++ b/tools/perf/bench/futex.h
@@ -13,6 +13,19 @@
 #include 
 #include 
 
+/**
+ * SYS_futex is expected from system C library,
+ * in glibc (/usr/include/bits/syscall.h defines it in terms of of NR_futex)
+ * some newer 32bit architectures e.g. RISCV32 is using 64bit time_t from
+ * get go unlike other 32bit architectures in glibc, therefore it wont have
+ * NR_futex defined but just NR_futex_time64 this aliases it to NR_futex
+ * so that SYS_futex is then defined for rv32
+*/
+
+#if !defined(SYS_futex) && defined(SYS_futex_time64)
+#define SYS_futex SYS_futex_time64
+#endif
+
 /**
  * futex() - SYS_futex syscall wrapper
  * @uaddr: address of first futex
-- 
2.29.2


-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#9162): 
https://lists.yoctoproject.org/g/linux-yocto/message/9162
Mute This Topic: https://lists.yoctoproject.org/mt/78299646/21656
Group Owner: linux-yocto+ow...@lists.yoctoproject.org
Unsubscribe: https://lists.yoctoproject.org/g/linux-yocto/unsub 
[arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-



[linux-yocto][v4.19/standard/preempt-rt/base][PATCH] sched/core: Fix CPU offline/online process

2020-11-16 Thread Daniel Dragomir
From: Daniel Dragomir 

This error was introduced in commit d02636e8d3 ("Merge branch
'v4.19/standard/base' into v4.19/standard/preempt-rt/base")
when a merge conflict has overwrited the changes from commit
373491f1f4 ("sched/core: Fix illegal RCU from offline CPUs").

This BUG occurs when running cpu_hotplug_stress testcase from
KTS or when stressing one CPU by switching it online/offline
(echo 0 and 1 in /sys/devices/system/cpu/cpu0/online).

kernel BUG at kernel/fork.c:633!
Internal error: Oops - BUG: 0 [#1] PREEMPT SMP
Modules linked in:
Process sh (pid: 2016, stack limit = 0xca5ad524)
CPU: 10 PID: 2016 Comm: sh Not tainted 4.19.131-rt30 axxia_gen2
Hardware name: AXM56xx Victoria (DT)
pstate: 6005 (nZCv daif -PAN -UAO)
pc : __mmdrop+0x120/0x138
lr : finish_cpu+0x68/0x70
sp : ff8012153a40
x29: ff8012153a40 x28: ffc07b389e00
x27:  x26: 00407610f000
x25: ffc07ee62ee0 x24: 
x23: ff80080dfc20 x22: ff8008d9a9d8
x21: ff8008d53ee0 x20: 0055
x19: ff8008dc1b58 x18: 0001
x17:  x16: 
x15:  x14: ff8008d89688
x13: ff8088d918d7 x12: ff8008d918e0
x11: ff8008da4000 x10: ff8012153a00
x9 : ffd0 x8 : ff80121539d0
x7 :  x6 : 0001
x5 : fffb x4 : 0030
x3 : 0030 x2 : ff8008dc1b58
x1 : ff8008dc1ba4 x0 : ff8008dc1b58
Call trace:
 __mmdrop+0x120/0x138
 finish_cpu+0x68/0x70
 cpuhp_invoke_callback+0xa8/0x800
 _cpu_down+0x100/0x220
 do_cpu_down+0x48/0x70
 cpu_down+0x24/0x30
 cpu_subsys_offline+0x20/0x30
 device_offline+0xa4/0xd0
 online_store+0x60/0xc0
 dev_attr_store+0x44/0x60
 sysfs_kf_write+0x5c/0x78
 kernfs_fop_write+0xd8/0x1d0
 __vfs_write+0x60/0x178
 vfs_write+0xac/0x1b0
 ksys_write+0x74/0xe8
 __arm64_sys_write+0x24/0x30
 el0_svc_common+0xa4/0x1a0
 el0_svc_compat_handler+0x30/0x40
 el0_svc_compat+0x8/0x18
 Code: a94153f3 a9425bf5 a8c37bfd d65f03c0 (d421)
---[ end trace 0002 ]---
BUG: Bad rss-counter state mm:1136ddcb idx:0 val:1012
BUG: Bad rss-counter state mm:1136ddcb idx:1 val:5902
BUG: non-zero pgtables_bytes on freeing mm: 180224

Signed-off-by: Daniel Dragomir 
---
 kernel/sched/core.c | 7 ++-
 1 file changed, 2 insertions(+), 5 deletions(-)

diff --git a/kernel/sched/core.c b/kernel/sched/core.c
index 218b93a..c62dbf9 100644
--- a/kernel/sched/core.c
+++ b/kernel/sched/core.c
@@ -5702,11 +5702,8 @@ void idle_task_exit(void)
switch_mm(mm, _mm, current);
finish_arch_post_lock_switch();
}
-   /*
-* Defer the cleanup to an alive cpu. On RT we can neither
-* call mmdrop() nor mmdrop_delayed() from here.
-*/
-   per_cpu(idle_last_mm, smp_processor_id()) = mm;
+
+   /* finish_cpu(), as ran on the BP, will clean up the active_mm state */
 }
 
 /*
-- 
2.7.4


-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#9160): 
https://lists.yoctoproject.org/g/linux-yocto/message/9160
Mute This Topic: https://lists.yoctoproject.org/mt/78299586/21656
Group Owner: linux-yocto+ow...@lists.yoctoproject.org
Unsubscribe: https://lists.yoctoproject.org/g/linux-yocto/unsub 
[arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-



[linux-yocto][v4.19/standard/preempt-rt/base][PATCH] net: core: Fix dead loop on virtual device lo

2020-11-16 Thread Daniel Dragomir
From: Daniel Dragomir 

Multiple alarming messages are shown on running tcp bandwidth test
from lmbench suite and the test fails with timeout:
Dead loop on virtual device lo, fix it urgently!

The cause for this failure is commit edbe65322391 ("net: place xmit
recursion in softnet data") which overwrites some preempt-rt specific
changes (PREEMPT_RT_FULL) from commit 7963359759cb ("net: move
xmit_recursion to per-task variable on -RT ").

The original version for commit edbe65322391 from kernel.org:
https://lkml.org/lkml/2020/6/29/1000

Signed-off-by: Daniel Dragomir 
---
 net/core/dev.c | 4 
 1 file changed, 4 insertions(+)

diff --git a/net/core/dev.c b/net/core/dev.c
index 6f7e36e..1734396 100644
--- a/net/core/dev.c
+++ b/net/core/dev.c
@@ -3834,7 +3834,11 @@ static int __dev_queue_xmit(struct sk_buff *skb, struct 
net_device *sb_dev)
if (dev->flags & IFF_UP) {
int cpu = smp_processor_id(); /* ok because BHs are off */
 
+#ifdef CONFIG_PREEMPT_RT_FULL
+   if (txq->xmit_lock_owner != current) {
+#else
if (txq->xmit_lock_owner != cpu) {
+#endif
if (dev_xmit_recursion())
goto recursion_alert;
 
-- 
2.7.4


-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#9161): 
https://lists.yoctoproject.org/g/linux-yocto/message/9161
Mute This Topic: https://lists.yoctoproject.org/mt/78299587/21656
Group Owner: linux-yocto+ow...@lists.yoctoproject.org
Unsubscribe: https://lists.yoctoproject.org/g/linux-yocto/unsub 
[arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-