 
	
| [Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [Xen-devel] [PATCH RFC] xen: add undefined behaviour sanitizer
 Hi Wei, On 03/10/17 17:03, Wei Liu wrote: Sadly, it is not trivial on Arm to get UBSAN running. It is not because of UBSAN itself but because of the memory layout. We assume that Xen is always smaller than 2MB (assembly code included :/). With UBSAN enabled, Xen binary go way beyond 2MB and will fail to build.I actually have a development branch with a prototype for UBSAN for Arm but I haven't found time to upstream it. I will rebase it on your work. I have got some for Arm too. I will try to post the fixes for Xen 4.10. [...] diff --git a/xen/common/ubsan/ubsan.c b/xen/common/ubsan/ubsan.c new file mode 100644 index 0000000000..aa359e712c --- /dev/null +++ b/xen/common/ubsan/ubsan.c @@ -0,0 +1,486 @@ +/* + * UBSAN error reporting functions + * + * Copyright (c) 2014 Samsung Electronics Co., Ltd. + * Author: Andrey Ryabinin <ryabinin.a.a@xxxxxxxxx> + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation. + * + * Adapt to Xen by: + * Andrew Cooper <andrew.cooper3@xxxxxxxxxx> + * Wei Liu <wei.liu2@xxxxxxxxxx> + */ + +#include <xen/bitops.h> +#include <xen/kernel.h> +#include <xen/lib.h> +#include <xen/types.h> +#include <xen/sched.h> +#include <xen/spinlock.h> +#include <xen/percpu.h> + +#define pr_err(...) printk(XENLOG_ERR __VA_ARGS__) +#define dump_stack dump_execution_state +#define __noreturn noreturn +#define CONFIG_ARCH_SUPPORTS_INT128 I believe this should go in arch specific code. For instance, Arm does not support INT128. +#define u64 long long unsigned int +#define s64 long long int Would not be better to have a typedef for those 2 and use uint64_t and int64_t? Cheers, -- Julien Grall _______________________________________________ Xen-devel mailing list Xen-devel@xxxxxxxxxxxxx https://lists.xen.org/xen-devel 
 
 | 
|  | Lists.xenproject.org is hosted with RackSpace, monitoring our |