All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v3] Livepatching patch set for 4.10
@ 2017-09-12  0:37 Konrad Rzeszutek Wilk
  2017-09-12  0:37 ` [PATCH v3 01/17] livepatch: Expand check for safe_for_reapply if livepatch has only .rodata Konrad Rzeszutek Wilk
                   ` (16 more replies)
  0 siblings, 17 replies; 42+ messages in thread
From: Konrad Rzeszutek Wilk @ 2017-09-12  0:37 UTC (permalink / raw)
  To: xen-devel, ross.lagerwall, konrad.wilk, julien.grall, sstabellini
  Cc: andrew.cooper3, jbeulich

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 the vmap functionality.
   Which then I made common on x86 as well (so no more CR4 mucking).
   This meant however meant mucking with x86 code page walker to
   have a do_page_walk functionality.

 - 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). It has latest
   feedback from Andrew and George (I hope!)

 - Post the local/global symbol patchset functionality. Only Jan had
   commented and I would appreciate other folks feedback - perhaps
   folks have better ideas on this?

Lastly, I tested this on ARM32 (Cubietruck), ARM64 (HiKey960) and
on x86. All looked good until I enabled CONFIG_DEBUG_SCRUB - which
is reported in:
https://lists.xen.org/archives/html/xen-devel/2017-09/msg01147.html

Patches are in 

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

 docs/features/livepatch.pandoc         | 106 ++++++++++++++++
 docs/misc/livepatch.markdown           |   4 +
 xen/arch/arm/arm32/livepatch.c         |  33 ++++-
 xen/arch/arm/arm64/livepatch.c         |  17 ++-
 xen/arch/arm/livepatch.c               |  49 +-------
 xen/arch/arm/xen.lds.S                 |   2 -
 xen/arch/x86/livepatch.c               |  36 ++++--
 xen/arch/x86/x86_64/mm.c               |  33 +++--
 xen/arch/x86/xen.lds.S                 |   1 -
 xen/common/Kconfig                     |   4 +-
 xen/common/livepatch.c                 | 219 +++++++++++++++++++++++++--------
 xen/common/livepatch_elf.c             |  13 ++
 xen/include/asm-arm/alternative.h      |   4 +
 xen/include/asm-arm/livepatch.h        |   6 -
 xen/include/asm-x86/alternative.h      |   1 +
 xen/include/asm-x86/mm.h               |   1 +
 xen/include/xen/elfstructs.h           |   2 +
 xen/include/xen/livepatch.h            |  23 +++-
 xen/include/xen/livepatch_elf.h        |   7 ++
 xen/test/livepatch/Makefile            |  76 +++++++-----
 xen/test/livepatch/xen_bye_world.c     |   1 +
 xen/test/livepatch/xen_hello_world.c   |   1 +
 xen/test/livepatch/xen_local_symbols.c |  53 ++++++++
 xen/test/livepatch/xen_nop.c           |   1 +
 xen/test/livepatch/xen_replace_world.c |   1 +
 25 files changed, 521 insertions(+), 173 deletions(-)

Konrad Rzeszutek Wilk (16):
      livepatch: Expand check for safe_for_reapply if livepatch has only .rodata.
      livepatch: Tighten alignment checks.
      livepatch: Include sizes when an mismatch occurs
      xen/livepatch/ARM32: Don't load and crash on livepatches loaded with wrong text alignment.
      alternative/x86/arm32: Align altinstructions (and altinstr_replacement) sections.
      xen/livepatch/x86/arm32: Force .livepatch.depends section to be uint32_t aligned.
      livepatch/arm/x86: Strip note_depends symbol from test-cases.
      livepatch/tests: Make sure all .livepatch.funcs sections are read-only
      livepatch/arm[32,64]: Modify livepatch_funcs
      livepatch/x86/arm[32,64]: Use common vmap code for applying.
      livepatch/x86/arm[32,64]: Unify arch_livepatch_revert
      livepatch: Expand spin_debug_disable in [apply|revert]_payload
      livepatch/x86/arm: arch/x86/mm: generalize do_page_walk() and implement arch_livepatch_lookup_mfn
      livepatch/x86/arm: Utilize the arch_livepatch_lookup_mfn
      livepatch: Add local and global symbol resolution.
      livepatch: Add xen_local_symbols test-case

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


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

^ permalink raw reply	[flat|nested] 42+ messages in thread

end of thread, other threads:[~2017-09-20 21:17 UTC | newest]

