diff options
author | Tim Deegan <Tim.Deegan@xensource.com> | 2007-06-20 10:55:37 +0100 |
---|---|---|
committer | Tim Deegan <Tim.Deegan@xensource.com> | 2007-06-20 10:55:37 +0100 |
commit | eed63189dabd90abe422b0e94ab8854783329bed (patch) | |
tree | 3e01a11d96bd1f15145e74bf7cd06bcb1c64229f /xen/include/asm-x86/hvm | |
parent | 2677d3c3f314c7e159cf24b6fb1fc6b6f4f98ef9 (diff) | |
download | xen-eed63189dabd90abe422b0e94ab8854783329bed.tar.gz xen-eed63189dabd90abe422b0e94ab8854783329bed.tar.bz2 xen-eed63189dabd90abe422b0e94ab8854783329bed.zip |
[HVM][SVM] flush all entries from guest ASIDs when xen writes CR3.
This makes the assumptions about TLB flush behaviour in the page-type
system and the shadow code safe again, and fixes a corner case of NPT
log-dirty.
Signed-off-by: Tim Deegan <Tim.Deegan@xensource.com>
Diffstat (limited to 'xen/include/asm-x86/hvm')
-rw-r--r-- | xen/include/asm-x86/hvm/hvm.h | 15 | ||||
-rw-r--r-- | xen/include/asm-x86/hvm/support.h | 1 | ||||
-rw-r--r-- | xen/include/asm-x86/hvm/svm/asid.h | 1 |
3 files changed, 16 insertions, 1 deletions
diff --git a/xen/include/asm-x86/hvm/hvm.h b/xen/include/asm-x86/hvm/hvm.h index 0a976e67b2..dd93c36e2a 100644 --- a/xen/include/asm-x86/hvm/hvm.h +++ b/xen/include/asm-x86/hvm/hvm.h @@ -124,6 +124,13 @@ struct hvm_function_table { void (*update_guest_cr3)(struct vcpu *v); /* + * Called to ensure than all guest-specific mappings in a tagged TLB + * are flushed; does *not* flush Xen's TLB entries, and on + * processors without a tagged TLB it will be a noop. + */ + void (*flush_guest_tlbs)(void); + + /* * Reflect the virtual APIC's value in the guest's V_TPR register */ void (*update_vtpr)(struct vcpu *v, unsigned long value); @@ -148,6 +155,7 @@ struct hvm_function_table { }; extern struct hvm_function_table hvm_funcs; +extern int hvm_enabled; int hvm_domain_initialise(struct domain *d); void hvm_domain_relinquish_resources(struct domain *d); @@ -231,6 +239,13 @@ hvm_update_vtpr(struct vcpu *v, unsigned long value) void hvm_update_guest_cr3(struct vcpu *v, unsigned long guest_cr3); +static inline void +hvm_flush_guest_tlbs(void) +{ + if ( hvm_enabled ) + hvm_funcs.flush_guest_tlbs(); +} + void hvm_hypercall_page_initialise(struct domain *d, void *hypercall_page); diff --git a/xen/include/asm-x86/hvm/support.h b/xen/include/asm-x86/hvm/support.h index 74d923cb10..ac8fb63fda 100644 --- a/xen/include/asm-x86/hvm/support.h +++ b/xen/include/asm-x86/hvm/support.h @@ -215,7 +215,6 @@ int hvm_load(struct domain *d, hvm_domain_context_t *h); /* End of save/restore */ extern char hvm_io_bitmap[]; -extern int hvm_enabled; void hvm_enable(struct hvm_function_table *); void hvm_disable(void); diff --git a/xen/include/asm-x86/hvm/svm/asid.h b/xen/include/asm-x86/hvm/svm/asid.h index afce858cfe..be5180e65a 100644 --- a/xen/include/asm-x86/hvm/svm/asid.h +++ b/xen/include/asm-x86/hvm/svm/asid.h @@ -30,6 +30,7 @@ void svm_asid_init(struct cpuinfo_x86 *c); void svm_asid_init_vcpu(struct vcpu *v); void svm_asid_inv_asid(struct vcpu *v); +void svm_asid_inc_generation(void); /* * ASID related, guest triggered events. |