From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:54118) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Wg9Ov-0005dB-BX for qemu-devel@nongnu.org; Fri, 02 May 2014 05:05:07 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Wg9Op-00035y-LI for qemu-devel@nongnu.org; Fri, 02 May 2014 05:05:01 -0400 Received: from mail-we0-x235.google.com ([2a00:1450:400c:c03::235]:63089) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Wg9Op-00035t-Co for qemu-devel@nongnu.org; Fri, 02 May 2014 05:04:55 -0400 Received: by mail-we0-f181.google.com with SMTP id q58so4311526wes.12 for ; Fri, 02 May 2014 02:04:54 -0700 (PDT) Date: Fri, 2 May 2014 11:04:50 +0200 From: Stefan Hajnoczi Message-ID: <20140502090450.GD8005@stefanha-thinkpad.redhat.com> References: <535a981f.86a6e00a.7dc9.5f5cSMTPIN_ADDED_BROKEN@mx.google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <535a981f.86a6e00a.7dc9.5f5cSMTPIN_ADDED_BROKEN@mx.google.com> Subject: Re: [Qemu-devel] [PATCH] improve emulation correctness List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: poletaev Cc: Paolo Bonzini , qemu-devel@nongnu.org, Andreas Faerber , Richard Henderson On Thu, Apr 24, 2014 at 12:35:24PM +0400, poletaev wrote: The commit message is vague so I guess the maintainers skipped your email. I have CCed Paolo, Richard, and Andreas who may be able to review and apply your patch. Please make the commit message more specific: target-i386: don't touch undefined OF flag in RCL instruction That way the relevant people can easily identify it on the mailing list and will review your patch. > There is a set of test, that checks QEMU CPU for similar behavior with real > hardware (http://roberto.greyhats.it/projects/pills.html). Test > reg/pill2579.c can detect, that program is execute in emulated environment. > It is related with behavior of rcl instruction. If the number of shifted > bits more than 1, OF of eflags become undefined. Real CPUs does not change > OF, if it is undefined. QEMU do it anyway. > > Emulated program can execute that test and after that can understand > environment not real. It will always be possible to tell the environment is virtual. There are too many quirks that are very hard to hide - timing, firmware, etc. But I checked the Intel Software Developer's Manual and your patch matches how they document the effect of the RCL instruction. Whether *all* Intel, AMD, VIA, etc x86 CPUs leave the OF flag alone, I'm not sure but I think this patch won't hurt. > Signed-off-by: Dmitry Poletaev > > > > diff --git a/target-i386/shift_helper_template.h > b/target-i386/shift_helper_template.h > > index cf91a2d..d5bd321 100644 > > --- a/target-i386/shift_helper_template.h This patch email is broken. Please use git-send-email(1) to send properly formatted patches.