Thread overview: 42+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-09-12  0:37 [PATCH v3] Livepatching patch set for 4.10 Konrad Rzeszutek Wilk
2017-09-12  0:37 ` [PATCH v3 01/17] livepatch: Expand check for safe_for_reapply if livepatch has only .rodata Konrad Rzeszutek Wilk
2017-09-12  0:37 ` [PATCH v3 02/17] livepatch: Tighten alignment checks Konrad Rzeszutek Wilk
2017-09-12 14:28   ` Jan Beulich
2017-09-12  0:37 ` [PATCH v3 03/17] livepatch: Include sizes when an mismatch occurs Konrad Rzeszutek Wilk
2017-09-12  0:37 ` [PATCH v3 04/17] xen/livepatch/ARM32: Don't load and crash on livepatches loaded with wrong text alignment Konrad Rzeszutek Wilk
2017-09-14 11:36   ` Julien Grall
2017-09-12  0:37 ` [PATCH v3 05/17] alternative/x86/arm32: Align altinstructions (and altinstr_replacement) sections Konrad Rzeszutek Wilk
2017-09-12 14:40   ` Jan Beulich
2017-09-12  0:37 ` [PATCH v3 06/17] xen/livepatch/x86/arm32: Force .livepatch.depends section to be uint32_t aligned Konrad Rzeszutek Wilk
2017-09-14 12:27   ` Julien Grall
2017-09-19  0:32     ` Konrad Rzeszutek Wilk
2017-09-19 11:05       ` Julien Grall
2017-09-20 14:01         ` Wei Liu
2017-09-20 21:17           ` Konrad Rzeszutek Wilk
2017-09-12  0:37 ` [PATCH v3 07/17] livepatch/arm/x86: Strip note_depends symbol from test-cases Konrad Rzeszutek Wilk
2017-09-12 14:48   ` Jan Beulich
2017-09-12 23:46     ` Konrad Rzeszutek Wilk
2017-09-13  8:51       ` Jan Beulich
2017-09-13 16:28         ` Konrad Rzeszutek Wilk
2017-09-12  0:37 ` [PATCH v3 08/17] livepatch/tests: Make sure all .livepatch.funcs sections are read-only Konrad Rzeszutek Wilk
2017-09-12 14:49   ` Jan Beulich
2017-09-19  0:36     ` Konrad Rzeszutek Wilk
2017-09-12  0:37 ` [PATCH v3 09/17] livepatch/arm[32, 64]: Modify livepatch_funcs Konrad Rzeszutek Wilk
2017-09-14 13:20   ` Julien Grall
2017-09-19  0:35     ` Konrad Rzeszutek Wilk
2017-09-19 11:09       ` Julien Grall
2017-09-12  0:37 ` [PATCH v3 10/17] livepatch: Declare live patching as a supported feature Konrad Rzeszutek Wilk
2017-09-12  0:37 ` [PATCH v3 11/17] livepatch/x86/arm[32, 64]: Use common vmap code for applying Konrad Rzeszutek Wilk
2017-09-12 14:50   ` Andrew Cooper
2017-09-12  0:37 ` [PATCH v3 12/17] livepatch/x86/arm[32, 64]: Unify arch_livepatch_revert Konrad Rzeszutek Wilk
2017-09-14 13:23   ` Julien Grall
2017-09-12  0:37 ` [PATCH v3 13/17] livepatch: Expand spin_debug_disable in [apply|revert]_payload Konrad Rzeszutek Wilk
2017-09-14 13:47   ` Julien Grall
2017-09-12  0:37 ` [PATCH v3 14/17] livepatch/x86/arm: arch/x86/mm: generalize do_page_walk() and implement arch_livepatch_lookup_mfn Konrad Rzeszutek Wilk
2017-09-12 14:54   ` Jan Beulich
2017-09-13  0:23     ` Konrad Rzeszutek Wilk
2017-09-13  8:54       ` Jan Beulich
2017-09-14 13:54   ` Julien Grall
2017-09-12  0:37 ` [PATCH v3 15/17] livepatch/x86/arm: Utilize the arch_livepatch_lookup_mfn Konrad Rzeszutek Wilk
2017-09-12  0:37 ` [PATCH v3 16/17] livepatch: Add local and global symbol resolution Konrad Rzeszutek Wilk
2017-09-12  0:37 ` [PATCH v3 17/17] livepatch: Add xen_local_symbols test-case Konrad Rzeszutek Wilk

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.