All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] x86emul/test: fix 32-bit build
@ 2017-02-10  7:38 Jan Beulich
  2017-02-10  8:15 ` Wei Liu
  2017-02-10 10:48 ` Andrew Cooper
  0 siblings, 2 replies; 4+ messages in thread
From: Jan Beulich @ 2017-02-10  7:38 UTC (permalink / raw)
  To: xen-devel; +Cc: Andrew Cooper, Wei Liu

[-- Attachment #1: Type: text/plain, Size: 3512 bytes --]

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 <jbeulich@suse.com>

--- 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 != X86EMUL_OKAY) ||
          (*res != 0x33331112) ||
          (regs.ecx != 0x22222222) ||
-         !(regs.eflags & EFLG_ZF) ||
+         !(regs.eflags & X86_EFLAGS_ZF) ||
          (regs.eip != (unsigned long)&instr[2]) )
         goto fail;
 #else
@@ -571,11 +571,11 @@ int main(int argc, char **argv)
 
 #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 = 0; i < 0x800; i++ )
     {
-        regs.eflags  = (i & 0x200) ? EFLG_CF : 0;
-        regs.eflags |= (i & 0x100) ? EFLG_AF : 0;
+        regs.eflags  = (i & 0x200) ? X86_EFLAGS_CF : 0;
+        regs.eflags |= (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"
                 : "=a" (bcdres_native), "=r" (regs.eflags)
                 : "0" (i & 0xff), "1" (regs.eflags) );
-        bcdres_native |= (regs.eflags & EFLG_PF) ? 0x1000 : 0;
-        bcdres_native |= (regs.eflags & EFLG_ZF) ? 0x800 : 0;
-        bcdres_native |= (regs.eflags & EFLG_SF) ? 0x400 : 0;
-        bcdres_native |= (regs.eflags & EFLG_CF) ? 0x200 : 0;
-        bcdres_native |= (regs.eflags & EFLG_AF) ? 0x100 : 0;
+        bcdres_native |= (regs.eflags & X86_EFLAGS_PF) ? 0x1000 : 0;
+        bcdres_native |= (regs.eflags & X86_EFLAGS_ZF) ? 0x800 : 0;
+        bcdres_native |= (regs.eflags & X86_EFLAGS_SF) ? 0x400 : 0;
+        bcdres_native |= (regs.eflags & X86_EFLAGS_CF) ? 0x200 : 0;
+        bcdres_native |= (regs.eflags & X86_EFLAGS_AF) ? 0x100 : 0;
 
         instr[0] = (i & 0x400) ? 0x2f: 0x27; /* daa/das */
-        regs.eflags  = (i & 0x200) ? EFLG_CF : 0;
-        regs.eflags |= (i & 0x100) ? EFLG_AF : 0;
+        regs.eflags  = (i & 0x200) ? X86_EFLAGS_CF : 0;
+        regs.eflags |= (i & 0x100) ? X86_EFLAGS_AF : 0;
         regs.eip    = (unsigned long)&instr[0];
         regs.eax    = (unsigned char)i;
         rc = x86_emulate(&ctxt, &emulops);
         bcdres_emul  = regs.eax;
-        bcdres_emul |= (regs.eflags & EFLG_PF) ? 0x1000 : 0;
-        bcdres_emul |= (regs.eflags & EFLG_ZF) ? 0x800 : 0;
-        bcdres_emul |= (regs.eflags & EFLG_SF) ? 0x400 : 0;
-        bcdres_emul |= (regs.eflags & EFLG_CF) ? 0x200 : 0;
-        bcdres_emul |= (regs.eflags & EFLG_AF) ? 0x100 : 0;
+        bcdres_emul |= (regs.eflags & X86_EFLAGS_PF) ? 0x1000 : 0;
+        bcdres_emul |= (regs.eflags & X86_EFLAGS_ZF) ? 0x800 : 0;
+        bcdres_emul |= (regs.eflags & X86_EFLAGS_SF) ? 0x400 : 0;
+        bcdres_emul |= (regs.eflags & X86_EFLAGS_CF) ? 0x200 : 0;
+        bcdres_emul |= (regs.eflags & X86_EFLAGS_AF) ? 0x100 : 0;
         if ( (rc != X86EMUL_OKAY) || (regs.eax > 255) ||
              (regs.eip != (unsigned long)&instr[1]) )
             goto fail;




[-- Attachment #2: x86emul-test-32bit.patch --]
[-- Type: text/plain, Size: 3540 bytes --]

x86emul/test: fix 32-bit build

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 <jbeulich@suse.com>

--- 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 != X86EMUL_OKAY) ||
          (*res != 0x33331112) ||
          (regs.ecx != 0x22222222) ||
-         !(regs.eflags & EFLG_ZF) ||
+         !(regs.eflags & X86_EFLAGS_ZF) ||
          (regs.eip != (unsigned long)&instr[2]) )
         goto fail;
 #else
