"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.jack...@eu.citrix.com>
CC: Andrew Cooper <andrew.coop...@citrix.com>
CC: Jan Beulich <jbeul...@suse.com>
---
 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@lists.xen.org
https://lists.xen.org/xen-devel

Reply via email to