search for: ud2

Displaying 20 results from an estimated 88 matches for "ud2".

Did you mean: u32
2013 Dec 04
2
[LLVMdev] ud2 and lack of warning messages
Is it just me or would it be nifty if Clang emitted a warning message when it generates an "ud2" (UnDefined2) instruction. I know this is x86-specific, but it would be sort of nice to know up front. After all, the compiler knows perfectly well that it is outputting an "ud2" instruction and I'm pretty sure almost every programmer out there would like to share the unhappy n...
2013 Dec 04
0
[LLVMdev] ud2 and lack of warning messages
Doing this would make clang's diagnostic output dependent on the optimization level, which is absolutely verboten. Also, a ud2 doesn't mean your program has a bug, and I doubt an asm-level diagnostic would be useful to anyone. A ud2 just means "if control flow ever reaches this point, the program has undefined behavior"; in that sense, they don't even have to be emitted. btw, compiling with -fsanitize=u...
2013 Dec 04
1
[LLVMdev] ud2 and lack of warning messages
...the sort.] Hmm, I am mostly thinking of this in terms of an LLVM IR generator who does not have the benefit of an expertly written front-end that can add run-time checks. I just tried this command: clang -c -S -O2 -fsanitize=undefined test.ll a.out And it didn't change anything. The ud2 instructions are still there and there are no checks. And on Windows, this seems to yield nothing but a mouse cursor that blinks once and then the program exits as if nothing had happened. This is possibly caused by the fact that I always operate with Windows Error Reporting disabled. I am in th...
2010 Feb 24
4
Re: [Xen-changelog] [xen-3.4-testing] x86: Generalise BUGFRAME_dump mechanism to allow polled UART irq to
...cstate(void *unused) { dump_execution_state(); <==== keyhandler.c:96 > +#define dump_execution_state() run_in_exception_handler(show_execution_state) > +#define run_in_exception_handler(fn) \ > asm volatile ( \ > - "ud2 ; ret $0" \ > - : : "i" (BUGFRAME_dump) ) > + "ud2 ; ret %0" BUG_STR(1) \ > + : : "i" (BUGFRAME_run_fn), \ > + "i" (fn) ) > On Wed, Feb 24, 20...
2011 Jun 17
3
[LLVMdev] LLVM-based address sanity checker
...I implemented the asm-free way to report warnings as an option to the llvm instrumentation pass (uses a call to run-time). It generates more code, it also creates prologue/epilogue in otherwise leaf functions. Such mode may still be useful if for whatever reason we can not use SIGILL. Default (use ud2): 402ed5: 48 89 d8 mov %rbx,%rax << move the address to rax 402ed8: 0f 0b ud2a << crash 402eda: 52 push %rdx << encode is_write and size in the opcode (note: with a good disassem...
2014 Apr 14
2
[LLVMdev] Emit code for 'unreachable'
I am not seeing this happening, at least not for unreachables that follow calls to 'noreturn' functions. On Apr 14, 2014, at 3:48 AM, Anton Korobeynikov <anton at korobeynikov.info> wrote: > Hello > > x86 backend emits ud2 instruction in this case > > On Mon, Apr 14, 2014 at 1:46 PM, Vadim Chugunov <vadimcn at gmail.com> wrote: >> Hi, >> Is it somehow possible to have LLVM emit machine code for the 'unreachable' >> IR instruction, which would assert that it indeed never gets reac...
2016 Apr 04
5
Optimization bug when byte compiling with gcc 5.3.0 on windows
...oesn't replace it with any version check since I don't see any reason to second-guess when it might be fixed. When it is fixed in MinGW-w64 we can just remove the hack and be happy (I would hope to be able to get round to this in the next few months). 0006-Win32-GCC-5.3-Fix-ISNAN-int-emits-UD2-insn.patch The reason that boxplot.stats() was crashing was because when isnan() is called with an int it emits a UD2 instruction to force a crash, so let us just cast the input value to a double to prevent that. The code for this can be seen here: https://github.com/Alexpux/mingw-w64/blob/master/m...
2014 Apr 15
2
[LLVMdev] Emit code for 'unreachable'
...eachable()' method to > TargetSelectionDAGInfo class, so that targets can emit code for > 'unreachable', if they need that. Does that sound right? > Personally I'm in favor, but others may disagree. Right now clang inserts calls to llvm.trap(), and that's how we get ud2's when falling off the end of a function with a return type. That may be the preferred approach for __builtin_unreachable(), since other clients of LLVM at -O0 may actually want it to produce code quickly without inserting any debugging aids. -------------- next part -------------- An HTML att...
2018 Jan 04
2
FYI, we've posted a component of Spectre mitigation on llvm-commits
...the following form. > > call next > loop: > pause > jmp loop > next: > mov [rsp], r11 > ret > > As I understand it, the busy loop is to cause the speculative execution to > be trapped in the loop. Was something like ud2 considered? I presume that > would stop the speculative execution without involving any of the execution > units the way the busy loop does. > The pause instruction will also avoid tying up execution resources in speculative contexts, so I wouldn't expect it to be significantly differ...
2011 Jun 21
0
[LLVMdev] LLVM-based address sanity checker
...report warnings as an option to the llvm > instrumentation pass (uses a call to run-time). > It generates more code, it also creates prologue/epilogue in otherwise leaf > functions. > Such mode may still be useful if for whatever reason we can not use > SIGILL. > > Default (use ud2): > 402ed5: 48 89 d8 mov %rbx,%rax << move the > address to rax > 402ed8: 0f 0b ud2a << crash > 402eda: 52 push %rdx << encode > is_write and size in the opcode &g...
2020 Jul 25
2
[cfe-dev] Zero length function pointer equality
Looks perfect to me! well, a couple of questions: Why a noop, rather than int3/ud2/etc? Might be worth using the existing code that places such an instruction when building at -O0? & you mention that this causes problems on Windows - but ICF done by the Windows linker does not cause such problems? (I'd have thought they'd result in the same situation - two functions d...
2014 Apr 14
3
[LLVMdev] Emit code for 'unreachable'
Hi, Is it somehow possible to have LLVM emit machine code for the 'unreachable' IR instruction, which would assert that it indeed never gets reached? Vadim -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20140414/02108a74/attachment.html>
2010 Jul 27
0
Problems with the function image()
...ing kernel home-ranges and would like to visualize them with the function image(). The xy-values consist of longitude and latitude data. example:       x        y 36154.97 355143.0   R-code: xy<-hares[,c("x","y")] id<-hares[,"date"]   (ud1 <- kernelUD(xy, id)) ud2 <- getvolumeUD(ud1) image(ud2)   My problem is that the image of the contours is cut at the edges. I tried to include the largest and smalest xy values with xlim and ylim. The contours shift on the Graphics Device of R, but the contours are still cut.   Can anybody help with this problem? Thanky...
2018 Jan 04
0
FYI, we've posted a component of Spectre mitigation on llvm-commits
...as this seems likely to be of relatively broad interest. It looks like this is producing code of the following form. call next loop: pause jmp loop next: mov [rsp], r11 ret As I understand it, the busy loop is to cause the speculative execution to be trapped in the loop. Was something like ud2 considered? I presume that would stop the speculative execution without involving any of the execution units the way the busy loop does. -- Stephen Checkoway
2014 Jul 28
1
[PATCH] x86, paravirt: BUG_ON on {rd,wr}msr exceptions
...n't see what was the > > original issue preventing BUG_ON from being used. > > > > Change rdmsr(), wrmsr(), and rdmsrl() to BUG_ON() on errors. > > How much does this bloat the kernel? It seems to add 8 bytes to each {wr,rd}msr() call (4 extra instructions: test, jmp, ud2, jmp). allyesconfig, paravirt enabled, before: text data bss dec hex filename 108368312 23500872 55705600 187574784 b2e2a00 vmlinux allyesconfig, paravirt enabled, after: text data bss dec hex filename 108384438 23500904...
2014 Jul 28
1
[PATCH] x86, paravirt: BUG_ON on {rd,wr}msr exceptions
...n't see what was the > > original issue preventing BUG_ON from being used. > > > > Change rdmsr(), wrmsr(), and rdmsrl() to BUG_ON() on errors. > > How much does this bloat the kernel? It seems to add 8 bytes to each {wr,rd}msr() call (4 extra instructions: test, jmp, ud2, jmp). allyesconfig, paravirt enabled, before: text data bss dec hex filename 108368312 23500872 55705600 187574784 b2e2a00 vmlinux allyesconfig, paravirt enabled, after: text data bss dec hex filename 108384438 23500904...
2016 Apr 04
0
Optimization bug when byte compiling with gcc 5.3.0 on windows
...onths). I can see increasing the version limit when we commit to gcc 5.x, but I think the point of the test is to remind users of new versions to remind the developers that they have a bug. If we work around it forever, it will never get fixed. > > 0006-Win32-GCC-5.3-Fix-ISNAN-int-emits-UD2-insn.patch > The reason that boxplot.stats() was crashing was because when isnan() is > called with an int it emits a UD2 instruction to force a crash, so let us > just cast the input value to a double to prevent that. The code for this > can be seen here: > https://github.com/Alexpu...
2018 Jan 04
0
FYI, we've posted a component of Spectre mitigation on llvm-commits
...via llvm-dev <llvm-dev at lists.llvm.org> wrote: > On Thu, Jan 4, 2018 at 12:31 PM Stephen Checkoway via llvm-dev <llvm-dev at lists.llvm.org> wrote: > >> As I understand it, the busy loop is to cause the speculative execution to be trapped in the loop. Was something like ud2 considered? I presume that would stop the speculative execution without involving any of the execution units the way the busy loop does. >> > The pause instruction will also avoid tying up execution resources in speculative contexts, so I wouldn't expect it to be significantly differe...
2012 Nov 10
0
[LLVMdev] LLVM IR and Naked functions in C/C++
...p .section __TEXT,__text,regular,pure_instructions .globl __Z9NakedTestii .align 4, 0x90 __Z9NakedTestii: ## @_Z9NakedTestii .cfi_startproc ## BB#0: ## %entry movl %edi, -8(%rbp) movl %esi, -12(%rbp) ## InlineAsm Start ## InlineAsm End ud2 .cfi_endproc The first two highlighted lines are overwriting memory unexpected. The ud2 causes a runtime failure on all naked functions with a return type. The same test.cpp compiled with Xcode 4.5.2's version of clang: .section __TEXT,__text,regular,pure_instructions .globl __Z9NakedTes...
2014 Mar 17
2
[LLVMdev] [RFC] Simple control-flow integrity
...func at PLT The CFI pass would add a special function that would consist only of these intrinsics, one for each jump statement needed by the table, and padded to a power of two using another special intrinsic (something like llvm.undefined.instr) that would lower to an undefined instruction (like ud2 in x86). I'd appreciate feedback anyone might have about this proposal. Thanks, Tom -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20140317/efb5749f/attachment.html>