* Re: [Qemu-devel] KVM internal error with some amounts of guest memory
[not found] <4FDA3A04.2000005@msgid.tls.msk.ru>
@ 2012-06-14 19:45 ` Michael Tokarev
2012-06-14 20:06 ` Michael Tokarev
0 siblings, 1 reply; 3+ messages in thread
From: Michael Tokarev @ 2012-06-14 19:45 UTC (permalink / raw)
To: KVM list; +Cc: qemu-devel
On 14.06.2012 23:22, Michael Tokarev wrote:
> Now that's something else. Reported by a debian user, but
> trivially reproducible.
>
> $ kvm -m 1.4g
> KVM internal error. Suberror: 1
> emulation failure
> EAX=000e3c54 EBX=00000000 ECX=00000000 EDX=00000cfd
> ESI=00000000 EDI=00000000 EBP=00000000 ESP=00006fe8
> EIP=000f309b EFL=00000016 [----AP-] CPL=0 II=0 A20=1 SMM=0 HLT=0
> ES =0010 00000000 ffffffff 00c09300 DPL=0 DS [-WA]
> CS =0008 00000000 ffffffff 00c09b00 DPL=0 CS32 [-RA]
> SS =0010 00000000 ffffffff 00c09300 DPL=0 DS [-WA]
> DS =0010 00000000 ffffffff 00c09300 DPL=0 DS [-WA]
> FS =0010 00000000 ffffffff 00c09300 DPL=0 DS [-WA]
> GS =0010 00000000 ffffffff 00c09300 DPL=0 DS [-WA]
> LDT=0000 00000000 0000ffff 00008200 DPL=0 LDT
> TR =0000 00000000 0000ffff 00008b00 DPL=0 TSS32-busy
> GDT= 000fd3a8 00000037
> IDT= 000fd3e6 00000000
> CR0=00000011 CR2=00000000 CR3=00000000 CR4=00000000
> DR0=0000000000000000 DR1=0000000000000000 DR2=0000000000000000 DR3=0000000000000000
> DR6=00000000ffff0ff0 DR7=0000000000000400
> EFER=0000000000000000
> Code=ff ff ba 59 00 00 00 a8 10 89 d8 75 09 b9 ef 2f ff ff ff d1 <eb> 23 59 5b 5e e9 4a ff ff ff 31 d2 89 f0 e8 6c fa ff ff 89 c6 85 c0 79 ab c7 04 24 8c 4c
>
> This is 1.1.
Qemu 1.1 with -enable-kvm also has this very issue. Switching to qemu-devel@.
> -m 1.5g works. -no-kvm works.
I can trivially reproduce this on two machines, both are AMD-based. I don't
know if it is amd-specific or not.
/mjt
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [Qemu-devel] KVM internal error with some amounts of guest memory
2012-06-14 19:45 ` [Qemu-devel] KVM internal error with some amounts of guest memory Michael Tokarev
@ 2012-06-14 20:06 ` Michael Tokarev
2012-06-17 8:25 ` Avi Kivity
0 siblings, 1 reply; 3+ messages in thread
From: Michael Tokarev @ 2012-06-14 20:06 UTC (permalink / raw)
To: Avi Kivity; +Cc: qemu-devel, KVM list
On 14.06.2012 23:45, Michael Tokarev wrote:
> On 14.06.2012 23:22, Michael Tokarev wrote:
>> Now that's something else. Reported by a debian user, but
>> trivially reproducible.
>>
>> $ kvm -m 1.4g
>> KVM internal error. Suberror: 1
>> emulation failure
>> EAX=000e3c54 EBX=00000000 ECX=00000000 EDX=00000cfd
>> ESI=00000000 EDI=00000000 EBP=00000000 ESP=00006fe8
>> EIP=000f309b EFL=00000016 [----AP-] CPL=0 II=0 A20=1 SMM=0 HLT=0
>> ES =0010 00000000 ffffffff 00c09300 DPL=0 DS [-WA]
>> CS =0008 00000000 ffffffff 00c09b00 DPL=0 CS32 [-RA]
>> SS =0010 00000000 ffffffff 00c09300 DPL=0 DS [-WA]
>> DS =0010 00000000 ffffffff 00c09300 DPL=0 DS [-WA]
>> FS =0010 00000000 ffffffff 00c09300 DPL=0 DS [-WA]
>> GS =0010 00000000 ffffffff 00c09300 DPL=0 DS [-WA]
>> LDT=0000 00000000 0000ffff 00008200 DPL=0 LDT
>> TR =0000 00000000 0000ffff 00008b00 DPL=0 TSS32-busy
>> GDT= 000fd3a8 00000037
>> IDT= 000fd3e6 00000000
>> CR0=00000011 CR2=00000000 CR3=00000000 CR4=00000000
>> DR0=0000000000000000 DR1=0000000000000000 DR2=0000000000000000 DR3=0000000000000000
>> DR6=00000000ffff0ff0 DR7=0000000000000400
>> EFER=0000000000000000
>> Code=ff ff ba 59 00 00 00 a8 10 89 d8 75 09 b9 ef 2f ff ff ff d1 <eb> 23 59 5b 5e e9 4a ff ff ff 31 d2 89 f0 e8 6c fa ff ff 89 c6 85 c0 79 ab c7 04 24 8c 4c
Bisected.
This is introduced by this commit:
8f6f962b994e1402935055ac7093ac977ccc9a5c is the first bad commit
commit 8f6f962b994e1402935055ac7093ac977ccc9a5c
Author: Avi Kivity <avi@redhat.com>
Date: Wed Feb 29 13:22:12 2012 +0200
kvm: fix unaligned slots
kvm_set_phys_mem() may be passed sections that are not aligned to a page
boundary. The current code simply brute-forces the alignment which leads
to an inconsistency and an abort().
Fix by aligning the start and the end of the section correctly, discarding
and unaligned head or tail.
This was triggered by a guest sizing a 64-bit BAR that is smaller than a page
with PCI_COMMAND_MEMORY enabled and the upper dword clear.
Signed-off-by: Avi Kivity <avi@redhat.com>
:100644 100644 c4babdac0dd3335eab1a9e45371b7df2c0dd1c9c 4b7a4ae5dd6d9bd0b4cfa37159382654f0641e8d M kvm-all.c
Once again, this affects both qemu-kvm and qemu (with -enable-kvm) 1.1,
at least on AMD host, and the issue gets reported immediately when
starting the virtual machine with -m 1.4g (no other arguments).
Thanks,
/mjt
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [Qemu-devel] KVM internal error with some amounts of guest memory
2012-06-14 20:06 ` Michael Tokarev
@ 2012-06-17 8:25 ` Avi Kivity
0 siblings, 0 replies; 3+ messages in thread
From: Avi Kivity @ 2012-06-17 8:25 UTC (permalink / raw)
To: Michael Tokarev; +Cc: qemu-devel, KVM list
On 06/14/2012 11:06 PM, Michael Tokarev wrote:
> On 14.06.2012 23:45, Michael Tokarev wrote:
>> On 14.06.2012 23:22, Michael Tokarev wrote:
>>> Now that's something else. Reported by a debian user, but
>>> trivially reproducible.
>>>
>>> $ kvm -m 1.4g
>>> KVM internal error. Suberror: 1
>>> emulation failure
>>> EAX=000e3c54 EBX=00000000 ECX=00000000 EDX=00000cfd
>>> ESI=00000000 EDI=00000000 EBP=00000000 ESP=00006fe8
>>> EIP=000f309b EFL=00000016 [----AP-] CPL=0 II=0 A20=1 SMM=0 HLT=0
>>> ES =0010 00000000 ffffffff 00c09300 DPL=0 DS [-WA]
>>> CS =0008 00000000 ffffffff 00c09b00 DPL=0 CS32 [-RA]
>>> SS =0010 00000000 ffffffff 00c09300 DPL=0 DS [-WA]
>>> DS =0010 00000000 ffffffff 00c09300 DPL=0 DS [-WA]
>>> FS =0010 00000000 ffffffff 00c09300 DPL=0 DS [-WA]
>>> GS =0010 00000000 ffffffff 00c09300 DPL=0 DS [-WA]
>>> LDT=0000 00000000 0000ffff 00008200 DPL=0 LDT
>>> TR =0000 00000000 0000ffff 00008b00 DPL=0 TSS32-busy
>>> GDT= 000fd3a8 00000037
>>> IDT= 000fd3e6 00000000
>>> CR0=00000011 CR2=00000000 CR3=00000000 CR4=00000000
>>> DR0=0000000000000000 DR1=0000000000000000 DR2=0000000000000000 DR3=0000000000000000
>>> DR6=00000000ffff0ff0 DR7=0000000000000400
>>> EFER=0000000000000000
>>> Code=ff ff ba 59 00 00 00 a8 10 89 d8 75 09 b9 ef 2f ff ff ff d1 <eb> 23 59 5b 5e e9 4a ff ff ff 31 d2 89 f0 e8 6c fa ff ff 89 c6 85 c0 79 ab c7 04 24 8c 4c
>
> Bisected.
>
> This is introduced by this commit:
>
> 8f6f962b994e1402935055ac7093ac977ccc9a5c is the first bad commit
> commit 8f6f962b994e1402935055ac7093ac977ccc9a5c
> Author: Avi Kivity <avi@redhat.com>
> Date: Wed Feb 29 13:22:12 2012 +0200
>
> kvm: fix unaligned slots
>
> kvm_set_phys_mem() may be passed sections that are not aligned to a page
> boundary. The current code simply brute-forces the alignment which leads
> to an inconsistency and an abort().
>
> Fix by aligning the start and the end of the section correctly, discarding
> and unaligned head or tail.
>
> This was triggered by a guest sizing a 64-bit BAR that is smaller than a page
> with PCI_COMMAND_MEMORY enabled and the upper dword clear.
>
> Signed-off-by: Avi Kivity <avi@redhat.com>
>
> :100644 100644 c4babdac0dd3335eab1a9e45371b7df2c0dd1c9c 4b7a4ae5dd6d9bd0b4cfa37159382654f0641e8d M kvm-all.c
>
> Once again, this affects both qemu-kvm and qemu (with -enable-kvm) 1.1,
> at least on AMD host, and the issue gets reported immediately when
> starting the virtual machine with -m 1.4g (no other arguments).
Thanks for the clear report. The problem is that 1.4g is not aligned on
a page boundary (in fact it's not even aligned to a byte boundary), and
some bios code tries to execute off the partial page at the end. kvm
doesn't support executing off partial pages, hence the breakage.
The proper fix is to align the memory size, but how? upwards or
downwards? To a page boundary or something larger?
--
error compiling committee.c: too many arguments to function
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2012-06-17 8:25 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <4FDA3A04.2000005@msgid.tls.msk.ru>
2012-06-14 19:45 ` [Qemu-devel] KVM internal error with some amounts of guest memory Michael Tokarev
2012-06-14 20:06 ` Michael Tokarev
2012-06-17 8:25 ` Avi Kivity
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).