All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v3 0/2] fuzz: Skip QTest serialization
@ 2020-05-29 22:14 Alexander Bulekov
  2020-05-29 22:14 ` [PATCH v3 1/2] fuzz: skip " Alexander Bulekov
                   ` (3 more replies)
  0 siblings, 4 replies; 8+ messages in thread
From: Alexander Bulekov @ 2020-05-29 22:14 UTC (permalink / raw)
  To: qemu-devel; +Cc: darren.kenny, bsd, f4bug, stefanha, Alexander Bulekov

In the same vein as Philippe's patch:

https://patchew.org/QEMU/20200528165303.1877-1-f4bug@amsat.org/

This uses linker trickery to wrap calls to libqtest functions and
directly call the corresponding read/write functions, rather than
relying on the ASCII-serialized QTest protocol.

v2: applies properly

v3: add missing qtest_wrappers.c file and fix formatting in fuzz.c

Alexander Bulekov (2):
  fuzz: skip QTest serialization
  fuzz: Add support for logging QTest commands

 tests/qtest/fuzz/Makefile.include |  21 +++
 tests/qtest/fuzz/fuzz.c           |  20 ++-
 tests/qtest/fuzz/fuzz.h           |   3 +
 tests/qtest/fuzz/qtest_wrappers.c | 252 ++++++++++++++++++++++++++++++
 4 files changed, 295 insertions(+), 1 deletion(-)
 create mode 100644 tests/qtest/fuzz/qtest_wrappers.c

-- 
2.26.2



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

* [PATCH v3 1/2] fuzz: skip QTest serialization
  2020-05-29 22:14 [PATCH v3 0/2] fuzz: Skip QTest serialization Alexander Bulekov
@ 2020-05-29 22:14 ` Alexander Bulekov
  2020-05-29 22:14 ` [PATCH v3 2/2] fuzz: Add support for logging QTest commands Alexander Bulekov
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 8+ messages in thread
From: Alexander Bulekov @ 2020-05-29 22:14 UTC (permalink / raw)
  To: qemu-devel
  Cc: Laurent Vivier, Thomas Huth, Alexander Bulekov, f4bug,
	darren.kenny, bsd, stefanha, Paolo Bonzini

The QTest server usually parses ASCII commands from clients. Since we
fuzz within the QEMU process, skip the QTest serialization and server
for most QTest commands. Leave the option to use the ASCII protocol, to
generate readable traces for crash reproducers.

Inspired-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Signed-off-by: Alexander Bulekov <alxndr@bu.edu>
---
 tests/qtest/fuzz/Makefile.include |  21 +++
 tests/qtest/fuzz/fuzz.c           |  13 +-
 tests/qtest/fuzz/fuzz.h           |   3 +
 tests/qtest/fuzz/qtest_wrappers.c | 252 ++++++++++++++++++++++++++++++
 4 files changed, 288 insertions(+), 1 deletion(-)
 create mode 100644 tests/qtest/fuzz/qtest_wrappers.c

diff --git a/tests/qtest/fuzz/Makefile.include b/tests/qtest/fuzz/Makefile.include
index f259d866c9..5bde793bf2 100644
--- a/tests/qtest/fuzz/Makefile.include
+++ b/tests/qtest/fuzz/Makefile.include
@@ -5,6 +5,7 @@ fuzz-obj-y += $(libqos-obj-y)
 fuzz-obj-y += tests/qtest/fuzz/fuzz.o # Fuzzer skeleton
 fuzz-obj-y += tests/qtest/fuzz/fork_fuzz.o
 fuzz-obj-y += tests/qtest/fuzz/qos_fuzz.o
+fuzz-obj-y += tests/qtest/fuzz/qtest_wrappers.o
 
 # Targets
 fuzz-obj-$(CONFIG_PCI_I440FX) += tests/qtest/fuzz/i440fx_fuzz.o
@@ -16,3 +17,23 @@ FUZZ_CFLAGS += -I$(SRC_PATH)/tests -I$(SRC_PATH)/tests/qtest
 # Linker Script to force coverage-counters into known regions which we can mark
 # shared
 FUZZ_LDFLAGS += -Xlinker -T$(SRC_PATH)/tests/qtest/fuzz/fork_fuzz.ld
