From: Avi Kivity <avi@qumranet.com>
To: linux-kernel@vger.kernel.org, kvm-devel@lists.sourceforge.net
Subject: [PATCH 40/54] KVM: SVM: Trap access to the cr8 register
Date: Tue, 1 Jan 2008 17:36:06 +0200 [thread overview]
Message-ID: <1199201780-14001-41-git-send-email-avi@qumranet.com> (raw)
In-Reply-To: <1199201780-14001-1-git-send-email-avi@qumranet.com>
Later we may be able to use the virtual tpr feature, but for now,
just trap it.
Signed-off-by: Avi Kivity <avi@qumranet.com>
---
drivers/kvm/svm.c | 8 ++++++--
drivers/kvm/svm.h | 1 +
2 files changed, 7 insertions(+), 2 deletions(-)
diff --git a/drivers/kvm/svm.c b/drivers/kvm/svm.c
index 8b1cc60..677b525 100644
--- a/drivers/kvm/svm.c
+++ b/drivers/kvm/svm.c
@@ -449,11 +449,13 @@ static void init_vmcb(struct vmcb *vmcb)
control->intercept_cr_read = INTERCEPT_CR0_MASK |
INTERCEPT_CR3_MASK |
- INTERCEPT_CR4_MASK;
+ INTERCEPT_CR4_MASK |
+ INTERCEPT_CR8_MASK;
control->intercept_cr_write = INTERCEPT_CR0_MASK |
INTERCEPT_CR3_MASK |
- INTERCEPT_CR4_MASK;
+ INTERCEPT_CR4_MASK |
+ INTERCEPT_CR8_MASK;
control->intercept_dr_read = INTERCEPT_DR0_MASK |
INTERCEPT_DR1_MASK |
@@ -1195,10 +1197,12 @@ static int (*svm_exit_handlers[])(struct vcpu_svm *svm,
[SVM_EXIT_READ_CR0] = emulate_on_interception,
[SVM_EXIT_READ_CR3] = emulate_on_interception,
[SVM_EXIT_READ_CR4] = emulate_on_interception,
+ [SVM_EXIT_READ_CR8] = emulate_on_interception,
/* for now: */
[SVM_EXIT_WRITE_CR0] = emulate_on_interception,
[SVM_EXIT_WRITE_CR3] = emulate_on_interception,
[SVM_EXIT_WRITE_CR4] = emulate_on_interception,
+ [SVM_EXIT_WRITE_CR8] = emulate_on_interception,
[SVM_EXIT_READ_DR0] = emulate_on_interception,
[SVM_EXIT_READ_DR1] = emulate_on_interception,
[SVM_EXIT_READ_DR2] = emulate_on_interception,
diff --git a/drivers/kvm/svm.h b/drivers/kvm/svm.h
index 5fa277c..5fd5049 100644
--- a/drivers/kvm/svm.h
+++ b/drivers/kvm/svm.h
@@ -204,6 +204,7 @@ struct __attribute__ ((__packed__)) vmcb {
#define INTERCEPT_CR0_MASK 1
#define INTERCEPT_CR3_MASK (1 << 3)
#define INTERCEPT_CR4_MASK (1 << 4)
+#define INTERCEPT_CR8_MASK (1 << 8)
#define INTERCEPT_DR0_MASK 1
#define INTERCEPT_DR1_MASK (1 << 1)
--
1.5.3.7
next prev parent reply other threads:[~2008-01-01 15:48 UTC|newest]
Thread overview: 57+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-01-01 15:35 [PATCH 00/54] KVM patch queue review for 2.6.25 merge window (part IV) Avi Kivity
2008-01-01 15:35 ` [PATCH 01/54] KVM: MMU: Remove gva_to_hpa() Avi Kivity
2008-01-01 15:35 ` [PATCH 02/54] KVM: Remove gpa_to_hpa() Avi Kivity
2008-01-01 15:35 ` [PATCH 03/54] KVM: MMU: Rename variables of type 'struct kvm_mmu_page *' Avi Kivity
2008-01-01 15:35 ` [PATCH 04/54] KVM: MMU: Rename 'release_page' Avi Kivity
2008-01-01 15:35 ` [PATCH 05/54] KVM: Disallow fork() and similar games when using a VM Avi Kivity
2008-01-01 15:35 ` [PATCH 06/54] KVM: Enhance guest cpuid management Avi Kivity
2008-01-01 15:35 ` [PATCH 07/54] KVM: VMX: Remove the secondary execute control dependency on irqchip Avi Kivity
2008-01-01 15:35 ` [PATCH 08/54] KVM: Portability: Move unalias_gfn to arch dependent file Avi Kivity
2008-01-01 15:35 ` [PATCH 09/54] KVM: x86 emulator: Make a distinction between repeat prefixes F3 and F2 Avi Kivity
2008-01-01 15:35 ` [PATCH 10/54] KVM: x86 emulator: address size and operand size overrides are sticky Avi Kivity
2008-01-01 15:35 ` [PATCH 11/54] KVM: Remove misleading check for mmio during event injection Avi Kivity
2008-01-01 15:35 ` [PATCH 12/54] KVM: MMU: mark pages that were inserted to the shadow pages table as accessed Avi Kivity
2008-01-01 15:35 ` [PATCH 13/54] KVM: x86 emulator: Rename 'cr2' to 'memop' Avi Kivity
2008-01-01 15:35 ` [PATCH 14/54] KVM: x86 emulator: cmps instruction Avi Kivity
2008-01-01 15:35 ` [PATCH 15/54] KVM: Add ifdef in irqchip struct for x86 only structures Avi Kivity
2008-01-01 15:35 ` [PATCH 16/54] KVM: x86 emulator: Move rep processing before instruction execution Avi Kivity
2008-01-01 15:35 ` [PATCH 17/54] KVM: x86 emulator: unify two switches Avi Kivity
2008-01-01 15:35 ` [PATCH 18/54] KVM: x86 emulator: unify four switch statements into two Avi Kivity
2008-01-01 15:35 ` [PATCH 19/54] KVM: Portability: Move KVM_INTERRUPT vcpu ioctl to x86.c Avi Kivity
2008-01-01 15:35 ` [PATCH 20/54] KVM: Correct kvm_init() error paths not freeing bad_pge Avi Kivity
2008-01-01 15:35 ` [PATCH 21/54] KVM: Export include/linux/kvm.h only if $ARCH actually supports KVM Avi Kivity
2008-01-01 16:22 ` Sam Ravnborg
2008-01-01 16:35 ` Avi Kivity
2008-01-01 15:35 ` [PATCH 22/54] KVM: SVM: Remove KVM specific defines for MSR_EFER Avi Kivity
2008-01-01 15:35 ` [PATCH 23/54] KVM: Replace kvm_lapic with kvm_vcpu in ioapic/lapic interface Avi Kivity
2008-01-01 15:35 ` [PATCH 24/54] KVM: Replace dest_Lowest_Prio and dest_Fixed with self-defined macros Avi Kivity
2008-01-01 15:35 ` [PATCH 25/54] KVM: Extend ioapic code to support iosapic Avi Kivity
2008-01-01 15:35 ` [PATCH 26/54] KVM: Portability: Move address types to their own header file Avi Kivity
2008-01-01 15:35 ` [PATCH 27/54] KVM: Portability: Move IO device definitions to its " Avi Kivity
2008-01-01 15:35 ` [PATCH 28/54] KVM: Portability: Stop including x86-specific headers in kvm_main.c Avi Kivity
2008-01-01 15:35 ` [PATCH 29/54] KVM: Portability: Create kvm_arch_vcpu_runnable() function Avi Kivity
2008-01-01 15:35 ` [PATCH 30/54] KVM: Convert KVM from ->nopage() to ->fault() Avi Kivity
2008-01-01 15:35 ` [PATCH 31/54] KVM: MMU: Remove unused prev_shadow_ent variable from fetch() Avi Kivity
2008-01-01 15:35 ` [PATCH 32/54] KVM: Generalize exception injection mechanism Avi Kivity
2008-01-01 15:35 ` [PATCH 33/54] KVM: Replace page fault injection by the generalized exception queue Avi Kivity
2008-01-01 15:36 ` [PATCH 34/54] KVM: Replace #GP " Avi Kivity
2008-01-01 15:36 ` [PATCH 35/54] KVM: Use generalized exception queue for injecting #UD Avi Kivity
2008-01-01 15:36 ` [PATCH 36/54] KVM: x86 emulator: fix eflags preparation for emulation Avi Kivity
2008-01-01 15:36 ` [PATCH 37/54] KVM: VMX: Avoid exit when setting cr8 if the local apic is in the kernel Avi Kivity
2008-01-01 15:36 ` [PATCH 38/54] KVM: SVM: Emulate read/write access to cr8 Avi Kivity
2008-01-01 15:36 ` [PATCH 39/54] KVM: x86 emulator: Fix stack instructions on 64-bit mode Avi Kivity
2008-01-01 15:36 ` Avi Kivity [this message]
2008-01-01 15:36 ` [PATCH 41/54] KVM: MMU: Use cmpxchg for pte updates on walk_addr() Avi Kivity
2008-01-01 15:36 ` [PATCH 42/54] KVM: MMU: Simplify calculation of pte access Avi Kivity
2008-01-01 15:36 ` [PATCH 43/54] KVM: MMU: Set nx bit correctly on shadow ptes Avi Kivity
2008-01-01 15:36 ` [PATCH 44/54] KVM: MMU: Move pte access calculation into a helper function Avi Kivity
2008-01-01 15:36 ` [PATCH 45/54] KVM: MMU: Fix inherited permissions for emulated guest pte updates Avi Kivity
2008-01-01 15:36 ` [PATCH 46/54] KVM: MMU: No need to pick up nx bit from guest pte Avi Kivity
2008-01-01 15:36 ` [PATCH 47/54] KVM: MMU: Pass pte dirty flag to set_pte() instead of calculating it on-site Avi Kivity
2008-01-01 15:36 ` [PATCH 48/54] KVM: MMU: Remove walker argument to set_pte() Avi Kivity
2008-01-01 15:36 ` [PATCH 49/54] KVM: MMU: Move set_pte() into guest paging mode independent code Avi Kivity
2008-01-01 15:36 ` [PATCH 50/54] KVM: MMU: Adjust mmu_set_spte() debug code for gpte removal Avi Kivity
2008-01-01 15:36 ` [PATCH 51/54] KVM: MMU: Use mmu_set_spte() for real-mode shadows Avi Kivity
2008-01-01 15:36 ` [PATCH 52/54] KVM: SVM: Exit to userspace if write to cr8 and not using in-kernel apic Avi Kivity
2008-01-01 15:36 ` [PATCH 53/54] KVM: MMU: Fix SMP shadow instantiation race Avi Kivity
2008-01-01 15:36 ` [PATCH 54/54] KVM: LAPIC: minor debugging compile fix 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=1199201780-14001-41-git-send-email-avi@qumranet.com \
--to=avi@qumranet.com \
--cc=kvm-devel@lists.sourceforge.net \
--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
all inboxes | Powered by JetHome®