Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'remotes/rth/tags/pull-tcg-20210323' int…
…o 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>
- Loading branch information
Showing
9 changed files
with
167 additions
and
149 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
/* | ||
* Definitions for cpus with variable page sizes. | ||
* | ||
* Copyright (c) 2003 Fabrice Bellard | ||
* | ||
* This library is free software; you can redistribute it and/or | ||
* modify it under the terms of the GNU Lesser General Public | ||
* License as published by the Free Software Foundation; either | ||
* version 2.1 of the License, or (at your option) any later version. | ||
* | ||
* This library is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
* Lesser General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU Lesser General Public | ||
* License along with this library; if not, see <http://www.gnu.org/licenses/>. | ||
*/ | ||
|
||
#ifndef EXEC_PAGE_VARY_H | ||
#define EXEC_PAGE_VARY_H | ||
|
||
typedef struct { | ||
bool decided; | ||
int bits; | ||
uint64_t mask; | ||
} TargetPageBits; | ||
|
||
#ifdef IN_PAGE_VARY | ||
extern bool set_preferred_target_page_bits_common(int bits); | ||
extern void finalize_target_page_bits_common(int min); | ||
#endif | ||
|
||
#endif /* EXEC_PAGE_VARY_H */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
/* | ||
* Variable page size handling -- target independent part. | ||
* | ||
* Copyright (c) 2003 Fabrice Bellard | ||
* | ||
* This library is free software; you can redistribute it and/or | ||
* modify it under the terms of the GNU Lesser General Public | ||
* License as published by the Free Software Foundation; either | ||
* version 2.1 of the License, or (at your option) any later version. | ||
* | ||
* This library is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
* Lesser General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU Lesser General Public | ||
* License along with this library; if not, see <http://www.gnu.org/licenses/>. | ||
*/ | ||
|
||
#define IN_PAGE_VARY 1 | ||
|
||
#include "qemu/osdep.h" | ||
#include "qemu-common.h" | ||
#include "exec/page-vary.h" | ||
|
||
/* WARNING: This file must *not* be complied with -flto. */ | ||
|
||
TargetPageBits target_page; | ||
|
||
bool set_preferred_target_page_bits_common(int bits) | ||
{ | ||
/* | ||
* The target page size is the lowest common denominator for all | ||
* the CPUs in the system, so we can only make it smaller, never | ||
* larger. And we can't make it smaller once we've committed to | ||
* a particular size. | ||
*/ | ||
if (target_page.bits == 0 || target_page.bits > bits) { | ||
if (target_page.decided) { | ||
return false; | ||
} | ||
target_page.bits = bits; | ||
} | ||
return true; | ||
} | ||
|
||
void finalize_target_page_bits_common(int min) | ||
{ | ||
if (target_page.bits == 0) { | ||
target_page.bits = min; | ||
} | ||
target_page.mask = -1ull << target_page.bits; | ||
target_page.decided = true; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
/* | ||
* Variable page size handling -- target specific part. | ||
* | ||
* Copyright (c) 2003 Fabrice Bellard | ||
* | ||
* This library is free software; you can redistribute it and/or | ||
* modify it under the terms of the GNU Lesser General Public | ||
* License as published by the Free Software Foundation; either | ||
* version 2.1 of the License, or (at your option) any later version. | ||
* | ||
* This library is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
* Lesser General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU Lesser General Public | ||
* License along with this library; if not, see <http://www.gnu.org/licenses/>. | ||
*/ | ||
|
||
#define IN_PAGE_VARY 1 | ||
|
||
#include "qemu/osdep.h" | ||
#include "qemu-common.h" | ||
#include "exec/exec-all.h" | ||
|
||
bool set_preferred_target_page_bits(int bits) | ||
{ | ||
#ifdef TARGET_PAGE_BITS_VARY | ||
assert(bits >= TARGET_PAGE_BITS_MIN); | ||
return set_preferred_target_page_bits_common(bits); | ||
#else | ||
return true; | ||
#endif | ||
} | ||
|
||
void finalize_target_page_bits(void) | ||
{ | ||
#ifdef TARGET_PAGE_BITS_VARY | ||
finalize_target_page_bits_common(TARGET_PAGE_BITS_MIN); | ||
#endif | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters