qemu-commits
[Top][All Lists]
Advanced

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

[Qemu-commits] [qemu/qemu] 15c4e8: tcg: Do not set guard pages on the rx


From: Peter Maydell
Subject: [Qemu-commits] [qemu/qemu] 15c4e8: tcg: Do not set guard pages on the rx portion of c...
Date: Wed, 24 Mar 2021 06:22:42 -0700

  Branch: refs/heads/master
  Home:   https://github.com/qemu/qemu
  Commit: 15c4e8fe44e34eee4a13135eeb121b3b26e4cd1b
      
https://github.com/qemu/qemu/commit/15c4e8fe44e34eee4a13135eeb121b3b26e4cd1b
  Author: Richard Henderson <richard.henderson@linaro.org>
  Date:   2021-03-23 (Tue, 23 Mar 2021)

  Changed paths:
    M tcg/tcg.c

  Log Message:
  -----------
  tcg: Do not set guard pages on the rx portion of code_gen_buffer

The rw portion of the buffer is the only one in which overruns
can be generated.  Allow the rx portion to be more completely
covered by huge pages.

Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Tested-by: Roman Bolshakov <r.bolshakov@yadro.com>
Reviewed-by: Roman Bolshakov <r.bolshakov@yadro.com>
Message-Id: <20210320165720.1813545-2-richard.henderson@linaro.org>


  Commit: c118881ee607dcac661b89893de07cbcbaeb304c
      
https://github.com/qemu/qemu/commit/c118881ee607dcac661b89893de07cbcbaeb304c
  Author: Richard Henderson <richard.henderson@linaro.org>
  Date:   2021-03-23 (Tue, 23 Mar 2021)

  Changed paths:
    M tcg/tcg.c

  Log Message:
  -----------
  tcg: Workaround macOS 11.2 mprotect bug

There's a change in mprotect() behaviour [1] in the latest macOS
on M1 and it's not yet clear if it's going to be fixed by Apple.

As a short-term fix, ignore failures setting up the guard pages.

[1] https://gist.github.com/hikalium/75ae822466ee4da13cbbe486498a191f

Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Tested-by: Roman Bolshakov <r.bolshakov@yadro.com>
Reviewed-by: Roman Bolshakov <r.bolshakov@yadro.com>
Buglink: https://bugs.launchpad.net/qemu/+bug/1914849
Message-Id: <20210320165720.1813545-3-richard.henderson@linaro.org>


  Commit: 6670d4d0e38249323df755a92ffdf04f2c6b7894
      
https://github.com/qemu/qemu/commit/6670d4d0e38249323df755a92ffdf04f2c6b7894
  Author: Richard Henderson <richard.henderson@linaro.org>
  Date:   2021-03-23 (Tue, 23 Mar 2021)

  Changed paths:
    M MAINTAINERS
    R exec-vary.c
    M meson.build
    A page-vary.c

  Log Message:
  -----------
  exec: Rename exec-vary.c as page-vary.c

exec-vary.c is about variable page size handling,
rename it page-vary.c. Currently this file is target
specific (built once for each target), comment this.

Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Message-Id: <20210322112427.4045204-2-f4bug@amsat.org>
[rth: Update MAINTAINERS]
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>


  Commit: 27eb9d65ff5121ed11979dd57d9ec2b6c2315c01
      
https://github.com/qemu/qemu/commit/27eb9d65ff5121ed11979dd57d9ec2b6c2315c01
  Author: Richard Henderson <richard.henderson@linaro.org>
  Date:   2021-03-23 (Tue, 23 Mar 2021)

  Changed paths:
    M include/exec/cpu-all.h
    A include/exec/page-vary.h

  Log Message:
  -----------
  exec: Extract 'page-vary.h' header

In the next commit we will extract the generic code out of
page-vary.c, only keeping the target specific code. Both
files will use the same TargetPageBits structure, so make
its declaration in a shared header.

