WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-changelog

[Xen-changelog] [xen-3.2-testing] vmx realmode: Faster emulation of REP

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [xen-3.2-testing] vmx realmode: Faster emulation of REP INS and REP OUTS.
From: "Xen patchbot-3.2-testing" <patchbot-3.2-testing@xxxxxxxxxxxxxxxxxxx>
Date: Thu, 07 Feb 2008 01:20:27 -0800
Delivery-date: Thu, 07 Feb 2008 01:20:23 -0800
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-id: BK change log <xen-changelog.lists.xensource.com>
List-post: <mailto:xen-changelog@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
Reply-to: xen-devel@xxxxxxxxxxxxxxxxxxx
Sender: xen-changelog-bounces@xxxxxxxxxxxxxxxxxxx
# HG changeset patch
# User Keir Fraser <keir.fraser@xxxxxxxxxx>
# Date 1202291356 0
# Node ID e3437ee4c9033aa1dcd2038cebc20b2ba623e30e
# Parent  f69df2cee4a6222706bc4e8e24533090325e5c9e
vmx realmode: Faster emulation of REP INS and REP OUTS.
This makes, in particular, reading files via the BIOS disk abstraction
much much much faster.
Signed-off-by: Keir Fraser <keir.fraser@xxxxxxxxxx>
xen-unstable changeset:   16793:dbb5a79837759726b0ea600e8122efd8efd334de
xen-unstable date:        Tue Jan 22 17:18:51 2008 +0000
---
 xen/arch/x86/hvm/vmx/realmode.c |   60 ++++++++++++++++++++++++++++++++++++++++
 1 files changed, 60 insertions(+)

diff -r f69df2cee4a6 -r e3437ee4c903 xen/arch/x86/hvm/vmx/realmode.c
--- a/xen/arch/x86/hvm/vmx/realmode.c   Wed Feb 06 09:48:41 2008 +0000
+++ b/xen/arch/x86/hvm/vmx/realmode.c   Wed Feb 06 09:49:16 2008 +0000
@@ -221,6 +221,64 @@ realmode_emulate_cmpxchg(
 {
     /* Fix this in case the guest is really relying on r-m-w atomicity. */
     return realmode_emulate_write(seg, offset, new, bytes, ctxt);
+}
+
+static int 
+realmode_rep_ins(
+    uint16_t src_port,
+    enum x86_segment dst_seg,
+    unsigned long dst_offset,
+    unsigned int bytes_per_rep,
+    unsigned long *reps,
+    struct x86_emulate_ctxt *ctxt)
+{
+    struct realmode_emulate_ctxt *rm_ctxt =
+        container_of(ctxt, struct realmode_emulate_ctxt, ctxt);
+    struct vcpu *curr = current;
+    uint32_t paddr = rm_ctxt->seg_reg[dst_seg].base + dst_offset;
+
+    if ( curr->arch.hvm_vmx.real_mode_io_in_progress )
+        return X86EMUL_UNHANDLEABLE;
+
+    if ( !curr->arch.hvm_vmx.real_mode_io_completed )
+    {
+        curr->arch.hvm_vmx.real_mode_io_in_progress = 1;
+        send_pio_req(src_port, *reps, bytes_per_rep,
+                     paddr, IOREQ_READ,
+                     !!(ctxt->regs->eflags & X86_EFLAGS_DF), 1);
+    }
+
+    if ( !curr->arch.hvm_vmx.real_mode_io_completed )
+        return X86EMUL_RETRY;
+
+    curr->arch.hvm_vmx.real_mode_io_completed = 0;
+
+    return X86EMUL_OKAY;
+}
+
+static int 
+realmode_rep_outs(
+    enum x86_segment src_seg,
+    unsigned long src_offset,
+    uint16_t dst_port,
+    unsigned int bytes_per_rep,
+    unsigned long *reps,
+    struct x86_emulate_ctxt *ctxt)
+{
+    struct realmode_emulate_ctxt *rm_ctxt =
+        container_of(ctxt, struct realmode_emulate_ctxt, ctxt);
+    struct vcpu *curr = current;
+    uint32_t paddr = rm_ctxt->seg_reg[src_seg].base + src_offset;
+
+    if ( curr->arch.hvm_vmx.real_mode_io_in_progress )
+        return X86EMUL_UNHANDLEABLE;
+
+    curr->arch.hvm_vmx.real_mode_io_in_progress = 1;
+    send_pio_req(dst_port, *reps, bytes_per_rep,
+                 paddr, IOREQ_WRITE,
+                 !!(ctxt->regs->eflags & X86_EFLAGS_DF), 1);
+
+    return X86EMUL_OKAY;
 }
 
 static int
@@ -420,6 +478,8 @@ static struct x86_emulate_ops realmode_e
     .insn_fetch    = realmode_emulate_insn_fetch,
     .write         = realmode_emulate_write,
     .cmpxchg       = realmode_emulate_cmpxchg,
+    .rep_ins       = realmode_rep_ins,
+    .rep_outs      = realmode_rep_outs,
     .read_segment  = realmode_read_segment,
     .write_segment = realmode_write_segment,
     .read_io       = realmode_read_io,

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] [xen-3.2-testing] vmx realmode: Faster emulation of REP INS and REP OUTS., Xen patchbot-3.2-testing <=