From: Linus Torvalds Date: Tue, 8 Dec 2009 16:02:38 +0000 (-0800) Subject: Merge branch 'kvm-updates/2.6.33' of git://git.kernel.org/pub/scm/virt/kvm/kvm X-Git-Tag: v2.6.33-rc1~387 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=ed9216c1717a3f3738a77908aff78995ea69e7ff;p=platform%2Fkernel%2Flinux-3.10.git Merge branch 'kvm-updates/2.6.33' of git://git./virt/kvm/kvm * 'kvm-updates/2.6.33' of git://git.kernel.org/pub/scm/virt/kvm/kvm: (84 commits) KVM: VMX: Fix comparison of guest efer with stale host value KVM: s390: Fix prefix register checking in arch/s390/kvm/sigp.c KVM: Drop user return notifier when disabling virtualization on a cpu KVM: VMX: Disable unrestricted guest when EPT disabled KVM: x86 emulator: limit instructions to 15 bytes KVM: s390: Make psw available on all exits, not just a subset KVM: x86: Add KVM_GET/SET_VCPU_EVENTS KVM: VMX: Report unexpected simultaneous exceptions as internal errors KVM: Allow internal errors reported to userspace to carry extra data KVM: Reorder IOCTLs in main kvm.h KVM: x86: Polish exception injection via KVM_SET_GUEST_DEBUG KVM: only clear irq_source_id if irqchip is present KVM: x86: disallow KVM_{SET,GET}_LAPIC without allocated in-kernel lapic KVM: x86: disallow multiple KVM_CREATE_IRQCHIP KVM: VMX: Remove vmx->msr_offset_efer KVM: MMU: update invlpg handler comment KVM: VMX: move CR3/PDPTR update to vmx_set_cr3 KVM: remove duplicated task_switch check KVM: powerpc: Fix BUILD_BUG_ON condition KVM: VMX: Use shared msr infrastructure ... Trivial conflicts due to new Kconfig options in arch/Kconfig and kernel/Makefile --- ed9216c1717a3f3738a77908aff78995ea69e7ff diff --cc arch/Kconfig index eef3bbb,4e312ff..d828758 --- a/arch/Kconfig +++ b/arch/Kconfig @@@ -126,11 -133,7 +133,13 @@@ config HAVE_DMA_API_DEBU config HAVE_DEFAULT_NO_SPIN_MUTEXES bool +config HAVE_HW_BREAKPOINT + bool + depends on HAVE_PERF_EVENTS + select ANON_INODES + select PERF_EVENTS + + config HAVE_USER_RETURN_NOTIFIER + bool source "kernel/gcov/Kconfig" diff --cc arch/x86/Kconfig index 178084b,8b54096..1b2182b --- a/arch/x86/Kconfig +++ b/arch/x86/Kconfig @@@ -49,8 -49,8 +49,9 @@@ config X8 select HAVE_KERNEL_GZIP select HAVE_KERNEL_BZIP2 select HAVE_KERNEL_LZMA + select HAVE_HW_BREAKPOINT select HAVE_ARCH_KMEMCHECK + select HAVE_USER_RETURN_NOTIFIER config OUTPUT_FORMAT string diff --cc arch/x86/kernel/process.c index 744508e,e51b056..5e2ba63 --- a/arch/x86/kernel/process.c +++ b/arch/x86/kernel/process.c @@@ -9,8 -9,8 +9,9 @@@ #include #include #include + #include #include +#include #include #include #include diff --cc arch/x86/kvm/x86.c index 4fc8017,ce677b2..9d06896 --- a/arch/x86/kvm/x86.c +++ b/arch/x86/kvm/x86.c @@@ -3642,17 -3918,16 +3919,17 @@@ static int vcpu_enter_guest(struct kvm_ } trace_kvm_entry(vcpu->vcpu_id); - kvm_x86_ops->run(vcpu, kvm_run); + kvm_x86_ops->run(vcpu); - if (unlikely(vcpu->arch.switch_db_regs || test_thread_flag(TIF_DEBUG))) { - set_debugreg(current->thread.debugreg0, 0); - set_debugreg(current->thread.debugreg1, 1); - set_debugreg(current->thread.debugreg2, 2); - set_debugreg(current->thread.debugreg3, 3); - set_debugreg(current->thread.debugreg6, 6); - set_debugreg(current->thread.debugreg7, 7); - } + /* + * If the guest has used debug registers, at least dr7 + * will be disabled while returning to the host. + * If we don't have active breakpoints in the host, we don't + * care about the messed up debug address registers. But if + * we have some of them active, restore the old state. + */ + if (hw_breakpoint_active()) + hw_breakpoint_restore(); set_bit(KVM_REQ_KICK, &vcpu->requests); local_irq_enable(); diff --cc kernel/Makefile index 9943202,6c51128..864ff75 --- a/kernel/Makefile +++ b/kernel/Makefile @@@ -98,7 -96,7 +98,8 @@@ obj-$(CONFIG_SMP) += sched_cpupri. obj-$(CONFIG_SLOW_WORK) += slow-work.o obj-$(CONFIG_SLOW_WORK_DEBUG) += slow-work-debugfs.o obj-$(CONFIG_PERF_EVENTS) += perf_event.o +obj-$(CONFIG_HAVE_HW_BREAKPOINT) += hw_breakpoint.o + obj-$(CONFIG_USER_RETURN_NOTIFIER) += user-return-notifier.o ifneq ($(CONFIG_SCHED_OMIT_FRAME_POINTER),y) # According to Alan Modra , the -fno-omit-frame-pointer is