From patchwork Sat Nov 28 12:18:47 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Avi Kivity X-Patchwork-Id: 63479 Received: from vger.kernel.org (vger.kernel.org [209.132.176.167]) by demeter.kernel.org (8.14.2/8.14.2) with ESMTP id nASCIpFg025864 for ; Sat, 28 Nov 2009 12:18:51 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753945AbZK1MSn (ORCPT ); Sat, 28 Nov 2009 07:18:43 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1753944AbZK1MSn (ORCPT ); Sat, 28 Nov 2009 07:18:43 -0500 Received: from mx1.redhat.com ([209.132.183.28]:21760 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753943AbZK1MSm (ORCPT ); Sat, 28 Nov 2009 07:18:42 -0500 Received: from int-mx08.intmail.prod.int.phx2.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id nASCInXH030306 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Sat, 28 Nov 2009 07:18:49 -0500 Received: from cleopatra.tlv.redhat.com (cleopatra.tlv.redhat.com [10.35.255.11]) by int-mx08.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id nASCImRs008459; Sat, 28 Nov 2009 07:18:48 -0500 Received: from localhost.localdomain (file.tlv.redhat.com [10.35.255.8]) by cleopatra.tlv.redhat.com (Postfix) with ESMTP id 0C0A825004A; Sat, 28 Nov 2009 14:18:48 +0200 (IST) From: Avi Kivity To: Marcelo Tosatti Cc: kvm@vger.kernel.org Subject: [PATCH] KVM: Drop user return notifier when disabling virtualization on a cpu Date: Sat, 28 Nov 2009 14:18:47 +0200 Message-Id: <1259410727-17246-1-git-send-email-avi@redhat.com> X-Scanned-By: MIMEDefang 2.67 on 10.5.11.21 Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c index 35eea30..106f9f1 100644 --- a/arch/x86/kvm/x86.c +++ b/arch/x86/kvm/x86.c @@ -201,6 +201,14 @@ void kvm_set_shared_msr(unsigned slot, u64 value) } EXPORT_SYMBOL_GPL(kvm_set_shared_msr); +static void drop_user_return_notifiers(void *ignore) +{ + struct kvm_shared_msrs *smsr = &__get_cpu_var(shared_msrs); + + if (smsr->registered) + kvm_on_user_return(&smsr->urn); +} + unsigned long segment_base(u16 selector) { struct descriptor_table gdt; @@ -5004,6 +5012,7 @@ int kvm_arch_hardware_enable(void *garbage) void kvm_arch_hardware_disable(void *garbage) { kvm_x86_ops->hardware_disable(garbage); + drop_user_return_notifiers(garbage); } int kvm_arch_hardware_setup(void)