On Fri, 2026-08-28 at 03:12 +0000, Alistair Francis wrote:
> On Sat, 2026-08-08 at 14:22 +0800, Tao Ding wrote:
> > Hi all,
> > 
> > This patch series adds GSDMA and Decomp_gzip to the K230 board.
> > Enable k230 to use k230_unzip to decompress files during the u-boot
> > phase.
> > 
> > This series includes the following features:
> > 
> > *patch1: add K230 gsdma which supports sdma, gdma is temporarily
> > not
> > supported
> > *patch2: add gsdma to K230 board
> > *patch3: add K230 gsdma qtest
> > *patch4: add K230 decomp_gzip which decompress data work with sdma
> > *patch5: add decomp_gzip to K230 board
> > *patch6: add K230 decomp_gzip qtest
> > *patch7: add a noc-stub region in K230 board
> > 
> > Patch-v2 is posted in:
> > https://lore.kernel.org/qemu-devel/[email protected]/
> > 
> > Changes in v3:
> > *patch1: 
> >   Removed temporarily unimplemented GDMA register read and write.
> >   Print with qemu_log_mask for access register errors.
> > *patch4:
> >   Print with qemu_log_mask for handle error ack signal.
> > 
> > Tao Ding (7):
> >   hw/dma: add K230 gsdma
> >   hw/riscv: k230: add gsdma in K230 board
> >   tests/qtest: add test for K230 gsdma
> >   hw/misc: add K230 decomp gzip
> >   hw/riscv: k230: add decomp gzip in K230 board
> >   tests/qtest: add test for K230 decomp gzip
> >   hw/riscv: k230: add a noc stub region in K230 board
> 
> This is causing some coverity issues
> 
> Can you send patches to fix them up?
> 
> *** CID 1685517:         Integer handling issues 
> (OVERFLOW_BEFORE_WIDEN)
> /builds/qemu-project/qemu/hw/misc/k230_decomp_gzip.c: 62            
> in
> k230_decomp_gzip_input_addr()
> 56                s->output.slot * K230_DECOMP_GZIP_BLOCK_SIZE +
> 57                s->output.current_offset;
> 58     }
> 59     
> 60     static hwaddr k230_decomp_gzip_input_addr(K230DecompGzipState
> *s)
> 61     {
> > > >     CID 1685517:         Integer handling issues 
> (OVERFLOW_BEFORE_WIDEN)
> > > >     Potentially overflowing expression "s->input.slot *
> > > > 131072U"
> with type "unsigned int" (32 bits, unsigned) is evaluated using 32-
> bit
> arithmetic, and then used in a context that expects an expression of
> type "hwaddr" (64 bits, unsigned).
> 62         return s->input.slot * K230_DECOMP_GZIP_BLOCK_SIZE +
> 63                K230_DECOMP_GZIP_SRAM_IN_BASE;
> 64     }
> 65     
> 66     static uint32_t
> k230_decomp_gzip_current_input_size(K230DecompGzipState *s)
> 67     {
> 
> 
> 
> *** CID 1685516:         Integer handling issues 
> (OVERFLOW_BEFORE_WIDEN)
> /builds/qemu-project/qemu/tests/qtest/k230-decomp-gzip-test.c: 49    
> in k230_sram_input_addr()
> 43         return K230_SRAM_BASE + off;
> 44     }
> 45     
> 46     static inline hwaddr k230_sram_input_addr(unsigned int slot)
> 47     {
> 48         return k230_sram_addr(K230_DECOMP_GZIP_SRAM_IN_BASE +
> > > >     CID 1685516:         Integer handling issues 
> (OVERFLOW_BEFORE_WIDEN)
> > > >     Potentially overflowing expression "slot * 131072U" with
> > > > type
> "unsigned int" (32 bits, unsigned) is evaluated using 32-bit
> arithmetic, and then used in a context that expects an expression of
> type "hwaddr" (64 bits, unsigned).
> 49                               slot * K230_DECOMP_GZIP_BLOCK_SIZE);
> 50     }
> 51     
> 52     /*
> 53      * test_gzip_data was generated by compressing test_payload in
> gzip format
> 54      * using Dynamic Huffman coding. The compression method byte
> in
> the gzip
> 
> 
> *** CID 1685515:         Integer handling issues 
> (OVERFLOW_BEFORE_WIDEN)
> /builds/qemu-project/qemu/hw/misc/k230_decomp_gzip.c: 56            
> in
> k230_decomp_gzip_output_addr()
> 50                                    MEMTXATTRS_UNSPECIFIED, buf,
> len)
> == MEMTX_OK;
> 51     }
> 52     
> 53     static hwaddr k230_decomp_gzip_output_addr(K230DecompGzipState
> *s)
> 54     {
> 55         return K230_DECOMP_GZIP_SRAM_OUT_BASE +
> > > >     CID 1685515:         Integer handling issues 
> (OVERFLOW_BEFORE_WIDEN)
> > > >     Potentially overflowing expression "s->output.slot *
> > > > 131072U"
> with type "unsigned int" (32 bits, unsigned) is evaluated using 32-
> bit
> arithmetic, and then used in a context that expects an expression of
> type "hwaddr" (64 bits, unsigned).
> 56                s->output.slot * K230_DECOMP_GZIP_BLOCK_SIZE +
> 57                s->output.current_offset;
> 58     }
> 59     
> 60     static hwaddr k230_decomp_gzip_input_addr(K230DecompGzipState
> *s)
> 61     {
> 
> *** CID 1685514:           (INTEGER_OVERFLOW)
> /builds/qemu-project/qemu/hw/dma/k230_gsdma.c: 332             in
> k230_gsdma_read()
> 326                             "%s: not implement gdma at offset
> 0x%"
> HWADDR_PRIx
> 327                             "\n", __func__, addr);
> 328             }
> 329             break;
> 330         }
> 331     
> > > >     CID 1685514:           (INTEGER_OVERFLOW)
> > > >     Expression "ch", where "(addr - 80UL) / 48UL" is known to
> > > > be
> equal to 1431655763, overflows the type of "ch", which is type
> "unsigned int".
> 332         ch = (addr - K230_GSDMA_CH_BASE) / K230_GSDMA_CH_STRIDE;
> 333         ch_off = (addr - K230_GSDMA_CH_BASE) %
> K230_GSDMA_CH_STRIDE;
> 334         if (ch < K230_GSDMA_NUM_SDMA_CHANNELS) {
> 335             switch (ch_off) {
> 336             case K230_GSDMA_CH_CTL:
> 337                 break;
> /builds/qemu-project/qemu/hw/dma/k230_gsdma.c: 332             in
> k230_gsdma_read()
> 326                             "%s: not implement gdma at offset
> 0x%"
> HWADDR_PRIx
> 327                             "\n", __func__, addr);
> 328             }
> 329             break;
> 330         }
> 331     
> > > >     CID 1685514:           (INTEGER_OVERFLOW)
> > > >     Expression "addr - 80UL", where "addr" is known to be equal
> > > > to
> 0, underflows the type of "addr - 80UL", which is type "unsigned
> long".
> 332         ch = (addr - K230_GSDMA_CH_BASE) / K230_GSDMA_CH_STRIDE;
> 333         ch_off = (addr - K230_GSDMA_CH_BASE) %
> K230_GSDMA_CH_STRIDE;
> 334         if (ch < K230_GSDMA_NUM_SDMA_CHANNELS) {
> 335             switch (ch_off) {
> 336             case K230_GSDMA_CH_CTL:
> 337                 break;
> 
> *** CID 1685513:         Control flow issues  (UNREACHABLE)
> /builds/qemu-project/qemu/disas/riscv.c: 2562             in
> decode_inst_opcode()
> 2556                     case 3: return &op_fscsr;
> 2557                     default: return &op_csrrw;
> 2558                     }
> 2559                     break;
> 2560                 case 2:
> 2561                     return &op_csrrs;
> > > >     CID 1685513:         Control flow issues  (UNREACHABLE)
> > > >     This code cannot be reached: "if (operand_rs1(inst) ==
> > > > 0U...".
> 2562                     if (operand_rs1(inst) == 0) {
> 2563                         switch (operand_csr12(inst)) {
> 2564                         case 0x001: return &op_frflags;
> 2565                         case 0x002: return &op_frrm;
> 2566                         case 0x003: return &op_frcsr;
> 2567                         case 0xc00: return &op_rdcycle;

Hey guys,

It seems like no one is willing to maintain these patches as it's been
over a month and no fixes for the coverity issues have been sent.

Considering that the patches have only recently been merged and already
aren't receiving fixes, I'm considering just reverting them at this
point.

Is anyone worth maintaining these or should they be reverted?

Alistair

Reply via email to