1. 01 8月, 2010 22 次提交
  2. 23 7月, 2010 1 次提交
  3. 19 5月, 2010 10 次提交
  4. 17 5月, 2010 7 次提交
    • J
      KVM: x86: Allow marking an exception as reinjected · ce7ddec4
      Joerg Roedel 提交于
      This patch adds logic to kvm/x86 which allows to mark an
      injected exception as reinjected. This allows to remove an
      ugly hack from svm_complete_interrupts that prevented
      exceptions from being reinjected at all in the nested case.
      The hack was necessary because an reinjected exception into
      the nested guest could cause a nested vmexit emulation. But
      reinjected exceptions must not intercept. The downside of
      the hack is that a exception that in injected could get
      lost.
      This patch fixes the problem and puts the code for it into
      generic x86 files because. Nested-VMX will likely have the
      same problem and could reuse the code.
      Signed-off-by: NJoerg Roedel <joerg.roedel@amd.com>
      Signed-off-by: NAvi Kivity <avi@redhat.com>
      ce7ddec4
    • J
      KVM: x86: Add callback to let modules decide over some supported cpuid bits · d4330ef2
      Joerg Roedel 提交于
      This patch adds the get_supported_cpuid callback to
      kvm_x86_ops. It will be used in do_cpuid_ent to delegate the
      decission about some supported cpuid bits to the
      architecture modules.
      
      Cc: stable@kernel.org
      Signed-off-by: NJoerg Roedel <joerg.roedel@amd.com>
      Signed-off-by: NAvi Kivity <avi@redhat.com>
      d4330ef2
    • A
      KVM: MMU: Drop cr4.pge from shadow page role · 87bc3bf9
      Avi Kivity 提交于
      Since commit bf47a760, we no longer handle ptes with the global bit
      set specially, so there is no reason to distinguish between shadow pages
      created with cr4.gpe set and clear.
      
      Such tracking is expensive when the guest toggles cr4.pge, so drop it.
      Signed-off-by: NAvi Kivity <avi@redhat.com>
      87bc3bf9
    • L
      KVM: use the correct RCU API for PROVE_RCU=y · 90d83dc3
      Lai Jiangshan 提交于
      The RCU/SRCU API have already changed for proving RCU usage.
      
      I got the following dmesg when PROVE_RCU=y because we used incorrect API.
      This patch coverts rcu_deference() to srcu_dereference() or family API.
      
      ===================================================
      [ INFO: suspicious rcu_dereference_check() usage. ]
      ---------------------------------------------------
      arch/x86/kvm/mmu.c:3020 invoked rcu_dereference_check() without protection!
      
      other info that might help us debug this:
      
      rcu_scheduler_active = 1, debug_locks = 0
      2 locks held by qemu-system-x86/8550:
       #0:  (&kvm->slots_lock){+.+.+.}, at: [<ffffffffa011a6ac>] kvm_set_memory_region+0x29/0x50 [kvm]
       #1:  (&(&kvm->mmu_lock)->rlock){+.+...}, at: [<ffffffffa012262d>] kvm_arch_commit_memory_region+0xa6/0xe2 [kvm]
      
      stack backtrace:
      Pid: 8550, comm: qemu-system-x86 Not tainted 2.6.34-rc4-tip-01028-g939eab1 #27
      Call Trace:
       [<ffffffff8106c59e>] lockdep_rcu_dereference+0xaa/0xb3
       [<ffffffffa012f6c1>] kvm_mmu_calculate_mmu_pages+0x44/0x7d [kvm]
       [<ffffffffa012263e>] kvm_arch_commit_memory_region+0xb7/0xe2 [kvm]
       [<ffffffffa011a5d7>] __kvm_set_memory_region+0x636/0x6e2 [kvm]
       [<ffffffffa011a6ba>] kvm_set_memory_region+0x37/0x50 [kvm]
       [<ffffffffa015e956>] vmx_set_tss_addr+0x46/0x5a [kvm_intel]
       [<ffffffffa0126592>] kvm_arch_vm_ioctl+0x17a/0xcf8 [kvm]
       [<ffffffff810a8692>] ? unlock_page+0x27/0x2c
       [<ffffffff810bf879>] ? __do_fault+0x3a9/0x3e1
       [<ffffffffa011b12f>] kvm_vm_ioctl+0x364/0x38d [kvm]
       [<ffffffff81060cfa>] ? up_read+0x23/0x3d
       [<ffffffff810f3587>] vfs_ioctl+0x32/0xa6
       [<ffffffff810f3b19>] do_vfs_ioctl+0x495/0x4db
       [<ffffffff810e6b2f>] ? fget_light+0xc2/0x241
       [<ffffffff810e416c>] ? do_sys_open+0x104/0x116
       [<ffffffff81382d6d>] ? retint_swapgs+0xe/0x13
       [<ffffffff810f3ba6>] sys_ioctl+0x47/0x6a
       [<ffffffff810021db>] system_call_fastpath+0x16/0x1b
      Signed-off-by: NLai Jiangshan <laijs@cn.fujitsu.com>
      Signed-off-by: NAvi Kivity <avi@redhat.com>
      90d83dc3
    • G
      KVM: fix emulator_task_switch() return value. · 19d04437
      Gleb Natapov 提交于
      emulator_task_switch() should return -1 for failure and 0 for success to
      the caller, just like x86_emulate_insn() does.
      Signed-off-by: NGleb Natapov <gleb@redhat.com>
      Signed-off-by: NMarcelo Tosatti <mtosatti@redhat.com>
      19d04437
    • J
      KVM: x86: Push potential exception error code on task switches · e269fb21
      Jan Kiszka 提交于
      When a fault triggers a task switch, the error code, if existent, has to
      be pushed on the new task's stack. Implement the missing bits.
      Signed-off-by: NJan Kiszka <jan.kiszka@siemens.com>
      Signed-off-by: NMarcelo Tosatti <mtosatti@redhat.com>
      e269fb21
    • G
      KVM: x86: get rid of mmu_only parameter in emulator_write_emulated() · 8f6abd06
      Gleb Natapov 提交于
      We can call kvm_mmu_pte_write() directly from
      emulator_cmpxchg_emulated() instead of passing mmu_only down to
      emulator_write_emulated_onepage() and call it there.
      Signed-off-by: NGleb Natapov <gleb@redhat.com>
      Signed-off-by: NMarcelo Tosatti <mtosatti@redhat.com>
      8f6abd06