Skip to content

Commit

Permalink
x86/alternative: introduce alternative_2
Browse files Browse the repository at this point in the history
It's based on alternative_io_2 without inputs or outputs but with an
added memory clobber.

This is part of XSA-321.

Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
Acked-by: Jan Beulich <jbeulich@suse.com>
  • Loading branch information
royger authored and jbeulich committed Jul 7, 2020
1 parent b6d9398 commit 23570bc
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions xen/include/asm-x86/alternative.h
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,11 @@ extern void alternative_branches(void);
#define alternative(oldinstr, newinstr, feature) \
asm volatile (ALTERNATIVE(oldinstr, newinstr, feature) : : : "memory")

#define alternative_2(oldinstr, newinstr1, feature1, newinstr2, feature2) \
asm volatile (ALTERNATIVE_2(oldinstr, newinstr1, feature1, \
newinstr2, feature2) \
: : : "memory")

/*
* Alternative inline assembly with input.
*
Expand Down

0 comments on commit 23570bc

Please sign in to comment.