From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Jan Beulich" Subject: [PATCH] x86emul/test: fix 32-bit build Date: Fri, 10 Feb 2017 00:38:51 -0700 Message-ID: <589D7C1B020000780013876A@prv-mh.provo.novell.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=__PartD8E1101B.1__=" Return-path: Received: from mail6.bemta6.messagelabs.com ([193.109.254.103]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cc6Hx-0000Lm-Lo for xen-devel@lists.xenproject.org; Fri, 10 Feb 2017 08:10:41 +0000 List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xen.org Sender: "Xen-devel" To: xen-devel Cc: Andrew Cooper , Wei Liu List-Id: xen-devel@lists.xenproject.org This is a MIME message. If you are reading this text, you may want to consider changing to a mail reader or gateway that understands how to properly handle MIME multipart messages. --=__PartD8E1101B.1__= Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable Content-Disposition: inline Commit 7603eb256 ("x86emul: use eflags definitions in x86-defns.h") removed the EFLG_* definitions without updating the use sites (which - oddly enough - happen to all be in 32-bit only code paths). Signed-off-by: Jan Beulich --- a/tools/tests/x86_emulator/test_x86_emulator.c +++ b/tools/tests/x86_emulator/test_x86_emulator.c @@ -497,7 +497,7 @@ int main(int argc, char **argv) if ( (rc !=3D X86EMUL_OKAY) || (*res !=3D 0x33331112) || (regs.ecx !=3D 0x22222222) || - !(regs.eflags & EFLG_ZF) || + !(regs.eflags & X86_EFLAGS_ZF) || (regs.eip !=3D (unsigned long)&instr[2]) ) goto fail; #else @@ -571,11 +571,11 @@ int main(int argc, char **argv) =20 #ifndef __x86_64__ printf("%-40s", "Testing daa/das (all inputs)..."); - /* Bits 0-7: AL; Bit 8: EFLG_AF; Bit 9: EFLG_CF; Bit 10: DAA vs. DAS. = */ + /* Bits 0-7: AL; Bit 8: EFLAGS.AF; Bit 9: EFLAGS.CF; Bit 10: DAA vs. = DAS. */ for ( i =3D 0; i < 0x800; i++ ) { - regs.eflags =3D (i & 0x200) ? EFLG_CF : 0; - regs.eflags |=3D (i & 0x100) ? EFLG_AF : 0; + regs.eflags =3D (i & 0x200) ? X86_EFLAGS_CF : 0; + regs.eflags |=3D (i & 0x100) ? X86_EFLAGS_AF : 0; if ( i & 0x400 ) __asm__ ( "pushf; and $0xffffffee,(%%esp); or %1,(%%esp); popf; = das; " @@ -588,24 +588,24 @@ int main(int argc, char **argv) "pushf; popl %1" : "=3Da" (bcdres_native), "=3Dr" (regs.eflags) : "0" (i & 0xff), "1" (regs.eflags) ); - bcdres_native |=3D (regs.eflags & EFLG_PF) ? 0x1000 : 0; - bcdres_native |=3D (regs.eflags & EFLG_ZF) ? 0x800 : 0; - bcdres_native |=3D (regs.eflags & EFLG_SF) ? 0x400 : 0; - bcdres_native |=3D (regs.eflags & EFLG_CF) ? 0x200 : 0; - bcdres_native |=3D (regs.eflags & EFLG_AF) ? 0x100 : 0; + bcdres_native |=3D (regs.eflags & X86_EFLAGS_PF) ? 0x1000 : 0; + bcdres_native |=3D (regs.eflags & X86_EFLAGS_ZF) ? 0x800 : 0; + bcdres_native |=3D (regs.eflags & X86_EFLAGS_SF) ? 0x400 : 0; + bcdres_native |=3D (regs.eflags & X86_EFLAGS_CF) ? 0x200 : 0; + bcdres_native |=3D (regs.eflags & X86_EFLAGS_AF) ? 0x100 : 0; =20 instr[0] =3D (i & 0x400) ? 0x2f: 0x27; /* daa/das */ - regs.eflags =3D (i & 0x200) ? EFLG_CF : 0; - regs.eflags |=3D (i & 0x100) ? EFLG_AF : 0; + regs.eflags =3D (i & 0x200) ? X86_EFLAGS_CF : 0; + regs.eflags |=3D (i & 0x100) ? X86_EFLAGS_AF : 0; regs.eip =3D (unsigned long)&instr[0]; regs.eax =3D (unsigned char)i; rc =3D x86_emulate(&ctxt, &emulops); bcdres_emul =3D regs.eax; - bcdres_emul |=3D (regs.eflags & EFLG_PF) ? 0x1000 : 0; - bcdres_emul |=3D (regs.eflags & EFLG_ZF) ? 0x800 : 0; - bcdres_emul |=3D (regs.eflags & EFLG_SF) ? 0x400 : 0; - bcdres_emul |=3D (regs.eflags & EFLG_CF) ? 0x200 : 0; - bcdres_emul |=3D (regs.eflags & EFLG_AF) ? 0x100 : 0; + bcdres_emul |=3D (regs.eflags & X86_EFLAGS_PF) ? 0x1000 : 0; + bcdres_emul |=3D (regs.eflags & X86_EFLAGS_ZF) ? 0x800 : 0; + bcdres_emul |=3D (regs.eflags & X86_EFLAGS_SF) ? 0x400 : 0; + bcdres_emul |=3D (regs.eflags & X86_EFLAGS_CF) ? 0x200 : 0; + bcdres_emul |=3D (regs.eflags & X86_EFLAGS_AF) ? 0x100 : 0; if ( (rc !=3D X86EMUL_OKAY) || (regs.eax > 255) || (regs.eip !=3D (unsigned long)&instr[1]) ) goto fail; --=__PartD8E1101B.1__= Content-Type: text/plain; name="x86emul-test-32bit.patch" Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename="x86emul-test-32bit.patch" x86emul/test: fix 32-bit build=0A=0ACommit 7603eb256 ("x86emul: use eflags = definitions in x86-defns.h")=0Aremoved the EFLG_* definitions without = updating the use sites (which=0A- oddly enough - happen to all be in = 32-bit only code paths).=0A=0ASigned-off-by: Jan Beulich =0A=0A--- a/tools/tests/x86_emulator/test_x86_emulator.c=0A+++ b/tools/tes= ts/x86_emulator/test_x86_emulator.c=0A@@ -497,7 +497,7 @@ int main(int = argc, char **argv)=0A if ( (rc !=3D X86EMUL_OKAY) ||=0A (*res = !=3D 0x33331112) ||=0A (regs.ecx !=3D 0x22222222) ||=0A- = !(regs.eflags & EFLG_ZF) ||=0A+ !(regs.eflags & X86_EFLAGS_ZF) = ||=0A (regs.eip !=3D (unsigned long)&instr[2]) )=0A goto = fail;=0A #else=0A@@ -571,11 +571,11 @@ int main(int argc, char **argv)=0A = =0A #ifndef __x86_64__=0A printf("%-40s", "Testing daa/das (all = inputs)...");=0A- /* Bits 0-7: AL; Bit 8: EFLG_AF; Bit 9: EFLG_CF; Bit = 10: DAA vs. DAS. */=0A+ /* Bits 0-7: AL; Bit 8: EFLAGS.AF; Bit 9: = EFLAGS.CF; Bit 10: DAA vs. DAS. */=0A for ( i =3D 0; i < 0x800; i++ = )=0A {=0A- regs.eflags =3D (i & 0x200) ? EFLG_CF : 0;=0A- = regs.eflags |=3D (i & 0x100) ? EFLG_AF : 0;=0A+ regs.eflags =3D = (i & 0x200) ? X86_EFLAGS_CF : 0;=0A+ regs.eflags |=3D (i & 0x100) ? = X86_EFLAGS_AF : 0;=0A if ( i & 0x400 )=0A __asm__ (=0A = "pushf; and $0xffffffee,(%%esp); or %1,(%%esp); popf; das; = "=0A@@ -588,24 +588,24 @@ int main(int argc, char **argv)=0A = "pushf; popl %1"=0A : "=3Da" (bcdres_native), "=3Dr" = (regs.eflags)=0A : "0" (i & 0xff), "1" (regs.eflags) = );=0A- bcdres_native |=3D (regs.eflags & EFLG_PF) ? 0x1000 : 0;=0A- = bcdres_native |=3D (regs.eflags & EFLG_ZF) ? 0x800 : 0;=0A- = bcdres_native |=3D (regs.eflags & EFLG_SF) ? 0x400 : 0;=0A- = bcdres_native |=3D (regs.eflags & EFLG_CF) ? 0x200 : 0;=0A- = bcdres_native |=3D (regs.eflags & EFLG_AF) ? 0x100 : 0;=0A+ = bcdres_native |=3D (regs.eflags & X86_EFLAGS_PF) ? 0x1000 : 0;=0A+ = bcdres_native |=3D (regs.eflags & X86_EFLAGS_ZF) ? 0x800 : 0;=0A+ = bcdres_native |=3D (regs.eflags & X86_EFLAGS_SF) ? 0x400 : 0;=0A+ = bcdres_native |=3D (regs.eflags & X86_EFLAGS_CF) ? 0x200 : 0;=0A+ = bcdres_native |=3D (regs.eflags & X86_EFLAGS_AF) ? 0x100 : 0;=0A =0A = instr[0] =3D (i & 0x400) ? 0x2f: 0x27; /* daa/das */=0A- = regs.eflags =3D (i & 0x200) ? EFLG_CF : 0;=0A- regs.eflags |=3D (i = & 0x100) ? EFLG_AF : 0;=0A+ regs.eflags =3D (i & 0x200) ? = X86_EFLAGS_CF : 0;=0A+ regs.eflags |=3D (i & 0x100) ? X86_EFLAGS_AF = : 0;=0A regs.eip =3D (unsigned long)&instr[0];=0A = regs.eax =3D (unsigned char)i;=0A rc =3D x86_emulate(&ctxt, = &emulops);=0A bcdres_emul =3D regs.eax;=0A- bcdres_emul = |=3D (regs.eflags & EFLG_PF) ? 0x1000 : 0;=0A- bcdres_emul |=3D = (regs.eflags & EFLG_ZF) ? 0x800 : 0;=0A- bcdres_emul |=3D (regs.efla= gs & EFLG_SF) ? 0x400 : 0;=0A- bcdres_emul |=3D (regs.eflags & = EFLG_CF) ? 0x200 : 0;=0A- bcdres_emul |=3D (regs.eflags & EFLG_AF) = ? 0x100 : 0;=0A+ bcdres_emul |=3D (regs.eflags & X86_EFLAGS_PF) ? = 0x1000 : 0;=0A+ bcdres_emul |=3D (regs.eflags & X86_EFLAGS_ZF) ? = 0x800 : 0;=0A+ bcdres_emul |=3D (regs.eflags & X86_EFLAGS_SF) ? = 0x400 : 0;=0A+ bcdres_emul |=3D (regs.eflags & X86_EFLAGS_CF) ? = 0x200 : 0;=0A+ bcdres_emul |=3D (regs.eflags & X86_EFLAGS_AF) ? = 0x100 : 0;=0A if ( (rc !=3D X86EMUL_OKAY) || (regs.eax > 255) = ||=0A (regs.eip !=3D (unsigned long)&instr[1]) )=0A = goto fail;=0A --=__PartD8E1101B.1__= Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: base64 Content-Disposition: inline X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX18KWGVuLWRldmVs IG1haWxpbmcgbGlzdApYZW4tZGV2ZWxAbGlzdHMueGVuLm9yZwpodHRwczovL2xpc3RzLnhlbi5v cmcveGVuLWRldmVsCg== --=__PartD8E1101B.1__=--