From: Avi Kivity <avi@qumranet.com>
To: linux-kernel@vger.kernel.org, kvm-devel@lists.sourceforge.net
Cc: Sheng Yang <sheng.yang@intel.com>
Subject: [PATCH 07/54] KVM: VMX: Remove the secondary execute control dependency on irqchip
Date: Tue, 1 Jan 2008 17:35:33 +0200 [thread overview]
Message-ID: <1199201780-14001-8-git-send-email-avi@qumranet.com> (raw)
In-Reply-To: <1199201780-14001-1-git-send-email-avi@qumranet.com>
From: Sheng Yang <sheng.yang@intel.com>
The state of SECONDARY_VM_EXEC_CONTROL shouldn't depend on in-kernel IRQ chip,
this patch fix this.
Signed-off-by: Sheng Yang <sheng.yang@intel.com>
Signed-off-by: Avi Kivity <avi@qumranet.com>
---
drivers/kvm/vmx.c | 17 +++++++----------
1 files changed, 7 insertions(+), 10 deletions(-)
diff --git a/drivers/kvm/vmx.c b/drivers/kvm/vmx.c
index fbe792d..8e43feb 100644
--- a/drivers/kvm/vmx.c
+++ b/drivers/kvm/vmx.c
@@ -193,11 +193,6 @@ static inline int cpu_has_secondary_exec_ctrls(void)
CPU_BASED_ACTIVATE_SECONDARY_CONTROLS);
}
-static inline int vm_need_secondary_exec_ctrls(struct kvm *kvm)
-{
- return ((cpu_has_secondary_exec_ctrls()) && (irqchip_in_kernel(kvm)));
-}
-
static inline int cpu_has_vmx_virtualize_apic_accesses(void)
{
return (vmcs_config.cpu_based_2nd_exec_ctrl &
@@ -1524,13 +1519,15 @@ static int vmx_vcpu_setup(struct vcpu_vmx *vmx)
CPU_BASED_CR8_LOAD_EXITING;
#endif
}
- if (!vm_need_secondary_exec_ctrls(vmx->vcpu.kvm))
- exec_control &= ~CPU_BASED_ACTIVATE_SECONDARY_CONTROLS;
vmcs_write32(CPU_BASED_VM_EXEC_CONTROL, exec_control);
- if (vm_need_secondary_exec_ctrls(vmx->vcpu.kvm))
- vmcs_write32(SECONDARY_VM_EXEC_CONTROL,
- vmcs_config.cpu_based_2nd_exec_ctrl);
+ if (cpu_has_secondary_exec_ctrls()) {
+ exec_control = vmcs_config.cpu_based_2nd_exec_ctrl;
+ if (!vm_need_virtualize_apic_accesses(vmx->vcpu.kvm))
+ exec_control &=
+ ~SECONDARY_EXEC_VIRTUALIZE_APIC_ACCESSES;
+ vmcs_write32(SECONDARY_VM_EXEC_CONTROL, exec_control);
+ }
vmcs_write32(PAGE_FAULT_ERROR_CODE_MASK, !!bypass_guest_pf);
vmcs_write32(PAGE_FAULT_ERROR_CODE_MATCH, !!bypass_guest_pf);
--
1.5.3.7
next prev parent reply other threads:[~2008-01-01 15:38 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 ` Avi Kivity [this message]
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 ` [PATCH 40/54] KVM: SVM: Trap access to the cr8 register Avi Kivity
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-8-git-send-email-avi@qumranet.com \
--to=avi@qumranet.com \
--cc=kvm-devel@lists.sourceforge.net \
--cc=linux-kernel@vger.kernel.org \
--cc=sheng.yang@intel.com \
/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®