To use as a common way of testing alternative patching for
livepatches. Both architectures have this FEATURE and the
test-cases can piggyback on that.
Reviewed-by: Ross Lagerwall <ross.lagerwall@citrix.com>
Acked-by: Julien Grall <julien.grall@arm.com>
Suggested-by: Julien Grall <julien.grall@arm.com>
Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
#include <xen/livepatch.h>
#include <xen/vmap.h>
+#include <asm/cpufeature.h>
#include <asm/livepatch.h>
#include <asm/mm.h>
end = (void *)LIVEPATCH_VMAP_END;
vm_init_type(VMAP_XEN, start, end);
+
+ cpus_set_cap(LIVEPATCH_FEATURE);
}
/*
#define ARM64_WORKAROUND_DEVICE_LOAD_ACQUIRE 1
#define ARM32_WORKAROUND_766422 2
#define ARM64_WORKAROUND_834220 3
+#define LIVEPATCH_FEATURE 4
-#define ARM_NCAPS 4
+#define ARM_NCAPS 5
#ifndef __ASSEMBLY__
#define ARCH_PATCH_INSN_SIZE 5
#define ARCH_LIVEPATCH_RANGE SZ_2G
+#define LIVEPATCH_FEATURE X86_FEATURE_ALWAYS
#endif /* __XEN_X86_LIVEPATCH_H__ */
#include <xen/types.h>
#include <asm/alternative.h>
+#include <asm/livepatch.h>
#include <asm/nops.h>
#include <asm/uaccess.h>
unsigned long tmp;
int rc;
- alternative(ASM_NOP8, ASM_NOP1, X86_FEATURE_LM);
+ alternative(ASM_NOP8, ASM_NOP1, LIVEPATCH_FEATURE);
/*
* Any BUG, or WARN_ON will contain symbol and payload name. Furthermore
* exceptions will be caught and processed properly.