qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH v3 04/16] fuzz: Add DMA support to the generic-fuzzer


From: Paolo Bonzini
Subject: Re: [PATCH v3 04/16] fuzz: Add DMA support to the generic-fuzzer
Date: Thu, 8 Oct 2020 09:43:37 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.11.0

On 21/09/20 04:24, Alexander Bulekov wrote:
> +    if (qtest_log_enabled) {
> +        /*
> +         * With QTEST_LOG, use a normal, slow QTest memwrite. Prefix the log
> +         * that will be written by qtest.c with a DMA tag, so we can reorder
> +         * the resulting QTest trace so the DMA fills precede the last 
> PIO/MMIO
> +         * command.
> +         */
> +        fprintf(stderr, "[DMA] ");
> +        fflush(stderr);
> +        qtest_memwrite(qts_global, ar.addr, buf, ar.size);
> +    } else {
> +       /*
> +        * Populate the region using address_space_write_rom to avoid writing 
> to
> +        * any IO MemoryRegions
> +        */
> +        address_space_write_rom(first_cpu->as, ar.addr, 
> MEMTXATTRS_UNSPECIFIED,
> +                buf, ar.size);
> +    }

I wonder if you should just copy address_space_write_rom to your own
code.  This way you can log the write just like qtest_memwrite would,
while skipping memwrites that would access IO regions.

Paolo




reply via email to

[Prev in Thread] Current Thread [Next in Thread]