qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH 1/2] qemu-accel: unbreak non-default accelerators
@ 2008-09-09 16:37 Dmitry Baryshkov
  2008-09-09 16:37 ` [Qemu-devel] [PATCH 2/2] qemu-accel: unbreak kqemu Dmitry Baryshkov
  2008-09-09 16:49 ` [Qemu-devel] Re: [PATCH 1/2] qemu-accel: unbreak non-default accelerators Glauber Costa
  0 siblings, 2 replies; 6+ messages in thread
From: Dmitry Baryshkov @ 2008-09-09 16:37 UTC (permalink / raw)
  To: qemu-devel; +Cc: Glauber Costa, Dmitry Baryshkov

Make noaccel accelerator "registered" early so that
kqemu has a change to be enabled (it's registered
via __constructor__ feature, so called before main()).

Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@siemens.com>
Cc: Glauber Costa <gcosta@redhat.com>
---
 vl.c |    9 +++++----
 1 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/vl.c b/vl.c
index 16c1e15..bf9d83c 100644
--- a/vl.c
+++ b/vl.c
@@ -243,7 +243,6 @@ static CPUState *next_cpu;
 static int event_pending = 1;
 
 QEMUAccel *current_accel;
-QEMUCont *head = NULL;
 char qemu_app_name[20] = "QEMU";
 
 void decorate_app_name(void)
@@ -290,6 +289,11 @@ QEMUAccel noaccel = {
     .break_loop = accel_nop,
 };
 
+QEMUCont *head = &(QEMUCont){
+	.acc = &noaccel,
+	.active = 0,
+};
+
 #define TFR(expr) do { if ((expr) != -1) break; } while (errno == EINTR)
 
 /***********************************************************/
@@ -7766,9 +7770,6 @@ int main(int argc, char **argv)
     }
 #endif
 
-    /* Basic handler for the noaccel case */
-    register_qemu_accel(&noaccel);
-
     register_machines();
     machine = first_machine;
     cpu_model = NULL;
-- 
1.5.6.5

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

* [Qemu-devel] [PATCH 2/2] qemu-accel: unbreak kqemu
  2008-09-09 16:37 [Qemu-devel] [PATCH 1/2] qemu-accel: unbreak non-default accelerators Dmitry Baryshkov
@ 2008-09-09 16:37 ` Dmitry Baryshkov
  2008-09-09 16:49 ` [Qemu-devel] Re: [PATCH 1/2] qemu-accel: unbreak non-default accelerators Glauber Costa
  1 sibling, 0 replies; 6+ messages in thread
From: Dmitry Baryshkov @ 2008-09-09 16:37 UTC (permalink / raw)
  To: qemu-devel; +Cc: Dmitry Baryshkov

commit 1884dcadd64e1c4535a2b3e88008be9070aeb25b broke accelerators
(at least kqemu) because it's initialised too early. Move accel_start()
later (as it was before) so that it has all necessary data.

Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@siemens.com>
---
 vl.c |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/vl.c b/vl.c
index bf9d83c..bc0fc3f 100644
--- a/vl.c
+++ b/vl.c
@@ -8508,13 +8508,14 @@ int main(int argc, char **argv)
         exit(1);
     }
 
+    /* init the dynamic translator */
+    cpu_exec_init_all(tb_size * 1024 * 1024);
+
     if (accel_start()) {
 	    fprintf(stderr, "qemu: error, no suitable accelerator found\n");
 	    exit(1);
     }
 
-    /* init the dynamic translator */
-    cpu_exec_init_all(tb_size * 1024 * 1024);
 
     bdrv_init();
 
-- 
1.5.6.5

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

