qemu: Update to 7.0.0

This commit is contained in:
Tee KOBAYASHI 2022-04-21 17:43:16 +09:00 committed by xtkoba
parent 6b168a0d73
commit 54527f58a8
8 changed files with 84 additions and 120 deletions

View File

@ -15,23 +15,45 @@ diff -uNr qemu-5.2.0/include/qapi/util.h qemu-5.2.0.mod/include/qapi/util.h
diff -uNr qemu-5.2.0/meson.build qemu-5.2.0.mod/meson.build
--- qemu-5.2.0/meson.build 2020-12-08 18:59:44.000000000 +0200
+++ qemu-5.2.0.mod/meson.build 2020-12-09 17:18:04.165911853 +0200
@@ -94,11 +94,11 @@
@@ -185,38 +185,6 @@
# Specify linker-script with add_project_link_arguments so that it is not placed
# within a linker --start-group/--end-group pair
-if 'CONFIG_FUZZ' in config_host
- add_project_link_arguments(['-Wl,-T,',
- (meson.current_source_dir() / 'tests/qtest/fuzz/fork_fuzz.ld')],
-if get_option('fuzzing')
- add_project_link_arguments(['-Wl,-T,',
- (meson.current_source_dir() / 'tests/qtest/fuzz/fork_fuzz.ld')],
- native: false, language: ['c', 'cpp', 'objc'])
-
- # Specify a filter to only instrument code that is directly related to
- # virtual-devices.
- configure_file(output: 'instrumentation-filter',
- input: 'scripts/oss-fuzz/instrumentation-filter-template',
- copy: true)
- add_global_arguments(
- cc.get_supported_arguments('-fsanitize-coverage-allowlist=instrumentation-filter'),
- native: false, language: ['c', 'cpp', 'objc'])
-
- if get_option('fuzzing_engine') == ''
- # Add CFLAGS to tell clang to add fuzzer-related instrumentation to all the
- # compiled code. To build non-fuzzer binaries with --enable-fuzzing, link
- # everything with fsanitize=fuzzer-no-link. Otherwise, the linker will be
- # unable to bind the fuzzer-related callbacks added by instrumentation.
- add_global_arguments('-fsanitize=fuzzer-no-link',
- native: false, language: ['c', 'cpp', 'objc'])
- add_global_link_arguments('-fsanitize=fuzzer-no-link',
- native: false, language: ['c', 'cpp', 'objc'])
- # For the actual fuzzer binaries, we need to link against the libfuzzer
- # library. They need to be configurable, to support OSS-Fuzz
- fuzz_exe_ldflags = ['-fsanitize=fuzzer']
- else
- # LIB_FUZZING_ENGINE was set; assume we are running on OSS-Fuzz, and
- # the needed CFLAGS have already been provided
- fuzz_exe_ldflags = get_option('fuzzing_engine').split()
- endif
-endif
+#if 'CONFIG_FUZZ' in config_host
+# add_project_link_arguments(['-Wl,-T,',
+# (meson.current_source_dir() / 'tests/qtest/fuzz/fork_fuzz.ld')],
+# native: false, language: ['c', 'cpp', 'objc'])
+#endif
add_project_arguments(config_host['QEMU_CFLAGS'].split(),
native: false, language: ['c', 'objc'])
add_global_arguments(qemu_cflags, native: false, language: ['c'])
add_global_arguments(qemu_cxxflags, native: false, language: ['cpp'])
@@ -1575,8 +1575,8 @@
specific_ss.add_all(when: 'CONFIG_LINUX_USER', if_true: linux_user_ss)

View File

@ -1,15 +1,14 @@
diff -uNr qemu-6.1.0/meson.build qemu-6.1.0.mod/meson.build
--- qemu-6.1.0/meson.build 2021-08-25 21:20:39.873631512 +0300
+++ qemu-6.1.0.mod/meson.build 2021-08-25 21:21:35.135670419 +0300
@@ -1411,11 +1411,6 @@
#include <sys/mman.h>
#include <stddef.h>
int main(void) { return posix_madvise(NULL, 0, POSIX_MADV_DONTNEED); }'''))
@@ -1785,10 +1785,6 @@
return 0;
}''', dependencies: threads))
-config_host_data.set('CONFIG_SIGNALFD', cc.links(gnu_source_prefix + '''
- #include <unistd.h>
- #include <sys/syscall.h>
- #include <signal.h>
- int main(void) { return syscall(SYS_signalfd, -1, NULL, _NSIG / 8); }'''))
- #include <sys/signalfd.h>
- #include <stddef.h>
- int main(void) { return signalfd(-1, NULL, SFD_CLOEXEC); }'''))
config_host_data.set('CONFIG_SPLICE', cc.links(gnu_source_prefix + '''
#include <unistd.h>
#include <fcntl.h>

View File

@ -1,37 +0,0 @@
--- qemu-6.1.0/target/i386/tcg/sysemu/excp_helper.c
+++ qemu-6.1.0/target/i386/tcg/sysemu/excp_helper.c
@@ -94,15 +94,6 @@ static int mmu_translate(CPUState *cs, hwaddr addr, MMUTranslateFunc get_hphys_f
bool la57 = pg_mode & PG_MODE_LA57;
uint64_t pml5e_addr, pml5e;
uint64_t pml4e_addr, pml4e;
- int32_t sext;
-
- /* test virtual address sign extension */
- sext = la57 ? (int64_t)addr >> 56 : (int64_t)addr >> 47;
- if (get_hphys_func && sext != 0 && sext != -1) {
- env->error_code = 0;
- cs->exception_index = EXCP0D_GPF;
- return 1;
- }
if (la57) {
pml5e_addr = ((cr3 & ~0xfff) +
@@ -423,6 +414,18 @@ static int handle_mmu_fault(CPUState *cs, vaddr addr, int size,
page_size = 4096;
} else {
pg_mode = get_pg_mode(env);
+ if (pg_mode & PG_MODE_LMA) {
+ int32_t sext;
+
+ /* test virtual address sign extension */
+ sext = (int64_t)addr >> (pg_mode & PG_MODE_LA57 ? 56 : 47);
+ if (sext != 0 && sext != -1) {
+ env->error_code = 0;
+ cs->exception_index = EXCP0D_GPF;
+ return 1;
+ }
+ }
+
error_code = mmu_translate(cs, addr, get_hphys, env->cr[3], is_write1,
mmu_idx, pg_mode,
&paddr, &page_size, &prot);

View File

@ -2,10 +2,9 @@ TERMUX_PKG_HOMEPAGE=https://www.qemu.org
TERMUX_PKG_DESCRIPTION="A generic and open source machine emulator and virtualizer (headless)"
TERMUX_PKG_LICENSE="GPL-2.0"
TERMUX_PKG_MAINTAINER="@termux"
TERMUX_PKG_VERSION=1:6.1.0
TERMUX_PKG_REVISION=11
TERMUX_PKG_VERSION=1:7.0.0
TERMUX_PKG_SRCURL=https://download.qemu.org/qemu-${TERMUX_PKG_VERSION:2}.tar.xz
TERMUX_PKG_SHA256=eebc089db3414bbeedf1e464beda0a7515aad30f73261abc246c9b27503a3c96
TERMUX_PKG_SHA256=f6b375c7951f728402798b0baabb2d86478ca53d44cedbefabbe1c46bf46f839
TERMUX_PKG_DEPENDS="glib, libbz2, libc++, libcurl, libgnutls, libiconv, libjpeg-turbo, liblzo, libnettle, libnfs, libpixman, libpng, libspice-server, libssh, libusb, libusbredir, ncurses, pulseaudio, qemu-common, resolv-conf, zlib, zstd"
# Required by configuration script, but I can't find any binary that uses it.
@ -95,7 +94,6 @@ termux_step_configure() {
--disable-lzfse \
--disable-seccomp \
--enable-libssh \
--enable-libxml2 \
--enable-bochs \
--enable-cloop \
--enable-dmg \

View File

@ -15,23 +15,45 @@ diff -uNr qemu-5.2.0/include/qapi/util.h qemu-5.2.0.mod/include/qapi/util.h
diff -uNr qemu-5.2.0/meson.build qemu-5.2.0.mod/meson.build
--- qemu-5.2.0/meson.build 2020-12-08 18:59:44.000000000 +0200
+++ qemu-5.2.0.mod/meson.build 2020-12-09 17:18:04.165911853 +0200
@@ -94,11 +94,11 @@
@@ -185,38 +185,6 @@
# Specify linker-script with add_project_link_arguments so that it is not placed
# within a linker --start-group/--end-group pair
-if 'CONFIG_FUZZ' in config_host
- add_project_link_arguments(['-Wl,-T,',
- (meson.current_source_dir() / 'tests/qtest/fuzz/fork_fuzz.ld')],
-if get_option('fuzzing')
- add_project_link_arguments(['-Wl,-T,',
- (meson.current_source_dir() / 'tests/qtest/fuzz/fork_fuzz.ld')],
- native: false, language: ['c', 'cpp', 'objc'])
-
- # Specify a filter to only instrument code that is directly related to
- # virtual-devices.
- configure_file(output: 'instrumentation-filter',
- input: 'scripts/oss-fuzz/instrumentation-filter-template',
- copy: true)
- add_global_arguments(
- cc.get_supported_arguments('-fsanitize-coverage-allowlist=instrumentation-filter'),
- native: false, language: ['c', 'cpp', 'objc'])
-
- if get_option('fuzzing_engine') == ''
- # Add CFLAGS to tell clang to add fuzzer-related instrumentation to all the
- # compiled code. To build non-fuzzer binaries with --enable-fuzzing, link
- # everything with fsanitize=fuzzer-no-link. Otherwise, the linker will be
- # unable to bind the fuzzer-related callbacks added by instrumentation.
- add_global_arguments('-fsanitize=fuzzer-no-link',
- native: false, language: ['c', 'cpp', 'objc'])
- add_global_link_arguments('-fsanitize=fuzzer-no-link',
- native: false, language: ['c', 'cpp', 'objc'])
- # For the actual fuzzer binaries, we need to link against the libfuzzer
- # library. They need to be configurable, to support OSS-Fuzz
- fuzz_exe_ldflags = ['-fsanitize=fuzzer']
- else
- # LIB_FUZZING_ENGINE was set; assume we are running on OSS-Fuzz, and
- # the needed CFLAGS have already been provided
- fuzz_exe_ldflags = get_option('fuzzing_engine').split()
- endif
-endif
+#if 'CONFIG_FUZZ' in config_host
+# add_project_link_arguments(['-Wl,-T,',
+# (meson.current_source_dir() / 'tests/qtest/fuzz/fork_fuzz.ld')],
+# native: false, language: ['c', 'cpp', 'objc'])
+#endif
add_project_arguments(config_host['QEMU_CFLAGS'].split(),
native: false, language: ['c', 'objc'])
add_global_arguments(qemu_cflags, native: false, language: ['c'])
add_global_arguments(qemu_cxxflags, native: false, language: ['cpp'])
@@ -1575,8 +1575,8 @@
specific_ss.add_all(when: 'CONFIG_LINUX_USER', if_true: linux_user_ss)

View File

@ -1,15 +1,14 @@
diff -uNr qemu-6.1.0/meson.build qemu-6.1.0.mod/meson.build
--- qemu-6.1.0/meson.build 2021-08-25 21:20:39.873631512 +0300
+++ qemu-6.1.0.mod/meson.build 2021-08-25 21:21:35.135670419 +0300
@@ -1411,11 +1411,6 @@
#include <sys/mman.h>
#include <stddef.h>
int main(void) { return posix_madvise(NULL, 0, POSIX_MADV_DONTNEED); }'''))
@@ -1785,10 +1785,6 @@
return 0;
}''', dependencies: threads))
-config_host_data.set('CONFIG_SIGNALFD', cc.links(gnu_source_prefix + '''
- #include <unistd.h>
- #include <sys/syscall.h>
- #include <signal.h>
- int main(void) { return syscall(SYS_signalfd, -1, NULL, _NSIG / 8); }'''))
- #include <sys/signalfd.h>
- #include <stddef.h>
- int main(void) { return signalfd(-1, NULL, SFD_CLOEXEC); }'''))
config_host_data.set('CONFIG_SPLICE', cc.links(gnu_source_prefix + '''
#include <unistd.h>
#include <fcntl.h>

View File

@ -1,37 +0,0 @@
--- qemu-6.1.0/target/i386/tcg/sysemu/excp_helper.c
+++ qemu-6.1.0/target/i386/tcg/sysemu/excp_helper.c
@@ -94,15 +94,6 @@ static int mmu_translate(CPUState *cs, hwaddr addr, MMUTranslateFunc get_hphys_f
bool la57 = pg_mode & PG_MODE_LA57;
uint64_t pml5e_addr, pml5e;
uint64_t pml4e_addr, pml4e;
- int32_t sext;
-
- /* test virtual address sign extension */
- sext = la57 ? (int64_t)addr >> 56 : (int64_t)addr >> 47;
- if (get_hphys_func && sext != 0 && sext != -1) {
- env->error_code = 0;
- cs->exception_index = EXCP0D_GPF;
- return 1;
- }
if (la57) {
pml5e_addr = ((cr3 & ~0xfff) +
@@ -423,6 +414,18 @@ static int handle_mmu_fault(CPUState *cs, vaddr addr, int size,
page_size = 4096;
} else {
pg_mode = get_pg_mode(env);
+ if (pg_mode & PG_MODE_LMA) {
+ int32_t sext;
+
+ /* test virtual address sign extension */
+ sext = (int64_t)addr >> (pg_mode & PG_MODE_LA57 ? 56 : 47);
+ if (sext != 0 && sext != -1) {
+ env->error_code = 0;
+ cs->exception_index = EXCP0D_GPF;
+ return 1;
+ }
+ }
+
error_code = mmu_translate(cs, addr, get_hphys, env->cr[3], is_write1,
mmu_idx, pg_mode,
&paddr, &page_size, &prot);

View File

@ -2,10 +2,9 @@ TERMUX_PKG_HOMEPAGE=https://www.qemu.org
TERMUX_PKG_DESCRIPTION="A generic and open source machine emulator and virtualizer"
TERMUX_PKG_LICENSE="GPL-2.0"
TERMUX_PKG_MAINTAINER="@termux"
TERMUX_PKG_VERSION=1:6.1.0
TERMUX_PKG_REVISION=10
TERMUX_PKG_VERSION=1:7.0.0
TERMUX_PKG_SRCURL=https://download.qemu.org/qemu-${TERMUX_PKG_VERSION:2}.tar.xz
TERMUX_PKG_SHA256=eebc089db3414bbeedf1e464beda0a7515aad30f73261abc246c9b27503a3c96
TERMUX_PKG_SHA256=f6b375c7951f728402798b0baabb2d86478ca53d44cedbefabbe1c46bf46f839
TERMUX_PKG_DEPENDS="glib, gtk3, libbz2, libc++, libcurl, libgnutls, libiconv, libjpeg-turbo, liblzo, libnettle, libnfs, libpixman, libpng, libspice-server, libssh, libusb, libusbredir, libx11, ncurses, pulseaudio, qemu-common, resolv-conf, sdl2, sdl2-image, zlib, zstd"
# Required by configuration script, but I can't find any binary that uses it.
@ -108,7 +107,6 @@ termux_step_configure() {
--disable-lzfse \
--disable-seccomp \
--enable-libssh \
--enable-libxml2 \
--enable-bochs \
--enable-cloop \
--enable-dmg \