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

Re: [PATCH v8 03/26] x86: fixup dependencies for asm/x86_emulate.h





On 11/11/26 8:47 PM, dmukhin@xxxxxxxx wrote:
From: Denis Mukhin <dmukhin@xxxxxxxx>

Add xen/bug.h so that asm/x86_emulate.h can be cleanly used if listed as
the first include in translation unit.

It would help to say what is needed from it: x86emul_invpcid_aux() in
x86_emulate/x86_emulate.h uses ASSERT(), which lives in xen/bug.h, and
xen/lib.h no longer provides it.

I haven't checked by do we really need then inclusion of xen/lib.h in x86_emulate.h? Won't it be enough to have only xen/bug.h as my understanding that the only reason for xen/lib.h is (was) ASSERT?


Amends: 0a249bcb0279 ("x86: reduce dependencies on x86_emulate/x86_emulate.h")

I don't think that commit is where this comes from. A translation unit
containing only #include <asm/x86_emulate.h> fails with "implicit
declaration of function 'ASSERT'" both at 0a249bcb0279 and at its
parent. The ASSERT() dependency got lost with 8de3afc0b402 ("xen: move
BUG_ON(), WARN_ON(), ASSERT(), ASSERT_UNREACHABLE() to xen/bug.h"),
which dropped xen/bug.h from xen/lib.h. Since the header wasn't
self-contained before that either, I'd rather drop the tag than point
it at 0a249bcb0279.

Signed-off-by: Denis Mukhin <dmukhin@xxxxxxxx>
---
  xen/arch/x86/include/asm/x86_emulate.h | 1 +
  1 file changed, 1 insertion(+)

diff --git a/xen/arch/x86/include/asm/x86_emulate.h 
b/xen/arch/x86/include/asm/x86_emulate.h
index 2b75f7f8e215..209d1e54e03f 100644
--- a/xen/arch/x86/include/asm/x86_emulate.h
+++ b/xen/arch/x86/include/asm/x86_emulate.h
@@ -13,6 +13,7 @@
  #define __ASM_X86_X86_EMULATE_H__
#include <xen/types.h>
+#include <xen/bug.h>

Nit: alphabetical order (xen/bug.h first).

  #include <xen/lib.h>
  #include <asm/regs.h>
  #include <asm/x86-defns.h>

~ Oleksii



 


Rackspace

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