* [Qemu-devel] QEMU aborts since "kvm: support using KVM_MEM_READONLY flag for regions"
@ 2013-06-03 17:23 Peter Wu
2013-06-03 17:35 ` Jordan Justen
2013-06-03 17:49 ` Anthony Liguori
0 siblings, 2 replies; 7+ messages in thread
From: Peter Wu @ 2013-06-03 17:23 UTC (permalink / raw)
To: Jordan Justen, qemu-devel; +Cc: Paolo Bonzini, Anthony Liguori, Xiao Guangrong
Hi,
With the current git source (f10acc8b38d65a66ffa0588a036489d7fa6a593e),
`qemu-system-x86_64 -enable-kvm` fails to run with the following error:
kvm_set_phys_mem: error unregistering overlapping slot: Invalid argument
After this message, qemu aborts. Reverting the following commit on top of
master makes the bug go away. Removing the `-enable-kvm` option also
allows QEMU to operate, but without KVM.
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
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.
For rom devices with !romd_mode, we force the slot to be
removed so reads or writes to the region will exit to qemu.
(Note that a memory region in this state is not executable
within kvm.)
QEMU was built using GCC 4.8.0, runs on Arch Linux 64-bit with a
custom kernel, Linux 3.9.1. CPU: i5-460M. A backtrace is provided
on the bottom of this message. If you need more details, please ask.
Regards,
Peter
#0 0x00007ffff1a251c9 in raise () from /usr/lib/libc.so.6
#1 0x00007ffff1a265c8 in abort () from /usr/lib/libc.so.6
#2 0x00005555557dd84d in kvm_set_phys_mem (section=0x7fffe6fdca00, add=false) at /tmp/qemu/kvm-all.c:715
#3 0x00005555557e132c in address_space_update_topology_pass (as=as@entry=0x5555564dae00 <address_space_memory>, adding=adding@entry=false, old_view=..., new_view=...) at /tmp/qemu/memory.c:725
#4 0x00005555557e1f13 in address_space_update_topology (as=0x5555564dae00 <address_space_memory>) at /tmp/qemu/memory.c:761
#5 memory_region_transaction_commit () at /tmp/qemu/memory.c:786
#6 0x00005555557dfa42 in access_with_adjusted_size (addr=addr@entry=2, value=value@entry=0x7fffe6fdcc18, size=1, access_size_min=<optimized out>, access_size_max=<optimized out>,
access=access@entry=0x5555557e0000 <memory_region_write_accessor>, opaque=opaque@entry=0x55555658c238) at /tmp/qemu/memory.c:399
#7 0x00005555557e0f77 in memory_region_iorange_write (iorange=<optimized out>, offset=2, width=1, data=51) at /tmp/qemu/memory.c:475
#8 0x00005555557de562 in kvm_handle_io (count=1, size=1, direction=1, data=<optimized out>, port=3326) at /tmp/qemu/kvm-all.c:1507
#9 kvm_cpu_exec (env=env@entry=0x55555656f750) at /tmp/qemu/kvm-all.c:1659
#10 0x000055555578da05 in qemu_kvm_cpu_thread_fn (arg=0x55555656f750) at /tmp/qemu/cpus.c:759
#11 0x00007ffff6280dd2 in start_thread () from /usr/lib/libpthread.so.0
#12 0x00007ffff1ad5cdd in clone () from /usr/lib/libc.so.6
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [Qemu-devel] QEMU aborts since "kvm: support using KVM_MEM_READONLY flag for regions"
2013-06-03 17:23 [Qemu-devel] QEMU aborts since "kvm: support using KVM_MEM_READONLY flag for regions" Peter Wu
@ 2013-06-03 17:35 ` Jordan Justen
2013-06-03 18:02 ` Peter Wu
2013-06-03 17:49 ` Anthony Liguori
1 sibling, 1 reply; 7+ messages in thread
From: Jordan Justen @ 2013-06-03 17:35 UTC (permalink / raw)
To: Peter Wu
Cc: Jordan Justen, Anthony Liguori, Xiao Guangrong, qemu-devel,
Paolo Bonzini
This should be fixed by Xiao's "fix double free the memslot in
kvm_set_phys_mem" patch.
On Mon, Jun 3, 2013 at 10:23 AM, Peter Wu <lekensteyn@gmail.com> wrote:
> Hi,
>
> With the current git source (f10acc8b38d65a66ffa0588a036489d7fa6a593e),
> `qemu-system-x86_64 -enable-kvm` fails to run with the following error:
>
> kvm_set_phys_mem: error unregistering overlapping slot: Invalid argument
>
> After this message, qemu aborts. Reverting the following commit on top of
> master makes the bug go away. Removing the `-enable-kvm` option also
> allows QEMU to operate, but without KVM.
>
> 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
>
> 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.
>
> For rom devices with !romd_mode, we force the slot to be
> removed so reads or writes to the region will exit to qemu.
> (Note that a memory region in this state is not executable
> within kvm.)
>
> QEMU was built using GCC 4.8.0, runs on Arch Linux 64-bit with a
> custom kernel, Linux 3.9.1. CPU: i5-460M. A backtrace is provided
> on the bottom of this message. If you need more details, please ask.
>
> Regards,
> Peter
>
> #0 0x00007ffff1a251c9 in raise () from /usr/lib/libc.so.6
> #1 0x00007ffff1a265c8 in abort () from /usr/lib/libc.so.6
> #2 0x00005555557dd84d in kvm_set_phys_mem (section=0x7fffe6fdca00, add=false) at /tmp/qemu/kvm-all.c:715
> #3 0x00005555557e132c in address_space_update_topology_pass (as=as@entry=0x5555564dae00 <address_space_memory>, adding=adding@entry=false, old_view=..., new_view=...) at /tmp/qemu/memory.c:725
> #4 0x00005555557e1f13 in address_space_update_topology (as=0x5555564dae00 <address_space_memory>) at /tmp/qemu/memory.c:761
> #5 memory_region_transaction_commit () at /tmp/qemu/memory.c:786
> #6 0x00005555557dfa42 in access_with_adjusted_size (addr=addr@entry=2, value=value@entry=0x7fffe6fdcc18, size=1, access_size_min=<optimized out>, access_size_max=<optimized out>,
> access=access@entry=0x5555557e0000 <memory_region_write_accessor>, opaque=opaque@entry=0x55555658c238) at /tmp/qemu/memory.c:399
> #7 0x00005555557e0f77 in memory_region_iorange_write (iorange=<optimized out>, offset=2, width=1, data=51) at /tmp/qemu/memory.c:475
> #8 0x00005555557de562 in kvm_handle_io (count=1, size=1, direction=1, data=<optimized out>, port=3326) at /tmp/qemu/kvm-all.c:1507
> #9 kvm_cpu_exec (env=env@entry=0x55555656f750) at /tmp/qemu/kvm-all.c:1659
> #10 0x000055555578da05 in qemu_kvm_cpu_thread_fn (arg=0x55555656f750) at /tmp/qemu/cpus.c:759
> #11 0x00007ffff6280dd2 in start_thread () from /usr/lib/libpthread.so.0
> #12 0x00007ffff1ad5cdd in clone () from /usr/lib/libc.so.6
>
>
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [Qemu-devel] QEMU aborts since "kvm: support using KVM_MEM_READONLY flag for regions"
2013-06-03 17:23 [Qemu-devel] QEMU aborts since "kvm: support using KVM_MEM_READONLY flag for regions" Peter Wu
2013-06-03 17:35 ` Jordan Justen
@ 2013-06-03 17:49 ` Anthony Liguori
2013-06-03 20:11 ` Paolo Bonzini
1 sibling, 1 reply; 7+ messages in thread
From: Anthony Liguori @ 2013-06-03 17:49 UTC (permalink / raw)
To: Peter Wu, Jordan Justen, qemu-devel; +Cc: Paolo Bonzini, Xiao Guangrong
Peter Wu <lekensteyn@gmail.com> writes:
> Hi,
>
> With the current git source (f10acc8b38d65a66ffa0588a036489d7fa6a593e),
> `qemu-system-x86_64 -enable-kvm` fails to run with the following error:
>
> kvm_set_phys_mem: error unregistering overlapping slot: Invalid argument
>
> After this message, qemu aborts. Reverting the following commit on top of
> master makes the bug go away. Removing the `-enable-kvm` option also
> allows QEMU to operate, but without KVM.
I also noted this on F19 this weekend.
Is anyone else seeing this on more recent kernels?
Regards,
Anthony Liguori
>
> 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
>
> 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.
>
> For rom devices with !romd_mode, we force the slot to be
> removed so reads or writes to the region will exit to qemu.
> (Note that a memory region in this state is not executable
> within kvm.)
>
> QEMU was built using GCC 4.8.0, runs on Arch Linux 64-bit with a
> custom kernel, Linux 3.9.1. CPU: i5-460M. A backtrace is provided
> on the bottom of this message. If you need more details, please ask.
>
> Regards,
> Peter
>
> #0 0x00007ffff1a251c9 in raise () from /usr/lib/libc.so.6
> #1 0x00007ffff1a265c8 in abort () from /usr/lib/libc.so.6
> #2 0x00005555557dd84d in kvm_set_phys_mem (section=0x7fffe6fdca00, add=false) at /tmp/qemu/kvm-all.c:715
> #3 0x00005555557e132c in address_space_update_topology_pass (as=as@entry=0x5555564dae00 <address_space_memory>, adding=adding@entry=false, old_view=..., new_view=...) at /tmp/qemu/memory.c:725
> #4 0x00005555557e1f13 in address_space_update_topology (as=0x5555564dae00 <address_space_memory>) at /tmp/qemu/memory.c:761
> #5 memory_region_transaction_commit () at /tmp/qemu/memory.c:786
> #6 0x00005555557dfa42 in access_with_adjusted_size (addr=addr@entry=2, value=value@entry=0x7fffe6fdcc18, size=1, access_size_min=<optimized out>, access_size_max=<optimized out>,
> access=access@entry=0x5555557e0000 <memory_region_write_accessor>, opaque=opaque@entry=0x55555658c238) at /tmp/qemu/memory.c:399
> #7 0x00005555557e0f77 in memory_region_iorange_write (iorange=<optimized out>, offset=2, width=1, data=51) at /tmp/qemu/memory.c:475
> #8 0x00005555557de562 in kvm_handle_io (count=1, size=1, direction=1, data=<optimized out>, port=3326) at /tmp/qemu/kvm-all.c:1507
> #9 kvm_cpu_exec (env=env@entry=0x55555656f750) at /tmp/qemu/kvm-all.c:1659
> #10 0x000055555578da05 in qemu_kvm_cpu_thread_fn (arg=0x55555656f750) at /tmp/qemu/cpus.c:759
> #11 0x00007ffff6280dd2 in start_thread () from /usr/lib/libpthread.so.0
> #12 0x00007ffff1ad5cdd in clone () from /usr/lib/libc.so.6
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [Qemu-devel] QEMU aborts since "kvm: support using KVM_MEM_READONLY flag for regions"
2013-06-03 17:35 ` Jordan Justen
@ 2013-06-03 18:02 ` Peter Wu
0 siblings, 0 replies; 7+ messages in thread
From: Peter Wu @ 2013-06-03 18:02 UTC (permalink / raw)
To: Jordan Justen
Cc: Jordan Justen, Anthony Liguori, Xiao Guangrong, qemu-devel,
Paolo Bonzini
On Monday 03 June 2013 10:35:28 Jordan Justen wrote:
> This should be fixed by Xiao's "fix double free the memslot in
> kvm_set_phys_mem" patch.
Confirmed, with this one-liner patch the bug is gone.
> On Mon, Jun 3, 2013 at 10:23 AM, Peter Wu <lekensteyn@gmail.com> wrote:
> > Hi,
> >
> > With the current git source (f10acc8b38d65a66ffa0588a036489d7fa6a593e),
> >
> > `qemu-system-x86_64 -enable-kvm` fails to run with the following error:
> > kvm_set_phys_mem: error unregistering overlapping slot: Invalid
> > argument
> >
> > After this message, qemu aborts. Reverting the following commit on top of
> > master makes the bug go away. Removing the `-enable-kvm` option also
> > allows QEMU to operate, but without KVM.
> >
> > 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
> >
> > 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.
> >
> > For rom devices with !romd_mode, we force the slot to be
> > removed so reads or writes to the region will exit to qemu.
> > (Note that a memory region in this state is not executable
> > within kvm.)
> >
> > QEMU was built using GCC 4.8.0, runs on Arch Linux 64-bit with a
> > custom kernel, Linux 3.9.1. CPU: i5-460M. A backtrace is provided
> > on the bottom of this message. If you need more details, please ask.
> >
> > Regards,
> > Peter
> >
> > #0 0x00007ffff1a251c9 in raise () from /usr/lib/libc.so.6
> > #1 0x00007ffff1a265c8 in abort () from /usr/lib/libc.so.6
> > #2 0x00005555557dd84d in kvm_set_phys_mem (section=0x7fffe6fdca00,
> > add=false) at /tmp/qemu/kvm-all.c:715 #3 0x00005555557e132c in
> > address_space_update_topology_pass (as=as@entry=0x5555564dae00
> > <address_space_memory>, adding=adding@entry=false, old_view=...,
> > new_view=...) at /tmp/qemu/memory.c:725 #4 0x00005555557e1f13 in
> > address_space_update_topology (as=0x5555564dae00 <address_space_memory>)
> > at /tmp/qemu/memory.c:761 #5 memory_region_transaction_commit () at
> > /tmp/qemu/memory.c:786
> > #6 0x00005555557dfa42 in access_with_adjusted_size (addr=addr@entry=2,
> > value=value@entry=0x7fffe6fdcc18, size=1, access_size_min=<optimized
> > out>, access_size_max=<optimized out>,>
> > access=access@entry=0x5555557e0000 <memory_region_write_accessor>,
> > opaque=opaque@entry=0x55555658c238) at /tmp/qemu/memory.c:399>
> > #7 0x00005555557e0f77 in memory_region_iorange_write (iorange=<optimized
> > out>, offset=2, width=1, data=51) at /tmp/qemu/memory.c:475 #8
> > 0x00005555557de562 in kvm_handle_io (count=1, size=1, direction=1,
> > data=<optimized out>, port=3326) at /tmp/qemu/kvm-all.c:1507 #9
> > kvm_cpu_exec (env=env@entry=0x55555656f750) at /tmp/qemu/kvm-all.c:1659
> > #10 0x000055555578da05 in qemu_kvm_cpu_thread_fn (arg=0x55555656f750) at
> > /tmp/qemu/cpus.c:759 #11 0x00007ffff6280dd2 in start_thread () from
> > /usr/lib/libpthread.so.0 #12 0x00007ffff1ad5cdd in clone () from
> > /usr/lib/libc.so.6
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [Qemu-devel] QEMU aborts since "kvm: support using KVM_MEM_READONLY flag for regions"
2013-06-03 17:49 ` Anthony Liguori
@ 2013-06-03 20:11 ` Paolo Bonzini
2013-06-03 20:20 ` Anthony Liguori
0 siblings, 1 reply; 7+ messages in thread
From: Paolo Bonzini @ 2013-06-03 20:11 UTC (permalink / raw)
To: Anthony Liguori
Cc: Jordan Justen, Peter Wu, qemu-devel, Gleb Natapov, Xiao Guangrong
Il 03/06/2013 19:49, Anthony Liguori ha scritto:
> Peter Wu <lekensteyn@gmail.com> writes:
>
>> Hi,
>>
>> With the current git source (f10acc8b38d65a66ffa0588a036489d7fa6a593e),
>> `qemu-system-x86_64 -enable-kvm` fails to run with the following error:
>>
>> kvm_set_phys_mem: error unregistering overlapping slot: Invalid argument
>>
>> After this message, qemu aborts. Reverting the following commit on top of
>> master makes the bug go away. Removing the `-enable-kvm` option also
>> allows QEMU to operate, but without KVM.
>
> I also noted this on F19 this weekend.
>
> Is anyone else seeing this on more recent kernels?
Yes, it's caused by 3.9. Gleb and I decided to consider this (raising
an error when removing a non-existent slot) a feature since it never
happened as far as we know on released versions of QEMU/nlkt/whatever.
Gleb queued a patch in uq/master, I think he'll be sending a pull
request soon.
Paolo
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [Qemu-devel] QEMU aborts since "kvm: support using KVM_MEM_READONLY flag for regions"
2013-06-03 20:11 ` Paolo Bonzini
@ 2013-06-03 20:20 ` Anthony Liguori
2013-06-04 6:39 ` Gleb Natapov
0 siblings, 1 reply; 7+ messages in thread
From: Anthony Liguori @ 2013-06-03 20:20 UTC (permalink / raw)
To: Paolo Bonzini
Cc: Jordan Justen, Peter Wu, qemu-devel, Gleb Natapov, Xiao Guangrong
Paolo Bonzini <pbonzini@redhat.com> writes:
> Il 03/06/2013 19:49, Anthony Liguori ha scritto:
>> Peter Wu <lekensteyn@gmail.com> writes:
>>
>>> Hi,
>>>
>>> With the current git source (f10acc8b38d65a66ffa0588a036489d7fa6a593e),
>>> `qemu-system-x86_64 -enable-kvm` fails to run with the following error:
>>>
>>> kvm_set_phys_mem: error unregistering overlapping slot: Invalid argument
>>>
>>> After this message, qemu aborts. Reverting the following commit on top of
>>> master makes the bug go away. Removing the `-enable-kvm` option also
>>> allows QEMU to operate, but without KVM.
>>
>> I also noted this on F19 this weekend.
>>
>> Is anyone else seeing this on more recent kernels?
>
> Yes, it's caused by 3.9. Gleb and I decided to consider this (raising
> an error when removing a non-existent slot) a feature since it never
> happened as far as we know on released versions of QEMU/nlkt/whatever.
> Gleb queued a patch in uq/master, I think he'll be sending a pull
> request soon.
Since I suspect Gleb is done for the day, I will apply directly since
this is a pretty major breakage.
Regards,
Anthony Liguori
>
> Paolo
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [Qemu-devel] QEMU aborts since "kvm: support using KVM_MEM_READONLY flag for regions"
2013-06-03 20:20 ` Anthony Liguori
@ 2013-06-04 6:39 ` Gleb Natapov
0 siblings, 0 replies; 7+ messages in thread
From: Gleb Natapov @ 2013-06-04 6:39 UTC (permalink / raw)
To: Anthony Liguori
Cc: Paolo Bonzini, Peter Wu, qemu-devel, Xiao Guangrong,
Jordan Justen
On Mon, Jun 03, 2013 at 03:20:48PM -0500, Anthony Liguori wrote:
> Paolo Bonzini <pbonzini@redhat.com> writes:
>
> > Il 03/06/2013 19:49, Anthony Liguori ha scritto:
> >> Peter Wu <lekensteyn@gmail.com> writes:
> >>
> >>> Hi,
> >>>
> >>> With the current git source (f10acc8b38d65a66ffa0588a036489d7fa6a593e),
> >>> `qemu-system-x86_64 -enable-kvm` fails to run with the following error:
> >>>
> >>> kvm_set_phys_mem: error unregistering overlapping slot: Invalid argument
> >>>
> >>> After this message, qemu aborts. Reverting the following commit on top of
> >>> master makes the bug go away. Removing the `-enable-kvm` option also
> >>> allows QEMU to operate, but without KVM.
> >>
> >> I also noted this on F19 this weekend.
> >>
> >> Is anyone else seeing this on more recent kernels?
> >
> > Yes, it's caused by 3.9. Gleb and I decided to consider this (raising
> > an error when removing a non-existent slot) a feature since it never
> > happened as far as we know on released versions of QEMU/nlkt/whatever.
> > Gleb queued a patch in uq/master, I think he'll be sending a pull
> > request soon.
>
> Since I suspect Gleb is done for the day, I will apply directly since
> this is a pretty major breakage.
>
Heh, since patch was on the list for 3 days before I picked it (was traveling
before that) I thought I can spend one day more for testing before
sending pull request :) The patch is already queued on uq/master and I'd
rather do not rebase this branch, so I'll push it to you anyway. git
will know how to handle this.
--
Gleb.
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2013-06-04 6:40 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-06-03 17:23 [Qemu-devel] QEMU aborts since "kvm: support using KVM_MEM_READONLY flag for regions" Peter Wu
2013-06-03 17:35 ` Jordan Justen
2013-06-03 18:02 ` Peter Wu
2013-06-03 17:49 ` Anthony Liguori
2013-06-03 20:11 ` Paolo Bonzini
2013-06-03 20:20 ` Anthony Liguori
2013-06-04 6:39 ` Gleb Natapov
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).