+
+FUZZ_LDFLAGS += -Wl,-wrap,qtest_inb
+FUZZ_LDFLAGS += -Wl,-wrap,qtest_inw
+FUZZ_LDFLAGS += -Wl,-wrap,qtest_inl
+FUZZ_LDFLAGS += -Wl,-wrap,qtest_outb
+FUZZ_LDFLAGS += -Wl,-wrap,qtest_outw
+FUZZ_LDFLAGS += -Wl,-wrap,qtest_outl
+FUZZ_LDFLAGS += -Wl,-wrap,qtest_readb
+FUZZ_LDFLAGS += -Wl,-wrap,qtest_readw
+FUZZ_LDFLAGS += -Wl,-wrap,qtest_readl
+FUZZ_LDFLAGS += -Wl,-wrap,qtest_readq
+FUZZ_LDFLAGS += -Wl,-wrap,qtest_writeb
+FUZZ_LDFLAGS += -Wl,-wrap,qtest_writew
+FUZZ_LDFLAGS += -Wl,-wrap,qtest_writel
+FUZZ_LDFLAGS += -Wl,-wrap,qtest_writeq
+FUZZ_LDFLAGS += -Wl,-wrap,qtest_memread
+FUZZ_LDFLAGS += -Wl,-wrap,qtest_bufread
+FUZZ_LDFLAGS += -Wl,-wrap,qtest_memwrite
+FUZZ_LDFLAGS += -Wl,-wrap,qtest_bufwrite
+FUZZ_LDFLAGS += -Wl,-wrap,qtest_memset
diff --git a/tests/qtest/fuzz/fuzz.c b/tests/qtest/fuzz/fuzz.c
index f5c923852e..88ac88bca9 100644
--- a/tests/qtest/fuzz/fuzz.c
+++ b/tests/qtest/fuzz/fuzz.c
@@ -91,7 +91,10 @@ static void usage(char *path)
         printf(" * %s  : %s\n", tmp->target->name,
                 tmp->target->description);
     }
-    printf("Alternatively, add -target-FUZZ_TARGET to the executable name\n");
+    printf("Alternatively, add -target-FUZZ_TARGET to the executable name\n\n"
+           "Set the environment variable FUZZ_SERIALIZE_QTEST=1 to serialize\n"
+           "QTest commands into an ASCII protocol. Useful for building crash\n"
+           "reproducers, but slows down execution.\n");
     exit(0);
 }
 
@@ -137,6 +140,7 @@ int LLVMFuzzerInitialize(int *argc, char ***argv, char ***envp)
 {
 
     char *target_name;
+    bool serialize = false;
 
     /* Initialize qgraph and modules */
     qos_graph_init();
@@ -157,6 +161,13 @@ int LLVMFuzzerInitialize(int *argc, char ***argv, char ***envp)
         usage(**argv);
     }
 