@@ -571,11 +571,11 @@ int main(int argc, char **argv)
 
 #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 = 0; i < 0x800; i++ )
     {
-        regs.eflags  = (i & 0x200) ? EFLG_CF : 0;
-        regs.eflags |= (i & 0x100) ? EFLG_AF : 0;
+        regs.eflags  = (i & 0x200) ? X86_EFLAGS_CF : 0;
+        regs.eflags |= (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"
                 : "=a" (bcdres_native), "=r" (regs.eflags)
                 : "0" (i & 0xff), "1" (regs.eflags) );
-        bcdres_native |= (regs.eflags & EFLG_PF) ? 0x1000 : 0;
-        bcdres_native |= (regs.eflags & EFLG_ZF) ? 0x800 : 0;
-        bcdres_native |= (regs.eflags & EFLG_SF) ? 0x400 : 0;
-        bcdres_native |= (regs.eflags & EFLG_CF) ? 0x200 : 0;
-        bcdres_native |= (regs.eflags & EFLG_AF) ? 0x100 : 0;
+        bcdres_native |= (regs.eflags & X86_EFLAGS_PF) ? 0x1000 : 0;
+        bcdres_native |= (regs.eflags & X86_EFLAGS_ZF) ? 0x800 : 0;
+        bcdres_native |= (regs.eflags & X86_EFLAGS_SF) ? 0x400 : 0;
+        bcdres_native |= (regs.eflags & X86_EFLAGS_CF) ? 0x200 : 0;
+        bcdres_native |= (regs.eflags & X86_EFLAGS_AF) ? 0x100 : 0;
 
         instr[0] = (i & 0x400) ? 0x2f: 0x27; /* daa/das */
-        regs.eflags  = (i & 0x200) ? EFLG_CF : 0;
-        regs.eflags |= (i & 0x100) ? EFLG_AF : 0;
+        regs.eflags  = (i & 0x200) ? X86_EFLAGS_CF : 0;
+        regs.eflags |= (i & 0x100) ? X86_EFLAGS_AF : 0;
         regs.eip    = (unsigned long)&instr[0];
         regs.eax    = (unsigned char)i;
         rc = x86_emulate(&ctxt, &emulops);
         bcdres_emul  = regs.eax;
-        bcdres_emul |= (regs.eflags & EFLG_PF) ? 0x1000 : 0;
-        bcdres_emul |= (regs.eflags & EFLG_ZF) ? 0x800 : 0;
-        bcdres_emul |= (regs.eflags & EFLG_SF) ? 0x400 : 0;
-        bcdres_emul |= (regs.eflags & EFLG_CF) ? 0x200 : 0;
-        bcdres_emul |= (regs.eflags & EFLG_AF) ? 0x100 : 0;
+        bcdres_emul |= (regs.eflags & X86_EFLAGS_PF) ? 0x1000 : 0;
+        bcdres_emul |= (regs.eflags & X86_EFLAGS_ZF) ? 0x800 : 0;
+        bcdres_emul |= (regs.eflags & X86_EFLAGS_SF) ? 0x400 : 0;
+        bcdres_emul |= (regs.eflags & X86_EFLAGS_CF) ? 0x200 : 0;
+        bcdres_emul |= (regs.eflags & X86_EFLAGS_AF) ? 0x100 : 0;
         if ( (rc != X86EMUL_OKAY) || (regs.eax > 255) ||
              (regs.eip != (unsigned long)&instr[1]) )
             goto fail;

[-- Attachment #3: Type: text/plain, Size: 127 bytes --]

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

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] x86emul/test: fix 32-bit build
  2017-02-10  7:38 [PATCH] x86emul/test: fix 32-bit build Jan Beulich
@ 2017-02-10  8:15 ` Wei Liu
  2017-02-10  9:05   ` Jan Beulich
  2017-02-10 10:48 ` Andrew Cooper
  1 sibling, 1 reply; 4+ messages in thread
From: Wei Liu @ 2017-02-10  8:15 UTC (permalink / raw)
  To: Jan Beulich; +Cc: xen-devel, Wei Liu, Andrew Cooper

On Fri, Feb 10, 2017 at 12:38:51AM -0700, Jan Beulich wrote:
> 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 <jbeulich@suse.com>

Reviewed-by: Wei Liu <wei.liu2@citrix.com>

Ah sorry! I would have sworn I did several mechanical replaces, but
apparently something went wrong...

And I also notice that this directory is not built by default, hence it
slipped my pre-commit build test (which does 32bit build as well) and
oostest build test.

Wei.

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

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] x86emul/test: fix 32-bit build
  2017-02-10  8:15 ` Wei Liu
@ 2017-02-10  9:05   ` Jan Beulich
  0 siblings, 0 replies; 4+ messages in thread
From: Jan Beulich @ 2017-02-10  9:05 UTC (permalink / raw)
  To: Wei Liu; +Cc: Andrew Cooper, xen-devel

>>> On 10.02.17 at 09:15, <wei.liu2@citrix.com> wrote:
> On Fri, Feb 10, 2017 at 12:38:51AM -0700, Jan Beulich wrote:
>> 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 <jbeulich@suse.com>
> 
> Reviewed-by: Wei Liu <wei.liu2@citrix.com>

Thanks.

> And I also notice that this directory is not built by default, hence it
> slipped my pre-commit build test (which does 32bit build as well) and
> oostest build test.

And we shouldn't try to build this by default, as it definitely
requires a much newer tool chain than what our base requirement
is.

Jan


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

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] x86emul/test: fix 32-bit build
  2017-02-10  7:38 [PATCH] x86emul/test: fix 32-bit build Jan Beulich
  2017-02-10  8:15 ` Wei Liu
@ 2017-02-10 10:48 ` Andrew Cooper
  1 sibling, 0 replies; 4+ messages in thread
From: Andrew Cooper @ 2017-02-10 10:48 UTC (permalink / raw)
  To: Jan Beulich, xen-devel; +Cc: Wei Liu

On 10/02/17 07:38, Jan Beulich wrote:
> 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 <jbeulich@suse.com>

Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>

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

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2017-02-10 10:48 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-02-10  7:38 [PATCH] x86emul/test: fix 32-bit build Jan Beulich
2017-02-10  8:15 ` Wei Liu
2017-02-10  9:05   ` Jan Beulich
2017-02-10 10:48 ` Andrew Cooper

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.