Re: [Xen-devel] [PATCH v5 02/16] arm/x86/common: Add HAS_[ALTERNATIVE|EX_TABLE]

2016-09-22 Thread Ross Lagerwall

On 09/21/2016 06:32 PM, Konrad Rzeszutek Wilk wrote:

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.

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

Acked-by: Jan Beulich  [relevant parts]
Suggested-by: Julien Grall 
Signed-off-by: Konrad Rzeszutek Wilk 



Reviewed-by: Ross Lagerwall 

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


Re: [Xen-devel] [PATCH v5 02/16] arm/x86/common: Add HAS_[ALTERNATIVE|EX_TABLE]

2016-09-22 Thread Julien Grall

Hi Konrad,

On 21/09/16 18:32, Konrad Rzeszutek Wilk wrote:

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.

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

Acked-by: Jan Beulich  [relevant parts]
Suggested-by: Julien Grall 
Signed-off-by: Konrad Rzeszutek Wilk 


Reviewed-by: Julien Grall 

Regards,

--
Julien Grall

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


[Xen-devel] [PATCH v5 02/16] arm/x86/common: Add HAS_[ALTERNATIVE|EX_TABLE]

2016-09-21 Thread Konrad Rzeszutek Wilk
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.

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

Acked-by: Jan Beulich  [relevant parts]
Suggested-by: Julien Grall 
Signed-off-by: Konrad Rzeszutek Wilk 

---
Cc: Stefano Stabellini 
Cc: Julien Grall 
Cc: Jan Beulich 
Cc: Andrew Cooper 
Cc: Doug Goldstein 

v2: First submission
v3: Move the config options to common code
Don't include  in the file.
Don't even include  in the file as xen/Rules.mk automatically
includes the config.h for every GCC invocation.
v4: Depend on "arm64: s/ALTERNATIVE/HAS_ALTERNATIVE/"
Remove the extra newline in arch/x86/Kconfig
v5: Add Jan's Ack.
---
 xen/arch/arm/Kconfig   | 3 ---
 xen/arch/x86/Kconfig   | 2 ++
 xen/common/Kconfig | 6 ++
 xen/common/livepatch.c | 4 +++-
 4 files changed, 11 insertions(+), 4 deletions(-)

diff --git a/xen/arch/arm/Kconfig b/xen/arch/arm/Kconfig
index 558d013..2e023d1 100644
--- a/xen/arch/arm/Kconfig
+++ b/xen/arch/arm/Kconfig
@@ -45,9 +45,6 @@ config ACPI
 config HAS_GICV3
bool
 
-config HAS_ALTERNATIVE
-   bool
-
 endmenu
 
 menu "ARM errata workaround via the alternative framework"
diff --git a/xen/arch/x86/Kconfig b/xen/arch/x86/Kconfig
index 265fd79..96ca2bf 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
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 5f9986d..292dd2e 100644
--- a/xen/common/livepatch.c
+++ b/xen/common/livepatch.c
@@ -643,7 +643,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 )
 {
@@ -674,7 +674,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