All of lore.kernel.org
 help / color / mirror / Atom feed
* [Ocfs2-devel] [PATCH v2] blkdev: Replace blksize_bits() with ilog2()
From: Matthew Wilcox @ 2020-05-29 20:27 UTC (permalink / raw)
  To: Kaitao Cheng
  Cc: axboe, hch, sth, viro, clm, jaegeuk, hch, mark, dhowells, balbi,
	damien.lemoal, bvanassche, ming.lei, martin.petersen, satyat,
	chaitanya.kulkarni, houtao1, asml.silence, ajay.joshi,
	linux-kernel, songmuchun, hoeppner, heiko.carstens, gor,
	borntraeger, linux-s390, sagi, linux-nvme, gregkh, linux-usb,
	josef, dsterba, linux-btrfs, chao, linux-f2fs-devel, darrick.wong,
	linux-xfs, linux-fsdevel, jlbec, joseph.qi, ocfs2-devel,
	deepa.kernel
In-Reply-To: <20200529141100.37519-1-pilgrimtao@gmail.com>

On Fri, May 29, 2020 at 10:11:00PM +0800, Kaitao Cheng wrote:
> There is a function named ilog2() exist which can replace blksize.
> The generated code will be shorter and more efficient on some
> architecture, such as arm64. And ilog2() can be optimized according
> to different architecture.

We'd get the same benefit from a smaller patch with just:

--- a/include/linux/blkdev.h
+++ b/include/linux/blkdev.h
@@ -1502,15 +1502,9 @@ static inline int blk_rq_aligned(struct request_queue *q, unsigned long addr,
 	return !(addr & alignment) && !(len & alignment);
 }
 
-/* assumes size > 256 */
 static inline unsigned int blksize_bits(unsigned int size)
 {
-	unsigned int bits = 8;
-	do {
-		bits++;
-		size >>= 1;
-	} while (size > 256);
-	return bits;
+	return ilog2(size);
 }
 
 static inline unsigned int block_size(struct block_device *bdev)

^ permalink raw reply

* Re: [PATCH v2] blkdev: Replace blksize_bits() with ilog2()
From: Matthew Wilcox @ 2020-05-29 20:27 UTC (permalink / raw)
  To: Kaitao Cheng
  Cc: axboe, hch, sth, viro, clm, jaegeuk, hch, mark, dhowells, balbi,
	damien.lemoal, bvanassche, ming.lei, martin.petersen, satyat,
	chaitanya.kulkarni, houtao1, asml.silence, ajay.joshi,
	linux-kernel, songmuchun, hoeppner, heiko.carstens, gor,
	borntraeger, linux-s390, sagi, linux-nvme, gregkh, linux-usb,
	josef, dsterba, linux-btrfs, chao, linux-f2fs-devel, darrick.wong,
	linux-xfs, linux-fsdevel, jlbec, joseph.qi, ocfs2-devel,
	deepa.kernel
In-Reply-To: <20200529141100.37519-1-pilgrimtao@gmail.com>

On Fri, May 29, 2020 at 10:11:00PM +0800, Kaitao Cheng wrote:
> There is a function named ilog2() exist which can replace blksize.
> The generated code will be shorter and more efficient on some
> architecture, such as arm64. And ilog2() can be optimized according
> to different architecture.

We'd get the same benefit from a smaller patch with just:

--- a/include/linux/blkdev.h
+++ b/include/linux/blkdev.h
@@ -1502,15 +1502,9 @@ static inline int blk_rq_aligned(struct request_queue *q, unsigned long addr,
 	return !(addr & alignment) && !(len & alignment);
 }
 
-/* assumes size > 256 */
 static inline unsigned int blksize_bits(unsigned int size)
 {
-	unsigned int bits = 8;
-	do {
-		bits++;
-		size >>= 1;
-	} while (size > 256);
-	return bits;
+	return ilog2(size);
 }
 
 static inline unsigned int block_size(struct block_device *bdev)

^ permalink raw reply

* Re: [PATCH v2] blkdev: Replace blksize_bits() with ilog2()
From: Matthew Wilcox @ 2020-05-29 20:27 UTC (permalink / raw)
  To: Kaitao Cheng
  Cc: hoeppner, heiko.carstens, linux-nvme, dhowells, clm, deepa.kernel,
	houtao1, hch, linux-s390, bvanassche, darrick.wong, mark, satyat,
	hch, borntraeger, gor, ajay.joshi, chaitanya.kulkarni, chao,
	josef, ming.lei, viro, songmuchun, dsterba, jaegeuk, jlbec, sagi,
	axboe, balbi, damien.lemoal, martin.petersen, joseph.qi, gregkh,
	linux-usb, linux-kernel, linux-f2fs-devel, linux-xfs, ocfs2-devel,
	linux-fsdevel, asml.silence, linux-btrfs, sth
In-Reply-To: <20200529141100.37519-1-pilgrimtao@gmail.com>

On Fri, May 29, 2020 at 10:11:00PM +0800, Kaitao Cheng wrote:
> There is a function named ilog2() exist which can replace blksize.
> The generated code will be shorter and more efficient on some
> architecture, such as arm64. And ilog2() can be optimized according
> to different architecture.

We'd get the same benefit from a smaller patch with just:

--- a/include/linux/blkdev.h
+++ b/include/linux/blkdev.h
@@ -1502,15 +1502,9 @@ static inline int blk_rq_aligned(struct request_queue *q, unsigned long addr,
 	return !(addr & alignment) && !(len & alignment);
 }
 
-/* assumes size > 256 */
 static inline unsigned int blksize_bits(unsigned int size)
 {
-	unsigned int bits = 8;
-	do {
-		bits++;
-		size >>= 1;
-	} while (size > 256);
-	return bits;
+	return ilog2(size);
 }
 
 static inline unsigned int block_size(struct block_device *bdev)

_______________________________________________
linux-nvme mailing list
linux-nvme@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-nvme

^ permalink raw reply

* Re: [f2fs-dev] [PATCH v2] blkdev: Replace blksize_bits() with ilog2()
From: Matthew Wilcox @ 2020-05-29 20:27 UTC (permalink / raw)
  To: Kaitao Cheng
  Cc: hoeppner, heiko.carstens, linux-nvme, dhowells, clm, deepa.kernel,
	houtao1, hch, linux-s390, bvanassche, darrick.wong, mark, satyat,
	hch, borntraeger, gor, chaitanya.kulkarni, josef, ming.lei, viro,
	songmuchun, dsterba, jaegeuk, jlbec, sagi, axboe, balbi,
	damien.lemoal, martin.petersen, joseph.qi, gregkh, linux-usb,
	linux-kernel, linux-f2fs-devel, linux-xfs, ocfs2-devel,
	linux-fsdevel, asml.silence, linux-btrfs, sth
In-Reply-To: <20200529141100.37519-1-pilgrimtao@gmail.com>

On Fri, May 29, 2020 at 10:11:00PM +0800, Kaitao Cheng wrote:
> There is a function named ilog2() exist which can replace blksize.
> The generated code will be shorter and more efficient on some
> architecture, such as arm64. And ilog2() can be optimized according
> to different architecture.

We'd get the same benefit from a smaller patch with just:

--- a/include/linux/blkdev.h
+++ b/include/linux/blkdev.h
@@ -1502,15 +1502,9 @@ static inline int blk_rq_aligned(struct request_queue *q, unsigned long addr,
 	return !(addr & alignment) && !(len & alignment);
 }
 
-/* assumes size > 256 */
 static inline unsigned int blksize_bits(unsigned int size)
 {
-	unsigned int bits = 8;
-	do {
-		bits++;
-		size >>= 1;
-	} while (size > 256);
-	return bits;
+	return ilog2(size);
 }
 
 static inline unsigned int block_size(struct block_device *bdev)


_______________________________________________
Linux-f2fs-devel mailing list
Linux-f2fs-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel

^ permalink raw reply

* [linux-next:master 9589/14131] kernel//debug/debug_core.c:420:5: warning: no previous prototype for function 'kgdb_has_hit_break'
From: kbuild test robot @ 2020-05-29 20:28 UTC (permalink / raw)
  To: kbuild-all

