Xiao Guangrong 87da7e66a4 KVM: x86: fix vcpu->mmio_fragments overflow
After commit b3356bf0dbb349 (KVM: emulator: optimize "rep ins" handling),
the pieces of io data can be collected and write them to the guest memory
or MMIO together

Unfortunately, kvm splits the mmio access into 8 bytes and store them to
vcpu->mmio_fragments. If the guest uses "rep ins" to move large data, it
will cause vcpu->mmio_fragments overflow

The bug can be exposed by isapc (-M isapc):

[23154.818733] general protection fault: 0000 [#1] SMP DEBUG_PAGEALLOC
[ ......]
[23154.858083] Call Trace:
[23154.859874]  [<ffffffffa04f0e17>] kvm_get_cr8+0x1d/0x28 [kvm]
[23154.861677]  [<ffffffffa04fa6d4>] kvm_arch_vcpu_ioctl_run+0xcda/0xe45 [kvm]
[23154.863604]  [<ffffffffa04f5a1a>] ? kvm_arch_vcpu_load+0x17b/0x180 [kvm]

Actually, we can use one mmio_fragment to store a large mmio access then
split it when we pass the mmio-exit-info to userspace. After that, we only
need two entries to store mmio info for the cross-mmio pages access

Signed-off-by: Xiao Guangrong <xiaoguangrong@linux.vnet.ibm.com>
Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
2012-10-31 20:36:30 -02:00
..
2012-10-02 17:26:42 -07:00
2012-10-09 15:04:25 +01:00
2012-10-09 15:04:25 +01:00
2012-10-03 13:45:43 -07:00
2012-10-07 17:29:24 +09:00
2012-10-24 18:00:17 -07:00
2012-10-13 14:15:08 -07:00
2012-10-08 13:50:20 +10:30
2012-10-02 18:32:35 -07:00
2012-10-16 18:49:15 -07:00
2012-09-26 21:10:00 -04:00
2012-10-16 13:37:17 -04:00
2012-10-06 03:04:56 +09:00
2012-10-10 01:15:44 -04:00
2012-10-02 19:01:32 -07:00
2012-10-09 16:22:54 +09:00
2012-10-09 16:23:00 +09:00
2012-10-10 20:00:55 +10:30
2012-10-17 15:53:01 -05:00
2012-10-17 15:53:02 -05:00
2012-10-10 22:41:05 -04:00
2012-10-05 22:23:53 +02:00
2012-10-02 18:32:35 -07:00
2012-10-11 08:50:16 +09:00
2012-10-06 03:05:01 +09:00
2012-09-27 12:45:28 +02:00
2012-10-11 20:02:04 -04:00
2012-10-07 00:40:54 -04:00
2012-10-09 16:22:55 +09:00
2012-10-22 15:16:06 -04:00
2012-10-09 16:22:32 +09:00
2012-10-07 21:19:42 +02:00
2012-10-17 11:16:13 -07:00