+    /* Should we always serialize qtest commands? */
+    if (getenv("FUZZ_SERIALIZE_QTEST")) {
+        serialize = true;
+    }
+
+    fuzz_qtest_set_serialize(serialize);
+
     /* Identify the fuzz target */
     fuzz_target = fuzz_get_target(target_name);
     if (!fuzz_target) {
diff --git a/tests/qtest/fuzz/fuzz.h b/tests/qtest/fuzz/fuzz.h
index 03901d414e..72d5710f6c 100644
--- a/tests/qtest/fuzz/fuzz.h
+++ b/tests/qtest/fuzz/fuzz.h
@@ -82,6 +82,9 @@ typedef struct FuzzTarget {
 void flush_events(QTestState *);
 void reboot(QTestState *);
 
+/* Use the QTest ASCII protocol or call address_space API directly?*/
+void fuzz_qtest_set_serialize(bool option);
+
 /*
  * makes a copy of *target and adds it to the target-list.
  * i.e. fine to set up target on the caller's stack
diff --git a/tests/qtest/fuzz/qtest_wrappers.c b/tests/qtest/fuzz/qtest_wrappers.c
new file mode 100644
index 0000000000..713c830cdb
--- /dev/null
+++ b/tests/qtest/fuzz/qtest_wrappers.c
@@ -0,0 +1,252 @@
+/*
+ * qtest function wrappers
+ *
+ * Copyright Red Hat Inc., 2019
+ *
+ * Authors:
+ *  Alexander Bulekov   <alxndr@bu.edu>
+ *
+ * This work is licensed under the terms of the GNU GPL, version 2 or later.
+ * See the COPYING file in the top-level directory.
+ *
+ */
+
+#include "qemu/osdep.h"
+#include "cpu.h"
+#include "exec/ioport.h"
+
+#include "fuzz.h"
+
+static bool serialize = true;
+
+#define WRAP(RET_TYPE, NAME_AND_ARGS)\
+    RET_TYPE __wrap_##NAME_AND_ARGS;\
+    RET_TYPE __real_##NAME_AND_ARGS;
+
+WRAP(uint8_t  , qtest_inb(QTestState *s, uint16_t addr))
+WRAP(uint16_t , qtest_inw(QTestState *s, uint16_t addr))
+WRAP(uint32_t , qtest_inl(QTestState *s, uint16_t addr))
+WRAP(void     , qtest_outb(QTestState *s, uint16_t addr, uint8_t value))
+WRAP(void     , qtest_outw(QTestState *s, uint16_t addr, uint16_t value))
+WRAP(void     , qtest_outl(QTestState *s, uint16_t addr, uint32_t value))
+WRAP(uint8_t  , qtest_readb(QTestState *s, uint64_t addr))
+WRAP(uint16_t , qtest_readw(QTestState *s, uint64_t addr))
+WRAP(uint32_t , qtest_readl(QTestState *s, uint64_t addr))
+WRAP(uint64_t , qtest_readq(QTestState *s, uint64_t addr))
+WRAP(void     , qtest_writeb(QTestState *s, uint64_t addr, uint8_t value))
+WRAP(void     , qtest_writew(QTestState *s, uint64_t addr, uint16_t value))
+WRAP(void     , qtest_writel(QTestState *s, uint64_t addr, uint32_t value))
+WRAP(void     , qtest_writeq(QTestState *s, uint64_t addr, uint64_t value))
+WRAP(void     , qtest_memread(QTestState *s, uint64_t addr,
+                              void *data, size_t size))
+WRAP(void     , qtest_bufread(QTestState *s, uint64_t addr, void *data,
+                              size_t size))
+WRAP(void     , qtest_memwrite(QTestState *s, uint64_t addr, const void *data,
+                               size_t size))
+WRAP(void,      qtest_bufwrite(QTestState *s, uint64_t addr,
+                               const void *data, size_t size))
+WRAP(void,      qtest_memset(QTestState *s, uint64_t addr,
+                             uint8_t patt, size_t size))
+
+
+uint8_t __wrap_qtest_inb(QTestState *s, uint16_t addr)
+{
+    if (!serialize) {
+        return cpu_inb(addr);
+    } else {
+        return __real_qtest_inb(s, addr);
+    }
+}
+
+uint16_t __wrap_qtest_inw(QTestState *s, uint16_t addr)
+{
+    if (!serialize) {
+        return cpu_inw(addr);
+    } else {
+        return __real_qtest_inw(s, addr);
+    }
+}
+
+uint32_t __wrap_qtest_inl(QTestState *s, uint16_t addr)
+{
+    if (!serialize) {
+        return cpu_inl(addr);
+    } else {
+        return __real_qtest_inl(s, addr);
+    }
+}
+
+void __wrap_qtest_outb(QTestState *s, uint16_t addr, uint8_t value)
+{
+    if (!serialize) {
+        cpu_outb(addr, value);
+    } else {
+        __real_qtest_outb(s, addr, value);
+    }
+}
+
+void __wrap_qtest_outw(QTestState *s, uint16_t addr, uint16_t value)
+{
+    if (!serialize) {
+        cpu_outw(addr, value);
+    } else {
+        __real_qtest_outw(s, addr, value);
+    }
+}
+
+void __wrap_qtest_outl(QTestState *s, uint16_t addr, uint32_t value)
+{
+    if (!serialize) {
+        cpu_outl(addr, value);
+    } else {
+        __real_qtest_outl(s, addr, value);
+    }
+}
+
+uint8_t __wrap_qtest_readb(QTestState *s, uint64_t addr)
+{
+    uint8_t value;
+    if (!serialize) {
+        address_space_read(first_cpu->as, addr, MEMTXATTRS_UNSPECIFIED,
+                            &value, 1);
+        return value;
+    } else {
+        return __real_qtest_readb(s, addr);
+    }
+}
+
+uint16_t __wrap_qtest_readw(QTestState *s, uint64_t addr)
+{
+    uint16_t value;
+    if (!serialize) {
+        address_space_read(first_cpu->as, addr, MEMTXATTRS_UNSPECIFIED,
+                            &value, 2);
+        return value;
+    } else {
+        return __real_qtest_readw(s, addr);
+    }
+}
+
+uint32_t __wrap_qtest_readl(QTestState *s, uint64_t addr)
+{
+    uint32_t value;
+    if (!serialize) {
+        address_space_read(first_cpu->as, addr, MEMTXATTRS_UNSPECIFIED,
+                            &value, 4);
+        return value;
+    } else {
+        return __real_qtest_readl(s, addr);
+    }
+}
+
+uint64_t __wrap_qtest_readq(QTestState *s, uint64_t addr)
+{
+    uint64_t value;
+    if (!serialize) {
+        address_space_read(first_cpu->as, addr, MEMTXATTRS_UNSPECIFIED,
+                            &value, 8);
+        return value;
+    } else {
+        return __real_qtest_readq(s, addr);
+    }
+}
+
+void __wrap_qtest_writeb(QTestState *s, uint64_t addr, uint8_t value)
+{
+    if (!serialize) {
+        address_space_write(first_cpu->as, addr, MEMTXATTRS_UNSPECIFIED,
+                            &value, 1);
+    } else {
+        __real_qtest_writeb(s, addr, value);
+    }
+}
+
+void __wrap_qtest_writew(QTestState *s, uint64_t addr, uint16_t value)
+{
+    if (!serialize) {
+        address_space_write(first_cpu->as, addr, MEMTXATTRS_UNSPECIFIED,
+                            &value, 2);
+    } else {
+        __real_qtest_writew(s, addr, value);
+    }
+}
+
+void __wrap_qtest_writel(QTestState *s, uint64_t addr, uint32_t value)
+{
+    if (!serialize) {
+        address_space_write(first_cpu->as, addr, MEMTXATTRS_UNSPECIFIED,
+                            &value, 4);
+    } else {
+        __real_qtest_writel(s, addr, value);
+    }
+}
+
+void __wrap_qtest_writeq(QTestState *s, uint64_t addr, uint64_t value)
+{
+    if (!serialize) {
+        address_space_write(first_cpu->as, addr, MEMTXATTRS_UNSPECIFIED,
+                            &value, 8);
+    } else {
+        __real_qtest_writeq(s, addr, value);
+    }
+}
+
+void __wrap_qtest_memread(QTestState *s, uint64_t addr, void *data, size_t size)
+{
+    if (!serialize) {
+        address_space_read(first_cpu->as, addr, MEMTXATTRS_UNSPECIFIED, data,
+                           size);
+    } else {
+        __real_qtest_memread(s, addr, data, size);
+    }
+}
+
+void __wrap_qtest_bufread(QTestState *s, uint64_t addr, void *data, size_t size)
+{
+    if (!serialize) {
+        address_space_read(first_cpu->as, addr, MEMTXATTRS_UNSPECIFIED, data,
+                           size);
+    } else {
+        __real_qtest_bufread(s, addr, data, size);
+    }
+}
+
+void __wrap_qtest_memwrite(QTestState *s, uint64_t addr, const void *data,
+                           size_t size)
+{
+    if (!serialize) {
+        address_space_write(first_cpu->as, addr, MEMTXATTRS_UNSPECIFIED,
+                            data, size);
+    } else {
+        __real_qtest_memwrite(s, addr, data, size);
+    }
+}
+
+void __wrap_qtest_bufwrite(QTestState *s, uint64_t addr,
+                    const void *data, size_t size)
+{
+    if (!serialize) {
+        address_space_write(first_cpu->as, addr, MEMTXATTRS_UNSPECIFIED,
+                            data, size);
+    } else {
+        __real_qtest_bufwrite(s, addr, data, size);
+    }
+}
+void __wrap_qtest_memset(QTestState *s, uint64_t addr,
+                         uint8_t patt, size_t size)
+{
+    void *data;
+    if (!serialize) {
+        data = malloc(size);
+        memset(data, patt, size);
+        address_space_write(first_cpu->as, addr, MEMTXATTRS_UNSPECIFIED,
+                            data, size);
+    } else {
+        __real_qtest_memset(s, addr, patt, size);
+    }
+}
+
+void fuzz_qtest_set_serialize(bool option)
+{
+    serialize = option;
+}
-- 
2.26.2



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

* [PATCH v3 2/2] fuzz: Add support for logging QTest commands
  2020-05-29 22:14 [PATCH v3 0/2] fuzz: Skip QTest serialization Alexander Bulekov
  2020-05-29 22:14 ` [PATCH v3 1/2] fuzz: skip " Alexander Bulekov
@ 2020-05-29 22:14 ` Alexander Bulekov
  2020-05-30  2:59 ` [PATCH v3 0/2] fuzz: Skip QTest serialization no-reply
  2020-06-02 13:28 ` Darren Kenny
  3 siblings, 0 replies; 8+ messages in thread
From: Alexander Bulekov @ 2020-05-29 22:14 UTC (permalink / raw)
  To: qemu-devel
  Cc: Laurent Vivier, Thomas Huth, Alexander Bulekov, f4bug,
	darren.kenny, bsd, stefanha, Paolo Bonzini

Signed-off-by: Alexander Bulekov <alxndr@bu.edu>
---
 tests/qtest/fuzz/fuzz.c | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/tests/qtest/fuzz/fuzz.c b/tests/qtest/fuzz/fuzz.c
index 88ac88bca9..21cdee53db 100644
--- a/tests/qtest/fuzz/fuzz.c
+++ b/tests/qtest/fuzz/fuzz.c
@@ -94,7 +94,9 @@ static void usage(char *path)
     printf("Alternatively, add -target-FUZZ_TARGET to the executable name\n\n"
            "Set the environment variable FUZZ_SERIALIZE_QTEST=1 to serialize\n"
            "QTest commands into an ASCII protocol. Useful for building crash\n"
-           "reproducers, but slows down execution.\n");
+           "reproducers, but slows down execution.\n\n"
+           "Set the environment variable QTEST_LOG=1 to log all qtest commands"
+           "\n");
     exit(0);
 }
 
