[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-devel] [PATCH v4] Livepatching patch set for 4.10



Hey,

As I was trying to port livepatch-build-tools.git to work under ARM32 and ARM64
(still ongoing, if somebody wants to help/take over would appreciate it)
I found some inconsistencies compared to the x86 and test-cases:

 - The .livepatch.funcs in the test-cases are in RW section but the 
livepatch-build-tools
   puts them in the RO sections. That works on x86 as arch_livepatch_quiesce
   turns of WP globally during the livepatching.
   But not on ARM.. and to make it work there I ended up using 
modify_xen_mappings

 - Cross compiling ARM32 introduces subtle alignment issues. Mainly
   both .altinstructions and .livepatch.depends end up with the
   wrong alingment and the hypervisor blows up. Both fixes are
   in the patchset.

I am also including in this patchset:

 - Declare the livepatch supported on x86 (but not ARM). I will
   shortly check it in if nobody screams.


I am NOT including in this patchset:

 - The local/global symbol patchset functionality. I am still
   working on Jan's feedback to use STV_INTERNAL.

Lastly, I tested this on ARM32 (Cubietruck), ARM64 (HiKey960) and
on x86.

Patches are in 

  git://xenbits.xen.org/people/konradwilk/xen.git staging-for-4.10.v4

Konrad Rzeszutek Wilk (10):
      livepatch: Expand check for safe_for_reapply if livepatch has only 
.rodata.
      livepatch: Tighten alignment checks.
      livepatch: Include sizes when an mismatch occurs
      livepatch/arm[32,64]: Don't load and crash on livepatches loaded with 
wrong text alignment.
      alternative/x86/arm32: Align altinstructions (and altinstr_replacement) 
sections.
      mkhex: Move it to tools/misc
      livepatch/x86/arm[32,64]: Force .livepatch.depends section to be uint32_t 
aligned.
      livepatch/arm/x86: Rename note_depends symbol from test-cases.
      livepatch/tests: Make sure all .livepatch.funcs sections are read-only
      livepatch/arm[32,64]: Modify .livepatch.funcs section to be RW when 
patching

Ross Lagerwall (1):
      livepatch: Declare live patching as a supported feature

 docs/features/livepatch.pandoc           | 106 +++++++++++++++++++++++++++++++
 docs/misc/livepatch.markdown             |   4 ++
 tools/firmware/hvmloader/Makefile        |   8 +--
 tools/{firmware/hvmloader => misc}/mkhex |   0
 xen/arch/arm/arm32/livepatch.c           |  13 +++-
 xen/arch/arm/kernel.c                    |   2 +-
 xen/arch/arm/livepatch.c                 |  54 +++++++++++++++-
 xen/arch/arm/mm.c                        |  28 ++++----
 xen/arch/arm/platforms/vexpress.c        |   2 +-
 xen/arch/arm/xen.lds.S                   |   1 -
 xen/arch/x86/livepatch.c                 |   8 ++-
 xen/arch/x86/xen.lds.S                   |   2 +-
 xen/common/Kconfig                       |   4 +-
 xen/common/livepatch.c                   |  71 ++++++++++++---------
 xen/common/livepatch_elf.c               |  13 ++++
 xen/drivers/video/arm_hdlcd.c            |   2 +-
 xen/include/asm-arm/alternative.h        |   4 ++
 xen/include/asm-arm/livepatch.h          |  13 ++++
 xen/include/asm-arm/page.h               |  51 ++++++++-------
 xen/include/asm-x86/alternative.h        |   2 +
 xen/include/xen/elfstructs.h             |   2 +
 xen/include/xen/livepatch.h              |   3 +-
 xen/test/livepatch/Makefile              |  64 ++++++++++---------
 xen/test/livepatch/xen_bye_world.c       |   1 +
 xen/test/livepatch/xen_hello_world.c     |   1 +
 xen/test/livepatch/xen_nop.c             |   1 +
 xen/test/livepatch/xen_replace_world.c   |   1 +
 27 files changed, 347 insertions(+), 114 deletions(-)


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
https://lists.xen.org/xen-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.