xen: drop the nop() macro

There isn't a plausible reason to insert nops into code in this manner.

The sole use is in do_debug_key(), and exists to prevent the compiler
optimising the tail of the function with 'jmp debugger_trap_fatal'

In practice, a compiler barrier suffices just as well to prevent the tailcall,
and doesn't involve inserting unnecessary instructions.

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
Reviewed-by: Wei Liu <wei.liu2@citrix.com>
Acked-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Julien Grall <julien.grall@arm.com>
This commit is contained in:
Andrew Cooper committed 2019-03-15 14:36:07 +00:00
1 parent 75e383fa93
commit 3d5adba2ff
3 files changed
+3 -9

No files matched your search

+3 -3
View File
@@ -480,9 +480,9 @@ static void do_debug_key(unsigned char key, struct cpu_user_regs *regs)
{
printk("'%c' pressed -> trapping into debugger\n", key);
(void)debugger_trap_fatal(0xf001, regs);
nop(); /* Prevent the compiler doing tail call
optimisation, as that confuses xendbg a
bit. */
/* Prevent tail call optimisation, which confuses xendbg. */
barrier();
}
static void do_toggle_alt_key(unsigned char key, struct cpu_user_regs *regs)
-3
View File
@@ -5,9 +5,6 @@
#include <xen/lib.h>
#include <public/arch-arm.h>
#define nop() \
asm volatile ( "nop" )
#define sev() asm volatile("sev" : : : "memory")
#define wfe() asm volatile("wfe" : : : "memory")
#define wfi() asm volatile("wfi" : : : "memory")
-3
View File
@@ -17,9 +17,6 @@
#define clflush(a) \
asm volatile ( "clflush (%0)" : : "r"(a) )
#define nop() \
asm volatile ( "nop" )
#define xchg(ptr,v) \
((__typeof__(*(ptr)))__xchg((unsigned long)(v),(ptr),sizeof(*(ptr))))
Reference in new issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.