From 8c8df59519d782fc31b41e7d1ec276c105e4eb4a Mon Sep 17 00:00:00 2001 From: Keir Fraser Date: Thu, 27 Mar 2008 10:52:54 +0000 Subject: x86_emulate: On HVM MMIO emulation, cache the gva->pfn mapping for the MMIO page. Speeds up Windows installation by about 20 percent. Signed-off-by: Keir Fraser --- xen/arch/x86/hvm/io.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'xen/arch/x86/hvm/io.c') diff --git a/xen/arch/x86/hvm/io.c b/xen/arch/x86/hvm/io.c index 041d237888..bc5f8acce3 100644 --- a/xen/arch/x86/hvm/io.c +++ b/xen/arch/x86/hvm/io.c @@ -183,7 +183,9 @@ int handle_mmio(void) rc = hvm_emulate_one(&ctxt); if ( curr->arch.hvm_vcpu.io_state == HVMIO_awaiting_completion ) - curr->arch.hvm_vcpu.io_state = HVMIO_handle_mmio_awaiting_completion; + curr->arch.hvm_vcpu.io_state = HVMIO_handle_mmio_awaiting_completion; + else + curr->arch.hvm_vcpu.mmio_gva = 0; switch ( rc ) { @@ -210,6 +212,13 @@ int handle_mmio(void) return 1; } +int handle_mmio_with_translation(unsigned long gva, unsigned long gpfn) +{ + current->arch.hvm_vcpu.mmio_gva = gva & PAGE_MASK; + current->arch.hvm_vcpu.mmio_gpfn = gpfn; + return handle_mmio(); +} + void hvm_io_assist(void) { struct vcpu *v = current; -- cgit v1.2.3