From: Avi Kivity <avi@redhat.com>
To: kvm@vger.kernel.org
Cc: linux-kernel@vger.kernel.org
Subject: [PATCH 02/40] KVM: x86: raise TSS exception for NULL CS and SS segments
Date: Wed, 10 Feb 2010 19:22:31 +0200 [thread overview]
Message-ID: <1265822589-11155-3-git-send-email-avi@redhat.com> (raw)
In-Reply-To: <1265822589-11155-1-git-send-email-avi@redhat.com>
From: Marcelo Tosatti <mtosatti@redhat.com>
Windows 2003 uses task switch to triple fault and reboot (the other
exception being reserved pdptrs bits).
Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
---
arch/x86/kvm/x86.c | 11 +++++++++++
1 files changed, 11 insertions(+), 0 deletions(-)
diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c
index b503614..47fab87 100644
--- a/arch/x86/kvm/x86.c
+++ b/arch/x86/kvm/x86.c
@@ -4411,6 +4411,15 @@ static int is_vm86_segment(struct kvm_vcpu *vcpu, int seg)
(kvm_get_rflags(vcpu) & X86_EFLAGS_VM);
}
+static void kvm_check_segment_descriptor(struct kvm_vcpu *vcpu, int seg,
+ u16 selector)
+{
+ /* NULL selector is not valid for CS and SS */
+ if (seg == VCPU_SREG_CS || seg == VCPU_SREG_SS)
+ if (!selector)
+ kvm_queue_exception_e(vcpu, TS_VECTOR, selector >> 3);
+}
+
int kvm_load_segment_descriptor(struct kvm_vcpu *vcpu, u16 selector,
int type_bits, int seg)
{
@@ -4420,6 +4429,8 @@ int kvm_load_segment_descriptor(struct kvm_vcpu *vcpu, u16 selector,
return kvm_load_realmode_segment(vcpu, selector, seg);
if (load_segment_descriptor_to_kvm_desct(vcpu, selector, &kvm_seg))
return 1;
+
+ kvm_check_segment_descriptor(vcpu, seg, selector);
kvm_seg.type |= type_bits;
if (seg != VCPU_SREG_SS && seg != VCPU_SREG_CS &&
--
1.6.5.3
next prev parent reply other threads:[~2010-02-10 17:23 UTC|newest]
Thread overview: 41+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-02-10 17:22 [PATCH 00/40] KVM updates for the 2.6.34 merge window (batch 1/4) Avi Kivity
2010-02-10 17:22 ` [PATCH 01/40] KVM: x86: make double/triple fault promotion generic to all exceptions Avi Kivity
2010-02-10 17:22 ` Avi Kivity [this message]
2010-02-10 17:22 ` [PATCH 03/40] KVM: MMU: Report spte not found in rmap before BUG() Avi Kivity
2010-02-10 17:22 ` [PATCH 04/40] KVM: VMX: Trap and invalid MWAIT/MONITOR instruction Avi Kivity
2010-02-10 17:22 ` [PATCH 05/40] KVM: VMX: Move some cr[04] related constants to vmx.c Avi Kivity
2010-02-10 17:22 ` [PATCH 06/40] KVM: Add accessor for reading cr4 (or some bits of cr4) Avi Kivity
2010-02-10 17:22 ` [PATCH 07/40] KVM: VMX: Make guest cr4 mask more conservative Avi Kivity
2010-02-10 17:22 ` [PATCH 08/40] KVM: VMX: When using ept, allow the guest to own cr4.pge Avi Kivity
2010-02-10 17:22 ` [PATCH 09/40] KVM: VMX: Fold ept_update_paging_mode_cr4() into its caller Avi Kivity
2010-02-10 17:22 ` [PATCH 10/40] KVM: VMX: Remove redundant variable Avi Kivity
2010-02-10 17:22 ` [PATCH 11/40] KVM: Extended shared_msr_global to per CPU Avi Kivity
2010-02-10 17:22 ` [PATCH 12/40] x86: Raise vsyscall priority on hotplug notifier chain Avi Kivity
2010-02-10 17:22 ` [PATCH 13/40] KVM: Add cpuid_update() callback to kvm_x86_ops Avi Kivity
2010-02-10 17:22 ` [PATCH 14/40] KVM: VMX: Add instruction rdtscp support for guest Avi Kivity
2010-02-10 17:22 ` [PATCH 15/40] KVM: SVM: Adjust tsc_offset only if tsc_unstable Avi Kivity
2010-02-10 17:22 ` [PATCH 16/40] KVM: Disentangle mmu notifiers and coalesced_mmio registration Avi Kivity
2010-02-10 17:22 ` [PATCH 17/40] KVM: Add include guards for coalesced_mmio.h Avi Kivity
2010-02-10 17:22 ` [PATCH 18/40] KVM: Remove ifdefs from mmu notifier initialization Avi Kivity
2010-02-10 17:22 ` [PATCH 19/40] KVM: Add KVM_MMIO kconfig item Avi Kivity
2010-02-10 17:22 ` [PATCH 20/40] KVM: Simplify coalesced mmio initialization Avi Kivity
2010-02-10 17:22 ` [PATCH 21/40] KVM: powerpc: Move vector to irqprio resolving to separate function Avi Kivity
2010-02-10 17:22 ` [PATCH 22/40] KVM: powerpc: Improve DEC handling Avi Kivity
2010-02-10 17:22 ` [PATCH 23/40] KVM: powerpc: Remove AGGRESSIVE_DEC Avi Kivity
2010-02-10 17:22 ` [PATCH 24/40] KVM: powerpc: Change maintainer Avi Kivity
2010-02-10 17:22 ` [PATCH 25/40] KVM: trivial document fixes Avi Kivity
2010-02-10 17:22 ` [PATCH 26/40] KVM: modify memslots layout in struct kvm Avi Kivity
2010-02-10 17:22 ` [PATCH 27/40] KVM: modify alias layout in x86s struct kvm_arch Avi Kivity
2010-02-10 17:22 ` [PATCH 28/40] KVM: split kvm_arch_set_memory_region into prepare and commit Avi Kivity
2010-02-10 17:22 ` [PATCH 29/40] KVM: introduce gfn_to_pfn_memslot Avi Kivity
2010-02-10 17:22 ` [PATCH 30/40] KVM: use gfn_to_pfn_memslot in kvm_iommu_map_pages Avi Kivity
2010-02-10 17:23 ` [PATCH 31/40] KVM: introduce kvm->srcu and convert kvm_set_memory_region to SRCU update Avi Kivity
2010-02-10 17:23 ` [PATCH 32/40] KVM: use SRCU for dirty log Avi Kivity
2010-02-10 17:23 ` [PATCH 33/40] KVM: x86: switch kvm_set_memory_alias to SRCU update Avi Kivity
2010-02-10 17:23 ` [PATCH 34/40] KVM: convert io_bus to SRCU Avi Kivity
2010-02-10 17:23 ` [PATCH 35/40] KVM: switch vcpu context to use SRCU Avi Kivity
2010-02-10 17:23 ` [PATCH 36/40] KVM: convert slots_lock to a mutex Avi Kivity
2010-02-10 17:23 ` [PATCH 37/40] KVM: Bump maximum vcpu count to 64 Avi Kivity
2010-02-10 17:23 ` [PATCH 38/40] KVM: Fill out ftrace exit reason strings Avi Kivity
2010-02-10 17:23 ` [PATCH 39/40] KVM: avoid taking ioapic mutex for non-ioapic EOIs Avi Kivity
2010-02-10 17:23 ` [PATCH 40/40] KVM: PPC: Fix typo in rebolting code Avi Kivity
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1265822589-11155-3-git-send-email-avi@redhat.com \
--to=avi@redhat.com \
--cc=kvm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Powered by JetHome