From: Paolo Bonzini <pbonzini@redhat.com>
To: Luiz Capitulino <lcapitulino@redhat.com>
Cc: "Justen, Jordan L" <jordan.l.justen@intel.com>,
Jordan Justen <jljusten@gmail.com>,
qemu-devel <qemu-devel@nongnu.org>,
Xiao Guangrong <xiaoguangrong@linux.vnet.ibm.com>
Subject: Re: [Qemu-devel] [BUG]: kvm_set_phys_mem: error unregistering overlapping slot: Invalid argument
Date: Thu, 30 May 2013 20:05:29 +0200 [thread overview]
Message-ID: <51A794E9.6090709@redhat.com> (raw)
In-Reply-To: <20130530135642.15040dde@redhat.com>
Il 30/05/2013 19:56, Luiz Capitulino ha scritto:
> On Thu, 30 May 2013 10:32:36 -0700
> Jordan Justen <jljusten@gmail.com> wrote:
>
>> On Thu, May 30, 2013 at 10:03 AM, Luiz Capitulino
>> <lcapitulino@redhat.com> wrote:
>>> On Thu, 30 May 2013 09:50:10 -0700
>>> Jordan Justen <jljusten@gmail.com> wrote:
>>>> On Thu, May 30, 2013 at 9:08 AM, Luiz Capitulino <lcapitulino@redhat.com> wrote:
>>>>> On Thu, 30 May 2013 18:03:04 +0200
>>>>> Paolo Bonzini <pbonzini@redhat.com> wrote:
>>>>>
>>>>>> Il 30/05/2013 17:46, Luiz Capitulino ha scritto:
>>>>>>> The culprit is commit:
>>>>>>>
>>>>>>> commit 235e8982ad393e5611cb892df54881c872eea9e1
>>>>>>> Author: Jordan Justen <jordan.l.justen@intel.com>
>>>>>>> Date: Wed May 29 01:27:26 2013 -0700
>>>>>>>
>>>>>>> kvm: support using KVM_MEM_READONLY flag for regions
>>>>>>>
>>>>>>> I'm running 3.9.2-200.fc18, btw. And, error checking is missing on the
>>>>>>> first call to kvm_vm_ioctl().
>>>>
>>>> As noted in the code, the first call is for KVM commit 75d61fbc.
>>>>
>>>> I'm not sure we want to fail if an error occurs when making that call.
>>>> (I'm pretty sure we don't want to in fact.)
>>>>
>>>> Xiao, any thoughts?
>>>>
>>>>>> Reproducer?
>>>>>
>>>>> I just try to start a VM (HEAD 87d23f7):
>>>>>
>>>>> ~/work/virt/ sudo ./qemu-qmp -drive file=disks/test.img,if=virtio,cache=none,aio=native -enable-kvm -m 1G -monitor stdio -cpu host -snapshot
>>>>> QEMU 1.5.50 monitor - type 'help' for more information
>>>>> (qemu) kvm_set_phys_mem: error unregistering overlapping slot: Invalid argument
>>>>> ~/work/virt/
>>>>
>>>> Sorry. I am working with Linux 3.8.0, and I don't see this. I'll try
>>>> to update my kernel.
>>>>
>>>> Does the firmware behave as a ROM for you?
>>>
>>> I think so:
>>>
>>> (qemu) info roms
>>> fw=genroms/kvmvapic.bin size=0x002400 name="kvmvapic.bin"
>>> addr=00000000fffe0000 size=0x020000 mem=rom name="bios.bin"
>>> (qemu)
>>>
>>> Is this what you're asking?
>>
>> I guess I was meaning ... if you write to an address such as
>> 0xfffffff0, does it update as RAM, or does it retain the original
>> value?
>>
>> This is easy to test in OVMF at the EFI shell, but I'm not sure how
>> you could easily test it otherwise.
>
> I could try to hack something, but maybe not today.
Just put a breakpoint on pflash_cfi01_register and see if it is reached.
I cannot reproduce it, but I'm also on 3.8.x. Will look at it tomorrow.
Paolo
>> Does the system actually boot for you after the error message?
>
> No, I get an abort. That's what kvm_set_phys_mem() does when
> kvm_set_user_memory_region() fails:
>
> (gdb) bt
> #0 0x00007f01f8592ba5 in __GI_raise (sig=sig@entry=6) at ../nptl/sysdeps/unix/sysv/linux/raise.c:63
> #1 0x00007f01f8594358 in __GI_abort () at abort.c:90
> #2 0x00007f01fedb57f1 in kvm_set_phys_mem (section=0x7f01ee6975d0, add=false) at /home/lcapitulino/work/src/upstream/qmp-unstable/kvm-all.c:692
> #3 0x00007f01fedb5bfa in kvm_region_del (listener=0x7f01ff2bc360 <kvm_memory_listener>, section=0x7f01ee6975d0) at /home/lcapitulino/work/src/upstream/qmp-unstable/kvm-all.c:795
> #4 0x00007f01fedbc92d in address_space_update_topology_pass (as=0x7f01ffadfa60 <address_space_memory>, old_view=..., new_view=..., adding=false) at /home/lcapitulino/work/src/upstream/qmp-unstable/memory.c:689
> #5 0x00007f01fedbd125 in address_space_update_topology (as=0x7f01ffadfa60 <address_space_memory>) at /home/lcapitulino/work/src/upstream/qmp-unstable/memory.c:725
> #6 0x00007f01fedbd29c in memory_region_transaction_commit () at /home/lcapitulino/work/src/upstream/qmp-unstable/memory.c:750
> #7 0x00007f01fec1b977 in i440fx_update_memory_mappings (d=0x7f0200511940) at /home/lcapitulino/work/src/upstream/qmp-unstable/hw/pci-host/piix.c:131
> #8 0x00007f01fec1bab3 in i440fx_write_config (dev=0x7f0200511940, address=94, val=51, len=1) at /home/lcapitulino/work/src/upstream/qmp-unstable/hw/pci-host/piix.c:154
> #9 0x00007f01fec29a9a in pci_host_config_write_common (pci_dev=0x7f0200511940, addr=94, limit=256, val=51, len=1) at /home/lcapitulino/work/src/upstream/qmp-unstable/hw/pci/pci_host.c:54
> #10 0x00007f01fec29ba2 in pci_data_write (s=0x7f0200502a50, addr=2147483742, val=51, len=1) at /home/lcapitulino/work/src/upstream/qmp-unstable/hw/pci/pci_host.c:75
> #11 0x00007f01fec29d5e in pci_host_data_write (opaque=0x7f02004fa1c0, addr=2, val=51, len=1) at /home/lcapitulino/work/src/upstream/qmp-unstable/hw/pci/pci_host.c:128
> #12 0x00007f01fedbac6e in memory_region_write_accessor (opaque=0x7f02004fc598, addr=2, value=0x7f01ee697a70, size=1, shift=0, mask=255) at /home/lcapitulino/work/src/upstream/qmp-unstable/memory.c:334
> #13 0x00007f01fedbad50 in access_with_adjusted_size (addr=2, value=0x7f01ee697a70, size=1, access_size_min=1, access_size_max=4, access=0x7f01fedbabe9 <memory_region_write_accessor>, opaque=0x7f02004fc598)
> at /home/lcapitulino/work/src/upstream/qmp-unstable/memory.c:364
> #14 0x00007f01fedbb1b8 in memory_region_iorange_write (iorange=0x7f0200503550, offset=2, width=1, data=51) at /home/lcapitulino/work/src/upstream/qmp-unstable/memory.c:439
> #15 0x00007f01fedb33aa in ioport_writeb_thunk (opaque=0x7f0200503550, addr=3326, data=51) at /home/lcapitulino/work/src/upstream/qmp-unstable/ioport.c:212
> #16 0x00007f01fedb2d84 in ioport_write (index=0, address=3326, data=51) at /home/lcapitulino/work/src/upstream/qmp-unstable/ioport.c:83
> #17 0x00007f01fedb3924 in cpu_outb (addr=3326, val=51 '3') at /home/lcapitulino/work/src/upstream/qmp-unstable/ioport.c:289
> #18 0x00007f01fedb76c5 in kvm_handle_io (port=3326, data=0x7f01fea6e000, direction=1, size=1, count=1) at /home/lcapitulino/work/src/upstream/qmp-unstable/kvm-all.c:1507
> #19 0x00007f01fedb7d59 in kvm_cpu_exec (env=0x7f02004e24e0) at /home/lcapitulino/work/src/upstream/qmp-unstable/kvm-all.c:1659
> #20 0x00007f01fed3dc3f in qemu_kvm_cpu_thread_fn (arg=0x7f02004e24e0) at /home/lcapitulino/work/src/upstream/qmp-unstable/cpus.c:759
> #21 0x00007f01fcf02d15 in start_thread (arg=0x7f01ee698700) at pthread_create.c:308
> #22 0x00007f01f864f48d in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:114
> (gdb)
>
next prev parent reply other threads:[~2013-05-30 18:06 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-05-30 15:46 [Qemu-devel] [BUG]: kvm_set_phys_mem: error unregistering overlapping slot: Invalid argument Luiz Capitulino
2013-05-30 16:03 ` Paolo Bonzini
2013-05-30 16:08 ` Luiz Capitulino
2013-05-30 16:50 ` Jordan Justen
2013-05-30 17:03 ` Luiz Capitulino
2013-05-30 17:32 ` Jordan Justen
2013-05-30 17:56 ` Luiz Capitulino
2013-05-30 18:05 ` Paolo Bonzini [this message]
2013-05-30 20:32 ` Luiz Capitulino
2013-05-30 21:23 ` Paolo Bonzini
2013-05-30 23:43 ` Jordan Justen
2013-05-31 6:51 ` Xiao Guangrong
2013-05-31 7:14 ` Jordan Justen
2013-05-31 8:01 ` Jordan Justen
2013-05-31 8:23 ` Paolo Bonzini
2013-05-31 8:52 ` [Qemu-devel] [PATCH uq/master] fix double free the memslot in kvm_set_phys_mem Xiao Guangrong
2013-05-31 12:27 ` Paolo Bonzini
2013-05-31 12:39 ` Luiz Capitulino
2013-06-02 17:35 ` Richard W.M. Jones
2013-06-02 22:08 ` Jordan Justen
2013-06-03 6:57 ` Gleb Natapov
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=51A794E9.6090709@redhat.com \
--to=pbonzini@redhat.com \
--cc=jljusten@gmail.com \
--cc=jordan.l.justen@intel.com \
--cc=lcapitulino@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=xiaoguangrong@linux.vnet.ibm.com \
/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;
as well as URLs for NNTP newsgroup(s).