From patchwork Tue Jun 4 08:26:16 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: dunrong huang X-Patchwork-Id: 248495 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id E9EE72C00A0 for ; Tue, 4 Jun 2013 18:26:44 +1000 (EST) Received: from localhost ([::1]:43249 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UjmZn-0006go-2I for incoming@patchwork.ozlabs.org; Tue, 04 Jun 2013 04:26:43 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:48193) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UjmZS-0006g7-O6 for qemu-devel@nongnu.org; Tue, 04 Jun 2013 04:26:28 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UjmZN-0005rc-Ck for qemu-devel@nongnu.org; Tue, 04 Jun 2013 04:26:22 -0400 Received: from mail-qa0-x229.google.com ([2607:f8b0:400d:c00::229]:37615) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UjmZN-0005rY-7R for qemu-devel@nongnu.org; Tue, 04 Jun 2013 04:26:17 -0400 Received: by mail-qa0-f41.google.com with SMTP id bn16so2402754qab.14 for ; Tue, 04 Jun 2013 01:26:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=L68uKM1FF6m0GGVAorQiU7BdQ2AMTvZsBBzEkFKMazw=; b=ZHPBvF3U19LHdH56fw7GPqk0t5e25h1smuaIYYi5s129mTXF1sGgWAJyuRn/M7WIQZ 85drXyKDlFlAI3iT2at7ewT0VZBE5Kuwrlss5mD5osFoglCx1jSL7VfirVirCBpKshCh aBjTk4RjZ66G5wvp+Ia6+MNS813ZhNM2aux+5EZzup7fvQzC0ChHMxkaLAQt7BBizta0 a3dKDcI6ZbM2oZiRraV4MF3lgvoCMYXEsEN+LyrBTAprWXJMAHowGdUHif5/f6tynHpI wtrRS1Dl2aY2h/V3yt27mAc5zch19+Hg13zWP6Stb8SLbP1IqH7BjFFd9NiCpOUPM3ko ozjQ== MIME-Version: 1.0 X-Received: by 10.224.174.138 with SMTP id t10mr21950638qaz.99.1370334376862; Tue, 04 Jun 2013 01:26:16 -0700 (PDT) Received: by 10.49.17.69 with HTTP; Tue, 4 Jun 2013 01:26:16 -0700 (PDT) In-Reply-To: <20130604075107.GJ4725@redhat.com> References: <51AD8D88.70104@redhat.com> <20130604075107.GJ4725@redhat.com> Date: Tue, 4 Jun 2013 16:26:16 +0800 Message-ID: From: Dunrong Huang To: Gleb Natapov X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2607:f8b0:400d:c00::229 Cc: Paolo Bonzini , qemu-devel , Jordan Justen Subject: Re: [Qemu-devel] VM can not boot after commit 235e898 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org On Tue, Jun 4, 2013 at 3:51 PM, Gleb Natapov wrote: > On Tue, Jun 04, 2013 at 03:47:47PM +0800, Dunrong Huang wrote: > > On Tue, Jun 4, 2013 at 2:47 PM, Paolo Bonzini > wrote: > > > > > Il 04/06/2013 05:47, Dunrong Huang ha scritto: > > > > > > > > QEMU command: > > > > ~/usr/bin/qemu-system-x86_64 -enable-kvm -m 1024 debian-append.img > > > > > > > > git bisect tells that the following commit causes this bug: > > > > > > > > commit 235e8982ad393e5611cb892df54881c872eea9e1 > > > > Author: Jordan Justen > > > > > > > > Date: Wed May 29 01:27:26 2013 -0700 > > > > > > > > kvm: support using KVM_MEM_READONLY flag for regions > > > > > > > > For readonly memory regions and rom devices in romd_mode, > > > > we make use of the KVM_MEM_READONLY. A slot that uses > > > > KVM_MEM_READONLY can be read from and code can execute from the > > > > region, but writes will exit to qemu. > > > > > > > > After reverting this commit, VM can boot normally. > > > > > > A patch is queued for that. Using kernel 3.8 or reverting the commit > > > will both work. > > > > > Ok, thanks for information, I will try it. > > > The fix is 651eb0f4 and you claim it is still fails for you. This is > strange because the commit fixed the problem for everyone else. Can you > double check that you are testing the right commit and you recompiled > and reinstalled? > I am sure 651eb0f4 does not fix this problem. My test environment is below: * config.log: # head -n 2 config.log # QEMU configure log 2013年 06月 04日 星期二 16:12:59 CST # Configured with: './configure' '--prefix=/root/usr' '--enable-kvm' '--enable-werror' '--enable-debug' '--enable-debug-tcg' '--enable-debug-info' '--enable-sdl' '--enable-gtk' '--enable-virtfs' '--enable-vnc' '--enable-mixemu' '--enable-vnc-tls' '--enable-vnc-sasl' '--enable-vnc-jpeg' '--enable-vnc-png' '--enable-vnc-ws' '--enable-curses' '--enable-curl' '--enable-nptl' '--enable-system' '--enable-user' '--enable-linux-user' '--enable-guest-base' '--enable-uuid' '--enable-vde' '--enable-linux-aio' '--enable-cap-ng' '--enable-attr' '--enable-docs' '--enable-vhost-net' '--enable-spice' '--enable-usb-redir' '--enable-smartcard-nss' '--enable-tpm' '--enable-guest-agent' '--target-list=x86_64-softmmu' * kernel version: # uname -a Linux gentoo-company 3.8.2-gentoo #1 SMP Fri Mar 8 11:44:36 CST 2013 x86_64 Intel(R) Core(TM)2 Duo CPU E7500 @ 2.93GHz GenuineIntel GNU/Linux * details of git tree: # git log HEAD --oneline 1713924 gtk: don't use g_object_unref on GdkCursor 41686a9 gtk: don't resize window when enabling scaling 651eb0f fix double free the memslot in kvm_set_phys_mem 25b4833 configure: Report unknown target names more helpfully 6e92f82 configure: Autogenerate default target list 0ded1fe Merge remote-tracking branch 'pmaydell/arm-devs.next' into staging 95669e6 i.MX: Improve EPIT timer code. 6539ed2 exynos4210.c: register rom_mem for memory migration * QEMU command line: x86_64-softmmu/qemu-system-x86_64 -enable-kvm -cdrom /mnt/nfs/Images/ISO/ubuntu-12.04-dvd-amd64.iso After disable KVM_MEM_READONLY flag like below, VM can boot normally. if (err) { I can provide more details if needed. > -- > Gleb. > diff --git a/kvm-all.c b/kvm-all.c index 405480e..c33ba6e 100644 --- a/kvm-all.c +++ b/kvm-all.c @@ -774,7 +774,7 @@ static void kvm_set_phys_mem(MemoryRegionSection *section, bool add) mem->memory_size = size; mem->start_addr = start_addr; mem->ram = ram; - mem->flags = kvm_mem_flags(s, log_dirty, readonly_flag); + mem->flags = kvm_mem_flags(s, log_dirty, false); err = kvm_set_user_memory_region(s, mem);