@@ -182,6 +184,11 @@ int LLVMFuzzerInitialize(int *argc, char ***argv, char ***envp)
 
     /* Run QEMU's softmmu main with the fuzz-target dependent arguments */
     const char *init_cmdline = fuzz_target->get_init_cmdline(fuzz_target);
+    init_cmdline = g_strdup_printf("%s -qtest /dev/null -qtest-log %s",
+                                   init_cmdline,
+                                   getenv("QTEST_LOG") ? "/dev/fd/2"
+                                                       : "/dev/null");
+
 
     /* Split the runcmd into an argv and argc */
     wordexp_t result;
-- 
2.26.2



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

* Re: [PATCH v3 0/2] fuzz: Skip QTest serialization
  2020-05-29 22:14 [PATCH v3 0/2] fuzz: Skip QTest serialization Alexander Bulekov
  2020-05-29 22:14 ` [PATCH v3 1/2] fuzz: skip " Alexander Bulekov
  2020-05-29 22:14 ` [PATCH v3 2/2] fuzz: Add support for logging QTest commands Alexander Bulekov
@ 2020-05-30  2:59 ` no-reply
  2020-06-02 13:28 ` Darren Kenny
  3 siblings, 0 replies; 8+ messages in thread
From: no-reply @ 2020-05-30  2:59 UTC (permalink / raw)
  To: alxndr; +Cc: darren.kenny, qemu-devel, f4bug, alxndr, bsd, stefanha

