Skip to contentSkip to conversation

s390x: pv: Fixes and improvements

PATCH In review Janosch Frank 6 participants 14 messages Sep 7, 2020 – Sep 8, 2020

Subsystems (4)
lore
Share & tools
lore

Janosch Frank

author maintainer
#0 lore raw

v2 cover s390x: pv: Fixes and improvements

Using the destroy call instead of the export on a VM shutdown, we can clear out a protected guest much faster.

The 3f exception can in fact be triggered by userspace and therefore should not panic the whole system, but send a SIGSEGV to the culprit process.

v2:
* Removed whitespace damage
* Directly access task struct for pid and comm
* Removed NOKPROBE_SYMBOL

Janosch Frank (2):
s390x: uv: Add destroy page call
s390x: Add 3f program exception handler

 arch/s390/include/asm/uv.h   |  7 +++++++
 arch/s390/kernel/pgm_check.S |  2 +-
 arch/s390/kernel/uv.c        | 20 ++++++++++++++++++++
 arch/s390/mm/fault.c         | 20 ++++++++++++++++++++
 arch/s390/mm/gmap.c          |  2 +-
 5 files changed, 49 insertions(+), 2 deletions(-)
Signature · 1 line
2.25.1
author maintainer
#1 lore raw

PATCH v2 1/2 s390x: uv: Add destroy page call

We don't need to export pages if we destroy the VM configuration afterwards anyway. Instead we can destroy the page which will zero it and then make it accessible to the host.

Destroying is about twice as fast as the export.

---
 arch/s390/include/asm/uv.h |  7 +++++++
 arch/s390/kernel/uv.c      | 20 ++++++++++++++++++++
 arch/s390/mm/gmap.c        |  2 +-
 3 files changed, 28 insertions(+), 1 deletion(-)
arch/s390/include/asm/uv.h +7 -0
index cff4b4c99b75..0325fc0469b7 100644
@@ -33,6 +33,7 @@
 #define UVC_CMD_DESTROY_SEC_CPU		0x0121
 #define UVC_CMD_CONV_TO_SEC_STOR	0x0200
 #define UVC_CMD_CONV_FROM_SEC_STOR	0x0201
+#define UVC_CMD_DESTR_SEC_STOR		0x0202
 #define UVC_CMD_SET_SEC_CONF_PARAMS	0x0300
 #define UVC_CMD_UNPACK_IMG		0x0301
 #define UVC_CMD_VERIFY_IMG		0x0302
@@ -344,6 +345,7 @@ static inline int is_prot_virt_host(void)
 }
 
 int gmap_make_secure(struct gmap *gmap, unsigned long gaddr, void *uvcb);
+int uv_destroy_page(unsigned long paddr);
 int uv_convert_from_secure(unsigned long paddr);
 int gmap_convert_to_secure(struct gmap *gmap, unsigned long gaddr);
 
@@ -354,6 +356,11 @@ void adjust_to_uv_max(unsigned long *vmax);
 static inline void setup_uv(void) {}
 static inline void adjust_to_uv_max(unsigned long *vmax) {}
 
+static inline int uv_destroy_page(unsigned long paddr)
+{
+	return 0;
+}
+
 static inline int uv_convert_from_secure(unsigned long paddr)
 {
 	return 0;
arch/s390/kernel/uv.c +20 -0
index c296e5c8dbf9..d3399b8a9b23 100644
@@ -118,6 +118,26 @@ static int uv_pin_shared(unsigned long paddr)
 	return 0;
 }
 
