From mboxrd@z Thu Jan 1 00:00:00 1970 From: Avi Kivity Subject: Re: kvm crashes with spice while loading qxl Date: Sun, 06 Mar 2011 12:38:44 +0200 Message-ID: <4D736434.1030704@redhat.com> References: <4D68F20D.2020401@web.de> <20110305163558.GA4607@amt.cnet> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: Jan Kiszka , xming , Gerd Hoffmann , kvm@vger.kernel.org, qemu-devel , Paolo Bonzini To: Marcelo Tosatti Return-path: Received: from mx1.redhat.com ([209.132.183.28]:18455 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752069Ab1CFKiy (ORCPT ); Sun, 6 Mar 2011 05:38:54 -0500 In-Reply-To: <20110305163558.GA4607@amt.cnet> Sender: kvm-owner@vger.kernel.org List-ID: On 03/05/2011 06:35 PM, Marcelo Tosatti wrote: > Regarding global mutex, TCG and KVM execution behaviour can become more > similar wrt locking by dropping qemu_global_mutex during generation and > execution of TBs. How can you do that? During generation, a device can assert the reset line, changing cpu modes, or move the memory map. During execution, tcg accesses memory a lot. So we'll need to acquire qemu_global_mutex for every memory access, and separate protection for TB. kvm achieves lockless protection by forcing vcpus off and dropping their page tables while executing natively, and using srcu while emulating. We can do something similar for tcg, but it won't be easy. > Of course for memory or PIO accesses from vcpu context qemu_global_mutex > must be acquired. Yes, and not just mmio - all memory accesses. > With that in place, it becomes easier to justify further improvements > regarding parallelization, such as using a read-write lock for > l1_phys_map / phys_page_find_alloc. > > > 21.62% sh 3d38920b3f [.] 0x00003d38920b3f > 6.38% sh qemu-system-x86_64 [.] phys_page_find_alloc should be replaced by a memslot list probably > 4.90% sh qemu-system-x86_64 [.] tb_find_fast > 4.34% sh qemu-system-x86_64 [.] tlb_flush > -- error compiling committee.c: too many arguments to function