diff options
author | Keir Fraser <keir@xen.org> | 2011-04-15 10:07:42 +0100 |
---|---|---|
committer | Keir Fraser <keir@xen.org> | 2011-04-15 10:07:42 +0100 |
commit | 3c9c26645ddd820084e2da86366a54990c363b54 (patch) | |
tree | 5b1353a72ecafe588ef7a92a3935180df4f1fc12 /xen/include/asm-x86 | |
parent | 8d24303023ec82d94f97154785302d52e9917f91 (diff) | |
download | xen-3c9c26645ddd820084e2da86366a54990c363b54.tar.gz xen-3c9c26645ddd820084e2da86366a54990c363b54.tar.bz2 xen-3c9c26645ddd820084e2da86366a54990c363b54.zip |
nestedhvm: Allocate a separate host ASID for each L2 VCPU.
This avoids TLB flushing on every L1/L2 transition.
Signed-off-by: Keir Fraser <keir@xen.org>
Signed-off-by: Christoph Egger <Christoph.Egger@amd.com>
Diffstat (limited to 'xen/include/asm-x86')
-rw-r--r-- | xen/include/asm-x86/hvm/asid.h | 8 | ||||
-rw-r--r-- | xen/include/asm-x86/hvm/vcpu.h | 10 | ||||
-rw-r--r-- | xen/include/asm-x86/hvm/vmx/vmx.h | 2 |
3 files changed, 15 insertions, 5 deletions
diff --git a/xen/include/asm-x86/hvm/asid.h b/xen/include/asm-x86/hvm/asid.h index 4ee520f1db..a01ebeb676 100644 --- a/xen/include/asm-x86/hvm/asid.h +++ b/xen/include/asm-x86/hvm/asid.h @@ -23,11 +23,15 @@ #include <xen/config.h> struct vcpu; +struct hvm_vcpu_asid; /* Initialise ASID management for the current physical CPU. */ void hvm_asid_init(int nasids); -/* Invalidate a VCPU's current ASID allocation: forces re-allocation. */ +/* Invalidate a particular ASID allocation: forces re-allocation. */ +void hvm_asid_flush_vcpu_asid(struct hvm_vcpu_asid *asid); + +/* Invalidate all ASID allocations for specified VCPU: forces re-allocation. */ void hvm_asid_flush_vcpu(struct vcpu *v); /* Flush all ASIDs on this processor core. */ @@ -35,7 +39,7 @@ void hvm_asid_flush_core(void); /* Called before entry to guest context. Checks ASID allocation, returns a * boolean indicating whether all ASIDs must be flushed. */ -bool_t hvm_asid_handle_vmenter(void); +bool_t hvm_asid_handle_vmenter(struct hvm_vcpu_asid *asid); #endif /* __ASM_X86_HVM_ASID_H__ */ diff --git a/xen/include/asm-x86/hvm/vcpu.h b/xen/include/asm-x86/hvm/vcpu.h index eabecaaccc..0282c01c3c 100644 --- a/xen/include/asm-x86/hvm/vcpu.h +++ b/xen/include/asm-x86/hvm/vcpu.h @@ -37,6 +37,11 @@ enum hvm_io_state { HVMIO_completed }; +struct hvm_vcpu_asid { + uint64_t generation; + uint32_t asid; +}; + #define VMCX_EADDR (~0ULL) struct nestedvcpu { @@ -57,6 +62,8 @@ struct nestedvcpu { bool_t nv_flushp2m; /* True, when p2m table must be flushed */ struct p2m_domain *nv_p2m; /* used p2m table for this vcpu */ + struct hvm_vcpu_asid nv_n2asid; + bool_t nv_vmentry_pending; bool_t nv_vmexit_pending; bool_t nv_vmswitch_in_progress; /* true during vmentry/vmexit emulation */ @@ -100,8 +107,7 @@ struct hvm_vcpu { bool_t hcall_preempted; bool_t hcall_64bit; - uint64_t asid_generation; - uint32_t asid; + struct hvm_vcpu_asid n1asid; u32 msr_tsc_aux; diff --git a/xen/include/asm-x86/hvm/vmx/vmx.h b/xen/include/asm-x86/hvm/vmx/vmx.h index 8e685e4dc6..23406fa230 100644 --- a/xen/include/asm-x86/hvm/vmx/vmx.h +++ b/xen/include/asm-x86/hvm/vmx/vmx.h @@ -377,7 +377,7 @@ static inline void vpid_sync_vcpu_gva(struct vcpu *v, unsigned long gva) type = INVVPID_ALL_CONTEXT; execute_invvpid: - __invvpid(type, v->arch.hvm_vcpu.asid, (u64)gva); + __invvpid(type, v->arch.hvm_vcpu.n1asid.asid, (u64)gva); } static inline void vpid_sync_all(void) |