From: Jan Kiszka <jan.kiszka@siemens.com>
To: Ryousei Takano <takano-ryousei@aist.go.jp>
Cc: "kvm@vger.kernel.org" <kvm@vger.kernel.org>,
Marcelo Tosatti <mtosatti@redhat.com>
Subject: Re: [PATCH] Revert "qemu-kvm: Bring qemu_init_vcpu back home"
Date: Wed, 23 Feb 2011 15:47:19 +0100 [thread overview]
Message-ID: <4D651DF7.2020900@siemens.com> (raw)
In-Reply-To: <AANLkTimrjb0b4BVge8Br+f52pym+OtzxMcMQgvn4nWv3@mail.gmail.com>
On 2011-02-23 15:38, Ryousei Takano wrote:
> This reverts commit c65827770b5e7282b5fb9da29c1de85ed08e816e
Reasoning would belong here, not below the separator.
>
> Signed-off-by: Ryousei Takano <takano-ryousei@aist.go.jp>
> ---
> I am trying to run OpenMP (i.e., multi-threaded) programs using Intel
> Math Kernel Library (MKL) on a guest OS. In the qemu-kvm-0.12.5,
> my program works fine. In the qemu-kvm-0.13.0, however, it does not.
What about 0.14?
> The Linux kernel is 2.6.32.28. The outputs of 'ps -L' are shown as follows:
>
> qemu-kvm-0.12.5:
> PID LWP TTY TIME CMD
> 2731 2731 pts/0 00:00:00 bash
> 2799 2799 pts/0 00:00:19 a.out
> 2799 2803 pts/0 00:00:00 a.out
> 2799 2804 pts/0 00:00:04 a.out <-
> 2799 2805 pts/0 00:00:03 a.out <- these threads are working properly.
> 2799 2806 pts/0 00:00:04 a.out <-
> 2807 2807 pts/0 00:00:00 ps
>
> qemu-0.13.0:
> PID LWP TTY TIME CMD
> 2725 2725 pts/0 00:00:00 bash
> 2748 2748 pts/0 00:00:19 a.out
> 2748 2752 pts/0 00:00:00 a.out
> 2748 2753 pts/0 00:00:00 a.out <-
> 2748 2754 pts/0 00:00:00 a.out <- these threads are blocked by
> pthread_cond_wait(3).
> 2748 2755 pts/0 00:00:00 a.out <-
> 2756 2756 pts/0 00:00:00 ps
>
> This problem seems to be introduced by the commit
> c65827770b5e7282b5fb9da29c1de85ed08e816e.
> The attached revert patch solves it. But I do not understand what is
> happened;-)
> Any comments and suggestions will be appreciated.
>
> Regards,
> Ryousei
>
> hw/pc.c | 6 ++++++
> target-i386/helper.c | 2 --
> 2 files changed, 6 insertions(+), 2 deletions(-)
>
> diff --git a/hw/pc.c b/hw/pc.c
> index ec97181..577abe7 100644
> --- a/hw/pc.c
> +++ b/hw/pc.c
> @@ -937,6 +937,12 @@ CPUState *pc_new_cpu(const char *cpu_model)
> }
> qemu_register_reset(pc_cpu_reset, env);
> pc_cpu_reset(env);
> +
> + /* kvm needs this to run after the apic is initialized. Otherwise,
> + * it can access invalid state and crash.
> + */
> + qemu_init_vcpu(env);
> +
> return env;
> }
>
> diff --git a/target-i386/helper.c b/target-i386/helper.c
> index 86202e6..69cda5e 100644
> --- a/target-i386/helper.c
> +++ b/target-i386/helper.c
> @@ -1224,8 +1224,6 @@ CPUX86State *cpu_x86_init(const char *cpu_model)
> }
> mce_init(env);
>
> - qemu_init_vcpu(env);
> -
> return env;
> }
>
I don't believe yet that the patch is the reason, specifically as it
targets the setup phase (except for CPU hotplug, but that's broken for
ages), not the operational phase of the VM.
What's your qemu-kvm command line?
Also, please attach gdb to the stuck VM and print the backtraces of all
threads ("thread apply all bt").
Thanks,
Jan
--
Siemens AG, Corporate Technology, CT T DE IT 1
Corporate Competence Center Embedded Linux
next prev parent reply other threads:[~2011-02-23 14:47 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-02-23 14:38 [PATCH] Revert "qemu-kvm: Bring qemu_init_vcpu back home" Ryousei Takano
2011-02-23 14:47 ` Jan Kiszka [this message]
2011-02-23 15:53 ` Ryousei Takano
2011-02-23 17:26 ` Jan Kiszka
2011-02-24 1:29 ` Ryousei Takano
2011-02-24 7:56 ` Jan Kiszka
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4D651DF7.2020900@siemens.com \
--to=jan.kiszka@siemens.com \
--cc=kvm@vger.kernel.org \
--cc=mtosatti@redhat.com \
--cc=takano-ryousei@aist.go.jp \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox