xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v4] Livepatching patch set for 4.10
@ 2017-09-20 22:31 Konrad Rzeszutek Wilk
  2017-09-20 22:31 ` [PATCH v4 01/11] livepatch: Expand check for safe_for_reapply if livepatch has only .rodata Konrad Rzeszutek Wilk
                   ` (10 more replies)
  0 siblings, 11 replies; 26+ messages in thread
From: Konrad Rzeszutek Wilk @ 2017-09-20 22:31 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 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@lists.xen.org
https://lists.xen.org/xen-devel

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

end of thread, other threads:[~2017-10-09  8:35 UTC | newest]

Thread overview: 26+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-09-20 22:31 [PATCH v4] Livepatching patch set for 4.10 Konrad Rzeszutek Wilk
2017-09-20 22:31 ` [PATCH v4 01/11] livepatch: Expand check for safe_for_reapply if livepatch has only .rodata Konrad Rzeszutek Wilk
2017-10-05 13:47   ` Ross Lagerwall
2017-10-05 13:51     ` Konrad Rzeszutek Wilk
2017-10-05 14:08       ` Ross Lagerwall
2017-09-20 22:31 ` [PATCH v4 02/11] livepatch: Tighten alignment checks Konrad Rzeszutek Wilk
2017-09-20 22:31 ` [PATCH v4 03/11] livepatch: Include sizes when an mismatch occurs Konrad Rzeszutek Wilk
2017-09-21 11:58   ` Jan Beulich
2017-10-05 14:06   ` Ross Lagerwall
2017-09-20 22:31 ` [PATCH v4 04/11] livepatch/arm[32, 64]: Don't load and crash on livepatches loaded with wrong text alignment Konrad Rzeszutek Wilk
2017-09-22 14:05   ` Jan Beulich
2017-10-09  8:35   ` Ross Lagerwall
2017-09-20 22:31 ` [PATCH v4 05/11] alternative/x86/arm32: Align altinstructions (and altinstr_replacement) sections Konrad Rzeszutek Wilk
2017-09-21 12:01   ` Jan Beulich
2017-09-20 22:31 ` [PATCH v4 06/11] mkhex: Move it to tools/misc Konrad Rzeszutek Wilk
2017-09-21  8:56   ` Wei Liu
2017-09-20 22:31 ` [PATCH v4 07/11] livepatch/x86/arm[32, 64]: Force .livepatch.depends section to be uint32_t aligned Konrad Rzeszutek Wilk
2017-10-05 14:11   ` Ross Lagerwall
2017-09-20 22:31 ` [PATCH v4 08/11] livepatch/arm/x86: Rename note_depends symbol from test-cases Konrad Rzeszutek Wilk
2017-09-21 12:05   ` Jan Beulich
2017-09-20 22:31 ` [PATCH v4 09/11] livepatch/tests: Make sure all .livepatch.funcs sections are read-only Konrad Rzeszutek Wilk
2017-09-20 22:31 ` [PATCH v4 10/11] livepatch/arm[32, 64]: Modify .livepatch.funcs section to be RW when patching Konrad Rzeszutek Wilk
2017-09-21 12:16   ` Jan Beulich
2017-09-21 14:58     ` Julien Grall
2017-09-21 15:09       ` Jan Beulich
2017-09-20 22:31 ` [PATCH v4 11/11] livepatch: Declare live patching as a supported feature Konrad Rzeszutek Wilk

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).