1 | The following changes since commit 285278ca785f5fa9a570927e1c0958a2ca2b2150: | 1 | The following changes since commit 98b2e3c9ab3abfe476a2b02f8f51813edb90e72d: |
---|---|---|---|
2 | 2 | ||
3 | Merge remote-tracking branch 'remotes/famz/tags/testing-pull-request' into staging (2018-10-27 19:55:08 +0100) | 3 | Merge remote-tracking branch 'remotes/stefanha/tags/block-pull-request' into staging (2019-10-08 16:08:35 +0100) |
4 | 4 | ||
5 | are available in the Git repository at: | 5 | are available in the Git repository at: |
6 | 6 | ||
7 | git://github.com/stefanha/qemu.git tags/block-pull-request | 7 | https://github.com/stefanha/qemu.git tags/block-pull-request |
8 | 8 | ||
9 | for you to fetch changes up to bd54b11062c4baa7d2e4efadcf71b8cfd55311fd: | 9 | for you to fetch changes up to 69de48445a0d6169f1e2a6c5bfab994e1c810e33: |
10 | 10 | ||
11 | nvdimm: Add docs hint for Linux driver name (2018-10-29 13:35:22 +0000) | 11 | test-bdrv-drain: fix iothread_join() hang (2019-10-14 09:48:01 +0100) |
12 | 12 | ||
13 | ---------------------------------------------------------------- | 13 | ---------------------------------------------------------------- |
14 | Pull request | 14 | Pull request |
15 | 15 | ||
16 | No changelog-worthy entries, just small tweaks. | ||
17 | |||
18 | ---------------------------------------------------------------- | 16 | ---------------------------------------------------------------- |
19 | 17 | ||
20 | Kees Cook (1): | 18 | Stefan Hajnoczi (1): |
21 | nvdimm: Add docs hint for Linux driver name | 19 | test-bdrv-drain: fix iothread_join() hang |
22 | 20 | ||
23 | Li Qiang (1): | 21 | tests/iothread.c | 10 ++++++++-- |
24 | util: aio-posix: fix a typo | 22 | 1 file changed, 8 insertions(+), 2 deletions(-) |
25 | |||
26 | docs/nvdimm.txt | 5 +++-- | ||
27 | util/aio-posix.c | 2 +- | ||
28 | 2 files changed, 4 insertions(+), 3 deletions(-) | ||
29 | 23 | ||
30 | -- | 24 | -- |
31 | 2.17.2 | 25 | 2.21.0 |
32 | 26 | ||
33 | 27 | diff view generated by jsdifflib |
Deleted patch | |||
---|---|---|---|
1 | From: Li Qiang <liq3ea@gmail.com> | ||
2 | 1 | ||
3 | Cc: qemu-trivial@nongnu.org | ||
4 | Signed-off-by: Li Qiang <liq3ea@gmail.com> | ||
5 | Reviewed-by: Peter Maydell <peter.maydell@linaro.org> | ||
6 | Reviewed-by: Fam Zheng <famz@redhat.com> | ||
7 | Message-id: 1538964972-3223-1-git-send-email-liq3ea@gmail.com | ||
8 | Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com> | ||
9 | --- | ||
10 | util/aio-posix.c | 2 +- | ||
11 | 1 file changed, 1 insertion(+), 1 deletion(-) | ||
12 | |||
13 | diff --git a/util/aio-posix.c b/util/aio-posix.c | ||
14 | index XXXXXXX..XXXXXXX 100644 | ||
15 | --- a/util/aio-posix.c | ||
16 | +++ b/util/aio-posix.c | ||
17 | @@ -XXX,XX +XXX,XX @@ struct AioHandler | ||
18 | |||
19 | #ifdef CONFIG_EPOLL_CREATE1 | ||
20 | |||
21 | -/* The fd number threashold to switch to epoll */ | ||
22 | +/* The fd number threshold to switch to epoll */ | ||
23 | #define EPOLL_ENABLE_THRESHOLD 64 | ||
24 | |||
25 | static void aio_epoll_disable(AioContext *ctx) | ||
26 | -- | ||
27 | 2.17.2 | ||
28 | |||
29 | diff view generated by jsdifflib |
1 | From: Kees Cook <keescook@chromium.org> | 1 | tests/test-bdrv-drain can hang in tests/iothread.c:iothread_run(): |
---|---|---|---|
2 | 2 | ||
3 | I spent way too much time trying to figure out why the emulated NVDIMM | 3 | while (!atomic_read(&iothread->stopping)) { |
4 | was missing under Linux. In an effort to help others who might be looking | 4 | aio_poll(iothread->ctx, true); |
5 | for these kinds of things in the future, include a hint. | 5 | } |
6 | 6 | ||
7 | Signed-off-by: Kees Cook <keescook@chromium.org> | 7 | The iothread_join() function works as follows: |
8 | Message-id: 20181018201351.GA25286@beast | 8 | |
9 | void iothread_join(IOThread *iothread) | ||
10 | { | ||
11 | iothread->stopping = true; | ||
12 | aio_notify(iothread->ctx); | ||
13 | qemu_thread_join(&iothread->thread); | ||
14 | |||
15 | If iothread_run() checks iothread->stopping before the iothread_join() | ||
16 | thread sets stopping to true, then aio_notify() may be optimized away | ||
17 | and iothread_run() hangs forever in aio_poll(). | ||
18 | |||
19 | The correct way to change iothread->stopping is from a BH that executes | ||
20 | within iothread_run(). This ensures that iothread->stopping is checked | ||
21 | after we set it to true. | ||
22 | |||
23 | This was already fixed for ./iothread.c (note this is a different source | ||
24 | file!) by commit 2362a28ea11c145e1a13ae79342d76dc118a72a6 ("iothread: | ||
25 | fix iothread_stop() race condition"), but not for tests/iothread.c. | ||
26 | |||
27 | Fixes: 0c330a734b51c177ab8488932ac3b0c4d63a718a | ||
28 | ("aio: introduce aio_co_schedule and aio_co_wake") | ||
29 | Reported-by: Dr. David Alan Gilbert <dgilbert@redhat.com> | ||
30 | Reviewed-by: Paolo Bonzini <pbonzini@redhat.com> | ||
31 | Message-Id: <20191003100103.331-1-stefanha@redhat.com> | ||
9 | Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com> | 32 | Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com> |
10 | --- | 33 | --- |
11 | docs/nvdimm.txt | 5 +++-- | 34 | tests/iothread.c | 10 ++++++++-- |
12 | 1 file changed, 3 insertions(+), 2 deletions(-) | 35 | 1 file changed, 8 insertions(+), 2 deletions(-) |
13 | 36 | ||
14 | diff --git a/docs/nvdimm.txt b/docs/nvdimm.txt | 37 | diff --git a/tests/iothread.c b/tests/iothread.c |
15 | index XXXXXXX..XXXXXXX 100644 | 38 | index XXXXXXX..XXXXXXX 100644 |
16 | --- a/docs/nvdimm.txt | 39 | --- a/tests/iothread.c |
17 | +++ b/docs/nvdimm.txt | 40 | +++ b/tests/iothread.c |
18 | @@ -XXX,XX +XXX,XX @@ Multiple vNVDIMM devices can be created if multiple pairs of "-object" | 41 | @@ -XXX,XX +XXX,XX @@ static void *iothread_run(void *opaque) |
19 | and "-device" are provided. | 42 | return NULL; |
20 | 43 | } | |
21 | For above command line options, if the guest OS has the proper NVDIMM | 44 | |
22 | -driver, it should be able to detect a NVDIMM device which is in the | 45 | -void iothread_join(IOThread *iothread) |
23 | -persistent memory mode and whose size is $NVDIMM_SIZE. | 46 | +static void iothread_stop_bh(void *opaque) |
24 | +driver (e.g. "CONFIG_ACPI_NFIT=y" under Linux), it should be able to | 47 | { |
25 | +detect a NVDIMM device which is in the persistent memory mode and whose | 48 | + IOThread *iothread = opaque; |
26 | +size is $NVDIMM_SIZE. | 49 | + |
27 | 50 | iothread->stopping = true; | |
28 | Note: | 51 | - aio_notify(iothread->ctx); |
29 | 52 | +} | |
53 | + | ||
54 | +void iothread_join(IOThread *iothread) | ||
55 | +{ | ||
56 | + aio_bh_schedule_oneshot(iothread->ctx, iothread_stop_bh, iothread); | ||
57 | qemu_thread_join(&iothread->thread); | ||
58 | qemu_cond_destroy(&iothread->init_done_cond); | ||
59 | qemu_mutex_destroy(&iothread->init_done_lock); | ||
30 | -- | 60 | -- |
31 | 2.17.2 | 61 | 2.21.0 |
32 | 62 | ||
33 | 63 | diff view generated by jsdifflib |