If unsure, say N.
+#
+# For architectures that know their compiler __int128 support is sound
+#
+config ARCH_SUPPORTS_INT128
+ bool
+
source "Kconfig.debug"
Verify that pages that need to be scrubbed before being allocated to
a guest are indeed scrubbed.
+config UBSAN
+ bool "Undefined behaviour sanitizer"
+ depends on HAS_UBSAN
+ ---help---
+ Enable undefined behaviour sanitizer. It uses compiler to insert code
+ snippets so that undefined behaviours in C are detected during runtime.
+ This requires a UBSAN capable compiler and it is a debug only feature.
+
+ If unsure, say N here.
+
endif # DEBUG || EXPERT
endmenu
$(filter-out %.init.o $(nogcov-y),$(obj-y) $(obj-bin-y) $(extra-y)): CFLAGS += -fprofile-arcs -ftest-coverage
endif
+ifeq ($(CONFIG_UBSAN),y)
+$(filter-out %.init.o $(noubsan-y),$(obj-y) $(obj-bin-y) $(extra-y)): CFLAGS += -fsanitize=undefined
+endif
+
ifeq ($(CONFIG_LTO),y)
CFLAGS += -flto
LDFLAGS-$(clang) += -plugin LLVMgold.so
def_bool y
select ACPI
select ACPI_LEGACY_TABLES_LOOKUP
+ select ARCH_SUPPORTS_INT128
select COMPAT
select CORE_PARKING
select HAS_ALTERNATIVE
select HAS_PASSTHROUGH
select HAS_PCI
select HAS_PDX
+ select HAS_UBSAN
select NUMA
select VGA
config HAS_PDX
bool
+config HAS_UBSAN
+ bool
+
config HAS_KEXEC
bool
obj-$(CONFIG_TMEM) += $(tmem-y)
subdir-$(CONFIG_GCOV) += gcov
+subdir-$(CONFIG_UBSAN) += ubsan
subdir-y += libelf
subdir-$(CONFIG_HAS_DEVICE_TREE) += libfdt
*
*/
-#include <linux/bitops.h>
-#include <linux/bug.h>
-#include <linux/ctype.h>
-#include <linux/init.h>
-#include <linux/kernel.h>
-#include <linux/types.h>
-#include <linux/sched.h>
+#include <xen/spinlock.h>
+#include <xen/percpu.h>
+
+#define __noreturn noreturn
+#define pr_err(...) printk(XENLOG_ERR __VA_ARGS__)
+struct xen_ubsan { int in_ubsan; };
+static DEFINE_PER_CPU(struct xen_ubsan[1], in_ubsan);
+#undef current
+#define current this_cpu(in_ubsan)
+#define dump_stack dump_execution_state
+#define u64 long long unsigned int
+#define s64 long long int
#include "ubsan.h"