As the common header can not use target specific types,
use a uint64_t to hold the page mask value, and add a
cast back to target_long in the TARGET_PAGE_MASK definitions.

Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Message-Id: <20210322112427.4045204-3-f4bug@amsat.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>


  Commit: 44b99a6d5f24afcd8476d0d2701e1ca4ab9b35c1
      
https://github.com/qemu/qemu/commit/44b99a6d5f24afcd8476d0d2701e1ca4ab9b35c1
  Author: Richard Henderson <richard.henderson@linaro.org>
  Date:   2021-03-23 (Tue, 23 Mar 2021)

  Changed paths:
    M MAINTAINERS
    M configure
    M include/exec/cpu-all.h
    M include/exec/page-vary.h
    M meson.build
    A page-vary-common.c
    M page-vary.c

  Log Message:
  -----------
  exec: Build page-vary-common.c with -fno-lto

In bbc17caf81f, we used an alias attribute to allow target_page
to be declared const, and yet be initialized late.

This fails when using LTO with several versions of gcc.
The compiler looks through the alias and decides that the const
variable is statically initialized to zero, then propagates that
zero to many uses of the variable.

This can be avoided by compiling one object file with -fno-lto.
In this way, any initializer cannot be seen, and the constant
propagation does not occur.

Since we are certain to have this separate compilation unit, we
can drop the alias attribute as well.  We simply have differing
declarations for target_page in different compilation units.
Drop the use of init_target_page, and drop the configure detection
for CONFIG_ATTRIBUTE_ALIAS.

In order to change the compilation flags for a file with meson,
we must use a static_library.  This runs into specific_ss, where
we would need to create many static_library instances.

Fix this by splitting page-vary.c: the page-vary-common.c part is
compiled once as a static_library, while the page-vary.c part is
left in specific_ss in order to handle the target-specific value
of TARGET_PAGE_BITS_MIN.

Reported-by: Gavin Shan <gshan@redhat.com>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Message-Id: <20210321211534.2101231-1-richard.henderson@linaro.org>
[PMD: Fix typo in subject, split original patch in 3]
Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Tested-by: Gavin Shan <gshan@redhat.com>
Message-Id: <20210322112427.4045204-4-f4bug@amsat.org>
[rth: Update MAINTAINERS]
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>


  Commit: 01874b15d36e3f9a3506c47941a92ccf8d8bed98
      
https://github.com/qemu/qemu/commit/01874b15d36e3f9a3506c47941a92ccf8d8bed98
  Author: Peter Maydell <peter.maydell@linaro.org>
  Date:   2021-03-24 (Wed, 24 Mar 2021)

  Changed paths:
    M MAINTAINERS
    M configure
    R exec-vary.c
    M include/exec/cpu-all.h
    A include/exec/page-vary.h
    M meson.build
    A page-vary-common.c
    A page-vary.c
    M tcg/tcg.c

  Log Message:
  -----------
  Merge remote-tracking branch 'remotes/rth/tags/pull-tcg-20210323' into staging

Workaround for macos mprotect
Workaround for target_page vs -flto

# gpg: Signature made Wed 24 Mar 2021 01:40:12 GMT
# gpg:                using RSA key 7A481E78868B4DB6A85A05C064DF38E8AF7E215F
# gpg:                issuer "richard.henderson@linaro.org"
# gpg: Good signature from "Richard Henderson <richard.henderson@linaro.org>" 
[full]
# Primary key fingerprint: 7A48 1E78 868B 4DB6 A85A  05C0 64DF 38E8 AF7E 215F

* remotes/rth/tags/pull-tcg-20210323:
  exec: Build page-vary-common.c with -fno-lto
  exec: Extract 'page-vary.h' header
  exec: Rename exec-vary.c as page-vary.c
  tcg: Workaround macOS 11.2 mprotect bug
  tcg: Do not set guard pages on the rx portion of code_gen_buffer

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>


Compare: https://github.com/qemu/qemu/compare/67c1115edd98...01874b15d36e



reply via email to

[Prev in Thread] Current Thread [Next in Thread]