From: Xiao Guangrong <guangrong.xiao@linux.intel.com>
To: Janusz <januszmk6@gmail.com>, Paolo Bonzini <pbonzini@redhat.com>,
Wanpeng Li <wanpeng.li@hotmail.com>,
Laszlo Ersek <lersek@redhat.com>,
kvm@vger.kernel.org
Cc: edk2-devel@ml01.01.org
Subject: Re: [edk2] KVM: MTRR: fix memory type handling if MTRR is completely disabled
Date: Tue, 13 Oct 2015 02:20:28 +0800 [thread overview]
Message-ID: <561BF9EC.5060605@linux.intel.com> (raw)
In-Reply-To: <56196FF1.8060902@linux.intel.com>
On 10/11/2015 04:07 AM, Xiao Guangrong wrote:
>
>
> On 10/02/2015 10:38 PM, Janusz wrote:
>> W dniu 01.10.2015 o 16:18, Paolo Bonzini pisze:
>>>
>>> On 01/10/2015 16:12, Janusz wrote:
>>>> Now, I can also add, that the problem is only when I allow VM to use
>>>> more than one core, so with option for example:
>>>> -smp 8,cores=4,threads=2,sockets=1 and other combinations like -smp
>>>> 4,threads=1 its not working, and without it I am always running VM
>>>> without problems
>>>>
>>>> Any ideas what can it be? or any idea what would help to find out what
>>>> is causing this?
>>> I am going to send a revert of the patch tomorrow.
>>>
>>> Paolo
>> Thanks, but revert patch doesn't help, so something else is wrong here
>>
>
> It seems i can reproduce it now ... and finally i get little free time now :(
> I will dig into it and fix it asap.
>
> Thank you, Janusz and Paolo!
I think i have figured out the root case, i got these traces:
<...>-47935 [052] d... 20017.763244: kvm_exit: reason EPT_VIOLATION rip 0xa0000 info 184 0
<...>-47935 [052] .... 20017.763244: kvm_page_fault: address a0000 error_code 184
<...>-47935 [052] .... 20017.763269: mark_mmio_spte: sptep:ffff880841c3d500 gfn a0
access 6 gen fff94
<...>-47935 [052] .... 20017.763272: kvm_mmu_pagetable_walk: addr a0000 pferr 10 F
<...>-47935 [052] .... 20017.763272: kvm_mmu_paging_element: pte bfeff023 level 4
<...>-47935 [052] .... 20017.763273: kvm_mmu_paging_element: pte bff00023 level 3
<...>-47935 [052] .... 20017.763273: kvm_mmu_paging_element: pte e3 level 2
<...>-47935 [052] .... 20017.763274: kvm_emulate_insn: 0:a0000: (prot32)
<...>-47935 [052] .... 20017.763274: kvm_emulate_insn: 0:a0000: (prot32) failed
<...>-
It told me that guest is executing on address 0xa0000 but it is a MMIO address, so KVM
can not emulate it and complained with internal error.
Actually, 0xa0000 is belong to SMRAM (0x30000 is SMRAM base and 0x80000 is EIP offset,
0x30000 + 0x80000 = 0xa0000), however, from QEMU's dump:
EAX=bfefe000 EBX=00000002 ECX=00000000 EDX=00000600
ESI=00000000 EDI=00003eb8 EBP=00000000 ESP=00000000
EIP=000a0000 EFL=00010086 [--S--P-] CPL=0 II=0 A20=1 SMM=0 HLT=0
we see that VCPU is not in SMM.
I dropped some patches (MTRR patches) then this bug can not be trigged so frequently but it
can not completely be avoided :(
I think we need to check OVMF's code to see if there is rare case that SMM hahdler is called
but KVM have not received SMI at that time...
next prev parent reply other threads:[~2015-10-12 18:26 UTC|newest]
Thread overview: 37+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-09-18 9:37 [edk2] KVM: MTRR: fix memory type handling if MTRR is completely disabled Janusz
2015-09-18 10:07 ` Laszlo Ersek
2015-09-18 17:48 ` Janusz
2015-09-21 2:51 ` Xiao Guangrong
2015-09-21 3:30 ` Wanpeng Li
2015-09-21 3:40 ` Xiao Guangrong
2015-10-01 14:12 ` Janusz
2015-10-01 14:18 ` Paolo Bonzini
2015-10-02 14:38 ` Janusz
2015-10-10 20:07 ` Xiao Guangrong
2015-10-12 18:20 ` Xiao Guangrong [this message]
2015-10-12 18:29 ` Xiao Guangrong
2015-10-14 3:58 ` Xiao Guangrong
2015-10-14 7:37 ` Janusz
2015-10-14 8:24 ` Xiao Guangrong
2015-10-14 8:32 ` Xiao Guangrong
2015-10-14 9:13 ` Janusz
2015-10-14 9:16 ` Janusz
2015-10-14 9:47 ` Laszlo Ersek
2015-10-15 3:59 ` Xiao Guangrong
2015-10-14 18:08 ` Janusz
2015-10-15 4:19 ` Xiao Guangrong
2015-10-15 6:19 ` Janusz
2015-10-15 6:41 ` Xiao Guangrong
2015-10-15 6:58 ` Janusz
2015-10-15 7:10 ` Xiao Guangrong
2015-10-15 7:21 ` Janusz
2015-10-15 16:18 ` Laszlo Ersek
2015-10-15 16:53 ` Kinney, Michael D
2015-10-15 18:46 ` Laszlo Ersek
2015-10-20 17:27 ` Janusz
2015-10-20 17:44 ` Laszlo Ersek
2015-10-20 18:52 ` Janusz Mocek
[not found] ` <5620696F.7050406@linux.intel.com>
2015-10-16 18:22 ` Laszlo Ersek
2015-09-21 8:23 ` Janusz
2015-09-22 8:59 ` Paolo Bonzini
2015-09-22 10:29 ` Janusz
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=561BF9EC.5060605@linux.intel.com \
--to=guangrong.xiao@linux.intel.com \
--cc=edk2-devel@ml01.01.org \
--cc=januszmk6@gmail.com \
--cc=kvm@vger.kernel.org \
--cc=lersek@redhat.com \
--cc=pbonzini@redhat.com \
--cc=wanpeng.li@hotmail.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).