* [Qemu-devel] Re: [PATCH 1/2] qemu-accel: unbreak non-default accelerators
  2008-09-09 16:37 [Qemu-devel] [PATCH 1/2] qemu-accel: unbreak non-default accelerators Dmitry Baryshkov
  2008-09-09 16:37 ` [Qemu-devel] [PATCH 2/2] qemu-accel: unbreak kqemu Dmitry Baryshkov
@ 2008-09-09 16:49 ` Glauber Costa
  2008-09-10  7:21   ` Jan Kiszka
  1 sibling, 1 reply; 6+ messages in thread
From: Glauber Costa @ 2008-09-09 16:49 UTC (permalink / raw)
  To: Dmitry Baryshkov; +Cc: qemu-devel, Glauber Costa

On Tue, Sep 09, 2008 at 08:37:37PM +0400, Dmitry Baryshkov wrote:
> Make noaccel accelerator "registered" early so that
> kqemu has a change to be enabled (it's registered
> via __constructor__ feature, so called before main()).
fyi: we're probably changing that. There has been a lot of mail exchange
this days about the general acceptability of this feature, and the overall
feeling is that it's a negative construct. So if the problem you hit happens because
the constructor itself, it's probably worthy to drop it altogether, and invest time
in a new method for registering the accelerators.

> 
> Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@siemens.com>
> Cc: Glauber Costa <gcosta@redhat.com>
> ---
>  vl.c |    9 +++++----
>  1 files changed, 5 insertions(+), 4 deletions(-)
> 
> diff --git a/vl.c b/vl.c
> index 16c1e15..bf9d83c 100644
> --- a/vl.c
> +++ b/vl.c
> @@ -243,7 +243,6 @@ static CPUState *next_cpu;
>  static int event_pending = 1;
>  
>  QEMUAccel *current_accel;
> -QEMUCont *head = NULL;
>  char qemu_app_name[20] = "QEMU";
>  
>  void decorate_app_name(void)
> @@ -290,6 +289,11 @@ QEMUAccel noaccel = {
>      .break_loop = accel_nop,
>  };
>  
> +QEMUCont *head = &(QEMUCont){
> +	.acc = &noaccel,
> +	.active = 0,
> +};
don't we want to register it as active = 1, for the case we're not using kqemu at all?
> +
>  #define TFR(expr) do { if ((expr) != -1) break; } while (errno == EINTR)
>  
>  /***********************************************************/
> @@ -7766,9 +7770,6 @@ int main(int argc, char **argv)
>      }
>  #endif
>  
> -    /* Basic handler for the noaccel case */
> -    register_qemu_accel(&noaccel);
> -
>      register_machines();
>      machine = first_machine;
>      cpu_model = NULL;
> -- 
> 1.5.6.5
> 

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

* [Qemu-devel] Re: [PATCH 1/2] qemu-accel: unbreak non-default accelerators
  2008-09-09 16:49 ` [Qemu-devel] Re: [PATCH 1/2] qemu-accel: unbreak non-default accelerators Glauber Costa
@ 2008-09-10  7:21   ` Jan Kiszka
  2008-09-10 13:48     ` Glauber Costa
  0 siblings, 1 reply; 6+ messages in thread
From: Jan Kiszka @ 2008-09-10  7:21 UTC (permalink / raw)
  To: Glauber Costa; +Cc: qemu-devel, Dmitry Baryshkov

Glauber Costa wrote:
> On Tue, Sep 09, 2008 at 08:37:37PM +0400, Dmitry Baryshkov wrote:
>> Make noaccel accelerator "registered" early so that
>> kqemu has a change to be enabled (it's registered
>> via __constructor__ feature, so called before main()).
> fyi: we're probably changing that. There has been a lot of mail exchange
> this days about the general acceptability of this feature, and the overall

[ That was a private discussion, I guess. ]

> feeling is that it's a negative construct. So if the problem you hit happens because
> the constructor itself, it's probably worthy to drop it altogether, and invest time
> in a new method for registering the accelerators.

Do you plan to update/rebase QEMUAccel in the near future? Or what is
the short-term roadmap of this approach?

Jan