Patchew URL: https://patchew.org/QEMU/20200529221450.26673-1-alxndr@bu.edu/



Hi,

This series seems to have some coding style problems. See output below for
more information:

Message-id: 20200529221450.26673-1-alxndr@bu.edu
Subject: [PATCH v3 0/2] fuzz: Skip QTest serialization
Type: series

=== TEST SCRIPT BEGIN ===
#!/bin/bash
git rev-parse base > /dev/null || exit 0
git config --local diff.renamelimit 0
git config --local diff.renames True
git config --local diff.algorithm histogram
./scripts/checkpatch.pl --mailback base..
=== TEST SCRIPT END ===

Updating 3c8cf5a9c21ff8782164d1def7f44bd888713384
Switched to a new branch 'test'
690701b fuzz: Add support for logging QTest commands
c833a8a fuzz: skip QTest serialization

=== OUTPUT BEGIN ===
1/2 Checking commit c833a8a44c55 (fuzz: skip QTest serialization)
WARNING: added, moved or deleted file(s), does MAINTAINERS need updating?
#105: 
new file mode 100644

ERROR: Macros with multiple statements should be enclosed in a do - while loop
#131: FILE: tests/qtest/fuzz/qtest_wrappers.c:22:
+#define WRAP(RET_TYPE, NAME_AND_ARGS)\
+    RET_TYPE __wrap_##NAME_AND_ARGS;\
+    RET_TYPE __real_##NAME_AND_ARGS;

