File s390-tools-sles15sp2-30-zipl-move-__always_inline-barrier-__pa32-pa-to-zt_co.patch of Package s390-tools.19914

Subject: [PATCH] [FEAT VS1804] zipl: move __always_inline/barrier/__pa32/pa to zt_common.h
From: Marc Hartmayer <mhartmay@linux.ibm.com>

Summary:     genprotimg: Introduce new tool for the creation of PV images
Description: genprotimg takes a kernel, host-key documents, optionally an
             initrd, optionally a file with the kernel command line, and it
             generates a single, loadable image file. The image consists of a
             concatenation of a plain text boot loader, the encrypted
             components for kernel, initrd, and cmdline, and the
             integrity-protected PV header, containing metadata necessary for
             running the guest in PV mode. It's possible to use this image file
             as a kernel for zIPL or for a direct kernel boot using QEMU.
Upstream-ID: 24fe8c1d1b75185f341ec2d0efc6c34f0b9263f1
Problem-ID:  VS1804

Upstream-Description:

             zipl: move __always_inline/barrier/__pa32/pa to zt_common.h

             Move `__always_inline/barrier/__pa32/pa` to `lib/zt_common.h` as this
             is non-architecture dependent code.

             Reviewed-by: Philipp Rudo <prudo@linux.ibm.com>
             Reviewed-by: Stefan Haberland <sth@linux.ibm.com>
             Signed-off-by: Marc Hartmayer <mhartmay@linux.ibm.com>
             Signed-off-by: Jan Höppner <hoeppner@linux.ibm.com>


Signed-off-by: Marc Hartmayer <mhartmay@linux.ibm.com>
---
 include/lib/zt_common.h |   12 ++++++++++++
 zipl/boot/s390.h        |    9 ---------
 2 files changed, 12 insertions(+), 9 deletions(-)

--- a/include/lib/zt_common.h
+++ b/include/lib/zt_common.h
@@ -55,6 +55,18 @@
 #define __may_alias __attribute__((may_alias))
 #define __section(x) __attribute__((__section__(#x)))
 #define __noinline __attribute__((__noinline__))
+/* The Linux kernel (in stddef.h) and glibc (sys/cdefs.h) define
+ * __always_inline. Therefore undefine it first to allow the headers
+ * to be included first.
+ */
+#undef __always_inline
+#define __always_inline inline __attribute__((always_inline))
+
+#define __pa32(x) ((uint32_t)(unsigned long)(x))
+#define __pa(x) ((unsigned long)(x))
+
+#define barrier() __asm__ __volatile__("": : :"memory")
+
 
 typedef unsigned long long	u64;
 typedef signed long long	s64;
--- a/zipl/boot/s390.h
+++ b/zipl/boot/s390.h
@@ -15,16 +15,7 @@
 #include "libc.h"
 #include "boot/sigp.h"
 
-#define __pa32(x) ((uint32_t)(unsigned long)(x))
-#define __pa(x) ((unsigned long)(x))
 #define MIN(x, y) ((x) < (y) ? (x) : (y))
-#define barrier() __asm__ __volatile__("": : :"memory")
-/* The Linux kernel (in stddef.h) and glibc (sys/cdefs.h) define
- * __always_inline. Therefore undefine it first to allow the headers
- * to be included first.
- */
-#undef __always_inline
-#define __always_inline inline __attribute__((always_inline))
 
 /*
  * Helper macro for exception table entries
openSUSE Build Service is sponsored by