From: kfraser@localhost.localdomain Date: Thu, 30 Aug 2007 08:57:09 +0000 (+0100) Subject: hvm: Provide an HVMOP_flush_tlbs to flush VCPU TLBs. X-Git-Tag: 3.2.0-rc1~365^2~39 X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=f57dc30e307d561093da5bf95d6bd45673997783;p=xen.git hvm: Provide an HVMOP_flush_tlbs to flush VCPU TLBs. From: Peter Johnston Signed-off-by: Keir Fraser --- diff --git a/xen/arch/x86/hvm/hvm.c b/xen/arch/x86/hvm/hvm.c index 0961f3372b..cb07b19289 100644 --- a/xen/arch/x86/hvm/hvm.c +++ b/xen/arch/x86/hvm/hvm.c @@ -1166,6 +1166,12 @@ static int hvmop_set_pci_link_route( return rc; } +static int hvmop_flush_tlb_all(void) +{ + flush_tlb_mask(current->domain->domain_dirty_cpumask); + return 0; +} + long do_hvm_op(unsigned long op, XEN_GUEST_HANDLE(void) arg) { @@ -1257,6 +1263,10 @@ long do_hvm_op(unsigned long op, XEN_GUEST_HANDLE(void) arg) guest_handle_cast(arg, xen_hvm_set_pci_link_route_t)); break; + case HVMOP_flush_tlbs: + rc = guest_handle_is_null(arg) ? hvmop_flush_tlb_all() : -ENOSYS; + break; + default: { gdprintk(XENLOG_WARNING, "Bad HVM op %ld.\n", op); diff --git a/xen/include/public/hvm/hvm_op.h b/xen/include/public/hvm/hvm_op.h index f568050949..b21b0f7abe 100644 --- a/xen/include/public/hvm/hvm_op.h +++ b/xen/include/public/hvm/hvm_op.h @@ -70,4 +70,7 @@ struct xen_hvm_set_pci_link_route { typedef struct xen_hvm_set_pci_link_route xen_hvm_set_pci_link_route_t; DEFINE_XEN_GUEST_HANDLE(xen_hvm_set_pci_link_route_t); +/* Flushes all VCPU TLBs: @arg must be NULL. */ +#define HVMOP_flush_tlbs 5 + #endif /* __XEN_PUBLIC_HVM_HVM_OP_H__ */