* instruction. See apply_alternatives().
*/
.macro altinstruction_entry orig, repl, feature, orig_len, repl_len, pad_len
+ .if \feature >= NCAPINTS * 32
+ .error "alternative feature outside of featureset range"
+ .endif
.long \orig - .
.long \repl - .
.word \feature
#include <xen/lib.h>
#include <xen/stringify.h>
#include <asm/asm-macros.h>
+#include <asm/cpufeatureset.h>
struct __packed alt_instr {
int32_t orig_offset; /* original instruction */
alt_repl_len(n2)) "-" alt_orig_len)
#define ALTINSTR_ENTRY(feature, num) \
+ " .if " STR(feature) " >= " STR(NCAPINTS * 32) "\n" \
+ " .error \"alternative feature outside of featureset range\"\n" \
+ " .endif\n" \
" .long .LXEN%=_orig_s - .\n" /* label */ \
" .long " alt_repl_s(num)" - .\n" /* new instruction */ \
" .word " __stringify(feature) "\n" /* feature bit */ \