Skip to contentSkip to conversation

xen: Rename of xSplice to livepatch.

PATCH In review Konrad Rzeszutek Wilk 5 participants 9 messages Jun 2, 2016 – Jun 3, 2016

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 xen: Rename of xSplice to livepatch.

Specifically:

s/\.xsplice/\.livepatch/ s/XSPLICE/LIVEPATCH/ s/xsplice/livepatch/ s/livepatch_patch_func/livepatch_func/ s/xSplice/Xen Live Patch/

And then modify some of the function arguments to have two more characters.

---
Cc: Ross Lagerwall <[email protected]>
Cc: Andrew Cooper <[email protected]>
Cc: George Dunlap <[email protected]>
Cc: Ian Jackson <[email protected]>
Cc: Jan Beulich <[email protected]>
Cc: Konrad Rzeszutek Wilk <[email protected]>
Cc: Stefano Stabellini <[email protected]>
Cc: Tim Deegan <[email protected]>
Cc: Wei Liu <[email protected]>
Cc: Martin Pohlack <[email protected]>

v2: Ditch the LIVE_PATCH and 'Live Patching' inconsitency.
Include Ross's email correctly.
Don't move alphabetically the #include header as it is inconsistent

---
 .gitignore                                         |   8 +-
 MAINTAINERS                                        |  12 +-
 docs/misc/{xsplice.markdown => livepatch.markdown} | 184 +++++-----
 tools/flask/policy/policy/modules/xen/xen.te       |   2 +-
 tools/libxc/include/xenctrl.h                      |  32 +-
 tools/libxc/xc_misc.c                              | 142 ++++----
 tools/misc/Makefile                                |   4 +-
 tools/misc/{xen-xsplice.c => xen-livepatch.c}      |  62 ++--
 xen/arch/arm/Makefile                              |   2 +-
 xen/arch/arm/{xsplice.c => livepatch.c}            |  38 +--
 xen/arch/x86/Makefile                              |   8 +-
 xen/arch/x86/alternative.c                         |  18 +-
 xen/arch/x86/domain.c                              |   4 +-
 xen/arch/x86/extable.c                             |   8 +-
 xen/arch/x86/{xsplice.c => livepatch.c}            |  56 ++--
 xen/arch/x86/test/Makefile                         |  58 ++--
 xen/arch/x86/test/xen_bye_world.c                  |   6 +-
 xen/arch/x86/test/xen_hello_world.c                |   6 +-
 xen/arch/x86/test/xen_replace_world.c              |   6 +-
 xen/arch/x86/traps.c                               |   2 +-
 xen/common/Kconfig                                 |  10 +-
 xen/common/Makefile                                |   4 +-
 xen/common/{xsplice.c => livepatch.c}              | 370 ++++++++++-----------
 xen/common/{xsplice_elf.c => livepatch_elf.c}      | 109 +++---
 xen/common/sysctl.c                                |   6 +-
 xen/common/virtual_region.c                        |   4 +-
 xen/common/vsprintf.c                              |   4 +-
 xen/include/asm-x86/current.h                      |   8 +-
 xen/include/public/sysctl.h                        | 138 ++++----
 xen/include/xen/elfstructs.h                       |   2 +-
 xen/include/xen/{xsplice.h => livepatch.h}         | 100 +++---
 xen/include/xen/{xsplice_elf.h => livepatch_elf.h} |  35 +-
 xen/xsm/flask/hooks.c                              |   4 +-
 xen/xsm/flask/policy/access_vectors                |   4 +-
 34 files changed, 729 insertions(+), 727 deletions(-)
 rename docs/misc/{xsplice.markdown => livepatch.markdown} (87%)
 rename tools/misc/{xen-xsplice.c => xen-livepatch.c} (86%)
 rename xen/arch/arm/{xsplice.c => livepatch.c} (29%)
 rename xen/arch/x86/{xsplice.c => livepatch.c} (74%)
 rename xen/common/{xsplice.c => livepatch.c} (75%)
 rename xen/common/{xsplice_elf.c => livepatch_elf.c} (72%)
 rename xen/include/xen/{xsplice.h => livepatch.h} (34%)
 rename xen/include/xen/{xsplice_elf.h => livepatch_elf.h} (56%)
.gitignore +4 -4
index 1b73293..7347801 100644
@@ -182,7 +182,7 @@ tools/misc/xen_cpuperf
 tools/misc/xen-cpuid
 tools/misc/xen-detect
 tools/misc/xen-tmem-list-parse
-tools/misc/xen-xsplice
+tools/misc/xen-livepatch
 tools/misc/xenperf
 tools/misc/xenpm
 tools/misc/xen-hvmctx
@@ -247,9 +247,9 @@ xen/arch/x86/efi/check.efi
 xen/arch/x86/efi/disabled
 xen/arch/x86/efi/mkreloc
 xen/arch/x86/test/config.h
-xen/arch/x86/test/xen_hello_world.xsplice
-xen/arch/x86/test/xen_bye_world.xsplice
-xen/arch/x86/test/xen_replace_world.xsplice
+xen/arch/x86/test/xen_hello_world.livepatch
+xen/arch/x86/test/xen_bye_world.livepatch
+xen/arch/x86/test/xen_replace_world.livepatch
 xen/arch/*/efi/boot.c
 xen/arch/*/efi/compat.c
 xen/arch/*/efi/efi.h
MAINTAINERS +6 -6
index 62f4ffd..18b3968 100644
@@ -470,15 +470,15 @@ F:  xen/include/xsm/
 F:  xen/xsm/
 F:  docs/misc/xsm-flask.txt
 
-XSPLICE
+LIVEPATCH
 M:  Konrad Rzeszutek Wilk <[email protected]>
 M:  Ross Lagerwall <[email protected]>
 S:  Supported
-F:  docs/misc/xsplice.markdown
-F:  tools/misc/xen-xsplice.c
-F:  xen/arch/*/xsplice*
-F:  xen/common/xsplice*
-F:  xen/include/xen/xsplice*
+F:  docs/misc/livepatch.markdown
+F:  tools/misc/xen-livepatch.c
+F:  xen/arch/*/livepatch*
+F:  xen/common/livepatch*
+F:  xen/include/xen/livepatch*
 
 THE REST
 M:	Andrew Cooper <[email protected]>
docs/misc/livepatch.markdown renamed from docs/misc/xsplice.markdown +92 -92

435 lines not on this page · raw message

tools/flask/policy/policy/modules/xen/xen.te +1 -1
index 0b1c955..50aa602 100644
@@ -74,7 +74,7 @@ allow dom0_t xen_t:xen2 {
     get_symbol
     get_cpu_levelling_caps
     get_cpu_featureset
-    xsplice_op
+    livepatch_op
 };
 
 # Allow dom0 to use all XENVER_ subops that have checks.
tools/libxc/include/xenctrl.h +16 -16
index dc54612..6ae1a2b 100644
@@ -2610,15 +2610,15 @@ const uint32_t *xc_get_feature_deep_deps(uint32_t feature);
 
 #endif
 
-int xc_xsplice_upload(xc_interface *xch,
-                      char *name, unsigned char *payload, uint32_t size);
+int xc_livepatch_upload(xc_interface *xch,
+                        char *name, unsigned char *payload, uint32_t size);
 
-int xc_xsplice_get(xc_interface *xch,
-                   char *name,
-                   xen_xsplice_status_t *status);
+int xc_livepatch_get(xc_interface *xch,
+                     char *name,
+                     xen_livepatch_status_t *status);
 
 /*
- * The heart of this function is to get an array of xen_xsplice_status_t.
+ * The heart of this function is to get an array of xen_livepatch_status_t.
  *
  * However it is complex because it has to deal with the hypervisor
  * returning some of the requested data or data being stale
@@ -2638,10 +2638,10 @@ int xc_xsplice_get(xc_interface *xch,
  * number of entries that 'info', 'name', and 'len' arrays can
  * be filled up with.
  *
- * Each entry in the 'name' array is expected to be of XEN_XSPLICE_NAME_SIZE
+ * Each entry in the 'name' array is expected to be of XEN_LIVEPATCH_NAME_SIZE
  * length.
  *
- * Each entry in the 'info' array is expected to be of xen_xsplice_status_t
+ * Each entry in the 'info' array is expected to be of xen_livepatch_status_t
  * structure size.
  *
  * Each entry in the 'len' array is expected to be of uint32_t size.
@@ -2655,10 +2655,10 @@ int xc_xsplice_get(xc_interface *xch,
  * will contain the number of entries that had been succesfully
  * retrieved (if any).
  */
-int xc_xsplice_list(xc_interface *xch, unsigned int max, unsigned int start,
-                    xen_xsplice_status_t *info, char *name,
-                    uint32_t *len, unsigned int *done,
-                    unsigned int *left);
+int xc_livepatch_list(xc_interface *xch, unsigned int max, unsigned int start,
+                      xen_livepatch_status_t *info, char *name,
+                      uint32_t *len, unsigned int *done,
+                      unsigned int *left);
 
 /*
  * The operations are asynchronous and the hypervisor may take a while
@@ -2666,10 +2666,10 @@ int xc_xsplice_list(xc_interface *xch, unsigned int max, unsigned int start,
  * operation if it could not be completed within the specified time
  * (in ms). Value of 0 means let hypervisor decide the best timeout.
  */
-int xc_xsplice_apply(xc_interface *xch, char *name, uint32_t timeout);
-int xc_xsplice_revert(xc_interface *xch, char *name, uint32_t timeout);
-int xc_xsplice_unload(xc_interface *xch, char *name, uint32_t timeout);
-int xc_xsplice_replace(xc_interface *xch, char *name, uint32_t timeout);
+int xc_livepatch_apply(xc_interface *xch, char *name, uint32_t timeout);
+int xc_livepatch_revert(xc_interface *xch, char *name, uint32_t timeout);
+int xc_livepatch_unload(xc_interface *xch, char *name, uint32_t timeout);
+int xc_livepatch_replace(xc_interface *xch, char *name, uint32_t timeout);
 
 /* Compat shims */
 #include "xenctrl_compat.h"
tools/libxc/xc_misc.c +71 -71

297 lines not on this page · raw message

tools/misc/Makefile +2 -2
index 3a5f842..cee2b99 100644
@@ -32,7 +32,7 @@ INSTALL_SBIN                   += xenlockprof
 INSTALL_SBIN                   += xenperf
 INSTALL_SBIN                   += xenpm
 INSTALL_SBIN                   += xenwatchdogd
-INSTALL_SBIN                   += xen-xsplice
+INSTALL_SBIN                   += xen-livepatch
 INSTALL_SBIN += $(INSTALL_SBIN-y)
 
 # Everything to be installed in a private bin/
@@ -104,7 +104,7 @@ xen-mfndump: xen-mfndump.o
 xenwatchdogd: xenwatchdogd.o
 	$(CC) $(LDFLAGS) -o $@ $< $(LDLIBS_libxenctrl) $(APPEND_LDFLAGS)
 
-xen-xsplice: xen-xsplice.o
+xen-livepatch: xen-livepatch.o
 	$(CC) $(LDFLAGS) -o $@ $< $(LDLIBS_libxenctrl) $(APPEND_LDFLAGS)
 
 xen-lowmemd: xen-lowmemd.o
tools/misc/xen-livepatch.c renamed from tools/misc/xen-xsplice.c +31 -31

167 lines not on this page · raw message

xen/arch/arm/Makefile +1 -1
index ead0cc0..af4d0e1 100644
@@ -40,7 +40,7 @@ obj-y += device.o
 obj-y += decode.o
 obj-y += processor.o
 obj-y += smc.o
-obj-$(CONFIG_XSPLICE) += xsplice.o
+obj-$(CONFIG_LIVEPATCH) += livepatch.o
 
 #obj-bin-y += ....o
 
xen/arch/arm/livepatch.c renamed from xen/arch/arm/xsplice.c +19 -19
similarity index 29%
rename from xen/arch/arm/xsplice.c
rename to xen/arch/arm/livepatch.c
index db0dce2..cfae6dd 100644
@@ -4,67 +4,67 @@
 #include <xen/errno.h>
 #include <xen/init.h>
 #include <xen/lib.h>
-#include <xen/xsplice_elf.h>
-#include <xen/xsplice.h>
+#include <xen/livepatch_elf.h>
+#include <xen/livepatch.h>
 
-void arch_xsplice_patching_enter(void)
+void arch_livepatching_enter(void)
 {
 }
 
-void arch_xsplice_patching_leave(void)
+void arch_livepatching_leave(void)
 {
 }
 
-int arch_xsplice_verify_func(const struct xsplice_patch_func *func)
+int arch_livepatch_verify_func(const struct livepatch_func *func)
 {
     return -ENOSYS;
 }
 
-void arch_xsplice_apply_jmp(struct xsplice_patch_func *func)
+void arch_livepatch_apply_jmp(struct livepatch_func *func)
 {
 }
 
-void arch_xsplice_revert_jmp(const struct xsplice_patch_func *func)
+void arch_livepatch_revert_jmp(const struct livepatch_func *func)
 {
 }
 
-void arch_xsplice_post_action(void)
+void arch_livepatch_post_action(void)
 {
 }
 
-void arch_xsplice_mask(void)
+void arch_livepatch_mask(void)
 {
 }
 
-void arch_xsplice_unmask(void)
+void arch_livepatch_unmask(void)
 {
 }
 
-int arch_xsplice_verify_elf(const struct xsplice_elf *elf)
+int arch_livepatch_verify_elf(const struct livepatch_elf *elf)
 {
     return -ENOSYS;
 }
 
