Re: [kvm-unit-tests PATCH v2 0/2] s390x: Avoid gcc 12 warnings

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

 



On Fri, 20 May 2022 16:05:44 +0200
Janis Schoetterl-Glausch <scgl@xxxxxxxxxxxxx> wrote:

> 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 is a hack, but it's a nice hack

it gets rid of the compiler warning, and it also simplifies the
existing code.

> 
>    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




[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Kernel Development]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite Info]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Linux Media]     [Device Mapper]

  Powered by Linux