[linux-yocto][linux-yocto v6.1/standard/preempt-rt/base][PATCH] aufs: i_op: Add handling for au_pin_hdir_set_owner with RT kernel

2024-01-05 Thread He Zhe via lists.yoctoproject.org
In RT kernel rw_semaphore uses rt_mutex whose owner should be set to the
task. Add a condition to handle both cases to avoid the following build error
for PREEMPT_RT kernel.

fs/aufs/i_op.c: In function 'au_pin_hdir_set_owner':
fs/aufs/i_op.c:639:52: error: 'struct rw_semaphore' has no member named 'owner'
639 | atomic_long_set(>hdir->hi_inode->i_rwsem.owner, (long)task);

Signed-off-by: He Zhe 
---
 fs/aufs/i_op.c | 4 
 1 file changed, 4 insertions(+)

diff --git a/fs/aufs/i_op.c b/fs/aufs/i_op.c
index a2416992a593..532382c880d8 100644
--- a/fs/aufs/i_op.c
+++ b/fs/aufs/i_op.c
@@ -636,7 +636,11 @@ int au_pin_hdir_relock(struct au_pin *p)
 
 static void au_pin_hdir_set_owner(struct au_pin *p, struct task_struct *task)
 {
+#if IS_ENABLED(CONFIG_PREEMPT_RT)
+   p->hdir->hi_inode->i_rwsem.rwbase.rtmutex.owner = task;
+#else
atomic_long_set(>hdir->hi_inode->i_rwsem.owner, (long)task);
+#endif
 }
 
 void au_pin_hdir_acquire_nest(struct au_pin *p)
-- 
2.35.5


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



[linux-yocto][linux-yocto v6.1/standard/base][PATCH] mtd_blkdevs: add mtd_table_mutex lock back to blktrans_{open, release} to avoid race condition

2023-05-31 Thread He Zhe via lists.yoctoproject.org
From: LiweiSong 

without lock mtd_table_mutex in blktrans_{open, release}, there will
be a race condition when access devices /dev/mtd1 and /dev/mtdblock1
at the same time with a high frequency open and close test:

kernel BUG at drivers/mtd/mtdcore.c:1221!
Internal error: Oops - BUG: 0 1 PREEMPT_RT SMP
CPU: 0 PID: 15349 Comm: mtd-test Not tainted 5.15.52-rt41-yocto-preempt-rt #1
Hardware name: SoCFPGA Stratix 10 SoCDK (DT)
pstate: 6005put_mtd_device+0x4c/0x84
lr : blktrans_release+0xb0/0x120
Call trace:
__put_mtd_device+0x4c/0x84
blktrans_release+0xb0/0x120
blkdev_put+0xd4/0x210
blkdev_close+0x34/0x50
__fput+0x8c/0x240
fput+0x1c/0x30
task_work_run+0x98/00t_64_sync_handler+0xa4/0x130
el0t_64_sync+0x1a0/0x1a4

since the original purpose of commit 799ae31c58ae ("mtd_blkdevs:
don't hold del_mtd_blktrans_dev in blktrans_{open, release}") is
to fix a DEADLOCK issue, here convert mutex_lock to mutex_trylock
and return immediately if failed acquire mtd_table_mutex, then
both race condition and DEADLOCK can be avoided.

Fixes: 799ae31c58ae ("mtd_blkdevs: don't hold del_mtd_blktrans_dev in 
blktrans_{open, release}")
Signed-off-by: Liwei Song 
Signed-off-by: He Zhe 
---

This was merged last year, we might still need this. I have built and run on 
qemux86-64.
https://lists.yoctoproject.org/g/linux-yocto/message/11641

The original mainline link. Haven't change ever since
https://lore.kernel.org/lkml/4910c707-ad97-362f-911a-79e438e6e...@windriver.com/


 drivers/mtd/mtd_blkdevs.c | 7 +++
 1 file changed, 7 insertions(+)

diff --git a/drivers/mtd/mtd_blkdevs.c b/drivers/mtd/mtd_blkdevs.c
index 60b222799871..31967ff4b826 100644
--- a/drivers/mtd/mtd_blkdevs.c
+++ b/drivers/mtd/mtd_blkdevs.c
@@ -189,6 +189,8 @@ static int blktrans_open(struct block_device *bdev, fmode_t 
mode)
 
kref_get(>ref);
 
+   if (!mutex_trylock(_table_mutex))
+   return ret;
mutex_lock(>lock);
 
if (dev->open)
@@ -213,6 +215,7 @@ static int blktrans_open(struct block_device *bdev, fmode_t 
mode)
 unlock:
dev->open++;
mutex_unlock(>lock);
+   mutex_unlock(_table_mutex);
return ret;
 
 error_release:
@@ -221,6 +224,7 @@ static int blktrans_open(struct block_device *bdev, fmode_t 
mode)
 error_put:
module_put(dev->tr->owner);
mutex_unlock(>lock);
+   mutex_unlock(_table_mutex);
blktrans_dev_put(dev);
return ret;
 }
@@ -229,6 +233,8 @@ static void blktrans_release(struct gendisk *disk, fmode_t 
mode)
 {
struct mtd_blktrans_dev *dev = disk->private_data;
 
+   if (!mutex_trylock(_table_mutex))
+   return;
mutex_lock(>lock);
 
if (--dev->open)
@@ -243,6 +249,7 @@ static void blktrans_release(struct gendisk *disk, fmode_t 
mode)
}
 unlock:
mutex_unlock(>lock);
+   mutex_unlock(_table_mutex);
blktrans_dev_put(dev);
 }
 
-- 
2.35.5


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



[linux-yocto][linux-yocto v6.1/standard/base][PATCH] yaffs2: Fix miscalculation of devname buffer length

2023-05-31 Thread He Zhe via lists.yoctoproject.org
The following build warning helps us find a real mishandling of array length.

fs/yaffs2/yaffs_vfs.c:122:29: warning: argument to 'sizeof' in 'snprintf' call
is the same expression as the destination; did you mean to provide an explicit
length? [-Wsizeof-pointer-memaccess]

If an array is passed as a function parameter it'll be treated as a simple
pointer and thus sizeof will return the length of a pointer rather than the
length of the array.

Add and pass the buffer length to make it work correctly.

Signed-off-by: He Zhe 
---
 fs/yaffs2/yaffs_vfs.c | 10 +-
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/fs/yaffs2/yaffs_vfs.c b/fs/yaffs2/yaffs_vfs.c
index 140f7aa7a1a1..e9e29a41a680 100644
--- a/fs/yaffs2/yaffs_vfs.c
+++ b/fs/yaffs2/yaffs_vfs.c
@@ -118,8 +118,8 @@
 
 /* FIXME: use sb->s_id instead ? */
 //#define yaffs_devname(sb, buf) bdevname(sb->s_bdev, buf)
