* [PATCH-for-5.1 v2 0/2] stubs: Fix notify-event stub linkage error on MinGW
@ 2020-08-05 8:55 Philippe Mathieu-Daudé
2020-08-05 8:55 ` [PATCH-for-5.1 v2 1/2] exec: Restrict icount to softmmu Philippe Mathieu-Daudé
` (2 more replies)
0 siblings, 3 replies; 9+ messages in thread
From: Philippe Mathieu-Daudé @ 2020-08-05 8:55 UTC (permalink / raw)
To: qemu-devel
Cc: Thomas Huth, Alex Bennée, Richard Henderson,
Pavel Dovgalyuk, Paolo Bonzini, Philippe Mathieu-Daudé
2 trivial patches to fix the link error reported by Thomas:
LINK tests/test-timed-average.exe
libqemuutil.a(main-loop.o): In function `qemu_notify_event':
util/main-loop.c:139: multiple definition of `qemu_notify_event'
tests/test-timed-average.o:/builds/huth/qemu/tests/../stubs/notify-event.c:5: first defined here
collect2: error: ld returned 1 exit status
rules.mak:124: recipe for target 'tests/test-timed-average.exe' failed
Philippe Mathieu-Daudé (2):
exec: Restrict icount to softmmu
stubs: Remove qemu_notify_event()
include/sysemu/cpus.h | 4 ++++
exec.c | 4 ----
softmmu/cpus.c | 7 +++++++
stubs/cpu-get-icount.c | 2 +-
stubs/notify-event.c | 6 ------
stubs/Makefile.objs | 1 -
6 files changed, 12 insertions(+), 12 deletions(-)
delete mode 100644 stubs/notify-event.c
--
2.21.3
^ permalink raw reply [flat|nested] 9+ messages in thread
* [PATCH-for-5.1 v2 1/2] exec: Restrict icount to softmmu
2020-08-05 8:55 [PATCH-for-5.1 v2 0/2] stubs: Fix notify-event stub linkage error on MinGW Philippe Mathieu-Daudé
@ 2020-08-05 8:55 ` Philippe Mathieu-Daudé
2020-08-05 8:55 ` [PATCH-for-5.1 v2 2/2] stubs: Remove qemu_notify_event() Philippe Mathieu-Daudé
2020-08-18 6:37 ` [PATCH-for-5.1 v2 0/2] stubs: Fix notify-event stub linkage error on MinGW Paolo Bonzini
2 siblings, 0 replies; 9+ messages in thread
From: Philippe Mathieu-Daudé @ 2020-08-05 8:55 UTC (permalink / raw)
To: qemu-devel
Cc: Thomas Huth, Alex Bennée, Richard Henderson,
Pavel Dovgalyuk, Paolo Bonzini, Philippe Mathieu-Daudé,
Richard Henderson
'icount' feature is only meaningful when using softmmu.
Move it out of the globally used exec.c, and define it as
'false' in user-mode emulation.
Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
---
include/sysemu/cpus.h | 4 ++++
exec.c | 4 ----
softmmu/cpus.c | 7 +++++++
3 files changed, 11 insertions(+), 4 deletions(-)
diff --git a/include/sysemu/cpus.h b/include/sysemu/cpus.h
index 3c1da6a018..d8442aa9f0 100644
--- a/include/sysemu/cpus.h
+++ b/include/sysemu/cpus.h
@@ -11,9 +11,13 @@ void pause_all_vcpus(void);
void cpu_stop_current(void);
void cpu_ticks_init(void);
+#if !defined(CONFIG_USER_ONLY)
void configure_icount(QemuOpts *opts, Error **errp);
extern int use_icount;
extern int icount_align_option;
+#else
+#define use_icount false
+#endif
/* drift information for info jit command */
extern int64_t max_delay;
diff --git a/exec.c b/exec.c
index 6f381f98e2..a89ffa93c1 100644
--- a/exec.c
+++ b/exec.c
@@ -102,10 +102,6 @@ uintptr_t qemu_host_page_size;
intptr_t qemu_host_page_mask;
#if !defined(CONFIG_USER_ONLY)
-/* 0 = Do not count executed instructions.
- 1 = Precise instruction counting.
- 2 = Adaptive rate instruction counting. */
-int use_icount;
typedef struct PhysPageEntry PhysPageEntry;
diff --git a/softmmu/cpus.c b/softmmu/cpus.c
index a802e899ab..a4772034c0 100644
--- a/softmmu/cpus.c
+++ b/softmmu/cpus.c
@@ -81,6 +81,13 @@
#endif /* CONFIG_LINUX */
+/*
+ * 0 = Do not count executed instructions.
+ * 1 = Precise instruction counting.
+ * 2 = Adaptive rate instruction counting.
+ */
+int use_icount;
+
static QemuMutex qemu_global_mutex;
int64_t max_delay;
--
2.21.3
^ permalink raw reply related [flat|nested] 9+ messages in thread
* [PATCH-for-5.1 v2 2/2] stubs: Remove qemu_notify_event()
2020-08-05 8:55 [PATCH-for-5.1 v2 0/2] stubs: Fix notify-event stub linkage error on MinGW Philippe Mathieu-Daudé
2020-08-05 8:55 ` [PATCH-for-5.1 v2 1/2] exec: Restrict icount to softmmu Philippe Mathieu-Daudé
@ 2020-08-05 8:55 ` Philippe Mathieu-Daudé
2020-08-05 9:42 ` Philippe Mathieu-Daudé
2020-08-18 6:37 ` [PATCH-for-5.1 v2 0/2] stubs: Fix notify-event stub linkage error on MinGW Paolo Bonzini
2 siblings, 1 reply; 9+ messages in thread
From: Philippe Mathieu-Daudé @ 2020-08-05 8:55 UTC (permalink / raw)
To: qemu-devel
Cc: Thomas Huth, Alex Bennée, Richard Henderson,
Pavel Dovgalyuk, Paolo Bonzini, Philippe Mathieu-Daudé
We don't need the qemu_notify_event() stub anymore.
Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
---
stubs/cpu-get-icount.c | 2 +-
stubs/notify-event.c | 6 ------
stubs/Makefile.objs | 1 -
3 files changed, 1 insertion(+), 8 deletions(-)
delete mode 100644 stubs/notify-event.c
diff --git a/stubs/cpu-get-icount.c b/stubs/cpu-get-icount.c
index b35f844638..8962dfd71f 100644
--- a/stubs/cpu-get-icount.c
+++ b/stubs/cpu-get-icount.c
@@ -17,5 +17,5 @@ int64_t cpu_get_icount_raw(void)
void qemu_timer_notify_cb(void *opaque, QEMUClockType type)
{
- qemu_notify_event();
+ abort();
}
diff --git a/stubs/notify-event.c b/stubs/notify-event.c
deleted file mode 100644
index 827bb52d1a..0000000000
--- a/stubs/notify-event.c
+++ /dev/null
@@ -1,6 +0,0 @@
-#include "qemu/osdep.h"
-#include "qemu/main-loop.h"
-
-void qemu_notify_event(void)
-{
-}
diff --git a/stubs/Makefile.objs b/stubs/Makefile.objs
index d42046afe4..cb374c96db 100644
--- a/stubs/Makefile.objs
+++ b/stubs/Makefile.objs
@@ -12,7 +12,6 @@ stub-obj-y += isa-bus.o
stub-obj-$(CONFIG_LINUX_AIO) += linux-aio.o
stub-obj-$(CONFIG_LINUX_IO_URING) += io_uring.o
stub-obj-y += monitor-core.o
-stub-obj-y += notify-event.o
stub-obj-y += pci-bus.o
stub-obj-y += qmp_memory_device.o
stub-obj-y += qtest.o
--
2.21.3
^ permalink raw reply related [flat|nested] 9+ messages in thread
* Re: [PATCH-for-5.1 v2 2/2] stubs: Remove qemu_notify_event()
2020-08-05 8:55 ` [PATCH-for-5.1 v2 2/2] stubs: Remove qemu_notify_event() Philippe Mathieu-Daudé
@ 2020-08-05 9:42 ` Philippe Mathieu-Daudé
2020-08-05 9:59 ` Philippe Mathieu-Daudé
0 siblings, 1 reply; 9+ messages in thread
From: Philippe Mathieu-Daudé @ 2020-08-05 9:42 UTC (permalink / raw)
To: qemu-devel
Cc: Alex Bennée, Thomas Huth, Richard Henderson,
Pavel Dovgalyuk, Paolo Bonzini
On 8/5/20 10:55 AM, Philippe Mathieu-Daudé wrote:
> We don't need the qemu_notify_event() stub anymore.
>
> Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
> ---
> stubs/cpu-get-icount.c | 2 +-
> stubs/notify-event.c | 6 ------
> stubs/Makefile.objs | 1 -
> 3 files changed, 1 insertion(+), 8 deletions(-)
> delete mode 100644 stubs/notify-event.c
>
> diff --git a/stubs/cpu-get-icount.c b/stubs/cpu-get-icount.c
> index b35f844638..8962dfd71f 100644
> --- a/stubs/cpu-get-icount.c
> +++ b/stubs/cpu-get-icount.c
> @@ -17,5 +17,5 @@ int64_t cpu_get_icount_raw(void)
>
> void qemu_timer_notify_cb(void *opaque, QEMUClockType type)
> {
> - qemu_notify_event();
> + abort();
This abort makes iotest 077 fail.
I think I'll simply repost without it.
> }
> diff --git a/stubs/notify-event.c b/stubs/notify-event.c
> deleted file mode 100644
> index 827bb52d1a..0000000000
> --- a/stubs/notify-event.c
> +++ /dev/null
> @@ -1,6 +0,0 @@
> -#include "qemu/osdep.h"
> -#include "qemu/main-loop.h"
> -
> -void qemu_notify_event(void)
> -{
> -}
> diff --git a/stubs/Makefile.objs b/stubs/Makefile.objs
> index d42046afe4..cb374c96db 100644
> --- a/stubs/Makefile.objs
> +++ b/stubs/Makefile.objs
> @@ -12,7 +12,6 @@ stub-obj-y += isa-bus.o
> stub-obj-$(CONFIG_LINUX_AIO) += linux-aio.o
> stub-obj-$(CONFIG_LINUX_IO_URING) += io_uring.o
> stub-obj-y += monitor-core.o
> -stub-obj-y += notify-event.o
> stub-obj-y += pci-bus.o
> stub-obj-y += qmp_memory_device.o
> stub-obj-y += qtest.o
>
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH-for-5.1 v2 2/2] stubs: Remove qemu_notify_event()
2020-08-05 9:42 ` Philippe Mathieu-Daudé
@ 2020-08-05 9:59 ` Philippe Mathieu-Daudé
2020-08-05 11:49 ` Thomas Huth
0 siblings, 1 reply; 9+ messages in thread
From: Philippe Mathieu-Daudé @ 2020-08-05 9:59 UTC (permalink / raw)
To: qemu-devel
Cc: Alex Bennée, Thomas Huth, Richard Henderson,
Pavel Dovgalyuk, Paolo Bonzini
On 8/5/20 11:42 AM, Philippe Mathieu-Daudé wrote:
> On 8/5/20 10:55 AM, Philippe Mathieu-Daudé wrote:
>> We don't need the qemu_notify_event() stub anymore.
>>
>> Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
>> ---
>> stubs/cpu-get-icount.c | 2 +-
>> stubs/notify-event.c | 6 ------
>> stubs/Makefile.objs | 1 -
>> 3 files changed, 1 insertion(+), 8 deletions(-)
>> delete mode 100644 stubs/notify-event.c
>>
>> diff --git a/stubs/cpu-get-icount.c b/stubs/cpu-get-icount.c
>> index b35f844638..8962dfd71f 100644
>> --- a/stubs/cpu-get-icount.c
>> +++ b/stubs/cpu-get-icount.c
>> @@ -17,5 +17,5 @@ int64_t cpu_get_icount_raw(void)
>>
>> void qemu_timer_notify_cb(void *opaque, QEMUClockType type)
>> {
>> - qemu_notify_event();
>> + abort();
>
> This abort makes iotest 077 fail.
> I think I'll simply repost without it.
I don't understand what from 077 trigger this callback, but
I confirm doing nothing is safe, ...
>
>> }
>> diff --git a/stubs/notify-event.c b/stubs/notify-event.c
>> deleted file mode 100644
>> index 827bb52d1a..0000000000
>> --- a/stubs/notify-event.c
>> +++ /dev/null
>> @@ -1,6 +0,0 @@
>> -#include "qemu/osdep.h"
>> -#include "qemu/main-loop.h"
>> -
>> -void qemu_notify_event(void)
>> -{
... as this is the current behavior.
>> -}
>> diff --git a/stubs/Makefile.objs b/stubs/Makefile.objs
>> index d42046afe4..cb374c96db 100644
>> --- a/stubs/Makefile.objs
>> +++ b/stubs/Makefile.objs
>> @@ -12,7 +12,6 @@ stub-obj-y += isa-bus.o
>> stub-obj-$(CONFIG_LINUX_AIO) += linux-aio.o
>> stub-obj-$(CONFIG_LINUX_IO_URING) += io_uring.o
>> stub-obj-y += monitor-core.o
>> -stub-obj-y += notify-event.o
>> stub-obj-y += pci-bus.o
>> stub-obj-y += qmp_memory_device.o
>> stub-obj-y += qtest.o
>>
>
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH-for-5.1 v2 2/2] stubs: Remove qemu_notify_event()
2020-08-05 9:59 ` Philippe Mathieu-Daudé
@ 2020-08-05 11:49 ` Thomas Huth
2020-08-18 6:34 ` Paolo Bonzini
0 siblings, 1 reply; 9+ messages in thread
From: Thomas Huth @ 2020-08-05 11:49 UTC (permalink / raw)
To: Philippe Mathieu-Daudé, qemu-devel
Cc: Alex Bennée, Richard Henderson, Pavel Dovgalyuk, Paolo Bonzini
On 05/08/2020 11.59, Philippe Mathieu-Daudé wrote:
> On 8/5/20 11:42 AM, Philippe Mathieu-Daudé wrote:
>> On 8/5/20 10:55 AM, Philippe Mathieu-Daudé wrote:
>>> We don't need the qemu_notify_event() stub anymore.
>>>
>>> Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
>>> ---
>>> stubs/cpu-get-icount.c | 2 +-
>>> stubs/notify-event.c | 6 ------
>>> stubs/Makefile.objs | 1 -
>>> 3 files changed, 1 insertion(+), 8 deletions(-)
>>> delete mode 100644 stubs/notify-event.c
>>>
>>> diff --git a/stubs/cpu-get-icount.c b/stubs/cpu-get-icount.c
>>> index b35f844638..8962dfd71f 100644
>>> --- a/stubs/cpu-get-icount.c
>>> +++ b/stubs/cpu-get-icount.c
>>> @@ -17,5 +17,5 @@ int64_t cpu_get_icount_raw(void)
>>>
>>> void qemu_timer_notify_cb(void *opaque, QEMUClockType type)
>>> {
>>> - qemu_notify_event();
>>> + abort();
>>
>> This abort makes iotest 077 fail.
>> I think I'll simply repost without it.
>
> I don't understand what from 077 trigger this callback, but
> I confirm doing nothing is safe, ...
>
>>
>>> }
>>> diff --git a/stubs/notify-event.c b/stubs/notify-event.c
>>> deleted file mode 100644
>>> index 827bb52d1a..0000000000
>>> --- a/stubs/notify-event.c
>>> +++ /dev/null
>>> @@ -1,6 +0,0 @@
>>> -#include "qemu/osdep.h"
>>> -#include "qemu/main-loop.h"
>>> -
>>> -void qemu_notify_event(void)
>>> -{
>
> ... as this is the current behavior.
But could we maybe end up in a scenario, where the stub from
stubs/cpu-get-icount.c is used, which then calls the real implementation
of qemu_notify_event() in main-loop.c ?
Thomas
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH-for-5.1 v2 2/2] stubs: Remove qemu_notify_event()
2020-08-05 11:49 ` Thomas Huth
@ 2020-08-18 6:34 ` Paolo Bonzini
0 siblings, 0 replies; 9+ messages in thread
From: Paolo Bonzini @ 2020-08-18 6:34 UTC (permalink / raw)
To: Thomas Huth, Philippe Mathieu-Daudé, qemu-devel
Cc: Alex Bennée, Richard Henderson, Pavel Dovgalyuk
On 05/08/20 13:49, Thomas Huth wrote:
>> ... as this is the current behavior.
> But could we maybe end up in a scenario, where the stub from
> stubs/cpu-get-icount.c is used, which then calls the real implementation
> of qemu_notify_event() in main-loop.c ?
Yes, definitely. It would happen in tools such as qemu-img/qemu-io and
it's the correct behavior.
Paolo
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH-for-5.1 v2 0/2] stubs: Fix notify-event stub linkage error on MinGW
2020-08-05 8:55 [PATCH-for-5.1 v2 0/2] stubs: Fix notify-event stub linkage error on MinGW Philippe Mathieu-Daudé
2020-08-05 8:55 ` [PATCH-for-5.1 v2 1/2] exec: Restrict icount to softmmu Philippe Mathieu-Daudé
2020-08-05 8:55 ` [PATCH-for-5.1 v2 2/2] stubs: Remove qemu_notify_event() Philippe Mathieu-Daudé
@ 2020-08-18 6:37 ` Paolo Bonzini
2020-08-18 7:09 ` Philippe Mathieu-Daudé
2 siblings, 1 reply; 9+ messages in thread
From: Paolo Bonzini @ 2020-08-18 6:37 UTC (permalink / raw)
To: Philippe Mathieu-Daudé, qemu-devel
Cc: Alex Bennée, Thomas Huth, Richard Henderson, Pavel Dovgalyuk
On 05/08/20 10:55, Philippe Mathieu-Daudé wrote:
> 2 trivial patches to fix the link error reported by Thomas:
>
> LINK tests/test-timed-average.exe
> libqemuutil.a(main-loop.o): In function `qemu_notify_event':
> util/main-loop.c:139: multiple definition of `qemu_notify_event'
> tests/test-timed-average.o:/builds/huth/qemu/tests/../stubs/notify-event.c:5: first defined here
> collect2: error: ld returned 1 exit status
> rules.mak:124: recipe for target 'tests/test-timed-average.exe' failed
>
> Philippe Mathieu-Daudé (2):
> exec: Restrict icount to softmmu
> stubs: Remove qemu_notify_event()
>
> include/sysemu/cpus.h | 4 ++++
> exec.c | 4 ----
> softmmu/cpus.c | 7 +++++++
> stubs/cpu-get-icount.c | 2 +-
> stubs/notify-event.c | 6 ------
> stubs/Makefile.objs | 1 -
> 6 files changed, 12 insertions(+), 12 deletions(-)
> delete mode 100644 stubs/notify-event.c
>
Patch 1 will be superseded by Claudio's refactoring. For patch 2 please
respin according to the review.
Paolo
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH-for-5.1 v2 0/2] stubs: Fix notify-event stub linkage error on MinGW
2020-08-18 6:37 ` [PATCH-for-5.1 v2 0/2] stubs: Fix notify-event stub linkage error on MinGW Paolo Bonzini
@ 2020-08-18 7:09 ` Philippe Mathieu-Daudé
0 siblings, 0 replies; 9+ messages in thread
From: Philippe Mathieu-Daudé @ 2020-08-18 7:09 UTC (permalink / raw)
To: Paolo Bonzini, qemu-devel
Cc: Alex Bennée, Thomas Huth, Richard Henderson, Pavel Dovgalyuk
On 8/18/20 8:37 AM, Paolo Bonzini wrote:
> On 05/08/20 10:55, Philippe Mathieu-Daudé wrote:
>> 2 trivial patches to fix the link error reported by Thomas:
>>
>> LINK tests/test-timed-average.exe
>> libqemuutil.a(main-loop.o): In function `qemu_notify_event':
>> util/main-loop.c:139: multiple definition of `qemu_notify_event'
>> tests/test-timed-average.o:/builds/huth/qemu/tests/../stubs/notify-event.c:5: first defined here
>> collect2: error: ld returned 1 exit status
>> rules.mak:124: recipe for target 'tests/test-timed-average.exe' failed
>>
>> Philippe Mathieu-Daudé (2):
>> exec: Restrict icount to softmmu
>> stubs: Remove qemu_notify_event()
>>
>> include/sysemu/cpus.h | 4 ++++
>> exec.c | 4 ----
>> softmmu/cpus.c | 7 +++++++
>> stubs/cpu-get-icount.c | 2 +-
>> stubs/notify-event.c | 6 ------
>> stubs/Makefile.objs | 1 -
>> 6 files changed, 12 insertions(+), 12 deletions(-)
>> delete mode 100644 stubs/notify-event.c
>>
>
> Patch 1 will be superseded by Claudio's refactoring. For patch 2 please
> respin according to the review.
The respin is available as <20200805100126.25583-3-philmd@redhat.com>:
https://www.mail-archive.com/qemu-devel@nongnu.org/msg727616.html
^ permalink raw reply [flat|nested] 9+ messages in thread
end of thread, other threads:[~2020-08-18 7:10 UTC | newest]
Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-08-05 8:55 [PATCH-for-5.1 v2 0/2] stubs: Fix notify-event stub linkage error on MinGW Philippe Mathieu-Daudé
2020-08-05 8:55 ` [PATCH-for-5.1 v2 1/2] exec: Restrict icount to softmmu Philippe Mathieu-Daudé
2020-08-05 8:55 ` [PATCH-for-5.1 v2 2/2] stubs: Remove qemu_notify_event() Philippe Mathieu-Daudé
2020-08-05 9:42 ` Philippe Mathieu-Daudé
2020-08-05 9:59 ` Philippe Mathieu-Daudé
2020-08-05 11:49 ` Thomas Huth
2020-08-18 6:34 ` Paolo Bonzini
2020-08-18 6:37 ` [PATCH-for-5.1 v2 0/2] stubs: Fix notify-event stub linkage error on MinGW Paolo Bonzini
2020-08-18 7:09 ` Philippe Mathieu-Daudé
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.