-int arch_xsplice_perform_rel(struct xsplice_elf *elf,
-                             const struct xsplice_elf_sec *base,
-                             const struct xsplice_elf_sec *rela)
+int arch_livepatch_perform_rel(struct livepatch_elf *elf,
+                               const struct livepatch_elf_sec *base,
+                               const struct livepatch_elf_sec *rela)
 {
     return -ENOSYS;
 }
 
-int arch_xsplice_perform_rela(struct xsplice_elf *elf,
-                              const struct xsplice_elf_sec *base,
-                              const struct xsplice_elf_sec *rela)
+int arch_livepatch_perform_rela(struct livepatch_elf *elf,
+                                const struct livepatch_elf_sec *base,
+                                const struct livepatch_elf_sec *rela)
 {
     return -ENOSYS;
 }
 
-int arch_xsplice_secure(const void *va, unsigned int pages, enum va_type type)
+int arch_livepatch_secure(const void *va, unsigned int pages, enum va_type type)
 {
     return -ENOSYS;
 }
 
-void __init arch_xsplice_init(void)
+void __init arch_livepatch_init(void)
 {
 }
 
xen/arch/x86/Makefile +4 -4
index 4665a68..b377c91 100644
@@ -7,7 +7,7 @@ subdir-$(CONFIG_XENOPROF) += oprofile
 subdir-y += x86_64
 
 alternative-y := alternative.init.o
-alternative-$(CONFIG_XSPLICE) :=
+alternative-$(CONFIG_LIVEPATCH) :=
 obj-bin-y += $(alternative-y)
 obj-y += apic.o
 obj-y += bitops.o
@@ -30,6 +30,7 @@ obj-y += flushtlb.o
 obj-y += i387.o
 obj-y += i8259.o
 obj-y += io_apic.o
+obj-$(CONFIG_LIVEPATCH) += alternative.o livepatch.o
 obj-y += msi.o
 obj-y += ioport_emulate.o
 obj-y += irq.o
@@ -63,7 +64,6 @@ obj-y += x86_emulate.o
 obj-y += tboot.o
 obj-y += hpet.o
 obj-y += vm_event.o
-obj-$(CONFIG_XSPLICE) += alternative.o xsplice.o
 obj-y += xstate.o
 
 obj-$(crash_debug) += gdbstub.o
@@ -80,7 +80,7 @@ else
 notes_phdrs =
 endif
 
-ifdef CONFIG_XSPLICE
+ifdef CONFIG_LIVEPATCH
 all_symbols = --all-symbols
 ifdef CONFIG_FAST_SYMBOL_LOOKUP
 all_symbols = --all-symbols --sort-by-name
@@ -95,7 +95,7 @@ $(TARGET): $(TARGET)-syms $(efi-y) boot/mkelf32
 
 .PHONY: tests
 tests:
-	$(MAKE) -f $(BASEDIR)/Rules.mk -C test xsplice
+	$(MAKE) -f $(BASEDIR)/Rules.mk -C test livepatch
 
 ALL_OBJS := $(BASEDIR)/arch/x86/boot/built_in.o $(BASEDIR)/arch/x86/efi/built_in.o $(ALL_OBJS)
 
xen/arch/x86/alternative.c +9 -9
index c188a15..be40b13 100644
@@ -22,14 +22,14 @@
 #include <asm/system.h>
 #include <asm/traps.h>
 #include <asm/nmi.h>
-#include <xen/xsplice.h>
+#include <xen/livepatch.h>
 
 #define MAX_PATCH_LEN (255-1)
 
 extern struct alt_instr __alt_instructions[], __alt_instructions_end[];
 
 #ifdef K8_NOP1
