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

[Xen-devel] [PATCH v2 07/20] arm/x86: Add ALTERNATIVE and HAS_EX_TABLE



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

ARM 64 only has alternative while ARM 32 has none of them.

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

Suggested-by: Julien Grall <julien.grall@xxxxxxx>
Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@xxxxxxxxxx>

---
Cc: Stefano Stabellini <sstabellini@xxxxxxxxxx>
Cc: Julien Grall <julien.grall@xxxxxxx>
Cc: Jan Beulich <jbeulich@xxxxxxxx>
Cc: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
Cc: Doug Goldstein <cardoe@xxxxxxxxxx>

v2: First submission
---
 xen/arch/x86/Kconfig   | 8 ++++++++
 xen/common/livepatch.c | 5 ++++-
 2 files changed, 12 insertions(+), 1 deletion(-)

diff --git a/xen/arch/x86/Kconfig b/xen/arch/x86/Kconfig
index 265fd79..daef864 100644
--- a/xen/arch/x86/Kconfig
+++ b/xen/arch/x86/Kconfig
@@ -5,10 +5,12 @@ config X86
        def_bool y
        select ACPI
        select ACPI_LEGACY_TABLES_LOOKUP
+       select ALTERNATIVE
        select COMPAT
        select CORE_PARKING
        select HAS_CPUFREQ
        select HAS_EHCI
+       select HAS_EX_TABLE
        select HAS_GDBSX
        select HAS_IOPORTS
        select HAS_KEXEC
@@ -22,6 +24,12 @@ config X86
        select NUMA
        select VGA
 
+config ALTERNATIVE
+       bool
+
+config HAS_EX_TABLE
+       bool
+
 config ARCH_DEFCONFIG
        string
        default "arch/x86/configs/x86_64_defconfig"
diff --git a/xen/common/livepatch.c b/xen/common/livepatch.c
index b771c7d..7e36d97 100644
--- a/xen/common/livepatch.c
+++ b/xen/common/livepatch.c
@@ -3,6 +3,7 @@
  *
  */
 
+#include <xen/config.h>
 #include <xen/cpu.h>
 #include <xen/elf.h>
 #include <xen/err.h>
@@ -684,7 +685,7 @@ static int prepare_payload(struct payload *payload,
                                   sizeof(*region->frame[i].bugs);
     }
 
-#ifndef CONFIG_ARM
+#ifdef CONFIG_ALTERNATIVE
     sec = livepatch_elf_sec_by_name(elf, ".altinstructions");
     if ( sec )
     {
@@ -715,7 +716,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@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®.