-static inline char* yaffs_devname(struct super_block *sb, char *buf) {
-   snprintf(buf, sizeof(buf), "%pg", sb->s_bdev);
+static inline char* yaffs_devname(struct super_block *sb, char *buf, unsigned 
long len) {
+   snprintf(buf, len, "%pg", sb->s_bdev);
return buf;
 }
 
@@ -2944,12 +2944,12 @@ static struct super_block 
*yaffs_internal_read_super(int yaffs_version,
 
if (!sb->s_dev)
printk(KERN_INFO "yaffs: sb->s_dev is NULL\n");
-   else if (!yaffs_devname(sb, devname_buf))
+   else if (!yaffs_devname(sb, devname_buf, sizeof(devname_buf)))
printk(KERN_INFO "yaffs: devname is NULL\n");
else
printk(KERN_INFO "yaffs: dev is %d name is \"%s\" %s\n",
   sb->s_dev,
-  yaffs_devname(sb, devname_buf), read_only ? "ro" : "rw");
+  yaffs_devname(sb, devname_buf, sizeof(devname_buf)), 
read_only ? "ro" : "rw");
 
if (!data_str)
data_str = "";
@@ -2974,7 +2974,7 @@ static struct super_block *yaffs_internal_read_super(int 
yaffs_version,
yaffs_trace(YAFFS_TRACE_ALWAYS,
"yaffs: Attempting MTD mount of %u.%u,\"%s\"",
MAJOR(sb->s_dev), MINOR(sb->s_dev),
-   yaffs_devname(sb, devname_buf));
+   yaffs_devname(sb, devname_buf, sizeof(devname_buf)));
 
 
mtd = yaffs_get_mtd_device(sb->s_dev);
-- 
2.35.5


-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#12670): 
https://lists.yoctoproject.org/g/linux-yocto/message/12670
Mute This Topic: https://lists.yoctoproject.org/mt/99236577/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] yaffs_vfs warning

2023-05-30 Thread He Zhe via lists.yoctoproject.org


On 5/30/23 21:35, Bruce Ashfield wrote:
> On Mon, May 29, 2023 at 11:41 PM He Zhe  wrote:
>> Sorry for messy encoding...
>>
>>
>> We met the following warning when build linux-yocto v6.1, introduced by 
>> latter diff. It perhaps miscalculates the buf length.
> Are you only seeing it with gcc-13 ?
>
> That fix follows the same pattern as many other parts of the kernel,
> and checking the 6.1 branch, those other subsystems still have similar
> sprintf() changes in place:
>
> i.e.:
>
> switch (cmd) {
> case BLKTRACESETUP:
> snprintf(b, sizeof(b), "%pg", bdev);

The problem is when array is passed as function parameter it'll be treated as a
simple pointer and thus sizeof will return the length of a pointer. This is the
warning is about.

But this doesn't apply to the above case since it passes array directly to
sizeof.

>
> So I don't see a miscalculation of the buffer length in the snippet
> you have below.
>
> The callers of yaffs_devname declare "buf" to be a char array, just as
> the other kernel references I mentioned do. The different being that
> yaffs_devname is an inline function, where the other reference changes
> are not.
>
> What happens if you take the code from the inline function and
> implement it in the calling function, does the warning go away ?

I did a quick test piggybacking print_unknown_bootoptions in init/main.c

static inline char* test_decay(char *buf) {
    printk("sizeof(buf) is %lu", sizeof(buf));
    snprintf(buf, sizeof(buf), "test_decay");
    return buf;
}

static void __init print_unknown_bootoptions(void)
{
    char *unknown_options;
    char *end;
    const char *const *p;
    size_t len;
    char buf[16];   
 

    test_decay(buf);
...

During build we got:
build/tmp-glibc/work-shared/qemux86-64/kernel-source/init/main.c:895:29: 
warning: argument to 'sizeof' in 'snprintf' call is the same expression as the 
destination; did you mean to provide an explicit length? 
[-Wsizeof-pointer-memaccess]
  895 | snprintf(buf, sizeof(buf), "test_decay");
  |

During boot we got:
...
[    0.00] sizeof(buf) is 8
...


I'll send a patch later.

Zhe

>
> Bruce
>
>> fs/yaffs2/yaffs_vfs.c:122:29: warning: argument to 'sizeof' in 'snprintf' 
>> call is the same expression as the destination; did you mean to provide an 
>> explicit length? [-Wsizeof-pointer-memaccess]
>>
>> --- a/fs/yaffs2/yaffs_vfs.c
>> +++ b/fs/yaffs2/yaffs_vfs.c
>> @@ -117,7 +117,11 @@
>>  #define Page_Uptodate(page) test_bit(PG_uptodate, &(page)->flags)
>>
>>  /* FIXME: use sb->s_id instead ? */
>> -#define yaffs_devname(sb, buf) bdevname(sb->s_bdev, buf)
>> +//#define yaffs_devname(sb, buf) bdevname(sb->s_bdev, buf)
>> +static inline char* yaffs_devname(struct super_block *sb, char *buf) {
>> +   snprintf(buf, sizeof(buf), "%pg", sb->s_bdev);
>> +   return buf;
>> +}
>>
>>  #else
>>
>>
>>
>> Thanks,
>> Zhe
>>
>> On 5/30/23 11:34, He Zhe via lists.yoctoproject.org wrote:
>>> |Hi Bruce, We met the following warning when build linux-yocto v6.1, 
>>> introduced by latter diff. It perhaps miscalculates the buf length. 
>>> fs/yaffs2/yaffs_vfs.c:122:29: warning: argument to 'sizeof' in 'snprintf' 
>>> call is the same expression as the destination; did you mean to provide an 
>>> explicit length? [-Wsizeof-pointer-memaccess] --- a/fs/yaffs2/yaffs_vfs.c 
>>> +++ b/fs/yaffs2/yaffs_vfs.c @@ -117,7 +117,11 @@  #define 
>>> Page_Uptodate(page) test_bit(PG_uptodate, &(page)->flags)/* FIXME: use 
>>> sb->s_id instead ? */ -#define yaffs_devname(sb, buf) bdevname(sb->s_bdev, 
>>> buf) +//#define yaffs_devname(sb, buf) bdevname(sb->s_bdev, buf) +static 
>>> inline char* yaffs_devname(struct super_block *sb, char *buf) { +   
>>> snprintf(buf, sizeof(buf), "%pg", sb->s_bdev); +   return buf; +}
>>> #else   Thanks, Zhe |
>>>
>>>
>>>
>>>
>
>
> 
>


-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#12669): 
https://lists.yoctoproject.org/g/linux-yocto/message/12669
Mute This Topic: https://lists.yoctoproject.org/mt/99213494/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] yaffs_vfs warning

2023-05-29 Thread He Zhe via lists.yoctoproject.org
Sorry for messy encoding...


We met the following warning when build linux-yocto v6.1, introduced by latter 
diff. It perhaps miscalculates the buf length.

fs/yaffs2/yaffs_vfs.c:122:29: warning: argument to 'sizeof' in 'snprintf' call 
is the same expression as the destination; did you mean to provide an explicit 
length? [-Wsizeof-pointer-memaccess]

--- a/fs/yaffs2/yaffs_vfs.c
+++ b/fs/yaffs2/yaffs_vfs.c
@@ -117,7 +117,11 @@
 #define Page_Uptodate(page) test_bit(PG_uptodate, &(page)->flags)
 
 /* FIXME: use sb->s_id instead ? */
-#define yaffs_devname(sb, buf) bdevname(sb->s_bdev, buf)
+//#define yaffs_devname(sb, buf) bdevname(sb->s_bdev, buf)
+static inline char* yaffs_devname(struct super_block *sb, char *buf) {
+   snprintf(buf, sizeof(buf), "%pg", sb->s_bdev);
+   return buf;
+}
 
 #else
 


Thanks,
Zhe

On 5/30/23 11:34, He Zhe via lists.yoctoproject.org wrote:
> |Hi Bruce, We met the following warning when build linux-yocto v6.1, 
> introduced by latter diff. It perhaps miscalculates the buf length. 
> fs/yaffs2/yaffs_vfs.c:122:29: warning: argument to 'sizeof' in 'snprintf' 
> call is the same expression as the destination; did you mean to provide an 
> explicit length? [-Wsizeof-pointer-memaccess] --- a/fs/yaffs2/yaffs_vfs.c +++ 
> b/fs/yaffs2/yaffs_vfs.c @@ -117,7 +117,11 @@  #define Page_Uptodate(page) 
> test_bit(PG_uptodate, &(page)->flags)    /* FIXME: use sb->s_id instead ? */ 
> -#define yaffs_devname(sb, buf) bdevname(sb->s_bdev, buf) +//#define 
> yaffs_devname(sb, buf) bdevname(sb->s_bdev, buf) +static inline char* 
> yaffs_devname(struct super_block *sb, char *buf) { +   snprintf(buf, 
> sizeof(buf), "%pg", sb->s_bdev); +   return buf; +}    #else   Thanks, 
> Zhe |
>
>
> 
>


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



[linux-yocto] yaffs_vfs warning

2023-05-29 Thread He Zhe via lists.yoctoproject.org
|Hi Bruce, We met the following warning when build linux-yocto v6.1, introduced 
by latter diff. It perhaps miscalculates the buf length. 
fs/yaffs2/yaffs_vfs.c:122:29: warning: argument to 'sizeof' in 'snprintf' call 
is the same expression as the destination; did you mean to provide an explicit 
length? [-Wsizeof-pointer-memaccess] --- a/fs/yaffs2/yaffs_vfs.c +++ 
b/fs/yaffs2/yaffs_vfs.c @@ -117,7 +117,11 @@  #define Page_Uptodate(page) 
test_bit(PG_uptodate, &(page)->flags)    /* FIXME: use sb->s_id instead ? */ 
-#define yaffs_devname(sb, buf) bdevname(sb->s_bdev, buf) +//#define 
yaffs_devname(sb, buf) bdevname(sb->s_bdev, buf) +static inline char* 
yaffs_devname(struct super_block *sb, char *buf) { +   snprintf(buf, 
sizeof(buf), "%pg", sb->s_bdev); +   return buf; +}    #else   Thanks, Zhe |


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



[linux-yocto][v5.15/standard/base][PATCH] squashfs: provide backing_dev_info in order to disable read-ahead

2022-12-07 Thread He Zhe
From: Zheng Liang 

commit 9eec1d897139e5de287af5d559a02b811b844d82 upstream.

Commit c1f6925e1091 ("mm: put readahead pages in cache earlier") causes
the read performance of squashfs to deteriorate.Through testing, we find
that the performance will be back by closing the readahead of squashfs.

So we want to learn the way of ubifs, provides backing_dev_info and
disable read-ahead

We tested the following data by fio.
squashfs image blocksize=128K
test command:

  fio --name basic --bs=? --filename="/mnt/test_file" --rw=? --iodepth=1 
--ioengine=psync --runtime=200 --time_based

  turn on squashfs readahead in 5.10 kernel
  bs(k)  read/randread   MB/s
  4randread  271
  128  randread  231
  1024 randread  246
  4read  310
  128  read  245
  1024 read  247

  turn off squashfs readahead in 5.10 kernel
  bs(k)  read/randread   MB/s
  4randread  293
  128  randread  330
  1024 randread  363
  4read  338
  128  read  360
  1024 read  365

  turn on squashfs readahead and revert the
  commit c1f6925e1091("mm: put readahead
  pages in cache earlier") in 5.10 kernel
  bs(k)  read/randread   MB/s
  4   randread   289
  128 randread   306
  1024randread   335
  4   read   337
  128 read   336
  1024read   338

Link: https://lkml.kernel.org/r/2026113141.1391026-1-zhenglia...@huawei.com
Signed-off-by: Zheng Liang 
Reviewed-by: Phillip Lougher 
Cc: Zhang Yi 
Cc: Hou Tao 
Cc: Miao Xie 
Signed-off-by: Andrew Morton 
Signed-off-by: Linus Torvalds 

This patch can fix a severe disk read degradation on squashfs, which is observed
in our customer's environment.

Signed-off-by: He Zhe 
---
 fs/squashfs/super.c | 33 +
 1 file changed, 33 insertions(+)

diff --git a/fs/squashfs/super.c b/fs/squashfs/super.c
index 60d6951915f4..4e5d3ec0a521 100644
--- a/fs/squashfs/super.c
+++ b/fs/squashfs/super.c
@@ -28,6 +28,7 @@
 #include 
 #include 
 #include 
+#include 
 
 #include "squashfs_fs.h"
 #include "squashfs_fs_sb.h"
@@ -111,6 +112,24 @@ static const struct squashfs_decompressor 
*supported_squashfs_filesystem(
return decompressor;
 }
 
+static int squashfs_bdi_init(struct super_block *sb)
+{
+   int err;
+   unsigned int major = MAJOR(sb->s_dev);
+   unsigned int minor = MINOR(sb->s_dev);
+
+   bdi_put(sb->s_bdi);
+   sb->s_bdi = _backing_dev_info;
+
+   err = super_setup_bdi_name(sb, "squashfs_%u_%u", major, minor);
+   if (err)
+   return err;
+
+   sb->s_bdi->ra_pages = 0;
+   sb->s_bdi->io_pages = 0;
+
+   return 0;
+}
 
 static int squashfs_fill_super(struct super_block *sb, struct fs_context *fc)
 {
@@ -126,6 +145,20 @@ static int squashfs_fill_super(struct super_block *sb, 
struct fs_context *fc)
 
TRACE("Entered squashfs_fill_superblock\n");
 
+   /*
+* squashfs provides 'backing_dev_info' in order to disable read-ahead. 
For
+* squashfs, I/O is not deferred, it is done immediately in readpage,
+* which means the user would always have to wait their own I/O. So the 
effect
+* of readahead is very weak for squashfs. squashfs_bdi_init will set
+* sb->s_bdi->ra_pages and sb->s_bdi->io_pages to 0 and close readahead 
for
+* squashfs.
+*/
+   err = squashfs_bdi_init(sb);
+   if (err) {
+   errorf(fc, "squashfs init bdi failed");
+   return err;
+   }
+
sb->s_fs_info = kzalloc(sizeof(*msblk), GFP_KERNEL);
if (sb->s_fs_info == NULL) {
ERROR("Failed to allocate squashfs_sb_info\n");
-- 
2.17.1


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



[linux-yocto] merge issue of arch/arm/boot/dts/imx6sx.dtsi on v5.15/standard/nxp-sdk-5.15/nxp-soc

2022-11-06 Thread He Zhe
Hi Bruce,

There is merge issue causing build failure on 
v5.15/standard/nxp-sdk-5.15/nxp-soc. Seems the HEAD should be kept.
https://git.yoctoproject.org/linux-yocto/tree/arch/arm/boot/dts/imx6sx.dtsi?h=v5.15/standard/nxp-sdk-5.15/nxp-soc#n218

arch/arm/boot/dts/imx6sx.dtsi:218.1-3 syntax error
FATAL ERROR: Unable to parse input tree

Zhe


-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#11849): 
https://lists.yoctoproject.org/g/linux-yocto/message/11849
Mute This Topic: https://lists.yoctoproject.org/mt/94860151/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][linux-ycoto v5.15/standard/preempt-rt/nxp-sdk-5.15/nxp-soc & v5.15/standard/nxp-sdk-5.15/nxp-soc][PATCH 1/1] cert host tools: Stop complaining about deprecated OpenSSL functions

2022-08-16 Thread He Zhe
Hi Bruce,

Seems all arches needs this patch so that it can save us a bunch of useless 
warnings in do_compile.
It was created since 5.19 and hasn't been put on upstream stable tree.

Thanks,
Zhe


On 7/14/22 08:13, Xiaolei Wang wrote:
> From: Linus Torvalds 
>
> commit 6bfb56e93bcef41859c2d5ab234ffd80b691be35 upstream.
>
> OpenSSL 3.0 deprecated the OpenSSL's ENGINE API.  That is as may be, but
> the kernel build host tools still use it.  Disable the warning about
> deprecated declarations until somebody who cares fixes it.
>
> Signed-off-by: Linus Torvalds 
> [Xiaolei: The cert/extract-cert.c is adjusted to scripts/extract-cert.c in 
> order to apply to v5.15 kernel.]
> Signed-off-by: Xiaolei Wang 
> ---
>  scripts/extract-cert.c | 7 +++
>  scripts/sign-file.c| 7 +++
>  2 files changed, 14 insertions(+)
>
> diff --git a/scripts/extract-cert.c b/scripts/extract-cert.c
> index 3bc48c726c41..79ecbbfe37cd 100644
> --- a/scripts/extract-cert.c
> +++ b/scripts/extract-cert.c
> @@ -23,6 +23,13 @@
>  #include 
>  #include 
>  
> +/*
> + * OpenSSL 3.0 deprecates the OpenSSL's ENGINE API.
> + *
> + * Remove this if/when that API is no longer used
> + */
> +#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
> +
>  #define PKEY_ID_PKCS7 2
>  
>  static __attribute__((noreturn))
> diff --git a/scripts/sign-file.c b/scripts/sign-file.c
> index fbd34b8e8f57..7434e9ea926e 100644
> --- a/scripts/sign-file.c
> +++ b/scripts/sign-file.c
> @@ -29,6 +29,13 @@
>  #include 
>  #include 
>  
> +/*
> + * OpenSSL 3.0 deprecates the OpenSSL's ENGINE API.
> + *
> + * Remove this if/when that API is no longer used
> + */
> +#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
> +
>  /*
>   * Use CMS if we have openssl-1.0.0 or newer available - otherwise we have to
>   * assume that it's not available and its header file is missing and that we
>
> 
>


-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#11569): 
https://lists.yoctoproject.org/g/linux-yocto/message/11569
Mute This Topic: https://lists.yoctoproject.org/mt/92370160/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] [kernel-cache][yocto-5.15][PATCH v3] nft: add configs for greater nftables coverage

2022-08-15 Thread He Zhe
Hi Bruce,

This patch happened to be merged onto two branches in linux-yocto.
https://git.yoctoproject.org/linux-yocto/commit/?h=v5.15/standard/nxp-sdk-5.10/nxp-s32g=a920167f0254ced8e1672e8b0c63fb49f6c3069b
https://git.yoctoproject.org/linux-yocto/commit/?h=v5.15/standard/preempt-rt/nxp-sdk-5.10/nxp-s32g=ee7baf33b698e9ef1900ad275c352f55cdbd8d26

Which would cause the following build failure.
| ERROR: could not process input files: ... features/netfilter/netfilter.scc 
features/nf_tables/nft_test.scc ...
| See /tmp/tmp.ownpBEhuml for details
| ERROR: Could not generate configuration queue for aptiv_cvc_sousa.

It should be reverted, or removed to not pollute commit log.


Regards,
Zhe

On 8/12/22 11:05, Bruce Ashfield wrote:
> merged.
>
> Bruce
>
> In message: [linux-yocto] [kernel-cache][yocto-5.15][PATCH v3] nft: add 
> configs for greater nftables coverage
> on 08/08/2022 Randy MacLeod wrote:
>
>> From: Randy MacLeod 
>>
>> Add an nft_test.scc file, which includes both nf_tables.cfg and a newly
>> added nft_test.cfg file.
>>
>> The nft_test.scc file include nftables.scc and also enables more nftables 
>> features.
>>
>> Previously some of the nftables ptests failed, due to missing kernel modules.
>> It's impossible to know which nftables features will be used so add more 
>> configs
>> in a new scc file to ensure that most nftables features used by nft work.
>>
>> The added features are:
>>
>> NF_CONNTRACK_TIMEOUT
>>   enables support for connection tracking timeout extension.
>>   This allows you to attach timeout policies to flow via the CT target.
>>
>> NFT_FLOW_OFFLOAD
>>   adds the "flow_offload" expression that you can use to choose what flows
>>   are placed into the hardware.
>>
>> NF_FLOW_TABLE
>>   adds the flow table core infrastructure.
>>
>> NF_FLOW_TABLE_INET
>>   adds the flow table mixed IPv4/IPv6 support.
>>
>> NF_FLOW_TABLE_IPV4
>>   adds the flow table IPv4 support.
>>
>> NFT_NUMGEN
>>   adds the number generator expression used to perform incremental
>>   counting and random numbers bound to a upper limit.
>>
>> NFT_OSF
>>   allows matching packets from an specific OS.
>>
>> NFT_QUOTA
>>   adds the "quota" expression that you can use to match enforce bytes quotas.
>>
>> NFT_SYNPROXY
>>   The SYNPROXY expression allows you to intercept TCP connections and
>>   establish them using syncookies before they are passed on to the
>>   server. This allows to avoid conntrack and server resource usage
>>   during SYN-flood attacks.
>>
>> NFT_XFRM
>>   adds an expression that you can use to extract properties of a packets
>>   security association.
>>
>> These additions enable the nftables-1.0.2 ptest to all pass.
>>
>> Signed-off-by: Aryaman Gupta 
>> Signed-off-by: Randy MacLeod 
>> ---
>>  features/nf_tables/nft_test.cfg | 11 +++
>>  features/nf_tables/nft_test.scc |  5 +
>>  2 files changed, 16 insertions(+)
>>  create mode 100644 features/nf_tables/nft_test.cfg
>>  create mode 100644 features/nf_tables/nft_test.scc
>>
>> diff --git a/features/nf_tables/nft_test.cfg 
>> b/features/nf_tables/nft_test.cfg
>> new file mode 100644
>> index ..5c5629c8
>> --- /dev/null
>> +++ b/features/nf_tables/nft_test.cfg
>> @@ -0,0 +1,11 @@
>> +CONFIG_NF_CONNTRACK_TIMEOUT=y
>> +CONFIG_NF_FLOW_TABLE_INET=m
>> +CONFIG_NF_FLOW_TABLE_IPV4=m
>> +CONFIG_NF_FLOW_TABLE=m
>> +CONFIG_NFT_FLOW_OFFLOAD=m
>> +CONFIG_NFT_NUMGEN=m
>> +CONFIG_NFT_OSF=m
>> +CONFIG_NFT_QUOTA=m
>> +CONFIG_NFT_SYNPROXY=m
>> +CONFIG_NFT_XFRM=m
>> +
>> diff --git a/features/nf_tables/nft_test.scc 
>> b/features/nf_tables/nft_test.scc
>> new file mode 100644
>> index ..8181c215
>> --- /dev/null
>> +++ b/features/nf_tables/nft_test.scc
>> @@ -0,0 +1,5 @@
>> +define KFEATURE_DESCRIPTION "Add extra nftables modules"
>> +define KFEATURE_COMPATIBILITY all
>> +
>> +include nf_tables.cfg
>> +include nft_test.cfg
>> -- 
>> 2.32.0
>>
>>
>>
>
> 
>


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



[linux-yocto][v5.15/standard/preempt-rt/base][PATCH] sched: deadline: Use printk_once instead of missing printk_deferred_once

2022-08-01 Thread He Zhe
46d5575df8a1 ("sched/deadline: Fix BUG_ON condition for deboosted tasks")
uses printk_deferred_once while
25f13bd1d07b ("printk: remove deferred printing") remove the function in
RT upstream. Let's use printk_once instead to fix the build failure.

kernel-source/kernel/sched/deadline.c: In function 'enqueue_task_dl':
kernel-source/kernel/sched/deadline.c:1565:25: error:
implicit declaration of function 'printk_deferred_once' 
[-Werror=implicit-function-declaration]
1565 | printk_deferred_once("sched: DL de-boosted task 
PID %d: REPLENISH flag missing\n",
 | ^~~~~~~~~~~~

Signed-off-by: He Zhe 
---
 kernel/sched/deadline.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/kernel/sched/deadline.c b/kernel/sched/deadline.c
index c9dc1bc06431..4c6579cb1b7f 100644
--- a/kernel/sched/deadline.c
+++ b/kernel/sched/deadline.c
@@ -1562,7 +1562,7 @@ static void enqueue_task_dl(struct rq *rq, struct 
task_struct *p, int flags)
 */
p->dl.dl_throttled = 0;
if (!(flags & ENQUEUE_REPLENISH))
-   printk_deferred_once("sched: DL de-boosted task PID %d: 
REPLENISH flag missing\n",
+   printk_once("sched: DL de-boosted task PID %d: 
REPLENISH flag missing\n",
 task_pid_nr(p));
 
return;
-- 
2.17.1


-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#11525): 
https://lists.yoctoproject.org/g/linux-yocto/message/11525
Mute This Topic: https://lists.yoctoproject.org/mt/92743928/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][yocto-kernel-cache yocto-5.15][PATCH] nxp-imx8: Enable CONFIG_EXPERT to meet dependency

2022-06-22 Thread He Zhe


On 6/22/22 16:37, Kevin wrote:
> On Wed, Jun 22, 2022 at 02:02:35PM +0800, He Zhe wrote:
>> [NOTE]: 'CONFIG_GPIO_SYSFS' last val (y) and .config val (n) do not match
> Hmm, The GPIO sysfs ABI has been marked as obsolete 6 years ago and has been
> scheduled to be removed in 2020.
>   commit fe95046e960b
>   Author: Linus Walleij 
>   Date: Thu Oct 22 09:58:34 2015 +0200
>   
>   gpio: ABI: mark the sysfs ABI as obsolete
>   
>   This marks the (optional) sysfs GPIO ABI as obsolete and schedules
>   it for removal in 2020.
>   
>   Cc: Johan Hovold 
>   Cc: Michael Welling 
>   Cc: Markus Pargmann 
>   Signed-off-by: Linus Walleij 
>
> Maybe we should drop CONFIG_GPIO_SYSFS from our BSPs now.

All right, I'm fine with removal. Just a quick fix here.

Regards,
Zhe

>
> Thanks,
> Kevin
>
>> ...snip...
>> Parent dependencies are:
>>  SYSFS [y] EXPERT [n] GPIOLIB [y]
>>
>> Signed-off-by: He Zhe 
>> ---
>>  bsp/nxp-imx8/nxp-imx8.cfg | 1 +
>>  1 file changed, 1 insertion(+)
>>
>> diff --git a/bsp/nxp-imx8/nxp-imx8.cfg b/bsp/nxp-imx8/nxp-imx8.cfg
>> index 2b31fc15..00530a64 100644
>> --- a/bsp/nxp-imx8/nxp-imx8.cfg
>> +++ b/bsp/nxp-imx8/nxp-imx8.cfg
>> @@ -4,6 +4,7 @@ CONFIG_SCHED_MC=y
>>  CONFIG_CLK_IMX8QXP=y
>>  CONFIG_CLK_IMX8MQ=y
>>  CONFIG_MXC_CLK=y
>> +CONFIG_EXPERT=y
>>  
>>  #
>>  ## Kernel Features
>> -- 
>> 2.17.1
>>
>> 
>>


-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#11410): 
https://lists.yoctoproject.org/g/linux-yocto/message/11410
Mute This Topic: https://lists.yoctoproject.org/mt/91916496/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 yocto-5.15][PATCH] nxp-imx8: Enable CONFIG_EXPERT to meet dependency

2022-06-22 Thread He Zhe
[NOTE]: 'CONFIG_GPIO_SYSFS' last val (y) and .config val (n) do not match
...snip...
Parent dependencies are:
 SYSFS [y] EXPERT [n] GPIOLIB [y]

Signed-off-by: He Zhe 
---
 bsp/nxp-imx8/nxp-imx8.cfg | 1 +
 1 file changed, 1 insertion(+)

diff --git a/bsp/nxp-imx8/nxp-imx8.cfg b/bsp/nxp-imx8/nxp-imx8.cfg
index 2b31fc15..00530a64 100644
--- a/bsp/nxp-imx8/nxp-imx8.cfg
+++ b/bsp/nxp-imx8/nxp-imx8.cfg
@@ -4,6 +4,7 @@ CONFIG_SCHED_MC=y
 CONFIG_CLK_IMX8QXP=y
 CONFIG_CLK_IMX8MQ=y
 CONFIG_MXC_CLK=y
+CONFIG_EXPERT=y
 
 #
 ## Kernel Features
-- 
2.17.1


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



[linux-yocto][v5.10/standard/base v5.15/standard/base][PATCH] x86/boot: Wrap literal addresses in absolute_pointer()

2022-06-01 Thread He Zhe
From: Kees Cook 

GCC 11 (incorrectly[1]) assumes that literal values cast to (void *)
should be treated like a NULL pointer with an offset, and raises
diagnostics when doing bounds checking under -Warray-bounds. GCC 12
got "smarter" about finding these:

In function 'rdfs8',
inlined from 'vga_recalc_vertical' at 
/srv/code/arch/x86/boot/video-mode.c:124:29,
inlined from 'set_mode' at /srv/code/arch/x86/boot/video-mode.c:163:3:
/srv/code/arch/x86/boot/boot.h:114:9: warning: array subscript 0 is outside 
array bounds of 'u8[0]' {aka 'unsigned char[]'} [-Warray-bounds]
  114 | asm volatile("movb %%fs:%1,%0" : "=q" (v) : "m" (*(u8 *)addr));
  | ^~~

This has been solved in other places[2] already by using the recently
added absolute_pointer() macro. Do the same here.

[1] https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99578
[2] https://lore.kernel.org/all/20210912160149.2227137-1-li...@roeck-us.net/

Cc: Thomas Gleixner 
Cc: Guenter Roeck 
Cc: x...@kernel.org
Signed-off-by: Kees Cook 

Backport https://git.kernel.org/tip/aeb84412037b89e06f45e382f044da6f200e12f8
to fix build warnings.
Signed-off-by: He Zhe 
---
 arch/x86/boot/boot.h | 36 
 arch/x86/boot/main.c |  2 +-
 2 files changed, 25 insertions(+), 13 deletions(-)

diff --git a/arch/x86/boot/boot.h b/arch/x86/boot/boot.h
index 34c9dbb6a47d..686a9d75a0e4 100644
--- a/arch/x86/boot/boot.h
+++ b/arch/x86/boot/boot.h
@@ -110,66 +110,78 @@ typedef unsigned int addr_t;
 
 static inline u8 rdfs8(addr_t addr)
 {
+   u8 *ptr = (u8 *)absolute_pointer(addr);
u8 v;
-   asm volatile("movb %%fs:%1,%0" : "=q" (v) : "m" (*(u8 *)addr));
+   asm volatile("movb %%fs:%1,%0" : "=q" (v) : "m" (*ptr));
return v;
 }
 static inline u16 rdfs16(addr_t addr)
 {
+   u16 *ptr = (u16 *)absolute_pointer(addr);
u16 v;
-   asm volatile("movw %%fs:%1,%0" : "=r" (v) : "m" (*(u16 *)addr));
+   asm volatile("movw %%fs:%1,%0" : "=r" (v) : "m" (*ptr));
return v;
 }
 static inline u32 rdfs32(addr_t addr)
 {
+   u32 *ptr = (u32 *)absolute_pointer(addr);
u32 v;
-   asm volatile("movl %%fs:%1,%0" : "=r" (v) : "m" (*(u32 *)addr));
+   asm volatile("movl %%fs:%1,%0" : "=r" (v) : "m" (*ptr));
return v;
 }
 
 static inline void wrfs8(u8 v, addr_t addr)
 {
-   asm volatile("movb %1,%%fs:%0" : "+m" (*(u8 *)addr) : "qi" (v));
+   u8 *ptr = (u8 *)absolute_pointer(addr);
+   asm volatile("movb %1,%%fs:%0" : "+m" (*ptr) : "qi" (v));
 }
 static inline void wrfs16(u16 v, addr_t addr)
 {
-   asm volatile("movw %1,%%fs:%0" : "+m" (*(u16 *)addr) : "ri" (v));
+   u16 *ptr = (u16 *)absolute_pointer(addr);
+   asm volatile("movw %1,%%fs:%0" : "+m" (*ptr) : "ri" (v));
 }
 static inline void wrfs32(u32 v, addr_t addr)
 {
-   asm volatile("movl %1,%%fs:%0" : "+m" (*(u32 *)addr) : "ri" (v));
+   u32 *ptr = (u32 *)absolute_pointer(addr);
+   asm volatile("movl %1,%%fs:%0" : "+m" (*ptr) : "ri" (v));
 }
 
 static inline u8 rdgs8(addr_t addr)
 {
+   u8 *ptr = (u8 *)absolute_pointer(addr);
u8 v;
-   asm volatile("movb %%gs:%1,%0" : "=q" (v) : "m" (*(u8 *)addr));
+   asm volatile("movb %%gs:%1,%0" : "=q" (v) : "m" (*ptr));
return v;
 }
 static inline u16 rdgs16(addr_t addr)
 {
+   u16 *ptr = (u16 *)absolute_pointer(addr);
u16 v;
-   asm volatile("movw %%gs:%1,%0" : "=r" (v) : "m" (*(u16 *)addr));
+   asm volatile("movw %%gs:%1,%0" : "=r" (v) : "m" (*ptr));
return v;
 }
 static inline u32 rdgs32(addr_t addr)
 {
+   u32 *ptr = (u32 *)absolute_pointer(addr);
u32 v;
-   asm volatile("movl %%gs:%1,%0" : "=r" (v) : "m" (*(u32 *)addr));
+   asm volatile("movl %%gs:%1,%0" : "=r" (v) : "m" (*ptr));
return v;
 }
 
 static inline void wrgs8(u8 v, addr_t addr)
 {
-   asm volatile("movb %1,%%gs:%0" : "+m" (*(u8 *)addr) : "qi" (v));
+   u8 *ptr = (u8 *)absolute_pointer(addr);
+   asm volatile("movb %1,%%gs:%0" : "+m" (*ptr) : "qi" (v));
 }
 static inline void wrgs16(u16 v, addr_t addr)
 {
-   asm volatile("movw %1,%%gs:%0" : "+m" (*(u16 *)addr) : "ri" (v));
+   u16 *ptr = (u16 *)absolute_pointer(addr);
+   asm volatile("movw %1,%%gs:%0" : "+m" (*

[linux-yocto][v5.10/standard/base v5.15/standard/base][PATCH] ACPI: thermal: drop an always true check

2022-06-01 Thread He Zhe
From: Adam Borowski 

Address of a field inside a struct can't possibly be null; gcc-12 warns
about this.

Signed-off-by: Adam Borowski 
Signed-off-by: Rafael J. Wysocki 

Backport e5b5d25444e9ee3ae439720e62769517d331fa39 from mainline to fix build 
error when we enable -Werror.
drivers/acpi/thermal.c:1101:21: error: the comparison will always evaluate as
'true' for the address of 'active' will never be NULL [-Waddress]
Signed-off-by: He Zhe 
---
 drivers/acpi/thermal.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/drivers/acpi/thermal.c b/drivers/acpi/thermal.c
index 95105db642b9..155bbabcc6f5 100644
--- a/drivers/acpi/thermal.c
+++ b/drivers/acpi/thermal.c
@@ -1098,8 +1098,6 @@ static int acpi_thermal_resume(struct device *dev)
return -EINVAL;
 
for (i = 0; i < ACPI_THERMAL_MAX_ACTIVE; i++) {
-   if (!(>trips.active[i]))
-   break;
if (!tz->trips.active[i].flags.valid)
break;
tz->trips.active[i].flags.enabled = 1;
-- 
2.25.1


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



[linux-yocto][v5.10/standard/base v5.15/standard/base][PATCH] xfs: Fix -Werror=dangling-pointer work-around for older GCC

2022-05-30 Thread He Zhe
GCC 11 and older do not have dangling-pointer, use cc-option to make it
work for all versions of GCC.

Fixes: 5509050b3392 ("xfs: Work around GCC 12 -Werror=dangling-pointer for 
xfs_attr_remote.o")
Signed-off-by: He Zhe 
---
 fs/xfs/Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fs/xfs/Makefile b/fs/xfs/Makefile
index 8d4ad8ed4b77..49260d9b3abc 100644
--- a/fs/xfs/Makefile
+++ b/fs/xfs/Makefile
@@ -6,7 +6,7 @@
 
 ccflags-y += -I $(srctree)/$(src)  # needed for trace events
 ccflags-y += -I $(srctree)/$(src)/libxfs
-ccflags-y += -Wno-error=dangling-pointer
+ccflags-y += $(call cc-option, -Wno-error=dangling-pointer)
 
 obj-$(CONFIG_XFS_FS)   += xfs.o
 
-- 
2.32.0


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



[linux-yocto][v5.10/standard/base v5.15/standard/base][PATCH 2/2] xfs: Work around GCC 12 -Werror=dangling-pointer for xfs_attr_remote.o

2022-05-25 Thread He Zhe
This is to fix build failure when we enable -Werror. It's still in discussion.

There seems no way to disable it only for xfs_attr_remote.o as there is only a
makefile in the parent directory. So Let's temporarily disable for fs/xfs/.

Link: https://bugzilla.kernel.org/show_bug.cgi?id=215851

Signed-off-by: He Zhe 
---
 fs/xfs/Makefile | 1 +
 1 file changed, 1 insertion(+)

diff --git a/fs/xfs/Makefile b/fs/xfs/Makefile
index 04611a1068b4..8d4ad8ed4b77 100644
--- a/fs/xfs/Makefile
+++ b/fs/xfs/Makefile
@@ -6,6 +6,7 @@
 
 ccflags-y += -I $(srctree)/$(src)  # needed for trace events
 ccflags-y += -I $(srctree)/$(src)/libxfs
+ccflags-y += -Wno-error=dangling-pointer
 
 obj-$(CONFIG_XFS_FS)   += xfs.o
 
-- 
2.32.0


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



[linux-yocto][v5.10/standard/base v5.15/standard/base][PATCH 1/2] virtio-pci: Remove wrong address verification in vp_del_vqs()

2022-05-25 Thread He Zhe
From: Murilo Opsfelder Araujo 

GCC 12 enhanced -Waddress when comparing array address to null [0],
which warns:

drivers/virtio/virtio_pci_common.c: In function ‘vp_del_vqs’:
drivers/virtio/virtio_pci_common.c:257:29: warning: the comparison will 
always evaluate as ‘true’ for the pointer operand in 
‘vp_dev->msix_affinity_masks + (sizetype)((long unsigned int)i * 256)’ must not 
be NULL [-Waddress]
  257 | if (vp_dev->msix_affinity_masks[i])
  | ^~

In fact, the verification is comparing the result of a pointer
arithmetic, the address "msix_affinity_masks + i", which will always
evaluate to true.

Under the hood, free_cpumask_var() calls kfree(), which is safe to pass
NULL, not requiring non-null verification.  So remove the verification
to make compiler happy (happy compiler, happy life).

[0] https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102103

Signed-off-by: Murilo Opsfelder Araujo 

This is to fix build failure when we enable -Werror. It's not yet merged, but
ACKed.
Link: https://lore.kernel.org/lkml/20220415023002.49805-1-muri...@linux.ibm.com/

Signed-off-by: He Zhe 
---
 drivers/virtio/virtio_pci_common.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/virtio/virtio_pci_common.c 
b/drivers/virtio/virtio_pci_common.c
index b35bb2d57f62..1e890ef17687 100644
--- a/drivers/virtio/virtio_pci_common.c
+++ b/drivers/virtio/virtio_pci_common.c
@@ -254,8 +254,7 @@ void vp_del_vqs(struct virtio_device *vdev)
 
if (vp_dev->msix_affinity_masks) {
for (i = 0; i < vp_dev->msix_vectors; i++)
-   if (vp_dev->msix_affinity_masks[i])
-   
free_cpumask_var(vp_dev->msix_affinity_masks[i]);
+   free_cpumask_var(vp_dev->msix_affinity_masks[i]);
}
 
if (vp_dev->msix_enabled) {
-- 
2.32.0


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



[linux-yocto][meta-realtime][PATCH] LICENSE: update to SPDX standard names

2022-05-12 Thread He Zhe
To fix warnings like the following, update LICENSE names in recipes with
poky/scripts/contrib/convert-spdx-licenses.py.

WARNING: schedtool-dl-1.0-r0 do_package_qa: QA Issue: Recipe LICENSE includes 
obsolete licenses GPLv2 [obsolete-license]

Signed-off-by: He Zhe 
---
 recipes-kernel/latencytop/latencytop_0.5.bb | 2 +-
 recipes-tools/rt-app/rt-app.bb  | 2 +-
 recipes-tools/schedtool-dl/schedtool-dl.bb  | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/recipes-kernel/latencytop/latencytop_0.5.bb 
b/recipes-kernel/latencytop/latencytop_0.5.bb
index eb19471..3720cde 100644
--- a/recipes-kernel/latencytop/latencytop_0.5.bb
+++ b/recipes-kernel/latencytop/latencytop_0.5.bb
@@ -1,7 +1,7 @@
 SUMMARY = "Linux tool for measuring and fixing latency"
 HOMEPAGE = "http://www.latencytop.org/;
 
-LICENSE = "GPLv2"
+LICENSE = "GPL-2.0-only"
 LIC_FILES_CHKSUM = 
"file://latencytop.c;endline=23;md5=ee9ea9b1415356e5734adad4a87dc7fa"
 
 inherit pkgconfig
diff --git a/recipes-tools/rt-app/rt-app.bb b/recipes-tools/rt-app/rt-app.bb
index c1d573e..6424e69 100644
--- a/recipes-tools/rt-app/rt-app.bb
+++ b/recipes-tools/rt-app/rt-app.bb
@@ -1,6 +1,6 @@
 DESCRIPTION = "rt-app is a test application that starts multiple periodic 
threads in order to simulate a real-time periodic load"
 SECTION = "devel"
-LICENSE = "GPLv2"
+LICENSE = "GPL-2.0-only"
 LIC_FILES_CHKSUM = 
"file://COPYING.in;endline=339;md5=e43fc16fccd8519fba405f0a0ff6e8a3"
 
 SRCREV = "17be4548c4260b80be623e0e1317e98a770dea7a"
diff --git a/recipes-tools/schedtool-dl/schedtool-dl.bb 
b/recipes-tools/schedtool-dl/schedtool-dl.bb
index c8f5d1e..f394f10 100644
--- a/recipes-tools/schedtool-dl/schedtool-dl.bb
+++ b/recipes-tools/schedtool-dl/schedtool-dl.bb
@@ -1,6 +1,6 @@
 DESCRIPTION = "schedtool-dl (scheduler test tool) for deadline scheduler"
 SECTION = "devel"
-LICENSE = "GPLv2"
+LICENSE = "GPL-2.0-only"
 LIC_FILES_CHKSUM = "file://LICENSE;md5=dc1f51f7ca94aebffb9b3663d82873ec"
 
 SRC_URI = 
"git://github.com/jlelli/schedtool-dl.git;protocol=https;branch=master \
-- 
2.32.0


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



[linux-yocto][v5.10/standard/base][PATCH] regulator: consumer: Add missing stubs to regulator/consumer.h

2022-05-10 Thread He Zhe
From: Dmitry Osipenko 

commit 51dfb6ca3728bd0a0a3c23776a12d2a15a1d2457 upstream

Add missing stubs to regulator/consumer.h in order to fix COMPILE_TEST
of the kernel. In particular this should fix compile-testing of OPP core
because of a missing stub for regulator_sync_voltage().

Reported-by: kernel test robot 
Signed-off-by: Dmitry Osipenko 
Link: https://lore.kernel.org/r/20210120205844.12658-1-dig...@gmail.com
Signed-off-by: Mark Brown 

Backport from mainline to fix build failure when CONFIG_REGULATOR=n which
is default in linux-yocto.
5.10.114 in mainline stable tree does not handle this case.
Link: https://lore.kernel.org/all/62796b82.1c69fb81.1bf47.0...@mx.google.com/

Signed-off-by: He Zhe 
---
 include/linux/regulator/consumer.h | 30 ++
 1 file changed, 30 insertions(+)

diff --git a/include/linux/regulator/consumer.h 
b/include/linux/regulator/consumer.h
index 2024944fd2f7..20e84a84fb77 100644
--- a/include/linux/regulator/consumer.h
+++ b/include/linux/regulator/consumer.h
@@ -331,6 +331,12 @@ regulator_get_exclusive(struct device *dev, const char *id)
return ERR_PTR(-ENODEV);
 }
 
+static inline struct regulator *__must_check
+devm_regulator_get_exclusive(struct device *dev, const char *id)
+{
+   return ERR_PTR(-ENODEV);
+}
+
 static inline struct regulator *__must_check
 regulator_get_optional(struct device *dev, const char *id)
 {
@@ -486,6 +492,11 @@ static inline int regulator_get_voltage(struct regulator 
*regulator)
return -EINVAL;
 }
 
+static inline int regulator_sync_voltage(struct regulator *regulator)
+{
+   return -EINVAL;
+}
+
 static inline int regulator_is_supported_voltage(struct regulator *regulator,
   int min_uV, int max_uV)
 {
@@ -578,6 +589,25 @@ static inline int 
devm_regulator_unregister_notifier(struct regulator *regulator
return 0;
 }
 
+static inline int regulator_suspend_enable(struct regulator_dev *rdev,
+  suspend_state_t state)
+{
+   return -EINVAL;
+}
+
+static inline int regulator_suspend_disable(struct regulator_dev *rdev,
+   suspend_state_t state)
+{
+   return -EINVAL;
+}
+
+static inline int regulator_set_suspend_voltage(struct regulator *regulator,
+   int min_uV, int max_uV,
+   suspend_state_t state)
+{
+   return -EINVAL;
+}
+
 static inline void *regulator_get_drvdata(struct regulator *regulator)
 {
return NULL;
-- 
2.25.1


-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#11290): 
https://lists.yoctoproject.org/g/linux-yocto/message/11290
Mute This Topic: https://lists.yoctoproject.org/mt/91008595/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] global: Clean up is not set with =n

2022-05-05 Thread He Zhe
Upstream is dropping support for is not set, so we adjust our
configs accordingly.

Commit:
https://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-kbuild.git/commit/?h=for-next=55de8686df7ed2b5237867b130e30c728bbd9db4

Signed-off-by: He Zhe 
---
 bsp/qemuarma15/qemuarma15.cfg | 2 +-
 features/security/security-x86_64.cfg | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/bsp/qemuarma15/qemuarma15.cfg b/bsp/qemuarma15/qemuarma15.cfg
index df8181ff..6fc92c6b 100644
--- a/bsp/qemuarma15/qemuarma15.cfg
+++ b/bsp/qemuarma15/qemuarma15.cfg
@@ -36,4 +36,4 @@ CONFIG_HIGHMEM=y
 CONFIG_ARM_AMBA=y
 CONFIG_ARM_THUMB=y
 
-# CONFIG_FUNCTION_GRAPH_TRACER is not set
+CONFIG_FUNCTION_GRAPH_TRACER=n
diff --git a/features/security/security-x86_64.cfg 
b/features/security/security-x86_64.cfg
index dad137f6..0f5c3621 100644
--- a/features/security/security-x86_64.cfg
+++ b/features/security/security-x86_64.cfg
@@ -1,4 +1,4 @@
 # SPDX-License-Identifier: MIT
 # Modern libc no longer needs a fixed-position mapping in userspace, remove it 
as a possible target.
-# CONFIG_LEGACY_VSYSCALL_EMULATE is not set
+CONFIG_LEGACY_VSYSCALL_EMULATE=n
 CONFIG_LEGACY_VSYSCALL_NONE=y
-- 
2.25.1


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



[linux-yocto][v5.10/standard/preempt-rt/base][PATCH] tcp: Fix net/ipv4/inet_hashtables.c conflict

2022-04-25 Thread He Zhe
This causes build failure.
Keep all parts of the function from v5.10/standard/base

Fixes: f640c7dd08c9 ("Merge branch 'v5.10/standard/base' into 
v5.10/standard/preempt-rt/base")
Signed-off-by: He Zhe 
---
 net/ipv4/inet_hashtables.c | 22 --
 1 file changed, 22 deletions(-)

diff --git a/net/ipv4/inet_hashtables.c b/net/ipv4/inet_hashtables.c
index 51c7d734175f..915b8e1bd9ef 100644
--- a/net/ipv4/inet_hashtables.c
+++ b/net/ipv4/inet_hashtables.c
@@ -680,26 +680,9 @@ EXPORT_SYMBOL_GPL(inet_hash);
 
 static void __inet_unhash(struct sock *sk, struct inet_listen_hashbucket *ilb)
 {
-   struct inet_hashinfo *hashinfo = sk->sk_prot->h.hashinfo;
-   struct inet_listen_hashbucket *ilb = NULL;
-   spinlock_t *lock;
-   bool state_listen;
-
if (sk_unhashed(sk))
return;
 
-   if (sk->sk_state == TCP_LISTEN) {
-   state_listen = true;
-   ilb = >listening_hash[inet_sk_listen_hashfn(sk)];
-   spin_lock(>lock);
-   } else {
-   state_listen = false;
-   lock = inet_ehash_lockp(hashinfo, sk->sk_hash);
-   spin_lock_bh(lock);
-   }
-   if (sk_unhashed(sk))
-   goto unlock;
-
if (rcu_access_pointer(sk->sk_reuseport_cb))
reuseport_detach_sock(sk);
if (ilb) {
@@ -710,11 +693,6 @@ static void __inet_unhash(struct sock *sk, struct 
inet_listen_hashbucket *ilb)
}
__sk_nulls_del_node_init_rcu(sk);
sock_prot_inuse_add(sock_net(sk), sk->sk_prot, -1);
-unlock:
-   if (state_listen)
-   spin_unlock(>lock);
-   else
-   spin_unlock_bh(lock);
 }
 
 void inet_unhash(struct sock *sk)
-- 
2.32.0


-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#11245): 
https://lists.yoctoproject.org/g/linux-yocto/message/11245
Mute This Topic: https://lists.yoctoproject.org/mt/90680941/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] Build failure drivers/video/fbdev/core/fbmem.c

2022-04-25 Thread He Zhe


On 4/25/22 13:23, He Zhe wrote:
> Hi Bruce,
>
> The base context of 2388f826cdc9af2651991adc0feb79de9bdf2232 is removed and 
> it causes build failure for all branches.

if we use linux-yocto 5.15.35 or later.

Zhe

> https://git.yoctoproject.org/linux-yocto/commit/?h=v5.15/standard/base=4e7122625996261d870160dfd2096108742f1009
>
> TOPDIR/tmp-glibc/work-shared/qemux86-64/kernel-source/drivers/video/fbdev/core/fbmem.c:
>  In function 'do_remove_conflicting_framebuffers':
> TOPDIR/tmp-glibc/work-shared/qemux86-64/kernel-source/drivers/video/fbdev/core/fbmem.c:1581:30:
>  error: 'device' undeclared (first use in this function)
>  1581 | if (!device) {
>   |  ^~
> TOPDIR/tmp-glibc/work-shared/qemux86-64/kernel-source/drivers/video/fbdev/core/fbmem.c:1581:30:
>  note: each undeclared identifier is reported only once for each function it 
> appears in
> TOPDIR/tmp-glibc/work-shared/qemux86-64/kernel-source/drivers/video/fbdev/core/fbmem.c:1588:36:
>  error: implicit declaration of function 'dev_is_platform' 
> [-Werror=implicit-function-declaration]
>  1588 | } else if (dev_is_platform(device)) {
>   |^~~
> TOPDIR/tmp-glibc/work-shared/qemux86-64/kernel-source/drivers/video/fbdev/core/fbmem.c:1589:49:
>  error: 'struct fb_info' has no member named 'forced_out'
>  1589 | registered_fb[i]->forced_out = true;
>   | ^~
>   CC  crypto/ccm.o
>   CC  block/ioprio.o
>   CC  kernel/utsname.o
> TOPDIR/tmp-glibc/work-shared/qemux86-64/kernel-source/drivers/video/fbdev/core/fbmem.c:1590:33:
>  error: implicit declaration of function 'platform_device_unregister'; did 
> you mean 'root_device_unregister'? [-Werror=implicit-function-declaration]
>  1590 | 
> platform_device_unregister(to_platform_device(device));
>   | ^~
>   | root_device_unregister
> TOPDIR/tmp-glibc/work-shared/qemux86-64/kernel-source/drivers/video/fbdev/core/fbmem.c:1590:60:
>  error: implicit declaration of function 'to_platform_device' 
> [-Werror=implicit-function-declaration]
>  1590 | 
> platform_device_unregister(to_platform_device(device));
>   |
> ^~
>
>
> Regards,
> Zhe
>
> 
>


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



[linux-yocto] Build failure drivers/video/fbdev/core/fbmem.c

2022-04-24 Thread He Zhe
Hi Bruce,

The base context of 2388f826cdc9af2651991adc0feb79de9bdf2232 is removed and it 
causes build failure for all branches.
https://git.yoctoproject.org/linux-yocto/commit/?h=v5.15/standard/base=4e7122625996261d870160dfd2096108742f1009

TOPDIR/tmp-glibc/work-shared/qemux86-64/kernel-source/drivers/video/fbdev/core/fbmem.c:
 In function 'do_remove_conflicting_framebuffers':
TOPDIR/tmp-glibc/work-shared/qemux86-64/kernel-source/drivers/video/fbdev/core/fbmem.c:1581:30:
 error: 'device' undeclared (first use in this function)
 1581 | if (!device) {
  |  ^~
TOPDIR/tmp-glibc/work-shared/qemux86-64/kernel-source/drivers/video/fbdev/core/fbmem.c:1581:30:
 note: each undeclared identifier is reported only once for each function it 
appears in
TOPDIR/tmp-glibc/work-shared/qemux86-64/kernel-source/drivers/video/fbdev/core/fbmem.c:1588:36:
 error: implicit declaration of function 'dev_is_platform' 
[-Werror=implicit-function-declaration]
 1588 | } else if (dev_is_platform(device)) {
  |^~~
TOPDIR/tmp-glibc/work-shared/qemux86-64/kernel-source/drivers/video/fbdev/core/fbmem.c:1589:49:
 error: 'struct fb_info' has no member named 'forced_out'
 1589 | registered_fb[i]->forced_out = true;
  | ^~
  CC  crypto/ccm.o
  CC  block/ioprio.o
  CC  kernel/utsname.o
TOPDIR/tmp-glibc/work-shared/qemux86-64/kernel-source/drivers/video/fbdev/core/fbmem.c:1590:33:
 error: implicit declaration of function 'platform_device_unregister'; did you 
mean 'root_device_unregister'? [-Werror=implicit-function-declaration]
 1590 | 
platform_device_unregister(to_platform_device(device));
  | ^~
  | root_device_unregister
TOPDIR/tmp-glibc/work-shared/qemux86-64/kernel-source/drivers/video/fbdev/core/fbmem.c:1590:60:
 error: implicit declaration of function 'to_platform_device' 
[-Werror=implicit-function-declaration]
 1590 | 
platform_device_unregister(to_platform_device(device));
  |
^~


Regards,
Zhe

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



[linux-yocto][v5.15/standard/base][PATCH] netfilter: conntrack: avoid useless indirection during conntrack destruction

2022-04-18 Thread He Zhe
From: Florian Westphal 

nf_ct_put() results in a usesless indirection:

nf_ct_put -> nf_conntrack_put -> nf_conntrack_destroy -> rcu readlock +
indirect call of ct_hooks->destroy().

There are two _put helpers:
nf_ct_put and nf_conntrack_put.  The latter is what should be used in
code that MUST NOT cause a linker dependency on the conntrack module
(e.g. calls from core network stack).

Everyone else should call nf_ct_put() instead.

A followup patch will convert a few nf_conntrack_put() calls to
nf_ct_put(), in particular from modules that already have a conntrack
dependency such as act_ct or even nf_conntrack itself.

Signed-off-by: Florian Westphal 
Signed-off-by: Pablo Neira Ayuso 

Backport
6ae7989c9af0 ("netfilter: conntrack: avoid useless indirection during")
which is not going to stable tree from mainline to fix the following warning,
with some necessary context tweaks.

root@intel-x86-64:~# ovs-vsctl add-br br0
device ovs-system entered promiscuous mode
[ cut here ]
WARNING: CPU: 2 PID: 711 at include/net/netfilter/nf_conntrack.h:175 
__ovs_ct_lookup+0x819/0x920 [openvswitch]
CPU: 2 PID: 711 Comm: ovs-vswitchd Not tainted 5.15.33-rt34-yocto-preempt-rt #1
Hardware name: Intel(R) Client Systems NUC7i5DNKE/NUC7i5DNB, BIOS 
DNKBLi5v.86A.0064.2019.0523.1933 05/23/2019
RIP: 0010:__ovs_ct_lookup+0x819/0x920 [openvswitch]
Code: b8 fe ff ff ff e9 69 f9 ff ff 41 0f b7 84 24 b0 00 00 00 49 8b 94 24 c0 
00 00 00 0f b6 1c 02 83 e3 0f c1 e3 02 e9 c5 fc ff ff <0f> 0b e9 86 f8 ff ff 4c 
89 f7 44 89 95 40 ff ff ff e8 61 30 fc ff
RSP: 0018:914c80a77638 EFLAGS: 00010246
RAX:  RBX: 903b139fa528 RCX: 
RDX: 0002 RSI: 914c80a77660 RDI: 
RBP: 914c80a77710 R08: 903b04819128 R09: aa605c40
R10: 914c80a779c0 R11:  R12: 903b05dd7000
R13: 0001 R14: 903b0a603c00 R15: 903b04819120
FS:  7f9256c9ba80() GS:903c65d0() knlGS:
CS:  0010 DS:  ES:  CR0: 80050033
CR2: 7ffe2fad9008 CR3: 00010a5e0002 CR4: 003706e0
DR0:  DR1:  DR2: 
DR3:  DR6: fffe0ff0 DR7: 0400
Call Trace:
 
 ? nf_ct_get_tuple+0x144/0x1f0 [nf_conntrack]
 ? nf_ct_get_tuplepr+0x5f/0x90 [nf_conntrack]
 ovs_ct_execute+0x3e1/0x5e0 [openvswitch]
 do_execute_actions+0xed/0x1ab0 [openvswitch]
 ? ovs_ct_copy_action+0x17b/0x8a0 [openvswitch]
 ? __ovs_nla_copy_actions+0x884/0xf30 [openvswitch]
 ? migrate_enable+0xd3/0x150
 ovs_execute_actions+0x62/0x140 [openvswitch]
 ? ovs_execute_actions+0x62/0x140 [openvswitch]
 ovs_packet_cmd_execute+0x294/0x310 [openvswitch]
 genl_family_rcv_msg_doit+0xe6/0x140
 genl_rcv_msg+0xde/0x1d0
 ? ovs_vport_cmd_del+0x200/0x200 [openvswitch]
 ? genl_get_cmd+0xd0/0xd0
 netlink_rcv_skb+0x55/0x100
 genl_rcv+0x29/0x40
 netlink_unicast+0x234/0x340
 netlink_sendmsg+0x226/0x470
 ? netlink_unicast+0x340/0x340
 sys_sendmsg+0x273/0x2b0
 ? sendmsg_copy_msghdr+0x7b/0xa0
 ___sys_sendmsg+0x81/0xc0
 ? do_futex+0x1c4/0xb70
 ? rt_spin_unlock+0x18/0x40
 ? __fget_light+0xa3/0x120
 __sys_sendmsg+0x62/0xb0
 ? fpregs_assert_state_consistent+0x27/0x50
 __x64_sys_sendmsg+0x1d/0x20
 do_syscall_64+0x43/0x90
 entry_SYSCALL_64_after_hwframe+0x44/0xae
RIP: 0033:0x7f9256dab82d
Code: 28 89 54 24 1c 48 89 74 24 10 89 7c 24 08 e8 1a 97 f7 ff 8b 54 24 1c 48 
8b 74 24 10 41 89 c0 8b 7c 24 08 b8 2e 00 00 00 0f 05 <48> 3d 00 f0 ff ff 77 33 
44 89 c7 48 89 44 24 08 e8 5e 97 f7 ff 48
RSP: 002b:7ffe2fae90a0 EFLAGS: 0293 ORIG_RAX: 002e
RAX: ffda RBX: 0001 RCX: 7f9256dab82d
RDX:  RSI: 7ffe2fae9130 RDI: 0011
RBP: 7ffe2fae9f30 R08:  R09: 0001
R10: 0006 R11: 0293 R12: 55fab0216e90
R13:  R14: 55fab0216e90 R15: 7ffe2fae9130
 
---[ end trace 00000002 ]---

Signed-off-by: He Zhe 
---
 include/linux/netfilter/nf_conntrack_common.h |  2 ++
 include/net/netfilter/nf_conntrack.h  |  8 ++--
 net/netfilter/nf_conntrack_core.c | 12 ++--
 3 files changed, 14 insertions(+), 8 deletions(-)

diff --git a/include/linux/netfilter/nf_conntrack_common.h 
b/include/linux/netfilter/nf_conntrack_common.h
index 700ea077ce2d..a0a587ffa021 100644
--- a/include/linux/netfilter/nf_conntrack_common.h
+++ b/include/linux/netfilter/nf_conntrack_common.h
@@ -29,6 +29,8 @@ struct nf_conntrack {
 };
 
 void nf_conntrack_destroy(struct nf_conntrack *nfct);
+
+/* like nf_ct_put, but without module dependency on nf_conntrack */
 static inline void nf_conntrack_put(struct nf_conntrack *nfct)
 {
if (nfct && atomic_dec_and_test(>use))
diff --git a/include/net/netfilter/nf_conntrack.h 
b/include/net/netfilter/nf_conntrack.h
index d24b0a34c8f0..8fc256af3df2 100644
--- a/include/n

Re: [linux-yocto][v5.10/standard/base][PATCH] ipv6: Fix stats accounting in ip6_pkt_drop

2022-04-06 Thread He Zhe


On 4/6/22 20:07, Paul Gortmaker wrote:
> [[linux-yocto][v5.10/standard/base][PATCH] ipv6: Fix stats accounting in 
> ip6_pkt_drop] On 06/04/2022 (Wed 15:54) He Zhe wrote:
>
>> VRF devices are the loopbacks for VRFs, and a loopback can not be
>> assigned to a VRF. Accordingly, the condition in ip6_pkt_drop should
>> be '||' not '&&'.
>>
>> Fixes: 1d3fd8a10bed ("vrf: Use orig netdev to count Ip6InNoRoutes and a 
>> fresh route lookup when sending dest unreach")
>> Reported-by: Pudak, Filip 
>> Reported-by: Xiao, Jiguang 
>> Signed-off-by: David Ahern 
>> Link: https://lore.kernel.org/r/20220404150908.2937-1-dsah...@kernel.org
>> Signed-off-by: Paolo Abeni 
>>
>> Link: 
>> https://git.kernel.org/pub/scm/linux/kernel/git/netdev/net.git/commit/?id=1158f79f82d4
> As this is in "net" (and not "net-next") it will go to mainline in a
> few days[1], and the LF stable team will grab it via the Fixes tag and
> backport it automatically (since it is a trivial change).
>
> What I'm getting at here, is that expiditing this (and any other fix that
> matches this same criteria) is a make-work project for yourself and for
> Bruce.  Unless it is has a priority (like a 0-day CVE) then there is no
> point trying to accelerate it vs. just waiting the few extra days for
> the normal "hands-free" process feed to take place on its own.
>
> And then it will have [comit abcd upstream] on it as well, indicating
> clearly that it was a mainline commit and not something that maybe 
> died on a mailing list thread and went no further.

We have customer experiencing network statistics error due to this bug and it
may also be the case for other Yocto users. Fixing this earlier may be more
important for them vs developers waiting and feeling hands-free. Anyway, this
patch is here up to maintainer's choice and convenience.

Thanks,
Zhe

>
> Thanks,
> Paul.
>
> [1] 
> https://docs.kernel.org/process/maintainer-netdev.html#how-do-the-changes-posted-to-netdev-make-their-way-into-linux
> --
>
>> Signed-off-by: He Zhe 
>> ---
>>  net/ipv6/route.c | 2 +-
>>  1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/net/ipv6/route.c b/net/ipv6/route.c
>> index 352e645c546e..776b1b58c5dc 100644
>> --- a/net/ipv6/route.c
>> +++ b/net/ipv6/route.c
>> @@ -4398,7 +4398,7 @@ static int ip6_pkt_drop(struct sk_buff *skb, u8 code, 
>> int ipstats_mib_noroutes)
>>  struct inet6_dev *idev;
>>  int type;
>>  
>> -if (netif_is_l3_master(skb->dev) &&
>> +if (netif_is_l3_master(skb->dev) ||
>>  dst->dev == net->loopback_dev)
>>  idev = __in6_dev_get_safely(dev_get_by_index_rcu(net, 
>> IP6CB(skb)->iif));
>>  else
>> -- 
>> 2.17.1
>>
>> 
>>


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



[linux-yocto][v5.10/standard/base][PATCH] ipv6: Fix stats accounting in ip6_pkt_drop

2022-04-06 Thread He Zhe
VRF devices are the loopbacks for VRFs, and a loopback can not be
assigned to a VRF. Accordingly, the condition in ip6_pkt_drop should
be '||' not '&&'.

Fixes: 1d3fd8a10bed ("vrf: Use orig netdev to count Ip6InNoRoutes and a fresh 
route lookup when sending dest unreach")
Reported-by: Pudak, Filip 
Reported-by: Xiao, Jiguang 
Signed-off-by: David Ahern 
Link: https://lore.kernel.org/r/20220404150908.2937-1-dsah...@kernel.org
Signed-off-by: Paolo Abeni 

Link: 
https://git.kernel.org/pub/scm/linux/kernel/git/netdev/net.git/commit/?id=1158f79f82d4
Signed-off-by: He Zhe 
---
 net/ipv6/route.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net/ipv6/route.c b/net/ipv6/route.c
index 352e645c546e..776b1b58c5dc 100644
--- a/net/ipv6/route.c
+++ b/net/ipv6/route.c
@@ -4398,7 +4398,7 @@ static int ip6_pkt_drop(struct sk_buff *skb, u8 code, int 
ipstats_mib_noroutes)
struct inet6_dev *idev;
int type;
 
-   if (netif_is_l3_master(skb->dev) &&
+   if (netif_is_l3_master(skb->dev) ||
dst->dev == net->loopback_dev)
idev = __in6_dev_get_safely(dev_get_by_index_rcu(net, 
IP6CB(skb)->iif));
else
-- 
2.17.1


-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#11124): 
https://lists.yoctoproject.org/g/linux-yocto/message/11124
Mute This Topic: https://lists.yoctoproject.org/mt/90285003/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] [kernel-cache][RFC][ PATCH] features/tpm: split into tpm-1.2, tpm-2.0, tpm-2.0-crb and vtpm feature

2022-03-08 Thread He Zhe
ERROR: could not find kconf tpm2.cfg, included from 
TOPDIR/tmp-glibc/work/intel_x86_64-wrs-linux/linux-yocto-dev/5.17++gitAUTOINC+72b219a527_8bfadd26b3-r0/kernel-meta/features/tpm/tpm.scc

features/tpm/tpm.scc -> features/tpm/tpm-2.0.scc -> tpm2.cfg

There is no tmp2.cfg there.

Zhe


On 3/9/22 02:34, Bruce Ashfield wrote:
> Sorry for the delay on this, I was tied up taking care of
> some golang issues.
>
> I've staged this on 5.10/5.15/master, and have pending
> commits for this.
>
> I don't have any objections, and all was clear on the list,
> so I've grabbed the change.
>
> Bruce
>
> In message: [kernel-cache][RFC][ PATCH] features/tpm: split into tpm-1.2, 
> tpm-2.0, tpm-2.0-crb and vtpm feature
> on 18/02/2022 Stefan Herbrechtsmeier wrote:
>
>> From: Stefan Herbrechtsmeier 
>>
>> Split the tpm feature into individual features as the tpm feature is
>> only usable on x86 because of its dependencies:
>>
>> Config 'TCG_NSC' has the following Direct dependencies (TCG_NSC=n):
>> X86(undefined/n) && TCG_TPM(=y)
>> Config 'TCG_ATMEL' has the following Direct dependencies (TCG_ATMEL=n):
>> PPC64(undefined/n) || HAS_IOPORT_MAP(=n) (=n) && TCG_TPM(=y)
>> Config 'TCG_INFINEON' has the following Direct dependencies (TCG_INFINEON=n):
>> PNP(=n) && TCG_TPM(=y)
>> Config 'TCG_CRB' has the following Direct dependencies (TCG_CRB=n):
>> ACPI(undefined/n) && TCG_TPM(=y)
>>
>> Signed-off-by: Stefan Herbrechtsmeier 
>> 
>>
>> ---
>> The commit adds new features to keep features/tpm/tpm backward
>> compatible.
>>
>>  features/tpm/tpm-1.2.cfg | 11 +++
>>  features/tpm/tpm-1.2.scc |  7 +++
>>  features/tpm/tpm-2.0-crb.cfg |  3 +++
>>  features/tpm/tpm-2.0-crb.scc |  7 +++
>>  features/tpm/tpm-2.0.cfg |  4 
>>  features/tpm/tpm-2.0.scc |  7 +++
>>  features/tpm/tpm-common.cfg  |  7 +++
>>  features/tpm/tpm-common.scc  |  5 +
>>  features/tpm/tpm.cfg | 20 
>>  features/tpm/tpm.scc |  8 ++--
>>  features/tpm/vtpm.cfg|  3 +++
>>  features/tpm/vtpm.scc|  7 +++
>>  12 files changed, 67 insertions(+), 22 deletions(-)
>>  create mode 100644 features/tpm/tpm-1.2.cfg
>>  create mode 100644 features/tpm/tpm-1.2.scc
>>  create mode 100644 features/tpm/tpm-2.0-crb.cfg
>>  create mode 100644 features/tpm/tpm-2.0-crb.scc
>>  create mode 100644 features/tpm/tpm-2.0.cfg
>>  create mode 100644 features/tpm/tpm-2.0.scc
>>  create mode 100644 features/tpm/tpm-common.cfg
>>  create mode 100644 features/tpm/tpm-common.scc
>>  delete mode 100644 features/tpm/tpm.cfg
>>  create mode 100644 features/tpm/vtpm.cfg
>>  create mode 100644 features/tpm/vtpm.scc
>>
>> diff --git a/features/tpm/tpm-1.2.cfg b/features/tpm/tpm-1.2.cfg
>> new file mode 100644
>> index ..d1fcf98c
>> --- /dev/null
>> +++ b/features/tpm/tpm-1.2.cfg
>> @@ -0,0 +1,11 @@
>> +# SPDX-License-Identifier: MIT
>> +# Enable TPM 1.2 device drivers.
>> +CONFIG_TCG_TIS_I2C_ATMEL=y
>> +CONFIG_TCG_TIS_I2C_INFINEON=y
>> +CONFIG_TCG_TIS_I2C_NUVOTON=y
>> +CONFIG_TCG_NSC=y
>> +CONFIG_TCG_ATMEL=y
>> +CONFIG_TCG_INFINEON=y
>> +CONFIG_TCG_TIS_ST33ZP24=y
>> +CONFIG_TCG_TIS_ST33ZP24_I2C=y
>> +CONFIG_TCG_TIS_ST33ZP24_SPI=y
>> \ No newline at end of file
>> diff --git a/features/tpm/tpm-1.2.scc b/features/tpm/tpm-1.2.scc
>> new file mode 100644
>> index ..74900486
>> --- /dev/null
>> +++ b/features/tpm/tpm-1.2.scc
>> @@ -0,0 +1,7 @@
>> +# SPDX-License-Identifier: MIT
>> +define KFEATURE_DESCRIPTION "Enable TCG TPM (Trusted Computing Group 
>> Trusted Platform Module) 1.2 drivers"
>> +define KFEATURE_COMPATIBILITY board
>> +
>> +include tpm-common.scc
>> +
>> +kconf hardware tpm-1.2.cfg
>> diff --git a/features/tpm/tpm-2.0-crb.cfg b/features/tpm/tpm-2.0-crb.cfg
>> new file mode 100644
>> index ..27a1ba25
>> --- /dev/null
>> +++ b/features/tpm/tpm-2.0-crb.cfg
>> @@ -0,0 +1,3 @@
>> +# SPDX-License-Identifier: MIT
>> +# Enable TPM device drivers.
>> +CONFIG_TCG_CRB=y
>> diff --git a/features/tpm/tpm-2.0-crb.scc b/features/tpm/tpm-2.0-crb.scc
>> new file mode 100644
>> index ..50875596
>> --- /dev/null
>> +++ b/features/tpm/tpm-2.0-crb.scc
>> @@ -0,0 +1,7 @@
>> +# SPDX-License-Identifier: MIT
>> +define KFEATURE_DESCRIPTION "Enable TCG CRB TPM (Trusted Computing Group 
>> Command Response Buffer Trusted Platform Module) 2.0 driver"
>> +define KFEATURE_COMPATIBILITY board
>> +
>> +include tpm-common.scc
>> +
>> +kconf hardware tpm2-crb.cfg
>> diff --git a/features/tpm/tpm-2.0.cfg b/features/tpm/tpm-2.0.cfg
>> new file mode 100644
>> index ..9f427afa
>> --- /dev/null
>> +++ b/features/tpm/tpm-2.0.cfg
>> @@ -0,0 +1,4 @@
>> +# SPDX-License-Identifier: MIT
>> +# Enable TPM device drivers.
>> +CONFIG_SPI=y
>> +CONFIG_TCG_TIS_SPI=y
>> diff --git a/features/tpm/tpm-2.0.scc b/features/tpm/tpm-2.0.scc
>> new file mode 100644
>> index ..68f98702
>> --- /dev/null
>> +++ b/features/tpm/tpm-2.0.scc
>> @@ -0,0 +1,7 @@
>> +# 

Re: [linux-yocto][linux-yocto v5.10/standard/base][PATCH 0/4] Fix ramoops/ftrace

2022-02-24 Thread He Zhe


On 2/25/22 12:28, He Zhe wrote:
> We experienced system hang when using ramoops/ftrace.
>
> To avoid the deadlock causing the hang, rebase the patch in the following
> link onto v5.10 as 4/9. 1/9, 2/9 and 3/9 are minimum basic change

typo, should have been 1/4 - 4/4.

> backported from mainline.
>
> Link: https://lkml.org/lkml/2021/6/10/868
>
> The code path of ftrace function tracer and the other users of it stays
> unchanged.
>
> This has been tested on arm64 and intel-x86-64 hardwares and qemu.
>
> He Zhe (4):
>   ftrace: Move the recursion testing into global headers
>   ftrace: Add ftrace_test_recursion_trylock() helper function
>   pstore/ftrace: Add recursion protection to the ftrace callback
>   pstore/ftrace: Add and use ftrace_test_recursion_trylock_safe
>
>  fs/pstore/ftrace.c  |  11 ++
>  include/linux/ftrace.h  |   1 +
>  include/linux/trace_recursion.h | 242 
>  kernel/trace/trace.h| 156 
>  4 files changed, 254 insertions(+), 156 deletions(-)
>  create mode 100644 include/linux/trace_recursion.h
>
>
> 
>


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



[linux-yocto][linux-yocto v5.10/standard/base][PATCH 4/4] pstore/ftrace: Add and use ftrace_test_recursion_trylock_safe

2022-02-24 Thread He Zhe
We experienced system hang when using ramoops/ftrace.

To avoid the deadlock causing the hang, this patch adds a safe version of
ftrace_test_recursion_trylock. This version does not allow any recursion
at the same context level (normal, softirq, irq and NMI) to avoid potential
deadlock. This is based on the Steven Rostedt's patch(not yet in mainline)
in following link.

Link: https://lkml.org/lkml/2021/6/10/868

Signed-off-by: He Zhe 
---
 fs/pstore/ftrace.c  |  7 -
 include/linux/trace_recursion.h | 55 +++--
 2 files changed, 59 insertions(+), 3 deletions(-)

diff --git a/fs/pstore/ftrace.c b/fs/pstore/ftrace.c
index 816210fc5d3a..3e58c53ecac6 100644
--- a/fs/pstore/ftrace.c
+++ b/fs/pstore/ftrace.c
@@ -41,7 +41,11 @@ static void notrace pstore_ftrace_call(unsigned long ip,
if (unlikely(oops_in_progress))
return;
 
-   bit = ftrace_test_recursion_trylock();
+   /* Locking is not safe to be taken in NMI */
+   if (in_nmi())
+   return;
+
+   bit = ftrace_test_recursion_trylock_safe();
if (bit < 0)
return;
 
@@ -59,6 +63,7 @@ static void notrace pstore_ftrace_call(unsigned long ip,
 
 static struct ftrace_ops pstore_ftrace_ops __read_mostly = {
.func   = pstore_ftrace_call,
+   .flags  = FTRACE_OPS_FL_RECURSION_SAFE,
 };
 
 static DEFINE_MUTEX(pstore_ftrace_lock);
diff --git a/include/linux/trace_recursion.h b/include/linux/trace_recursion.h
index 7bead54d8ba8..ce9f49c57338 100644
--- a/include/linux/trace_recursion.h
+++ b/include/linux/trace_recursion.h
@@ -125,7 +125,7 @@ static __always_inline int trace_get_context_bit(void)
return bit;
 }
 
-static __always_inline int trace_test_and_set_recursion(int start)
+static __always_inline int __trace_test_and_set_recursion(int start, bool safe)
 {
unsigned int val = current->trace_recursion;
int bit;
@@ -137,7 +137,7 @@ static __always_inline int trace_test_and_set_recursion(int 
start)
 * a switch between contexts. Allow for a single recursion.
 */
bit = start + TRACE_CTX_TRANSITION;
-   if (trace_recursion_test(bit))
+   if (safe || trace_recursion_test(bit))
return -1;
trace_recursion_set(bit);
barrier();
@@ -151,6 +151,26 @@ static __always_inline int 
trace_test_and_set_recursion(int start)
return bit;
 }
 
+static __always_inline int trace_test_and_set_recursion(int start)
+{
+   return __trace_test_and_set_recursion(start, false);
+}
+
+/*
+ * The safe version does not let any recursion happen.
+ * The unsafe version will allow for a single recursion to deal with
+ * the period during a context switch from normal to interrupt to NMI
+ * that may be in the wrong context. But if the caller is expecting
+ * this to be safe for grabbing locks, it must use the safe version
+ * otherwise it could cause a deadlock. But it may still miss events
+ * in the period of context switches, but if it is grabbing locks
+ * it shouldn't be tracing in that period anyway.
+ */
+static __always_inline int trace_test_and_set_recursion_safe(int start)
+{
+   return __trace_test_and_set_recursion(start, true);
+}
+
 static __always_inline void trace_clear_recursion(int bit)
 {
unsigned int val = current->trace_recursion;
@@ -168,6 +188,14 @@ static __always_inline void trace_clear_recursion(int bit)
  * Use this for ftrace callbacks. This will detect if the function
  * tracing recursed in the same context (normal vs interrupt),
  *
+ * Note, this may allow one nested level of recursion, because of the
+ * way interrupts are tracked. If a trace happens at the start of
+ * an interrupt before the interrupts state is set, it needs to allow
+ * one recursion to handle this case.
+ *
+ * If this is used to protect locks, use the
+ * ftrace_test_recursion_trylock_safe() version instead.
+ *
  * Returns: -1 if a recursion happened.
  *   >= 0 if no recursion
  */
@@ -176,6 +204,29 @@ static __always_inline int 
ftrace_test_recursion_trylock(void)
return trace_test_and_set_recursion(TRACE_FTRACE_START);
 }
 
+/**
+ * ftrace_test_recursion_trylock_safe - tests for recursion in same context
+ *
+ * Use this for ftrace callbacks. This will detect if the function
+ * tracing recursed in the same context (normal vs interrupt),
+ *
+ * Use this version if you depend on it for grabbing locks.
+ * You should also not be tracing in NMI either.
+ *
+ * This version is the same as the ftrace_test_recursion_trylock() except that
+ * it does not allow any recursion. It may produce a false positive if
+ * a trace occurs at the start of an interrupt but before the interrupt
+ * state is set. Any event that happens in that case will be considered
+ * a "recursion".
+ *
+ * Returns: -1 if a recursion happened.
+ *   >= 0 if no recursion
+ */
+s

[linux-yocto][linux-yocto v5.10/standard/base][PATCH 0/4] Fix ramoops/ftrace

2022-02-24 Thread He Zhe
We experienced system hang when using ramoops/ftrace.

To avoid the deadlock causing the hang, rebase the patch in the following
link onto v5.10 as 4/9. 1/9, 2/9 and 3/9 are minimum basic change
backported from mainline.

Link: https://lkml.org/lkml/2021/6/10/868

The code path of ftrace function tracer and the other users of it stays
unchanged.

This has been tested on arm64 and intel-x86-64 hardwares and qemu.

He Zhe (4):
  ftrace: Move the recursion testing into global headers
  ftrace: Add ftrace_test_recursion_trylock() helper function
  pstore/ftrace: Add recursion protection to the ftrace callback
  pstore/ftrace: Add and use ftrace_test_recursion_trylock_safe

 fs/pstore/ftrace.c  |  11 ++
 include/linux/ftrace.h  |   1 +
 include/linux/trace_recursion.h | 242 
 kernel/trace/trace.h| 156 
 4 files changed, 254 insertions(+), 156 deletions(-)
 create mode 100644 include/linux/trace_recursion.h

-- 
2.25.1


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



[linux-yocto][linux-yocto v5.10/standard/base][PATCH 1/4] ftrace: Move the recursion testing into global headers

2022-02-24 Thread He Zhe
Currently, if a callback is registered to a ftrace function and its
ftrace_ops does not have the RECURSION flag set, it is encapsulated in a
helper function that does the recursion for it.

Really, all the callbacks should have their own recursion protection for
performance reasons. But they should not all implement their own. Move the
recursion helpers to global headers, so that all callbacks can use them.

Signed-off-by: Steven Rostedt (VMware) 

Rebase to 5.10
Signed-off-by: He Zhe 
---
 include/linux/ftrace.h  |   1 +
 include/linux/trace_recursion.h | 166 
 kernel/trace/trace.h| 156 --
 3 files changed, 167 insertions(+), 156 deletions(-)
 create mode 100644 include/linux/trace_recursion.h

diff --git a/include/linux/ftrace.h b/include/linux/ftrace.h
index 1bd3a0356ae4..0e4164a7f56d 100644
--- a/include/linux/ftrace.h
+++ b/include/linux/ftrace.h
@@ -7,6 +7,7 @@
 #ifndef _LINUX_FTRACE_H
 #define _LINUX_FTRACE_H
 
+#include 
 #include 
 #include 
 #include 
diff --git a/include/linux/trace_recursion.h b/include/linux/trace_recursion.h
new file mode 100644
index ..74bbc0f39810
--- /dev/null
+++ b/include/linux/trace_recursion.h
@@ -0,0 +1,166 @@
+/* SPDX-License-Identifier: GPL-2.0 */
+#ifndef _LINUX_TRACE_RECURSION_H
+#define _LINUX_TRACE_RECURSION_H
+
+#include 
+#include 
+
+#ifdef CONFIG_TRACING
+
+/* Only current can touch trace_recursion */
+
+/*
+ * For function tracing recursion:
+ *  The order of these bits are important.
+ *
+ *  When function tracing occurs, the following steps are made:
+ *   If arch does not support a ftrace feature:
+ *call internal function (uses INTERNAL bits) which calls...
+ *   If callback is registered to the "global" list, the list
+ *function is called and recursion checks the GLOBAL bits.
+ *then this function calls...
+ *   The function callback, which can use the FTRACE bits to
+ *check for recursion.
+ */
+enum {
+   /* Function recursion bits */
+   TRACE_FTRACE_BIT,
+   TRACE_FTRACE_NMI_BIT,
+   TRACE_FTRACE_IRQ_BIT,
+   TRACE_FTRACE_SIRQ_BIT,
+   TRACE_FTRACE_TRANSITION_BIT,
+
+   /* Internal use recursion bits */
+   TRACE_INTERNAL_BIT,
+   TRACE_INTERNAL_NMI_BIT,
+   TRACE_INTERNAL_IRQ_BIT,
+   TRACE_INTERNAL_SIRQ_BIT,
+   TRACE_INTERNAL_TRANSITION_BIT,
+
+   TRACE_BRANCH_BIT,
+/*
+ * Abuse of the trace_recursion.
+ * As we need a way to maintain state if we are tracing the function
+ * graph in irq because we want to trace a particular function that
+ * was called in irq context but we have irq tracing off. Since this
+ * can only be modified by current, we can reuse trace_recursion.
+ */
+   TRACE_IRQ_BIT,
+
+   /* Set if the function is in the set_graph_function file */
+   TRACE_GRAPH_BIT,
+
+   /*
+* In the very unlikely case that an interrupt came in
+* at a start of graph tracing, and we want to trace
+* the function in that interrupt, the depth can be greater
+* than zero, because of the preempted start of a previous
+* trace. In an even more unlikely case, depth could be 2
+* if a softirq interrupted the start of graph tracing,
+* followed by an interrupt preempting a start of graph
+* tracing in the softirq, and depth can even be 3
+* if an NMI came in at the start of an interrupt function
+* that preempted a softirq start of a function that
+* preempted normal context Luckily, it can't be
+* greater than 3, so the next two bits are a mask
+* of what the depth is when we set TRACE_GRAPH_BIT
+*/
+
+   TRACE_GRAPH_DEPTH_START_BIT,
+   TRACE_GRAPH_DEPTH_END_BIT,
+
+   /*
+* To implement set_graph_notrace, if this bit is set, we ignore
+* function graph tracing of called functions, until the return
+* function is called to clear it.
+*/
+   TRACE_GRAPH_NOTRACE_BIT,
+};
+
+#define trace_recursion_set(bit)   do { (current)->trace_recursion |= 
(1<<(bit)); } while (0)
+#define trace_recursion_clear(bit) do { (current)->trace_recursion &= 
~(1<<(bit)); } while (0)
+#define trace_recursion_test(bit)  ((current)->trace_recursion & 
(1<<(bit)))
+
+#define trace_recursion_depth() \
+   (((current)->trace_recursion >> TRACE_GRAPH_DEPTH_START_BIT) & 3)
+#define trace_recursion_set_depth(depth) \
+   do {\
+   current->trace_recursion &= \
+   ~(3 << TRACE_GRAPH_DEPTH_START_BIT);\
+   current->trace_recursion |= \
+   ((depth) & 3) << TRACE_GRAPH_DEPTH_START_BIT;   \
+   } while (0)
+
+#define TRACE_CONTEXT_BITS 

[linux-yocto][linux-yocto v5.10/standard/base][PATCH 2/4] ftrace: Add ftrace_test_recursion_trylock() helper function

2022-02-24 Thread He Zhe
To make it easier for ftrace callbacks to have recursion protection, provide
a ftrace_test_recursion_trylock() and ftrace_test_recursion_unlock() helper
that tests for recursion.

Signed-off-by: Steven Rostedt (VMware) 

Rebase to 5.10
Keep core path of function tracer unchanged
Signed-off-by: He Zhe 
---
 include/linux/trace_recursion.h | 25 +
 1 file changed, 25 insertions(+)

diff --git a/include/linux/trace_recursion.h b/include/linux/trace_recursion.h
index 74bbc0f39810..7bead54d8ba8 100644
--- a/include/linux/trace_recursion.h
+++ b/include/linux/trace_recursion.h
@@ -162,5 +162,30 @@ static __always_inline void trace_clear_recursion(int bit)
current->trace_recursion = val;
 }
 
+/**
+ * ftrace_test_recursion_trylock - tests for recursion in same context
+ *
+ * Use this for ftrace callbacks. This will detect if the function
+ * tracing recursed in the same context (normal vs interrupt),
+ *
+ * Returns: -1 if a recursion happened.
+ *   >= 0 if no recursion
+ */
+static __always_inline int ftrace_test_recursion_trylock(void)
+{
+   return trace_test_and_set_recursion(TRACE_FTRACE_START);
+}
+
+/**
+ * ftrace_test_recursion_unlock - called when function callback is complete
+ * @bit: The return of a successful ftrace_test_recursion_trylock()
+ *
+ * This is used at the end of a ftrace callback.
+ */
+static __always_inline void ftrace_test_recursion_unlock(int bit)
+{
+   trace_clear_recursion(bit);
+}
+
 #endif /* CONFIG_TRACING */
 #endif /* _LINUX_TRACE_RECURSION_H */
-- 
2.25.1


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



[linux-yocto][linux-yocto v5.10/standard/base][PATCH 3/4] pstore/ftrace: Add recursion protection to the ftrace callback

2022-02-24 Thread He Zhe
If a ftrace callback does not supply its own recursion protection and
does not set the RECURSION_SAFE flag in its ftrace_ops, then ftrace will
make a helper trampoline to do so before calling the callback instead of
just calling the callback directly.

The default for ftrace_ops is going to assume recursion protection unless
otherwise specified.

Cc: Thomas Meyer 
Cc: Kees Cook 
Signed-off-by: Steven Rostedt (VMware) 

Rebase to 5.10
Signed-off-by: He Zhe 
---
 fs/pstore/ftrace.c | 6 ++
 1 file changed, 6 insertions(+)

diff --git a/fs/pstore/ftrace.c b/fs/pstore/ftrace.c
index 5c0450701293..816210fc5d3a 100644
--- a/fs/pstore/ftrace.c
+++ b/fs/pstore/ftrace.c
@@ -28,6 +28,7 @@ static void notrace pstore_ftrace_call(unsigned long ip,
   struct ftrace_ops *op,
   struct pt_regs *regs)
 {
+   int bit;
unsigned long flags;
struct pstore_ftrace_record rec = {};
struct pstore_record record = {
@@ -40,6 +41,10 @@ static void notrace pstore_ftrace_call(unsigned long ip,
if (unlikely(oops_in_progress))
return;
 
+   bit = ftrace_test_recursion_trylock();
+   if (bit < 0)
+   return;
+
local_irq_save(flags);
 
rec.ip = ip;
@@ -49,6 +54,7 @@ static void notrace pstore_ftrace_call(unsigned long ip,
psinfo->write();
 
local_irq_restore(flags);
+   ftrace_test_recursion_unlock(bit);
 }
 
 static struct ftrace_ops pstore_ftrace_ops __read_mostly = {
-- 
2.25.1


-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#10982): 
https://lists.yoctoproject.org/g/linux-yocto/message/10982
Mute This Topic: https://lists.yoctoproject.org/mt/89382548/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] intel-x86: preempt-rt: Disable CONFIG_NUMA_BALANCING

2021-12-13 Thread He Zhe
CONFIG_NUMA_BALANCING has been set to depend on !PREEMPT_RT according to
https://git.yoctoproject.org/linux-yocto-dev/commit/?h=standard/preempt-rt/base=554b0f3ca6f4948fdbab5f199858d902061318d0

and thus causes the following warnings on all preempt branches.
[NOTE]: 'CONFIG_NUMA_BALANCING' last val (y) and .config val (n) do not match
[NOTE]: 'CONFIG_NUMA_BALANCING_DEFAULT_ENABLED' last val (y) and .config val 
(n) do not match

Signed-off-by: He Zhe 
---
 bsp/intel-x86/intel-x86-64-preempt-rt.scc | 1 +
 intel-x86-64-preempt-rt.cfg   | 4 
 2 files changed, 5 insertions(+)
 create mode 100644 intel-x86-64-preempt-rt.cfg

diff --git a/bsp/intel-x86/intel-x86-64-preempt-rt.scc 
b/bsp/intel-x86/intel-x86-64-preempt-rt.scc
index e759c884..38331ac8 100644
--- a/bsp/intel-x86/intel-x86-64-preempt-rt.scc
+++ b/bsp/intel-x86/intel-x86-64-preempt-rt.scc
@@ -7,3 +7,4 @@ include ktypes/preempt-rt
 
 include intel-x86-64.scc
 kconf hardware cfs-bandwidth.cfg
+kconf hardware intel-x86-64-preempt-rt.cfg
diff --git a/intel-x86-64-preempt-rt.cfg b/intel-x86-64-preempt-rt.cfg
new file mode 100644
index ..9880d740
--- /dev/null
+++ b/intel-x86-64-preempt-rt.cfg
@@ -0,0 +1,4 @@
+# SPDX-License-Identifier: MIT
+
+# CONFIG_NUMA_BALANCING is not set
+# CONFIG_NUMA_BALANCING_DEFAULT_ENABLED is not set
-- 
2.17.1


-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#10737): 
https://lists.yoctoproject.org/g/linux-yocto/message/10737
Mute This Topic: https://lists.yoctoproject.org/mt/87694195/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][yocto-5.10][PATCH] intel-x86: preempt-rt: Disable CONFIG_NUMA_BALANCING

2021-12-13 Thread He Zhe
CONFIG_NUMA_BALANCING has been set to depend on !PREEMPT_RT according to
https://git.yoctoproject.org/linux-yocto/commit/?h=v5.10/standard/preempt-rt/base=53ecacfc9c6861e44f4e0a3754f038224aa7fb23

and thus causes the following warnings on all preempt branches.
[NOTE]: 'CONFIG_NUMA_BALANCING' last val (y) and .config val (n) do not match
[NOTE]: 'CONFIG_NUMA_BALANCING_DEFAULT_ENABLED' last val (y) and .config val 
(n) do not match

Signed-off-by: He Zhe 
---
 bsp/intel-x86/intel-x86-64-preempt-rt.scc | 1 +
 intel-x86-64-preempt-rt.cfg   | 4 
 2 files changed, 5 insertions(+)
 create mode 100644 intel-x86-64-preempt-rt.cfg

diff --git a/bsp/intel-x86/intel-x86-64-preempt-rt.scc 
b/bsp/intel-x86/intel-x86-64-preempt-rt.scc
index bd31121b..197b5064 100644
--- a/bsp/intel-x86/intel-x86-64-preempt-rt.scc
+++ b/bsp/intel-x86/intel-x86-64-preempt-rt.scc
@@ -8,3 +8,4 @@ include ktypes/preempt-rt
 include intel-x86-64.scc
 include features/tsn/tsn.scc
 kconf hardware cfs-bandwidth.cfg
+kconf hardware intel-x86-64-preempt-rt.cfg
diff --git a/intel-x86-64-preempt-rt.cfg b/intel-x86-64-preempt-rt.cfg
new file mode 100644
index ..9880d740
--- /dev/null
+++ b/intel-x86-64-preempt-rt.cfg
@@ -0,0 +1,4 @@
+# SPDX-License-Identifier: MIT
+
+# CONFIG_NUMA_BALANCING is not set
+# CONFIG_NUMA_BALANCING_DEFAULT_ENABLED is not set
-- 
2.17.1


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



[linux-yocto][v5.10/standard/preempt-rt/base][PATCH] arm64: signal: Delay calling signals in atomic

2021-10-19 Thread He Zhe
Debugging with breakpoints on arm64 and RT would trigger the following
call trace. When CONFIG_PREEMPT_RT is enabled, spin_locks become mutexes,
and one of these is the spin lock used in signal handling.

BUG: sleeping function called from invalid context at 
kernel/locking/rtmutex.c:969
in_atomic(): 1, irqs_disabled(): 0, non_block: 0, pid: 17192, name: multi-timer
INFO: lockdep is turned off.
Preemption disabled at:
[] debug_exception_enter+0x20/0x70
CPU: 1 PID: 17192 Comm: multi-timer Not tainted 5.10.63-rt47-yocto-preempt-rt #1
Hardware name: Freescale S32G274 (DT)
Call trace:
 dump_backtrace+0x0/0x1d4
 show_stack+0x24/0x30
 dump_stack+0xf0/0x13c
 ___might_sleep+0x17c/0x1f0
 rt_spin_lock+0x6c/0x104
 force_sig_info_to_task+0x30/0x12c
 force_sig_fault+0x58/0x80
 arm64_force_sig_fault+0x4c/0x7c
 send_user_sigtrap+0x50/0x84
 brk_handler+0x40/0x70
 do_debug_exception+0x78/0x194
 el0_dbg+0x34/0x54
 el0_sync_handler+0x110/0x1b0
 el0_sync+0x180/0x1c0

Fix potential sleep while atomic in the similar way of
2dbbc3a07009 ("signal/x86: Delay calling signals in atomic")

Define ARCH_RT_DELAYS_SIGNAL_SEND to enable delaying action in
force_sig_info_to_task. Add actual sending action to arm64 specific path.

Link: https://lore.kernel.org/all/20211015170325.li5rugf6u4rgh...@linutronix.de/
Back ported for 5.10
Signed-off-by: He Zhe 
---
 arch/arm64/include/asm/signal.h | 11 +++
 arch/arm64/kernel/signal.c  |  8 
 2 files changed, 19 insertions(+)
 create mode 100644 arch/arm64/include/asm/signal.h

diff --git a/arch/arm64/include/asm/signal.h b/arch/arm64/include/asm/signal.h
new file mode 100644
index ..dea713119b5b
--- /dev/null
+++ b/arch/arm64/include/asm/signal.h
@@ -0,0 +1,11 @@
+/* SPDX-License-Identifier: GPL-2.0 */
+#ifndef __ARM64_ASM_SIGNAL_H
+#define __ARM64_ASM_SIGNAL_H
+
+#include 
+
+#if defined(CONFIG_PREEMPT_RT)
+#define ARCH_RT_DELAYS_SIGNAL_SEND
+#endif
+
+#endif
diff --git a/arch/arm64/kernel/signal.c b/arch/arm64/kernel/signal.c
index fe94a3e1f849..10b9ac9988a3 100644
--- a/arch/arm64/kernel/signal.c
+++ b/arch/arm64/kernel/signal.c
@@ -927,6 +927,14 @@ asmlinkage void do_notify_resume(struct pt_regs *regs,
} else {
local_daif_restore(DAIF_PROCCTX);
 
+#ifdef ARCH_RT_DELAYS_SIGNAL_SEND
+   if (unlikely(current->forced_info.si_signo)) {
+   struct task_struct *t = current;
+   force_sig_info(>forced_info);
+   t->forced_info.si_signo = 0;
+   }
+#endif
+
if (thread_flags & _TIF_UPROBE)
uprobe_notify_resume(regs);
 
-- 
2.17.1


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



[linux-yocto][v5.10/standard/base][PATCH 1/2] perf: Cap allocation order at aux_watermark

2021-07-13 Thread He Zhe
From: Alexander Shishkin 

Currently, we start allocating AUX pages half the size of the total
requested AUX buffer size, ignoring the attr.aux_watermark setting. This,
in turn, makes intel_pt driver disregard the watermark also, as it uses
page order for its SG (ToPA) configuration.

Now, this can be fixed in the intel_pt PMU driver, but seeing as it's the
only one currently making use of high order allocations, there is no
reason not to fix the allocator instead. This way, any other driver
wishing to add this support would not have to worry about this.

Signed-off-by: Alexander Shishkin 
Signed-off-by: Peter Zijlstra (Intel) 
Link: 
https://lkml.kernel.org/r/20210414154955.49603-2-alexander.shish...@linux.intel.com

perf, pt: Improve data loss
https://lore.kernel.org/lkml/20210414154955.49603-1-alexander.shish...@linux.intel.com/
Signed-off-by: He Zhe 
---
 kernel/events/ring_buffer.c | 34 ++
 1 file changed, 18 insertions(+), 16 deletions(-)

diff --git a/kernel/events/ring_buffer.c b/kernel/events/ring_buffer.c
index ef91ae75ca56..dd49506f7bd8 100644
--- a/kernel/events/ring_buffer.c
+++ b/kernel/events/ring_buffer.c
@@ -674,21 +674,26 @@ int rb_alloc_aux(struct perf_buffer *rb, struct 
perf_event *event,
if (!has_aux(event))
return -EOPNOTSUPP;
 
-   /*
-* We need to start with the max_order that fits in nr_pages,
-* not the other way around, hence ilog2() and not get_order.
-*/
-   max_order = ilog2(nr_pages);
-
-   /*
-* PMU requests more than one contiguous chunks of memory
-* for SW double buffering
-*/
if (!overwrite) {
-   if (!max_order)
-   return -EINVAL;
+   /*
+* Watermark defaults to half the buffer, and so does the
+* max_order, to aid PMU drivers in double buffering.
+*/
+   if (!watermark)
+   watermark = nr_pages << (PAGE_SHIFT - 1);
 
-   max_order--;
+   /*
+* Use aux_watermark as the basis for chunking to
+* help PMU drivers honor the watermark.
+*/
+   max_order = get_order(watermark);
+   } else {
+   /*
+* We need to start with the max_order that fits in nr_pages,
+* not the other way around, hence ilog2() and not get_order.
+*/
+   max_order = ilog2(nr_pages);
+   watermark = 0;
}
 
rb->aux_pages = kcalloc_node(nr_pages, sizeof(void *), GFP_KERNEL,
@@ -743,9 +748,6 @@ int rb_alloc_aux(struct perf_buffer *rb, struct perf_event 
*event,
rb->aux_overwrite = overwrite;
rb->aux_watermark = watermark;
 
-   if (!rb->aux_watermark && !rb->aux_overwrite)
-   rb->aux_watermark = nr_pages << (PAGE_SHIFT - 1);
-
 out:
if (!ret)
rb->aux_pgoff = pgoff;
-- 
2.29.2


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



[linux-yocto][v5.10/standard/base][PATCH 2/2] perf intel-pt: Use aux_watermark

2021-07-13 Thread He Zhe
From: Alexander Shishkin 

Turns out, the default setting of attr.aux_watermark to half of the total
buffer size is not very useful, especially with smaller buffers. The
problem is that, after half of the buffer is filled up, the kernel updates
->aux_head and sets up the next "transaction", while observing that
->aux_tail is still zero (as userspace haven't had the chance to update
it), meaning that the trace will have to stop at the end of this second
"transaction". This means, for example, that the second PERF_RECORD_AUX in
every trace comes with TRUNCATED flag set.

Setting attr.aux_watermark to quarter of the buffer gives enough space for
the ->aux_tail update to be observed and prevents the data loss.

The obligatory before/after showcase:

> # perf_before record -e intel_pt//u -m,8 uname
> Linux
> [ perf record: Woken up 6 times to write data ]
> Warning:
> AUX data lost 4 times out of 10!
>
> [ perf record: Captured and wrote 0.099 MB perf.data ]
> # perf record -e intel_pt//u -m,8 uname
> Linux
> [ perf record: Woken up 4 times to write data ]
> [ perf record: Captured and wrote 0.039 MB perf.data ]

The effect is still visible with large workloads and large buffers,
although less pronounced.

Signed-off-by: Alexander Shishkin 
Signed-off-by: Peter Zijlstra (Intel) 
Link: 
https://lkml.kernel.org/r/20210414154955.49603-3-alexander.shish...@linux.intel.com

perf, pt: Improve data loss
https://lore.kernel.org/lkml/20210414154955.49603-1-alexander.shish...@linux.intel.com/
Signed-off-by: He Zhe 
---
 tools/perf/arch/x86/util/intel-pt.c | 6 ++
 1 file changed, 6 insertions(+)

diff --git a/tools/perf/arch/x86/util/intel-pt.c 
b/tools/perf/arch/x86/util/intel-pt.c
index 082e5f2a415a..3c6745e28f57 100644
--- a/tools/perf/arch/x86/util/intel-pt.c
+++ b/tools/perf/arch/x86/util/intel-pt.c
@@ -776,6 +776,12 @@ static int intel_pt_recording_options(struct 
auxtrace_record *itr,
}
}
 
+   if (!opts->auxtrace_snapshot_mode && !opts->auxtrace_sample_mode) {
+   u32 aux_watermark = opts->auxtrace_mmap_pages * page_size / 4;
+
+   intel_pt_evsel->core.attr.aux_watermark = aux_watermark;
+   }
+
intel_pt_parse_terms(intel_pt_pmu->name, _pt_pmu->format,
 "tsc", _bit);
 
-- 
2.29.2


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



[linux-yocto][v5.10/standard/base][PATCH] timers: Fix get_next_timer_interrupt() with no timers pending

2021-07-12 Thread He Zhe
From: Frederic Weisbecker 

31cd0e119d50 ("timers: Recalculate next timer interrupt only when
necessary") subtly altered get_next_timer_interrupt()'s behaviour. The
function no longer consistently returns KTIME_MAX with no timers
pending.

In order to decide if there are any timers pending we check whether the
next expiry will happen NEXT_TIMER_MAX_DELTA jiffies from now.
Unfortunately, the next expiry time and the timer base clock are no
longer updated in unison. The former changes upon certain timer
operations (enqueue, expire, detach), whereas the latter keeps track of
jiffies as they move forward. Ultimately breaking the logic above.

A simplified example:

- Upon entering get_next_timer_interrupt() with:

jiffies = 1
base->clk = 0;
base->next_expiry = NEXT_TIMER_MAX_DELTA;

  'base->next_expiry == base->clk + NEXT_TIMER_MAX_DELTA', the function
  returns KTIME_MAX.

- 'base->clk' is updated to the jiffies value.

- The next time we enter get_next_timer_interrupt(), taking into account
  no timer operations happened:

base->clk = 1;
base->next_expiry = NEXT_TIMER_MAX_DELTA;

  'base->next_expiry != base->clk + NEXT_TIMER_MAX_DELTA', the function
  returns a valid expire time, which is incorrect.

This ultimately might unnecessarily rearm sched's timer on nohz_full
setups, and add latency to the system[1].

So, introduce 'base->timers_pending'[2], update it every time
'base->next_expiry' changes, and use it in get_next_timer_interrupt().

[1] See tick_nohz_stop_tick().
[2] A quick pahole check on x86_64 and arm64 shows it doesn't make
'struct timer_base' any bigger.

Fixes: 31cd0e119d50 ("timers: Recalculate next timer interrupt only when 
necessary")
Signed-off-by: Nicolas Saenz Julienne 
Acked-by: Frederic Weisbecker 

Link: https://lore.kernel.org/lkml/20210710005243.GA23956@lothringen/
Signed-off-by: He Zhe 
---
This fixes the bug that arch_timer interrupt counts keep increasing on isolated 
cores for all arm64
This has been acked by the original problematic commit author and I have 
validated it.

 kernel/time/timer.c | 8 +---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/kernel/time/timer.c b/kernel/time/timer.c
index d111adf4a0cb..99b97ccefdbd 100644
--- a/kernel/time/timer.c
+++ b/kernel/time/timer.c
@@ -207,6 +207,7 @@ struct timer_base {
unsigned intcpu;
boolnext_expiry_recalc;
boolis_idle;
+   booltimers_pending;
DECLARE_BITMAP(pending_map, WHEEL_SIZE);
struct hlist_head   vectors[WHEEL_SIZE];
 } cacheline_aligned;
@@ -595,6 +596,7 @@ static void enqueue_timer(struct timer_base *base, struct 
timer_list *timer,
 * can reevaluate the wheel:
 */
base->next_expiry = bucket_expiry;
+   base->timers_pending = true;
base->next_expiry_recalc = false;
trigger_dyntick_cpu(base, timer);
}
@@ -1596,6 +1598,7 @@ static unsigned long __next_timer_interrupt(struct 
timer_base *base)
}
 
base->next_expiry_recalc = false;
+   base->timers_pending = !(next == base->clk + NEXT_TIMER_MAX_DELTA);
 
return next;
 }
@@ -1647,7 +1650,6 @@ u64 get_next_timer_interrupt(unsigned long basej, u64 
basem)
struct timer_base *base = this_cpu_ptr(_bases[BASE_STD]);
u64 expires = KTIME_MAX;
unsigned long nextevt;
-   bool is_max_delta;
 
/*
 * Pretend that there is no timer pending if the cpu is offline.
@@ -1660,7 +1662,6 @@ u64 get_next_timer_interrupt(unsigned long basej, u64 
basem)
if (base->next_expiry_recalc)
base->next_expiry = __next_timer_interrupt(base);
nextevt = base->next_expiry;
-   is_max_delta = (nextevt == base->clk + NEXT_TIMER_MAX_DELTA);
 
/*
 * We have a fresh next event. Check whether we can forward the
@@ -1678,7 +1679,7 @@ u64 get_next_timer_interrupt(unsigned long basej, u64 
basem)
expires = basem;
base->is_idle = false;
} else {
-   if (!is_max_delta)
+   if (base->timers_pending)
expires = basem + (u64)(nextevt - basej) * TICK_NSEC;
/*
 * If we expect to sleep more than a tick, mark the base idle.
@@ -1961,6 +1962,7 @@ int timers_prepare_cpu(unsigned int cpu)
base = per_cpu_ptr(_bases[b], cpu);
base->clk = jiffies;
base->next_expiry = base->clk + NEXT_TIMER_MAX_DELTA;
+   base->timers_pending = false;
base->is_idle = false;
}
return 0;
-- 
2.29.2


-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#10090): 
https://lists.yoctoproject

[linux-yocto][yocto-kernel-cache][master yocto-5.13][PATCH] kfence: Initial enablement

2021-06-22 Thread He Zhe
Kernel Electric-Fence (KFENCE) is a low-overhead sampling-based memory safety
error detector. KFENCE detects heap out-of-bounds access, use-after-free, and
invalid-free errors.

KFENCE is designed to be enabled in production kernels, and has near zero
performance overhead. Compared to KASAN, KFENCE trades precision for
performance.

Signed-off-by: He Zhe 
---
 features/kfence/kfence.cfg | 2 ++
 features/kfence/kfence.scc | 5 +
 2 files changed, 7 insertions(+)
 create mode 100644 features/kfence/kfence.cfg
 create mode 100644 features/kfence/kfence.scc

diff --git a/features/kfence/kfence.cfg b/features/kfence/kfence.cfg
new file mode 100644
index ..6f4875c3
--- /dev/null
+++ b/features/kfence/kfence.cfg
@@ -0,0 +1,2 @@
+# SPDX-License-Identifier: MIT
+CONFIG_KFENCE=y
diff --git a/features/kfence/kfence.scc b/features/kfence/kfence.scc
new file mode 100644
index ..741bca26
--- /dev/null
+++ b/features/kfence/kfence.scc
@@ -0,0 +1,5 @@
+# SPDX-License-Identifier: MIT
+define KFEATURE_DESCRIPTION "a low-overhead sampling-based memory safety error 
detector"
+define KFEATURE_COMPATIBILITY arch
+
+kconf non-hardware kfence.cfg
-- 
2.17.1


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



[linux-yocto][v5.10/standard/preempt-rt/base][PATCH] ptrace: Fix make ptrace() fail if the tracee changed its pid unexpectedly

2021-06-17 Thread He Zhe
A part of dbb5afad100a ("ptrace: make ptrace() fail if the tracee changed its 
pid unexpectedly")
is missing during merge, which invalidates the commit.

Signed-off-by: He Zhe 
---
 kernel/ptrace.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/kernel/ptrace.c b/kernel/ptrace.c
index ee935f6c2300..ec2d9fd37a11 100644
--- a/kernel/ptrace.c
+++ b/kernel/ptrace.c
@@ -194,7 +194,8 @@ static bool ptrace_freeze_traced(struct task_struct *task)
return ret;
 
spin_lock_irq(>sighand->siglock);
-   if (task_is_traced(task) && !__fatal_signal_pending(task)) {
+   if (task_is_traced(task) && !looks_like_a_spurious_pid(task) &&
+   !__fatal_signal_pending(task)) {
unsigned long flags;
 
raw_spin_lock_irqsave(>pi_lock, flags);
-- 
2.29.2


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



[linux-yocto] missing cfg/crypto-obsolete-disable.scc

2021-05-14 Thread He Zhe
Hi Bruce,

Seems cfg/crypto-obsolete-disable.scc is missing from the commit
5eb0bebcf0b5 ("ktypes/standard: disable obsolete crypto options by default")

Regards,
Zhe

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



[linux-yocto] preempt-rt build failure

2021-01-19 Thread He Zhe
Hi Bruce,

The following revert breaks preempt-rt build.

http://git.yoctoproject.org/cgit/cgit.cgi/linux-yocto/commit/?h=v5.10/standard/preempt-rt/base=491a86a368de0c75f18b85d01a3390dc2811c343

tmp-glibc/work-shared/qemux86-64/kernel-source/kernel/locking/rwsem.c:1517:54: 
error: implicit declaration of function '__down_read_interruptible'; did you 
mean 'down_read_interruptible'? [-Werror=implicit-function-declaration]


Zhe

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



[linux-yocto][linux-yocto][v5.4/standard/xlnx-soc][PATCH] net: axienet: Remove static from __axienet_device_reset

2020-11-15 Thread He Zhe
__axienet_device_reset is referenced from different source files.

Fixes: 59b0ea17cf64 ("net: axienet: Add missing return value type for 
__axienet_device_reset")
Signed-off-by: He Zhe 
---
 drivers/net/ethernet/xilinx/xilinx_axienet.h  | 2 +-
 drivers/net/ethernet/xilinx/xilinx_axienet_main.c | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/net/ethernet/xilinx/xilinx_axienet.h 
b/drivers/net/ethernet/xilinx/xilinx_axienet.h
index b8d94f7ae9af..f9746e3eca95 100644
--- a/drivers/net/ethernet/xilinx/xilinx_axienet.h
+++ b/drivers/net/ethernet/xilinx/xilinx_axienet.h
@@ -1065,7 +1065,7 @@ irqreturn_t __maybe_unused axienet_tx_irq(int irq, void 
*_ndev);
 irqreturn_t __maybe_unused axienet_rx_irq(int irq, void *_ndev);
 void axienet_start_xmit_done(struct net_device *ndev, struct axienet_dma_q *q);
 void axienet_dma_bd_release(struct net_device *ndev);
-void __axienet_device_reset(struct axienet_dma_q *q);
+int __axienet_device_reset(struct axienet_dma_q *q);
 void axienet_set_mac_address(struct net_device *ndev, const void *address);
 void axienet_set_multicast_list(struct net_device *ndev);
 int xaxienet_rx_poll(struct napi_struct *napi, int quota);
diff --git a/drivers/net/ethernet/xilinx/xilinx_axienet_main.c 
b/drivers/net/ethernet/xilinx/xilinx_axienet_main.c
index 4f2a853d34b6..af98135aa1b2 100644
--- a/drivers/net/ethernet/xilinx/xilinx_axienet_main.c
+++ b/drivers/net/ethernet/xilinx/xilinx_axienet_main.c
@@ -387,7 +387,7 @@ static void xxvenet_setoptions(struct net_device *ndev, u32 
options)
 }
 
 
-static int __axienet_device_reset(struct axienet_dma_q *q)
+int __axienet_device_reset(struct axienet_dma_q *q)
 {
u32 timeout;
 
-- 
2.17.1


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



[linux-yocto][linux-yocto][v5.4/standard/xlnx-soc][PATCH] net: axienet: Add missing return value type for __axienet_device_reset

2020-11-10 Thread He Zhe
To fix the following build warnings and the related work flow.

drivers/net/ethernet/xilinx/xilinx_axienet_main.c:409:11: warning:
'return' with a value, in function returning void [-Wreturn-type]

drivers/net/ethernet/xilinx/xilinx_axienet_main.c:413:9: warning:
'return' with a value, in function returning void [-Wreturn-type]

Fixes: 00c44b7e5c15 ("Merge branch 'v5.4/standard/base' into 
v5.4/standard/xlnx-soc")
Signed-off-by: He Zhe 
---
 drivers/net/ethernet/xilinx/xilinx_axienet_main.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/xilinx/xilinx_axienet_main.c 
b/drivers/net/ethernet/xilinx/xilinx_axienet_main.c
index cd6db1d21b40..4f2a853d34b6 100644
--- a/drivers/net/ethernet/xilinx/xilinx_axienet_main.c
+++ b/drivers/net/ethernet/xilinx/xilinx_axienet_main.c
@@ -387,7 +387,7 @@ static void xxvenet_setoptions(struct net_device *ndev, u32 
options)
 }
 
 
-void __axienet_device_reset(struct axienet_dma_q *q)
+static int __axienet_device_reset(struct axienet_dma_q *q)
 {
u32 timeout;
 
-- 
2.17.1


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



[linux-yocto][linux-yocto-dev][PATCH] SUNRPC: Fix svc_flush_dcache()

2020-09-28 Thread He Zhe
From: Chuck Lever 

On platforms that implement flush_dcache_page(), a large NFS WRITE
triggers the WARN_ONCE in bvec_iter_advance():

Sep 20 14:01:05 klimt.1015granger.net kernel: Attempted to advance past end of 
bvec iter
Sep 20 14:01:05 klimt.1015granger.net kernel: WARNING: CPU: 0 PID: 1032 at 
include/linux/bvec.h:101 bvec_iter_advance.isra.0+0xa7/0x158 [sunrpc]

Sep 20 14:01:05 klimt.1015granger.net kernel: Call Trace:
Sep 20 14:01:05 klimt.1015granger.net kernel:  svc_tcp_recvfrom+0x60c/0x12c7 
[sunrpc]
Sep 20 14:01:05 klimt.1015granger.net kernel:  ? 
bvec_iter_advance.isra.0+0x158/0x158 [sunrpc]
Sep 20 14:01:05 klimt.1015granger.net kernel:  ? del_timer_sync+0x4b/0x55
Sep 20 14:01:05 klimt.1015granger.net kernel:  ? test_bit+0x1d/0x27 [sunrpc]
Sep 20 14:01:05 klimt.1015granger.net kernel:  svc_recv+0x1193/0x15e4 [sunrpc]
Sep 20 14:01:05 klimt.1015granger.net kernel:  ? try_to_freeze.isra.0+0x6f/0x6f 
[sunrpc]
Sep 20 14:01:05 klimt.1015granger.net kernel:  ? 
refcount_sub_and_test.constprop.0+0x13/0x40 [sunrpc]
Sep 20 14:01:05 klimt.1015granger.net kernel:  ? svc_xprt_put+0x1e/0x29f 
[sunrpc]
Sep 20 14:01:05 klimt.1015granger.net kernel:  ? svc_send+0x39f/0x3c1 [sunrpc]
Sep 20 14:01:05 klimt.1015granger.net kernel:  nfsd+0x282/0x345 [nfsd]
Sep 20 14:01:05 klimt.1015granger.net kernel:  ? __kthread_parkme+0x74/0xba
Sep 20 14:01:05 klimt.1015granger.net kernel:  kthread+0x2ad/0x2bc
Sep 20 14:01:05 klimt.1015granger.net kernel:  ? nfsd_destroy+0x124/0x124 [nfsd]
Sep 20 14:01:05 klimt.1015granger.net kernel:  ? test_bit+0x1d/0x27
Sep 20 14:01:05 klimt.1015granger.net kernel:  ? 
kthread_mod_delayed_work+0x115/0x115
Sep 20 14:01:05 klimt.1015granger.net kernel:  ret_from_fork+0x22/0x30

Reported-by: He Zhe 
Fixes: ca07eda33e01 ("SUNRPC: Refactor svc_recvfrom()")
Signed-off-by: Chuck Lever 
Link: 
https://lore.kernel.org/lkml/15694751-066e-18de-85d6-c47635a28...@windriver.com/
Signed-off-by: He Zhe 
---
 net/sunrpc/svcsock.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net/sunrpc/svcsock.c b/net/sunrpc/svcsock.c
index d5805fa1d066..c2752e2b9ce3 100644
--- a/net/sunrpc/svcsock.c
+++ b/net/sunrpc/svcsock.c
@@ -228,7 +228,7 @@ static int svc_one_sock_name(struct svc_sock *svsk, char 
*buf, int remaining)
 static void svc_flush_bvec(const struct bio_vec *bvec, size_t size, size_t 
seek)
 {
struct bvec_iter bi = {
-   .bi_size= size,
+   .bi_size= size + seek,
};
struct bio_vec bv;
 
-- 
2.17.1


-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#9093): 
https://lists.yoctoproject.org/g/linux-yocto/message/9093
Mute This Topic: https://lists.yoctoproject.org/mt/77170896/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] [standard/base] [PATCH] arm64/perf: Fix wrong cast that may cause wrong truncation

2020-09-17 Thread He Zhe
Hi Bruce,

This patch is missing for linux-yocto-dev from the latest rebase.

Thanks,
Zhe

On 8/21/20 3:03 AM, Bruce Ashfield wrote:
> merged to linux-yocto-dev standard/* and linux-yocto v5.8/standard/*
>
> Bruce
>
>
> In message: [linux-yocto] [standard/base] [PATCH] arm64/perf: Fix wrong cast 
> that may cause wrong truncation
> on 21/08/2020 zhe...@windriver.com wrote:
>
>> From: He Zhe 
>>
>> tail is a pointer while buftail.fp is a u32.
>>
>> arch/arm64/kernel/perf_callchain.c:100:6: warning: cast from pointer to
>> integer of different size [-Wpointer-to-int-cast]
>>   100 |  if ((u32)tail + 4 >= buftail.fp)
>>   |  ^
>> arch/arm64/kernel/perf_callchain.c:103:9: warning: cast to pointer from
>> integer of different size [-Wint-to-pointer-cast]{noformat}
>>   103 |  return (struct compat_frame_tail __user *)(buftail.fp - 4);
>>   | ^
>>
>> Fixes: 8818670c17d2 ("arm64/perf: fix backtrace for AAPCS with FP enabled")
>> Signed-off-by: He Zhe 
>> ---
>>  arch/arm64/kernel/perf_callchain.c | 4 ++--
>>  1 file changed, 2 insertions(+), 2 deletions(-)
>>
>> diff --git a/arch/arm64/kernel/perf_callchain.c 
>> b/arch/arm64/kernel/perf_callchain.c
>> index 1be96e3631ea..a4b0864c4e32 100644
>> --- a/arch/arm64/kernel/perf_callchain.c
>> +++ b/arch/arm64/kernel/perf_callchain.c
>> @@ -97,10 +97,10 @@ compat_user_backtrace(struct compat_frame_tail __user 
>> *tail,
>>   * Frame pointers should strictly progress back up the stack
>>   * (towards higher addresses).
>>   */
>> -if ((u32)tail + 4 >= buftail.fp)
>> +if ((u64)tail + 4 >= (u64)buftail.fp)
>>  return NULL;
>>  
>> -return (struct compat_frame_tail __user *)(buftail.fp - 4);
>> +return (struct compat_frame_tail __user *)((u64)buftail.fp - 4);
>>  }
>>  #endif /* CONFIG_COMPAT */
>>  
>> -- 
>> 2.17.1
>>


-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#9060): 
https://lists.yoctoproject.org/g/linux-yocto/message/9060
Mute This Topic: https://lists.yoctoproject.org/mt/76312403/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 and yocto-5.4 and later][PATCH] ti-am335x: Clean up useless and badly formatted fragments

2020-09-10 Thread He Zhe
From: He Zhe 

Fix the following warning.

WARNING: linux-yocto-5.4.x do_kernel_configcheck: [kernel config]:
 This BSP contains fragments with warnings:
[INFO]: Fragments with badly formatted configuration options:
- fragment configs/v5.4/standard/ti-am335x/bsp/ti-am335x/ti-am335x.cfg
  has the following issues: #CONFIG_USB_ANNOUNCE_NEW_DEVICES=y
- fragment configs/v5.4/standard/ti-am335x/bsp/ti-am335x/ti-am335x.cfg
  has the following issues: #CONFIG_USB_MON=m

Signed-off-by: He Zhe 
---
 bsp/ti-am335x/ti-am335x.cfg | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/bsp/ti-am335x/ti-am335x.cfg b/bsp/ti-am335x/ti-am335x.cfg
index 9ed4fff7..d5b9ee63 100644
--- a/bsp/ti-am335x/ti-am335x.cfg
+++ b/bsp/ti-am335x/ti-am335x.cfg
@@ -177,9 +177,6 @@ CONFIG_SND_SOC=m
 CONFIG_SND_SIMPLE_CARD=m
 
 
-#CONFIG_USB_ANNOUNCE_NEW_DEVICES=y
-#CONFIG_USB_MON=m
-
 #
 # USB Host Controller Drivers
 #
-- 
2.17.1

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.

View/Reply Online (#9044): 
https://lists.yoctoproject.org/g/linux-yocto/message/9044
Mute This Topic: https://lists.yoctoproject.org/mt/76750598/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][yocto-5.4/yocto-5.8/master][PATCH] netfilter: Enable nat for ipv4 and ipv6

2020-09-01 Thread He Zhe
From: He Zhe 

nat is widely used in virtualization environment. For example, libvirt expects
one of ipv4 and ipv6 nat working by default.

Signed-off-by: He Zhe 
---
 cfg/net/ip6_nf.cfg | 1 +
 cfg/net/ip_nf.cfg  | 1 +
 2 files changed, 2 insertions(+)

diff --git a/cfg/net/ip6_nf.cfg b/cfg/net/ip6_nf.cfg
index cb1db470..3458f9c4 100644
--- a/cfg/net/ip6_nf.cfg
+++ b/cfg/net/ip6_nf.cfg
@@ -12,3 +12,4 @@ CONFIG_IP6_NF_MATCH_EUI64=m
 CONFIG_IP6_NF_FILTER=m
 CONFIG_IP6_NF_MANGLE=m
 CONFIG_IP6_NF_RAW=m
+CONFIG_IP6_NF_NAT=m
diff --git a/cfg/net/ip_nf.cfg b/cfg/net/ip_nf.cfg
index 406be5bc..cf0251fa 100644
--- a/cfg/net/ip_nf.cfg
+++ b/cfg/net/ip_nf.cfg
@@ -17,3 +17,4 @@ CONFIG_IP_NF_RAW=m
 CONFIG_IP_NF_ARPTABLES=m
 CONFIG_IP_NF_ARPFILTER=m
 CONFIG_IP_NF_ARP_MANGLE=m
+CONFIG_IP_NF_NAT=m
-- 
2.17.1

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.

View/Reply Online (#9008): 
https://lists.yoctoproject.org/g/linux-yocto/message/9008
Mute This Topic: https://lists.yoctoproject.org/mt/76552328/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 yocto-5.4 yocto-5.2][PATCH] features/ocicontainer: Drop RT_GROUP_SCHED

2020-07-12 Thread He Zhe
From: He Zhe 

Systemd doesn't support RT group scheduling.
https://github.com/systemd/systemd/issues/13781#issuecomment-549164383

And lxc doesn't necessarily use this feature.

Signed-off-by: He Zhe 
---
 features/ocicontainer/lxc.cfg | 1 -
 1 file changed, 1 deletion(-)

diff --git a/features/ocicontainer/lxc.cfg b/features/ocicontainer/lxc.cfg
index 3fefc034..e195c15b 100644
--- a/features/ocicontainer/lxc.cfg
+++ b/features/ocicontainer/lxc.cfg
@@ -4,7 +4,6 @@ CONFIG_PROC_PID_CPUSET=y
 CONFIG_MEMCG=y
 CONFIG_CGROUP_SCHED=y
 CONFIG_FAIR_GROUP_SCHED=y
-CONFIG_RT_GROUP_SCHED=y
 CONFIG_CHECKPOINT_RESTORE=y
 CONFIG_NAMESPACES=y
 CONFIG_UTS_NS=y
-- 
2.17.1

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.

View/Reply Online (#8825): 
https://lists.yoctoproject.org/g/linux-yocto/message/8825
Mute This Topic: https://lists.yoctoproject.org/mt/75470715/21656
Group Owner: linux-yocto+ow...@lists.yoctoproject.org
Unsubscribe: https://lists.yoctoproject.org/g/linux-yocto/unsub  
[arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-


[linux-yocto][linux-yocto-dev][standard/base][PATCH] eventfd: Enlarge recursion limit to allow vhost to work

2020-06-05 Thread He Zhe
From: He Zhe 

Upstream link: 
https://lore.kernel.org/lkml/20200410114720.24838-1-zhe...@windriver.com/

commit b5e683d5cab8 ("eventfd: track eventfd_signal() recursion depth")
introduces a percpu counter that tracks the percpu recursion depth and
warn if it greater than zero, to avoid potential deadlock and stack
overflow.

However sometimes different eventfds may be used in parallel. Specifically,
when heavy network load goes through kvm and vhost, working as below, it
would trigger the following call trace.

-  100.00%
   - 66.51%
ret_from_fork
kthread
  - vhost_worker
 - 33.47% handle_tx_kick
  handle_tx
  handle_tx_copy
  vhost_tx_batch.isra.0
  vhost_add_used_and_signal_n
  eventfd_signal
 - 33.05% handle_rx_net
  handle_rx
  vhost_add_used_and_signal_n
  eventfd_signal
   - 33.49%
ioctl
entry_SYSCALL_64_after_hwframe
do_syscall_64
__x64_sys_ioctl
ksys_ioctl
do_vfs_ioctl
kvm_vcpu_ioctl
kvm_arch_vcpu_ioctl_run
vmx_handle_exit
handle_ept_misconfig
kvm_io_bus_write
__kvm_io_bus_write
eventfd_signal

001: WARNING: CPU: 1 PID: 1503 at fs/eventfd.c:73 eventfd_signal+0x85/0xa0
 snip 
001: Call Trace:
001:  vhost_signal+0x15e/0x1b0 [vhost]
001:  vhost_add_used_and_signal_n+0x2b/0x40 [vhost]
001:  handle_rx+0xb9/0x900 [vhost_net]
001:  handle_rx_net+0x15/0x20 [vhost_net]
001:  vhost_worker+0xbe/0x120 [vhost]
001:  kthread+0x106/0x140
001:  ? log_used.part.0+0x20/0x20 [vhost]
001:  ? kthread_park+0x90/0x90
001:  ret_from_fork+0x35/0x40
001: ---[ end trace 0003 ]---

This patch enlarges the limit to 1 which is the maximum recursion depth we
have found so far.

Signed-off-by: He Zhe 
---
 fs/eventfd.c| 3 ++-
 include/linux/eventfd.h | 3 +++
 2 files changed, 5 insertions(+), 1 deletion(-)

diff --git a/fs/eventfd.c b/fs/eventfd.c
index 78e41c7c3d05..8b9bd6fb08cd 100644
--- a/fs/eventfd.c
+++ b/fs/eventfd.c
@@ -70,7 +70,8 @@ __u64 eventfd_signal(struct eventfd_ctx *ctx, __u64 n)
 * it returns true, the eventfd_signal() call should be deferred to a
 * safe context.
 */
-   if (WARN_ON_ONCE(this_cpu_read(eventfd_wake_count)))
+   if (WARN_ON_ONCE(this_cpu_read(eventfd_wake_count) >
+   EFD_WAKE_COUNT_MAX))
return 0;
 
spin_lock_irqsave(>wqh.lock, flags);
diff --git a/include/linux/eventfd.h b/include/linux/eventfd.h
index dc4fd8a6644d..e7684d768e3f 100644
--- a/include/linux/eventfd.h
+++ b/include/linux/eventfd.h
@@ -29,6 +29,9 @@
 #define EFD_SHARED_FCNTL_FLAGS (O_CLOEXEC | O_NONBLOCK)
 #define EFD_FLAGS_SET (EFD_SHARED_FCNTL_FLAGS | EFD_SEMAPHORE)
 
+/* This is the maximum recursion depth we find so far */
+#define EFD_WAKE_COUNT_MAX 1
+
 struct eventfd_ctx;
 struct file;
 
-- 
2.17.1

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.

View/Reply Online (#8727): 
https://lists.yoctoproject.org/g/linux-yocto/message/8727
Mute This Topic: https://lists.yoctoproject.org/mt/74688802/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][linux-yocto-dev standard/base][PATCH] x86/mce: Add compat_ioctl assignment to make it compatible with 32-bit system

2020-05-20 Thread He Zhe
Could you please merge this? This has been accepted but not in mainline master.

Thanks,
Zhe

On 3/4/20 2:48 PM, He Zhe wrote:
> From: He Zhe 
>
> 32-bit user-space program would get errors like the following from ioctl
> syscall due to missing compat_ioctl.
> MCE_GET_RECORD_LEN: Inappropriate ioctl for device
>
> compat_ptr_ioctl is provided as a generic implementation of .compat_ioctl
> file operation to ioctl functions that either ignore the argument or pass
> a pointer to a compatible data type.
>
> https://lore.kernel.org/lkml/1583303947-49858-1-git-send-email-zhe...@windriver.com/
>
> Signed-off-by: He Zhe 
> ---
>  arch/x86/kernel/cpu/mce/dev-mcelog.c | 1 +
>  1 file changed, 1 insertion(+)
>
> diff --git a/arch/x86/kernel/cpu/mce/dev-mcelog.c 
> b/arch/x86/kernel/cpu/mce/dev-mcelog.c
> index 7c8958d..6c9b91b7 100644
> --- a/arch/x86/kernel/cpu/mce/dev-mcelog.c
> +++ b/arch/x86/kernel/cpu/mce/dev-mcelog.c
> @@ -328,6 +328,7 @@ static const struct file_operations mce_chrdev_ops = {
>   .write  = mce_chrdev_write,
>   .poll   = mce_chrdev_poll,
>   .unlocked_ioctl = mce_chrdev_ioctl,
> + .compat_ioctl   = compat_ptr_ioctl,
>   .llseek = no_llseek,
>  };
>  
>
> 

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.

View/Reply Online (#8708): 
https://lists.yoctoproject.org/g/linux-yocto/message/8708
Mute This Topic: https://lists.yoctoproject.org/mt/74368714/21656
Group Owner: linux-yocto+ow...@lists.yoctoproject.org
Unsubscribe: https://lists.yoctoproject.org/g/linux-yocto/unsub  
[arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-


[linux-yocto][master yocto-5.4][PATCH] bpf: Add CONFIG_IKHEADERS

2020-04-27 Thread He Zhe
From: He Zhe 

bcc and bpftrace may require kernel headers to be able to build tools.
Otherwise it would fail as

modprobe: module kheaders not found in modules.dep
Unable to find kernel headers. Try rebuilding kernel with CONFIG_IKHEADERS=m 
(module)

Signed-off-by: He Zhe 
---
 features/bpf/bpf.cfg | 1 +
 1 file changed, 1 insertion(+)

diff --git a/features/bpf/bpf.cfg b/features/bpf/bpf.cfg
index b90e87a..b6858ba 100644
--- a/features/bpf/bpf.cfg
+++ b/features/bpf/bpf.cfg
@@ -4,3 +4,4 @@ CONFIG_BPF_SYSCALL=y
 CONFIG_BPF_JIT=y
 CONFIG_BPF_EVENTS=y
 CONFIG_CGROUP_BPF=y
+CONFIG_IKHEADERS=m
-- 
2.7.4

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.

View/Reply Online (#8625): 
https://lists.yoctoproject.org/g/linux-yocto/message/8625
Mute This Topic: https://lists.yoctoproject.org/mt/73304858/21656
Group Owner: linux-yocto+ow...@lists.yoctoproject.org
Unsubscribe: https://lists.yoctoproject.org/g/linux-yocto/unsub  
[arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-


[linux-yocto] ARM: 8918/2: only build return_address() if needed

2020-04-01 Thread He Zhe
Hi Bruce,

fb033c95c94c ("ARM: 8918/2: only build return_address() if needed") fixing a
build warning is now on standard/base and v5.5/standard/base. Could you please
merge it to v5.4/standard/base too?

Zhe
-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.

View/Reply Online (#8573): 
https://lists.yoctoproject.org/g/linux-yocto/message/8573
Mute This Topic: https://lists.yoctoproject.org/mt/72718459/21656
Group Owner: linux-yocto+ow...@lists.yoctoproject.org
Unsubscribe: https://lists.yoctoproject.org/g/linux-yocto/unsub  
[arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-


[linux-yocto][standard/base v5.4/standard/base][PATCH] KVM: LAPIC: Mark hrtimer for period or oneshot mode to expire in hard interrupt context

2020-03-24 Thread He Zhe
From: He Zhe 

https://lore.kernel.org/lkml/a2eb9c9e-b8db-6d17-82b2-70014324f...@redhat.com/

apic->lapic_timer.timer was initialized with HRTIMER_MODE_ABS_HARD but
started later with HRTIMER_MODE_ABS, which may cause the following warning
in PREEMPT_RT kernel.

WARNING: CPU: 1 PID: 2957 at kernel/time/hrtimer.c:1129 
hrtimer_start_range_ns+0x348/0x3f0
CPU: 1 PID: 2957 Comm: qemu-system-x86 Not tainted 5.4.23-rt11 #1
Hardware name: Supermicro SYS-E300-9A-8C/A2SDi-8C-HLN4F, BIOS 1.1a 09/18/2018
RIP: 0010:hrtimer_start_range_ns+0x348/0x3f0
Code: 4d b8 0f 94 c1 0f b6 c9 e8 35 f1 ff ff 4c 8b 45
  b0 e9 3b fd ff ff e8 d7 3f fa ff 48 98 4c 03 34
  c5 a0 26 bf 93 e9 a1 fd ff ff <0f> 0b e9 fd fc ff
  ff 65 8b 05 fa b7 90 6d 89 c0 48 0f a3 05 60 91
RSP: 0018:bc60026ffaf8 EFLAGS: 00010202
RAX: 0001 RBX: 9d81657d4110 RCX: 
RDX:  RSI: 006cc7987bcf RDI: 9d81657d4110
RBP: bc60026ffb58 R08: 0001 R09: 0010
R10:  R11:  R12: 006cc7987bcf
R13:  R14: 006cc7987bcf R15: bc60026d6a00
FS: 7f401daed700() GS:9d81ffa4() knlGS:
CS: 0010 DS:  ES:  CR0: 80050033
CR2:  CR3: 000fa7574000 CR4: 003426e0
Call Trace:
? kvm_release_pfn_clean+0x22/0x60 [kvm]
start_sw_timer+0x85/0x230 [kvm]
? vmx_vmexit+0x1b/0x30 [kvm_intel]
kvm_lapic_switch_to_sw_timer+0x72/0x80 [kvm]
vmx_pre_block+0x1cb/0x260 [kvm_intel]
? vmx_vmexit+0xf/0x30 [kvm_intel]
? vmx_vmexit+0x1b/0x30 [kvm_intel]
? vmx_vmexit+0xf/0x30 [kvm_intel]
? vmx_vmexit+0x1b/0x30 [kvm_intel]
? vmx_vmexit+0xf/0x30 [kvm_intel]
? vmx_vmexit+0x1b/0x30 [kvm_intel]
? vmx_vmexit+0xf/0x30 [kvm_intel]
? vmx_vmexit+0xf/0x30 [kvm_intel]
? vmx_vmexit+0x1b/0x30 [kvm_intel]
? vmx_vmexit+0xf/0x30 [kvm_intel]
? vmx_vmexit+0x1b/0x30 [kvm_intel]
? vmx_vmexit+0xf/0x30 [kvm_intel]
? vmx_vmexit+0x1b/0x30 [kvm_intel]
? vmx_vmexit+0xf/0x30 [kvm_intel]
? vmx_vmexit+0x1b/0x30 [kvm_intel]
? vmx_vmexit+0xf/0x30 [kvm_intel]
? vmx_sync_pir_to_irr+0x9e/0x100 [kvm_intel]
? kvm_apic_has_interrupt+0x46/0x80 [kvm]
kvm_arch_vcpu_ioctl_run+0x85b/0x1fa0 [kvm]
? _raw_spin_unlock_irqrestore+0x18/0x50
? _copy_to_user+0x2c/0x30
kvm_vcpu_ioctl+0x235/0x660 [kvm]
? rt_spin_unlock+0x2c/0x50
do_vfs_ioctl+0x3e4/0x650
? __fget+0x7a/0xa0
ksys_ioctl+0x67/0x90
__x64_sys_ioctl+0x1a/0x20
do_syscall_64+0x4d/0x120
entry_SYSCALL_64_after_hwframe+0x44/0xa9
RIP: 0033:0x7f4027cc54a7
Code: 00 00 90 48 8b 05 e9 59 0c 00 64 c7 00 26 00 00
  00 48 c7 c0 ff ff ff ff c3 66 2e 0f 1f 84 00 00
  00 00 00 b8 10 00 00 00 0f 05 <48> 3d 01 f0 ff ff
  73 01 c3 48 8b 0d b9 59 0c 00 f7 d8 64 89 01 48
RSP: 002b:7f401dae9858 EFLAGS: 0246 ORIG_RAX: 0010
RAX: ffda RBX: 5558bd029690 RCX: 7f4027cc54a7
RDX:  RSI: ae80 RDI: 000d
RBP: 7f4028b72000 R08: 5558bc829ad0 R09: 
R10: 5558bcf90ca0 R11: 0246 R12: 
R13:  R14:  R15: 5558bce1c840
--[ end trace 0002 ]--

Signed-off-by: He Zhe 
---
 arch/x86/kvm/lapic.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/x86/kvm/lapic.c b/arch/x86/kvm/lapic.c
index e3099c6..929511e 100644
--- a/arch/x86/kvm/lapic.c
+++ b/arch/x86/kvm/lapic.c
@@ -1715,7 +1715,7 @@ static void start_sw_period(struct kvm_lapic *apic)
 
hrtimer_start(>lapic_timer.timer,
apic->lapic_timer.target_expiration,
-   HRTIMER_MODE_ABS);
+   HRTIMER_MODE_ABS_HARD);
 }
 
 bool kvm_lapic_hv_timer_in_use(struct kvm_vcpu *vcpu)
-- 
2.7.4

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.

View/Reply Online (#8551): 
https://lists.yoctoproject.org/g/linux-yocto/message/8551
Mute This Topic: https://lists.yoctoproject.org/mt/72513167/21656
Group Owner: linux-yocto+ow...@lists.yoctoproject.org
Unsubscribe: https://lists.yoctoproject.org/g/linux-yocto/unsub  
[arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-


[linux-yocto][v5.4/standard/base][PATCH] ARM: 8918/2: only build return_address() if needed

2020-03-24 Thread He Zhe
From: Ben Dooks 

The system currently warns if the config conditions for
building return_address in arch/arm/kernel/return_address.c
are not met, leaving just an EXPORT_SYMBOL_GPL(return_address)
of a function defined to be 'static linline'.
This is a result of aeea3592a13b ("ARM: 8158/1: LLVMLinux: use static inline in 
ARM ftrace.h").

Since we're not going to build anything other than an exported
symbol for something that is already being defined to be an
inline-able return of NULL, just avoid building the code to
remove the following warning:

Fixes: aeea3592a13b ("ARM: 8158/1: LLVMLinux: use static inline in ARM 
ftrace.h")
Signed-off-by: Ben Dooks 
Signed-off-by: Russell King 
---
 arch/arm/kernel/Makefile | 6 +-
 arch/arm/kernel/return_address.c | 4 
 2 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/arch/arm/kernel/Makefile b/arch/arm/kernel/Makefile
index 8cad594..8b679e2 100644
--- a/arch/arm/kernel/Makefile
+++ b/arch/arm/kernel/Makefile
@@ -17,10 +17,14 @@ CFLAGS_REMOVE_return_address.o = -pg
 # Object file lists.
 
 obj-y  := elf.o entry-common.o irq.o opcodes.o \
-  process.o ptrace.o reboot.o return_address.o \
+  process.o ptrace.o reboot.o \
   setup.o signal.o sigreturn_codes.o \
   stacktrace.o sys_arm.o time.o traps.o
 
+ifneq ($(CONFIG_ARM_UNWIND),y)
+obj-$(CONFIG_FRAME_POINTER)+= return_address.o
+endif
+
 obj-$(CONFIG_ATAGS)+= atags_parse.o
 obj-$(CONFIG_ATAGS_PROC)   += atags_proc.o
 obj-$(CONFIG_DEPRECATED_PARAM_STRUCT) += atags_compat.o
diff --git a/arch/arm/kernel/return_address.c b/arch/arm/kernel/return_address.c
index b0d2f1f..7b42ac0 100644
--- a/arch/arm/kernel/return_address.c
+++ b/arch/arm/kernel/return_address.c
@@ -7,8 +7,6 @@
  */
 #include 
 #include 
-
-#if defined(CONFIG_FRAME_POINTER) && !defined(CONFIG_ARM_UNWIND)
 #include 
 
 #include 
@@ -53,6 +51,4 @@ void *return_address(unsigned int level)
return NULL;
 }
 
-#endif /* if defined(CONFIG_FRAME_POINTER) && !defined(CONFIG_ARM_UNWIND) */
-
 EXPORT_SYMBOL_GPL(return_address);
-- 
2.7.4

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.

View/Reply Online (#8550): 
https://lists.yoctoproject.org/g/linux-yocto/message/8550
Mute This Topic: https://lists.yoctoproject.org/mt/72513165/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][linux-yocto v5.4/standard/preempt-rt/base v5.4/standard/preempt-rt/intel-x86 v5.4/standard/preempt-rt/bcm-2xxx-rpi][PATCH] aufs5:fix:avoid to access rw_sem.owner at rt kernel

2020-03-11 Thread He Zhe


On 3/11/20 3:44 PM, Xu, Yanfei wrote:
>
> On 3/11/20 12:14 PM, He Zhe wrote:
>>
>> On 3/10/20 2:50 PM, Xu, Yanfei wrote:
>>> From: Yanfei Xu 
>>>
>>> Fix build failure.
>>>
>>> Even though owner member is now made a permanent member of the
>>> rw_semaphore. The rw_semaphore in rwsem-rt.h doesn't have owner
>>> field still.
>>>
>>> -Error messages-
>>> |
>>> /buildarea1/nightly/WRLINUX_MASTER_WR/build_dir/OVP/GIT_202003/lxbuilds/intel-x86-64-preempt-rt-ovp-kvm/wrlinux/build_linux/tmp-glibc/work-shared/intel-x86-64/kernel-source/fs/aufs/i_op.c:
>>> In function 'au_pin_hdir_set_owner':
>>> |
>>> /buildarea1/nightly/WRLINUX_MASTER_WR/build_dir/OVP/GIT_202003/lxbuilds/intel-x86-64-preempt-rt-ovp-kvm/wrlinux/build_linux/tmp-glibc/work-shared/intel-x86-64/kernel-source/fs/aufs/i_op.c:643:45:
>>> error: 'struct rw_semaphore' has no member named 'owner'
>>> |   643 |  atomic_long_set(>hdir->hi_inode->i_rwsem.owner,
>>> (long)task);
>>> |   | ^
>>> |   CC  fs/btrfs/zstd.o
>>> |   AR  fs/kernfs/built-in.a
>>> |   CC  arch/x86/kernel/io_delay.o
>>> |   CC  net/ipv6/udplite.o
>>> | make[3]: ***
>>> [/buildarea1/nightly/WRLINUX_MASTER_WR/build_dir/OVP/GIT_202003/lxbuilds/intel-x86-64-preempt-rt-ovp-kvm/wrlinux/build_linux/tmp-glibc/work-shared/intel-x86-64/kernel-source/scripts/Makefile.build:265:
>>> fs/aufs/i_op.o] Error 1
>>> | make[3]: *** Waiting for unfinished jobs
>>> --
>>>
>>> Signed-off-by: Yanfei Xu 
>>> ---
>>>   fs/aufs/i_op.c | 2 ++
>>>   1 file changed, 2 insertions(+)
>>>
>>> diff --git a/fs/aufs/i_op.c b/fs/aufs/i_op.c
>>> index ef1e08c7ca10..b6b316b12144 100644
>>> --- a/fs/aufs/i_op.c
>>> +++ b/fs/aufs/i_op.c
>>> @@ -640,7 +640,9 @@ int au_pin_hdir_relock(struct au_pin *p)
>>>     static void au_pin_hdir_set_owner(struct au_pin *p, struct task_struct 
>>> *task)
>>>   {
>>> +#if !defined(CONFIG_PREEMPT_RT)
>>>   atomic_long_set(>hdir->hi_inode->i_rwsem.owner, (long)task);
>>> +#endif
>> This doesn't seem to work as it gives a no-op for RT kernel.
>>
>> The following diff should work, since rwsem in RT kernel had been 
>> implemented with rt_mutex.
>> But I haven't validated it.
>>
>> diff --git a/fs/aufs/i_op.c b/fs/aufs/i_op.c
>> index ef1e08c7ca10..37b535d19060 100644
>> --- a/fs/aufs/i_op.c
>> +++ b/fs/aufs/i_op.c
>> @@ -640,7 +640,7 @@ int au_pin_hdir_relock(struct au_pin *p)
>>     static void au_pin_hdir_set_owner(struct au_pin *p, struct task_struct 
>> *task)
>>   {
>> -   atomic_long_set(>hdir->hi_inode->i_rwsem.owner, (long)task);
>> +   p->hdir->hi_inode->i_rwsem.rtmutex.owner = task;
>>   }
>
> Good suggestion, and I think "#if !defined(CONFIG_PREEMPT_RT)" should be 
> reserved to avoid compile
>
> failure if someone compiles a kernel without CONFIG_PREEMPT_RT with 
> preempt_rt branchs.

The #if does not make much sense, since people wanting standard kernel should 
use standard branches. That's enforced by linux-yocto-*.bb.

>
> I will send a v2 patch soon.

Some smoke test needs to be done to make sure the change works well for aufs.

Zhe

>
> // Yanfei
>
>  
>
>>     void au_pin_hdir_acquire_nest(struct au_pin *p)
>>
>>
>> Zhe
>>
>>>   }
>>>     void au_pin_hdir_acquire_nest(struct au_pin *p)
>>>
>>> 
>>

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.

View/Reply Online (#8467): 
https://lists.yoctoproject.org/g/linux-yocto/message/8467
Mute This Topic: https://lists.yoctoproject.org/mt/71852365/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][linux-yocto-dev standard/base][PATCH 0/5] Revert disk invalidating updates

2020-03-10 Thread He Zhe


On 3/11/20 11:24 AM, Bruce Ashfield wrote:
> On Wed, Mar 4, 2020 at 10:40 AM  wrote:
>> From: He Zhe 
>>
>> This series of commits do not work with the latest systemd-udevd(v244, likely
>> v245). And the mainline has confirmed this potential misbehaviour.
>>
>> https://lore.kernel.org/lkml/20200304133738.gf21...@quack2.suse.cz/
>>
>> As it would run out of memory very soon and make the system unavailable, it
>> seems we'd better apply the reverts first.
> Since these came out, I've upgraded -dev to v5.6,  I can apply these
> to v5.5/*. Have you confirmed if 5.6 has the same issue ?

I just confirmed that it also happens with the latest 5.6-rc5.

Zhe

>
> Bruce
>
>> With this series of reverts applied, I just did some random file and disk
>> operations and did not meet errors.
>>
>> He Zhe (5):
>>   Revert "block: move clearing bd_invalidated into
>> check_disk_size_change"
>>   Revert "block: remove (__)blkdev_reread_part as an exported API"
>>   Revert "block: fix bdev_disk_changed for non-partitioned devices"
>>   Revert "block: move rescan_partitions to fs/block_dev.c"
>>   Revert "block: merge invalidate_partitions into rescan_partitions"
>>
>>  block/ioctl.c   | 37 +++
>>  block/partition-generic.c   | 52 -
>>  drivers/block/loop.c| 13 -
>>  drivers/s390/block/dasd_genhd.c |  4 +--
>>  fs/block_dev.c  | 50 ---
>>  include/linux/fs.h  |  4 +++
>>  include/linux/genhd.h   |  5 ++--
>>  7 files changed, 101 insertions(+), 64 deletions(-)
>>
>> --
>> 2.24.1
>>
>

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.

View/Reply Online (#8463): 
https://lists.yoctoproject.org/g/linux-yocto/message/8463
Mute This Topic: https://lists.yoctoproject.org/mt/71728956/21656
Group Owner: linux-yocto+ow...@lists.yoctoproject.org
Unsubscribe: https://lists.yoctoproject.org/g/linux-yocto/unsub  
[arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-


[linux-yocto][linux-yocto-dev standard/base][PATCH 4/5] Revert "block: move rescan_partitions to fs/block_dev.c"

2020-03-04 Thread He Zhe
From: He Zhe 

This reverts commit a1548b674403c0de70cc29a1575689917ba60157.
---
 block/partition-generic.c | 37 +++--
 fs/block_dev.c| 38 ++
 include/linux/fs.h|  2 ++
 include/linux/genhd.h |  4 ++--
 4 files changed, 41 insertions(+), 40 deletions(-)

diff --git a/block/partition-generic.c b/block/partition-generic.c
index 535fbb9b6337..c0f28eaf54f6 100644
--- a/block/partition-generic.c
+++ b/block/partition-generic.c
@@ -460,7 +460,7 @@ static bool disk_unlock_native_capacity(struct gendisk 
*disk)
}
 }
 
-int blk_drop_partitions(struct gendisk *disk, struct block_device *bdev)
+static int drop_partitions(struct gendisk *disk, struct block_device *bdev)
 {
struct disk_part_iter piter;
struct hd_struct *part;
@@ -530,7 +530,7 @@ static bool blk_add_partition(struct gendisk *disk, struct 
block_device *bdev,
return true;
 }
 
-int blk_add_partitions(struct gendisk *disk, struct block_device *bdev)
+static int blk_add_partitions(struct gendisk *disk, struct block_device *bdev)
 {
struct parsed_partitions *state;
int ret = -EAGAIN, p, highest;
@@ -597,6 +597,39 @@ int blk_add_partitions(struct gendisk *disk, struct 
block_device *bdev)
return ret;
 }
 
+int rescan_partitions(struct gendisk *disk, struct block_device *bdev,
+   bool invalidate)
+{
+   int ret;
+
+rescan:
+   ret = drop_partitions(disk, bdev);
+   if (ret)
+   return ret;
+
+   if (invalidate)
+   set_capacity(disk, 0);
+   else if (disk->fops->revalidate_disk)
+   disk->fops->revalidate_disk(disk);
+
+   check_disk_size_change(disk, bdev, !invalidate);
+   bdev->bd_invalidated = 0;
+
+   if (!get_capacity(disk)) {
+   /*
+* Tell userspace that the media / partition table may have
+* changed.
+*/
+   kobject_uevent(_to_dev(disk)->kobj, KOBJ_CHANGE);
+   return 0;
+   }
+
+   ret = blk_add_partitions(disk, bdev);
+   if (ret == -EAGAIN)
+   goto rescan;
+   return ret;
+}
+
 unsigned char *read_dev_sector(struct block_device *bdev, sector_t n, Sector 
*p)
 {
struct address_space *mapping = bdev->bd_inode->i_mapping;
diff --git a/fs/block_dev.c b/fs/block_dev.c
index ec10dacd18d0..0af62b76d031 100644
--- a/fs/block_dev.c
+++ b/fs/block_dev.c
@@ -1416,8 +1416,8 @@ static void flush_disk(struct block_device *bdev, bool 
kill_dirty)
  * and adjusts it if it differs. When shrinking the bdev size, its all caches
  * are freed.
  */
-static void check_disk_size_change(struct gendisk *disk,
-   struct block_device *bdev, bool verbose)
+void check_disk_size_change(struct gendisk *disk, struct block_device *bdev,
+   bool verbose)
 {
loff_t disk_size, bdev_size;
 
@@ -1508,40 +1508,6 @@ EXPORT_SYMBOL(bd_set_size);
 
 static void __blkdev_put(struct block_device *bdev, fmode_t mode, int 
for_part);
 
-static int rescan_partitions(struct gendisk *disk, struct block_device *bdev,
-   bool invalidate)
-{
-   int ret;
-
-rescan:
-   ret = blk_drop_partitions(disk, bdev);
-   if (ret)
-   return ret;
-
-   if (invalidate)
-   set_capacity(disk, 0);
-   else if (disk->fops->revalidate_disk)
-   disk->fops->revalidate_disk(disk);
-
-   check_disk_size_change(disk, bdev, !invalidate);
-   bdev->bd_invalidated = 0;
-
-   if (!get_capacity(disk)) {
-   /*
-* Tell userspace that the media / partition table may have
-* changed.
-*/
-   kobject_uevent(_to_dev(disk)->kobj, KOBJ_CHANGE);
-   return 0;
-   }
-
-   ret = blk_add_partitions(disk, bdev);
-   if (ret == -EAGAIN)
-   goto rescan;
-   return ret;
-}
-
-
 static void bdev_disk_changed(struct block_device *bdev, bool invalidate)
 {
if (disk_part_scan_enabled(bdev->bd_disk)) {
diff --git a/include/linux/fs.h b/include/linux/fs.h
index 30676ca9a258..cee484867d12 100644
--- a/include/linux/fs.h
+++ b/include/linux/fs.h
@@ -2710,6 +2710,8 @@ extern void make_bad_inode(struct inode *);
 extern bool is_bad_inode(struct inode *);
 
 #ifdef CONFIG_BLOCK
+extern void check_disk_size_change(struct gendisk *disk,
+   struct block_device *bdev, bool verbose);
 extern int revalidate_disk(struct gendisk *);
 extern int check_disk_change(struct block_device *);
 extern int __invalidate_device(struct block_device *, bool);
diff --git a/include/linux/genhd.h b/include/linux/genhd.h
index 0cc259daed8e..e661120c5b14 100644
--- a/include/linux/genhd.h
+++ b/include/linux/genhd.h
@@ -633,9 +633,9 @@ extern void blk_invalidate_devt(dev_t devt);
 extern dev_t blk_lookup_devt(const char *name, int partno)

[linux-yocto][linux-yocto-dev standard/base][PATCH 2/5] Revert "block: remove (__)blkdev_reread_part as an exported API"

2020-03-04 Thread He Zhe
From: He Zhe 

This reverts commit f0b870df80bc70dad432fd0c142bb709a49964f5.

Adjust context of block/ioctl.c
---
 block/ioctl.c   | 35 -
 drivers/block/loop.c| 13 +---
 drivers/s390/block/dasd_genhd.c |  4 +---
 fs/block_dev.c  |  7 ---
 include/linux/fs.h  |  2 ++
 5 files changed, 38 insertions(+), 23 deletions(-)

diff --git a/block/ioctl.c b/block/ioctl.c
index 5de98b97af2a..775023548cb7 100644
--- a/block/ioctl.c
+++ b/block/ioctl.c
@@ -155,21 +155,46 @@ static int blkpg_ioctl(struct block_device *bdev, struct 
blkpg_ioctl_arg __user
}
 }
 
-static int blkdev_reread_part(struct block_device *bdev)
+/*
+ * This is an exported API for the block driver, and will not
+ * acquire bd_mutex. This API should be used in case that
+ * caller has held bd_mutex already.
+ */
+int __blkdev_reread_part(struct block_device *bdev)
 {
-   int ret;
-
if (!disk_part_scan_enabled(bdev->bd_disk) || bdev != bdev->bd_contains)
return -EINVAL;
if (!capable(CAP_SYS_ADMIN))
return -EACCES;
 
+   lockdep_assert_held(>bd_mutex);
+
+   return bdev_disk_changed(bdev, false);
+}
+EXPORT_SYMBOL(__blkdev_reread_part);
+
+/*
+ * This is an exported API for the block driver, and will
+ * try to acquire bd_mutex. If bd_mutex has been held already
+ * in current context, please call __blkdev_reread_part().
+ *
+ * Make sure the held locks in current context aren't required
+ * in open()/close() handler and I/O path for avoiding ABBA deadlock:
+ * - bd_mutex is held before calling block driver's open/close
+ *   handler
+ * - reading partition table may submit I/O to the block device
+ */
+int blkdev_reread_part(struct block_device *bdev)
+{
+   int res;
+
mutex_lock(>bd_mutex);
-   ret = bdev_disk_changed(bdev, false);
+   res = __blkdev_reread_part(bdev);
mutex_unlock(>bd_mutex);
 
-   return ret;
+   return res;
 }
+EXPORT_SYMBOL(blkdev_reread_part);
 
 static int blk_ioctl_discard(struct block_device *bdev, fmode_t mode,
unsigned long arg, unsigned long flags)
diff --git a/drivers/block/loop.c b/drivers/block/loop.c
index 739b372a5112..ef6e251857c8 100644
--- a/drivers/block/loop.c
+++ b/drivers/block/loop.c
@@ -640,9 +640,7 @@ static void loop_reread_partitions(struct loop_device *lo,
 {
int rc;
 
-   mutex_lock(>bd_mutex);
-   rc = bdev_disk_changed(bdev, false);
-   mutex_unlock(>bd_mutex);
+   rc = blkdev_reread_part(bdev);
if (rc)
pr_warn("%s: partition scan of loop%d (%s) failed (rc=%d)\n",
__func__, lo->lo_number, lo->lo_file_name, rc);
@@ -1166,11 +1164,10 @@ static int __loop_clr_fd(struct loop_device *lo, bool 
release)
 * must be at least one and it can only become zero when the
 * current holder is released.
 */
-   if (!release)
-   mutex_lock(>bd_mutex);
-   err = bdev_disk_changed(bdev, false);
-   if (!release)
-   mutex_unlock(>bd_mutex);
+   if (release)
+   err = __blkdev_reread_part(bdev);
+   else
+   err = blkdev_reread_part(bdev);
if (err)
pr_warn("%s: partition scan of loop%d failed (rc=%d)\n",
__func__, lo_number, err);
diff --git a/drivers/s390/block/dasd_genhd.c b/drivers/s390/block/dasd_genhd.c
index 7d079154f849..5542d9eadfe0 100644
--- a/drivers/s390/block/dasd_genhd.c
+++ b/drivers/s390/block/dasd_genhd.c
@@ -116,9 +116,7 @@ int dasd_scan_partitions(struct dasd_block *block)
return -ENODEV;
}
 
-   mutex_lock(>bd_mutex);
-   rc = bdev_disk_changed(bdev, false);
-   mutex_unlock(>bd_mutex);
+   rc = blkdev_reread_part(bdev);
if (rc)
DBF_DEV_EVENT(DBF_ERR, block->base,
"scan partitions error, rc %d", rc);
diff --git a/fs/block_dev.c b/fs/block_dev.c
index 387b64665dc2..6f335fc1501d 100644
--- a/fs/block_dev.c
+++ b/fs/block_dev.c
@@ -1513,8 +1513,6 @@ int bdev_disk_changed(struct block_device *bdev, bool 
invalidate)
struct gendisk *disk = bdev->bd_disk;
int ret;
 
-   lockdep_assert_held(>bd_mutex);
-
 rescan:
ret = blk_drop_partitions(disk, bdev);
if (ret)
@@ -1542,11 +1540,6 @@ int bdev_disk_changed(struct block_device *bdev, bool 
invalidate)
 
return ret;
 }
-/*
- * Only exported for for loop and dasd for historic reasons.  Don't use in new
- * code!
- */
-EXPORT_SYMBOL_GPL(bdev_disk_changed);
 
 /*
  * bd_mutex locking:
diff --git a/include/linux/fs.h b/include/linux/fs.h
index 98e0349adb52..30676ca9a258 100644
--- a/include/linux/fs.h
+++ b/

[linux-yocto][linux-yocto-dev standard/base][PATCH 3/5] Revert "block: fix bdev_disk_changed for non-partitioned devices"

2020-03-04 Thread He Zhe
From: He Zhe 

This reverts commit 142fe8f4bb169e8632024d51c64653a8bf140561.

Also reverts commit 490547ca2df6 ("block: don't send uevent for empty disk when 
not invalidating")
---
 block/ioctl.c |  6 --
 block/partition-generic.c |  5 -
 fs/block_dev.c| 25 ++---
 include/linux/genhd.h |  1 -
 4 files changed, 22 insertions(+), 15 deletions(-)

diff --git a/block/ioctl.c b/block/ioctl.c
index 775023548cb7..f5d75ba9ceb4 100644
--- a/block/ioctl.c
+++ b/block/ioctl.c
@@ -162,14 +162,16 @@ static int blkpg_ioctl(struct block_device *bdev, struct 
blkpg_ioctl_arg __user
  */
 int __blkdev_reread_part(struct block_device *bdev)
 {
-   if (!disk_part_scan_enabled(bdev->bd_disk) || bdev != bdev->bd_contains)
+   struct gendisk *disk = bdev->bd_disk;
+
+   if (!disk_part_scan_enabled(disk) || bdev != bdev->bd_contains)
return -EINVAL;
if (!capable(CAP_SYS_ADMIN))
return -EACCES;
 
lockdep_assert_held(>bd_mutex);
 
-   return bdev_disk_changed(bdev, false);
+   return rescan_partitions(disk, bdev, false);
 }
 EXPORT_SYMBOL(__blkdev_reread_part);
 
diff --git a/block/partition-generic.c b/block/partition-generic.c
index 564fae77711d..535fbb9b6337 100644
--- a/block/partition-generic.c
+++ b/block/partition-generic.c
@@ -466,8 +466,6 @@ int blk_drop_partitions(struct gendisk *disk, struct 
block_device *bdev)
struct hd_struct *part;
int res;
 
-   if (!disk_part_scan_enabled(disk))
-   return 0;
if (bdev->bd_part_count || bdev->bd_super)
return -EBUSY;
res = invalidate_partition(disk, 0);
@@ -537,9 +535,6 @@ int blk_add_partitions(struct gendisk *disk, struct 
block_device *bdev)
struct parsed_partitions *state;
int ret = -EAGAIN, p, highest;
 
-   if (!disk_part_scan_enabled(disk))
-   return 0;
-
state = check_partition(disk, bdev);
if (!state)
return 0;
diff --git a/fs/block_dev.c b/fs/block_dev.c
index 6f335fc1501d..ec10dacd18d0 100644
--- a/fs/block_dev.c
+++ b/fs/block_dev.c
@@ -1508,9 +1508,9 @@ EXPORT_SYMBOL(bd_set_size);
 
 static void __blkdev_put(struct block_device *bdev, fmode_t mode, int 
for_part);
 
-int bdev_disk_changed(struct block_device *bdev, bool invalidate)
+static int rescan_partitions(struct gendisk *disk, struct block_device *bdev,
+   bool invalidate)
 {
-   struct gendisk *disk = bdev->bd_disk;
int ret;
 
 rescan:
@@ -1526,21 +1526,32 @@ int bdev_disk_changed(struct block_device *bdev, bool 
invalidate)
check_disk_size_change(disk, bdev, !invalidate);
bdev->bd_invalidated = 0;
 
-   if (get_capacity(disk)) {
-   ret = blk_add_partitions(disk, bdev);
-   if (ret == -EAGAIN)
-   goto rescan;
-   } else if (invalidate) {
+   if (!get_capacity(disk)) {
/*
 * Tell userspace that the media / partition table may have
 * changed.
 */
kobject_uevent(_to_dev(disk)->kobj, KOBJ_CHANGE);
+   return 0;
}
 
+   ret = blk_add_partitions(disk, bdev);
+   if (ret == -EAGAIN)
+   goto rescan;
return ret;
 }
 
+
+static void bdev_disk_changed(struct block_device *bdev, bool invalidate)
+{
+   if (disk_part_scan_enabled(bdev->bd_disk)) {
+   rescan_partitions(bdev->bd_disk, bdev, invalidate);
+   } else {
+   check_disk_size_change(bdev->bd_disk, bdev, !invalidate);
+   bdev->bd_invalidated = 0;
+   }
+}
+
 /*
  * bd_mutex locking:
  *
diff --git a/include/linux/genhd.h b/include/linux/genhd.h
index ea4c133b4139..0cc259daed8e 100644
--- a/include/linux/genhd.h
+++ b/include/linux/genhd.h
@@ -633,7 +633,6 @@ extern void blk_invalidate_devt(dev_t devt);
 extern dev_t blk_lookup_devt(const char *name, int partno);
 extern char *disk_name (struct gendisk *hd, int partno, char *buf);
 
-int bdev_disk_changed(struct block_device *bdev, bool invalidate);
 int blk_add_partitions(struct gendisk *disk, struct block_device *bdev);
 int blk_drop_partitions(struct gendisk *disk, struct block_device *bdev);
 extern int disk_expand_part_tbl(struct gendisk *disk, int target);
-- 
2.24.1

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.

View/Reply Online (#8445): 
https://lists.yoctoproject.org/g/linux-yocto/message/8445
Mute This Topic: https://lists.yoctoproject.org/mt/71728980/21656
Group Owner: linux-yocto+ow...@lists.yoctoproject.org
Unsubscribe: https://lists.yoctoproject.org/g/linux-yocto/unsub  
[arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-


[linux-yocto][linux-yocto-dev standard/base][PATCH 5/5] Revert "block: merge invalidate_partitions into rescan_partitions"

2020-03-04 Thread He Zhe
From: He Zhe 

This reverts commit 6917d0689993f46d97d40dd66c601d0fd5b1dbdd.
---
 block/ioctl.c |  2 +-
 block/partition-generic.c | 38 --
 fs/block_dev.c|  5 -
 include/linux/genhd.h |  4 ++--
 4 files changed, 31 insertions(+), 18 deletions(-)

diff --git a/block/ioctl.c b/block/ioctl.c
index f5d75ba9ceb4..f5565dd6bf2a 100644
--- a/block/ioctl.c
+++ b/block/ioctl.c
@@ -171,7 +171,7 @@ int __blkdev_reread_part(struct block_device *bdev)
 
lockdep_assert_held(>bd_mutex);
 
-   return rescan_partitions(disk, bdev, false);
+   return rescan_partitions(disk, bdev);
 }
 EXPORT_SYMBOL(__blkdev_reread_part);
 
diff --git a/block/partition-generic.c b/block/partition-generic.c
index c0f28eaf54f6..81430b317379 100644
--- a/block/partition-generic.c
+++ b/block/partition-generic.c
@@ -597,8 +597,7 @@ static int blk_add_partitions(struct gendisk *disk, struct 
block_device *bdev)
return ret;
 }
 
-int rescan_partitions(struct gendisk *disk, struct block_device *bdev,
-   bool invalidate)
+int rescan_partitions(struct gendisk *disk, struct block_device *bdev)
 {
int ret;
 
@@ -607,22 +606,13 @@ int rescan_partitions(struct gendisk *disk, struct 
block_device *bdev,
if (ret)
return ret;
 
-   if (invalidate)
-   set_capacity(disk, 0);
-   else if (disk->fops->revalidate_disk)
+   if (disk->fops->revalidate_disk)
disk->fops->revalidate_disk(disk);
-
-   check_disk_size_change(disk, bdev, !invalidate);
+   check_disk_size_change(disk, bdev, true);
bdev->bd_invalidated = 0;
 
-   if (!get_capacity(disk)) {
-   /*
-* Tell userspace that the media / partition table may have
-* changed.
-*/
-   kobject_uevent(_to_dev(disk)->kobj, KOBJ_CHANGE);
+   if (!get_capacity(disk))
return 0;
-   }
 
ret = blk_add_partitions(disk, bdev);
if (ret == -EAGAIN)
@@ -630,6 +620,26 @@ int rescan_partitions(struct gendisk *disk, struct 
block_device *bdev,
return ret;
 }
 
+int invalidate_partitions(struct gendisk *disk, struct block_device *bdev)
+{
+   int res;
+
+   if (!bdev->bd_invalidated)
+   return 0;
+
+   res = drop_partitions(disk, bdev);
+   if (res)
+   return res;
+
+   set_capacity(disk, 0);
+   check_disk_size_change(disk, bdev, false);
+   bdev->bd_invalidated = 0;
+   /* tell userspace that the media / partition table may have changed */
+   kobject_uevent(_to_dev(disk)->kobj, KOBJ_CHANGE);
+
+   return 0;
+}
+
 unsigned char *read_dev_sector(struct block_device *bdev, sector_t n, Sector 
*p)
 {
struct address_space *mapping = bdev->bd_inode->i_mapping;
diff --git a/fs/block_dev.c b/fs/block_dev.c
index 0af62b76d031..d612468ee66b 100644
--- a/fs/block_dev.c
+++ b/fs/block_dev.c
@@ -1511,7 +1511,10 @@ static void __blkdev_put(struct block_device *bdev, 
fmode_t mode, int for_part);
 static void bdev_disk_changed(struct block_device *bdev, bool invalidate)
 {
if (disk_part_scan_enabled(bdev->bd_disk)) {
-   rescan_partitions(bdev->bd_disk, bdev, invalidate);
+   if (invalidate)
+   invalidate_partitions(bdev->bd_disk, bdev);
+   else
+   rescan_partitions(bdev->bd_disk, bdev);
} else {
check_disk_size_change(bdev->bd_disk, bdev, !invalidate);
bdev->bd_invalidated = 0;
diff --git a/include/linux/genhd.h b/include/linux/genhd.h
index e661120c5b14..0ac379b10d45 100644
--- a/include/linux/genhd.h
+++ b/include/linux/genhd.h
@@ -634,8 +634,8 @@ extern dev_t blk_lookup_devt(const char *name, int partno);
 extern char *disk_name (struct gendisk *hd, int partno, char *buf);
 
 extern int disk_expand_part_tbl(struct gendisk *disk, int target);
-int rescan_partitions(struct gendisk *disk, struct block_device *bdev,
-   bool invalidate);
+extern int rescan_partitions(struct gendisk *disk, struct block_device *bdev);
+extern int invalidate_partitions(struct gendisk *disk, struct block_device 
*bdev);
 extern struct hd_struct * __must_check add_partition(struct gendisk *disk,
 int partno, sector_t start,
 sector_t len, int flags,
-- 
2.24.1

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.

View/Reply Online (#8443): 
https://lists.yoctoproject.org/g/linux-yocto/message/8443
Mute This Topic: https://lists.yoctoproject.org/mt/71728976/21656
Group Owner: linux-yocto+ow...@lists.yoctoproject.org
Unsubscribe: https://lists.yoctoproject.org/g/linux-yocto/unsub  
[arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-


[linux-yocto][linux-yocto-dev standard/base][PATCH 1/5] Revert "block: move clearing bd_invalidated into check_disk_size_change"

2020-03-04 Thread He Zhe
From: He Zhe 

This reverts commit 979c690d9a017db14b7759a099478e3faad991ac.
---
 fs/block_dev.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/fs/block_dev.c b/fs/block_dev.c
index 69bf2fb6f7cd..387b64665dc2 100644
--- a/fs/block_dev.c
+++ b/fs/block_dev.c
@@ -1433,7 +1433,6 @@ static void check_disk_size_change(struct gendisk *disk,
if (bdev_size > disk_size)
flush_disk(bdev, false);
}
-   bdev->bd_invalidated = 0;
 }
 
 /**
@@ -1463,6 +1462,7 @@ int revalidate_disk(struct gendisk *disk)
 
mutex_lock(>bd_mutex);
check_disk_size_change(disk, bdev, ret == 0);
+   bdev->bd_invalidated = 0;
mutex_unlock(>bd_mutex);
bdput(bdev);
}
@@ -1526,6 +1526,7 @@ int bdev_disk_changed(struct block_device *bdev, bool 
invalidate)
disk->fops->revalidate_disk(disk);
 
check_disk_size_change(disk, bdev, !invalidate);
+   bdev->bd_invalidated = 0;
 
if (get_capacity(disk)) {
ret = blk_add_partitions(disk, bdev);
-- 
2.24.1

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.

View/Reply Online (#8441): 
https://lists.yoctoproject.org/g/linux-yocto/message/8441
Mute This Topic: https://lists.yoctoproject.org/mt/71728957/21656
Group Owner: linux-yocto+ow...@lists.yoctoproject.org
Unsubscribe: https://lists.yoctoproject.org/g/linux-yocto/unsub  
[arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-


[linux-yocto][linux-yocto-dev standard/base][PATCH 0/5] Revert disk invalidating updates

2020-03-04 Thread He Zhe
From: He Zhe 

This series of commits do not work with the latest systemd-udevd(v244, likely
v245). And the mainline has confirmed this potential misbehaviour.

https://lore.kernel.org/lkml/20200304133738.gf21...@quack2.suse.cz/

As it would run out of memory very soon and make the system unavailable, it
seems we'd better apply the reverts first.

With this series of reverts applied, I just did some random file and disk
operations and did not meet errors.

He Zhe (5):
  Revert "block: move clearing bd_invalidated into
check_disk_size_change"
  Revert "block: remove (__)blkdev_reread_part as an exported API"
  Revert "block: fix bdev_disk_changed for non-partitioned devices"
  Revert "block: move rescan_partitions to fs/block_dev.c"
  Revert "block: merge invalidate_partitions into rescan_partitions"

 block/ioctl.c   | 37 +++
 block/partition-generic.c   | 52 -
 drivers/block/loop.c| 13 -
 drivers/s390/block/dasd_genhd.c |  4 +--
 fs/block_dev.c  | 50 ---
 include/linux/fs.h  |  4 +++
 include/linux/genhd.h   |  5 ++--
 7 files changed, 101 insertions(+), 64 deletions(-)

-- 
2.24.1

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.

View/Reply Online (#8440): 
https://lists.yoctoproject.org/g/linux-yocto/message/8440
Mute This Topic: https://lists.yoctoproject.org/mt/71728956/21656
Group Owner: linux-yocto+ow...@lists.yoctoproject.org
Unsubscribe: https://lists.yoctoproject.org/g/linux-yocto/unsub  
[arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-


[linux-yocto][linux-yocto v5.4/standard/preempt-rt/base][PATCH] printk: Fix build failures caused by v5.4.22 merge

2020-03-03 Thread He Zhe
From: He Zhe 

A hunk of code that was already removed from RT upstream was introduced by
the merger of v5.4.22 and cause the following build failures. Remove it.

kernel/printk/printk.c: In function 'register_console':
kernel/printk/printk.c:2530:3: error: implicit declaration of function 
'logbuf_lock_irqsave'; did you mean 'xa_lock_irqsave'? 
[-Werror=implicit-function-declaration]
 2530 |   logbuf_lock_irqsave(flags);
  |   ^~~
  |   xa_lock_irqsave
kernel/printk/printk.c:2530:23: error: 'flags' undeclared (first use in this 
function)
 2530 |   logbuf_lock_irqsave(flags);
  |   ^
kernel/printk/printk.c:2530:23: note: each undeclared identifier is reported 
only once for each function it appears in
  CC  arch/x86/entry/syscall_32.o
kernel/printk/printk.c:2540:3: error: 'exclusive_console' undeclared (first use 
in this function)
 2540 |   exclusive_console = newcon;
  |   ^
kernel/printk/printk.c:2541:3: error: 'exclusive_console_stop_seq' undeclared 
(first use in this function)
 2541 |   exclusive_console_stop_seq = console_seq;
  |   ^~
kernel/printk/printk.c:2541:32: error: 'console_seq' undeclared (first use in 
this function); did you mean 'console_sem'?
 2541 |   exclusive_console_stop_seq = console_seq;
  |^~~
  |console_sem
kernel/printk/printk.c:2543:3: error: 'console_idx' undeclared (first use in 
this function); did you mean 'console_sem'?
 2543 |   console_idx = syslog_idx;
  |   ^~~
  |   console_sem
kernel/printk/printk.c:2543:17: error: 'syslog_idx' undeclared (first use in 
this function); did you mean 'syslog_time'?
 2543 |   console_idx = syslog_idx;
  | ^~

Signed-off-by: He Zhe 
---
 kernel/printk/printk.c | 21 -
 1 file changed, 21 deletions(-)

diff --git a/kernel/printk/printk.c b/kernel/printk/printk.c
index 49e9e5450b51..0605a74ad76b 100644
--- a/kernel/printk/printk.c
+++ b/kernel/printk/printk.c
@@ -2522,27 +2522,6 @@ void register_console(struct console *newcon)
if (newcon->flags & CON_EXTENDED)
nr_ext_console_drivers++;
 
-   if (newcon->flags & CON_PRINTBUFFER) {
-   /*
-* console_unlock(); will print out the buffered messages
-* for us.
-*/
-   logbuf_lock_irqsave(flags);
-   /*
-* We're about to replay the log buffer.  Only do this to the
-* just-registered console to avoid excessive message spam to
-* the already-registered consoles.
-*
-* Set exclusive_console with disabled interrupts to reduce
-* race window with eventual console_flush_on_panic() that
-* ignores console_lock.
-*/
-   exclusive_console = newcon;
-   exclusive_console_stop_seq = console_seq;
-   console_seq = syslog_seq;
-   console_idx = syslog_idx;
-   logbuf_unlock_irqrestore(flags);
-   }
console_unlock();
console_sysfs_notify();
 
-- 
2.24.1

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.

View/Reply Online (#8428): 
https://lists.yoctoproject.org/g/linux-yocto/message/8428
Mute This Topic: https://lists.yoctoproject.org/mt/71696644/21656
Group Owner: linux-yocto+ow...@lists.yoctoproject.org
Unsubscribe: https://lists.yoctoproject.org/g/linux-yocto/unsub  
[arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-


[linux-yocto][linux-yocto-dev standard/base][PATCH] perf probe: Fix to delete multiple probe event

2020-02-25 Thread He Zhe
From: Masami Hiramatsu 

Fix to delete multiple probe event with filter correctly.

When we put an event with multiple probes, perf-probe fails
to delete with filters. This comes from a failure to list
up the event name because of overwrapping its name.

To fix this issue, skip to list up the event which has
same name.

Without this patch:
  # perf probe -l \*
probe_perf:map__map_ip (on perf_sample__fprintf_brstackoff:21@
probe_perf:map__map_ip (on perf_sample__fprintf_brstackoff:25@
probe_perf:map__map_ip (on append_inlines:12@util/machine.c in
probe_perf:map__map_ip (on unwind_entry:19@util/machine.c in /
probe_perf:map__map_ip (on map__map_ip@util/map.h in /home/mhi
probe_perf:map__map_ip (on map__map_ip@util/map.h in /home/mhi
  # perf probe -d \*
  "*" does not hit any event.
Error: Failed to delete events. Reason: No such file or directory (Code: -2)

With this:
  # perf probe -d \*
  Removed event: probe_perf:map__map_ip

Reported-by: Arnaldo Carvalho de Melo 
Signed-off-by: Masami Hiramatsu 

https://lkml.org/lkml/2019/12/3/136

Signed-off-by: He Zhe 
---
 tools/perf/util/probe-file.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/tools/perf/util/probe-file.c b/tools/perf/util/probe-file.c
index 5003ba4..c03a591 100644
--- a/tools/perf/util/probe-file.c
+++ b/tools/perf/util/probe-file.c
@@ -206,6 +206,9 @@ static struct strlist *__probe_file__get_namelist(int fd, 
bool include_group)
} else
ret = strlist__add(sl, tev.event);
clear_probe_trace_event();
+   /* Skip if there is same name multi-probe event in the list */
+   if (ret == -EEXIST)
+   ret = 0;
if (ret < 0)
break;
}
-- 
2.7.4

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.

View/Reply Online (#8394): 
https://lists.yoctoproject.org/g/linux-yocto/message/8394
Mute This Topic: https://lists.yoctoproject.org/mt/71548260/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 v5.2/standard/preempt-rt/base] workqueue: Fix missing transition to raw lock

2020-02-10 Thread He Zhe
From: He Zhe 

For the following build failure.

kernel/workqueue.c:4336:17: error: passing argument 1 of 'rt_spin_lock' from
incompatible pointer type [-Werror=incompatible-pointer-types]
4336 | spin_lock_irq(_mayday_lock);
| ^~~
kernel/workqueue.c:4338:19: error: passing argument 1 of 'rt_spin_unlock' from
incompatible pointer type [-Werror=incompatible-pointer-types]
4338 | spin_unlock_irq(_mayday_lock);
| ^~~

Signed-off-by: He Zhe 
---
This is for v5.2/standard/preempt-rt/base and related rt branches

 kernel/workqueue.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/kernel/workqueue.c b/kernel/workqueue.c
index df43d680a3e7..592c07376050 100644
--- a/kernel/workqueue.c
+++ b/kernel/workqueue.c
@@ -4333,9 +4333,9 @@ void destroy_workqueue(struct workqueue_struct *wq)
struct worker *rescuer = wq->rescuer;
 
/* this prevents new queueing */
-   spin_lock_irq(_mayday_lock);
+   raw_spin_lock_irq(_mayday_lock);
wq->rescuer = NULL;
-   spin_unlock_irq(_mayday_lock);
+   raw_spin_unlock_irq(_mayday_lock);
 
/* rescuer will empty maydays list before exiting */
kthread_stop(rescuer->task);
-- 
2.24.1

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.

View/Reply Online (#8384): 
https://lists.yoctoproject.org/g/linux-yocto/message/8384
Mute This Topic: https://lists.yoctoproject.org/mt/71135736/21656
Group Owner: linux-yocto+ow...@lists.yoctoproject.org
Unsubscribe: https://lists.yoctoproject.org/g/linux-yocto/unsub  
[arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-


[linux-yocto][v5.2/standard/mti-malta64][PATCH] malta64: Remove __init annotation of malta_pcnet32_ioports_fixup

2020-01-18 Thread He Zhe
From: He Zhe 

To fix the following warning.

WARNING: vmlinux.o(.pci_fixup_final+0x1288): Section mismatch in reference
from the variable __pci_fixup_malta_pcnet32_ioports_fixup163 to the
function .init.text:malta_pcnet32_ioports_fixup()
The variable __pci_fixup_malta_pcnet32_ioports_fixup163 references
a function __init malta_pcnet32_ioports_fixup().
This is often seen when error handling in the init function
uses functionality in the exit path.
The fix is often to remove the __init annotation of
malta_pcnet32_ioports_fixup() so it may be used outside an exit section.

Fixes: b73edd2e3a58 ("mti_malta32: fix the pci resource conflicts")
Signed-off-by: He Zhe 
---
 arch/mips/pci/fixup-malta.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/mips/pci/fixup-malta.c b/arch/mips/pci/fixup-malta.c
index ffc068e7f13e..df1cae42ff9e 100644
--- a/arch/mips/pci/fixup-malta.c
+++ b/arch/mips/pci/fixup-malta.c
@@ -143,7 +143,7 @@ DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, 
PCI_DEVICE_ID_INTEL_82371AB,
 malta_piix_func1_fixup);
 
 /* Use the io resource allocated by YAMON */
-static void __init malta_pcnet32_ioports_fixup(struct pci_dev *pdev)
+static void malta_pcnet32_ioports_fixup(struct pci_dev *pdev)
 {
u32 check = 0, new = 0x1060;
 
-- 
2.24.1

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.

View/Reply Online (#8333): 
https://lists.yoctoproject.org/g/linux-yocto/message/8333
Mute This Topic: https://lists.yoctoproject.org/mt/69900343/21656
Group Owner: linux-yocto+ow...@lists.yoctoproject.org
Unsubscribe: https://lists.yoctoproject.org/g/linux-yocto/unsub  
[arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-


[linux-yocto] Still need "Omit to optimize vsprintf.c/kasprintf.c"?

2020-01-17 Thread He Zhe
Hi Bruce,

And reason we keep the following commit?
http://git.yoctoproject.org/cgit/cgit.cgi/linux-yocto/commit/?id=0817a77d8c65f150d659f0a38b5f108372f381e6=v5.2%2Fstandard%2Farm-versatile-926ejs

It causes the following warning.
tmp-glibc/work-shared/qemuarm/kernel-source/include/net/sch_generic.h: In 
function 'qdisc_cb_private_validate':
tmp-glibc/work-shared/qemuarm/kernel-source/include/net/sch_generic.h:481:23: 
warning: unused variable 'qcb' [-Wunused-variable]
481 | struct qdisc_skb_cb *qcb;

Thanks,
Zhe
-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.

View/Reply Online (#8320): 
https://lists.yoctoproject.org/g/linux-yocto/message/8320
Mute This Topic: https://lists.yoctoproject.org/mt/69840960/21656
Group Owner: linux-yocto+ow...@lists.yoctoproject.org
Unsubscribe: https://lists.yoctoproject.org/g/linux-yocto/unsub  
[arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-


[linux-yocto][master v5.2/standard/base][PATCH] net, sysctl: Fix compiler warning when only cBPF is present

2020-01-17 Thread He Zhe
From: Alexander Lobakin 

commit 1148f9adbe71415836a18a36c1b4ece999ab0973 upstream

proc_dointvec_minmax_bpf_restricted() has been firstly introduced
in commit 2e4a30983b0f ("bpf: restrict access to core bpf sysctls")
under CONFIG_HAVE_EBPF_JIT. Then, this ifdef has been removed in
ede95a63b5e8 ("bpf: add bpf_jit_limit knob to restrict unpriv
allocations"), because a new sysctl, bpf_jit_limit, made use of it.
Finally, this parameter has become long instead of integer with
fdadd04931c2 ("bpf: fix bpf_jit_limit knob for PAGE_SIZE >= 64K")
and thus, a new proc_dolongvec_minmax_bpf_restricted() has been
added.

With this last change, we got back to that
proc_dointvec_minmax_bpf_restricted() is used only under
CONFIG_HAVE_EBPF_JIT, but the corresponding ifdef has not been
brought back.

So, in configurations like CONFIG_BPF_JIT=y && CONFIG_HAVE_EBPF_JIT=n
since v4.20 we have:

  CC  net/core/sysctl_net_core.o
net/core/sysctl_net_core.c:292:1: warning: 
‘proc_dointvec_minmax_bpf_restricted’ defined but not used [-Wunused-function]
  292 | proc_dointvec_minmax_bpf_restricted(struct ctl_table *table, int write,
  | ^~~

Suppress this by guarding it with CONFIG_HAVE_EBPF_JIT again.

Fixes: fdadd04931c2 ("bpf: fix bpf_jit_limit knob for PAGE_SIZE >= 64K")
Signed-off-by: Alexander Lobakin 
Signed-off-by: Daniel Borkmann 
Link: https://lore.kernel.org/bpf/20191218091821.7080-1-aloba...@dlink.ru
Signed-off-by: He Zhe 
---
 net/core/sysctl_net_core.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/net/core/sysctl_net_core.c b/net/core/sysctl_net_core.c
index eb29e5a..9f9e00b 100644
--- a/net/core/sysctl_net_core.c
+++ b/net/core/sysctl_net_core.c
@@ -288,6 +288,7 @@ static int proc_dointvec_minmax_bpf_enable(struct ctl_table 
*table, int write,
return ret;
 }
 
+# ifdef CONFIG_HAVE_EBPF_JIT
 static int
 proc_dointvec_minmax_bpf_restricted(struct ctl_table *table, int write,
void __user *buffer, size_t *lenp,
@@ -298,6 +299,7 @@ proc_dointvec_minmax_bpf_restricted(struct ctl_table 
*table, int write,
 
return proc_dointvec_minmax(table, write, buffer, lenp, ppos);
 }
+# endif /* CONFIG_HAVE_EBPF_JIT */
 
 static int
 proc_dolongvec_minmax_bpf_restricted(struct ctl_table *table, int write,
-- 
2.7.4

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.

View/Reply Online (#8319): 
https://lists.yoctoproject.org/g/linux-yocto/message/8319
Mute This Topic: https://lists.yoctoproject.org/mt/69840715/21656
Group Owner: linux-yocto+ow...@lists.yoctoproject.org
Unsubscribe: https://lists.yoctoproject.org/g/linux-yocto/unsub  
[arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-


[linux-yocto][v5.2/standard/base v5.2/standard/intel-x86][PATCH] Revert "x86: Use CONFIG_PREEMPTION"

2020-01-15 Thread He Zhe
From: He Zhe 

This reverts commit 41bbdde13b435400816397a47e84fa697934c253.

The reverted patch causes the following build failure.
tmp-glibc/work-shared/intel-x86-64/kernel-source/include/linux/preempt.h:190:3:
error: implicit declaration of function '__preempt_schedule'
[-Werror=implicit-function-declaration]

The reverted patch should have been used with b8d3349803ba
("sched/rt, Kconfig: Unbreak def/oldconfig with CONFIG_PREEMPT=y") which fixes
a50a3f4b6a31 ("sched/rt, Kconfig: Introduce CONFIG_PREEMPT_RT") which is not
included in 5.2.29. So we simply revert 41bbdde13b43.

Signed-off-by: He Zhe 
---
 arch/x86/entry/entry_32.S  | 6 +++---
 arch/x86/entry/entry_64.S  | 4 ++--
 arch/x86/entry/thunk_32.S  | 2 +-
 arch/x86/entry/thunk_64.S  | 4 ++--
 arch/x86/include/asm/preempt.h | 2 +-
 arch/x86/kernel/kprobes/core.c | 2 +-
 6 files changed, 10 insertions(+), 10 deletions(-)

diff --git a/arch/x86/entry/entry_32.S b/arch/x86/entry/entry_32.S
index f07baf0388bc..1153e510cedd 100644
--- a/arch/x86/entry/entry_32.S
+++ b/arch/x86/entry/entry_32.S
@@ -63,7 +63,7 @@
  * enough to patch inline, increasing performance.
  */
 
-#ifdef CONFIG_PREEMPTION
+#ifdef CONFIG_PREEMPT
 # define preempt_stop(clobbers)DISABLE_INTERRUPTS(clobbers); 
TRACE_IRQS_OFF
 #else
 # define preempt_stop(clobbers)
@@ -1104,7 +1104,7 @@ restore_all:
INTERRUPT_RETURN
 
 restore_all_kernel:
-#ifdef CONFIG_PREEMPTION
+#ifdef CONFIG_PREEMPT
DISABLE_INTERRUPTS(CLBR_ANY)
cmpl$0, PER_CPU_VAR(__preempt_count)
jnz .Lno_preempt
@@ -1393,7 +1393,7 @@ ENTRY(xen_hypervisor_callback)
TRACE_IRQS_OFF
mov %esp, %eax
callxen_evtchn_do_upcall
-#ifndef CONFIG_PREEMPTION
+#ifndef CONFIG_PREEMPT
callxen_maybe_preempt_hcall
 #endif
jmp ret_from_intr
diff --git a/arch/x86/entry/entry_64.S b/arch/x86/entry/entry_64.S
index c2604cb55c63..7d81e14b6226 100644
--- a/arch/x86/entry/entry_64.S
+++ b/arch/x86/entry/entry_64.S
@@ -664,7 +664,7 @@ GLOBAL(swapgs_restore_regs_and_return_to_usermode)
 
 /* Returning to kernel space */
 retint_kernel:
-#ifdef CONFIG_PREEMPTION
+#ifdef CONFIG_PREEMPT
/* Interrupts are off */
/* Check if we need preemption */
btl $9, EFLAGS(%rsp)/* were interrupts off? */
@@ -1115,7 +1115,7 @@ ENTRY(xen_do_hypervisor_callback) /* 
do_hypervisor_callback(struct *pt_regs) */
callxen_evtchn_do_upcall
LEAVE_IRQ_STACK
 
-#ifndef CONFIG_PREEMPTION
+#ifndef CONFIG_PREEMPT
callxen_maybe_preempt_hcall
 #endif
jmp error_exit
diff --git a/arch/x86/entry/thunk_32.S b/arch/x86/entry/thunk_32.S
index 2713490611a3..cb3464525b37 100644
--- a/arch/x86/entry/thunk_32.S
+++ b/arch/x86/entry/thunk_32.S
@@ -34,7 +34,7 @@
THUNK trace_hardirqs_off_thunk,trace_hardirqs_off_caller,1
 #endif
 
-#ifdef CONFIG_PREEMPTION
+#ifdef CONFIG_PREEMPT
THUNK ___preempt_schedule, preempt_schedule
THUNK ___preempt_schedule_notrace, preempt_schedule_notrace
EXPORT_SYMBOL(___preempt_schedule)
diff --git a/arch/x86/entry/thunk_64.S b/arch/x86/entry/thunk_64.S
index d6d1fdc09f9e..cfdca8b42c70 100644
--- a/arch/x86/entry/thunk_64.S
+++ b/arch/x86/entry/thunk_64.S
@@ -47,7 +47,7 @@
THUNK lockdep_sys_exit_thunk,lockdep_sys_exit
 #endif
 
-#ifdef CONFIG_PREEMPTION
+#ifdef CONFIG_PREEMPT
THUNK ___preempt_schedule, preempt_schedule
THUNK ___preempt_schedule_notrace, preempt_schedule_notrace
EXPORT_SYMBOL(___preempt_schedule)
@@ -56,7 +56,7 @@
 
 #if defined(CONFIG_TRACE_IRQFLAGS) \
  || defined(CONFIG_DEBUG_LOCK_ALLOC) \
- || defined(CONFIG_PREEMPTION)
+ || defined(CONFIG_PREEMPT)
 .L_restore:
popq %r11
popq %r10
diff --git a/arch/x86/include/asm/preempt.h b/arch/x86/include/asm/preempt.h
index 3d4cb83a8828..99a7fa9ab0a3 100644
--- a/arch/x86/include/asm/preempt.h
+++ b/arch/x86/include/asm/preempt.h
@@ -102,7 +102,7 @@ static __always_inline bool should_resched(int 
preempt_offset)
return unlikely(raw_cpu_read_4(__preempt_count) == preempt_offset);
 }
 
-#ifdef CONFIG_PREEMPTION
+#ifdef CONFIG_PREEMPT
   extern asmlinkage void ___preempt_schedule(void);
 # define __preempt_schedule() \
asm volatile ("call ___preempt_schedule" : ASM_CALL_CONSTRAINT)
diff --git a/arch/x86/kernel/kprobes/core.c b/arch/x86/kernel/kprobes/core.c
index c88c1ec5938a..bd17dbb15d6a 100644
--- a/arch/x86/kernel/kprobes/core.c
+++ b/arch/x86/kernel/kprobes/core.c
@@ -580,7 +580,7 @@ static void setup_singlestep(struct kprobe *p, struct 
pt_regs *regs,
if (setup_detour_execution(p, regs, reenter))
return;
 
-#if !defined(CONFIG_PREEMPTION)
+#if !defined(CONFIG_PREEMPT)
if (p->ainsn.boostable && !p->post_handler) {
/* Boost up -- we can execute copied instructions directly */
if (!reenter)
-- 
2.24.1

-=

[linux-yocto][linux-yocto-dev][PATCH] linux-yocto linux-yocto-dev: Fix /bin/awk issues

2020-01-14 Thread He Zhe
From: He Zhe 

084857b1bf19 ("linux-yocto: Handle /bin/awk issues") makes one mistake and
misses one substitution causing the following warning.

Warning: Kernel ABI header at 'tools/arch/x86/tools/gen-insn-attr-x86.awk'
differs from latest version at 'arch/x86/tools/gen-insn-attr-x86.awk'

Fixes: 084857b1bf19 ("linux-yocto: Handle /bin/awk issues")
Signed-off-by: He Zhe 
---
Branches need to be merged to:
linux-yocto: v5.4/standard/base v5.2/standard/base v4.19/standard/base
 v4.18/standard/base v4.15/standard/base v4.14/standard/base
linux-yocto-dev: standard/base v5.4/standard/base

 tools/arch/x86/tools/gen-insn-attr-x86.awk  | 2 +-
 .../selftests/rcutorture/formal/srcu-cbmc/modify_srcu.awk   | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/tools/arch/x86/tools/gen-insn-attr-x86.awk 
b/tools/arch/x86/tools/gen-insn-attr-x86.awk
index a42015b305f4..1c2832e9f77d 100644
--- a/tools/arch/x86/tools/gen-insn-attr-x86.awk
+++ b/tools/arch/x86/tools/gen-insn-attr-x86.awk
@@ -1,4 +1,4 @@
-#!/bin/awk -f
+#!/usr/bin/awk -f
 # SPDX-License-Identifier: GPL-2.0
 # gen-insn-attr-x86.awk: Instruction attribute table generator
 # Written by Masami Hiramatsu 
diff --git 
a/tools/testing/selftests/rcutorture/formal/srcu-cbmc/modify_srcu.awk 
b/tools/testing/selftests/rcutorture/formal/srcu-cbmc/modify_srcu.awk
index 6798ab45032d..e05182d3e47d 100644
--- a/tools/testing/selftests/rcutorture/formal/srcu-cbmc/modify_srcu.awk
+++ b/tools/testing/selftests/rcutorture/formal/srcu-cbmc/modify_srcu.awk
@@ -1,4 +1,4 @@
-#!/usr/usr/bin/awk -f
+#!/usr/bin/awk -f
 # SPDX-License-Identifier: GPL-2.0
 
 # Modify SRCU for formal verification. The first argument should be srcu.h and
-- 
2.24.1

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.

View/Reply Online (#8306): 
https://lists.yoctoproject.org/g/linux-yocto/message/8306
Mute This Topic: https://lists.yoctoproject.org/mt/69710658/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] qemuarma15: Enable high memory to support more physical memory

2020-01-08 Thread He Zhe
Hi Bruce,

I can't find it in master/yocto-5.2 from the web.

http://git.yoctoproject.org/cgit/cgit.cgi/yocto-kernel-cache/log/?h=master

Zhe


On 1/9/20 4:59 AM, Bruce Ashfield wrote:
> merged to master/yocto-5.2
>
> Bruce
>
> On Sun, Jan 5, 2020 at 10:30 PM  wrote:
>> From: He Zhe 
>>
>> Signed-off-by: He Zhe 
>> ---
>>  bsp/qemuarma15/qemuarma15.cfg | 1 +
>>  1 file changed, 1 insertion(+)
>>
>> diff --git a/bsp/qemuarma15/qemuarma15.cfg b/bsp/qemuarma15/qemuarma15.cfg
>> index 3bc219a..c7bb50a 100644
>> --- a/bsp/qemuarma15/qemuarma15.cfg
>> +++ b/bsp/qemuarma15/qemuarma15.cfg
>> @@ -30,3 +30,4 @@ CONFIG_CRYPTO_CHACHA20_NEON=y
>>  CONFIG_ARM_LPAE=y
>>  CONFIG_PCI=y
>>  CONFIG_PCI_HOST_GENERIC=y
>> +CONFIG_HIGHMEM=y
>> --
>> 2.7.4
>>
>
>
> 

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.

View/Reply Online (#8295): 
https://lists.yoctoproject.org/g/linux-yocto/message/8295
Mute This Topic: https://lists.yoctoproject.org/mt/69456767/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] qemuarma15: Enable high memory to support more physical memory

2020-01-05 Thread He Zhe
From: He Zhe 

Signed-off-by: He Zhe 
---
 bsp/qemuarma15/qemuarma15.cfg | 1 +
 1 file changed, 1 insertion(+)

diff --git a/bsp/qemuarma15/qemuarma15.cfg b/bsp/qemuarma15/qemuarma15.cfg
index 3bc219a..c7bb50a 100644
--- a/bsp/qemuarma15/qemuarma15.cfg
+++ b/bsp/qemuarma15/qemuarma15.cfg
@@ -30,3 +30,4 @@ CONFIG_CRYPTO_CHACHA20_NEON=y
 CONFIG_ARM_LPAE=y
 CONFIG_PCI=y
 CONFIG_PCI_HOST_GENERIC=y
+CONFIG_HIGHMEM=y
-- 
2.7.4

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.

View/Reply Online (#8282): 
https://lists.yoctoproject.org/g/linux-yocto/message/8282
Mute This Topic: https://lists.yoctoproject.org/mt/69456767/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][yocto-kernel-cache yocto-5.0 yocto-5.2 master][PATCH] qemuarma15: Enable high memory to support more physical memory

2020-01-01 Thread He Zhe
Ping.

Zhe

On 12/19/19 6:19 PM, He Zhe wrote:
> From: He Zhe 
>
> Signed-off-by: He Zhe 
> ---
>  bsp/qemuarma15/qemuarma15.cfg | 1 +
>  1 file changed, 1 insertion(+)
>
> diff --git a/bsp/qemuarma15/qemuarma15.cfg b/bsp/qemuarma15/qemuarma15.cfg
> index 3bc219a..c7bb50a 100644
> --- a/bsp/qemuarma15/qemuarma15.cfg
> +++ b/bsp/qemuarma15/qemuarma15.cfg
> @@ -30,3 +30,4 @@ CONFIG_CRYPTO_CHACHA20_NEON=y
>  CONFIG_ARM_LPAE=y
>  CONFIG_PCI=y
>  CONFIG_PCI_HOST_GENERIC=y
> +CONFIG_HIGHMEM=y
>
> -=-=-=-=-=-=-=-=-=-=-=-
> Links: You receive all messages sent to this group.
>
> View/Reply Online (#8253): 
> https://lists.yoctoproject.org/g/linux-yocto/message/8253
> Mute This Topic: https://lists.yoctoproject.org/mt/68829089/3617042
> Group Owner: linux-yocto+ow...@lists.yoctoproject.org
> Unsubscribe: https://lists.yoctoproject.org/g/linux-yocto/unsub  
> [zhe...@windriver.com]
> -=-=-=-=-=-=-=-=-=-=-=-

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.

View/Reply Online (#8264): 
https://lists.yoctoproject.org/g/linux-yocto/message/8264
Mute This Topic: https://lists.yoctoproject.org/mt/68829089/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 yocto-5.0 yocto-5.2 master][PATCH] qemuarma15: Enable high memory to support more physical memory

2019-12-19 Thread He Zhe
From: He Zhe 

Signed-off-by: He Zhe 
---
 bsp/qemuarma15/qemuarma15.cfg | 1 +
 1 file changed, 1 insertion(+)

diff --git a/bsp/qemuarma15/qemuarma15.cfg b/bsp/qemuarma15/qemuarma15.cfg
index 3bc219a..c7bb50a 100644
--- a/bsp/qemuarma15/qemuarma15.cfg
+++ b/bsp/qemuarma15/qemuarma15.cfg
@@ -30,3 +30,4 @@ CONFIG_CRYPTO_CHACHA20_NEON=y
 CONFIG_ARM_LPAE=y
 CONFIG_PCI=y
 CONFIG_PCI_HOST_GENERIC=y
+CONFIG_HIGHMEM=y
-- 
2.7.4

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.

View/Reply Online (#8253): 
https://lists.yoctoproject.org/g/linux-yocto/message/8253
Mute This Topic: https://lists.yoctoproject.org/mt/68829089/21656
Group Owner: linux-yocto+ow...@lists.yoctoproject.org
Unsubscribe: https://lists.yoctoproject.org/g/linux-yocto/unsub  
[arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-