xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
To: xen-devel@lists.xenproject.org, konrad@kernel.org,
	julien.grall@arm.com, sstabellini@kernel.org,
	ross.lagerwall@citrix.com
Cc: andrew.cooper3@citrix.com, Doug Goldstein <cardoe@cardoe.com>,
	Jan Beulich <jbeulich@suse.com>,
	Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Subject: [PATCH v3 01/18] arm/x86: Add HAS_[ALTERNATIVE|EX_TABLE]
Date: Sun, 11 Sep 2016 16:35:08 -0400	[thread overview]
Message-ID: <1473626125-13683-2-git-send-email-konrad.wilk@oracle.com> (raw)
In-Reply-To: <1473626125-13683-1-git-send-email-konrad.wilk@oracle.com>

x86 implements all of them by default - and we just
add two extra HAS_ variables to be declared in autoconf.h.

ARM 64 only has alternative while ARM 32 has none of them.
The ARM64 is going to be a bit funny as there is an
ALTERNATIVE already and we end up selecting the HAS_ALTERNATIVE
whenever the ALTERNATIVE is selected.

And while at it change the livepatch common code that
would benefit from this.

Suggested-by: Julien Grall <julien.grall@arm.com>
Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>

---
Cc: Stefano Stabellini <sstabellini@kernel.org>
Cc: Julien Grall <julien.grall@arm.com>
Cc: Jan Beulich <jbeulich@suse.com>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>
Cc: Doug Goldstein <cardoe@cardoe.com>

v2: First submission
v3: Move the config options to common code
    Don't include <xen/config.h> in the file.
    Don't even include <xen/kconfig.h> in the file as xen/Rules.mk automatically
    includes the config.h for every GCC invocation.
---
 xen/arch/arm/Kconfig   | 4 ++++
 xen/arch/x86/Kconfig   | 3 +++
 xen/common/Kconfig     | 6 ++++++
 xen/common/livepatch.c | 4 +++-
 4 files changed, 16 insertions(+), 1 deletion(-)

diff --git a/xen/arch/arm/Kconfig b/xen/arch/arm/Kconfig
index 797c91f..bf640c5 100644
--- a/xen/arch/arm/Kconfig
+++ b/xen/arch/arm/Kconfig
@@ -45,8 +45,12 @@ config ACPI
 config HAS_GICV3
 	bool
 
+config HAS_ALTERNATIVE
+	bool
+
 config ALTERNATIVE
 	bool
+	select HAS_ALTERNATIVE
 
 endmenu
 
diff --git a/xen/arch/x86/Kconfig b/xen/arch/x86/Kconfig
index 265fd79..056a77f 100644
--- a/xen/arch/x86/Kconfig
+++ b/xen/arch/x86/Kconfig
@@ -7,8 +7,10 @@ config X86
 	select ACPI_LEGACY_TABLES_LOOKUP
 	select COMPAT
 	select CORE_PARKING
+	select HAS_ALTERNATIVE
 	select HAS_CPUFREQ
 	select HAS_EHCI
+	select HAS_EX_TABLE
 	select HAS_GDBSX
 	select HAS_IOPORTS
 	select HAS_KEXEC
@@ -22,6 +24,7 @@ config X86
 	select NUMA
 	select VGA
 
+
 config ARCH_DEFCONFIG
 	string
 	default "arch/x86/configs/x86_64_defconfig"
diff --git a/xen/common/Kconfig b/xen/common/Kconfig
index 4331874..81e0017 100644
--- a/xen/common/Kconfig
+++ b/xen/common/Kconfig
@@ -11,9 +11,15 @@ config COMPAT
 config CORE_PARKING
 	bool
 
+config HAS_ALTERNATIVE
+	bool
+
 config HAS_DEVICE_TREE
 	bool
 
+config HAS_EX_TABLE
+	bool
+
 config HAS_MEM_ACCESS
 	bool
 
diff --git a/xen/common/livepatch.c b/xen/common/livepatch.c
index f75171b..a2ddb61 100644
--- a/xen/common/livepatch.c
+++ b/xen/common/livepatch.c
@@ -628,7 +628,7 @@ static int prepare_payload(struct payload *payload,
                                   sizeof(*region->frame[i].bugs);
     }
 
-#ifndef CONFIG_ARM
+#ifdef CONFIG_HAS_ALTERNATIVE
     sec = livepatch_elf_sec_by_name(elf, ".altinstructions");
     if ( sec )
     {
@@ -659,7 +659,9 @@ static int prepare_payload(struct payload *payload,
         }
         apply_alternatives(start, end);
     }
+#endif
 
+#ifdef CONFIG_HAS_EX_TABLE
     sec = livepatch_elf_sec_by_name(elf, ".ex_table");
     if ( sec )
     {
-- 
2.4.11


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

  reply	other threads:[~2016-09-11 20:35 UTC|newest]

Thread overview: 38+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-09-11 20:35 [PATCH v3] Livepatch for ARM 64 and 32 Konrad Rzeszutek Wilk
2016-09-11 20:35 ` Konrad Rzeszutek Wilk [this message]
2016-09-12 15:28   ` [PATCH v3 01/18] arm/x86: Add HAS_[ALTERNATIVE|EX_TABLE] Jan Beulich
2016-09-12 15:31     ` Julien Grall
2016-09-13 16:58       ` Konrad Rzeszutek Wilk
2016-09-11 20:35 ` [PATCH v3 02/18] livepatch: Reject payloads with .alternative or .ex_table if support is not built-in Konrad Rzeszutek Wilk
2016-09-16 12:50   ` Julien Grall
2016-09-11 20:35 ` [PATCH v3 03/18] arm/x86: change [modify, destroy]_xen_mappings to return error Konrad Rzeszutek Wilk
2016-09-16 13:06   ` Julien Grall
2016-09-11 20:35 ` [PATCH v3 04/18] arm/mm: Introduce modify_xen_mappings Konrad Rzeszutek Wilk
2016-09-11 20:35 ` [PATCH v3 05/18] arm: poison initmem when it is freed Konrad Rzeszutek Wilk
2016-09-16 13:31   ` Julien Grall
2016-09-11 20:35 ` [PATCH v3 06/18] livepatch: Initial ARM64 support Konrad Rzeszutek Wilk
2016-09-12  7:45   ` Jan Beulich
2016-09-11 20:35 ` [PATCH v3 07/18] livepatch: ARM/x86: Check displacement of old_addr and new_addr Konrad Rzeszutek Wilk
2016-09-12 15:36   ` Jan Beulich
2016-09-11 20:35 ` [PATCH v3 08/18] livepatch: ARM 32|64: Ignore mapping symbols: $[d, a, x] Konrad Rzeszutek Wilk
2016-09-12 15:52   ` Jan Beulich
2016-09-11 20:35 ` [PATCH v3 09/18] livepatch/arm/x86: Check payload for for unwelcomed symbols Konrad Rzeszutek Wilk
2016-09-12 15:55   ` Jan Beulich
2016-09-11 20:35 ` [PATCH v3 10/18] livepatch: Move test-cases to their own sub-directory in test Konrad Rzeszutek Wilk
2016-09-11 20:35 ` [PATCH v3 11/18] livepatch: tests: Move the .name value to .rodata Konrad Rzeszutek Wilk
2016-09-11 20:35 ` [PATCH v3 12/18] livepatch: tests: Make them compile under ARM64 Konrad Rzeszutek Wilk
2016-09-11 20:35 ` [PATCH v3 13/18] livepatch: x86, ARM, alternative: Expose FEATURE_LIVEPATCH Konrad Rzeszutek Wilk
2016-09-13  9:14   ` Jan Beulich
2016-09-11 20:35 ` [PATCH v3 14/18] xen/arm32: Add an helper to invalidate all instruction caches Konrad Rzeszutek Wilk
2016-09-11 20:35 ` [PATCH v3 15/18] bug/x86/arm: Align bug_frames sections Konrad Rzeszutek Wilk
2016-09-13  9:21   ` Jan Beulich
2016-09-13 19:26     ` Konrad Rzeszutek Wilk
2016-09-11 20:35 ` [PATCH v3 16/18] livepatch: ARM32 support Konrad Rzeszutek Wilk
2016-09-12  7:48   ` Jan Beulich
2016-09-11 20:35 ` [PATCH v3 17/18] livepatch, arm[32|64]: Share arch_livepatch_revert_jmp Konrad Rzeszutek Wilk
2016-09-11 20:35 ` [PATCH v3 18/18] livepatch: arm[32, 64], x86: NOP test-case Konrad Rzeszutek Wilk
2016-09-16 13:35 ` [PATCH v3] Livepatch for ARM 64 and 32 Julien Grall
2016-09-16 13:41   ` Konrad Rzeszutek Wilk
2016-09-16 13:45     ` Julien Grall
2016-09-16 14:35       ` Konrad Rzeszutek Wilk
2016-09-16 14:43         ` Julien Grall

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1473626125-13683-2-git-send-email-konrad.wilk@oracle.com \
    --to=konrad.wilk@oracle.com \
    --cc=andrew.cooper3@citrix.com \
    --cc=cardoe@cardoe.com \
    --cc=jbeulich@suse.com \
    --cc=julien.grall@arm.com \
    --cc=konrad@kernel.org \
    --cc=ross.lagerwall@citrix.com \
    --cc=sstabellini@kernel.org \
    --cc=xen-devel@lists.xenproject.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).