[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-devel] [PATCH] xen: Disable REP MOVSD optimization if introspection is active


  • To: xen-devel@xxxxxxxxxxxxx
  • From: Razvan Cojocaru <rcojocaru@xxxxxxxxxxxxxxx>
  • Date: Mon, 27 Oct 2014 12:37:43 +0200
  • Cc: keir@xxxxxxx, Razvan Cojocaru <rcojocaru@xxxxxxxxxxxxxxx>, jbeulich@xxxxxxxx
  • Comment: DomainKeys? See http://domainkeys.sourceforge.net/
  • Delivery-date: Mon, 27 Oct 2014 10:38:01 +0000
  • Domainkey-signature: a=rsa-sha1; q=dns; c=nofws; s=default; d=bitdefender.com; b=YX3G0TDZxfZJINQ95LCEShQsVP4TzowwiHmFRwKdM6FvDLdJzwUzFNxNQRThunvJt6HUKczBzMzc2loclfPhUlI5nZWxTQPFP+e9mJbTOnpH6J0AO8KsnpfeItKza8B+S82NXhCR4lYJ2tnLKby+Etoifnjeq01FIveRyn1T4K9eFtGOj9I33W9m4FUoVjIWcsYD1D0XZcgbf4sg/zfAnEviF/Vb/BMejosNY1zr6urRhpPMn/JwNB3Aiu0EpjEK9KkyQlXx2Ilak/wuTQkJo2oyk3/+Drl7wt/H0tf7EjYId+F3HflIjK8Kyr6LQ7VaOAR5Pvy+/fRzqm/l0QkjcA==; h=Received:Received:Received:Received:Received:From:To:Cc:Subject:Date:Message-Id:X-Mailer:X-BitDefender-Scanner:X-BitDefender-Spam:X-BitDefender-SpamStamp:X-BitDefender-CF-Stamp;
  • List-id: Xen developer discussion <xen-devel.lists.xen.org>

REP MOVSD emulation is optimized to write several pages at once
if possible. While this is a very good thing in general, it
can interfere with a memory introspection application's ability
to detect suspect behaviour, since it supresses potentially
telling future page faults. This patch disables the optimization,
gated on introspection being active for the domain.

Signed-off-by: Razvan Cojocaru <rcojocaru@xxxxxxxxxxxxxxx>
---
 xen/arch/x86/hvm/emulate.c |    5 +++++
 1 file changed, 5 insertions(+)

diff --git a/xen/arch/x86/hvm/emulate.c b/xen/arch/x86/hvm/emulate.c
index c0f47d2..1848a33 100644
--- a/xen/arch/x86/hvm/emulate.c
+++ b/xen/arch/x86/hvm/emulate.c
@@ -885,6 +885,7 @@ static int hvmemul_rep_movs(
     p2m_type_t sp2mt, dp2mt;
     int rc, df = !!(ctxt->regs->eflags & X86_EFLAGS_DF);
     char *buf;
+    struct domain *currd = current->domain;
 
     rc = hvmemul_virtual_to_linear(
         src_seg, src_offset, bytes_per_rep, reps, hvm_access_read,
@@ -928,6 +929,10 @@ static int hvmemul_rep_movs(
         return hvmemul_do_mmio(
             dgpa, reps, bytes_per_rep, sgpa, IOREQ_WRITE, df, NULL);
 
+    /* Fall back to slow emulation if introspection is enabled. */
+    if ( currd->arch.hvm_domain.introspection_enabled )
+        return X86EMUL_UNHANDLEABLE;
+
     /* RAM-to-RAM copy: emulate as equivalent of memmove(dgpa, sgpa, bytes). */
     bytes = *reps * bytes_per_rep;
 
-- 
1.7.9.5


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.