qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v3 0/5] Fix LoongArch coverity error and cpu name bug
@ 2022-07-15  6:07 Xiaojuan Yang
  2022-07-15  6:07 ` [PATCH v3 1/5] target/loongarch/cpu: Fix cpu_class_by_name function Xiaojuan Yang
                   ` (5 more replies)
  0 siblings, 6 replies; 11+ messages in thread
From: Xiaojuan Yang @ 2022-07-15  6:07 UTC (permalink / raw)
  To: qemu-devel
  Cc: richard.henderson, gaosong, maobibo, mark.cave-ayland, mst,
	imammedo, ani, f4bug, peter.maydell

This series fix some coverity errors and loongarch_cpu_class_by_name function
for LoongArch virt machine.

Only the loongarch_pch_pic patch(number 2/5) need to be reviewed in this v3
verison, and other patches have been reviewed.

Changes for v3:

1. In loongarch_pch_pic file, We should not use 'unsigned long'
   type as argument when we use find_first_bit(), and we use
   ctz64() to replace find_first_bit() to fix this bug.
2. It is not standard to use '1ULL << irq' to generate a irq mask.
   So, we replace it with 'MAKE_64BIT_MASK(irq, 1)'.
3. Rewrite commit comments for op_helper patch(number 5/5).

Changes for v2:

1. Use MAKE_64BIT_MASK(shift, len) to replace 'xxx << shift'.
2. Use ARRAY_SIZE(arrqy) to get the array size.
3. Add the assertion that 'cpu_model' resolve to a class of the 
   appropriate type.


Changes for v1:

1. Fix coverity errors such as out-of-bounds, integer overflow,
   cond_at_most, etc.
2. Fix loongarch_cpu_class_by_name function.


Please help review
Thanks.

Xiaojuan Yang (5):
  target/loongarch/cpu: Fix cpu_class_by_name function
  hw/intc/loongarch_pch_pic: Fix bugs for update_irq function
  target/loongarch/cpu: Fix coverity errors about excp_names
  target/loongarch/tlb_helper: Fix coverity integer overflow error
  target/loongarch/op_helper: Fix coverity cond_at_most error

 hw/intc/loongarch_pch_pic.c   | 18 +++++++++++-------
 target/loongarch/cpu.c        | 15 ++++++++-------
 target/loongarch/op_helper.c  |  2 +-
 target/loongarch/tlb_helper.c |  4 ++--
 4 files changed, 22 insertions(+), 17 deletions(-)

-- 
2.31.1



^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2022-07-19  8:42 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-07-15  6:07 [PATCH v3 0/5] Fix LoongArch coverity error and cpu name bug Xiaojuan Yang
2022-07-15  6:07 ` [PATCH v3 1/5] target/loongarch/cpu: Fix cpu_class_by_name function Xiaojuan Yang
2022-07-19  6:46   ` Richard Henderson
2022-07-19  6:52     ` Richard Henderson
2022-07-19  8:38       ` Igor Mammedov
2022-07-15  6:07 ` [PATCH v3 2/5] hw/intc/loongarch_pch_pic: Fix bugs for update_irq function Xiaojuan Yang
2022-07-19  5:34   ` Richard Henderson
2022-07-15  6:07 ` [PATCH v3 3/5] target/loongarch/cpu: Fix coverity errors about excp_names Xiaojuan Yang
2022-07-15  6:07 ` [PATCH v3 4/5] target/loongarch/tlb_helper: Fix coverity integer overflow error Xiaojuan Yang
2022-07-15  6:07 ` [PATCH v3 5/5] target/loongarch/op_helper: Fix coverity cond_at_most error Xiaojuan Yang
2022-07-19  6:58 ` [PATCH v3 0/5] Fix LoongArch coverity error and cpu name bug Richard Henderson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).