aboutsummaryrefslogtreecommitdiffstats
path: root/xen/arch/x86/hvm/vmx
diff options
context:
space:
mode:
authorYang Zhang <yang.z.zhang@Intel.com>2013-04-18 11:34:04 +0200
committerJan Beulich <jbeulich@suse.com>2013-04-18 11:34:04 +0200
commit1c0ac49b1d6c3d54fc1f75661742a988ca7cf255 (patch)
treee1367294435ce3a1a814dea34caf6251fd8234be /xen/arch/x86/hvm/vmx
parentb266924990af96ee47ee299e1b6bb87fac2e2548 (diff)
downloadxen-1c0ac49b1d6c3d54fc1f75661742a988ca7cf255.tar.gz
xen-1c0ac49b1d6c3d54fc1f75661742a988ca7cf255.tar.bz2
xen-1c0ac49b1d6c3d54fc1f75661742a988ca7cf255.zip
VMX: Turn on posted interrupt bit in vmcs
Turn on posted interrupt for vcpu if posted interrupt is avaliable. Signed-off-by: Yang Zhang <yang.z.zhang@Intel.com> Reviewed-by: Jun Nakajima <jun.nakajima@intel.com> Acked-by: Keir Fraser <keir@xen.org> Acked-by: George Dunlap <george.dunlap@eu.citrix.com> (from a release perspective)
Diffstat (limited to 'xen/arch/x86/hvm/vmx')
-rw-r--r--xen/arch/x86/hvm/vmx/vmcs.c6
-rw-r--r--xen/arch/x86/hvm/vmx/vmx.c5
2 files changed, 11 insertions, 0 deletions
diff --git a/xen/arch/x86/hvm/vmx/vmcs.c b/xen/arch/x86/hvm/vmx/vmcs.c
index d634d488e6..ef0ee7f836 100644
--- a/xen/arch/x86/hvm/vmx/vmcs.c
+++ b/xen/arch/x86/hvm/vmx/vmcs.c
@@ -926,6 +926,12 @@ static int construct_vmcs(struct vcpu *v)
__vmwrite(GUEST_INTR_STATUS, 0);
}
+ if ( cpu_has_vmx_posted_intr_processing )
+ {
+ __vmwrite(PI_DESC_ADDR, virt_to_maddr(&v->arch.hvm_vmx.pi_desc));
+ __vmwrite(POSTED_INTR_NOTIFICATION_VECTOR, posted_intr_vector);
+ }
+
/* Host data selectors. */
__vmwrite(HOST_SS_SELECTOR, __HYPERVISOR_DS);
__vmwrite(HOST_DS_SELECTOR, __HYPERVISOR_DS);
diff --git a/xen/arch/x86/hvm/vmx/vmx.c b/xen/arch/x86/hvm/vmx/vmx.c
index e36dbcbad1..0aa4b8293e 100644
--- a/xen/arch/x86/hvm/vmx/vmx.c
+++ b/xen/arch/x86/hvm/vmx/vmx.c
@@ -75,6 +75,8 @@ static int vmx_msr_read_intercept(unsigned int msr, uint64_t *msr_content);
static int vmx_msr_write_intercept(unsigned int msr, uint64_t msr_content);
static void vmx_invlpg_intercept(unsigned long vaddr);
+uint8_t __read_mostly posted_intr_vector;
+
static int vmx_domain_initialise(struct domain *d)
{
int rc;
@@ -1521,6 +1523,9 @@ struct hvm_function_table * __init start_vmx(void)
setup_ept_dump();
}
+
+ if ( cpu_has_vmx_posted_intr_processing )
+ alloc_direct_apic_vector(&posted_intr_vector, event_check_interrupt);
setup_vmcs_dump();