From: "Jan Beulich" Subject: [PATCH] x86-64: clear DF for kernel when forwarding syscall Date: Fri, 22 Jun 2007 16:01:10 +0100 Message-ID: <467C0056.76E4.0078.0@novell.com> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable Return-path: Content-Disposition: inline List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: xen-devel@lists.xensource.com List-Id: xen-devel@lists.xenproject.org While this is not really matching native behavior, no guest seems to = assume EFLAGS.DF being set or reflecting application state. Thus clear it for = now, the syscall/sysenter patch that I'll hopefully be able to get to work will then introduce a more consistent solution. In any case, without this any app can easily force kernel data corruption. Signed-off-by: Jan Beulich Index: 2007-06-18/xen/arch/x86/x86_64/entry.S =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- 2007-06-18.orig/xen/arch/x86/x86_64/entry.S 2007-06-22 16:35:55.0000000= 00 +0200 +++ 2007-06-18/xen/arch/x86/x86_64/entry.S 2007-06-22 16:36:59.0000000= 00 +0200 @@ -34,6 +34,7 @@ switch_to_kernel: jnc 1f movb $TBF_INTERRUPT,TRAPBOUNCE_flags(%rdx) 1: call create_bounce_frame + andl $~X86_EFLAGS_DF,UREGS_eflags(%rsp) jmp test_all_events =20 /* %rbx: struct vcpu, interrupts disabled */