total: 1 errors, 1 warnings, 322 lines checked

Patch 1/2 has style problems, please review.  If any of these errors
are false positives report them to the maintainer, see
CHECKPATCH in MAINTAINERS.

2/2 Checking commit 690701bb2f91 (fuzz: Add support for logging QTest commands)
=== OUTPUT END ===

Test command exited with code: 1


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

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

* Re: [PATCH v3 0/2] fuzz: Skip QTest serialization
  2020-05-29 22:14 [PATCH v3 0/2] fuzz: Skip QTest serialization Alexander Bulekov
                   ` (2 preceding siblings ...)
  2020-05-30  2:59 ` [PATCH v3 0/2] fuzz: Skip QTest serialization no-reply
@ 2020-06-02 13:28 ` Darren Kenny
  2020-06-02 13:40   ` Alexander Bulekov
  3 siblings, 1 reply; 8+ messages in thread
From: Darren Kenny @ 2020-06-02 13:28 UTC (permalink / raw)
  To: Alexander Bulekov, qemu-devel; +Cc: Alexander Bulekov, bsd, f4bug, stefanha


Hi Alex,

In general the series looks good, so:

Reviewed-by: Darren Kenny <darren.kenny@oracle.com>

But not sure how to handle the patchew output though, not sure if it is
really a concern or not, since do/while won't work that context.

Thanks,

Darren.

On Friday, 2020-05-29 at 18:14:48 -04, Alexander Bulekov wrote:
> In the same vein as Philippe's patch:
>
> https://patchew.org/QEMU/20200528165303.1877-1-f4bug@amsat.org/
>
> This uses linker trickery to wrap calls to libqtest functions and
> directly call the corresponding read/write functions, rather than
> relying on the ASCII-serialized QTest protocol.
>
> v2: applies properly
>
> v3: add missing qtest_wrappers.c file and fix formatting in fuzz.c
>
> Alexander Bulekov (2):
>   fuzz: skip QTest serialization
>   fuzz: Add support for logging QTest commands
>
>  tests/qtest/fuzz/Makefile.include |  21 +++
>  tests/qtest/fuzz/fuzz.c           |  20 ++-
>  tests/qtest/fuzz/fuzz.h           |   3 +
>  tests/qtest/fuzz/qtest_wrappers.c | 252 ++++++++++++++++++++++++++++++
>  4 files changed, 295 insertions(+), 1 deletion(-)
>  create mode 100644 tests/qtest/fuzz/qtest_wrappers.c
>
> -- 
> 2.26.2


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