[-- Attachment #1: Type: text/plain, Size: 1953 bytes --]

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master
head:   e7b08814b16b80a0bf76eeca16317f8c2ed23b8c
commit: f83b04d36e52cc3d941120ec859374fcda36eb31 [9589/14131] kgdb: Add kgdb_has_hit_break function
config: x86_64-allyesconfig (attached as .config)
compiler: clang version 11.0.0 (https://github.com/llvm/llvm-project 2d068e534f1671459e1b135852c1b3c10502e929)
reproduce (this is a W=1 build):
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # install x86_64 cross compiling tool for clang build
        # apt-get install binutils-x86-64-linux-gnu
        git checkout f83b04d36e52cc3d941120ec859374fcda36eb31
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=x86_64 

If you fix the issue, kindly add following tag as appropriate
Reported-by: kbuild test robot <lkp@intel.com>

All warnings (new ones prefixed by >>, old ones prefixed by <<):

>> kernel//debug/debug_core.c:420:5: warning: no previous prototype for function 'kgdb_has_hit_break' [-Wmissing-prototypes]
int kgdb_has_hit_break(unsigned long addr)
^
kernel//debug/debug_core.c:420:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
int kgdb_has_hit_break(unsigned long addr)
^
static
1 warning generated.

vim +/kgdb_has_hit_break +420 kernel//debug/debug_core.c

   419	
 > 420	int kgdb_has_hit_break(unsigned long addr)
   421	{
   422		int i;
   423	
   424		for (i = 0; i < KGDB_MAX_BREAKPOINTS; i++) {
   425			if (kgdb_break[i].state == BP_ACTIVE &&
   426			    kgdb_break[i].bpt_addr == addr)
   427				return 1;
   428		}
   429		return 0;
   430	}
   431	

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org

[-- Attachment #2: config.gz --]
[-- Type: application/gzip, Size: 73449 bytes --]

^ permalink raw reply

* Re: [PATCH] staging: gasket: Convert get_user_pages*() --> pin_user_pages*()
From: John Hubbard @ 2020-05-29 20:28 UTC (permalink / raw)
  To: Dan Carpenter, Souptick Joarder
  Cc: devel, gregkh, linux-kernel, rspringer, toddpoynor
In-Reply-To: <20200529115330.GO30374@kadam>

On 2020-05-29 04:53, Dan Carpenter wrote:
...
> What are the runtime implications of this patch?  I'm still not clear on
> that honestly.

Instead of incrementing each page's refcount by 1 (with get_user_pages()),
pin_user_pages*() will increment by GUP_PIN_COUNTING_BIAS, which is 1024.
That by itself should not have any performance impact, of course, but
there's a couple more things:

For compound pages of more than 2 page size, it will also increment
a separate struct page's field, via hpage_pincount_add().

And finally, it will update /proc/vmstat counters on pin and unpin, via
the optimized mod_node_page_state() call.

So it's expected to be very light. And, for DMA (as opposed to DIO)
situations, the DMA setup time is inevitably much greater than any of
the above overheads, so I expect that this patch will be completely
invisible from a performance point of view.

It would be a "nice to have", though, if anyone were able to do a
performance comparison on the gasket driver for this patch, and/or
basic runtime verification, since I'm sure it's a specialized setup.


thanks,
-- 
John Hubbard
NVIDIA

^ permalink raw reply

* Re: [PATCH v2 14/14] x86/shstk: Activate Supervisor Shadow Stacks
From: Andrew Cooper @ 2020-05-29 20:28 UTC (permalink / raw)
  To: Jan Beulich; +Cc: Xen-devel, Wei Liu, Roger Pau Monné
In-Reply-To: <886eccd3-e2d4-fdc5-f1cd-e8671a5271e2@suse.com>

On 29/05/2020 14:09, Jan Beulich wrote:
> On 27.05.2020 21:18, Andrew Cooper wrote:
>> With all other plumbing in place, activate shadow stacks when possible.  Note
>> that this requires prohibiting the use of PV32.  Compatibility can be
>> maintained if necessary via PV-Shim.
> In the revision log you say "Discuss CET-SS disabling PV32", and I
> agree both here and in the command line doc you mention the "that"
> aspect. But what about the "why"? Aiui "is incompatible" or
> "requires" are too strong statements: It could be made work (by
> disabling / enabling CET on the way out of / back into Xen), but
> besides losing some of the intended protection that way, it would
> be quite a bit of overhead. So it's more like a design decision,
> and it would be nice to express it like this at least in the
> commit message.

For starters, the guest kernel and Xen share the single
MSR_S_CET.SHSKT_EN bit, as they are both supervisor in the eyes of the
processor.

We can't use the PV32_CR4 trick to turn CET.SS off on return to guest
kernel context, because (unlike SMAP/SMEP), the race condition with a
late NMI would manifest as #CP against the IRET, not a spurious page fault.

Furthermore, an IRET to Ring 3 and an IRET to Ring 1 now differ by three
words on the shadow stack.  An IRET to Ring 1 is a supervisor return, so
performs consistency checks on %cs/%lip/SSP on the shadow stack.  We
could in theory shuffle the shadow stack by 3 words on context switch.

It might theoretically be possible to make something which functioned
correctly with a PV guest kernel which doesn't understand a
paravirtualised version of supervisor shadow stacks, but I quickly
concluded that it isn't even worth the effort to figure for certain.

>
>> --- a/xen/arch/x86/setup.c
>> +++ b/xen/arch/x86/setup.c
>> @@ -664,6 +664,13 @@ static void __init noreturn reinit_bsp_stack(void)
>>      stack_base[0] = stack;
>>      memguard_guard_stack(stack);
>>  
>> +    if ( cpu_has_xen_shstk )
>> +    {
>> +        wrmsrl(MSR_PL0_SSP, (unsigned long)stack + 0x5ff8);
> Please replace this remaining literal number accordingly.
>
>> @@ -1801,6 +1823,10 @@ void __init noreturn __start_xen(unsigned long mbi_p)
>>  
>>      alternative_branches();
>>  
>> +    /* Defer CR4.CET until alternatives have finished playing with CR4.WP */
>> +    if ( cpu_has_xen_shstk )
>> +        set_in_cr4(X86_CR4_CET);
> Nit: The comment still wants changing to CR0.WP.
>
> With these taken care of in some form
> Reviewed-by: Jan Beulich <jbeulich@suse.com>

Thanks.

~Andrew


^ permalink raw reply

* Re: [PATCH v8 41/62] target/riscv: vector floating-point classify instructions
From: Alistair Francis @ 2020-05-29 20:20 UTC (permalink / raw)
  To: LIU Zhiwei
  Cc: qemu-devel@nongnu.org Developers, open list:RISC-V,
	Richard Henderson, wxy194768, wenmeng_zhang, Alistair Francis,
	Palmer Dabbelt
In-Reply-To: <20200521094413.10425-42-zhiwei_liu@c-sky.com>

On Thu, May 21, 2020 at 4:07 AM LIU Zhiwei <zhiwei_liu@c-sky.com> wrote:
>
> Signed-off-by: LIU Zhiwei <zhiwei_liu@c-sky.com>
> Reviewed-by: Richard Henderson <richard.henderson@linaro.org>

Reviewed-by: Alistair Francis <alistair.francis@wdc.com>

Alistair

> ---
>  target/riscv/fpu_helper.c               | 33 +--------
>  target/riscv/helper.h                   |  4 ++
>  target/riscv/insn32.decode              |  1 +
>  target/riscv/insn_trans/trans_rvv.inc.c |  3 +
>  target/riscv/internals.h                |  5 ++
>  target/riscv/vector_helper.c            | 91 +++++++++++++++++++++++++
>  6 files changed, 107 insertions(+), 30 deletions(-)
>
> diff --git a/target/riscv/fpu_helper.c b/target/riscv/fpu_helper.c
> index 262610e837..fdbdffaef2 100644
> --- a/target/riscv/fpu_helper.c
> +++ b/target/riscv/fpu_helper.c
> @@ -22,6 +22,7 @@
>  #include "exec/exec-all.h"
>  #include "exec/helper-proto.h"
>  #include "fpu/softfloat.h"
> +#include "internals.h"
>
>  target_ulong riscv_cpu_get_fflags(CPURISCVState *env)
>  {
> @@ -239,21 +240,7 @@ uint64_t helper_fcvt_s_lu(CPURISCVState *env, uint64_t rs1)
>
>  target_ulong helper_fclass_s(uint64_t frs1)
>  {
> -    float32 f = frs1;
> -    bool sign = float32_is_neg(f);
> -
> -    if (float32_is_infinity(f)) {
> -        return sign ? 1 << 0 : 1 << 7;
> -    } else if (float32_is_zero(f)) {
> -        return sign ? 1 << 3 : 1 << 4;
> -    } else if (float32_is_zero_or_denormal(f)) {
> -        return sign ? 1 << 2 : 1 << 5;
> -    } else if (float32_is_any_nan(f)) {
> -        float_status s = { }; /* for snan_bit_is_one */
> -        return float32_is_quiet_nan(f, &s) ? 1 << 9 : 1 << 8;
> -    } else {
> -        return sign ? 1 << 1 : 1 << 6;
> -    }
> +    return fclass_s(frs1);
>  }
>
>  uint64_t helper_fadd_d(CPURISCVState *env, uint64_t frs1, uint64_t frs2)
> @@ -362,19 +349,5 @@ uint64_t helper_fcvt_d_lu(CPURISCVState *env, uint64_t rs1)
>
>  target_ulong helper_fclass_d(uint64_t frs1)
>  {
> -    float64 f = frs1;
> -    bool sign = float64_is_neg(f);
> -
> -    if (float64_is_infinity(f)) {
> -        return sign ? 1 << 0 : 1 << 7;
> -    } else if (float64_is_zero(f)) {
> -        return sign ? 1 << 3 : 1 << 4;
> -    } else if (float64_is_zero_or_denormal(f)) {
> -        return sign ? 1 << 2 : 1 << 5;
> -    } else if (float64_is_any_nan(f)) {
> -        float_status s = { }; /* for snan_bit_is_one */
> -        return float64_is_quiet_nan(f, &s) ? 1 << 9 : 1 << 8;
> -    } else {
> -        return sign ? 1 << 1 : 1 << 6;
> -    }
> +    return fclass_d(frs1);
>  }
> diff --git a/target/riscv/helper.h b/target/riscv/helper.h
> index bedd4d0114..23b268df90 100644
> --- a/target/riscv/helper.h
> +++ b/target/riscv/helper.h
> @@ -990,3 +990,7 @@ DEF_HELPER_6(vmford_vv_d, void, ptr, ptr, ptr, ptr, env, i32)
>  DEF_HELPER_6(vmford_vf_h, void, ptr, ptr, i64, ptr, env, i32)
>  DEF_HELPER_6(vmford_vf_w, void, ptr, ptr, i64, ptr, env, i32)
>  DEF_HELPER_6(vmford_vf_d, void, ptr, ptr, i64, ptr, env, i32)
> +
> +DEF_HELPER_5(vfclass_v_h, void, ptr, ptr, ptr, env, i32)
> +DEF_HELPER_5(vfclass_v_w, void, ptr, ptr, ptr, env, i32)
> +DEF_HELPER_5(vfclass_v_d, void, ptr, ptr, ptr, env, i32)
> diff --git a/target/riscv/insn32.decode b/target/riscv/insn32.decode
> index b0f1c54d53..23e80fe954 100644
> --- a/target/riscv/insn32.decode
> +++ b/target/riscv/insn32.decode
> @@ -512,6 +512,7 @@ vmfgt_vf        011101 . ..... ..... 101 ..... 1010111 @r_vm
>  vmfge_vf        011111 . ..... ..... 101 ..... 1010111 @r_vm
>  vmford_vv       011010 . ..... ..... 001 ..... 1010111 @r_vm
>  vmford_vf       011010 . ..... ..... 101 ..... 1010111 @r_vm
> +vfclass_v       100011 . ..... 10000 001 ..... 1010111 @r2_vm
>
>  vsetvli         0 ........... ..... 111 ..... 1010111  @r2_zimm
>  vsetvl          1000000 ..... ..... 111 ..... 1010111  @r
> diff --git a/target/riscv/insn_trans/trans_rvv.inc.c b/target/riscv/insn_trans/trans_rvv.inc.c
> index 4a45c00ffb..621220e5ff 100644
> --- a/target/riscv/insn_trans/trans_rvv.inc.c
> +++ b/target/riscv/insn_trans/trans_rvv.inc.c
> @@ -2174,3 +2174,6 @@ GEN_OPFVF_TRANS(vmfle_vf, opfvf_cmp_check)
>  GEN_OPFVF_TRANS(vmfgt_vf, opfvf_cmp_check)
>  GEN_OPFVF_TRANS(vmfge_vf, opfvf_cmp_check)
>  GEN_OPFVF_TRANS(vmford_vf, opfvf_cmp_check)
> +
> +/* Vector Floating-Point Classify Instruction */
> +GEN_OPFV_TRANS(vfclass_v, opfv_check)
> diff --git a/target/riscv/internals.h b/target/riscv/internals.h
> index 52f6af2513..ed2ad7f0f1 100644
> --- a/target/riscv/internals.h
> +++ b/target/riscv/internals.h
> @@ -30,4 +30,9 @@ FIELD(VDATA, WD, 11, 1)
>
>  /* set float rounding mode */
>  bool riscv_cpu_set_rounding_mode(CPURISCVState *env, uint32_t rm);
> +
> +/* float point classify helpers */
> +target_ulong fclass_h(uint64_t frs1);
> +target_ulong fclass_s(uint64_t frs1);
> +target_ulong fclass_d(uint64_t frs1);
>  #endif
> diff --git a/target/riscv/vector_helper.c b/target/riscv/vector_helper.c
> index 92227228b7..63d8873c0a 100644
> --- a/target/riscv/vector_helper.c
> +++ b/target/riscv/vector_helper.c
> @@ -4102,3 +4102,94 @@ GEN_VEXT_CMP_VV_ENV(vmford_vv_d, uint64_t, H8, !float64_unordered_quiet)
>  GEN_VEXT_CMP_VF(vmford_vf_h, uint16_t, H2, !float16_unordered_quiet)
>  GEN_VEXT_CMP_VF(vmford_vf_w, uint32_t, H4, !float32_unordered_quiet)
>  GEN_VEXT_CMP_VF(vmford_vf_d, uint64_t, H8, !float64_unordered_quiet)
> +
> +/* Vector Floating-Point Classify Instruction */
> +#define OPIVV1(NAME, TD, T2, TX2, HD, HS2, OP)         \
> +static void do_##NAME(void *vd, void *vs2, int i)      \
> +{                                                      \
> +    TX2 s2 = *((T2 *)vs2 + HS2(i));                    \
> +    *((TD *)vd + HD(i)) = OP(s2);                      \
> +}
> +
> +#define GEN_VEXT_V(NAME, ESZ, DSZ, CLEAR_FN)           \
> +void HELPER(NAME)(void *vd, void *v0, void *vs2,       \
> +                  CPURISCVState *env, uint32_t desc)   \
> +{                                                      \
> +    uint32_t vlmax = vext_maxsz(desc) / ESZ;           \
> +    uint32_t mlen = vext_mlen(desc);                   \
> +    uint32_t vm = vext_vm(desc);                       \
> +    uint32_t vl = env->vl;                             \
> +    uint32_t i;                                        \
> +                                                       \
> +    for (i = 0; i < vl; i++) {                         \
> +        if (!vm && !vext_elem_mask(v0, mlen, i)) {     \
> +            continue;                                  \
> +        }                                              \
> +        do_##NAME(vd, vs2, i);                         \
> +    }                                                  \
> +    CLEAR_FN(vd, vl, vl * DSZ,  vlmax * DSZ);          \
> +}
> +
> +target_ulong fclass_h(uint64_t frs1)
> +{
> +    float16 f = frs1;
> +    bool sign = float16_is_neg(f);
> +
> +    if (float16_is_infinity(f)) {
> +        return sign ? 1 << 0 : 1 << 7;
> +    } else if (float16_is_zero(f)) {
> +        return sign ? 1 << 3 : 1 << 4;
> +    } else if (float16_is_zero_or_denormal(f)) {
> +        return sign ? 1 << 2 : 1 << 5;
> +    } else if (float16_is_any_nan(f)) {
> +        float_status s = { }; /* for snan_bit_is_one */
> +        return float16_is_quiet_nan(f, &s) ? 1 << 9 : 1 << 8;
> +    } else {
> +        return sign ? 1 << 1 : 1 << 6;
> +    }
> +}
> +
> +target_ulong fclass_s(uint64_t frs1)
> +{
> +    float32 f = frs1;
> +    bool sign = float32_is_neg(f);
> +
> +    if (float32_is_infinity(f)) {
> +        return sign ? 1 << 0 : 1 << 7;
> +    } else if (float32_is_zero(f)) {
> +        return sign ? 1 << 3 : 1 << 4;
> +    } else if (float32_is_zero_or_denormal(f)) {
> +        return sign ? 1 << 2 : 1 << 5;
> +    } else if (float32_is_any_nan(f)) {
> +        float_status s = { }; /* for snan_bit_is_one */
> +        return float32_is_quiet_nan(f, &s) ? 1 << 9 : 1 << 8;
> +    } else {
> +        return sign ? 1 << 1 : 1 << 6;
> +    }
> +}
> +
> +target_ulong fclass_d(uint64_t frs1)
> +{
> +    float64 f = frs1;
> +    bool sign = float64_is_neg(f);
> +
> +    if (float64_is_infinity(f)) {
> +        return sign ? 1 << 0 : 1 << 7;
> +    } else if (float64_is_zero(f)) {
> +        return sign ? 1 << 3 : 1 << 4;
> +    } else if (float64_is_zero_or_denormal(f)) {
> +        return sign ? 1 << 2 : 1 << 5;
> +    } else if (float64_is_any_nan(f)) {
> +        float_status s = { }; /* for snan_bit_is_one */
> +        return float64_is_quiet_nan(f, &s) ? 1 << 9 : 1 << 8;
> +    } else {
> +        return sign ? 1 << 1 : 1 << 6;
> +    }
> +}
> +
> +RVVCALL(OPIVV1, vfclass_v_h, OP_UU_H, H2, H2, fclass_h)
> +RVVCALL(OPIVV1, vfclass_v_w, OP_UU_W, H4, H4, fclass_s)
> +RVVCALL(OPIVV1, vfclass_v_d, OP_UU_D, H8, H8, fclass_d)
> +GEN_VEXT_V(vfclass_v_h, 2, 2, clearh)
> +GEN_VEXT_V(vfclass_v_w, 4, 4, clearl)
> +GEN_VEXT_V(vfclass_v_d, 8, 8, clearq)
> --
> 2.23.0
>
>


^ permalink raw reply

* Re: [PATCH v8 41/62] target/riscv: vector floating-point classify instructions
From: Alistair Francis @ 2020-05-29 20:20 UTC (permalink / raw)
  To: LIU Zhiwei
  Cc: open list:RISC-V, Richard Henderson,
	qemu-devel@nongnu.org Developers, wxy194768, wenmeng_zhang,
	Alistair Francis, Palmer Dabbelt
In-Reply-To: <20200521094413.10425-42-zhiwei_liu@c-sky.com>

On Thu, May 21, 2020 at 4:07 AM LIU Zhiwei <zhiwei_liu@c-sky.com> wrote:
>
> Signed-off-by: LIU Zhiwei <zhiwei_liu@c-sky.com>
> Reviewed-by: Richard Henderson <richard.henderson@linaro.org>

Reviewed-by: Alistair Francis <alistair.francis@wdc.com>

Alistair

> ---
>  target/riscv/fpu_helper.c               | 33 +--------
>  target/riscv/helper.h                   |  4 ++
>  target/riscv/insn32.decode              |  1 +
>  target/riscv/insn_trans/trans_rvv.inc.c |  3 +
>  target/riscv/internals.h                |  5 ++
>  target/riscv/vector_helper.c            | 91 +++++++++++++++++++++++++
>  6 files changed, 107 insertions(+), 30 deletions(-)
>
> diff --git a/target/riscv/fpu_helper.c b/target/riscv/fpu_helper.c
> index 262610e837..fdbdffaef2 100644
> --- a/target/riscv/fpu_helper.c
> +++ b/target/riscv/fpu_helper.c
> @@ -22,6 +22,7 @@
>  #include "exec/exec-all.h"
>  #include "exec/helper-proto.h"
>  #include "fpu/softfloat.h"
> +#include "internals.h"
>
>  target_ulong riscv_cpu_get_fflags(CPURISCVState *env)
>  {
> @@ -239,21 +240,7 @@ uint64_t helper_fcvt_s_lu(CPURISCVState *env, uint64_t rs1)
>
>  target_ulong helper_fclass_s(uint64_t frs1)
>  {
> -    float32 f = frs1;
> -    bool sign = float32_is_neg(f);
> -
> -    if (float32_is_infinity(f)) {
> -        return sign ? 1 << 0 : 1 << 7;
> -    } else if (float32_is_zero(f)) {
> -        return sign ? 1 << 3 : 1 << 4;
> -    } else if (float32_is_zero_or_denormal(f)) {
> -        return sign ? 1 << 2 : 1 << 5;
> -    } else if (float32_is_any_nan(f)) {
> -        float_status s = { }; /* for snan_bit_is_one */
> -        return float32_is_quiet_nan(f, &s) ? 1 << 9 : 1 << 8;
> -    } else {
> -        return sign ? 1 << 1 : 1 << 6;
> -    }
> +    return fclass_s(frs1);
>  }
>
>  uint64_t helper_fadd_d(CPURISCVState *env, uint64_t frs1, uint64_t frs2)
> @@ -362,19 +349,5 @@ uint64_t helper_fcvt_d_lu(CPURISCVState *env, uint64_t rs1)
>
>  target_ulong helper_fclass_d(uint64_t frs1)
>  {
> -    float64 f = frs1;
> -    bool sign = float64_is_neg(f);
> -
> -    if (float64_is_infinity(f)) {
> -        return sign ? 1 << 0 : 1 << 7;
> -    } else if (float64_is_zero(f)) {
> -        return sign ? 1 << 3 : 1 << 4;
> -    } else if (float64_is_zero_or_denormal(f)) {
> -        return sign ? 1 << 2 : 1 << 5;
> -    } else if (float64_is_any_nan(f)) {
> -        float_status s = { }; /* for snan_bit_is_one */
> -        return float64_is_quiet_nan(f, &s) ? 1 << 9 : 1 << 8;
> -    } else {
> -        return sign ? 1 << 1 : 1 << 6;
> -    }
> +    return fclass_d(frs1);
>  }
> diff --git a/target/riscv/helper.h b/target/riscv/helper.h
> index bedd4d0114..23b268df90 100644
> --- a/target/riscv/helper.h
> +++ b/target/riscv/helper.h
> @@ -990,3 +990,7 @@ DEF_HELPER_6(vmford_vv_d, void, ptr, ptr, ptr, ptr, env, i32)
>  DEF_HELPER_6(vmford_vf_h, void, ptr, ptr, i64, ptr, env, i32)
>  DEF_HELPER_6(vmford_vf_w, void, ptr, ptr, i64, ptr, env, i32)
>  DEF_HELPER_6(vmford_vf_d, void, ptr, ptr, i64, ptr, env, i32)
> +
> +DEF_HELPER_5(vfclass_v_h, void, ptr, ptr, ptr, env, i32)
> +DEF_HELPER_5(vfclass_v_w, void, ptr, ptr, ptr, env, i32)
> +DEF_HELPER_5(vfclass_v_d, void, ptr, ptr, ptr, env, i32)
> diff --git a/target/riscv/insn32.decode b/target/riscv/insn32.decode
> index b0f1c54d53..23e80fe954 100644
> --- a/target/riscv/insn32.decode
> +++ b/target/riscv/insn32.decode
> @@ -512,6 +512,7 @@ vmfgt_vf        011101 . ..... ..... 101 ..... 1010111 @r_vm
>  vmfge_vf        011111 . ..... ..... 101 ..... 1010111 @r_vm
>  vmford_vv       011010 . ..... ..... 001 ..... 1010111 @r_vm
>  vmford_vf       011010 . ..... ..... 101 ..... 1010111 @r_vm
> +vfclass_v       100011 . ..... 10000 001 ..... 1010111 @r2_vm
>
>  vsetvli         0 ........... ..... 111 ..... 1010111  @r2_zimm
>  vsetvl          1000000 ..... ..... 111 ..... 1010111  @r
> diff --git a/target/riscv/insn_trans/trans_rvv.inc.c b/target/riscv/insn_trans/trans_rvv.inc.c
> index 4a45c00ffb..621220e5ff 100644
> --- a/target/riscv/insn_trans/trans_rvv.inc.c
> +++ b/target/riscv/insn_trans/trans_rvv.inc.c
> @@ -2174,3 +2174,6 @@ GEN_OPFVF_TRANS(vmfle_vf, opfvf_cmp_check)
>  GEN_OPFVF_TRANS(vmfgt_vf, opfvf_cmp_check)
>  GEN_OPFVF_TRANS(vmfge_vf, opfvf_cmp_check)
>  GEN_OPFVF_TRANS(vmford_vf, opfvf_cmp_check)
> +
> +/* Vector Floating-Point Classify Instruction */
> +GEN_OPFV_TRANS(vfclass_v, opfv_check)
> diff --git a/target/riscv/internals.h b/target/riscv/internals.h
> index 52f6af2513..ed2ad7f0f1 100644
> --- a/target/riscv/internals.h
> +++ b/target/riscv/internals.h
> @@ -30,4 +30,9 @@ FIELD(VDATA, WD, 11, 1)
>
>  /* set float rounding mode */
>  bool riscv_cpu_set_rounding_mode(CPURISCVState *env, uint32_t rm);
> +
> +/* float point classify helpers */
> +target_ulong fclass_h(uint64_t frs1);
> +target_ulong fclass_s(uint64_t frs1);
> +target_ulong fclass_d(uint64_t frs1);
>  #endif
> diff --git a/target/riscv/vector_helper.c b/target/riscv/vector_helper.c
> index 92227228b7..63d8873c0a 100644
> --- a/target/riscv/vector_helper.c
> +++ b/target/riscv/vector_helper.c
> @@ -4102,3 +4102,94 @@ GEN_VEXT_CMP_VV_ENV(vmford_vv_d, uint64_t, H8, !float64_unordered_quiet)
>  GEN_VEXT_CMP_VF(vmford_vf_h, uint16_t, H2, !float16_unordered_quiet)
>  GEN_VEXT_CMP_VF(vmford_vf_w, uint32_t, H4, !float32_unordered_quiet)
>  GEN_VEXT_CMP_VF(vmford_vf_d, uint64_t, H8, !float64_unordered_quiet)
> +
> +/* Vector Floating-Point Classify Instruction */
> +#define OPIVV1(NAME, TD, T2, TX2, HD, HS2, OP)         \
> +static void do_##NAME(void *vd, void *vs2, int i)      \
> +{                                                      \
> +    TX2 s2 = *((T2 *)vs2 + HS2(i));                    \
> +    *((TD *)vd + HD(i)) = OP(s2);                      \
> +}
> +
> +#define GEN_VEXT_V(NAME, ESZ, DSZ, CLEAR_FN)           \
> +void HELPER(NAME)(void *vd, void *v0, void *vs2,       \
> +                  CPURISCVState *env, uint32_t desc)   \
> +{                                                      \
> +    uint32_t vlmax = vext_maxsz(desc) / ESZ;           \
> +    uint32_t mlen = vext_mlen(desc);                   \
> +    uint32_t vm = vext_vm(desc);                       \
> +    uint32_t vl = env->vl;                             \
> +    uint32_t i;                                        \
> +                                                       \
> +    for (i = 0; i < vl; i++) {                         \
> +        if (!vm && !vext_elem_mask(v0, mlen, i)) {     \
> +            continue;                                  \
> +        }                                              \
> +        do_##NAME(vd, vs2, i);                         \
> +    }                                                  \
> +    CLEAR_FN(vd, vl, vl * DSZ,  vlmax * DSZ);          \
> +}
> +
> +target_ulong fclass_h(uint64_t frs1)
> +{
> +    float16 f = frs1;
> +    bool sign = float16_is_neg(f);
> +
> +    if (float16_is_infinity(f)) {
> +        return sign ? 1 << 0 : 1 << 7;
> +    } else if (float16_is_zero(f)) {
> +        return sign ? 1 << 3 : 1 << 4;
> +    } else if (float16_is_zero_or_denormal(f)) {
> +        return sign ? 1 << 2 : 1 << 5;
> +    } else if (float16_is_any_nan(f)) {
> +        float_status s = { }; /* for snan_bit_is_one */
> +        return float16_is_quiet_nan(f, &s) ? 1 << 9 : 1 << 8;
> +    } else {
> +        return sign ? 1 << 1 : 1 << 6;
> +    }
> +}
> +
> +target_ulong fclass_s(uint64_t frs1)
> +{
> +    float32 f = frs1;
> +    bool sign = float32_is_neg(f);
> +
> +    if (float32_is_infinity(f)) {
> +        return sign ? 1 << 0 : 1 << 7;
> +    } else if (float32_is_zero(f)) {
> +        return sign ? 1 << 3 : 1 << 4;
> +    } else if (float32_is_zero_or_denormal(f)) {
> +        return sign ? 1 << 2 : 1 << 5;
> +    } else if (float32_is_any_nan(f)) {
> +        float_status s = { }; /* for snan_bit_is_one */
> +        return float32_is_quiet_nan(f, &s) ? 1 << 9 : 1 << 8;
> +    } else {
> +        return sign ? 1 << 1 : 1 << 6;
> +    }
> +}
> +
> +target_ulong fclass_d(uint64_t frs1)
> +{
> +    float64 f = frs1;
> +    bool sign = float64_is_neg(f);
> +
> +    if (float64_is_infinity(f)) {
> +        return sign ? 1 << 0 : 1 << 7;
> +    } else if (float64_is_zero(f)) {
> +        return sign ? 1 << 3 : 1 << 4;
> +    } else if (float64_is_zero_or_denormal(f)) {
> +        return sign ? 1 << 2 : 1 << 5;
> +    } else if (float64_is_any_nan(f)) {
> +        float_status s = { }; /* for snan_bit_is_one */
> +        return float64_is_quiet_nan(f, &s) ? 1 << 9 : 1 << 8;
> +    } else {
> +        return sign ? 1 << 1 : 1 << 6;
> +    }
> +}
> +
> +RVVCALL(OPIVV1, vfclass_v_h, OP_UU_H, H2, H2, fclass_h)
> +RVVCALL(OPIVV1, vfclass_v_w, OP_UU_W, H4, H4, fclass_s)
> +RVVCALL(OPIVV1, vfclass_v_d, OP_UU_D, H8, H8, fclass_d)
> +GEN_VEXT_V(vfclass_v_h, 2, 2, clearh)
> +GEN_VEXT_V(vfclass_v_w, 4, 4, clearl)
> +GEN_VEXT_V(vfclass_v_d, 8, 8, clearq)
> --
> 2.23.0
>
>


^ permalink raw reply

* Re: linux-next: Tree for May 29 (objtool warnings)
From: Josh Poimboeuf @ 2020-05-29 20:31 UTC (permalink / raw)
  To: Randy Dunlap
  Cc: Stephen Rothwell, Linux Next Mailing List,
	Linux Kernel Mailing List, Peter Zijlstra, Kees Cook
In-Reply-To: <27c0f44b-f61f-a545-25b0-747f1a6dd7e9@infradead.org>

On Fri, May 29, 2020 at 12:43:59PM -0700, Randy Dunlap wrote:
> On 5/29/20 4:56 AM, Stephen Rothwell wrote:
> > Hi all,
> > 
> > News: there will be no linux-next release on Monday.
> > 
> > Changes since 20200528:
> > 
> 
> 
> on x86_64:
> 
> crypto/drbg.o: warning: objtool: drbg_hash_update()+0x2a6: unreachable instruction
> drivers/clk/clk-si5341.o: warning: objtool: si5341_synth_clk_set_rate()+0x129: unreachable instruction

More UBSAN_TRAP, this should be fixed by Kees' new patch.

-- 
Josh


^ permalink raw reply

* Re: incoming
From: Andrew Morton @ 2020-05-29 20:31 UTC (permalink / raw)
  To: Linus Torvalds; +Cc: mm-commits, Linux-MM
In-Reply-To: <CAHk-=whQSWcE1WvKxptHdyc9BUXQyxxyAH954=Jb_YSBrNJYDQ@mail.gmail.com>

On Thu, 28 May 2020 13:10:18 -0700 Linus Torvalds <torvalds@linux-foundation.org> wrote:

> Hmm..
> 
> On Wed, May 27, 2020 at 10:20 PM Andrew Morton
> <akpm@linux-foundation.org> wrote:
> >
> >  fs/binfmt_elf.c                |    2 +-
> >  include/asm-generic/topology.h |    2 +-
> >  include/linux/mm.h             |   19 +++++++++++++++----
> >  mm/khugepaged.c                |    1 +
> >  mm/z3fold.c                    |    3 +++
> >  5 files changed, 21 insertions(+), 6 deletions(-)
> 
> I wonder how you generate that diffstat.
> 
> The change to <linux/mm.h> simply doesn't match what you sent me.  The
> patch you sent me that changed mm.h had this:
> 
>  include/linux/mm.h |   15 +++++++++++++--
>  1 file changed, 13 insertions(+), 2 deletions(-)
> 
> (note 15 lines changed: it's +13 and -2) but now suddenly in your
> overall diffstat you have that
> 
>   include/linux/mm.h             |   19 +++++++++++++++----
> 
> with +15/-4.
> 
> So your diffstat simply doesn't match what you are sending. What's going on?
> 

Bah.  I got lazy (didn't want to interrupt an ongoing build) so I
generated the diffstat prior to folding two patches into a single one. 
Evidently diffstat isn't as smart as I had assumed!

^ permalink raw reply

* Re: [RFC v3 0/8] vDPA support in qemu
From: no-reply @ 2020-05-29 20:29 UTC (permalink / raw)
  To: lulu
  Cc: rdunlap, mst, mhabets, qemu-devel, rob.miller, saugatm, lulu,
	armbru, hch, eperezma, jgg, jasowang, shahafs, kevin.tian, parav,
	vmireyno, cunming.liang, gdawar, jiri, xiao.w.wang, stefanha,
	zhihong.wang, maxime.coquelin, aadam, cohuck, hanand,
	lingshan.zhu
In-Reply-To: <20200529140620.28759-1-lulu@redhat.com>

Patchew URL: https://patchew.org/QEMU/20200529140620.28759-1-lulu@redhat.com/



Hi,

This series failed the docker-quick@centos7 build test. Please find the testing commands and
their output below. If you have Docker installed, you can probably reproduce it
locally.

=== TEST SCRIPT BEGIN ===
#!/bin/bash
make docker-image-centos7 V=1 NETWORK=1
time make docker-test-quick@centos7 SHOW_ENV=1 J=14 NETWORK=1
=== TEST SCRIPT END ===

  CC      x86_64-softmmu/hw/virtio/vhost-user-fs-pci.o
  CC      x86_64-softmmu/hw/virtio/virtio-iommu.o
/tmp/qemu-test/src/hw/virtio/vhost-vdpa.c: In function 'vhost_vdpa_set_config':
/tmp/qemu-test/src/hw/virtio/vhost-vdpa.c:323:17: error: 'VHOST_VDPA_MAX_CONFIG_SIZE' undeclared (first use in this function)
     if ((size > VHOST_VDPA_MAX_CONFIG_SIZE) || (data == NULL)) {
                 ^
/tmp/qemu-test/src/hw/virtio/vhost-vdpa.c:323:17: note: each undeclared identifier is reported only once for each function it appears in
make[1]: *** [hw/virtio/vhost-vdpa.o] Error 1
make[1]: *** Waiting for unfinished jobs....
  CC      aarch64-softmmu/hw/vfio/common.o
  CC      aarch64-softmmu/hw/vfio/spapr.o
---
  CC      aarch64-softmmu/hw/virtio/vhost-vsock.o
  CC      aarch64-softmmu/hw/virtio/vhost-vsock-pci.o
/tmp/qemu-test/src/hw/virtio/vhost-vdpa.c: In function 'vhost_vdpa_set_config':
/tmp/qemu-test/src/hw/virtio/vhost-vdpa.c:323:17: error: 'VHOST_VDPA_MAX_CONFIG_SIZE' undeclared (first use in this function)
     if ((size > VHOST_VDPA_MAX_CONFIG_SIZE) || (data == NULL)) {
                 ^
/tmp/qemu-test/src/hw/virtio/vhost-vdpa.c:323:17: note: each undeclared identifier is reported only once for each function it appears in
make[1]: *** [hw/virtio/vhost-vdpa.o] Error 1
make[1]: *** Waiting for unfinished jobs....
make: *** [x86_64-softmmu/all] Error 2
make: *** Waiting for unfinished jobs....
make: *** [aarch64-softmmu/all] Error 2
Traceback (most recent call last):
  File "./tests/docker/docker.py", line 664, in <module>
    sys.exit(main())
---
    raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['sudo', '-n', 'docker', 'run', '--label', 'com.qemu.instance.uuid=c4d0aff9719e4e6986252b1cdad2d78a', '-u', '1001', '--security-opt', 'seccomp=unconfined', '--rm', '-e', 'TARGET_LIST=', '-e', 'EXTRA_CONFIGURE_OPTS=', '-e', 'V=', '-e', 'J=14', '-e', 'DEBUG=', '-e', 'SHOW_ENV=1', '-e', 'CCACHE_DIR=/var/tmp/ccache', '-v', '/home/patchew/.cache/qemu-docker-ccache:/var/tmp/ccache:z', '-v', '/var/tmp/patchew-tester-tmp-jxkhgbnq/src/docker-src.2020-05-29-16.25.59.22140:/var/tmp/qemu:z,ro', 'qemu:centos7', '/var/tmp/qemu/run', 'test-quick']' returned non-zero exit status 2.
filter=--filter=label=com.qemu.instance.uuid=c4d0aff9719e4e6986252b1cdad2d78a
make[1]: *** [docker-run] Error 1
make[1]: Leaving directory `/var/tmp/patchew-tester-tmp-jxkhgbnq/src'
make: *** [docker-run-test-quick@centos7] Error 2

real    3m7.072s
user    0m9.059s


The full log is available at
http://patchew.org/logs/20200529140620.28759-1-lulu@redhat.com/testing.docker-quick@centos7/?type=message.
---
Email generated automatically by Patchew [https://patchew.org/].
Please send your feedback to patchew-devel@redhat.com

^ permalink raw reply

* [Buildroot] [PATCH] DEVELOPERS: remove Carlos Santos
From: unixmania at gmail.com @ 2020-05-29 20:32 UTC (permalink / raw)
  To: buildroot

From: Carlos Santos <unixmania@gmail.com>

Goodbye!

Signed-off-by: Carlos Santos <unixmania@gmail.com>
---
 DEVELOPERS | 22 ----------------------
 1 file changed, 22 deletions(-)

diff --git a/DEVELOPERS b/DEVELOPERS
index 99f47c3a37..88050349db 100644
--- a/DEVELOPERS
+++ b/DEVELOPERS
@@ -504,28 +504,6 @@ N:	Carlo Caione <carlo.caione@gmail.com>
 F:	package/jailhouse/
 F:	package/sunxi-boards/
 
-N:	Carlos Santos <unixmania@gmail.com>
-F:	package/busybox/
-F:	package/initscripts/
-F:	package/intel-microcode/
-F:	package/liburiparser/
-F:	package/modem-manager/
-F:	package/pamtester/
-F:	package/pcm-tools/
-F:	package/skeleton-custom/
-F:	package/skeleton-init-common/
-F:	package/skeleton-init-none/
-F:	package/skeleton-init-systemd/
-F:	package/skeleton-init-sysv/
-F:	package/skeleton/
-F:	package/sysvinit/
-F:	package/udev-gentoo-scripts/
-F:	package/util-linux/
-F:	package/tpm2-abrmd/
-F:	package/tpm2-tools/
-F:	package/tpm2-totp/
-F:	package/tpm2-tss/
-
 N:	Carsten Schoenert <c.schoenert@gmail.com>
 F:	package/dvbsnoop/
 F:	package/libdvbsi/
-- 
2.18.4

^ permalink raw reply related

* Re: [PATCH 1/9] staging: media: atomisp: fix incorrect NULL pointer check
From: Arnd Bergmann @ 2020-05-29 20:31 UTC (permalink / raw)
  To: Nick Desaulniers
  Cc: Mauro Carvalho Chehab, Sakari Ailus, Linux Media Mailing List,
	driverdevel, LKML, clang-built-linux, Nathan Chancellor
In-Reply-To: <CAK8P3a2UKC=s7re2P+qfxz8eqeC+yCcPGuYKkgji9N_ugdgWhg@mail.gmail.com>

On Fri, May 29, 2020 at 10:23 PM Arnd Bergmann <arnd@arndb.de> wrote:
>
> On Fri, May 29, 2020 at 10:04 PM 'Nick Desaulniers' via Clang Built
> Linux <clang-built-linux@googlegroups.com> wrote:
> >
> > See also Nathan's 7 patch series.
> > https://lore.kernel.org/lkml/20200527071150.3381228-1-natechancellor@gmail.com/
> >
> > Might be some overlap between series?
> >
>
> Probably. I really should have checked when I saw the number of warnings.
>
> At least this gives Mauro a chance to double-check the changes and see if
> Nathan and I came to different conclusions on any of them.

I checked now and found that the overlap is smaller than I expected.
In each case, Nathans' solution seems more complete than mine,
so this patch ("staging: media: atomisp: fix incorrect NULL pointer check")
and also "staging: media: atomisp: fix a type conversion warning" can be
dropped, but I think the others are still needed.

        Arnd

^ permalink raw reply

* Re: [PATCH 2/2] perf build: Allow explicitely disabling the NO_SYSCALL_TABLE variable
From: Jiri Olsa @ 2020-05-29 20:33 UTC (permalink / raw)
  To: Arnaldo Carvalho de Melo
  Cc: Jiri Olsa, Namhyung Kim, Ingo Molnar, Thomas Gleixner,
	Clark Williams, linux-kernel, linux-perf-users,
	Arnaldo Carvalho de Melo, Adrian Hunter
In-Reply-To: <20200529194515.GB31795@kernel.org>

On Fri, May 29, 2020 at 04:45:15PM -0300, Arnaldo Carvalho de Melo wrote:
> Em Fri, May 29, 2020 at 08:07:17PM +0200, Jiri Olsa escreveu:
> > On Fri, May 29, 2020 at 12:55:52PM -0300, Arnaldo Carvalho de Melo wrote:
> > > From: Arnaldo Carvalho de Melo <acme@redhat.com>
> > > 
> > > This is useful to see if, on x86, the legacy libaudit still works, as it
> > > is used in architectures that don't have the SYSCALL_TABLE logic and we
> > > want to have it tested in 'make -C tools/perf/ build-test'.
> > > 
> > > E.g.:
> > > 
> > > Without having audit-libs-devel installed:
> > > 
> > >   $ make NO_SYSCALL_TABLE=1 O=/tmp/build/perf -C tools/perf install-bin
> > >   make: Entering directory '/home/acme/git/perf/tools/perf'
> > >     BUILD:   Doing 'make -j12' parallel build
> > >   <SNIP>
> > >   Auto-detecting system features:
> > >   <SNIP>
> > >   ...                      libaudit: [ OFF ]
> > >   ...                        libbfd: [ on  ]
> > >   ...                        libcap: [ on  ]
> > >   <SNIP>
> > >   Makefile.config:664: No libaudit.h found, disables 'trace' tool, please install audit-libs-devel or libaudit-dev
> > >   <SNIP>
> > > 
> > > After installing it:
> > > 
> > >   $ rm -rf /tmp/build/perf ; mkdir -p /tmp/build/perf
> > >   $ time make NO_SYSCALL_TABLE=1 O=/tmp/build/perf  -C tools/perf install-bin ; perf test python
> > 
> > heya,
> > seems ok, perhaps also put it in comment to Makefile.perf
> > among other NO_* stuff and to tests/make
> 
> 
> Added this and your Acked-by (from the "seems ok") :-) Ok?

yep ;-)

jirka

> 
> - Arnaldo
> 
> diff --git a/tools/perf/Makefile.perf b/tools/perf/Makefile.perf
> index 30e41dcd4095..e3a34af38130 100644
> --- a/tools/perf/Makefile.perf
> +++ b/tools/perf/Makefile.perf
> @@ -118,6 +118,9 @@ include ../scripts/utilities.mak
>  #
>  # Define LIBBPF_DYNAMIC to enable libbpf dynamic linking.
>  #
> +# Define NO_SYSCALL_TABLE=1 to disable the use of syscall id to/from name tables
> +# generated from the kernel .tbl or unistd.h files and use, if available, libaudit
> +# for doing the conversions to/from strings/id.
>  
>  # As per kernel Makefile, avoid funny character set dependencies
>  unexport LC_ALL
> 

^ permalink raw reply

* Re: [PATCH 3/3] hwrng: ba431-rng: add support for BA431 hwrng
From: Olivier Sobrie @ 2020-05-29 20:33 UTC (permalink / raw)
  To: Rob Herring
  Cc: Arnd Bergmann, Matt Mackall, Herbert Xu, Greg Kroah-Hartman,
	open list:HARDWARE RANDOM NUMBER GENERATOR CORE, DTML,
	linux-kernel@vger.kernel.org, Waleed Ziad, sebastien.rabou
In-Reply-To: <20200529171231.GA2581035@bogus>

On Fri, May 29, 2020 at 11:12:31AM -0600, Rob Herring wrote:
> On Mon, May 25, 2020 at 10:28:46PM +0200, Arnd Bergmann wrote:
> > On Mon, May 25, 2020 at 10:07 PM Olivier Sobrie
> > <olivier.sobrie@silexinsight.com> wrote:
> > >
> > > Silex insight BA431 is an IP designed to generate random numbers that
> > > can be integrated in various FPGA.
> > > This driver adds support for it through the hwrng interface.
> > >
> > > This driver is used in Silex Insight Viper OEM boards.
> > >
> > > Signed-off-by: Olivier Sobrie <olivier.sobrie@silexinsight.com>
> > > Signed-off-by: Waleed Ziad <waleed94ziad@gmail.com>
> > 
> > The driver looks good to me.
> > 
> > Acked-by: Arnd Bergmann  <arnd@arndb.de>
> > 
> > >  drivers/char/hw_random/Kconfig     |  10 ++
> > >  drivers/char/hw_random/Makefile    |   1 +
> > >  drivers/char/hw_random/ba431-rng.c | 240 +++++++++++++++++++++++++++++
> > 
> > I wonder if we should move drivers/char/hw_random to its own top-level drivers
> > subsystem outside of drivers/char. It seems to be growing steadily and is larger
> > than a lot of other subsystems with currently 34 drivers in there.
> > 
> > Not your problem though.
> > 
> > > +       /* Wait until the state changed */
> > > +       for (i = 0; i < BA431_RESET_READ_STATUS_RETRIES; ++i) {
> > > +               state = ba431_trng_get_state(ba431);
> > > +               if (state >= BA431_STATE_STARTUP)
> > > +                       break;
> > > +
> > > +               udelay(BA431_RESET_READ_STATUS_INTERVAL);
> > > +       }
> > 
> > Looking for something to improve, I noticed that this loop can take over
> > a millisecond to time out, and it always runs in non-atomic context.
> > It may be better to use usleep_range() than udelay().
> 
> Or better yet, use the register polling helpers.

Indeed, thanks for the suggestion.
I'll replace this loop by the readx_poll_timeout() macro.

Olivier

^ permalink raw reply

* [linux-next:master 6635/14131] include/trace/events/qrtr.h:11:1: sparse: sparse: cast to restricted __le32
From: kbuild test robot @ 2020-05-29 20:33 UTC (permalink / raw)
  To: kbuild-all

[-- Attachment #1: Type: text/plain, Size: 11238 bytes --]

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master
head:   e7b08814b16b80a0bf76eeca16317f8c2ed23b8c
commit: e42671084361302141a09284fde9bbc14fdd16bf [6635/14131] net: qrtr: Do not depend on ARCH_QCOM
config: sh-randconfig-s031-20200529 (attached as .config)
compiler: sh4-linux-gcc (GCC) 9.3.0
reproduce:
        # apt-get install sparse
        # sparse version: v0.6.1-243-gc100a7ab-dirty
        git checkout e42671084361302141a09284fde9bbc14fdd16bf
        # save the attached .config to linux build tree
        make W=1 C=1 ARCH=sh CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__'

If you fix the issue, kindly add following tag as appropriate
Reported-by: kbuild test robot <lkp@intel.com>


sparse warnings: (new ones prefixed by >>)

>> include/trace/events/qrtr.h:11:1: sparse: sparse: cast to restricted __le32
>> include/trace/events/qrtr.h:11:1: sparse: sparse: cast to restricted __le32
   include/trace/events/qrtr.h:11:1: sparse: sparse: restricted __le32 degrades to integer
   include/trace/events/qrtr.h:11:1: sparse: sparse: restricted __le32 degrades to integer
>> include/trace/events/qrtr.h:11:1: sparse: sparse: cast to restricted __le32
>> include/trace/events/qrtr.h:11:1: sparse: sparse: cast to restricted __le32
   include/trace/events/qrtr.h:11:1: sparse: sparse: restricted __le32 degrades to integer
   include/trace/events/qrtr.h:11:1: sparse: sparse: restricted __le32 degrades to integer
>> include/trace/events/qrtr.h:11:1: sparse: sparse: cast to restricted __le32
>> include/trace/events/qrtr.h:11:1: sparse: sparse: cast to restricted __le32
   include/trace/events/qrtr.h:11:1: sparse: sparse: restricted __le32 degrades to integer
   include/trace/events/qrtr.h:11:1: sparse: sparse: restricted __le32 degrades to integer
>> include/trace/events/qrtr.h:11:1: sparse: sparse: cast to restricted __le32
>> include/trace/events/qrtr.h:11:1: sparse: sparse: cast to restricted __le32
   include/trace/events/qrtr.h:11:1: sparse: sparse: restricted __le32 degrades to integer
   include/trace/events/qrtr.h:11:1: sparse: sparse: restricted __le32 degrades to integer
   include/trace/events/qrtr.h:37:1: sparse: sparse: cast to restricted __le32
   include/trace/events/qrtr.h:37:1: sparse: sparse: cast to restricted __le32
   include/trace/events/qrtr.h:37:1: sparse: sparse: restricted __le32 degrades to integer
   include/trace/events/qrtr.h:37:1: sparse: sparse: restricted __le32 degrades to integer
   include/trace/events/qrtr.h:37:1: sparse: sparse: cast to restricted __le32
   include/trace/events/qrtr.h:37:1: sparse: sparse: cast to restricted __le32
   include/trace/events/qrtr.h:37:1: sparse: sparse: restricted __le32 degrades to integer
   include/trace/events/qrtr.h:37:1: sparse: sparse: restricted __le32 degrades to integer
   include/trace/events/qrtr.h:37:1: sparse: sparse: cast to restricted __le32
   include/trace/events/qrtr.h:37:1: sparse: sparse: cast to restricted __le32
   include/trace/events/qrtr.h:37:1: sparse: sparse: restricted __le32 degrades to integer
   include/trace/events/qrtr.h:37:1: sparse: sparse: restricted __le32 degrades to integer
   include/trace/events/qrtr.h:37:1: sparse: sparse: cast to restricted __le32
   include/trace/events/qrtr.h:37:1: sparse: sparse: cast to restricted __le32
   include/trace/events/qrtr.h:37:1: sparse: sparse: restricted __le32 degrades to integer
   include/trace/events/qrtr.h:37:1: sparse: sparse: restricted __le32 degrades to integer
   include/trace/events/qrtr.h:63:1: sparse: sparse: cast to restricted __le32
   include/trace/events/qrtr.h:63:1: sparse: sparse: cast to restricted __le32
   include/trace/events/qrtr.h:63:1: sparse: sparse: restricted __le32 degrades to integer
   include/trace/events/qrtr.h:63:1: sparse: sparse: restricted __le32 degrades to integer
   include/trace/events/qrtr.h:63:1: sparse: sparse: cast to restricted __le32
   include/trace/events/qrtr.h:63:1: sparse: sparse: cast to restricted __le32
   include/trace/events/qrtr.h:63:1: sparse: sparse: restricted __le32 degrades to integer
   include/trace/events/qrtr.h:63:1: sparse: sparse: restricted __le32 degrades to integer
   include/trace/events/qrtr.h:63:1: sparse: sparse: cast to restricted __le32
   include/trace/events/qrtr.h:63:1: sparse: sparse: cast to restricted __le32
   include/trace/events/qrtr.h:63:1: sparse: sparse: restricted __le32 degrades to integer
   include/trace/events/qrtr.h:63:1: sparse: sparse: restricted __le32 degrades to integer
   include/trace/events/qrtr.h:63:1: sparse: sparse: cast to restricted __le32
   include/trace/events/qrtr.h:63:1: sparse: sparse: cast to restricted __le32
   include/trace/events/qrtr.h:63:1: sparse: sparse: restricted __le32 degrades to integer
   include/trace/events/qrtr.h:63:1: sparse: sparse: restricted __le32 degrades to integer
   net/qrtr/ns.c:111:47: sparse: sparse: incorrect type in argument 1 (different base types) @@     expected restricted __le32 [usertype] service @@     got unsigned int service @@
   net/qrtr/ns.c:111:47: sparse:     expected restricted __le32 [usertype] service
   net/qrtr/ns.c:111:47: sparse:     got unsigned int service
   net/qrtr/ns.c:111:61: sparse: sparse: incorrect type in argument 2 (different base types) @@     expected restricted __le32 [usertype] instance @@     got unsigned int instance @@
   net/qrtr/ns.c:111:61: sparse:     expected restricted __le32 [usertype] instance
   net/qrtr/ns.c:111:61: sparse:     got unsigned int instance
   net/qrtr/ns.c:112:47: sparse: sparse: incorrect type in argument 3 (different base types) @@     expected restricted __le32 [usertype] node @@     got unsigned int node @@
   net/qrtr/ns.c:112:47: sparse:     expected restricted __le32 [usertype] node
   net/qrtr/ns.c:112:47: sparse:     got unsigned int node
   net/qrtr/ns.c:112:58: sparse: sparse: incorrect type in argument 4 (different base types) @@     expected restricted __le32 [usertype] port @@     got unsigned int port @@
   net/qrtr/ns.c:112:58: sparse:     expected restricted __le32 [usertype] port
   net/qrtr/ns.c:112:58: sparse:     got unsigned int port
   net/qrtr/ns.c:138:47: sparse: sparse: incorrect type in argument 1 (different base types) @@     expected restricted __le32 [usertype] service @@     got unsigned int service @@
   net/qrtr/ns.c:138:47: sparse:     expected restricted __le32 [usertype] service
   net/qrtr/ns.c:138:47: sparse:     got unsigned int service
   net/qrtr/ns.c:138:61: sparse: sparse: incorrect type in argument 2 (different base types) @@     expected restricted __le32 [usertype] instance @@     got unsigned int instance @@
   net/qrtr/ns.c:138:61: sparse:     expected restricted __le32 [usertype] instance
   net/qrtr/ns.c:138:61: sparse:     got unsigned int instance
   net/qrtr/ns.c:139:47: sparse: sparse: incorrect type in argument 3 (different base types) @@     expected restricted __le32 [usertype] node @@     got unsigned int node @@
   net/qrtr/ns.c:139:47: sparse:     expected restricted __le32 [usertype] node
   net/qrtr/ns.c:139:47: sparse:     got unsigned int node
   net/qrtr/ns.c:139:58: sparse: sparse: incorrect type in argument 4 (different base types) @@     expected restricted __le32 [usertype] port @@     got unsigned int port @@
   net/qrtr/ns.c:139:58: sparse:     expected restricted __le32 [usertype] port
   net/qrtr/ns.c:139:58: sparse:     got unsigned int port
   net/qrtr/ns.c:250:37: sparse: sparse: incorrect type in argument 1 (different base types) @@     expected restricted __le32 [usertype] service @@     got unsigned int service @@
   net/qrtr/ns.c:250:37: sparse:     expected restricted __le32 [usertype] service
   net/qrtr/ns.c:250:37: sparse:     got unsigned int service
   net/qrtr/ns.c:250:51: sparse: sparse: incorrect type in argument 2 (different base types) @@     expected restricted __le32 [usertype] instance @@     got unsigned int instance @@
   net/qrtr/ns.c:250:51: sparse:     expected restricted __le32 [usertype] instance
   net/qrtr/ns.c:250:51: sparse:     got unsigned int instance
   net/qrtr/ns.c:251:37: sparse: sparse: incorrect type in argument 3 (different base types) @@     expected restricted __le32 [usertype] node @@     got unsigned int node @@
   net/qrtr/ns.c:251:37: sparse:     expected restricted __le32 [usertype] node
   net/qrtr/ns.c:251:37: sparse:     got unsigned int node
   net/qrtr/ns.c:251:48: sparse: sparse: incorrect type in argument 4 (different base types) @@     expected restricted __le32 [usertype] port @@     got unsigned int port @@
   net/qrtr/ns.c:251:48: sparse:     expected restricted __le32 [usertype] port
   net/qrtr/ns.c:251:48: sparse:     got unsigned int port

vim +11 include/trace/events/qrtr.h

dfddb54043f0a3 Manivannan Sadhasivam 2020-04-21  10  
dfddb54043f0a3 Manivannan Sadhasivam 2020-04-21 @11  TRACE_EVENT(qrtr_ns_service_announce_new,
dfddb54043f0a3 Manivannan Sadhasivam 2020-04-21  12  
dfddb54043f0a3 Manivannan Sadhasivam 2020-04-21  13  	TP_PROTO(__le32 service, __le32 instance, __le32 node, __le32 port),
dfddb54043f0a3 Manivannan Sadhasivam 2020-04-21  14  
dfddb54043f0a3 Manivannan Sadhasivam 2020-04-21  15  	TP_ARGS(service, instance, node, port),
dfddb54043f0a3 Manivannan Sadhasivam 2020-04-21  16  
dfddb54043f0a3 Manivannan Sadhasivam 2020-04-21  17  	TP_STRUCT__entry(
dfddb54043f0a3 Manivannan Sadhasivam 2020-04-21  18  		__field(__le32, service)
dfddb54043f0a3 Manivannan Sadhasivam 2020-04-21  19  		__field(__le32, instance)
dfddb54043f0a3 Manivannan Sadhasivam 2020-04-21  20  		__field(__le32, node)
dfddb54043f0a3 Manivannan Sadhasivam 2020-04-21  21  		__field(__le32, port)
dfddb54043f0a3 Manivannan Sadhasivam 2020-04-21  22  	),
dfddb54043f0a3 Manivannan Sadhasivam 2020-04-21  23  
dfddb54043f0a3 Manivannan Sadhasivam 2020-04-21  24  	TP_fast_assign(
dfddb54043f0a3 Manivannan Sadhasivam 2020-04-21  25  		__entry->service = service;
dfddb54043f0a3 Manivannan Sadhasivam 2020-04-21  26  		__entry->instance = instance;
dfddb54043f0a3 Manivannan Sadhasivam 2020-04-21  27  		__entry->node = node;
dfddb54043f0a3 Manivannan Sadhasivam 2020-04-21  28  		__entry->port = port;
dfddb54043f0a3 Manivannan Sadhasivam 2020-04-21  29  	),
dfddb54043f0a3 Manivannan Sadhasivam 2020-04-21  30  
dfddb54043f0a3 Manivannan Sadhasivam 2020-04-21  31  	TP_printk("advertising new server [%d:%x]@[%d:%d]",
dfddb54043f0a3 Manivannan Sadhasivam 2020-04-21  32  		  __entry->service, __entry->instance, __entry->node,
dfddb54043f0a3 Manivannan Sadhasivam 2020-04-21  33  		  __entry->port
dfddb54043f0a3 Manivannan Sadhasivam 2020-04-21  34  	)
dfddb54043f0a3 Manivannan Sadhasivam 2020-04-21  35  );
dfddb54043f0a3 Manivannan Sadhasivam 2020-04-21  36  

:::::: The code at line 11 was first introduced by commit
:::::: dfddb54043f0a377f642bd0e6a28aa40769e2e65 net: qrtr: Add tracepoint support

:::::: TO: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
:::::: CC: David S. Miller <davem@davemloft.net>

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org

[-- Attachment #2: config.gz --]
[-- Type: application/gzip, Size: 22904 bytes --]

^ permalink raw reply

* Re: [PATCH] HID: usbhid: do not sleep when opening device
From: Dmitry Torokhov @ 2020-05-29 20:33 UTC (permalink / raw)
  To: Guenter Roeck
  Cc: Jiri Kosina, Benjamin Tissoires, groeck, Nicolas Boichat,
	linux-usb, linux-input, linux-kernel
In-Reply-To: <20200529201424.GA180211@roeck-us.net>

On Fri, May 29, 2020 at 01:14:24PM -0700, Guenter Roeck wrote:
> On Fri, May 29, 2020 at 12:59:51PM -0700, Dmitry Torokhov wrote:
> > usbhid tries to give the device 50 milliseconds to drain its queues
> > when opening the device, but does it naively by simply sleeping in open
> > handler, which slows down device probing (and thus may affect overall
> > boot time).
> > 
> > However we do not need to sleep as we can instead mark a point of time
> > in the future when we should start processing the events.
> > 
> > Reported-by: Nicolas Boichat <drinkcat@chromium.org>
> > Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
> > ---
> >  drivers/hid/usbhid/hid-core.c | 27 +++++++++++++++------------
> >  drivers/hid/usbhid/usbhid.h   |  1 +
> >  2 files changed, 16 insertions(+), 12 deletions(-)
> > 
> > diff --git a/drivers/hid/usbhid/hid-core.c b/drivers/hid/usbhid/hid-core.c
> > index c7bc9db5b192..e69992e945b2 100644
> > --- a/drivers/hid/usbhid/hid-core.c
> > +++ b/drivers/hid/usbhid/hid-core.c
> > @@ -95,6 +95,19 @@ static int hid_start_in(struct hid_device *hid)
> >  				set_bit(HID_NO_BANDWIDTH, &usbhid->iofl);
> >  		} else {
> >  			clear_bit(HID_NO_BANDWIDTH, &usbhid->iofl);
> > +
> > +			if (test_and_clear_bit(HID_RESUME_RUNNING,
> > +					       &usbhid->iofl)) {
> > +				/*
> > +				 * In case events are generated while nobody was
> > +				 * listening, some are released when the device
> > +				 * is re-opened. Wait 50 msec for the queue to
> > +				 * empty before allowing events to go through
> > +				 * hid.
> > +				 */
> > +				usbhid->input_start_time = jiffies +
> > +							   msecs_to_jiffies(50);
> > +			}
> >  		}
> >  	}
> >  	spin_unlock_irqrestore(&usbhid->lock, flags);
> > @@ -280,7 +293,8 @@ static void hid_irq_in(struct urb *urb)
> >  		if (!test_bit(HID_OPENED, &usbhid->iofl))
> >  			break;
> >  		usbhid_mark_busy(usbhid);
> > -		if (!test_bit(HID_RESUME_RUNNING, &usbhid->iofl)) {
> > +		if (!test_bit(HID_RESUME_RUNNING, &usbhid->iofl) &&
> > +		    time_after(jiffies, usbhid->input_start_time)) {
> >  			hid_input_report(urb->context, HID_INPUT_REPORT,
> >  					 urb->transfer_buffer,
> >  					 urb->actual_length, 1);
> > @@ -714,17 +728,6 @@ static int usbhid_open(struct hid_device *hid)
> >  	}
> >  
> >  	usb_autopm_put_interface(usbhid->intf);
> > -
> > -	/*
> > -	 * In case events are generated while nobody was listening,
> > -	 * some are released when the device is re-opened.
> > -	 * Wait 50 msec for the queue to empty before allowing events
> > -	 * to go through hid.
> > -	 */
> > -	if (res == 0)
> > -		msleep(50);
> > -
> Can you just set usbhid->input_start_time here ?
> 	if (res == 0)
> 		usbhid->input_start_time = jiffies + msecs_to_jiffies(50);
> 	clear_bit(HID_RESUME_RUNNING, &usbhid->iofl);
> 
> Then you might not need the added code in hid_start_in().

That was my first version, but if hid_start_in() fails we start a timer
and try to retry the IO (and the "res" in 0 in this case). And we want
to mark the time only after we successfully submitted the interrupt URB,
that is why the code is in hid_start_in().

Thanks.

-- 
Dmitry

^ permalink raw reply

* Re: [net-next 09/11] net/mlx5e: kTLS, Add kTLS RX stats
From: Saeed Mahameed @ 2020-05-29 20:33 UTC (permalink / raw)
  To: kuba@kernel.org; +Cc: davem@davemloft.net, netdev@vger.kernel.org, Tariq Toukan
In-Reply-To: <20200529130912.4da4f596@kicinski-fedora-PC1C0HJN.hsd1.ca.comcast.net>

On Fri, 2020-05-29 at 13:09 -0700, Jakub Kicinski wrote:
> On Fri, 29 May 2020 12:46:39 -0700 Saeed Mahameed wrote:
> > diff --git a/Documentation/networking/tls-offload.rst
> > b/Documentation/networking/tls-offload.rst
> > index f914e81fd3a64..44c4b19647746 100644
> > --- a/Documentation/networking/tls-offload.rst
> > +++ b/Documentation/networking/tls-offload.rst
> > @@ -428,6 +428,14 @@ by the driver:
> >     which were part of a TLS stream.
> >   * ``rx_tls_decrypted_bytes`` - number of TLS payload bytes in RX
> > packets
> >     which were successfully decrypted.
> > + * ``rx_tls_ctx`` - number of TLS RX HW offload contexts added to
> > device for
> > +   decryption.
> > + * ``rx_tls_ooo`` - number of RX packets which were part of a TLS
> > stream
> > +   but did not arrive in the expected order and triggered the
> > resync procedure.
> > + * ``rx_tls_del`` - number of TLS RX HW offload contexts deleted
> > from device
> > +   (connection has finished).
> > + * ``rx_tls_err`` - number of RX packets which were part of a TLS
> > stream
> > +   but were not decrypted due to unexpected error in the state
> > machine.
> >   * ``tx_tls_encrypted_packets`` - number of TX packets passed to
> > the device
> >     for encryption of their TLS payload.
> >   * ``tx_tls_encrypted_bytes`` - number of TLS payload bytes in TX
> > packets
> 
> Stack already has stats for some of these in /proc/net/tls_stat. 
> Does this really need to be per device?

these are great for debug.. IMHO stats for offloaded flows per device
are nice thing to have ..  

^ permalink raw reply

* [Intel-gfx] [PATCH] compact-test-array
From: Chris Wilson @ 2020-05-29 20:34 UTC (permalink / raw)
  To: intel-gfx; +Cc: Chris Wilson
In-Reply-To: <20200529201534.474853-1-arnd@arndb.de>

Ok, so count was variable, how about something like this. By my back of
the paper calcs this should reduce it from 408 bytes to 272 bytes.

---
 drivers/gpu/drm/selftests/test-drm_mm.c | 42 ++++++++++++-------------
 1 file changed, 20 insertions(+), 22 deletions(-)

diff --git a/drivers/gpu/drm/selftests/test-drm_mm.c b/drivers/gpu/drm/selftests/test-drm_mm.c
index 9aabe82dcd3a..fa643cc54b0b 100644
--- a/drivers/gpu/drm/selftests/test-drm_mm.c
+++ b/drivers/gpu/drm/selftests/test-drm_mm.c
@@ -323,32 +323,30 @@ static bool expect_reserve_fail(struct drm_mm *mm, struct drm_mm_node *node)
 	return false;
 }
 
-static bool check_reserve_boundaries(struct drm_mm *mm,
-				     unsigned int count,
-				     u64 size)
+static bool check_reserve_boundaries(struct drm_mm *mm, int count, u64 size)
 {
 	const struct boundary {
-		u64 start, size;
+		int start, size;
 		const char *name;
 	} boundaries[] = {
 #define B(st, sz) { (st), (sz), "{ " #st ", " #sz "}" }
 		B(0, 0),
-		B(-size, 0),
-		B(size, 0),
-		B(size * count, 0),
-		B(-size, size),
-		B(-size, -size),
-		B(-size, 2*size),
-		B(0, -size),
-		B(size, -size),
-		B(count*size, size),
-		B(count*size, -size),
-		B(count*size, count*size),
-		B(count*size, -count*size),
-		B(count*size, -(count+1)*size),
-		B((count+1)*size, size),
-		B((count+1)*size, -size),
-		B((count+1)*size, -2*size),
+		B(-1, 0),
+		B(1, 0),
+		B(count, 0),
+		B(-1, 1),
+		B(-1, -1),
+		B(-1, 2),
+		B(0, -1),
+		B(1, -1),
+		B(count, 1),
+		B(count, -1),
+		B(count, count),
+		B(count, -count),
+		B(count, -(count + 1)),
+		B(count + 1, 1),
+		B(count + 1, -1),
+		B(count + 1, -2),
 #undef B
 	};
 	struct drm_mm_node tmp = {};
@@ -357,8 +355,8 @@ static bool check_reserve_boundaries(struct drm_mm *mm,
 	for (n = 0; n < ARRAY_SIZE(boundaries); n++) {
 		if (!expect_reserve_fail(mm,
 					 set_node(&tmp,
-						  boundaries[n].start,
-						  boundaries[n].size))) {
+						  boundaries[n].start * size,
+						  boundaries[n].size * size))) {
 			pr_err("boundary[%d:%s] failed, count=%u, size=%lld\n",
 			       n, boundaries[n].name, count, size);
 			return false;
-- 
2.27.0.rc2

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply related

* Re: [RFC v3 0/8] vDPA support in qemu
From: no-reply @ 2020-05-29 20:33 UTC (permalink / raw)
  To: lulu
  Cc: rdunlap, mst, mhabets, qemu-devel, rob.miller, saugatm, lulu,
	armbru, hch, eperezma, jgg, jasowang, shahafs, kevin.tian, parav,
	vmireyno, cunming.liang, gdawar, jiri, xiao.w.wang, stefanha,
	zhihong.wang, maxime.coquelin, aadam, cohuck, hanand,
	lingshan.zhu
In-Reply-To: <20200529140620.28759-1-lulu@redhat.com>

Patchew URL: https://patchew.org/QEMU/20200529140620.28759-1-lulu@redhat.com/



Hi,

This series failed the asan build test. Please find the testing commands and
their output below. If you have Docker installed, you can probably reproduce it
locally.

=== TEST SCRIPT BEGIN ===
#!/bin/bash
export ARCH=x86_64
make docker-image-fedora V=1 NETWORK=1
time make docker-test-debug@fedora TARGET_LIST=x86_64-softmmu J=14 NETWORK=1
=== TEST SCRIPT END ===

  CC      accel/tcg/trace.o
  CC      backends/trace.o

Warning, treated as error:
/tmp/qemu-test/src/docs/../qemu-options.hx:2920:Inline literal start-string without end-string.
  CC      crypto/trace.o
  CC      monitor/trace.o
---
  CC      block/trace.o
  CC      io/trace.o
  CC      nbd/trace.o
make: *** [Makefile:1114: .docs_system_qemu.1_docs_system_qemu-block-drivers.7_docs_system_qemu-cpu-models.7.sentinel.] Error 2
make: *** Deleting file '.docs_system_qemu.1_docs_system_qemu-block-drivers.7_docs_system_qemu-cpu-models.7.sentinel.'
make: *** Waiting for unfinished jobs....

Warning, treated as error:
/tmp/qemu-test/src/docs/../qemu-options.hx:2920:Inline literal start-string without end-string.
make: *** [Makefile:1103: docs/system/index.html] Error 2
Traceback (most recent call last):
  File "./tests/docker/docker.py", line 664, in <module>
    sys.exit(main())
---
    raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['sudo', '-n', 'docker', 'run', '--label', 'com.qemu.instance.uuid=97acfdab68d34ed4abd8fdcbff72793c', '-u', '1001', '--security-opt', 'seccomp=unconfined', '--rm', '-e', 'TARGET_LIST=x86_64-softmmu', '-e', 'EXTRA_CONFIGURE_OPTS=', '-e', 'V=', '-e', 'J=14', '-e', 'DEBUG=', '-e', 'SHOW_ENV=', '-e', 'CCACHE_DIR=/var/tmp/ccache', '-v', '/home/patchew/.cache/qemu-docker-ccache:/var/tmp/ccache:z', '-v', '/var/tmp/patchew-tester-tmp-l3clgv2k/src/docker-src.2020-05-29-16.30.04.2097:/var/tmp/qemu:z,ro', 'qemu:fedora', '/var/tmp/qemu/run', 'test-debug']' returned non-zero exit status 2.
filter=--filter=label=com.qemu.instance.uuid=97acfdab68d34ed4abd8fdcbff72793c
make[1]: *** [docker-run] Error 1
make[1]: Leaving directory `/var/tmp/patchew-tester-tmp-l3clgv2k/src'
make: *** [docker-run-test-debug@fedora] Error 2

real    3m32.660s
user    0m8.310s


The full log is available at
http://patchew.org/logs/20200529140620.28759-1-lulu@redhat.com/testing.asan/?type=message.
---
Email generated automatically by Patchew [https://patchew.org/].
Please send your feedback to patchew-devel@redhat.com

^ permalink raw reply

* [dhowells-fs:afs-operation 20/27] fs/afs/vl_alias.c:318:8-17: ERROR: reference preceded by free on line 316
From: kbuild test robot @ 2020-05-29 20:35 UTC (permalink / raw)
  To: kbuild

[-- Attachment #1: Type: text/plain, Size: 3118 bytes --]

CC: kbuild-all(a)lists.01.org
TO: "David, Howells," <dhowells@redhat.com>

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/dhowells/linux-fs.git afs-operation
head:   028362346b339f27505b0eb27e7c7f68cd0fc8b9
commit: 298b5d29c83596b495250fdcc97d16183f67b895 [20/27] afs: Detect cell aliases 3 - YFS Cells with a canonical cell name op
:::::: branch date: 6 hours ago
:::::: commit date: 6 hours ago
config: nds32-randconfig-c021-20200529 (attached as .config)
compiler: nds32le-linux-gcc (GCC) 9.3.0

If you fix the issue, kindly add following tag as appropriate
Reported-by: kbuild test robot <lkp@intel.com>
Reported-by: Julia Lawall <julia.lawall@lip6.fr>


coccinelle warnings: (new ones prefixed by >>)

>> fs/afs/vl_alias.c:318:8-17: ERROR: reference preceded by free on line 316

# https://git.kernel.org/pub/scm/linux/kernel/git/dhowells/linux-fs.git/commit/?id=298b5d29c83596b495250fdcc97d16183f67b895
git remote add dhowells-fs https://git.kernel.org/pub/scm/linux/kernel/git/dhowells/linux-fs.git
git remote update dhowells-fs
git checkout 298b5d29c83596b495250fdcc97d16183f67b895
vim +318 fs/afs/vl_alias.c

298b5d29c83596b David Howells 2020-04-27  299  
298b5d29c83596b David Howells 2020-04-27  300  static int yfs_check_canonical_cell_name(struct afs_cell *cell, struct key *key)
298b5d29c83596b David Howells 2020-04-27  301  {
298b5d29c83596b David Howells 2020-04-27  302  	struct afs_cell *master;
298b5d29c83596b David Howells 2020-04-27  303  	char *cell_name;
298b5d29c83596b David Howells 2020-04-27  304  
298b5d29c83596b David Howells 2020-04-27  305  	cell_name = afs_vl_get_cell_name(cell, key);
298b5d29c83596b David Howells 2020-04-27  306  	if (IS_ERR(cell_name))
298b5d29c83596b David Howells 2020-04-27  307  		return PTR_ERR(cell_name);
298b5d29c83596b David Howells 2020-04-27  308  
298b5d29c83596b David Howells 2020-04-27  309  	if (strcmp(cell_name, cell->name) == 0) {
298b5d29c83596b David Howells 2020-04-27  310  		kfree(cell_name);
298b5d29c83596b David Howells 2020-04-27  311  		return 0;
298b5d29c83596b David Howells 2020-04-27  312  	}
298b5d29c83596b David Howells 2020-04-27  313  
298b5d29c83596b David Howells 2020-04-27  314  	master = afs_lookup_cell(cell->net, cell_name, strlen(cell_name),
298b5d29c83596b David Howells 2020-04-27  315  				 NULL, false);
298b5d29c83596b David Howells 2020-04-27 @316  	kfree(cell_name);
298b5d29c83596b David Howells 2020-04-27  317  	if (IS_ERR(master)) {
298b5d29c83596b David Howells 2020-04-27 @318  		kfree(cell_name);
298b5d29c83596b David Howells 2020-04-27  319  		return PTR_ERR(master);
298b5d29c83596b David Howells 2020-04-27  320  	}
298b5d29c83596b David Howells 2020-04-27  321  
298b5d29c83596b David Howells 2020-04-27  322  	cell->alias_of = master; /* Transfer our ref */
298b5d29c83596b David Howells 2020-04-27  323  	return 1;
298b5d29c83596b David Howells 2020-04-27  324  }
298b5d29c83596b David Howells 2020-04-27  325  

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org

[-- Attachment #2: config.gz --]
[-- Type: application/gzip, Size: 28360 bytes --]

^ permalink raw reply

* Re: [PATCH v6 09/12] mmap locking API: add mmap_assert_locked() and mmap_assert_write_locked()
From: Daniel Jordan @ 2020-05-29 20:36 UTC (permalink / raw)
  To: Michel Lespinasse
  Cc: Andrew Morton, linux-mm, LKML, Peter Zijlstra, Laurent Dufour,
	Vlastimil Babka, Matthew Wilcox, Liam Howlett, Jerome Glisse,
	Davidlohr Bueso, David Rientjes, Hugh Dickins, Ying Han,
	Jason Gunthorpe, Daniel Jordan, John Hubbard
In-Reply-To: <20200520052908.204642-10-walken@google.com>

On Tue, May 19, 2020 at 10:29:05PM -0700, Michel Lespinasse wrote:
> Add new APIs to assert that mmap_sem is held.
> 
> Using this instead of rwsem_is_locked and lockdep_assert_held[_write]
> makes the assertions more tolerant of future changes to the lock type.
> 
> Signed-off-by: Michel Lespinasse <walken@google.com>

Reviewed-by: Daniel Jordan <daniel.m.jordan@oracle.com>


^ permalink raw reply

* Re: [PATCH v2] selftests/ftrace: Use printf instead of echo in kprobe syntax error tests
From: Seth Forshee @ 2020-05-29 20:37 UTC (permalink / raw)
  To: Steven Rostedt, Ingo Molnar, Shuah Khan; +Cc: linux-kselftest, linux-kernel
In-Reply-To: <20200304222009.34663-1-seth.forshee@canonical.com>

On Wed, Mar 04, 2020 at 04:20:09PM -0600, Seth Forshee wrote:
> Test cases which use echo to write strings containing backslashes
> fail with some shells, as echo's treatment of backslashes in
> strings varies between shell implementations. Use printf instead,
> as it should behave consistently across different shells. This
> requires adjustments to the strings to escape \ and % characters.
> ftrace_errlog_check() must also re-escape these characters after
> processing them to remove ^ characters.
> 
> Signed-off-by: Seth Forshee <seth.forshee@canonical.com>

Ping. Someone just asked me about this patch, and I noticed that it
hasn't been applied or received any feedback.

> ---
> Changes in v2:
>  - Escape backslashes for a couple of additional tests
> 
>  .../testing/selftests/ftrace/test.d/functions |  6 +++---
>  .../test.d/kprobe/kprobe_syntax_errors.tc     | 20 +++++++++----------
>  2 files changed, 13 insertions(+), 13 deletions(-)
> 
> diff --git a/tools/testing/selftests/ftrace/test.d/functions b/tools/testing/selftests/ftrace/test.d/functions
> index 5d4550591ff9..b38c6eb029e8 100644
> --- a/tools/testing/selftests/ftrace/test.d/functions
> +++ b/tools/testing/selftests/ftrace/test.d/functions
> @@ -114,11 +114,11 @@ yield() {
>  }
>  
>  ftrace_errlog_check() { # err-prefix command-with-error-pos-by-^ command-file
> -    pos=$(echo -n "${2%^*}" | wc -c) # error position
> -    command=$(echo "$2" | tr -d ^)
> +    pos=$(printf "${2%^*}" | wc -c) # error position
> +    command=$(printf "$2" | sed -e 's/\^//g' -e 's/%/%%/g' -e 's/\\/\\\\/g')
>      echo "Test command: $command"
>      echo > error_log
> -    (! echo "$command" >> "$3" ) 2> /dev/null
> +    (! printf "$command" >> "$3" ) 2> /dev/null
>      grep "$1: error:" -A 3 error_log
>      N=$(tail -n 1 error_log | wc -c)
>      # "  Command: " and "^\n" => 13
> diff --git a/tools/testing/selftests/ftrace/test.d/kprobe/kprobe_syntax_errors.tc b/tools/testing/selftests/ftrace/test.d/kprobe/kprobe_syntax_errors.tc
> index ef1e9bafb098..039c03d230b9 100644
> --- a/tools/testing/selftests/ftrace/test.d/kprobe/kprobe_syntax_errors.tc
> +++ b/tools/testing/selftests/ftrace/test.d/kprobe/kprobe_syntax_errors.tc
> @@ -37,14 +37,14 @@ fi
>  
>  check_error 'p vfs_read ^$none_var'	# BAD_VAR
>  
> -check_error 'p vfs_read ^%none_reg'	# BAD_REG_NAME
> +check_error 'p vfs_read ^%%none_reg'	# BAD_REG_NAME
>  check_error 'p vfs_read ^@12345678abcde'	# BAD_MEM_ADDR
>  check_error 'p vfs_read ^@+10'		# FILE_ON_KPROBE
>  
>  grep -q "imm-value" README && \
> -check_error 'p vfs_read arg1=\^x'	# BAD_IMM
> +check_error 'p vfs_read arg1=\\^x'	# BAD_IMM
>  grep -q "imm-string" README && \
> -check_error 'p vfs_read arg1=\"abcd^'	# IMMSTR_NO_CLOSE
> +check_error 'p vfs_read arg1=\\"abcd^'	# IMMSTR_NO_CLOSE
>  
>  check_error 'p vfs_read ^+0@0)'		# DEREF_NEED_BRACE
>  check_error 'p vfs_read ^+0ab1(@0)'	# BAD_DEREF_OFFS
> @@ -80,7 +80,7 @@ check_error 'p vfs_read arg1=^'			# NO_ARG_BODY
>  # instruction boundary check is valid on x86 (at this moment)
>  case $(uname -m) in
>    x86_64|i[3456]86)
> -    echo 'p vfs_read' > kprobe_events
> +    printf 'p vfs_read' > kprobe_events
>      if grep -q FTRACE ../kprobes/list ; then
>  	check_error 'p ^vfs_read+3'		# BAD_INSN_BNDRY (only if function-tracer is enabled)
>      fi
> @@ -89,13 +89,13 @@ esac
>  
>  # multiprobe errors
>  if grep -q "Create/append/" README && grep -q "imm-value" README; then
> -echo 'p:kprobes/testevent _do_fork' > kprobe_events
> +printf 'p:kprobes/testevent _do_fork' > kprobe_events
>  check_error '^r:kprobes/testevent do_exit'	# DIFF_PROBE_TYPE
> -echo 'p:kprobes/testevent _do_fork abcd=\1' > kprobe_events
> -check_error 'p:kprobes/testevent _do_fork ^bcd=\1'	# DIFF_ARG_TYPE
> -check_error 'p:kprobes/testevent _do_fork ^abcd=\1:u8'	# DIFF_ARG_TYPE
> -check_error 'p:kprobes/testevent _do_fork ^abcd=\"foo"'	# DIFF_ARG_TYPE
> -check_error '^p:kprobes/testevent _do_fork abcd=\1'	# SAME_PROBE
> +printf 'p:kprobes/testevent _do_fork abcd=\\1' > kprobe_events
> +check_error 'p:kprobes/testevent _do_fork ^bcd=\\1'	# DIFF_ARG_TYPE
> +check_error 'p:kprobes/testevent _do_fork ^abcd=\\1:u8'	# DIFF_ARG_TYPE
> +check_error 'p:kprobes/testevent _do_fork ^abcd=\\"foo"'# DIFF_ARG_TYPE
> +check_error '^p:kprobes/testevent _do_fork abcd=\\1'	# SAME_PROBE
>  fi
>  
>  exit 0
> -- 
> 2.25.0
> 

^ permalink raw reply

* Re: [PATCH v3 1/2] avrcp: Fix always requesting player settings for category 1
From: Luiz Augusto von Dentz @ 2020-05-29 20:29 UTC (permalink / raw)
  To: linux-bluetooth@vger.kernel.org
In-Reply-To: <20200528215300.225894-1-luiz.dentz@gmail.com>

Hi,

On Thu, May 28, 2020 at 2:53 PM Luiz Augusto von Dentz
<luiz.dentz@gmail.com> wrote:
>
> From: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
>
> Player Application settings is not mandatory for category 1 so instead
> of always listing the settings the code now checks if
> AVRCP_FEATURE_PLAYER_SETTINGS is enabled.
> ---
>  profiles/audio/avrcp.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/profiles/audio/avrcp.c b/profiles/audio/avrcp.c
> index 773ccdb60..75811bf98 100644
> --- a/profiles/audio/avrcp.c
> +++ b/profiles/audio/avrcp.c
> @@ -3814,7 +3814,8 @@ static gboolean avrcp_get_capabilities_resp(struct avctp *conn, uint8_t code,
>         if (!session->controller || !session->controller->player)
>                 return FALSE;
>
> -       if (!(events & (1 << AVRCP_EVENT_SETTINGS_CHANGED)))
> +       if ((session->controller->features & AVRCP_FEATURE_PLAYER_SETTINGS) &&
> +                       !(events & (1 << AVRCP_EVENT_SETTINGS_CHANGED)))
>                 avrcp_list_player_attributes(session);
>
>         if (!(events & (1 << AVRCP_EVENT_STATUS_CHANGED)))
> --
> 2.25.3
>

Applied.

-- 
Luiz Augusto von Dentz

^ permalink raw reply


This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.