-static const unsigned char k8nops[] init_or_xsplice_const = {
+static const unsigned char k8nops[] init_or_livepatch_const = {
     K8_NOP1,
     K8_NOP2,
     K8_NOP3,
@@ -39,7 +39,7 @@ static const unsigned char k8nops[] init_or_xsplice_const = {
     K8_NOP7,
     K8_NOP8
 };
-static const unsigned char * const k8_nops[ASM_NOP_MAX+1] init_or_xsplice_constrel = {
+static const unsigned char * const k8_nops[ASM_NOP_MAX+1] init_or_livepatch_constrel = {
     NULL,
     k8nops,
     k8nops + 1,
@@ -53,7 +53,7 @@ static const unsigned char * const k8_nops[ASM_NOP_MAX+1] init_or_xsplice_constr
 #endif
 
 #ifdef P6_NOP1
-static const unsigned char p6nops[] init_or_xsplice_const = {
+static const unsigned char p6nops[] init_or_livepatch_const = {
     P6_NOP1,
     P6_NOP2,
     P6_NOP3,
@@ -63,7 +63,7 @@ static const unsigned char p6nops[] init_or_xsplice_const = {
     P6_NOP7,
     P6_NOP8
 };
-static const unsigned char * const p6_nops[ASM_NOP_MAX+1] init_or_xsplice_constrel = {
+static const unsigned char * const p6_nops[ASM_NOP_MAX+1] init_or_livepatch_constrel = {
     NULL,
     p6nops,
     p6nops + 1,
@@ -76,7 +76,7 @@ static const unsigned char * const p6_nops[ASM_NOP_MAX+1] init_or_xsplice_constr
 };
 #endif
 
-static const unsigned char * const *ideal_nops init_or_xsplice_data = k8_nops;
+static const unsigned char * const *ideal_nops init_or_livepatch_data = k8_nops;
 
 static int __init mask_nmi_callback(const struct cpu_user_regs *regs, int cpu)
 {
@@ -101,7 +101,7 @@ static void __init arch_init_ideal_nops(void)
 }
 
 /* Use this to add nops to a buffer, then text_poke the whole buffer. */
-static void init_or_xsplice add_nops(void *insns, unsigned int len)
+static void init_or_livepatch add_nops(void *insns, unsigned int len)
 {
     while ( len > 0 )
     {
@@ -129,7 +129,7 @@ static void init_or_xsplice add_nops(void *insns, unsigned int len)
  * You should run this with interrupts disabled or on code that is not
  * executing.
  */
-static void *init_or_xsplice text_poke(void *addr, const void *opcode, size_t len)
+static void *init_or_livepatch text_poke(void *addr, const void *opcode, size_t len)
 {
     memcpy(addr, opcode, len);
     sync_core();
@@ -144,7 +144,7 @@ static void *init_or_xsplice text_poke(void *addr, const void *opcode, size_t le
  * APs have less capabilities than the boot processor are not handled.
  * Tough. Make sure you disable such features by hand.
  */
-void init_or_xsplice apply_alternatives_nocheck(struct alt_instr *start, struct alt_instr *end)
+void init_or_livepatch apply_alternatives_nocheck(struct alt_instr *start, struct alt_instr *end)
 {
     struct alt_instr *a;
     u8 *instr, *replacement;
xen/arch/x86/domain.c +2 -2
index 5af2cc5..f2d7f47 100644
@@ -36,7 +36,7 @@
 #include <xen/cpu.h>
 #include <xen/wait.h>
 #include <xen/guest_access.h>
-#include <xen/xsplice.h>
+#include <xen/livepatch.h>
 #include <public/sysctl.h>
 #include <public/hvm/hvm_vcpu.h>
 #include <asm/regs.h>
@@ -125,7 +125,7 @@ static void idle_loop(void)
          * We MUST be last (or before pm_idle). Otherwise after we get the
          * softirq we would execute pm_idle (and sleep) and not patch.
          */
-        check_for_xsplice_work();
+        check_for_livepatch_work();
     }
 }
 
xen/arch/x86/extable.c +4 -4
index 349df79..701441a 100644
@@ -7,7 +7,7 @@
 #include <xen/spinlock.h>
 #include <asm/uaccess.h>
 #include <xen/virtual_region.h>
-#include <xen/xsplice.h>
+#include <xen/livepatch.h>
 
 #define EX_FIELD(ptr, field) ((unsigned long)&(ptr)->field + (ptr)->field)
 
@@ -21,7 +21,7 @@ static inline unsigned long ex_cont(const struct exception_table_entry *x)
 	return EX_FIELD(x, cont);
 }
 
-static int init_or_xsplice cmp_ex(const void *a, const void *b)
+static int init_or_livepatch cmp_ex(const void *a, const void *b)
 {
 	const struct exception_table_entry *l = a, *r = b;
 	unsigned long lip = ex_addr(l);
@@ -36,7 +36,7 @@ static int init_or_xsplice cmp_ex(const void *a, const void *b)
 }
 
 #ifndef swap_ex
-static void init_or_xsplice swap_ex(void *a, void *b, int size)
+static void init_or_livepatch swap_ex(void *a, void *b, int size)
 {
 	struct exception_table_entry *l = a, *r = b, tmp;
 	long delta = b - a;
@@ -49,7 +49,7 @@ static void init_or_xsplice swap_ex(void *a, void *b, int size)
 }
 #endif
 
-void init_or_xsplice sort_exception_table(struct exception_table_entry *start,
+void init_or_livepatch sort_exception_table(struct exception_table_entry *start,
                                  const struct exception_table_entry *stop)
 {
     sort(start, stop - start,
xen/arch/x86/livepatch.c renamed from xen/arch/x86/xsplice.c +28 -28

174 lines not on this page · raw message

xen/arch/x86/test/Makefile +29 -29

96 lines not on this page · raw message

xen/arch/x86/test/xen_bye_world.c +3 -3
index f93f969..b75e0b1 100644
@@ -7,15 +7,15 @@
 #include <xen/lib.h>
 #include <xen/types.h>
 #include <xen/version.h>
-#include <xen/xsplice.h>
+#include <xen/livepatch.h>
 
 #include <public/sysctl.h>
 
 static char bye_world_patch_this_fnc[] = "xen_extra_version";
 extern const char *xen_bye_world(void);
 
-struct xsplice_patch_func __section(".xsplice.funcs") xsplice_xen_bye_world = {
-    .version = XSPLICE_PAYLOAD_VERSION,
+struct livepatch_func __section(".livepatch.funcs") livepatch_xen_bye_world = {
+    .version = LIVEPATCH_PAYLOAD_VERSION,
     .name = bye_world_patch_this_fnc,
     .new_addr = xen_bye_world,
     .old_addr = xen_extra_version,
xen/arch/x86/test/xen_hello_world.c +3 -3
index 8afd66e..422bdf1 100644
@@ -6,15 +6,15 @@
 #include "config.h"
 #include <xen/types.h>
 #include <xen/version.h>
-#include <xen/xsplice.h>
+#include <xen/livepatch.h>
 
 #include <public/sysctl.h>
 
 static char hello_world_patch_this_fnc[] = "xen_extra_version";
 extern const char *xen_hello_world(void);
 
-struct xsplice_patch_func __section(".xsplice.funcs") xsplice_xen_hello_world = {
-    .version = XSPLICE_PAYLOAD_VERSION,
+struct livepatch_func __section(".livepatch.funcs") livepatch_xen_hello_world = {
+    .version = LIVEPATCH_PAYLOAD_VERSION,
     .name = hello_world_patch_this_fnc,
     .new_addr = xen_hello_world,
     .old_addr = xen_extra_version,
xen/arch/x86/test/xen_replace_world.c +3 -3
index fab2841..a2a221a 100644
@@ -6,15 +6,15 @@
 #include "config.h"
 #include <xen/lib.h>
 #include <xen/types.h>
-#include <xen/xsplice.h>
+#include <xen/livepatch.h>
 
 #include <public/sysctl.h>
 
 static char xen_replace_world_name[] = "xen_extra_version";
 extern const char *xen_replace_world(void);
 
-struct xsplice_patch_func __section(".xsplice.funcs") xsplice_xen_replace_world = {
-    .version = XSPLICE_PAYLOAD_VERSION,
+struct livepatch_func __section(".livepatch.funcs") livepatch_xen_replace_world = {
+    .version = LIVEPATCH_PAYLOAD_VERSION,
     .name = xen_replace_world_name,
     .old_addr = 0, /* Forces the hypervisor to lookup .name */
     .new_addr = xen_replace_world,
xen/arch/x86/traps.c +1 -1
index 5d7232d..c4e0e6f 100644
@@ -50,7 +50,7 @@
 #include <xen/paging.h>
 #include <xen/virtual_region.h>
 #include <xen/watchdog.h>
-#include <xen/xsplice.h>
+#include <xen/livepatch.h>
 #include <asm/system.h>
 #include <asm/io.h>
 #include <asm/atomic.h>
xen/common/Kconfig +5 -5
index 91ea904..63bde26 100644
@@ -192,9 +192,9 @@ config SCHED_DEFAULT
 
 endmenu
 
-# Enable/Disable xsplice support
-config XSPLICE
-	bool "xSplice live patching support (TECH PREVIEW)"
+# Enable/Disable live patching support
+config LIVEPATCH
+	bool "Live patching support (TECH PREVIEW)"
 	default n
 	depends on X86 && HAS_BUILD_ID = "y"
 	---help---
@@ -207,13 +207,13 @@ config XSPLICE
 config FAST_SYMBOL_LOOKUP
 	bool "Fast symbol lookup (bigger binary)"
 	default y
-	depends on XSPLICE
+	depends on LIVEPATCH
 	---help---
 	  When searching for symbol addresses we can use the built-in system
 	  that is optimized for searching symbols using addresses as the key.
 	  However using it for the inverse (find address using the symbol name)
 	  it is slow. This extra data and code (~55kB) speeds up the search.
-	  The only user of this is xSplice.
+	  The only user of this is live patch.
 
 	  If unsure, say Y.
 endmenu
xen/common/Makefile +2 -2
index afd84b6..4765831 100644
@@ -58,8 +58,8 @@ obj-y += vsprintf.o
 obj-y += wait.o
 obj-$(CONFIG_XENOPROF) += xenoprof.o
 obj-y += xmalloc_tlsf.o
-obj-$(CONFIG_XSPLICE) += xsplice.o
-obj-$(CONFIG_XSPLICE) += xsplice_elf.o
+obj-$(CONFIG_LIVEPATCH) += livepatch.o
+obj-$(CONFIG_LIVEPATCH) += livepatch_elf.o
 
 obj-bin-$(CONFIG_X86) += $(foreach n,decompress bunzip2 unxz unlzma unlzo unlz4 earlycpio,$(n).init.o)
 
xen/common/livepatch.c renamed from xen/common/xsplice.c +185 -185

1,023 lines not on this page · raw message

xen/common/livepatch_elf.c renamed from xen/common/xsplice_elf.c +55 -54

331 lines not on this page · raw message

xen/common/sysctl.c +3 -3
index 9a4cc1f..75f4c05 100644

Lines of this file are not shown. View the raw message.

xen/common/virtual_region.c +2 -2
index 426dfa0..b666bc9 100644

Lines of this file are not shown. View the raw message.

xen/common/vsprintf.c +2 -2
index 70e1edf..226ef86 100644

Lines of this file are not shown. View the raw message.

xen/include/asm-x86/current.h +4 -4
index fa55602..e6587e6 100644

Lines of this file are not shown. View the raw message.

xen/include/public/sysctl.h +69 -69

138 lines not on this page · raw message

xen/include/xen/elfstructs.h +1 -1
index 68954b0..5f2082e 100644

Lines of this file are not shown. View the raw message.

xen/include/xen/livepatch.h renamed from xen/include/xen/xsplice.h +50 -50

100 lines not on this page · raw message

xen/include/xen/livepatch_elf.h renamed from xen/include/xen/xsplice_elf.h +18 -17
similarity index 56%
rename from xen/include/xen/xsplice_elf.h
rename to xen/include/xen/livepatch_elf.h
index 750dc94..7e7c86e 100644

Lines of this file are not shown. View the raw message.

xen/xsm/flask/hooks.c +2 -2
index 7477dbe..20d46c8 100644

Lines of this file are not shown. View the raw message.

xen/xsm/flask/policy/access_vectors +2 -2
index 4d1b548..3d29042 100644

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

Signature · 7 lines
2.5.5


_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel

Part of the diff is not shown here. View the raw message.

Acked-by on v2 1/1
#1 lore raw
Quoted 12 lines
Quoted 1 line
Quoted 1 line · On 02.06.16 at 16:05, <[email protected]> wrote:
MAINTAINERS +1 -1
@@ -470,15 +470,15 @@ F:  xen/include/xsm/
 F:  xen/xsm/
 F:  docs/misc/xsm-flask.txt
 
-XSPLICE
+LIVEPATCH
 M:  Konrad Rzeszutek Wilk <[email protected]>
 M:  Ross Lagerwall <[email protected]>
 S:  Supported

MAINTAINERS F: xen/include/xsm/ · line 481

Quoted 10 lines
MAINTAINERS +5 -5
-F:  docs/misc/xsplice.markdown
-F:  tools/misc/xen-xsplice.c
-F:  xen/arch/*/xsplice*
-F:  xen/common/xsplice*
-F:  xen/include/xen/xsplice*
+F:  docs/misc/livepatch.markdown
+F:  tools/misc/xen-livepatch.c
+F:  xen/arch/*/livepatch*
+F:  xen/common/livepatch*
+F:  xen/include/xen/livepatch*

This file is sorted, so the section should move up.

xen/arch/arm/livepatch.c line 10

Quoted 13 lines
xen/arch/arm/livepatch.c renamed from xen/arch/arm/xsplice.c +3 -3
@@ -4,67 +4,67 @@
 #include <xen/errno.h>
 #include <xen/init.h>
 #include <xen/lib.h>
-#include <xen/xsplice_elf.h>
-#include <xen/xsplice.h>
+#include <xen/livepatch_elf.h>
+#include <xen/livepatch.h>
 
-void arch_xsplice_patching_enter(void)
+void arch_livepatching_enter(void)

Still "patching"?

Quoted 18 lines
xen/common/Kconfig +3 -3
@@ -192,9 +192,9 @@ config SCHED_DEFAULT
 
 endmenu
 
-# Enable/Disable xsplice support
-config XSPLICE
-	bool "xSplice live patching support (TECH PREVIEW)"
+# Enable/Disable live patching support
+config LIVEPATCH
+	bool "Live patching support (TECH PREVIEW)"
 	default n
 	depends on X86 && HAS_BUILD_ID = "y"
 	---help---
@@ -207,13 +207,13 @@ config XSPLICE
 config FAST_SYMBOL_LOOKUP
 	bool "Fast symbol lookup (bigger binary)"

xen/common/Kconfig config XSPLICE · line 216

Quoted 10 lines
xen/common/Kconfig +2 -2
 	default y
-	depends on XSPLICE
+	depends on LIVEPATCH
 	---help---
 	  When searching for symbol addresses we can use the built-in system
 	  that is optimized for searching symbols using addresses as the key.
 	  However using it for the inverse (find address using the symbol name)
 	  it is slow. This extra data and code (~55kB) speeds up the search.
-	  The only user of this is xSplice.
+	  The only user of this is live patch.

Should at least the L be upper case? Or even better say Live patching, to match its config item's prompt?

xen/common/Makefile obj-y += vsprintf.o · line 62

Quoted 10 lines
xen/common/Makefile +2 -2
@@ -58,8 +58,8 @@ obj-y += vsprintf.o
 obj-y += wait.o
 obj-$(CONFIG_XENOPROF) += xenoprof.o
 obj-y += xmalloc_tlsf.o
-obj-$(CONFIG_XSPLICE) += xsplice.o
-obj-$(CONFIG_XSPLICE) += xsplice_elf.o
+obj-$(CONFIG_LIVEPATCH) += livepatch.o
+obj-$(CONFIG_LIVEPATCH) += livepatch_elf.o

These need to move up now. I'd also like to encourage you to merge the two lines.

xen/common/Makefile static char *pointer(char *str, char *end, const char **fmt_ptr, · line 359

Quoted 6 lines
xen/common/Makefile +1 -1
@@ -356,7 +356,7 @@ static char *pointer(char *str, char *end, const char **fmt_ptr,
         }
 
         /*
-         * namebuf contents and s for core hypervisor are same but for xSplice
+         * namebuf contents and s for core hypervisor are same but for live patch

"live patch" here and ...

xen/include/xen/elfstructs.h typedef struct { · line 356

Quoted 8 lines
xen/include/xen/elfstructs.h +1 -1
@@ -353,7 +353,7 @@ typedef struct {
 #define	ELF64_R_TYPE(info)	((info) & 0xFFFFFFFF)
 #define ELF64_R_INFO(s,t) 	(((s) << 32) + (u_int32_t)(t))
 
-/* x86-64 relocation types. We list only the ones xSplice implements. */
+/* x86-64 relocation types. We list only the ones Live Patch implements. */

"Live Patch" here - please try to be consistent (personally I prefer the latter).

With those taken care of,

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel

#2 lore raw
Quoted 12 lines · Jan Beulich
Quoted 12 lines
xen/arch/arm/livepatch.c renamed from xen/arch/arm/xsplice.c +2 -2
@@ -4,67 +4,67 @@
 #include <xen/errno.h>
 #include <xen/init.h>
 #include <xen/lib.h>
-#include <xen/xsplice_elf.h>
-#include <xen/xsplice.h>
+#include <xen/livepatch_elf.h>
+#include <xen/livepatch.h>
 
Quoted 3 lines

xen/arch/arm/livepatch.c line 10

Quoted 2 lines
xen/arch/arm/livepatch.c renamed from xen/arch/arm/xsplice.c +1 -1
-void arch_xsplice_patching_enter(void)
+void arch_livepatching_enter(void)

Still "patching"?

This function came from one of my additions to the series. It half of a pair of calls around the critical region which is writing new code/data, where CR0.WP needs tweaking.

As such, 'patching' was logically distinct from the name 'livepatch' as the general namespace of these functions, and referred to the critical region of actually changing live memory.

I am at a loss to suggest a better alternative.

~Andrew

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel

#3 lore raw
Quoted 21 lines · Andrew Cooper
Quoted 12 lines · Jan Beulich
Quoted 12 lines
xen/arch/arm/livepatch.c renamed from xen/arch/arm/xsplice.c +2 -2
@@ -4,67 +4,67 @@
 #include <xen/errno.h>
 #include <xen/init.h>
 #include <xen/lib.h>
-#include <xen/xsplice_elf.h>
-#include <xen/xsplice.h>
+#include <xen/livepatch_elf.h>
+#include <xen/livepatch.h>
 
Quoted 3 lines

xen/arch/arm/livepatch.c line 10

Quoted 2 lines
xen/arch/arm/livepatch.c renamed from xen/arch/arm/xsplice.c +1 -1
-void arch_xsplice_patching_enter(void)
+void arch_livepatching_enter(void)

Still "patching"?

This function came from one of my additions to the series. It half of a pair of calls around the critical region which is writing new code/data, where CR0.WP needs tweaking.

Quoted 5 lines

As such, 'patching' was logically distinct from the name 'livepatch' as the general namespace of these functions, and referred to the critical region of actually changing live memory.

I am at a loss to suggest a better alternative.

arch_quiescing_start and arch_quiescing_stop ?

Quoted 2 lines

~Andrew

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel

#4 lore raw
Quoted 23 lines
Quoted 1 line
Quoted 1 line · On 02.06.16 at 17:18, <[email protected]> wrote:
Quoted 21 lines · Andrew Cooper
Quoted 12 lines · Jan Beulich
Quoted 12 lines
xen/arch/arm/livepatch.c renamed from xen/arch/arm/xsplice.c +2 -2
@@ -4,67 +4,67 @@
 #include <xen/errno.h>
 #include <xen/init.h>
 #include <xen/lib.h>
-#include <xen/xsplice_elf.h>
-#include <xen/xsplice.h>
+#include <xen/livepatch_elf.h>
+#include <xen/livepatch.h>
 
Quoted 3 lines

xen/arch/arm/livepatch.c line 10

Quoted 2 lines
xen/arch/arm/livepatch.c renamed from xen/arch/arm/xsplice.c +1 -1
-void arch_xsplice_patching_enter(void)
+void arch_livepatching_enter(void)

Still "patching"?

This function came from one of my additions to the series. It half of a pair of calls around the critical region which is writing new code/data, where CR0.WP needs tweaking.

Quoted 7 lines
Quoted 5 lines

As such, 'patching' was logically distinct from the name 'livepatch' as the general namespace of these functions, and referred to the critical region of actually changing live memory.

I am at a loss to suggest a better alternative.

arch_quiescing_start and arch_quiescing_stop ?

arch_livepatch_quiesce() / arch_livepatch_revive()?

Jan

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel

author Acked-by Jan Beulich
#5 lore raw
Quoted 27 lines · Jan Beulich
Quoted 27 lines
Quoted 1 line
Quoted 1 line · On 02.06.16 at 17:18, <[email protected]> wrote:
Quoted 25 lines · Andrew Cooper
Quoted 12 lines · Jan Beulich
Quoted 12 lines
xen/arch/arm/livepatch.c renamed from xen/arch/arm/xsplice.c +2 -2
@@ -4,67 +4,67 @@
 #include <xen/errno.h>
 #include <xen/init.h>
 #include <xen/lib.h>
-#include <xen/xsplice_elf.h>
-#include <xen/xsplice.h>
+#include <xen/livepatch_elf.h>
+#include <xen/livepatch.h>
 
Quoted 3 lines

xen/arch/arm/livepatch.c line 10

Quoted 2 lines
xen/arch/arm/livepatch.c renamed from xen/arch/arm/xsplice.c +1 -1
-void arch_xsplice_patching_enter(void)
+void arch_livepatching_enter(void)

Still "patching"?

This function came from one of my additions to the series. It half of a pair of calls around the critical region which is writing new code/data, where CR0.WP needs tweaking.

As such, 'patching' was logically distinct from the name 'livepatch' as the general namespace of these functions, and referred to the critical region of actually changing live memory.

Quoted 5 lines
Quoted 3 lines
Quoted 1 line

I am at a loss to suggest a better alternative.

arch_quiescing_start and arch_quiescing_stop ?

arch_livepatch_quiesce() / arch_livepatch_revive()?

Fantastic!

For reference the patch.

From c15659cf833a453c27386cb181744ebcf5b0cd1f Mon Sep 17 00:00:00 2001
From: Konrad Rzeszutek Wilk <[email protected]>
Date: Wed, 1 Jun 2016 20:14:47 -0400
Subject: [PATCH v3.1 for 4.7] xen: Rename of xSplice to livepatch.

Specifically:

s/\.xsplice/\.livepatch/
s/XSPLICE/LIVEPATCH/
s/xsplice/livepatch/
s/livepatch_patch_func/livepatch_func/
s/xSplice/Xen Live Patch/
s/livepatching/livepatch/
s/arch_livepatch_enter/arch_livepatch_quiesce/
s/arch_livepatch_exit/arch_livepatch_revive/

And then modify some of the function arguments
to have two more characters.

---
Cc: Ross Lagerwall <[email protected]>
Cc: Andrew Cooper <[email protected]>
Cc: George Dunlap <[email protected]>
Cc: Ian Jackson <[email protected]>
Cc: Jan Beulich <[email protected]>
Cc: Konrad Rzeszutek Wilk <[email protected]>
Cc: Stefano Stabellini <[email protected]>
Cc: Tim Deegan <[email protected]>
Cc: Wei Liu <[email protected]>
Cc: Martin Pohlack <[email protected]>

v2: Ditch the LIVE_PATCH and 'Live Patching' inconsitency.
Include Ross's email correctly.
Don't move alphabetically the #include header as it is inconsistent
v3: s/livepatching/livepatch/
Alter some of the "live patching" or "live patch" to say "Live Patch"
Move in common/Makefile the livepatch entry (it is sorted) Move the LIVEPATCH in MAINTAINERS file in the proper location (it is sorted). Add Jan's Ack.
v3.1: s/arch_livepatch_enter/arch_livepatch_quiesce/
s/arch_livepatch_exit/arch_livepatch_revive/

---
 .gitignore                                         |   8 +-
 MAINTAINERS                                        |  20 +-
 docs/misc/{xsplice.markdown => livepatch.markdown} | 184 +++++-----
 tools/flask/policy/policy/modules/xen/xen.te       |   2 +-
 tools/libxc/include/xenctrl.h                      |  32 +-
 tools/libxc/xc_misc.c                              | 142 ++++----
 tools/misc/Makefile                                |   4 +-
 tools/misc/{xen-xsplice.c => xen-livepatch.c}      |  62 ++--
 xen/arch/arm/Makefile                              |   2 +-
 xen/arch/arm/{xsplice.c => livepatch.c}            |  38 +--
 xen/arch/x86/Makefile                              |   8 +-
 xen/arch/x86/alternative.c                         |  18 +-
 xen/arch/x86/domain.c                              |   4 +-
 xen/arch/x86/extable.c                             |   8 +-
 xen/arch/x86/{xsplice.c => livepatch.c}            |  56 ++--
 xen/arch/x86/test/Makefile                         |  58 ++--
 xen/arch/x86/test/xen_bye_world.c                  |   6 +-
 xen/arch/x86/test/xen_hello_world.c                |   6 +-
 xen/arch/x86/test/xen_replace_world.c              |   6 +-
 xen/arch/x86/traps.c                               |   2 +-
 xen/common/Kconfig                                 |  10 +-
 xen/common/Makefile                                |   3 +-
 xen/common/{xsplice.c => livepatch.c}              | 370 ++++++++++-----------
 xen/common/{xsplice_elf.c => livepatch_elf.c}      | 109 +++---
 xen/common/sysctl.c                                |   6 +-
 xen/common/virtual_region.c                        |   4 +-
 xen/common/vsprintf.c                              |   4 +-
 xen/include/asm-x86/current.h                      |   8 +-
 xen/include/public/sysctl.h                        | 138 ++++----
 xen/include/xen/elfstructs.h                       |   2 +-
 xen/include/xen/{xsplice.h => livepatch.h}         | 100 +++---
 xen/include/xen/{xsplice_elf.h => livepatch_elf.h} |  35 +-
 xen/xsm/flask/hooks.c                              |   4 +-
 xen/xsm/flask/policy/access_vectors                |   4 +-
 34 files changed, 732 insertions(+), 731 deletions(-)
 rename docs/misc/{xsplice.markdown => livepatch.markdown} (87%)
 rename tools/misc/{xen-xsplice.c => xen-livepatch.c} (86%)
 rename xen/arch/arm/{xsplice.c => livepatch.c} (29%)
 rename xen/arch/x86/{xsplice.c => livepatch.c} (74%)
 rename xen/common/{xsplice.c => livepatch.c} (75%)
 rename xen/common/{xsplice_elf.c => livepatch_elf.c} (72%)
 rename xen/include/xen/{xsplice.h => livepatch.h} (34%)
 rename xen/include/xen/{xsplice_elf.h => livepatch_elf.h} (56%)
.gitignore +4 -4
index 1b73293..7347801 100644
@@ -182,7 +182,7 @@ tools/misc/xen_cpuperf
 tools/misc/xen-cpuid
 tools/misc/xen-detect
 tools/misc/xen-tmem-list-parse
-tools/misc/xen-xsplice
+tools/misc/xen-livepatch
 tools/misc/xenperf
 tools/misc/xenpm
 tools/misc/xen-hvmctx
@@ -247,9 +247,9 @@ xen/arch/x86/efi/check.efi
 xen/arch/x86/efi/disabled
 xen/arch/x86/efi/mkreloc
 xen/arch/x86/test/config.h
-xen/arch/x86/test/xen_hello_world.xsplice
-xen/arch/x86/test/xen_bye_world.xsplice
-xen/arch/x86/test/xen_replace_world.xsplice
+xen/arch/x86/test/xen_hello_world.livepatch
+xen/arch/x86/test/xen_bye_world.livepatch
+xen/arch/x86/test/xen_replace_world.livepatch
 xen/arch/*/efi/boot.c
 xen/arch/*/efi/compat.c
 xen/arch/*/efi/efi.h
MAINTAINERS +10 -10
index 62f4ffd..9a224d4 100644
@@ -261,6 +261,16 @@ F:      xen/include/{kexec,kimage}.h
 F:      xen/arch/x86/machine_kexec.c
 F:      xen/arch/x86/x86_64/kexec_reloc.S
 
+LIVEPATCH
+M:  Konrad Rzeszutek Wilk <[email protected]>
+M:  Ross Lagerwall <[email protected]>
+S:  Supported
+F:  docs/misc/livepatch.markdown
+F:  tools/misc/xen-livepatch.c
+F:  xen/arch/*/livepatch*
+F:  xen/common/livepatch*
+F:  xen/include/xen/livepatch*
+
 MACHINE CHECK (MCA) & RAS
 M:	Christoph Egger <[email protected]>
 M:	Liu Jinsong <[email protected]>
@@ -470,16 +480,6 @@ F:  xen/include/xsm/
 F:  xen/xsm/
 F:  docs/misc/xsm-flask.txt
 
-XSPLICE
-M:  Konrad Rzeszutek Wilk <[email protected]>
-M:  Ross Lagerwall <[email protected]>
-S:  Supported
-F:  docs/misc/xsplice.markdown
-F:  tools/misc/xen-xsplice.c
-F:  xen/arch/*/xsplice*
-F:  xen/common/xsplice*
-F:  xen/include/xen/xsplice*
-
 THE REST
 M:	Andrew Cooper <[email protected]>
 M:	George Dunlap <[email protected]>
docs/misc/livepatch.markdown renamed from docs/misc/xsplice.markdown +92 -92

435 lines not on this page · raw message

tools/flask/policy/policy/modules/xen/xen.te +1 -1
index 0b1c955..50aa602 100644
@@ -74,7 +74,7 @@ allow dom0_t xen_t:xen2 {
     get_symbol
     get_cpu_levelling_caps
     get_cpu_featureset
-    xsplice_op
+    livepatch_op
 };
 
 # Allow dom0 to use all XENVER_ subops that have checks.
tools/libxc/include/xenctrl.h +16 -16
index dc54612..6ae1a2b 100644
@@ -2610,15 +2610,15 @@ const uint32_t *xc_get_feature_deep_deps(uint32_t feature);
 
 #endif
 
-int xc_xsplice_upload(xc_interface *xch,
-                      char *name, unsigned char *payload, uint32_t size);
+int xc_livepatch_upload(xc_interface *xch,
+                        char *name, unsigned char *payload, uint32_t size);
 
-int xc_xsplice_get(xc_interface *xch,
-                   char *name,
-                   xen_xsplice_status_t *status);
+int xc_livepatch_get(xc_interface *xch,
+                     char *name,
+                     xen_livepatch_status_t *status);
 
 /*
- * The heart of this function is to get an array of xen_xsplice_status_t.
+ * The heart of this function is to get an array of xen_livepatch_status_t.
  *
  * However it is complex because it has to deal with the hypervisor
  * returning some of the requested data or data being stale
@@ -2638,10 +2638,10 @@ int xc_xsplice_get(xc_interface *xch,
  * number of entries that 'info', 'name', and 'len' arrays can
  * be filled up with.
  *
- * Each entry in the 'name' array is expected to be of XEN_XSPLICE_NAME_SIZE
+ * Each entry in the 'name' array is expected to be of XEN_LIVEPATCH_NAME_SIZE
  * length.
  *
- * Each entry in the 'info' array is expected to be of xen_xsplice_status_t
+ * Each entry in the 'info' array is expected to be of xen_livepatch_status_t
  * structure size.
  *
  * Each entry in the 'len' array is expected to be of uint32_t size.
@@ -2655,10 +2655,10 @@ int xc_xsplice_get(xc_interface *xch,
  * will contain the number of entries that had been succesfully
  * retrieved (if any).
  */
-int xc_xsplice_list(xc_interface *xch, unsigned int max, unsigned int start,
-                    xen_xsplice_status_t *info, char *name,
-                    uint32_t *len, unsigned int *done,
-                    unsigned int *left);
+int xc_livepatch_list(xc_interface *xch, unsigned int max, unsigned int start,
+                      xen_livepatch_status_t *info, char *name,
+                      uint32_t *len, unsigned int *done,
+                      unsigned int *left);
 
 /*
  * The operations are asynchronous and the hypervisor may take a while
@@ -2666,10 +2666,10 @@ int xc_xsplice_list(xc_interface *xch, unsigned int max, unsigned int start,
  * operation if it could not be completed within the specified time
  * (in ms). Value of 0 means let hypervisor decide the best timeout.
  */
-int xc_xsplice_apply(xc_interface *xch, char *name, uint32_t timeout);
-int xc_xsplice_revert(xc_interface *xch, char *name, uint32_t timeout);
-int xc_xsplice_unload(xc_interface *xch, char *name, uint32_t timeout);
-int xc_xsplice_replace(xc_interface *xch, char *name, uint32_t timeout);
+int xc_livepatch_apply(xc_interface *xch, char *name, uint32_t timeout);
+int xc_livepatch_revert(xc_interface *xch, char *name, uint32_t timeout);
+int xc_livepatch_unload(xc_interface *xch, char *name, uint32_t timeout);
+int xc_livepatch_replace(xc_interface *xch, char *name, uint32_t timeout);
 
 /* Compat shims */
 #include "xenctrl_compat.h"
tools/libxc/xc_misc.c +71 -71

297 lines not on this page · raw message

tools/misc/Makefile +2 -2
index 3a5f842..cee2b99 100644
@@ -32,7 +32,7 @@ INSTALL_SBIN                   += xenlockprof
 INSTALL_SBIN                   += xenperf
 INSTALL_SBIN                   += xenpm
 INSTALL_SBIN                   += xenwatchdogd
-INSTALL_SBIN                   += xen-xsplice
+INSTALL_SBIN                   += xen-livepatch
 INSTALL_SBIN += $(INSTALL_SBIN-y)
 
 # Everything to be installed in a private bin/
@@ -104,7 +104,7 @@ xen-mfndump: xen-mfndump.o
 xenwatchdogd: xenwatchdogd.o
 	$(CC) $(LDFLAGS) -o $@ $< $(LDLIBS_libxenctrl) $(APPEND_LDFLAGS)
 
-xen-xsplice: xen-xsplice.o
+xen-livepatch: xen-livepatch.o
 	$(CC) $(LDFLAGS) -o $@ $< $(LDLIBS_libxenctrl) $(APPEND_LDFLAGS)
 
 xen-lowmemd: xen-lowmemd.o
tools/misc/xen-livepatch.c renamed from tools/misc/xen-xsplice.c +31 -31

167 lines not on this page · raw message

xen/arch/arm/Makefile +1 -1
index ead0cc0..af4d0e1 100644
@@ -40,7 +40,7 @@ obj-y += device.o
 obj-y += decode.o
 obj-y += processor.o
 obj-y += smc.o
-obj-$(CONFIG_XSPLICE) += xsplice.o
+obj-$(CONFIG_LIVEPATCH) += livepatch.o
 
 #obj-bin-y += ....o
 
xen/arch/arm/livepatch.c renamed from xen/arch/arm/xsplice.c +19 -19
similarity index 29%
rename from xen/arch/arm/xsplice.c
rename to xen/arch/arm/livepatch.c
index db0dce2..aba1320 100644
@@ -4,67 +4,67 @@
 #include <xen/errno.h>
 #include <xen/init.h>
 #include <xen/lib.h>
-#include <xen/xsplice_elf.h>
-#include <xen/xsplice.h>
+#include <xen/livepatch_elf.h>
+#include <xen/livepatch.h>
 
-void arch_xsplice_patching_enter(void)
+void arch_livepatch_quiesce(void)
 {
 }
 
-void arch_xsplice_patching_leave(void)
+void arch_livepatch_revive(void)
 {
 }
 
-int arch_xsplice_verify_func(const struct xsplice_patch_func *func)
+int arch_livepatch_verify_func(const struct livepatch_func *func)
 {
     return -ENOSYS;
 }
 
-void arch_xsplice_apply_jmp(struct xsplice_patch_func *func)
+void arch_livepatch_apply_jmp(struct livepatch_func *func)
 {
 }
 
-void arch_xsplice_revert_jmp(const struct xsplice_patch_func *func)
+void arch_livepatch_revert_jmp(const struct livepatch_func *func)
 {
 }
 
-void arch_xsplice_post_action(void)
+void arch_livepatch_post_action(void)
 {
 }
 
-void arch_xsplice_mask(void)
+void arch_livepatch_mask(void)
 {
 }
 
-void arch_xsplice_unmask(void)
+void arch_livepatch_unmask(void)
 {
 }
 
-int arch_xsplice_verify_elf(const struct xsplice_elf *elf)
+int arch_livepatch_verify_elf(const struct livepatch_elf *elf)
 {
     return -ENOSYS;
 }
 
-int arch_xsplice_perform_rel(struct xsplice_elf *elf,
-                             const struct xsplice_elf_sec *base,
-                             const struct xsplice_elf_sec *rela)
+int arch_livepatch_perform_rel(struct livepatch_elf *elf,
+                               const struct livepatch_elf_sec *base,
+                               const struct livepatch_elf_sec *rela)
 {
     return -ENOSYS;
 }
 
-int arch_xsplice_perform_rela(struct xsplice_elf *elf,
-                              const struct xsplice_elf_sec *base,
-                              const struct xsplice_elf_sec *rela)
+int arch_livepatch_perform_rela(struct livepatch_elf *elf,
+                                const struct livepatch_elf_sec *base,
+                                const struct livepatch_elf_sec *rela)
 {
     return -ENOSYS;
 }
 
-int arch_xsplice_secure(const void *va, unsigned int pages, enum va_type type)
+int arch_livepatch_secure(const void *va, unsigned int pages, enum va_type type)
 {
     return -ENOSYS;
 }
 
-void __init arch_xsplice_init(void)
+void __init arch_livepatch_init(void)
 {
 }
 
xen/arch/x86/Makefile +4 -4
index 4665a68..b377c91 100644
@@ -7,7 +7,7 @@ subdir-$(CONFIG_XENOPROF) += oprofile
 subdir-y += x86_64
 
 alternative-y := alternative.init.o
-alternative-$(CONFIG_XSPLICE) :=
+alternative-$(CONFIG_LIVEPATCH) :=
 obj-bin-y += $(alternative-y)
 obj-y += apic.o
 obj-y += bitops.o
@@ -30,6 +30,7 @@ obj-y += flushtlb.o
 obj-y += i387.o
 obj-y += i8259.o
 obj-y += io_apic.o
+obj-$(CONFIG_LIVEPATCH) += alternative.o livepatch.o
 obj-y += msi.o
 obj-y += ioport_emulate.o
 obj-y += irq.o
@@ -63,7 +64,6 @@ obj-y += x86_emulate.o
 obj-y += tboot.o
 obj-y += hpet.o
 obj-y += vm_event.o
-obj-$(CONFIG_XSPLICE) += alternative.o xsplice.o
 obj-y += xstate.o
 
 obj-$(crash_debug) += gdbstub.o
@@ -80,7 +80,7 @@ else
 notes_phdrs =
 endif
 
-ifdef CONFIG_XSPLICE
+ifdef CONFIG_LIVEPATCH
 all_symbols = --all-symbols
 ifdef CONFIG_FAST_SYMBOL_LOOKUP
 all_symbols = --all-symbols --sort-by-name
@@ -95,7 +95,7 @@ $(TARGET): $(TARGET)-syms $(efi-y) boot/mkelf32
 
 .PHONY: tests
 tests:
-	$(MAKE) -f $(BASEDIR)/Rules.mk -C test xsplice
+	$(MAKE) -f $(BASEDIR)/Rules.mk -C test livepatch
 
 ALL_OBJS := $(BASEDIR)/arch/x86/boot/built_in.o $(BASEDIR)/arch/x86/efi/built_in.o $(ALL_OBJS)
 
xen/arch/x86/alternative.c +9 -9
index c188a15..be40b13 100644
@@ -22,14 +22,14 @@
 #include <asm/system.h>
 #include <asm/traps.h>
 #include <asm/nmi.h>
-#include <xen/xsplice.h>
+#include <xen/livepatch.h>
 
 #define MAX_PATCH_LEN (255-1)
 
 extern struct alt_instr __alt_instructions[], __alt_instructions_end[];
 
 #ifdef K8_NOP1
-static const unsigned char k8nops[] init_or_xsplice_const = {
+static const unsigned char k8nops[] init_or_livepatch_const = {
     K8_NOP1,
     K8_NOP2,
     K8_NOP3,
@@ -39,7 +39,7 @@ static const unsigned char k8nops[] init_or_xsplice_const = {
     K8_NOP7,
     K8_NOP8
 };
-static const unsigned char * const k8_nops[ASM_NOP_MAX+1] init_or_xsplice_constrel = {
+static const unsigned char * const k8_nops[ASM_NOP_MAX+1] init_or_livepatch_constrel = {
     NULL,
     k8nops,
     k8nops + 1,
@@ -53,7 +53,7 @@ static const unsigned char * const k8_nops[ASM_NOP_MAX+1] init_or_xsplice_constr
 #endif
 
 #ifdef P6_NOP1
-static const unsigned char p6nops[] init_or_xsplice_const = {
+static const unsigned char p6nops[] init_or_livepatch_const = {
     P6_NOP1,
     P6_NOP2,
     P6_NOP3,
@@ -63,7 +63,7 @@ static const unsigned char p6nops[] init_or_xsplice_const = {
     P6_NOP7,
     P6_NOP8
 };
-static const unsigned char * const p6_nops[ASM_NOP_MAX+1] init_or_xsplice_constrel = {
+static const unsigned char * const p6_nops[ASM_NOP_MAX+1] init_or_livepatch_constrel = {
     NULL,
     p6nops,
     p6nops + 1,
@@ -76,7 +76,7 @@ static const unsigned char * const p6_nops[ASM_NOP_MAX+1] init_or_xsplice_constr
 };
 #endif
 
-static const unsigned char * const *ideal_nops init_or_xsplice_data = k8_nops;
+static const unsigned char * const *ideal_nops init_or_livepatch_data = k8_nops;
 
 static int __init mask_nmi_callback(const struct cpu_user_regs *regs, int cpu)
 {
@@ -101,7 +101,7 @@ static void __init arch_init_ideal_nops(void)
 }
 
 /* Use this to add nops to a buffer, then text_poke the whole buffer. */
-static void init_or_xsplice add_nops(void *insns, unsigned int len)
+static void init_or_livepatch add_nops(void *insns, unsigned int len)
 {
     while ( len > 0 )
     {
@@ -129,7 +129,7 @@ static void init_or_xsplice add_nops(void *insns, unsigned int len)
  * You should run this with interrupts disabled or on code that is not
  * executing.
  */
-static void *init_or_xsplice text_poke(void *addr, const void *opcode, size_t len)
+static void *init_or_livepatch text_poke(void *addr, const void *opcode, size_t len)
 {
     memcpy(addr, opcode, len);
     sync_core();
@@ -144,7 +144,7 @@ static void *init_or_xsplice text_poke(void *addr, const void *opcode, size_t le
  * APs have less capabilities than the boot processor are not handled.
  * Tough. Make sure you disable such features by hand.
  */
-void init_or_xsplice apply_alternatives_nocheck(struct alt_instr *start, struct alt_instr *end)
+void init_or_livepatch apply_alternatives_nocheck(struct alt_instr *start, struct alt_instr *end)
 {
     struct alt_instr *a;
     u8 *instr, *replacement;
xen/arch/x86/domain.c +2 -2
index 5af2cc5..f2d7f47 100644
@@ -36,7 +36,7 @@
 #include <xen/cpu.h>
 #include <xen/wait.h>
 #include <xen/guest_access.h>
-#include <xen/xsplice.h>
+#include <xen/livepatch.h>
 #include <public/sysctl.h>
 #include <public/hvm/hvm_vcpu.h>
 #include <asm/regs.h>
@@ -125,7 +125,7 @@ static void idle_loop(void)
          * We MUST be last (or before pm_idle). Otherwise after we get the
          * softirq we would execute pm_idle (and sleep) and not patch.
          */
-        check_for_xsplice_work();
+        check_for_livepatch_work();
     }
 }
 
xen/arch/x86/extable.c +4 -4
index 349df79..701441a 100644
@@ -7,7 +7,7 @@
 #include <xen/spinlock.h>
 #include <asm/uaccess.h>
 #include <xen/virtual_region.h>
-#include <xen/xsplice.h>
+#include <xen/livepatch.h>
 
 #define EX_FIELD(ptr, field) ((unsigned long)&(ptr)->field + (ptr)->field)
 
@@ -21,7 +21,7 @@ static inline unsigned long ex_cont(const struct exception_table_entry *x)
 	return EX_FIELD(x, cont);
 }
 
-static int init_or_xsplice cmp_ex(const void *a, const void *b)
+static int init_or_livepatch cmp_ex(const void *a, const void *b)
 {
 	const struct exception_table_entry *l = a, *r = b;
 	unsigned long lip = ex_addr(l);
@@ -36,7 +36,7 @@ static int init_or_xsplice cmp_ex(const void *a, const void *b)
 }
 
 #ifndef swap_ex
-static void init_or_xsplice swap_ex(void *a, void *b, int size)
+static void init_or_livepatch swap_ex(void *a, void *b, int size)
 {
 	struct exception_table_entry *l = a, *r = b, tmp;
 	long delta = b - a;
@@ -49,7 +49,7 @@ static void init_or_xsplice swap_ex(void *a, void *b, int size)
 }
 #endif
 
-void init_or_xsplice sort_exception_table(struct exception_table_entry *start,
+void init_or_livepatch sort_exception_table(struct exception_table_entry *start,
                                  const struct exception_table_entry *stop)
 {
     sort(start, stop - start,
xen/arch/x86/livepatch.c renamed from xen/arch/x86/xsplice.c +28 -28

174 lines not on this page · raw message

xen/arch/x86/test/Makefile +29 -29

96 lines not on this page · raw message

xen/arch/x86/test/xen_bye_world.c +3 -3
index f93f969..b75e0b1 100644
@@ -7,15 +7,15 @@
 #include <xen/lib.h>
 #include <xen/types.h>
 #include <xen/version.h>
-#include <xen/xsplice.h>
+#include <xen/livepatch.h>
 
 #include <public/sysctl.h>
 
 static char bye_world_patch_this_fnc[] = "xen_extra_version";
 extern const char *xen_bye_world(void);
 
-struct xsplice_patch_func __section(".xsplice.funcs") xsplice_xen_bye_world = {
-    .version = XSPLICE_PAYLOAD_VERSION,
+struct livepatch_func __section(".livepatch.funcs") livepatch_xen_bye_world = {
+    .version = LIVEPATCH_PAYLOAD_VERSION,
     .name = bye_world_patch_this_fnc,
     .new_addr = xen_bye_world,
     .old_addr = xen_extra_version,
xen/arch/x86/test/xen_hello_world.c +3 -3
index 8afd66e..422bdf1 100644
@@ -6,15 +6,15 @@
 #include "config.h"
 #include <xen/types.h>
 #include <xen/version.h>
-#include <xen/xsplice.h>
+#include <xen/livepatch.h>
 
 #include <public/sysctl.h>
 
 static char hello_world_patch_this_fnc[] = "xen_extra_version";
 extern const char *xen_hello_world(void);
 
-struct xsplice_patch_func __section(".xsplice.funcs") xsplice_xen_hello_world = {
-    .version = XSPLICE_PAYLOAD_VERSION,
+struct livepatch_func __section(".livepatch.funcs") livepatch_xen_hello_world = {
+    .version = LIVEPATCH_PAYLOAD_VERSION,
     .name = hello_world_patch_this_fnc,
     .new_addr = xen_hello_world,
     .old_addr = xen_extra_version,
xen/arch/x86/test/xen_replace_world.c +3 -3
index fab2841..a2a221a 100644
@@ -6,15 +6,15 @@
 #include "config.h"
 #include <xen/lib.h>
 #include <xen/types.h>
-#include <xen/xsplice.h>
+#include <xen/livepatch.h>
 
 #include <public/sysctl.h>
 
 static char xen_replace_world_name[] = "xen_extra_version";
 extern const char *xen_replace_world(void);
 
-struct xsplice_patch_func __section(".xsplice.funcs") xsplice_xen_replace_world = {
-    .version = XSPLICE_PAYLOAD_VERSION,
+struct livepatch_func __section(".livepatch.funcs") livepatch_xen_replace_world = {
+    .version = LIVEPATCH_PAYLOAD_VERSION,
     .name = xen_replace_world_name,
     .old_addr = 0, /* Forces the hypervisor to lookup .name */
     .new_addr = xen_replace_world,
xen/arch/x86/traps.c +1 -1
index 5d7232d..c4e0e6f 100644
@@ -50,7 +50,7 @@
 #include <xen/paging.h>
 #include <xen/virtual_region.h>
 #include <xen/watchdog.h>
-#include <xen/xsplice.h>
+#include <xen/livepatch.h>
 #include <asm/system.h>
 #include <asm/io.h>
 #include <asm/atomic.h>
xen/common/Kconfig +5 -5
index 91ea904..cd59574 100644
@@ -192,9 +192,9 @@ config SCHED_DEFAULT
 
 endmenu
 
-# Enable/Disable xsplice support
-config XSPLICE
-	bool "xSplice live patching support (TECH PREVIEW)"
+# Enable/Disable live patching support
+config LIVEPATCH
+	bool "Live patching support (TECH PREVIEW)"
 	default n
 	depends on X86 && HAS_BUILD_ID = "y"
 	---help---
@@ -207,13 +207,13 @@ config XSPLICE
 config FAST_SYMBOL_LOOKUP
 	bool "Fast symbol lookup (bigger binary)"
 	default y
-	depends on XSPLICE
+	depends on LIVEPATCH
 	---help---
 	  When searching for symbol addresses we can use the built-in system
 	  that is optimized for searching symbols using addresses as the key.
 	  However using it for the inverse (find address using the symbol name)
 	  it is slow. This extra data and code (~55kB) speeds up the search.
-	  The only user of this is xSplice.
+	  The only user of this is Live patching.
 
 	  If unsure, say Y.
 endmenu
xen/common/Makefile +1 -2
index afd84b6..dda9925 100644
@@ -17,6 +17,7 @@ obj-y += keyhandler.o
 obj-$(CONFIG_KEXEC) += kexec.o
 obj-$(CONFIG_KEXEC) += kimage.o
 obj-y += lib.o
+obj-$(CONFIG_LIVEPATCH) += livepatch.o livepatch_elf.o
 obj-y += lzo.o
 obj-$(CONFIG_HAS_MEM_ACCESS) += mem_access.o
 obj-y += memory.o
@@ -58,8 +59,6 @@ obj-y += vsprintf.o
 obj-y += wait.o
 obj-$(CONFIG_XENOPROF) += xenoprof.o
 obj-y += xmalloc_tlsf.o
-obj-$(CONFIG_XSPLICE) += xsplice.o
-obj-$(CONFIG_XSPLICE) += xsplice_elf.o
 
 obj-bin-$(CONFIG_X86) += $(foreach n,decompress bunzip2 unxz unlzma unlzo unlz4 earlycpio,$(n).init.o)
 
xen/common/livepatch.c renamed from xen/common/xsplice.c +185 -185

1,023 lines not on this page · raw message

xen/common/livepatch_elf.c renamed from xen/common/xsplice_elf.c +55 -54

305 lines not on this page · raw message

xen/common/sysctl.c +3 -3
index 9a4cc1f..75f4c05 100644

Lines of this file are not shown. View the raw message.

xen/common/virtual_region.c +2 -2
index 426dfa0..aa23918 100644

Lines of this file are not shown. View the raw message.

xen/common/vsprintf.c +2 -2
index 70e1edf..b050ea3 100644

Lines of this file are not shown. View the raw message.

xen/include/asm-x86/current.h +4 -4
index fa55602..e6587e6 100644

Lines of this file are not shown. View the raw message.

xen/include/public/sysctl.h +69 -69

138 lines not on this page · raw message

xen/include/xen/elfstructs.h +1 -1
index 68954b0..5f2082e 100644

Lines of this file are not shown. View the raw message.

xen/include/xen/livepatch.h renamed from xen/include/xen/xsplice.h +50 -50

100 lines not on this page · raw message

xen/include/xen/livepatch_elf.h renamed from xen/include/xen/xsplice_elf.h +18 -17
similarity index 56%
rename from xen/include/xen/xsplice_elf.h
rename to xen/include/xen/livepatch_elf.h
index 750dc94..7e7c86e 100644

Lines of this file are not shown. View the raw message.

xen/xsm/flask/hooks.c +2 -2
index 7477dbe..20d46c8 100644

Lines of this file are not shown. View the raw message.

xen/xsm/flask/policy/access_vectors +2 -2
index 4d1b548..3d29042 100644

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

Signature · 7 lines
2.5.5


_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel

Part of the diff is not shown here. View the raw message.

Acked-by
#6 lore raw
Quoted 84 lines · Konrad Rzeszutek Wilk
Quoted 27 lines · Jan Beulich
Quoted 27 lines
Quoted 1 line
Quoted 1 line · On 02.06.16 at 17:18, <[email protected]> wrote:
Quoted 25 lines · Andrew Cooper
Quoted 12 lines · Jan Beulich
Quoted 12 lines
xen/arch/arm/livepatch.c renamed from xen/arch/arm/xsplice.c +2 -2
@@ -4,67 +4,67 @@
 #include <xen/errno.h>
 #include <xen/init.h>
 #include <xen/lib.h>
-#include <xen/xsplice_elf.h>
-#include <xen/xsplice.h>
+#include <xen/livepatch_elf.h>
+#include <xen/livepatch.h>
 
Quoted 3 lines

xen/arch/arm/livepatch.c line 10

Quoted 2 lines
xen/arch/arm/livepatch.c renamed from xen/arch/arm/xsplice.c +1 -1
-void arch_xsplice_patching_enter(void)
+void arch_livepatching_enter(void)

Still "patching"?

This function came from one of my additions to the series. It half of a pair of calls around the critical region which is writing new code/data, where CR0.WP needs tweaking.

As such, 'patching' was logically distinct from the name 'livepatch' as the general namespace of these functions, and referred to the critical region of actually changing live memory.

Quoted 5 lines
Quoted 3 lines
Quoted 1 line

I am at a loss to suggest a better alternative.

arch_quiescing_start and arch_quiescing_stop ?

arch_livepatch_quiesce() / arch_livepatch_revive()?

Fantastic!

For reference the patch.

From c15659cf833a453c27386cb181744ebcf5b0cd1f Mon Sep 17 00:00:00 2001
From: Konrad Rzeszutek Wilk <[email protected]>
Date: Wed, 1 Jun 2016 20:14:47 -0400
Subject: [PATCH v3.1 for 4.7] xen: Rename of xSplice to livepatch.

Specifically:

s/\.xsplice/\.livepatch/
s/XSPLICE/LIVEPATCH/
s/xsplice/livepatch/
s/livepatch_patch_func/livepatch_func/
s/xSplice/Xen Live Patch/
s/livepatching/livepatch/
s/arch_livepatch_enter/arch_livepatch_quiesce/
s/arch_livepatch_exit/arch_livepatch_revive/

And then modify some of the function arguments
to have two more characters.

---
Cc: Ross Lagerwall <[email protected]>
Cc: Andrew Cooper <[email protected]>
Cc: George Dunlap <[email protected]>
Cc: Ian Jackson <[email protected]>
Cc: Jan Beulich <[email protected]>
Cc: Konrad Rzeszutek Wilk <[email protected]>
Cc: Stefano Stabellini <[email protected]>
Cc: Tim Deegan <[email protected]>
Cc: Wei Liu <[email protected]>
Cc: Martin Pohlack <[email protected]>

v2: Ditch the LIVE_PATCH and 'Live Patching' inconsitency.
Include Ross's email correctly.
Don't move alphabetically the #include header as it is inconsistent
v3: s/livepatching/livepatch/
Alter some of the "live patching" or "live patch" to say "Live Patch"
Move in common/Makefile the livepatch entry (it is sorted) Move the LIVEPATCH in MAINTAINERS file in the proper location (it is sorted). Add Jan's Ack.
v3.1: s/arch_livepatch_enter/arch_livepatch_quiesce/
s/arch_livepatch_exit/arch_livepatch_revive/

Quoted 9 lines
---
 .gitignore                                         |   8 +-
 MAINTAINERS                                        |  20 +-
 docs/misc/{xsplice.markdown => livepatch.markdown} | 184 +++++-----
 tools/flask/policy/policy/modules/xen/xen.te       |   2 +-
 tools/libxc/include/xenctrl.h                      |  32 +-
 tools/libxc/xc_misc.c                              | 142 ++++----
 tools/misc/Makefile                                |   4 +-
 tools/misc/{xen-xsplice.c => xen-livepatch.c}      |  62 ++--

And

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel

author Acked-by Jan Beulich
#7 lore raw
In reply to Jan Beulich
Quoted 16 lines

Review static char *pointer(char *str, char *end, const char **fmt_ptr, · line 359

Quoted 7 lines
(quoted diff) +1 -1
@@ -356,7 +356,7 @@ static char *pointer(char *str, char *end, const char **fmt_ptr,
         }
 
         /*
-         * namebuf contents and s for core hypervisor are same but for xSplice
+         * namebuf contents and s for core hypervisor are same but for live patch

"live patch" here and ...

Quoted 6 lines
xen/include/xen/elfstructs.h +0 -0
@@ -353,7 +353,7 @@ typedef struct {
 #define	ELF64_R_TYPE(info)	((info) & 0xFFFFFFFF)
 #define ELF64_R_INFO(s,t) 	(((s) << 32) + (u_int32_t)(t))
 
Quoted 5 lines

xen/include/xen/elfstructs.h typedef struct { · line 356

Quoted 2 lines
xen/include/xen/elfstructs.h +1 -1
-/* x86-64 relocation types. We list only the ones xSplice implements. */
+/* x86-64 relocation types. We list only the ones Live Patch implements. */

"Live Patch" here - please try to be consistent (personally I prefer the latter).

Awesome!

Live Patch it is. I did it also to two other files where it had it as 'live patch' (or live patching):
xen/common/virtual_region. xen/include/xen/livepatch.h

Quoted 2 lines

With those taken care of,

All done.

Quoted 2 lines

Thank you again for quick review of this big and boring patch.

For reference here it is (compiling and testing it right now)

From 12a2f4d3c3029ddc94181fe3993ce4a1e82d3dc8 Mon Sep 17 00:00:00 2001
From: Konrad Rzeszutek Wilk <[email protected]>
Date: Wed, 1 Jun 2016 20:14:47 -0400
Subject: [PATCH v3 for 4.7] xen: Rename of xSplice to livepatch.

Specifically:

s/\.xsplice/\.livepatch/
s/XSPLICE/LIVEPATCH/
s/xsplice/livepatch/
s/livepatch_patch_func/livepatch_func/
s/xSplice/Xen Live Patch/
s/livepatching/livepatch/

And then modify some of the function arguments
to have two more characters.

---
Cc: Ross Lagerwall <[email protected]>
Cc: Andrew Cooper <[email protected]>
Cc: George Dunlap <[email protected]>
Cc: Ian Jackson <[email protected]>
Cc: Jan Beulich <[email protected]>
Cc: Konrad Rzeszutek Wilk <[email protected]>
Cc: Stefano Stabellini <[email protected]>
Cc: Tim Deegan <[email protected]>
Cc: Wei Liu <[email protected]>
Cc: Martin Pohlack <[email protected]>

v2: Ditch the LIVE_PATCH and 'Live Patching' inconsitency.
Include Ross's email correctly.
Don't move alphabetically the #include header as it is inconsistent
v3: s/livepatching/livepatch/
Alter some of the "live patching" or "live patch" to say "Live Patch"
Move in common/Makefile the livepatch entry (it is sorted) Move the LIVEPATCH in MAINTAINERS file in the proper location (it is sorted). Add Jan's Ack.

---
 .gitignore                                         |   8 +-
 MAINTAINERS                                        |  20 +-
 docs/misc/{xsplice.markdown => livepatch.markdown} | 184 +++++-----
 tools/flask/policy/policy/modules/xen/xen.te       |   2 +-
 tools/libxc/include/xenctrl.h                      |  32 +-
 tools/libxc/xc_misc.c                              | 142 ++++----
 tools/misc/Makefile                                |   4 +-
 tools/misc/{xen-xsplice.c => xen-livepatch.c}      |  62 ++--
 xen/arch/arm/Makefile                              |   2 +-
 xen/arch/arm/{xsplice.c => livepatch.c}            |  38 +--
 xen/arch/x86/Makefile                              |   8 +-
 xen/arch/x86/alternative.c                         |  18 +-
 xen/arch/x86/domain.c                              |   4 +-
 xen/arch/x86/extable.c                             |   8 +-
 xen/arch/x86/{xsplice.c => livepatch.c}            |  56 ++--
 xen/arch/x86/test/Makefile                         |  58 ++--
 xen/arch/x86/test/xen_bye_world.c                  |   6 +-
 xen/arch/x86/test/xen_hello_world.c                |   6 +-
 xen/arch/x86/test/xen_replace_world.c              |   6 +-
 xen/arch/x86/traps.c                               |   2 +-
 xen/common/Kconfig                                 |  10 +-
 xen/common/Makefile                                |   3 +-
 xen/common/{xsplice.c => livepatch.c}              | 370 ++++++++++-----------
 xen/common/{xsplice_elf.c => livepatch_elf.c}      | 109 +++---
 xen/common/sysctl.c                                |   6 +-
 xen/common/virtual_region.c                        |   4 +-
 xen/common/vsprintf.c                              |   4 +-
 xen/include/asm-x86/current.h                      |   8 +-
 xen/include/public/sysctl.h                        | 138 ++++----
 xen/include/xen/elfstructs.h                       |   2 +-
 xen/include/xen/{xsplice.h => livepatch.h}         | 100 +++---
 xen/include/xen/{xsplice_elf.h => livepatch_elf.h} |  35 +-
 xen/xsm/flask/hooks.c                              |   4 +-
 xen/xsm/flask/policy/access_vectors                |   4 +-
 34 files changed, 732 insertions(+), 731 deletions(-)
 rename docs/misc/{xsplice.markdown => livepatch.markdown} (87%)
 rename tools/misc/{xen-xsplice.c => xen-livepatch.c} (86%)
 rename xen/arch/arm/{xsplice.c => livepatch.c} (29%)
 rename xen/arch/x86/{xsplice.c => livepatch.c} (74%)
 rename xen/common/{xsplice.c => livepatch.c} (75%)
 rename xen/common/{xsplice_elf.c => livepatch_elf.c} (72%)
 rename xen/include/xen/{xsplice.h => livepatch.h} (34%)
 rename xen/include/xen/{xsplice_elf.h => livepatch_elf.h} (56%)
.gitignore +4 -4
index 1b73293..7347801 100644
@@ -182,7 +182,7 @@ tools/misc/xen_cpuperf
 tools/misc/xen-cpuid
 tools/misc/xen-detect
 tools/misc/xen-tmem-list-parse
-tools/misc/xen-xsplice
+tools/misc/xen-livepatch
 tools/misc/xenperf
 tools/misc/xenpm
 tools/misc/xen-hvmctx
@@ -247,9 +247,9 @@ xen/arch/x86/efi/check.efi
 xen/arch/x86/efi/disabled
 xen/arch/x86/efi/mkreloc
 xen/arch/x86/test/config.h
-xen/arch/x86/test/xen_hello_world.xsplice
-xen/arch/x86/test/xen_bye_world.xsplice
-xen/arch/x86/test/xen_replace_world.xsplice
+xen/arch/x86/test/xen_hello_world.livepatch
+xen/arch/x86/test/xen_bye_world.livepatch
+xen/arch/x86/test/xen_replace_world.livepatch
 xen/arch/*/efi/boot.c
 xen/arch/*/efi/compat.c
 xen/arch/*/efi/efi.h
MAINTAINERS +10 -10
index 62f4ffd..9a224d4 100644
@@ -261,6 +261,16 @@ F:      xen/include/{kexec,kimage}.h
 F:      xen/arch/x86/machine_kexec.c
 F:      xen/arch/x86/x86_64/kexec_reloc.S
 
+LIVEPATCH
+M:  Konrad Rzeszutek Wilk <[email protected]>
+M:  Ross Lagerwall <[email protected]>
+S:  Supported
+F:  docs/misc/livepatch.markdown
+F:  tools/misc/xen-livepatch.c
+F:  xen/arch/*/livepatch*
+F:  xen/common/livepatch*
+F:  xen/include/xen/livepatch*
+
 MACHINE CHECK (MCA) & RAS
 M:	Christoph Egger <[email protected]>
 M:	Liu Jinsong <[email protected]>
@@ -470,16 +480,6 @@ F:  xen/include/xsm/
 F:  xen/xsm/
 F:  docs/misc/xsm-flask.txt
 
-XSPLICE
-M:  Konrad Rzeszutek Wilk <[email protected]>
-M:  Ross Lagerwall <[email protected]>
-S:  Supported
-F:  docs/misc/xsplice.markdown
-F:  tools/misc/xen-xsplice.c
-F:  xen/arch/*/xsplice*
-F:  xen/common/xsplice*
-F:  xen/include/xen/xsplice*
-
 THE REST
 M:	Andrew Cooper <[email protected]>
 M:	George Dunlap <[email protected]>
docs/misc/livepatch.markdown renamed from docs/misc/xsplice.markdown +92 -92

435 lines not on this page · raw message

tools/flask/policy/policy/modules/xen/xen.te +1 -1
index 0b1c955..50aa602 100644
@@ -74,7 +74,7 @@ allow dom0_t xen_t:xen2 {
     get_symbol
     get_cpu_levelling_caps
     get_cpu_featureset
-    xsplice_op
+    livepatch_op
 };
 
 # Allow dom0 to use all XENVER_ subops that have checks.
tools/libxc/include/xenctrl.h +16 -16
index dc54612..6ae1a2b 100644
@@ -2610,15 +2610,15 @@ const uint32_t *xc_get_feature_deep_deps(uint32_t feature);
 
 #endif
 
-int xc_xsplice_upload(xc_interface *xch,
-                      char *name, unsigned char *payload, uint32_t size);
+int xc_livepatch_upload(xc_interface *xch,
+                        char *name, unsigned char *payload, uint32_t size);
 
-int xc_xsplice_get(xc_interface *xch,
-                   char *name,
-                   xen_xsplice_status_t *status);
+int xc_livepatch_get(xc_interface *xch,
+                     char *name,
+                     xen_livepatch_status_t *status);
 
 /*
- * The heart of this function is to get an array of xen_xsplice_status_t.
+ * The heart of this function is to get an array of xen_livepatch_status_t.
  *
  * However it is complex because it has to deal with the hypervisor
  * returning some of the requested data or data being stale
@@ -2638,10 +2638,10 @@ int xc_xsplice_get(xc_interface *xch,
  * number of entries that 'info', 'name', and 'len' arrays can
  * be filled up with.
  *
- * Each entry in the 'name' array is expected to be of XEN_XSPLICE_NAME_SIZE
+ * Each entry in the 'name' array is expected to be of XEN_LIVEPATCH_NAME_SIZE
  * length.
  *
- * Each entry in the 'info' array is expected to be of xen_xsplice_status_t
+ * Each entry in the 'info' array is expected to be of xen_livepatch_status_t
  * structure size.
  *
  * Each entry in the 'len' array is expected to be of uint32_t size.
@@ -2655,10 +2655,10 @@ int xc_xsplice_get(xc_interface *xch,
  * will contain the number of entries that had been succesfully
  * retrieved (if any).
  */
-int xc_xsplice_list(xc_interface *xch, unsigned int max, unsigned int start,
-                    xen_xsplice_status_t *info, char *name,
-                    uint32_t *len, unsigned int *done,
-                    unsigned int *left);
+int xc_livepatch_list(xc_interface *xch, unsigned int max, unsigned int start,
+                      xen_livepatch_status_t *info, char *name,
+                      uint32_t *len, unsigned int *done,
+                      unsigned int *left);
 
 /*
  * The operations are asynchronous and the hypervisor may take a while
@@ -2666,10 +2666,10 @@ int xc_xsplice_list(xc_interface *xch, unsigned int max, unsigned int start,
  * operation if it could not be completed within the specified time
  * (in ms). Value of 0 means let hypervisor decide the best timeout.
  */
-int xc_xsplice_apply(xc_interface *xch, char *name, uint32_t timeout);
-int xc_xsplice_revert(xc_interface *xch, char *name, uint32_t timeout);
-int xc_xsplice_unload(xc_interface *xch, char *name, uint32_t timeout);
-int xc_xsplice_replace(xc_interface *xch, char *name, uint32_t timeout);
+int xc_livepatch_apply(xc_interface *xch, char *name, uint32_t timeout);
+int xc_livepatch_revert(xc_interface *xch, char *name, uint32_t timeout);
+int xc_livepatch_unload(xc_interface *xch, char *name, uint32_t timeout);
+int xc_livepatch_replace(xc_interface *xch, char *name, uint32_t timeout);
 
 /* Compat shims */
 #include "xenctrl_compat.h"
tools/libxc/xc_misc.c +71 -71

297 lines not on this page · raw message

tools/misc/Makefile +2 -2
index 3a5f842..cee2b99 100644
@@ -32,7 +32,7 @@ INSTALL_SBIN                   += xenlockprof
 INSTALL_SBIN                   += xenperf
 INSTALL_SBIN                   += xenpm
 INSTALL_SBIN                   += xenwatchdogd
-INSTALL_SBIN                   += xen-xsplice
+INSTALL_SBIN                   += xen-livepatch
 INSTALL_SBIN += $(INSTALL_SBIN-y)
 
 # Everything to be installed in a private bin/
@@ -104,7 +104,7 @@ xen-mfndump: xen-mfndump.o
 xenwatchdogd: xenwatchdogd.o
 	$(CC) $(LDFLAGS) -o $@ $< $(LDLIBS_libxenctrl) $(APPEND_LDFLAGS)
 
-xen-xsplice: xen-xsplice.o
+xen-livepatch: xen-livepatch.o
 	$(CC) $(LDFLAGS) -o $@ $< $(LDLIBS_libxenctrl) $(APPEND_LDFLAGS)
 
 xen-lowmemd: xen-lowmemd.o
tools/misc/xen-livepatch.c renamed from tools/misc/xen-xsplice.c +31 -31

167 lines not on this page · raw message

xen/arch/arm/Makefile +1 -1
index ead0cc0..af4d0e1 100644
@@ -40,7 +40,7 @@ obj-y += device.o
 obj-y += decode.o
 obj-y += processor.o
 obj-y += smc.o
-obj-$(CONFIG_XSPLICE) += xsplice.o
+obj-$(CONFIG_LIVEPATCH) += livepatch.o
 
 #obj-bin-y += ....o
 
xen/arch/arm/livepatch.c renamed from xen/arch/arm/xsplice.c +19 -19
similarity index 29%
rename from xen/arch/arm/xsplice.c
rename to xen/arch/arm/livepatch.c
index db0dce2..527d691 100644
@@ -4,67 +4,67 @@
 #include <xen/errno.h>
 #include <xen/init.h>
 #include <xen/lib.h>
-#include <xen/xsplice_elf.h>
-#include <xen/xsplice.h>
+#include <xen/livepatch_elf.h>
+#include <xen/livepatch.h>
 
-void arch_xsplice_patching_enter(void)
+void arch_livepatch_enter(void)
 {
 }
 
-void arch_xsplice_patching_leave(void)
+void arch_livepatch_leave(void)
 {
 }
 
-int arch_xsplice_verify_func(const struct xsplice_patch_func *func)
+int arch_livepatch_verify_func(const struct livepatch_func *func)
 {
     return -ENOSYS;
 }
 
-void arch_xsplice_apply_jmp(struct xsplice_patch_func *func)
+void arch_livepatch_apply_jmp(struct livepatch_func *func)
 {
 }
 
-void arch_xsplice_revert_jmp(const struct xsplice_patch_func *func)
+void arch_livepatch_revert_jmp(const struct livepatch_func *func)
 {
 }
 
-void arch_xsplice_post_action(void)
+void arch_livepatch_post_action(void)
 {
 }
 
-void arch_xsplice_mask(void)
+void arch_livepatch_mask(void)
 {
 }
 
-void arch_xsplice_unmask(void)
+void arch_livepatch_unmask(void)
 {
 }
 
-int arch_xsplice_verify_elf(const struct xsplice_elf *elf)
+int arch_livepatch_verify_elf(const struct livepatch_elf *elf)
 {
     return -ENOSYS;
 }
 
-int arch_xsplice_perform_rel(struct xsplice_elf *elf,
-                             const struct xsplice_elf_sec *base,
-                             const struct xsplice_elf_sec *rela)
+int arch_livepatch_perform_rel(struct livepatch_elf *elf,
+                               const struct livepatch_elf_sec *base,
+                               const struct livepatch_elf_sec *rela)
 {
     return -ENOSYS;
 }
 
-int arch_xsplice_perform_rela(struct xsplice_elf *elf,
-                              const struct xsplice_elf_sec *base,
-                              const struct xsplice_elf_sec *rela)
+int arch_livepatch_perform_rela(struct livepatch_elf *elf,
+                                const struct livepatch_elf_sec *base,
+                                const struct livepatch_elf_sec *rela)
 {
     return -ENOSYS;
 }
 
-int arch_xsplice_secure(const void *va, unsigned int pages, enum va_type type)
+int arch_livepatch_secure(const void *va, unsigned int pages, enum va_type type)
 {
     return -ENOSYS;
 }
 
-void __init arch_xsplice_init(void)
+void __init arch_livepatch_init(void)
 {
 }
 
xen/arch/x86/Makefile +4 -4
index 4665a68..b377c91 100644
@@ -7,7 +7,7 @@ subdir-$(CONFIG_XENOPROF) += oprofile
 subdir-y += x86_64
 
 alternative-y := alternative.init.o
-alternative-$(CONFIG_XSPLICE) :=
+alternative-$(CONFIG_LIVEPATCH) :=
 obj-bin-y += $(alternative-y)
 obj-y += apic.o
 obj-y += bitops.o
@@ -30,6 +30,7 @@ obj-y += flushtlb.o
 obj-y += i387.o
 obj-y += i8259.o
 obj-y += io_apic.o
+obj-$(CONFIG_LIVEPATCH) += alternative.o livepatch.o
 obj-y += msi.o
 obj-y += ioport_emulate.o
 obj-y += irq.o
@@ -63,7 +64,6 @@ obj-y += x86_emulate.o
 obj-y += tboot.o
 obj-y += hpet.o
 obj-y += vm_event.o
-obj-$(CONFIG_XSPLICE) += alternative.o xsplice.o
 obj-y += xstate.o
 
 obj-$(crash_debug) += gdbstub.o
@@ -80,7 +80,7 @@ else
 notes_phdrs =
 endif
 
-ifdef CONFIG_XSPLICE
+ifdef CONFIG_LIVEPATCH
 all_symbols = --all-symbols
 ifdef CONFIG_FAST_SYMBOL_LOOKUP
 all_symbols = --all-symbols --sort-by-name
@@ -95,7 +95,7 @@ $(TARGET): $(TARGET)-syms $(efi-y) boot/mkelf32
 
 .PHONY: tests
 tests:
-	$(MAKE) -f $(BASEDIR)/Rules.mk -C test xsplice
+	$(MAKE) -f $(BASEDIR)/Rules.mk -C test livepatch
 
 ALL_OBJS := $(BASEDIR)/arch/x86/boot/built_in.o $(BASEDIR)/arch/x86/efi/built_in.o $(ALL_OBJS)
 
xen/arch/x86/alternative.c +9 -9
index c188a15..be40b13 100644
@@ -22,14 +22,14 @@
 #include <asm/system.h>
 #include <asm/traps.h>
 #include <asm/nmi.h>
-#include <xen/xsplice.h>
+#include <xen/livepatch.h>
 
 #define MAX_PATCH_LEN (255-1)
 
 extern struct alt_instr __alt_instructions[], __alt_instructions_end[];
 
 #ifdef K8_NOP1
-static const unsigned char k8nops[] init_or_xsplice_const = {
+static const unsigned char k8nops[] init_or_livepatch_const = {
     K8_NOP1,
     K8_NOP2,
     K8_NOP3,
@@ -39,7 +39,7 @@ static const unsigned char k8nops[] init_or_xsplice_const = {
     K8_NOP7,
     K8_NOP8
 };
-static const unsigned char * const k8_nops[ASM_NOP_MAX+1] init_or_xsplice_constrel = {
+static const unsigned char * const k8_nops[ASM_NOP_MAX+1] init_or_livepatch_constrel = {
     NULL,
     k8nops,
     k8nops + 1,
@@ -53,7 +53,7 @@ static const unsigned char * const k8_nops[ASM_NOP_MAX+1] init_or_xsplice_constr
 #endif
 
 #ifdef P6_NOP1
-static const unsigned char p6nops[] init_or_xsplice_const = {
+static const unsigned char p6nops[] init_or_livepatch_const = {
     P6_NOP1,
     P6_NOP2,
     P6_NOP3,
@@ -63,7 +63,7 @@ static const unsigned char p6nops[] init_or_xsplice_const = {
     P6_NOP7,
     P6_NOP8
 };
-static const unsigned char * const p6_nops[ASM_NOP_MAX+1] init_or_xsplice_constrel = {
+static const unsigned char * const p6_nops[ASM_NOP_MAX+1] init_or_livepatch_constrel = {
     NULL,
     p6nops,
     p6nops + 1,
@@ -76,7 +76,7 @@ static const unsigned char * const p6_nops[ASM_NOP_MAX+1] init_or_xsplice_constr
 };
 #endif
 
-static const unsigned char * const *ideal_nops init_or_xsplice_data = k8_nops;
+static const unsigned char * const *ideal_nops init_or_livepatch_data = k8_nops;
 
 static int __init mask_nmi_callback(const struct cpu_user_regs *regs, int cpu)
 {
@@ -101,7 +101,7 @@ static void __init arch_init_ideal_nops(void)
 }
 
 /* Use this to add nops to a buffer, then text_poke the whole buffer. */
-static void init_or_xsplice add_nops(void *insns, unsigned int len)
+static void init_or_livepatch add_nops(void *insns, unsigned int len)
 {
     while ( len > 0 )
     {
@@ -129,7 +129,7 @@ static void init_or_xsplice add_nops(void *insns, unsigned int len)
  * You should run this with interrupts disabled or on code that is not
  * executing.
  */
-static void *init_or_xsplice text_poke(void *addr, const void *opcode, size_t len)
+static void *init_or_livepatch text_poke(void *addr, const void *opcode, size_t len)
 {
     memcpy(addr, opcode, len);
     sync_core();
@@ -144,7 +144,7 @@ static void *init_or_xsplice text_poke(void *addr, const void *opcode, size_t le
  * APs have less capabilities than the boot processor are not handled.
  * Tough. Make sure you disable such features by hand.
  */
-void init_or_xsplice apply_alternatives_nocheck(struct alt_instr *start, struct alt_instr *end)
+void init_or_livepatch apply_alternatives_nocheck(struct alt_instr *start, struct alt_instr *end)
 {
     struct alt_instr *a;
     u8 *instr, *replacement;
xen/arch/x86/domain.c +2 -2
index 5af2cc5..f2d7f47 100644
@@ -36,7 +36,7 @@
 #include <xen/cpu.h>
 #include <xen/wait.h>
 #include <xen/guest_access.h>
-#include <xen/xsplice.h>
+#include <xen/livepatch.h>
 #include <public/sysctl.h>
 #include <public/hvm/hvm_vcpu.h>
 #include <asm/regs.h>
@@ -125,7 +125,7 @@ static void idle_loop(void)
          * We MUST be last (or before pm_idle). Otherwise after we get the
          * softirq we would execute pm_idle (and sleep) and not patch.
          */
-        check_for_xsplice_work();
+        check_for_livepatch_work();
     }
 }
 
xen/arch/x86/extable.c +4 -4
index 349df79..701441a 100644
@@ -7,7 +7,7 @@
 #include <xen/spinlock.h>
 #include <asm/uaccess.h>
 #include <xen/virtual_region.h>
-#include <xen/xsplice.h>
+#include <xen/livepatch.h>
 
 #define EX_FIELD(ptr, field) ((unsigned long)&(ptr)->field + (ptr)->field)
 
@@ -21,7 +21,7 @@ static inline unsigned long ex_cont(const struct exception_table_entry *x)
 	return EX_FIELD(x, cont);
 }
 
-static int init_or_xsplice cmp_ex(const void *a, const void *b)
+static int init_or_livepatch cmp_ex(const void *a, const void *b)
 {
 	const struct exception_table_entry *l = a, *r = b;
 	unsigned long lip = ex_addr(l);
@@ -36,7 +36,7 @@ static int init_or_xsplice cmp_ex(const void *a, const void *b)
 }
 
 #ifndef swap_ex
-static void init_or_xsplice swap_ex(void *a, void *b, int size)
+static void init_or_livepatch swap_ex(void *a, void *b, int size)
 {
 	struct exception_table_entry *l = a, *r = b, tmp;
 	long delta = b - a;
@@ -49,7 +49,7 @@ static void init_or_xsplice swap_ex(void *a, void *b, int size)
 }
 #endif
 
-void init_or_xsplice sort_exception_table(struct exception_table_entry *start,
+void init_or_livepatch sort_exception_table(struct exception_table_entry *start,
                                  const struct exception_table_entry *stop)
 {
     sort(start, stop - start,
xen/arch/x86/livepatch.c renamed from xen/arch/x86/xsplice.c +28 -28

174 lines not on this page · raw message

xen/arch/x86/test/Makefile +29 -29

96 lines not on this page · raw message

xen/arch/x86/test/xen_bye_world.c +3 -3
index f93f969..b75e0b1 100644
@@ -7,15 +7,15 @@
 #include <xen/lib.h>
 #include <xen/types.h>
 #include <xen/version.h>
-#include <xen/xsplice.h>
+#include <xen/livepatch.h>
 
 #include <public/sysctl.h>
 
 static char bye_world_patch_this_fnc[] = "xen_extra_version";
 extern const char *xen_bye_world(void);
 
-struct xsplice_patch_func __section(".xsplice.funcs") xsplice_xen_bye_world = {
-    .version = XSPLICE_PAYLOAD_VERSION,
+struct livepatch_func __section(".livepatch.funcs") livepatch_xen_bye_world = {
+    .version = LIVEPATCH_PAYLOAD_VERSION,
     .name = bye_world_patch_this_fnc,
     .new_addr = xen_bye_world,
     .old_addr = xen_extra_version,
xen/arch/x86/test/xen_hello_world.c +3 -3
index 8afd66e..422bdf1 100644
@@ -6,15 +6,15 @@
 #include "config.h"
 #include <xen/types.h>
 #include <xen/version.h>
-#include <xen/xsplice.h>
+#include <xen/livepatch.h>
 
 #include <public/sysctl.h>
 
 static char hello_world_patch_this_fnc[] = "xen_extra_version";
 extern const char *xen_hello_world(void);
 
-struct xsplice_patch_func __section(".xsplice.funcs") xsplice_xen_hello_world = {
-    .version = XSPLICE_PAYLOAD_VERSION,
+struct livepatch_func __section(".livepatch.funcs") livepatch_xen_hello_world = {
+    .version = LIVEPATCH_PAYLOAD_VERSION,
     .name = hello_world_patch_this_fnc,
     .new_addr = xen_hello_world,
     .old_addr = xen_extra_version,
xen/arch/x86/test/xen_replace_world.c +3 -3
index fab2841..a2a221a 100644
@@ -6,15 +6,15 @@
 #include "config.h"
 #include <xen/lib.h>
 #include <xen/types.h>
-#include <xen/xsplice.h>
+#include <xen/livepatch.h>
 
 #include <public/sysctl.h>
 
 static char xen_replace_world_name[] = "xen_extra_version";
 extern const char *xen_replace_world(void);
 
-struct xsplice_patch_func __section(".xsplice.funcs") xsplice_xen_replace_world = {
-    .version = XSPLICE_PAYLOAD_VERSION,
+struct livepatch_func __section(".livepatch.funcs") livepatch_xen_replace_world = {
+    .version = LIVEPATCH_PAYLOAD_VERSION,
     .name = xen_replace_world_name,
     .old_addr = 0, /* Forces the hypervisor to lookup .name */
     .new_addr = xen_replace_world,
xen/arch/x86/traps.c +1 -1
index 5d7232d..c4e0e6f 100644
@@ -50,7 +50,7 @@
 #include <xen/paging.h>
 #include <xen/virtual_region.h>
 #include <xen/watchdog.h>
-#include <xen/xsplice.h>
+#include <xen/livepatch.h>
 #include <asm/system.h>
 #include <asm/io.h>
 #include <asm/atomic.h>
xen/common/Kconfig +5 -5
index 91ea904..cd59574 100644
@@ -192,9 +192,9 @@ config SCHED_DEFAULT
 
 endmenu
 
-# Enable/Disable xsplice support
-config XSPLICE
-	bool "xSplice live patching support (TECH PREVIEW)"
+# Enable/Disable live patching support
+config LIVEPATCH
+	bool "Live patching support (TECH PREVIEW)"
 	default n
 	depends on X86 && HAS_BUILD_ID = "y"
 	---help---
@@ -207,13 +207,13 @@ config XSPLICE
 config FAST_SYMBOL_LOOKUP
 	bool "Fast symbol lookup (bigger binary)"
 	default y
-	depends on XSPLICE
+	depends on LIVEPATCH
 	---help---
 	  When searching for symbol addresses we can use the built-in system
 	  that is optimized for searching symbols using addresses as the key.
 	  However using it for the inverse (find address using the symbol name)
 	  it is slow. This extra data and code (~55kB) speeds up the search.
-	  The only user of this is xSplice.
+	  The only user of this is Live patching.
 
 	  If unsure, say Y.
 endmenu
xen/common/Makefile +1 -2
index afd84b6..dda9925 100644
@@ -17,6 +17,7 @@ obj-y += keyhandler.o
 obj-$(CONFIG_KEXEC) += kexec.o
 obj-$(CONFIG_KEXEC) += kimage.o
 obj-y += lib.o
+obj-$(CONFIG_LIVEPATCH) += livepatch.o livepatch_elf.o
 obj-y += lzo.o
 obj-$(CONFIG_HAS_MEM_ACCESS) += mem_access.o
 obj-y += memory.o
@@ -58,8 +59,6 @@ obj-y += vsprintf.o
 obj-y += wait.o
 obj-$(CONFIG_XENOPROF) += xenoprof.o
 obj-y += xmalloc_tlsf.o
-obj-$(CONFIG_XSPLICE) += xsplice.o
-obj-$(CONFIG_XSPLICE) += xsplice_elf.o
 
 obj-bin-$(CONFIG_X86) += $(foreach n,decompress bunzip2 unxz unlzma unlzo unlz4 earlycpio,$(n).init.o)
 
xen/common/livepatch.c renamed from xen/common/xsplice.c +185 -185

1,023 lines not on this page · raw message

xen/common/livepatch_elf.c renamed from xen/common/xsplice_elf.c +55 -54

305 lines not on this page · raw message

xen/common/sysctl.c +3 -3
index 9a4cc1f..75f4c05 100644

Lines of this file are not shown. View the raw message.

xen/common/virtual_region.c +2 -2
index 426dfa0..aa23918 100644

Lines of this file are not shown. View the raw message.

xen/common/vsprintf.c +2 -2
index 70e1edf..b050ea3 100644

Lines of this file are not shown. View the raw message.

xen/include/asm-x86/current.h +4 -4
index fa55602..e6587e6 100644

Lines of this file are not shown. View the raw message.

xen/include/public/sysctl.h +69 -69

138 lines not on this page · raw message

xen/include/xen/elfstructs.h +1 -1
index 68954b0..5f2082e 100644

Lines of this file are not shown. View the raw message.

xen/include/xen/livepatch.h renamed from xen/include/xen/xsplice.h +50 -50

100 lines not on this page · raw message

xen/include/xen/livepatch_elf.h renamed from xen/include/xen/xsplice_elf.h +18 -17
similarity index 56%
rename from xen/include/xen/xsplice_elf.h
rename to xen/include/xen/livepatch_elf.h
index 750dc94..7e7c86e 100644

Lines of this file are not shown. View the raw message.

xen/xsm/flask/hooks.c +2 -2
index 7477dbe..20d46c8 100644

Lines of this file are not shown. View the raw message.

xen/xsm/flask/policy/access_vectors +2 -2
index 4d1b548..3d29042 100644

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

Signature · 9 lines
2.5.5




_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel

Part of the diff is not shown here. View the raw message.

Acked-by on v2 1/1
#8 lore raw
In reply to Konrad Rzeszutek Wilk
Quoted 8 lines · Konrad Rzeszutek Wilk

Specifically:

s/\.xsplice/\.livepatch/
s/XSPLICE/LIVEPATCH/
s/xsplice/livepatch/
s/livepatch_patch_func/livepatch_func/
s/xSplice/Xen Live Patch/

Quoted 5 lines

And then modify some of the function arguments
to have two more characters.

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel