aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorPeter Maydell <peter.maydell@linaro.org>2021-03-24 11:22:08 +0000
committerPeter Maydell <peter.maydell@linaro.org>2021-03-24 11:22:08 +0000
commit01874b15d36e3f9a3506c47941a92ccf8d8bed98 (patch)
tree7f80e037c438ebe084e7e7c06b9f44faffc0a161 /include
parent67c1115edd98f388ca89dd38322ea3fadf034523 (diff)
parent44b99a6d5f24afcd8476d0d2701e1ca4ab9b35c1 (diff)
downloadqemu-01874b15d36e3f9a3506c47941a92ccf8d8bed98.zip
qemu-01874b15d36e3f9a3506c47941a92ccf8d8bed98.tar.gz
qemu-01874b15d36e3f9a3506c47941a92ccf8d8bed98.tar.bz2
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>
Diffstat (limited to 'include')
-rw-r--r--include/exec/cpu-all.h15
-rw-r--r--include/exec/page-vary.h34
2 files changed, 38 insertions, 11 deletions
diff --git a/include/exec/cpu-all.h b/include/exec/cpu-all.h
index 76443eb..d76b0b9 100644
--- a/include/exec/cpu-all.h
+++ b/include/exec/cpu-all.h
@@ -215,22 +215,15 @@ static inline void stl_phys_notdirty(AddressSpace *as, hwaddr addr, uint32_t val
/* page related stuff */
#ifdef TARGET_PAGE_BITS_VARY
-typedef struct {
- bool decided;
- int bits;
- target_long mask;
-} TargetPageBits;
-#if defined(CONFIG_ATTRIBUTE_ALIAS) || !defined(IN_EXEC_VARY)
+# include "exec/page-vary.h"
extern const TargetPageBits target_page;
-#else
-extern TargetPageBits target_page;
-#endif
#ifdef CONFIG_DEBUG_TCG
#define TARGET_PAGE_BITS ({ assert(target_page.decided); target_page.bits; })
-#define TARGET_PAGE_MASK ({ assert(target_page.decided); target_page.mask; })
+#define TARGET_PAGE_MASK ({ assert(target_page.decided); \
+ (target_long)target_page.mask; })
#else
#define TARGET_PAGE_BITS target_page.bits
-#define TARGET_PAGE_MASK target_page.mask
+#define TARGET_PAGE_MASK ((target_long)target_page.mask)
#endif
#define TARGET_PAGE_SIZE (-(int)TARGET_PAGE_MASK)
#else
diff --git a/include/exec/page-vary.h b/include/exec/page-vary.h
new file mode 100644
index 0000000..c22a7a7
--- /dev/null
+++ b/include/exec/page-vary.h
@@ -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 */