[PATCH] xen/nospec: Include <xen/stdbool.h>

Michal Orzel posted 1 patch 1 month, 1 week ago
Patches applied successfully (tree, apply log)
git fetch https://gitlab.com/xen-project/patchew/xen tags/patchew/20240319085042.28470-1-michal.orzel@amd.com
xen/include/xen/nospec.h | 2 ++
1 file changed, 2 insertions(+)
[PATCH] xen/nospec: Include <xen/stdbool.h>
Posted by Michal Orzel 1 month, 1 week ago
After introduction of lock_evaluate_nospec() using bool type, building
Xen on Arm with UBSAN enabled fails:

In file included from ./include/xen/spinlock.h:4,
                 from common/ubsan/ubsan.c:13:
./include/xen/nospec.h:79:22: error: unknown type name ‘bool’
   79 | static always_inline bool lock_evaluate_nospec(bool condition)

There is no issue on x86, as xen/stdbool.h is included somewhere along
the asm/nospec.h path, which is not the case for other architectures.

Fixes: 7ef0084418e1 ("x86/spinlock: introduce support for blocking speculation into critical regions")
Signed-off-by: Michal Orzel <michal.orzel@amd.com>
---
 xen/include/xen/nospec.h | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/xen/include/xen/nospec.h b/xen/include/xen/nospec.h
index e8d73f9538e5..9fb15aa26aa9 100644
--- a/xen/include/xen/nospec.h
+++ b/xen/include/xen/nospec.h
@@ -7,6 +7,8 @@
 #ifndef XEN_NOSPEC_H
 #define XEN_NOSPEC_H
 
+#include <xen/stdbool.h>
+
 #include <asm/nospec.h>
 
 /**
-- 
2.25.1


Re: [PATCH] xen/nospec: Include <xen/stdbool.h>
Posted by Jan Beulich 1 month, 1 week ago
On 19.03.2024 09:50, Michal Orzel wrote:
> After introduction of lock_evaluate_nospec() using bool type, building
> Xen on Arm with UBSAN enabled fails:
> 
> In file included from ./include/xen/spinlock.h:4,
>                  from common/ubsan/ubsan.c:13:
> ./include/xen/nospec.h:79:22: error: unknown type name ‘bool’
>    79 | static always_inline bool lock_evaluate_nospec(bool condition)
> 
> There is no issue on x86, as xen/stdbool.h is included somewhere along
> the asm/nospec.h path, which is not the case for other architectures.
> 
> Fixes: 7ef0084418e1 ("x86/spinlock: introduce support for blocking speculation into critical regions")
> Signed-off-by: Michal Orzel <michal.orzel@amd.com>

Acked-by: Jan Beulich <jbeulich@suse.com>