All of lore.kernel.org
 help / color / mirror / Atom feed
* [kvm-unit-tests PATCH v2 0/2] s390x: Avoid gcc 12 warnings
@ 2022-05-20 14:05 Janis Schoetterl-Glausch
  2022-05-20 14:05 ` [kvm-unit-tests PATCH v2 1/2] s390x: Introduce symbol for lowcore and use it Janis Schoetterl-Glausch
                   ` (2 more replies)
  0 siblings, 3 replies; 8+ messages in thread
From: Janis Schoetterl-Glausch @ 2022-05-20 14:05 UTC (permalink / raw)
  To: Thomas Huth, Janosch Frank, Claudio Imbrenda
  Cc: Janis Schoetterl-Glausch, David Hildenbrand, kvm, linux-s390

gcc 12 warns if a memory operand to inline asm points to memory in the
first 4k bytes. However, in our case, these operands are fine, either
because we actually want to use that memory, or expect and handle the
resulting exception.

v1 -> v2
 * replace mechanism, don't use pragmas, instead use an extern symbol so
   gcc cannot conclude that the pointer is <4k

   This new extern symbol refers to the lowcore. As a result, code
   generation for lowcore accesses becomes worse.

   Alternatives:
    * Don't use extern symbol for lowcore, just for problematic pointers
    * Hide value from gcc via inline asm
    * Disable the warning globally
    * Use memory clobber instead of memory output
      Use address in register input instead of memory input
          (may require WRITE_ONCE)
    * Don't use gcc 12.0, with newer versions --param=min-pagesize=0 might
      avoid the problem

Janis Schoetterl-Glausch (2):
  s390x: Introduce symbol for lowcore and use it
  s390x: Fix gcc 12 warning about array bounds

 lib/s390x/asm/arch_def.h   |  2 ++
 lib/s390x/asm/facility.h   |  4 +--
 lib/s390x/asm/mem.h        |  4 +++
 lib/s390x/css.h            |  2 --
 lib/s390x/css_lib.c        | 12 ++++----
 lib/s390x/fault.c          | 10 +++----
 lib/s390x/interrupt.c      | 61 +++++++++++++++++++-------------------
 lib/s390x/mmu.c            |  3 +-
 s390x/flat.lds             |  1 +
 s390x/snippets/c/flat.lds  |  1 +
 s390x/css.c                |  4 +--
 s390x/diag288.c            |  4 +--
 s390x/edat.c               |  5 ++--
 s390x/emulator.c           | 15 +++++-----
 s390x/mvpg.c               |  7 ++---
 s390x/sclp.c               |  3 +-
 s390x/skey.c               |  2 +-
 s390x/skrf.c               | 11 +++----
 s390x/smp.c                | 23 +++++++-------
 s390x/snippets/c/spec_ex.c |  5 ++--
 20 files changed, 83 insertions(+), 96 deletions(-)


base-commit: 8719e8326101c1be8256617caf5835b57e819339
-- 
2.33.1


^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2022-06-03 13:12 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-05-20 14:05 [kvm-unit-tests PATCH v2 0/2] s390x: Avoid gcc 12 warnings Janis Schoetterl-Glausch
2022-05-20 14:05 ` [kvm-unit-tests PATCH v2 1/2] s390x: Introduce symbol for lowcore and use it Janis Schoetterl-Glausch
2022-05-24  7:42   ` Claudio Imbrenda
2022-06-03 13:12   ` Thomas Huth
2022-05-20 14:05 ` [kvm-unit-tests PATCH v2 2/2] s390x: Fix gcc 12 warning about array bounds Janis Schoetterl-Glausch
2022-05-24  7:31   ` Claudio Imbrenda
2022-05-24  9:35     ` Janis Schoetterl-Glausch
2022-05-24  7:39 ` [kvm-unit-tests PATCH v2 0/2] s390x: Avoid gcc 12 warnings Claudio Imbrenda

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.