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

[Xen-devel] [PATCH] tools/tests/x86_emulate: #define unlikely in x86 emulator test harness



"x86emul: in_longmode() should not ignore ->read_msr() errors" aka
c/s 122dd9575c7a introduced a use of unlikely() in
xen/arch/x86/x86_emulate/x86_emulate.c.

I think this is probably intentional and fine.  However, there is no
definition of unlikely in the x86 emulator test harness, under tools.

The result is this error:
  x86_emulate/x86_emulate.c: In function 'in_longmode':
  x86_emulate/x86_emulate.c:1300:10: error: implicit declaration of function 
'unlikely' [-Werror=implicit-function-declaration]
            unlikely(ops->read_msr(MSR_EFER, &efer, ctxt) != X86EMUL_OKAY) )
            ^~~~~~~~

Fix this by providing a boring definition of unlikely().

Signed-off-by: Ian Jackson <Ian.Jackson@xxxxxxxxxxxxx>
CC: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
CC: Jan Beulich <jbeulich@xxxxxxxx>
---
 tools/tests/x86_emulator/x86_emulate.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/tools/tests/x86_emulator/x86_emulate.c 
b/tools/tests/x86_emulator/x86_emulate.c
index c46b7fc..e8f26fe 100644
--- a/tools/tests/x86_emulator/x86_emulate.c
+++ b/tools/tests/x86_emulator/x86_emulate.c
@@ -49,5 +49,6 @@ typedef bool bool_t;
 
 #define __init
 #define __maybe_unused __attribute__((__unused__))
+#define unlikely(x) (x)
 
 #include "x86_emulate/x86_emulate.c"
-- 
2.1.4


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

 


Rackspace

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