* Re: [PATCH v3 0/2] fuzz: Skip QTest serialization
  2020-06-02 13:28 ` Darren Kenny
@ 2020-06-02 13:40   ` Alexander Bulekov
  2020-06-03 14:46     ` Thomas Huth
  0 siblings, 1 reply; 8+ messages in thread
From: Alexander Bulekov @ 2020-06-02 13:40 UTC (permalink / raw)
  To: Darren Kenny; +Cc: bsd, qemu-devel, stefanha, f4bug

Thank you Darren.

On 200602 1428, Darren Kenny wrote:
> 
> Hi Alex,
> 
> In general the series looks good, so:
> 
> Reviewed-by: Darren Kenny <darren.kenny@oracle.com>
> 
> But not sure how to handle the patchew output though, not sure if it is
> really a concern or not, since do/while won't work that context.
> 

Yes - I was not really sure how to deal with those failures, so I sent
the patch anyway. Maybe someone else knows a workaround.
-Alex

> Thanks,
> 
> Darren.
> 
> On Friday, 2020-05-29 at 18:14:48 -04, Alexander Bulekov wrote:
> > In the same vein as Philippe's patch:
> >
> > https://patchew.org/QEMU/20200528165303.1877-1-f4bug@amsat.org/
> >
> > This uses linker trickery to wrap calls to libqtest functions and
> > directly call the corresponding read/write functions, rather than
> > relying on the ASCII-serialized QTest protocol.
> >
> > v2: applies properly
> >
> > v3: add missing qtest_wrappers.c file and fix formatting in fuzz.c
> >
> > Alexander Bulekov (2):
> >   fuzz: skip QTest serialization
> >   fuzz: Add support for logging QTest commands
> >
> >  tests/qtest/fuzz/Makefile.include |  21 +++
> >  tests/qtest/fuzz/fuzz.c           |  20 ++-
> >  tests/qtest/fuzz/fuzz.h           |   3 +
> >  tests/qtest/fuzz/qtest_wrappers.c | 252 ++++++++++++++++++++++++++++++
> >  4 files changed, 295 insertions(+), 1 deletion(-)
> >  create mode 100644 tests/qtest/fuzz/qtest_wrappers.c
> >
> > -- 
> > 2.26.2


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

* Re: [PATCH v3 0/2] fuzz: Skip QTest serialization
  2020-06-02 13:40   ` Alexander Bulekov
@ 2020-06-03 14:46     ` Thomas Huth
  2020-06-03 15:22       ` Alexander Bulekov
  0 siblings, 1 reply; 8+ messages in thread
From: Thomas Huth @ 2020-06-03 14:46 UTC (permalink / raw)
  To: Alexander Bulekov, qemu-devel; +Cc: Darren Kenny, bsd, f4bug, stefanha

On 02/06/2020 15.40, Alexander Bulekov wrote:
> Thank you Darren.
> 
> On 200602 1428, Darren Kenny wrote:
>>
>> Hi Alex,
>>
>> In general the series looks good, so:
>>
>> Reviewed-by: Darren Kenny <darren.kenny@oracle.com>
>>
>> But not sure how to handle the patchew output though, not sure if it is
>> really a concern or not, since do/while won't work that context.
>>
> 
> Yes - I was not really sure how to deal with those failures, so I sent
> the patch anyway. Maybe someone else knows a workaround.
> -Alex

Don't worry, the checkpatch script is known to generate false
warnings/errors in some cases. If you've got such a case, simply state
it as a reply to the mail from patchew, and then the message from
patchew can be simply ignored.

By the way, I'm finally back to the state where I can pick up qtest
patches again (btw2, thanks for Stefan for picking up all the fuzzer
patches in the past months). So question: With your two patches here,
the patch from Philippe is not required anymore, right?

 Thanks,
  Thomas


>> On Friday, 2020-05-29 at 18:14:48 -04, Alexander Bulekov wrote:
>>> In the same vein as Philippe's patch:
>>>
>>> https://patchew.org/QEMU/20200528165303.1877-1-f4bug@amsat.org/
>>>
>>> This uses linker trickery to wrap calls to libqtest functions and
>>> directly call the corresponding read/write functions, rather than
>>> relying on the ASCII-serialized QTest protocol.
>>>
>>> v2: applies properly
>>>
>>> v3: add missing qtest_wrappers.c file and fix formatting in fuzz.c
>>>
>>> Alexander Bulekov (2):
>>>   fuzz: skip QTest serialization
>>>   fuzz: Add support for logging QTest commands
>>>
>>>  tests/qtest/fuzz/Makefile.include |  21 +++
>>>  tests/qtest/fuzz/fuzz.c           |  20 ++-
>>>  tests/qtest/fuzz/fuzz.h           |   3 +
>>>  tests/qtest/fuzz/qtest_wrappers.c | 252 ++++++++++++++++++++++++++++++
>>>  4 files changed, 295 insertions(+), 1 deletion(-)
>>>  create mode 100644 tests/qtest/fuzz/qtest_wrappers.c
>>>
>>> -- 
>>> 2.26.2
> 



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

