login
Login
/
Register
Search
Search this site:
Forums
News
Blogs
Features
Site
Home
»
Mailing list archives
»
linux-kernel
»
2010
»
April
»
23
Re: [PATCH 1/8] KVM: SVM: Fix nested nmi handling
view
thread
Previous message: [
thread
] [
date
] [
author
]
Next message: [
thread
] [
date
] [
author
]
[view in full thread]
From: Joerg Roedel
Subject:
Re: [PATCH 1/8] KVM: SVM: Fix nested nmi handling
Date: Friday, April 23, 2010 - 7:13 am
On Fri, Apr 23, 2010 at 03:46:07PM +0200, Alexander Graf wrote:
quoted text
> > On 22.04.2010, at 12:33, Joerg Roedel wrote: > > > The patch introducing nested nmi handling had a bug. The > > check does not belong to enable_nmi_window but must be in > > nmi_allowed. This patch fixes this. > > > > Signed-off-by: Joerg Roedel <joerg.roedel@amd.com> > > --- > > arch/x86/kvm/svm.c | 16 +++++++++------- > > 1 files changed, 9 insertions(+), 7 deletions(-) > > > > diff --git a/arch/x86/kvm/svm.c b/arch/x86/kvm/svm.c > > index ab78eb8..ec20584 100644 > > --- a/arch/x86/kvm/svm.c > > +++ b/arch/x86/kvm/svm.c > > @@ -2771,8 +2771,12 @@ static int svm_nmi_allowed(struct kvm_vcpu *vcpu) > > { > > struct vcpu_svm *svm = to_svm(vcpu); > > struct vmcb *vmcb = svm->vmcb; > > - return !(vmcb->control.int_state & SVM_INTERRUPT_SHADOW_MASK) && > > - !(svm->vcpu.arch.hflags & HF_NMI_MASK); > > + int ret; > > + ret = !(vmcb->control.int_state & SVM_INTERRUPT_SHADOW_MASK) && > > + !(svm->vcpu.arch.hflags & HF_NMI_MASK); > > + ret = ret && gif_set(svm) && nested_svm_nmi(svm); > > + > > + return ret; > > } > > > > static bool svm_get_nmi_mask(struct kvm_vcpu *vcpu) > > @@ -2841,11 +2845,9 @@ static void enable_nmi_window(struct kvm_vcpu *vcpu) > > * Something prevents NMI from been injected. Single step over possible > > * problem (IRET or exception injection or interrupt shadow) > > */ > > - if (gif_set(svm) && nested_svm_nmi(svm)) { > > - svm->nmi_singlestep = true; > > - svm->vmcb->save.rflags |= (X86_EFLAGS_TF | X86_EFLAGS_RF); > > - update_db_intercept(vcpu); > > - } > > + svm->nmi_singlestep = true; > > + svm->vmcb->save.rflags |= (X86_EFLAGS_TF | X86_EFLAGS_RF); > > + update_db_intercept(vcpu); > > So we're always messing with the nested guest state when the host > wants to inject an nmi into the l1 guest? Is that safe?
Why not? We can't inject an NMI directly into L2 if the nested hypervisor intercepts it. Joerg --
unsubscribe notice
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to
majordomo@vger.kernel.org
More majordomo info at
http://vger.kernel.org/majordomo-info.html
Please read the FAQ at
http://www.tux.org/lkml/
Previous message: [
thread
] [
date
] [
author
]
Next message: [
thread
] [
date
] [
author
]
Messages in current thread:
[PATCH 1/8] KVM: SVM: Fix nested nmi handling
, Joerg Roedel
, (Thu Apr 22, 3:33 am)
Re: [PATCH 1/8] KVM: SVM: Fix nested nmi handling
, Alexander Graf
, (Fri Apr 23, 6:46 am)
Re: [PATCH 1/8] KVM: SVM: Fix nested nmi handling
, Joerg Roedel
, (Fri Apr 23, 7:13 am)
Re: [PATCH 1/8] KVM: SVM: Fix nested nmi handling
, Alexander Graf
, (Fri Apr 23, 7:19 am)
Re: [PATCH 1/8] KVM: SVM: Fix nested nmi handling
, Joerg Roedel
, (Fri Apr 23, 7:22 am)
Re: [PATCH 1/8] KVM: SVM: Fix nested nmi handling
, Alexander Graf
, (Fri Apr 23, 7:24 am)
Re: [PATCH 1/8] KVM: SVM: Fix nested nmi handling
, Joerg Roedel
, (Fri Apr 23, 7:31 am)
Re: [PATCH 1/8] KVM: SVM: Fix nested nmi handling
, Alexander Graf
, (Fri Apr 23, 7:42 am)
Re: [PATCH 1/8] KVM: SVM: Fix nested nmi handling
, Joerg Roedel
, (Fri Apr 23, 7:51 am)
Re: [PATCH 1/8] KVM: SVM: Fix nested nmi handling
, Alexander Graf
, (Fri Apr 23, 12:18 pm)
Navigation
Mailing list archives
Recent posts
Popular discussions
linux-kernel
:
Ken Chen
[patch] sched: fix inconsistency when redistribute per-cpu tg->cfs_rq shares.
Ingo Molnar
Re: [PATCH v3] x86: merge the simple bitops and move them to bitops.h
Jan Engelhardt
Re: [PATCH] Allow Kconfig to set default mmap_min_addr protection
Dmitry Torokhov
Re: [2.6 patch] input/serio/hp_sdc.c section fix
Rafael J. Wysocki
[Bug #16380] Loop devices act strangely in 2.6.35
git
:
Steven Grimm
Using git as a general backup mechanism (was Re: Using GIT to store /etc)
Jeff King
Re: [PATCH] git-reset: allow --soft in a bare repo
Johannes Sixt
Re: [PATCH 01/14] msvc: Fix compilation errors in compat/win32/sys/poll.c
Johannes Schindelin
Re: [PATCH] Uninstall rule for top level Makefile
Shawn O. Pearce
Re: [PATCH v2] Speed up bash completion loading
git-commits-head
:
Linux Kernel Mailing List
cgroups: clean up cgroup_pidlist_find() a bit
Linux Kernel Mailing List
sony-laptop: Add support for extended hotkeys
Linux Kernel Mailing List
IB/core: Add support for masked atomic operations
Linux Kernel Mailing List
V4L/DVB (8939): cx18: fix sparse warnings
Linux Kernel Mailing List
ipv6 mcast: Check address family of gf_group in getsockopt(MS_FILTER).
linux-netdev
:
Inaky Perez-Gonzalez
[PATCH 40/40] wimax/i2400m: add CREDITS and MAINTAINERS entries
Karsten Keil
[mISDN PATCH v2 05/19] Reduce stack size in dsp_cmx_send()
linux
Re: 2.6.23-rc8 network problem. Mem leak? ip1000a?
David Miller
Re: tun: Use netif_receive_skb instead of netif_rx
David Miller
Re: [net-next PATCH v2] llc enhancements
freebsd-current
:
Matthew Fleming
Re: [RFC] Outline of USB process integration in the kernel taskqueue system
illoai@gmail.com
Re: OT: 2d password
Hartmut Brandt
Re: problem with nss_ldap
Andrew Reilly
Re: FreeBSD's problems as seen by the BSDForen.de community
Max Laier
Re: Upcoming ABI Breakage in RELENG_7
Colocation donated by:
Syndicate