-- 
Siemens AG, Corporate Technology, CT SE 2
Corporate Competence Center Embedded Linux

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

* [Qemu-devel] Re: [PATCH 1/2] qemu-accel: unbreak non-default accelerators
  2008-09-10  7:21   ` Jan Kiszka
@ 2008-09-10 13:48     ` Glauber Costa
  2008-09-10 14:15       ` Jan Kiszka
  0 siblings, 1 reply; 6+ messages in thread
From: Glauber Costa @ 2008-09-10 13:48 UTC (permalink / raw)
  To: Jan Kiszka; +Cc: Dmitry Baryshkov, qemu-devel, Glauber Costa

On Wed, Sep 10, 2008 at 09:21:39AM +0200, Jan Kiszka wrote:
> Glauber Costa wrote:
> > On Tue, Sep 09, 2008 at 08:37:37PM +0400, Dmitry Baryshkov wrote:
> >> Make noaccel accelerator "registered" early so that
> >> kqemu has a change to be enabled (it's registered
> >> via __constructor__ feature, so called before main()).
> > fyi: we're probably changing that. There has been a lot of mail exchange
> > this days about the general acceptability of this feature, and the overall
> 
> [ That was a private discussion, I guess. ]

No. That was on list, triggered by Gerd. But right now I can't remember how it started.

> 
> > feeling is that it's a negative construct. So if the problem you hit happens because
> > the constructor itself, it's probably worthy to drop it altogether, and invest time
> > in a new method for registering the accelerators.
> 
> Do you plan to update/rebase QEMUAccel in the near future? Or what is
> the short-term roadmap of this approach?
I plan to update it as soon as I finish the memory rework I'm doing, with a somewhat
broad definition of "finish" (they don't need to be accepted, just be in a more definitive
shape). I expect it to happen somewhere next week.

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

* [Qemu-devel] Re: [PATCH 1/2] qemu-accel: unbreak non-default accelerators
  2008-09-10 13:48     ` Glauber Costa
@ 2008-09-10 14:15       ` Jan Kiszka
  0 siblings, 0 replies; 6+ messages in thread
From: Jan Kiszka @ 2008-09-10 14:15 UTC (permalink / raw)
  To: Glauber Costa; +Cc: Dmitry Baryshkov, qemu-devel, Glauber Costa

Glauber Costa wrote:
> On Wed, Sep 10, 2008 at 09:21:39AM +0200, Jan Kiszka wrote:
>> Glauber Costa wrote:
>>> On Tue, Sep 09, 2008 at 08:37:37PM +0400, Dmitry Baryshkov wrote:
>>>> Make noaccel accelerator "registered" early so that
>>>> kqemu has a change to be enabled (it's registered
>>>> via __constructor__ feature, so called before main()).
>>> fyi: we're probably changing that. There has been a lot of mail exchange
>>> this days about the general acceptability of this feature, and the overall
>> [ That was a private discussion, I guess. ]
> 
> No. That was on list, triggered by Gerd. But right now I can't remember how it started.

Now I got what you are referring to:
http://comments.gmane.org/gmane.comp.emulators.qemu/28138

Jan

-- 
Siemens AG, Corporate Technology, CT SE 2
Corporate Competence Center Embedded Linux

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

end of thread, other threads:[~2008-09-10 14:15 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-09-09 16:37 [Qemu-devel] [PATCH 1/2] qemu-accel: unbreak non-default accelerators Dmitry Baryshkov
2008-09-09 16:37 ` [Qemu-devel] [PATCH 2/2] qemu-accel: unbreak kqemu Dmitry Baryshkov
2008-09-09 16:49 ` [Qemu-devel] Re: [PATCH 1/2] qemu-accel: unbreak non-default accelerators Glauber Costa
2008-09-10  7:21   ` Jan Kiszka
2008-09-10 13:48     ` Glauber Costa
2008-09-10 14:15       ` Jan Kiszka

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).