From mboxrd@z Thu Jan 1 00:00:00 1970 From: =?UTF-8?B?QW5kcmVhcyBGw6RyYmVy?= Subject: Re: [Qemu-devel] [PATCH qom-cpu for-1.4?] kvm: Pass CPUState to kvm_on_sigbus_vcpu() Date: Mon, 28 Jan 2013 16:29:35 +0100 Message-ID: <5106995F.4010702@suse.de> References: <1359129329-21274-1-git-send-email-afaerber@suse.de> <20130128135048.GD22871@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: QUOTED-PRINTABLE Cc: Marcelo Tosatti , qemu-devel@nongnu.org, Overall To: Gleb Natapov Return-path: Received: from cantor2.suse.de ([195.135.220.15]:41113 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754166Ab3A1P3p (ORCPT ); Mon, 28 Jan 2013 10:29:45 -0500 In-Reply-To: <20130128135048.GD22871@redhat.com> Sender: kvm-owner@vger.kernel.org List-ID: Am 28.01.2013 14:50, schrieb Gleb Natapov: > On Fri, Jan 25, 2013 at 04:55:29PM +0100, Andreas F=C3=A4rber wrote: >> Since commit 20d695a9254c1b086a456d3b79a3c311236643ba (kvm: Pass >> CPUState to kvm_arch_*) CPUArchState is no longer needed. >> >> Allows to change qemu_kvm_eat_signals() argument as well. >> >> Signed-off-by: Andreas F=C3=A4rber > Reviewed-by: Gleb Natapov Thanks, applied to qom-cpu: https://github.com/afaerber/qemu-cpu/commits/qom-cpu Background was: https://lists.nongnu.org/archive/html/qemu-devel/2013-01/msg03087.html <<< [...] qemu_init_vcpu() still operates on CPUArchState and thus cannot b= e moved into CPUClass yet. The reason is that cpus.c:qemu_kvm_cpu_thread_fn sets cpu_single_env, and I do not see a solution for that - suggestions or patches welcome. However, I see that kvm-all.c:kvm_on_sigbus_vcpu() can be switched to CPUState now, so that cpus.c:qemu_kvm_eat_signals() can be changed to CPUState, used from cpus.c:qemu_kvm_wait_io_event(). But cpus.c:cpu_thread_is_idle() still uses env->halted, which is blocke= d by the search for an acceptable solution to flush the TLB at CPUState level (exec.c:cpu_common_post_load()). >>> A less elegant but working solution is on my qom-cpu-8 branch (based of= f qom-cpu-next): I introduced a void *env_ptr CPUState field. While potentially opening a can of worms I wanted to avoid, it allows us to defer finding a solution to the target_ulong-dependent TLB some more. Regards, Andreas --=20 SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 N=C3=BCrnberg, Germany GF: Jeff Hawn, Jennifer Guild, Felix Imend=C3=B6rffer; HRB 16746 AG N=C3= =BCrnberg