+/*
+ * Requests the Ultravisor to destroy a guest page and make it
+ * accessible to the host. The destroy clears the page instead of
+ * exporting.
+ *
+ * @paddr: Absolute host address of page to be destroyed
+ */
+int uv_destroy_page(unsigned long paddr)
+{
+	struct uv_cb_cfs uvcb = {
+		.header.cmd = UVC_CMD_DESTR_SEC_STOR,
+		.header.len = sizeof(uvcb),
+		.paddr = paddr
+	};
+
+	if (uv_call(0, (u64)&uvcb))
+		return -EINVAL;
+	return 0;
+}
+
 /*
  * Requests the Ultravisor to encrypt a guest page and make it
  * accessible to the host for paging (export).
arch/s390/mm/gmap.c +1 -1
index 373542ca1113..cfb0017f33a7 100644
@@ -2679,7 +2679,7 @@ static int __s390_reset_acc(pte_t *ptep, unsigned long addr,
 	pte_t pte = READ_ONCE(*ptep);
 
 	if (pte_present(pte))
-		WARN_ON_ONCE(uv_convert_from_secure(pte_val(pte) & PAGE_MASK));
+		WARN_ON_ONCE(uv_destroy_page(pte_val(pte) & PAGE_MASK));
 	return 0;
 }
 
Signature · 1 line
2.25.1
Reviewed-by on v2 1/2
#2 lore raw

Re: [PATCH v2 1/2] s390x: uv: Add destroy page call

Quoted 6 lines · Janosch Frank

We don't need to export pages if we destroy the VM configuration afterwards anyway. Instead we can destroy the page which will zero it and then make it accessible to the host.

Destroying is about twice as fast as the export.

Quoted 7 lines
---
 arch/s390/include/asm/uv.h |  7 +++++++
 arch/s390/kernel/uv.c      | 20 ++++++++++++++++++++
 arch/s390/mm/gmap.c        |  2 +-
 3 files changed, 28 insertions(+), 1 deletion(-)
Reviewed-by on v2 1/2
#3 lore raw

Re: [PATCH v2 1/2] s390x: uv: Add destroy page call

In reply to Janosch Frank
Quoted 6 lines · On Mon, 7 Sep 2020 08:46:59 -0400 Janosch Frank <[email protected]> wrote:

We don't need to export pages if we destroy the VM configuration afterwards anyway. Instead we can destroy the page which will zero it and then make it accessible to the host.

Destroying is about twice as fast as the export.

Quoted 7 lines
---
 arch/s390/include/asm/uv.h |  7 +++++++
 arch/s390/kernel/uv.c      | 20 ++++++++++++++++++++
 arch/s390/mm/gmap.c        |  2 +-
 3 files changed, 28 insertions(+), 1 deletion(-)
author maintainer
#4 lore raw

PATCH v2 2/2 s390x: Add 3f program exception handler

In reply to Janosch Frank

Program exception 3f (secure storage violation) can only be detected when the CPU is running in SIE with a format 4 state description, e.g. running a protected guest. Because of this and because user space partly controls the guest memory mapping and can trigger this exception, we want to send a SIGSEGV to the process running the guest and not panic the kernel.

CC <[email protected]> # 5.7+
Fixes 084ea4d611a3 ("s390/mm: add (non)secure page access exceptions handlers")
---
 arch/s390/kernel/pgm_check.S |  2 +-
 arch/s390/mm/fault.c         | 20 ++++++++++++++++++++
 2 files changed, 21 insertions(+), 1 deletion(-)
arch/s390/kernel/pgm_check.S +1 -1
index 2c27907a5ffc..9a92638360ee 100644
@@ -80,7 +80,7 @@ PGM_CHECK(do_dat_exception)		/* 3b */
 PGM_CHECK_DEFAULT			/* 3c */
 PGM_CHECK(do_secure_storage_access)	/* 3d */
 PGM_CHECK(do_non_secure_storage_access)	/* 3e */
-PGM_CHECK_DEFAULT			/* 3f */
+PGM_CHECK(do_secure_storage_violation)	/* 3f */
 PGM_CHECK(monitor_event_exception)	/* 40 */
 PGM_CHECK_DEFAULT			/* 41 */
 PGM_CHECK_DEFAULT			/* 42 */
arch/s390/mm/fault.c +20 -0
index 4c8c063bce5b..996884dcc9fd 100644
@@ -859,6 +859,21 @@ void do_non_secure_storage_access(struct pt_regs *regs)
 }
 NOKPROBE_SYMBOL(do_non_secure_storage_access);
 
+void do_secure_storage_violation(struct pt_regs *regs)
+{
+	/*
+	 * Either KVM messed up the secure guest mapping or the same
+	 * page is mapped into multiple secure guests.
+	 *
+	 * This exception is only triggered when a guest 2 is running
+	 * and can therefore never occur in kernel context.
+	 */
+	printk_ratelimited(KERN_WARNING
+			   "Secure storage violation in task: %s, pid %d\n",
+			   current->comm, current->pid);
+	send_sig(SIGSEGV, current, 0);
+}
+
 #else
 void do_secure_storage_access(struct pt_regs *regs)
 {
@@ -869,4 +884,9 @@ void do_non_secure_storage_access(struct pt_regs *regs)
 {
 	default_trap_handler(regs);
 }
+
+void do_secure_storage_violation(struct pt_regs *regs)
+{
+	default_trap_handler(regs);
+}
 #endif
Signature · 1 line
2.25.1
#5 lore raw

Re: [PATCH v2 2/2] s390x: Add 3f program exception handler

I love your patch! Perhaps something to improve:

Hi Janosch,

I love your patch! Perhaps something to improve:

[auto build test WARNING on s390/features]
[also build test WARNING on kvms390/next v5.9-rc4 next-20200903] [If your patch is applied to the wrong git tree, kindly drop us a note. And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch]

url:    https://github.com/0day-ci/linux/commits/Janosch-Frank/s390x-pv-Fixes-and-improvements/20200908-021233
base:   https://git.kernel.org/pub/scm/linux/kernel/git/s390/linux.git features
config: s390-allyesconfig (attached as .config)
compiler: s390-linux-gcc (GCC) 9.3.0

reproduce (this is a W=1 build):
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross chmod +x ~/bin/make.cross
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross ARCH=s390

If you fix the issue, kindly add following tag as appropriate

All warnings (new ones prefixed by >>):

>> arch/s390/mm/fault.c:862:6: warning: no previous prototype for 'do_secure_storage_violation' [-Wmissing-prototypes]

862 | void do_secure_storage_violation(struct pt_regs *regs)
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~

# https://github.com/0day-ci/linux/commit/4aee662164217d48d050e0d9cf57a2cb2cdeaa8a
git remote add linux-review https://github.com/0day-ci/linux
git fetch --no-tags linux-review Janosch-Frank/s390x-pv-Fixes-and-improvements/20200908-021233 git checkout 4aee662164217d48d050e0d9cf57a2cb2cdeaa8a
vim +/do_secure_storage_violation +862 arch/s390/mm/fault.c

861

 > 862	void do_secure_storage_violation(struct pt_regs *regs)

863 {
864 /*
865 * Either KVM messed up the secure guest mapping or the same
866 * page is mapped into multiple secure guests.
867 *
868 * This exception is only triggered when a guest 2 is running
869 * and can therefore never occur in kernel context.
870 */
871 printk_ratelimited(KERN_WARNING
872 "Secure storage violation in task: %s, pid %d\n",
873 current->comm, current->pid);
874 send_sig(SIGSEGV, current, 0);
875 }
876

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org

maintainer
#6 lore raw

Re: [PATCH v2 2/2] s390x: Add 3f program exception handler

Hi Janosch,

Quoted 6 lines · kernel test robot

All warnings (new ones prefixed by >>):

Quoted 1 line
Quoted 1 line

arch/s390/mm/fault.c:862:6: warning: no previous prototype for 'do_secure_storage_violation' [-Wmissing-prototypes]

862 | void do_secure_storage_violation(struct pt_regs *regs)
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~

Quoted 8 lines

# https://github.com/0day-ci/linux/commit/4aee662164217d48d050e0d9cf57a2cb2cdeaa8a
git remote add linux-review https://github.com/0day-ci/linux
git fetch --no-tags linux-review Janosch-Frank/s390x-pv-Fixes-and-improvements/20200908-021233 git checkout 4aee662164217d48d050e0d9cf57a2cb2cdeaa8a
vim +/do_secure_storage_violation +862 arch/s390/mm/fault.c

   861	
Quoted 1 line

862 void do_secure_storage_violation(struct pt_regs *regs)

To get rid of this warning, please add the function prototype to arch/s390/kernel/entry.h. Like we have them for all other program check handlers for this reason as well.

author maintainer
#7 lore raw

PATCH v3 1/1 s390x: Add 3f program exception handler

Program exception 3f (secure storage violation) can only be detected when the CPU is running in SIE with a format 4 state description, e.g. running a protected guest. Because of this and because user space partly controls the guest memory mapping and can trigger this exception, we want to send a SIGSEGV to the process running the guest and not panic the kernel.

CC <[email protected]> # 5.7+
Fixes 084ea4d611a3 ("s390/mm: add (non)secure page access exceptions handlers")
---
 arch/s390/kernel/entry.h     |  1 +
 arch/s390/kernel/pgm_check.S |  2 +-
 arch/s390/mm/fault.c         | 20 ++++++++++++++++++++
 3 files changed, 22 insertions(+), 1 deletion(-)
arch/s390/kernel/entry.h +1 -0
index faca269d5f27..a44ddc2f2dec 100644
@@ -26,6 +26,7 @@ void do_protection_exception(struct pt_regs *regs);
 void do_dat_exception(struct pt_regs *regs);
 void do_secure_storage_access(struct pt_regs *regs);
 void do_non_secure_storage_access(struct pt_regs *regs);
+void do_secure_storage_violation(struct pt_regs *regs);
 
 void addressing_exception(struct pt_regs *regs);
 void data_exception(struct pt_regs *regs);
arch/s390/kernel/pgm_check.S +1 -1
index 2c27907a5ffc..9a92638360ee 100644
@@ -80,7 +80,7 @@ PGM_CHECK(do_dat_exception)		/* 3b */
 PGM_CHECK_DEFAULT			/* 3c */
 PGM_CHECK(do_secure_storage_access)	/* 3d */
 PGM_CHECK(do_non_secure_storage_access)	/* 3e */
-PGM_CHECK_DEFAULT			/* 3f */
+PGM_CHECK(do_secure_storage_violation)	/* 3f */
 PGM_CHECK(monitor_event_exception)	/* 40 */
 PGM_CHECK_DEFAULT			/* 41 */
 PGM_CHECK_DEFAULT			/* 42 */
arch/s390/mm/fault.c +20 -0
index 4c8c063bce5b..996884dcc9fd 100644
@@ -859,6 +859,21 @@ void do_non_secure_storage_access(struct pt_regs *regs)
 }
 NOKPROBE_SYMBOL(do_non_secure_storage_access);
 
+void do_secure_storage_violation(struct pt_regs *regs)
+{
+	/*
+	 * Either KVM messed up the secure guest mapping or the same
+	 * page is mapped into multiple secure guests.
+	 *
+	 * This exception is only triggered when a guest 2 is running
+	 * and can therefore never occur in kernel context.
+	 */
+	printk_ratelimited(KERN_WARNING
+			   "Secure storage violation in task: %s, pid %d\n",
+			   current->comm, current->pid);
+	send_sig(SIGSEGV, current, 0);
+}
+
 #else
 void do_secure_storage_access(struct pt_regs *regs)
 {
@@ -869,4 +884,9 @@ void do_non_secure_storage_access(struct pt_regs *regs)
 {
 	default_trap_handler(regs);
 }
+
+void do_secure_storage_violation(struct pt_regs *regs)
+{
+	default_trap_handler(regs);
+}
 #endif
Signature · 1 line
2.25.1
maintainer
#8 lore raw

Re: [PATCH v3] s390x: Add 3f program exception handler

Quoted 13 lines · Janosch Frank

Program exception 3f (secure storage violation) can only be detected when the CPU is running in SIE with a format 4 state description, e.g. running a protected guest. Because of this and because user space partly controls the guest memory mapping and can trigger this exception, we want to send a SIGSEGV to the process running the guest and not panic the kernel.

CC <[email protected]> # 5.7+
Fixes 084ea4d611a3 ("s390/mm: add (non)secure page access exceptions handlers")
Quoted 5 lines
---
 arch/s390/kernel/entry.h     |  1 +
 arch/s390/kernel/pgm_check.S |  2 +-
 arch/s390/mm/fault.c         | 20 ++++++++++++++++++++
 3 files changed, 22 insertions(+), 1 deletion(-)

I guess this should go upstream via the s390 tree? Should I pick this up?

author maintainer
#9 lore raw

Re: [PATCH v3] s390x: Add 3f program exception handler

Quoted 20 lines · Heiko Carstens
Quoted 13 lines · Janosch Frank

Program exception 3f (secure storage violation) can only be detected when the CPU is running in SIE with a format 4 state description, e.g. running a protected guest. Because of this and because user space partly controls the guest memory mapping and can trigger this exception, we want to send a SIGSEGV to the process running the guest and not panic the kernel.

CC <[email protected]> # 5.7+
Fixes 084ea4d611a3 ("s390/mm: add (non)secure page access exceptions handlers")
Quoted 5 lines
---
 arch/s390/kernel/entry.h     |  1 +
 arch/s390/kernel/pgm_check.S |  2 +-
 arch/s390/mm/fault.c         | 20 ++++++++++++++++++++
 3 files changed, 22 insertions(+), 1 deletion(-)
Quoted 1 line

I guess this should go upstream via the s390 tree?

Christian asked the exact same question.
I think we picked the secure/non-secure exception handlers via the s390 tree so bringing these in via s390 would be in line with that.

Quoted 1 line

Should I pick this up?

That would be nice

maintainer
#10 lore raw

Re: [PATCH v3] s390x: Add 3f program exception handler

Quoted 23 lines · Janosch Frank
Quoted 20 lines · Heiko Carstens
Quoted 13 lines · Janosch Frank

Program exception 3f (secure storage violation) can only be detected when the CPU is running in SIE with a format 4 state description, e.g. running a protected guest. Because of this and because user space partly controls the guest memory mapping and can trigger this exception, we want to send a SIGSEGV to the process running the guest and not panic the kernel.

CC <[email protected]> # 5.7+
Fixes 084ea4d611a3 ("s390/mm: add (non)secure page access exceptions handlers")
Quoted 5 lines
---
 arch/s390/kernel/entry.h     |  1 +
 arch/s390/kernel/pgm_check.S |  2 +-
 arch/s390/mm/fault.c         | 20 ++++++++++++++++++++
 3 files changed, 22 insertions(+), 1 deletion(-)
Quoted 1 line

I guess this should go upstream via the s390 tree?

Quoted 7 lines

Christian asked the exact same question.
I think we picked the secure/non-secure exception handlers via the s390 tree so bringing these in via s390 would be in line with that.

Quoted 1 line

Should I pick this up?

That would be nice

Done.

#11 lore raw

Re: [PATCH v3] s390x: Add 3f program exception handler

In reply to Heiko Carstens
Quoted 20 lines · Heiko Carstens
Quoted 13 lines · Janosch Frank

Program exception 3f (secure storage violation) can only be detected when the CPU is running in SIE with a format 4 state description, e.g. running a protected guest. Because of this and because user space partly controls the guest memory mapping and can trigger this exception, we want to send a SIGSEGV to the process running the guest and not panic the kernel.

CC <[email protected]> # 5.7+
Fixes 084ea4d611a3 ("s390/mm: add (non)secure page access exceptions handlers")
Quoted 5 lines
---
 arch/s390/kernel/entry.h     |  1 +
 arch/s390/kernel/pgm_check.S |  2 +-
 arch/s390/mm/fault.c         | 20 ++++++++++++++++++++
 3 files changed, 22 insertions(+), 1 deletion(-)
Quoted 3 lines

I guess this should go upstream via the s390 tree? Should I pick this up?

Yes please.

Reviewed-by on v2 2/2
#12 lore raw

Re: [PATCH v2 2/2] s390x: Add 3f program exception handler

In reply to Janosch Frank
Quoted 12 lines · On Mon, 7 Sep 2020 08:47:00 -0400 Janosch Frank <[email protected]> wrote:

Program exception 3f (secure storage violation) can only be detected when the CPU is running in SIE with a format 4 state description, e.g. running a protected guest. Because of this and because user space partly controls the guest memory mapping and can trigger this exception, we want to send a SIGSEGV to the process running the guest and not panic the kernel.

CC <[email protected]> # 5.7+
Fixes 084ea4d611a3 ("s390/mm: add (non)secure page access exceptions handlers")
Quoted 4 lines
---
 arch/s390/kernel/pgm_check.S |  2 +-
 arch/s390/mm/fault.c         | 20 ++++++++++++++++++++
 2 files changed, 21 insertions(+), 1 deletion(-)
#13 lore raw

Re: [PATCH v2 2/2] s390x: Add 3f program exception handler

In reply to Janosch Frank
I love your patch! Perhaps something to improve:

Hi Janosch,

I love your patch! Perhaps something to improve:

[auto build test WARNING on s390/features]
[also build test WARNING on v5.9-rc4 next-20200903]
[If your patch is applied to the wrong git tree, kindly drop us a note. And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch]

url:    https://github.com/0day-ci/linux/commits/Janosch-Frank/s390x-pv-Fixes-and-improvements/20200908-021233
base:   https://git.kernel.org/pub/scm/linux/kernel/git/s390/linux.git features
config: s390-randconfig-r032-20200908 (attached as .config)
compiler: clang version 12.0.0 (https://github.com/llvm/llvm-project 5f5a0bb0872a9673bad08b38bc0b14c42263902a)

reproduce (this is a W=1 build):
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross chmod +x ~/bin/make.cross
# install s390 cross compiling tool for clang build
# apt-get install binutils-s390x-linux-gnu
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=s390

If you fix the issue, kindly add following tag as appropriate

All warnings (new ones prefixed by >>):

include/asm-generic/io.h:490:61: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]

           val = __le32_to_cpu((__le32 __force)__raw_readl(PCI_IOBASE + addr));
                                                           ~~~~~~~~~~ ^
   include/uapi/linux/byteorder/big_endian.h:34:59: note: expanded from macro '__le32_to_cpu'
   #define __le32_to_cpu(x) __swab32((__force __u32)(__le32)(x))
                                                             ^
   include/uapi/linux/swab.h:119:21: note: expanded from macro '__swab32'
           ___constant_swab32(x) :                 \
                              ^
   include/uapi/linux/swab.h:20:12: note: expanded from macro '___constant_swab32'
           (((__u32)(x) & (__u32)0x0000ff00UL) <<  8) |            \
                     ^
   In file included from arch/s390/mm/fault.c:35:
   In file included from arch/s390/include/asm/diag.h:12:
   In file included from include/linux/if_ether.h:19:
   In file included from include/linux/skbuff.h:31:
   In file included from include/linux/dma-mapping.h:11:
   In file included from include/linux/scatterlist.h:9:
   In file included from arch/s390/include/asm/io.h:72:
   include/asm-generic/io.h:490:61: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
           val = __le32_to_cpu((__le32 __force)__raw_readl(PCI_IOBASE + addr));
                                                           ~~~~~~~~~~ ^
   include/uapi/linux/byteorder/big_endian.h:34:59: note: expanded from macro '__le32_to_cpu'
   #define __le32_to_cpu(x) __swab32((__force __u32)(__le32)(x))
                                                             ^
   include/uapi/linux/swab.h:119:21: note: expanded from macro '__swab32'
           ___constant_swab32(x) :                 \
                              ^
   include/uapi/linux/swab.h:21:12: note: expanded from macro '___constant_swab32'
           (((__u32)(x) & (__u32)0x00ff0000UL) >>  8) |            \
                     ^
   In file included from arch/s390/mm/fault.c:35:
   In file included from arch/s390/include/asm/diag.h:12:
   In file included from include/linux/if_ether.h:19:
   In file included from include/linux/skbuff.h:31:
   In file included from include/linux/dma-mapping.h:11:
   In file included from include/linux/scatterlist.h:9:
   In file included from arch/s390/include/asm/io.h:72:
   include/asm-generic/io.h:490:61: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
           val = __le32_to_cpu((__le32 __force)__raw_readl(PCI_IOBASE + addr));
                                                           ~~~~~~~~~~ ^
   include/uapi/linux/byteorder/big_endian.h:34:59: note: expanded from macro '__le32_to_cpu'
   #define __le32_to_cpu(x) __swab32((__force __u32)(__le32)(x))
                                                             ^
   include/uapi/linux/swab.h:119:21: note: expanded from macro '__swab32'
           ___constant_swab32(x) :                 \
                              ^
   include/uapi/linux/swab.h:22:12: note: expanded from macro '___constant_swab32'
           (((__u32)(x) & (__u32)0xff000000UL) >> 24)))
                     ^
   In file included from arch/s390/mm/fault.c:35:
   In file included from arch/s390/include/asm/diag.h:12:
   In file included from include/linux/if_ether.h:19:
   In file included from include/linux/skbuff.h:31:
   In file included from include/linux/dma-mapping.h:11:
   In file included from include/linux/scatterlist.h:9:
   In file included from arch/s390/include/asm/io.h:72:
   include/asm-generic/io.h:490:61: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
           val = __le32_to_cpu((__le32 __force)__raw_readl(PCI_IOBASE + addr));
                                                           ~~~~~~~~~~ ^
   include/uapi/linux/byteorder/big_endian.h:34:59: note: expanded from macro '__le32_to_cpu'
   #define __le32_to_cpu(x) __swab32((__force __u32)(__le32)(x))
                                                             ^
   include/uapi/linux/swab.h:120:12: note: expanded from macro '__swab32'
           __fswab32(x))
                     ^
   In file included from arch/s390/mm/fault.c:35:
   In file included from arch/s390/include/asm/diag.h:12:
   In file included from include/linux/if_ether.h:19:
   In file included from include/linux/skbuff.h:31:
   In file included from include/linux/dma-mapping.h:11:
   In file included from include/linux/scatterlist.h:9:
   In file included from arch/s390/include/asm/io.h:72:
   include/asm-generic/io.h:501:33: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
           __raw_writeb(value, PCI_IOBASE + addr);
                               ~~~~~~~~~~ ^
   include/asm-generic/io.h:511:59: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
           __raw_writew((u16 __force)cpu_to_le16(value), PCI_IOBASE + addr);
                                                         ~~~~~~~~~~ ^
   include/asm-generic/io.h:521:59: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
           __raw_writel((u32 __force)cpu_to_le32(value), PCI_IOBASE + addr);
                                                         ~~~~~~~~~~ ^
   include/asm-generic/io.h:609:20: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
           readsb(PCI_IOBASE + addr, buffer, count);
                  ~~~~~~~~~~ ^
   include/asm-generic/io.h:617:20: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
           readsw(PCI_IOBASE + addr, buffer, count);
                  ~~~~~~~~~~ ^
   include/asm-generic/io.h:625:20: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
           readsl(PCI_IOBASE + addr, buffer, count);
                  ~~~~~~~~~~ ^
   include/asm-generic/io.h:634:21: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
           writesb(PCI_IOBASE + addr, buffer, count);
                   ~~~~~~~~~~ ^
   include/asm-generic/io.h:643:21: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
           writesw(PCI_IOBASE + addr, buffer, count);
                   ~~~~~~~~~~ ^
   include/asm-generic/io.h:652:21: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
           writesl(PCI_IOBASE + addr, buffer, count);
                   ~~~~~~~~~~ ^
>> arch/s390/mm/fault.c:862:6: warning: no previous prototype for function 'do_secure_storage_violation' [-Wmissing-prototypes]
   void do_secure_storage_violation(struct pt_regs *regs)
        ^

arch/s390/mm/fault.c:862:1: note: declare 'static' if the function is not intended to be used outside of this translation unit void do_secure_storage_violation(struct pt_regs *regs)
^
static
21 warnings generated.

# https://github.com/0day-ci/linux/commit/4aee662164217d48d050e0d9cf57a2cb2cdeaa8a
git remote add linux-review https://github.com/0day-ci/linux
git fetch --no-tags linux-review Janosch-Frank/s390x-pv-Fixes-and-improvements/20200908-021233 git checkout 4aee662164217d48d050e0d9cf57a2cb2cdeaa8a
vim +/do_secure_storage_violation +862 arch/s390/mm/fault.c

861

 > 862	void do_secure_storage_violation(struct pt_regs *regs)

863 {
864 /*
865 * Either KVM messed up the secure guest mapping or the same
866 * page is mapped into multiple secure guests.
867 *
868 * This exception is only triggered when a guest 2 is running
869 * and can therefore never occur in kernel context.
870 */
871 printk_ratelimited(KERN_WARNING
872 "Secure storage violation in task: %s, pid %d\n",
873 current->comm, current->pid);
874 send_sig(SIGSEGV, current, 0);
875 }
876

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org