* Re: [PATCH v3 0/2] fuzz: Skip QTest serialization
  2020-06-03 14:46     ` Thomas Huth
@ 2020-06-03 15:22       ` Alexander Bulekov
  0 siblings, 0 replies; 8+ messages in thread
From: Alexander Bulekov @ 2020-06-03 15:22 UTC (permalink / raw)
  To: Thomas Huth; +Cc: Darren Kenny, bsd, qemu-devel, stefanha, f4bug

On 200603 1646, Thomas Huth wrote:
> On 02/06/2020 15.40, Alexander Bulekov wrote:
> > Thank you Darren.
> > 
> > On 200602 1428, Darren Kenny wrote:
> >>
> >> Hi Alex,
> >>
> >> In general the series looks good, so:
> >>
> >> Reviewed-by: Darren Kenny <darren.kenny@oracle.com>
> >>
> >> But not sure how to handle the patchew output though, not sure if it is
> >> really a concern or not, since do/while won't work that context.
> >>
> > 
> > Yes - I was not really sure how to deal with those failures, so I sent
> > the patch anyway. Maybe someone else knows a workaround.
> > -Alex
> 
> Don't worry, the checkpatch script is known to generate false
> warnings/errors in some cases. If you've got such a case, simply state
> it as a reply to the mail from patchew, and then the message from
> patchew can be simply ignored.
> 
> By the way, I'm finally back to the state where I can pick up qtest
> patches again (btw2, thanks for Stefan for picking up all the fuzzer
> patches in the past months). So question: With your two patches here,
> the patch from Philippe is not required anymore, right?

Hi Thomas,
Yes - I think this series enables the same improvements as Philippe's
patch.
Thank you
-Alex

>  Thanks,
>   Thomas 

> 
> >> On Friday, 2020-05-29 at 18:14:48 -04, Alexander Bulekov wrote:
> >>> In the same vein as Philippe's patch:
> >>>
> >>> https://patchew.org/QEMU/20200528165303.1877-1-f4bug@amsat.org/
> >>>
> >>> This uses linker trickery to wrap calls to libqtest functions and
> >>> directly call the corresponding read/write functions, rather than
> >>> relying on the ASCII-serialized QTest protocol.
> >>>
> >>> v2: applies properly
> >>>
> >>> v3: add missing qtest_wrappers.c file and fix formatting in fuzz.c
> >>>
> >>> Alexander Bulekov (2):
> >>>   fuzz: skip QTest serialization
> >>>   fuzz: Add support for logging QTest commands
> >>>
> >>>  tests/qtest/fuzz/Makefile.include |  21 +++
> >>>  tests/qtest/fuzz/fuzz.c           |  20 ++-
> >>>  tests/qtest/fuzz/fuzz.h           |   3 +
> >>>  tests/qtest/fuzz/qtest_wrappers.c | 252 ++++++++++++++++++++++++++++++
> >>>  4 files changed, 295 insertions(+), 1 deletion(-)
> >>>  create mode 100644 tests/qtest/fuzz/qtest_wrappers.c
> >>>
> >>> -- 
> >>> 2.26.2
> > 
> 


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

end of thread, other threads:[~2020-06-03 15:24 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-05-29 22:14 [PATCH v3 0/2] fuzz: Skip QTest serialization Alexander Bulekov
2020-05-29 22:14 ` [PATCH v3 1/2] fuzz: skip " Alexander Bulekov
2020-05-29 22:14 ` [PATCH v3 2/2] fuzz: Add support for logging QTest commands Alexander Bulekov
2020-05-30  2:59 ` [PATCH v3 0/2] fuzz: Skip QTest serialization no-reply
2020-06-02 13:28 ` Darren Kenny
2020-06-02 13:40   ` Alexander Bulekov
2020-06-03 14:46     ` Thomas Huth
2020-06-03 15:22       ` Alexander Bulekov

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.