mirror of
https://github.com/utmapp/qemu.git
synced 2026-12-04 07:33:41 -10:00
Compare commits
166
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
f818886828 | ||
|
|
9748378628 | ||
|
|
1fc3358fee | ||
|
|
2b0fd418aa | ||
|
|
d66b46f0be | ||
|
|
5786281b5f | ||
|
|
f9a11d22b1 | ||
|
|
e97555efb5 | ||
|
|
3f949cf30c | ||
|
|
80c0e3099f | ||
|
|
c874e68e5a | ||
|
|
531da34587 | ||
|
|
34b035535e | ||
|
|
bb5c41eb13 | ||
|
|
b3cf3579f5 | ||
|
|
96e76ff0a1 | ||
|
|
3ef0f0db05 | ||
|
|
f129a2b8db | ||
|
|
6e9f737fcc | ||
|
|
51a16884c3 | ||
|
|
6626058f22 | ||
|
|
0fbf694119 | ||
|
|
12d182898a | ||
|
|
25dfefc810 | ||
|
|
397bb125e1 | ||
|
|
355b0824c6 | ||
|
|
84641e7ceb | ||
|
|
1716a3f189 | ||
|
|
aac64f9286 | ||
|
|
85af432691 | ||
|
|
a0167d013f | ||
|
|
3acd8e70ba | ||
|
|
e0af80866a | ||
|
|
b3ebe68e23 | ||
|
|
9e45375602 | ||
|
|
bdf261c858 | ||
|
|
ad2fe378fe | ||
|
|
3f620296d8 | ||
|
|
f2098f2c30 | ||
|
|
7dfd20c7e8 | ||
|
|
41eb76f5bf | ||
|
|
99ac5e48e4 | ||
|
|
67876f074e | ||
|
|
781a23afc7 | ||
|
|
1f24abea06 | ||
|
|
de8f1b03d0 | ||
|
|
66553a8213 | ||
|
|
4214699f96 | ||
|
|
401a81844b | ||
|
|
129127242d | ||
|
|
c146fe8095 | ||
|
|
e6441f8683 | ||
|
|
7135bae71b | ||
|
|
c9eb230657 | ||
|
|
ee9a9b425f | ||
|
|
5286a192c8 | ||
|
|
f854a87eeb | ||
|
|
1699eb16a7 | ||
|
|
d1792ff228 | ||
|
|
cd85cb5abe | ||
|
|
c94e174af8 | ||
|
|
8f1617b581 | ||
|
|
fc43b65e06 | ||
|
|
6409730ff9 | ||
|
|
cc24c9b7cb | ||
|
|
0d24c5332f | ||
|
|
44cfb32e24 | ||
|
|
e73864e11d | ||
|
|
2b73a7937d | ||
|
|
753fffe1ea | ||
|
|
e19e3cb9b5 | ||
|
|
26324b7d94 | ||
|
|
929b3859bd | ||
|
|
fdd3d1d3a0 | ||
|
|
345ec3279b | ||
|
|
e8f8220618 | ||
|
|
f275f433af | ||
|
|
f384e2c7eb | ||
|
|
dc386f9eb0 | ||
|
|
1adb9ff17d | ||
|
|
ce01739e6d | ||
|
|
f357b925b3 | ||
|
|
edba23a4d4 | ||
|
|
3428101c02 | ||
|
|
1e8db1949d | ||
|
|
e91d59cbea | ||
|
|
eace1c8c9f | ||
|
|
c800dbb61e | ||
|
|
b3a305701e | ||
|
|
21954ae12a | ||
|
|
61f5befa07 | ||
|
|
45c171c238 | ||
|
|
1b10cab21a | ||
|
|
c61c853e1f | ||
|
|
8681835e66 | ||
|
|
adaef950b5 | ||
|
|
a1cbf10708 | ||
|
|
d0c0d66796 | ||
|
|
920d2875a0 | ||
|
|
5ba17fba6e | ||
|
|
51f8c2e5b8 | ||
|
|
3184f37bbe | ||
|
|
110dbe7e89 | ||
|
|
2565eea22b | ||
|
|
8c2f5eff66 | ||
|
|
db430377c0 | ||
|
|
b2708c4684 | ||
|
|
9ea8f7a804 | ||
|
|
6a1e678f5b | ||
|
|
902616b2f0 | ||
|
|
bc73e87997 | ||
|
|
7292f1fc18 | ||
|
|
2ee6330b9e | ||
|
|
a0db5bfa90 | ||
|
|
998320a3da | ||
|
|
8137225fde | ||
|
|
3f09807e7f | ||
|
|
17d38dc6d9 | ||
|
|
66c71d88ed | ||
|
|
30adfa9b1d | ||
|
|
3bf12f1f40 | ||
|
|
4c82b50085 | ||
|
|
f3b4506f14 | ||
|
|
056bdd9a51 | ||
|
|
0bc7389a8e | ||
|
|
9517f7e873 | ||
|
|
30c2f78449 | ||
|
|
ea9f45cec5 | ||
|
|
82e6e2bdff | ||
|
|
ffb51175ba | ||
|
|
a13fec6c17 | ||
|
|
cf664b3a04 | ||
|
|
5897229105 | ||
|
|
d35954d3c9 | ||
|
|
64dcc3969b | ||
|
|
06962e1aaa | ||
|
|
ec151f4659 | ||
|
|
9d9ca24b72 | ||
|
|
fe1b754eab | ||
|
|
6d6e43ebce | ||
|
|
f479e7eacd | ||
|
|
dbbbd13bf6 | ||
|
|
dc32fd2d89 | ||
|
|
3354c800ac | ||
|
|
365294d55a | ||
|
|
a6bff5ccc8 | ||
|
|
c803fc9d7d | ||
|
|
653cc15628 | ||
|
|
2e77c788d8 | ||
|
|
1534c4fe04 | ||
|
|
3a513c9db4 | ||
|
|
e27df17c9c | ||
|
|
aa7ebf9a77 | ||
|
|
be54898fd5 | ||
|
|
7a64de81ce | ||
|
|
71f21b796f | ||
|
|
4e70afa94d | ||
|
|
36195a781c | ||
|
|
2541dde936 | ||
|
|
ecc067a3ba | ||
|
|
819b2c2984 | ||
|
|
8ed0f7cb4d | ||
|
|
d1bf1e28b6 | ||
|
|
47cd50d3d2 | ||
|
|
324cef19f8 | ||
|
|
e252078b6e |
No files matched your search
+109
@@ -0,0 +1,109 @@
|
||||
env:
|
||||
CIRRUS_CLONE_DEPTH: 1
|
||||
|
||||
windows_msys2_task:
|
||||
timeout_in: 90m
|
||||
windows_container:
|
||||
image: cirrusci/windowsservercore:2019
|
||||
os_version: 2019
|
||||
cpu: 8
|
||||
memory: 8G
|
||||
env:
|
||||
CIRRUS_SHELL: powershell
|
||||
MSYS: winsymlinks:native
|
||||
MSYSTEM: MINGW64
|
||||
MSYS2_URL: https://github.com/msys2/msys2-installer/releases/download/2022-06-03/msys2-base-x86_64-20220603.sfx.exe
|
||||
MSYS2_FINGERPRINT: 0
|
||||
MSYS2_PACKAGES: "
|
||||
diffutils git grep make pkg-config sed
|
||||
mingw-w64-x86_64-python
|
||||
mingw-w64-x86_64-python-sphinx
|
||||
mingw-w64-x86_64-toolchain
|
||||
mingw-w64-x86_64-SDL2
|
||||
mingw-w64-x86_64-SDL2_image
|
||||
mingw-w64-x86_64-gtk3
|
||||
mingw-w64-x86_64-glib2
|
||||
mingw-w64-x86_64-ninja
|
||||
mingw-w64-x86_64-jemalloc
|
||||
mingw-w64-x86_64-lzo2
|
||||
mingw-w64-x86_64-zstd
|
||||
mingw-w64-x86_64-libjpeg-turbo
|
||||
mingw-w64-x86_64-pixman
|
||||
mingw-w64-x86_64-libgcrypt
|
||||
mingw-w64-x86_64-libpng
|
||||
mingw-w64-x86_64-libssh
|
||||
mingw-w64-x86_64-snappy
|
||||
mingw-w64-x86_64-libusb
|
||||
mingw-w64-x86_64-usbredir
|
||||
mingw-w64-x86_64-libtasn1
|
||||
mingw-w64-x86_64-nettle
|
||||
mingw-w64-x86_64-cyrus-sasl
|
||||
mingw-w64-x86_64-curl
|
||||
mingw-w64-x86_64-gnutls
|
||||
mingw-w64-x86_64-libnfs
|
||||
"
|
||||
CHERE_INVOKING: 1
|
||||
msys2_cache:
|
||||
folder: C:\tools\archive
|
||||
reupload_on_changes: false
|
||||
# These env variables are used to generate fingerprint to trigger the cache procedure
|
||||
# If wanna to force re-populate msys2, increase MSYS2_FINGERPRINT
|
||||
fingerprint_script:
|
||||
- |
|
||||
echo $env:CIRRUS_TASK_NAME
|
||||
echo $env:MSYS2_URL
|
||||
echo $env:MSYS2_FINGERPRINT
|
||||
echo $env:MSYS2_PACKAGES
|
||||
populate_script:
|
||||
- |
|
||||
md -Force C:\tools\archive\pkg
|
||||
$start_time = Get-Date
|
||||
bitsadmin /transfer msys_download /dynamic /download /priority FOREGROUND $env:MSYS2_URL C:\tools\archive\base.exe
|
||||
Write-Output "Download time taken: $((Get-Date).Subtract($start_time))"
|
||||
cd C:\tools
|
||||
C:\tools\archive\base.exe -y
|
||||
del -Force C:\tools\archive\base.exe
|
||||
Write-Output "Base install time taken: $((Get-Date).Subtract($start_time))"
|
||||
$start_time = Get-Date
|
||||
|
||||
((Get-Content -path C:\tools\msys64\etc\\post-install\\07-pacman-key.post -Raw) -replace '--refresh-keys', '--version') | Set-Content -Path C:\tools\msys64\etc\\post-install\\07-pacman-key.post
|
||||
C:\tools\msys64\usr\bin\bash.exe -lc "sed -i 's/^CheckSpace/#CheckSpace/g' /etc/pacman.conf"
|
||||
C:\tools\msys64\usr\bin\bash.exe -lc "export"
|
||||
C:\tools\msys64\usr\bin\pacman.exe --noconfirm -Sy
|
||||
echo Y | C:\tools\msys64\usr\bin\pacman.exe --noconfirm -Suu --overwrite=*
|
||||
taskkill /F /FI "MODULES eq msys-2.0.dll"
|
||||
tasklist
|
||||
C:\tools\msys64\usr\bin\bash.exe -lc "mv -f /etc/pacman.conf.pacnew /etc/pacman.conf || true"
|
||||
C:\tools\msys64\usr\bin\bash.exe -lc "pacman --noconfirm -Syuu --overwrite=*"
|
||||
Write-Output "Core install time taken: $((Get-Date).Subtract($start_time))"
|
||||
$start_time = Get-Date
|
||||
|
||||
C:\tools\msys64\usr\bin\bash.exe -lc "pacman --noconfirm -S --needed $env:MSYS2_PACKAGES"
|
||||
Write-Output "Package install time taken: $((Get-Date).Subtract($start_time))"
|
||||
$start_time = Get-Date
|
||||
|
||||
del -Force -ErrorAction SilentlyContinue C:\tools\msys64\etc\mtab
|
||||
del -Force -ErrorAction SilentlyContinue C:\tools\msys64\dev\fd
|
||||
del -Force -ErrorAction SilentlyContinue C:\tools\msys64\dev\stderr
|
||||
del -Force -ErrorAction SilentlyContinue C:\tools\msys64\dev\stdin
|
||||
del -Force -ErrorAction SilentlyContinue C:\tools\msys64\dev\stdout
|
||||
del -Force -Recurse -ErrorAction SilentlyContinue C:\tools\msys64\var\cache\pacman\pkg
|
||||
tar cf C:\tools\archive\msys64.tar -C C:\tools\ msys64
|
||||
|
||||
Write-Output "Package archive time taken: $((Get-Date).Subtract($start_time))"
|
||||
del -Force -Recurse -ErrorAction SilentlyContinue c:\tools\msys64
|
||||
install_script:
|
||||
- |
|
||||
$start_time = Get-Date
|
||||
cd C:\tools
|
||||
ls C:\tools\archive\msys64.tar
|
||||
tar xf C:\tools\archive\msys64.tar
|
||||
Write-Output "Extract msys2 time taken: $((Get-Date).Subtract($start_time))"
|
||||
script:
|
||||
- C:\tools\msys64\usr\bin\bash.exe -lc "mkdir build"
|
||||
- C:\tools\msys64\usr\bin\bash.exe -lc "cd build && ../configure --python=python3"
|
||||
- C:\tools\msys64\usr\bin\bash.exe -lc "cd build && make -j8"
|
||||
- exit $LastExitCode
|
||||
test_script:
|
||||
- C:\tools\msys64\usr\bin\bash.exe -lc "cd build && make V=1 check"
|
||||
- exit $LastExitCode
|
||||
+25
-20
@@ -109,8 +109,8 @@ crash-test-debian:
|
||||
IMAGE: debian-amd64
|
||||
script:
|
||||
- cd build
|
||||
- make NINJA=":" check-venv
|
||||
- tests/venv/bin/python3 scripts/device-crash-test -q --tcg-only ./qemu-system-i386
|
||||
- make check-venv
|
||||
- tests/venv/bin/python3 scripts/device-crash-test -q ./qemu-system-i386
|
||||
|
||||
build-system-fedora:
|
||||
extends: .native_build_job_template
|
||||
@@ -155,16 +155,16 @@ crash-test-fedora:
|
||||
IMAGE: fedora
|
||||
script:
|
||||
- cd build
|
||||
- make NINJA=":" check-venv
|
||||
- make check-venv
|
||||
- tests/venv/bin/python3 scripts/device-crash-test -q ./qemu-system-ppc
|
||||
- tests/venv/bin/python3 scripts/device-crash-test -q ./qemu-system-riscv32
|
||||
|
||||
build-system-centos:
|
||||
extends: .native_build_job_template
|
||||
needs:
|
||||
job: amd64-centos9-container
|
||||
job: amd64-centos8-container
|
||||
variables:
|
||||
IMAGE: centos9
|
||||
IMAGE: centos8
|
||||
CONFIGURE_ARGS: --disable-nettle --enable-gcrypt --enable-fdt=system
|
||||
--enable-modules --enable-trace-backends=dtrace --enable-docs
|
||||
--enable-vfio-user-server
|
||||
@@ -182,7 +182,7 @@ check-system-centos:
|
||||
- job: build-system-centos
|
||||
artifacts: true
|
||||
variables:
|
||||
IMAGE: centos9
|
||||
IMAGE: centos8
|
||||
MAKE_CHECK_ARGS: check
|
||||
|
||||
avocado-system-centos:
|
||||
@@ -191,7 +191,7 @@ avocado-system-centos:
|
||||
- job: build-system-centos
|
||||
artifacts: true
|
||||
variables:
|
||||
IMAGE: centos9
|
||||
IMAGE: centos8
|
||||
MAKE_CHECK_ARGS: check-avocado
|
||||
|
||||
build-system-opensuse:
|
||||
@@ -237,9 +237,9 @@ avocado-system-opensuse:
|
||||
build-tcg-disabled:
|
||||
extends: .native_build_job_template
|
||||
needs:
|
||||
job: amd64-centos9-container
|
||||
job: amd64-centos8-container
|
||||
variables:
|
||||
IMAGE: centos9
|
||||
IMAGE: centos8
|
||||
script:
|
||||
- mkdir build
|
||||
- cd build
|
||||
@@ -469,6 +469,7 @@ tsan-build:
|
||||
CONFIGURE_ARGS: --enable-tsan --cc=clang-10 --cxx=clang++-10
|
||||
--enable-trace-backends=ust --enable-fdt=system --disable-slirp
|
||||
TARGETS: x86_64-softmmu ppc64-softmmu riscv64-softmmu x86_64-linux-user
|
||||
MAKE_CHECK_ARGS: bench V=1
|
||||
|
||||
# gprof/gcov are GCC features
|
||||
build-gprof-gcov:
|
||||
@@ -559,22 +560,29 @@ build-coroutine-sigaltstack:
|
||||
MAKE_CHECK_ARGS: check-unit
|
||||
|
||||
# Check our reduced build configurations
|
||||
build-without-defaults:
|
||||
build-without-default-devices:
|
||||
extends: .native_build_job_template
|
||||
needs:
|
||||
job: amd64-centos9-container
|
||||
job: amd64-centos8-container
|
||||
variables:
|
||||
IMAGE: centos9
|
||||
IMAGE: centos8
|
||||
CONFIGURE_ARGS: --without-default-devices --disable-user
|
||||
|
||||
build-without-default-features:
|
||||
extends: .native_build_job_template
|
||||
needs:
|
||||
job: amd64-fedora-container
|
||||
variables:
|
||||
IMAGE: fedora
|
||||
CONFIGURE_ARGS:
|
||||
--without-default-devices
|
||||
--without-default-features
|
||||
--disable-fdt
|
||||
--disable-capstone
|
||||
--disable-pie
|
||||
--disable-qom-cast-debug
|
||||
--disable-strip
|
||||
TARGETS: avr-softmmu mips64-softmmu s390x-softmmu sh4-softmmu
|
||||
TARGETS: avr-softmmu i386-softmmu mips64-softmmu s390x-softmmu sh4-softmmu
|
||||
sparc64-softmmu hexagon-linux-user i386-linux-user s390x-linux-user
|
||||
MAKE_CHECK_ARGS: check-unit check-qtest-avr check-qtest-mips64
|
||||
MAKE_CHECK_ARGS: check-unit check-qtest SPEED=slow
|
||||
|
||||
build-libvhost-user:
|
||||
extends: .base_job_template
|
||||
@@ -629,10 +637,7 @@ pages:
|
||||
- mkdir -p public
|
||||
# HTML-ised source tree
|
||||
- make gtags
|
||||
# We unset variables to work around a bug in some htags versions
|
||||
# which causes it to fail when the environment is large
|
||||
- CI_COMMIT_MESSAGE= CI_COMMIT_TAG_MESSAGE= htags
|
||||
-anT --tree-view=filetree -m qemu_init
|
||||
- htags -anT --tree-view=filetree -m qemu_init
|
||||
-t "Welcome to the QEMU sourcecode"
|
||||
- mv HTML public/src
|
||||
# Project documentation
|
||||
|
||||
@@ -19,12 +19,13 @@ cwd = os.getcwd()
|
||||
reponame = os.path.basename(cwd)
|
||||
repourl = "https://gitlab.com/%s/%s.git" % (namespace, reponame)
|
||||
|
||||
print(f"adding upstream git repo @ {repourl}")
|
||||
subprocess.check_call(["git", "remote", "add", "check-dco", repourl])
|
||||
subprocess.check_call(["git", "fetch", "check-dco", "stable-7.2"])
|
||||
subprocess.check_call(["git", "fetch", "check-dco", "master"],
|
||||
stdout=subprocess.DEVNULL,
|
||||
stderr=subprocess.DEVNULL)
|
||||
|
||||
ancestor = subprocess.check_output(["git", "merge-base",
|
||||
"check-dco/stable-7.2", "HEAD"],
|
||||
"check-dco/master", "HEAD"],
|
||||
universal_newlines=True)
|
||||
|
||||
ancestor = ancestor.strip()
|
||||
@@ -84,7 +85,7 @@ This can be achieved by passing the "-s" flag to the "git commit" command.
|
||||
|
||||
To bulk update all commits on current branch "git rebase" can be used:
|
||||
|
||||
git rebase -i stable-7.2 -x 'git commit --amend --no-edit -s'
|
||||
git rebase -i master -x 'git commit --amend --no-edit -s'
|
||||
|
||||
""")
|
||||
|
||||
|
||||
@@ -19,12 +19,13 @@ cwd = os.getcwd()
|
||||
reponame = os.path.basename(cwd)
|
||||
repourl = "https://gitlab.com/%s/%s.git" % (namespace, reponame)
|
||||
|
||||
print(f"adding upstream git repo @ {repourl}")
|
||||
# GitLab CI environment does not give us any direct info about the
|
||||
# base for the user's branch. We thus need to figure out a common
|
||||
# ancestor between the user's branch and current git master.
|
||||
subprocess.check_call(["git", "remote", "add", "check-patch", repourl])
|
||||
subprocess.check_call(["git", "fetch", "check-patch", "master"])
|
||||
subprocess.check_call(["git", "fetch", "check-patch", "master"],
|
||||
stdout=subprocess.DEVNULL,
|
||||
stderr=subprocess.DEVNULL)
|
||||
|
||||
ancestor = subprocess.check_output(["git", "merge-base",
|
||||
"check-patch/master", "HEAD"],
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
.cirrus_build_job:
|
||||
extends: .base_job_template
|
||||
stage: build
|
||||
image: registry.gitlab.com/libvirt/libvirt-ci/cirrus-run:latest
|
||||
image: registry.gitlab.com/libvirt/libvirt-ci/cirrus-run:master
|
||||
needs: []
|
||||
timeout: 80m
|
||||
allow_failure: true
|
||||
@@ -63,12 +63,11 @@ x64-freebsd-13-build:
|
||||
NAME: freebsd-13
|
||||
CIRRUS_VM_INSTANCE_TYPE: freebsd_instance
|
||||
CIRRUS_VM_IMAGE_SELECTOR: image_family
|
||||
CIRRUS_VM_IMAGE_NAME: freebsd-13-3
|
||||
CIRRUS_VM_IMAGE_NAME: freebsd-13-1
|
||||
CIRRUS_VM_CPUS: 8
|
||||
CIRRUS_VM_RAM: 8G
|
||||
UPDATE_COMMAND: pkg update
|
||||
INSTALL_COMMAND: pkg install -y
|
||||
CONFIGURE_ARGS: --target-list-exclude=arm-softmmu,i386-softmmu,microblaze-softmmu,mips64el-softmmu,mipsel-softmmu,mips-softmmu,ppc-softmmu,sh4eb-softmmu,xtensa-softmmu
|
||||
TEST_TARGETS: check
|
||||
|
||||
aarch64-macos-12-base-build:
|
||||
@@ -84,7 +83,6 @@ aarch64-macos-12-base-build:
|
||||
INSTALL_COMMAND: brew install
|
||||
PATH_EXTRA: /opt/homebrew/ccache/libexec:/opt/homebrew/gettext/bin
|
||||
PKG_CONFIG_PATH: /opt/homebrew/curl/lib/pkgconfig:/opt/homebrew/ncurses/lib/pkgconfig:/opt/homebrew/readline/lib/pkgconfig
|
||||
CONFIGURE_ARGS: --target-list-exclude=arm-softmmu,i386-softmmu,microblazeel-softmmu,mips64-softmmu,mipsel-softmmu,mips-softmmu,ppc-softmmu,sh4-softmmu,xtensaeb-softmmu
|
||||
TEST_TARGETS: check-unit check-block check-qapi-schema check-softfloat check-qtest-x86_64
|
||||
|
||||
|
||||
|
||||
@@ -19,7 +19,7 @@ build_task:
|
||||
install_script:
|
||||
- @UPDATE_COMMAND@
|
||||
- @INSTALL_COMMAND@ @PKGS@
|
||||
- if test -n "@PYPI_PKGS@" ; then PYLIB=$(@PYTHON@ -c 'import sysconfig; print(sysconfig.get_path("stdlib"))'); rm -f $PYLIB/EXTERNALLY-MANAGED; @PIP3@ install @PYPI_PKGS@ ; fi
|
||||
- if test -n "@PYPI_PKGS@" ; then @PIP3@ install @PYPI_PKGS@ ; fi
|
||||
clone_script:
|
||||
- git clone --depth 100 "$CI_REPOSITORY_URL" .
|
||||
- git fetch origin "$CI_COMMIT_REF_NAME"
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
include:
|
||||
- local: '/.gitlab-ci.d/container-template.yml'
|
||||
|
||||
amd64-centos9-container:
|
||||
amd64-centos8-container:
|
||||
extends: .container_job_template
|
||||
variables:
|
||||
NAME: centos9
|
||||
NAME: centos8
|
||||
|
||||
amd64-fedora-container:
|
||||
extends: .container_job_template
|
||||
|
||||
@@ -22,6 +22,12 @@ arm64-debian-cross-container:
|
||||
variables:
|
||||
NAME: debian-arm64-cross
|
||||
|
||||
armel-debian-cross-container:
|
||||
extends: .container_job_template
|
||||
stage: containers
|
||||
variables:
|
||||
NAME: debian-armel-cross
|
||||
|
||||
armhf-debian-cross-container:
|
||||
extends: .container_job_template
|
||||
stage: containers
|
||||
@@ -109,7 +115,6 @@ riscv64-debian-cross-container:
|
||||
allow_failure: true
|
||||
variables:
|
||||
NAME: debian-riscv64-cross
|
||||
QEMU_JOB_OPTIONAL: 1
|
||||
|
||||
# we can however build TCG tests using a non-sid base
|
||||
riscv64-debian-test-cross-container:
|
||||
|
||||
@@ -1,6 +1,20 @@
|
||||
include:
|
||||
- local: '/.gitlab-ci.d/crossbuild-template.yml'
|
||||
|
||||
cross-armel-system:
|
||||
extends: .cross_system_build_job
|
||||
needs:
|
||||
job: armel-debian-cross-container
|
||||
variables:
|
||||
IMAGE: debian-armel-cross
|
||||
|
||||
cross-armel-user:
|
||||
extends: .cross_user_build_job
|
||||
needs:
|
||||
job: armel-debian-cross-container
|
||||
variables:
|
||||
IMAGE: debian-armel-cross
|
||||
|
||||
cross-armhf-system:
|
||||
extends: .cross_system_build_job
|
||||
needs:
|
||||
|
||||
@@ -14,7 +14,7 @@ variables:
|
||||
GIT_STRATEGY: clone
|
||||
|
||||
include:
|
||||
- local: '/.gitlab-ci.d/custom-runners/ubuntu-22.04-s390x.yml'
|
||||
- local: '/.gitlab-ci.d/custom-runners/ubuntu-20.04-s390x.yml'
|
||||
- local: '/.gitlab-ci.d/custom-runners/ubuntu-22.04-aarch64.yml'
|
||||
- local: '/.gitlab-ci.d/custom-runners/ubuntu-22.04-aarch32.yml'
|
||||
- local: '/.gitlab-ci.d/custom-runners/centos-stream-8-x86_64.yml'
|
||||
+14
-14
@@ -1,12 +1,12 @@
|
||||
# All ubuntu-22.04 jobs should run successfully in an environment
|
||||
# All ubuntu-20.04 jobs should run successfully in an environment
|
||||
# setup by the scripts/ci/setup/build-environment.yml task
|
||||
# "Install basic packages to build QEMU on Ubuntu 22.04"
|
||||
# "Install basic packages to build QEMU on Ubuntu 20.04/20.04"
|
||||
|
||||
ubuntu-22.04-s390x-all-linux-static:
|
||||
ubuntu-20.04-s390x-all-linux-static:
|
||||
needs: []
|
||||
stage: build
|
||||
tags:
|
||||
- ubuntu_22.04
|
||||
- ubuntu_20.04
|
||||
- s390x
|
||||
rules:
|
||||
- if: '$CI_PROJECT_NAMESPACE == "qemu-project" && $CI_COMMIT_BRANCH =~ /^staging/'
|
||||
@@ -24,11 +24,11 @@ ubuntu-22.04-s390x-all-linux-static:
|
||||
- make --output-sync -j`nproc` check-tcg V=1
|
||||
|| { cat meson-logs/testlog.txt; exit 1; } ;
|
||||
|
||||
ubuntu-22.04-s390x-all:
|
||||
ubuntu-20.04-s390x-all:
|
||||
needs: []
|
||||
stage: build
|
||||
tags:
|
||||
- ubuntu_22.04
|
||||
- ubuntu_20.04
|
||||
- s390x
|
||||
timeout: 75m
|
||||
rules:
|
||||
@@ -43,11 +43,11 @@ ubuntu-22.04-s390x-all:
|
||||
- make --output-sync -j`nproc` check V=1
|
||||
|| { cat meson-logs/testlog.txt; exit 1; } ;
|
||||
|
||||
ubuntu-22.04-s390x-alldbg:
|
||||
ubuntu-20.04-s390x-alldbg:
|
||||
needs: []
|
||||
stage: build
|
||||
tags:
|
||||
- ubuntu_22.04
|
||||
- ubuntu_20.04
|
||||
- s390x
|
||||
rules:
|
||||
- if: '$CI_PROJECT_NAMESPACE == "qemu-project" && $CI_COMMIT_BRANCH =~ /^staging/'
|
||||
@@ -66,11 +66,11 @@ ubuntu-22.04-s390x-alldbg:
|
||||
- make --output-sync -j`nproc` check V=1
|
||||
|| { cat meson-logs/testlog.txt; exit 1; } ;
|
||||
|
||||
ubuntu-22.04-s390x-clang:
|
||||
ubuntu-20.04-s390x-clang:
|
||||
needs: []
|
||||
stage: build
|
||||
tags:
|
||||
- ubuntu_22.04
|
||||
- ubuntu_20.04
|
||||
- s390x
|
||||
rules:
|
||||
- if: '$CI_PROJECT_NAMESPACE == "qemu-project" && $CI_COMMIT_BRANCH =~ /^staging/'
|
||||
@@ -88,11 +88,11 @@ ubuntu-22.04-s390x-clang:
|
||||
- make --output-sync -j`nproc` check V=1
|
||||
|| { cat meson-logs/testlog.txt; exit 1; } ;
|
||||
|
||||
ubuntu-22.04-s390x-tci:
|
||||
ubuntu-20.04-s390x-tci:
|
||||
needs: []
|
||||
stage: build
|
||||
tags:
|
||||
- ubuntu_22.04
|
||||
- ubuntu_20.04
|
||||
- s390x
|
||||
rules:
|
||||
- if: '$CI_PROJECT_NAMESPACE == "qemu-project" && $CI_COMMIT_BRANCH =~ /^staging/'
|
||||
@@ -108,11 +108,11 @@ ubuntu-22.04-s390x-tci:
|
||||
|| { cat config.log meson-logs/meson-log.txt; exit 1; }
|
||||
- make --output-sync -j`nproc`
|
||||
|
||||
ubuntu-22.04-s390x-notcg:
|
||||
ubuntu-20.04-s390x-notcg:
|
||||
needs: []
|
||||
stage: build
|
||||
tags:
|
||||
- ubuntu_22.04
|
||||
- ubuntu_20.04
|
||||
- s390x
|
||||
rules:
|
||||
- if: '$CI_PROJECT_NAMESPACE == "qemu-project" && $CI_COMMIT_BRANCH =~ /^staging/'
|
||||
@@ -0,0 +1,85 @@
|
||||
# All jobs needing docker-edk2 must use the same rules it uses.
|
||||
.edk2_job_rules:
|
||||
rules:
|
||||
# Forks don't get pipelines unless QEMU_CI=1 or QEMU_CI=2 is set
|
||||
- if: '$QEMU_CI != "1" && $QEMU_CI != "2" && $CI_PROJECT_NAMESPACE != "qemu-project"'
|
||||
when: never
|
||||
|
||||
# In forks, if QEMU_CI=1 is set, then create manual job
|
||||
# if any of the files affecting the build are touched
|
||||
- if: '$QEMU_CI == "1" && $CI_PROJECT_NAMESPACE != "qemu-project"'
|
||||
changes:
|
||||
- .gitlab-ci.d/edk2.yml
|
||||
- .gitlab-ci.d/edk2/Dockerfile
|
||||
- roms/edk2/*
|
||||
when: manual
|
||||
|
||||
# In forks, if QEMU_CI=1 is set, then create manual job
|
||||
# if the branch/tag starts with 'edk2'
|
||||
- if: '$QEMU_CI == "1" && $CI_PROJECT_NAMESPACE != "qemu-project" && $CI_COMMIT_REF_NAME =~ /^edk2/'
|
||||
when: manual
|
||||
|
||||
# In forks, if QEMU_CI=1 is set, then create manual job
|
||||
# if last commit msg contains 'EDK2' (case insensitive)
|
||||
- if: '$QEMU_CI == "1" && $CI_PROJECT_NAMESPACE != "qemu-project" && $CI_COMMIT_MESSAGE =~ /edk2/i'
|
||||
when: manual
|
||||
|
||||
# Run if any files affecting the build output are touched
|
||||
- changes:
|
||||
- .gitlab-ci.d/edk2.yml
|
||||
- .gitlab-ci.d/edk2/Dockerfile
|
||||
- roms/edk2/*
|
||||
when: on_success
|
||||
|
||||
# Run if the branch/tag starts with 'edk2'
|
||||
- if: '$CI_COMMIT_REF_NAME =~ /^edk2/'
|
||||
when: on_success
|
||||
|
||||
# Run if last commit msg contains 'EDK2' (case insensitive)
|
||||
- if: '$CI_COMMIT_MESSAGE =~ /edk2/i'
|
||||
when: on_success
|
||||
|
||||
docker-edk2:
|
||||
extends: .edk2_job_rules
|
||||
stage: containers
|
||||
image: docker:19.03.1
|
||||
services:
|
||||
- docker:19.03.1-dind
|
||||
variables:
|
||||
GIT_DEPTH: 3
|
||||
IMAGE_TAG: $CI_REGISTRY_IMAGE:edk2-cross-build
|
||||
# We don't use TLS
|
||||
DOCKER_HOST: tcp://docker:2375
|
||||
DOCKER_TLS_CERTDIR: ""
|
||||
before_script:
|
||||
- docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY
|
||||
script:
|
||||
- docker pull $IMAGE_TAG || true
|
||||
- docker build --cache-from $IMAGE_TAG --tag $CI_REGISTRY_IMAGE:$CI_COMMIT_SHA
|
||||
--tag $IMAGE_TAG .gitlab-ci.d/edk2
|
||||
- docker push $CI_REGISTRY_IMAGE:$CI_COMMIT_SHA
|
||||
- docker push $IMAGE_TAG
|
||||
|
||||
build-edk2:
|
||||
extends: .edk2_job_rules
|
||||
stage: build
|
||||
needs: ['docker-edk2']
|
||||
artifacts:
|
||||
paths: # 'artifacts.zip' will contains the following files:
|
||||
- pc-bios/edk2*bz2
|
||||
- pc-bios/edk2-licenses.txt
|
||||
- edk2-stdout.log
|
||||
- edk2-stderr.log
|
||||
image: $CI_REGISTRY_IMAGE:edk2-cross-build
|
||||
variables:
|
||||
GIT_DEPTH: 3
|
||||
script: # Clone the required submodules and build EDK2
|
||||
- git submodule update --init roms/edk2
|
||||
- git -C roms/edk2 submodule update --init --
|
||||
ArmPkg/Library/ArmSoftFloatLib/berkeley-softfloat-3
|
||||
BaseTools/Source/C/BrotliCompress/brotli
|
||||
CryptoPkg/Library/OpensslLib/openssl
|
||||
MdeModulePkg/Library/BrotliCustomDecompressLib/brotli
|
||||
- export JOBS=$(($(getconf _NPROCESSORS_ONLN) + 1))
|
||||
- echo "=== Using ${JOBS} simultaneous jobs ==="
|
||||
- make -j${JOBS} -C roms efi 2>&1 1>edk2-stdout.log | tee -a edk2-stderr.log >&2
|
||||
@@ -0,0 +1,27 @@
|
||||
#
|
||||
# Docker image to cross-compile EDK2 firmware binaries
|
||||
#
|
||||
FROM ubuntu:18.04
|
||||
|
||||
MAINTAINER Philippe Mathieu-Daudé <[email protected]>
|
||||
|
||||
# Install packages required to build EDK2
|
||||
RUN apt update \
|
||||
&& \
|
||||
\
|
||||
DEBIAN_FRONTEND=noninteractive \
|
||||
apt install --assume-yes --no-install-recommends \
|
||||
build-essential \
|
||||
ca-certificates \
|
||||
dos2unix \
|
||||
gcc-aarch64-linux-gnu \
|
||||
gcc-arm-linux-gnueabi \
|
||||
git \
|
||||
iasl \
|
||||
make \
|
||||
nasm \
|
||||
python3 \
|
||||
uuid-dev \
|
||||
&& \
|
||||
\
|
||||
rm -rf /var/lib/apt/lists/*
|
||||
@@ -42,9 +42,9 @@
|
||||
docker-opensbi:
|
||||
extends: .opensbi_job_rules
|
||||
stage: containers
|
||||
image: docker:stable
|
||||
image: docker:19.03.1
|
||||
services:
|
||||
- docker:stable-dind
|
||||
- docker:19.03.1-dind
|
||||
variables:
|
||||
GIT_DEPTH: 3
|
||||
IMAGE_TAG: $CI_REGISTRY_IMAGE:opensbi-cross-build
|
||||
|
||||
@@ -15,7 +15,6 @@ RUN apt update \
|
||||
ca-certificates \
|
||||
git \
|
||||
make \
|
||||
python3 \
|
||||
wget \
|
||||
&& \
|
||||
\
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
include:
|
||||
- local: '/.gitlab-ci.d/base.yml'
|
||||
- local: '/.gitlab-ci.d/stages.yml'
|
||||
- local: '/.gitlab-ci.d/edk2.yml'
|
||||
- local: '/.gitlab-ci.d/opensbi.yml'
|
||||
- local: '/.gitlab-ci.d/containers.yml'
|
||||
- local: '/.gitlab-ci.d/crossbuilds.yml'
|
||||
|
||||
@@ -23,12 +23,12 @@ check-dco:
|
||||
before_script:
|
||||
- apk -U add git
|
||||
|
||||
check-python-minreqs:
|
||||
check-python-pipenv:
|
||||
extends: .base_job_template
|
||||
stage: test
|
||||
image: $CI_REGISTRY_IMAGE/qemu/python:latest
|
||||
script:
|
||||
- make -C python check-minreqs
|
||||
- make -C python check-pipenv
|
||||
variables:
|
||||
GIT_DEPTH: 1
|
||||
needs:
|
||||
|
||||
@@ -1,7 +1,9 @@
|
||||
.shared_msys2_builder:
|
||||
extends: .base_job_template
|
||||
tags:
|
||||
- saas-windows-medium-amd64
|
||||
- shared-windows
|
||||
- windows
|
||||
- windows-1809
|
||||
cache:
|
||||
key: "${CI_JOB_NAME}-cache"
|
||||
paths:
|
||||
@@ -61,3 +63,37 @@ msys2-64bit:
|
||||
--enable-capstone --without-default-devices'
|
||||
- .\msys64\usr\bin\bash -lc 'make'
|
||||
- .\msys64\usr\bin\bash -lc 'make check || { cat build/meson-logs/testlog.txt; exit 1; } ;'
|
||||
|
||||
msys2-32bit:
|
||||
extends: .shared_msys2_builder
|
||||
script:
|
||||
- .\msys64\usr\bin\bash -lc "pacman -Sy --noconfirm --needed
|
||||
bison diffutils flex
|
||||
git grep make sed
|
||||
mingw-w64-i686-capstone
|
||||
mingw-w64-i686-curl
|
||||
mingw-w64-i686-cyrus-sasl
|
||||
mingw-w64-i686-gcc
|
||||
mingw-w64-i686-glib2
|
||||
mingw-w64-i686-gnutls
|
||||
mingw-w64-i686-gtk3
|
||||
mingw-w64-i686-libgcrypt
|
||||
mingw-w64-i686-libjpeg-turbo
|
||||
mingw-w64-i686-libssh
|
||||
mingw-w64-i686-libtasn1
|
||||
mingw-w64-i686-libusb
|
||||
mingw-w64-i686-lzo2
|
||||
mingw-w64-i686-ninja
|
||||
mingw-w64-i686-pixman
|
||||
mingw-w64-i686-pkgconf
|
||||
mingw-w64-i686-python
|
||||
mingw-w64-i686-snappy
|
||||
mingw-w64-i686-usbredir "
|
||||
- $env:CHERE_INVOKING = 'yes' # Preserve the current working directory
|
||||
- $env:MSYSTEM = 'MINGW32' # Start a 32-bit MinG environment
|
||||
- $env:MSYS = 'winsymlinks:native' # Enable native Windows symlink
|
||||
- mkdir output
|
||||
- cd output
|
||||
- ..\msys64\usr\bin\bash -lc "../configure --target-list=ppc64-softmmu"
|
||||
- ..\msys64\usr\bin\bash -lc 'make'
|
||||
- ..\msys64\usr\bin\bash -lc 'make check || { cat meson-logs/testlog.txt; exit 1; } ;'
|
||||
@@ -58,6 +58,9 @@
|
||||
[submodule "roms/vbootrom"]
|
||||
path = roms/vbootrom
|
||||
url = https://gitlab.com/qemu-project/vbootrom.git
|
||||
[submodule "libucontext"]
|
||||
path = subprojects/libucontext
|
||||
url = https://github.com/utmapp/libucontext.git
|
||||
[submodule "tests/lcitool/libvirt-ci"]
|
||||
path = tests/lcitool/libvirt-ci
|
||||
url = https://gitlab.com/libvirt/libvirt-ci.git
|
||||
|
||||
+7
-12
@@ -5,21 +5,16 @@
|
||||
# Required
|
||||
version: 2
|
||||
|
||||
# Set the version of Python and other tools you might need
|
||||
build:
|
||||
os: ubuntu-22.04
|
||||
tools:
|
||||
python: "3.11"
|
||||
|
||||
# Build documentation in the docs/ directory with Sphinx
|
||||
sphinx:
|
||||
configuration: docs/conf.py
|
||||
|
||||
# We recommend specifying your dependencies to enable reproducible builds:
|
||||
# https://docs.readthedocs.io/en/stable/guides/reproducible-builds.html
|
||||
python:
|
||||
install:
|
||||
- requirements: docs/requirements.txt
|
||||
|
||||
# We want all the document formats
|
||||
formats: all
|
||||
|
||||
# For consistency, we require that QEMU's Sphinx extensions
|
||||
# run with at least the same minimum version of Python that
|
||||
# we require for other Python in our codebase (our conf.py
|
||||
# enforces this, and some code needs it.)
|
||||
python:
|
||||
version: 3.6
|
||||
+4
-1
@@ -3257,6 +3257,8 @@ F: roms/edk2
|
||||
F: roms/edk2-*
|
||||
F: tests/data/uefi-boot-images/
|
||||
F: tests/uefi-test-tools/
|
||||
F: .gitlab-ci.d/edk2.yml
|
||||
F: .gitlab-ci.d/edk2/
|
||||
|
||||
VT-d Emulation
|
||||
M: Michael S. Tsirkin <[email protected]>
|
||||
@@ -3731,7 +3733,8 @@ W: https://cirrus-ci.com/github/qemu/qemu
|
||||
Windows Hosted Continuous Integration
|
||||
M: Yonggang Luo <[email protected]>
|
||||
S: Maintained
|
||||
F: .gitlab-ci.d/windows.yml
|
||||
F: .cirrus.yml
|
||||
W: https://cirrus-ci.com/github/qemu/qemu
|
||||
|
||||
Guest Test Compilation Support
|
||||
M: Alex Bennée <[email protected]>
|
||||
|
||||
@@ -213,10 +213,10 @@ clean: recurse-clean
|
||||
|
||||
VERSION = $(shell cat $(SRC_PATH)/VERSION)
|
||||
|
||||
dist: qemu-$(VERSION).tar.xz
|
||||
dist: qemu-$(VERSION).tar.bz2
|
||||
|
||||
qemu-%.tar.xz:
|
||||
$(SRC_PATH)/scripts/make-release "$(SRC_PATH)" "$(patsubst qemu-%.tar.xz,%,$@)"
|
||||
qemu-%.tar.bz2:
|
||||
$(SRC_PATH)/scripts/make-release "$(SRC_PATH)" "$(patsubst qemu-%.tar.bz2,%,$@)"
|
||||
|
||||
distclean: clean recurse-distclean
|
||||
-$(quiet-@)test -f build.ninja && $(NINJA) $(NINJAFLAGS) -t clean -g || :
|
||||
|
||||
+302
-83
@@ -57,25 +57,34 @@
|
||||
#include "sysemu/hvf_int.h"
|
||||
#include "sysemu/runstate.h"
|
||||
#include "qemu/guest-random.h"
|
||||
#include "hw/boards.h"
|
||||
#include "exec/memory-remap.h"
|
||||
#include "exec/ram_addr.h"
|
||||
|
||||
HVFState *hvf_state;
|
||||
|
||||
#ifdef __aarch64__
|
||||
#define HV_VM_DEFAULT NULL
|
||||
#endif
|
||||
|
||||
/* Memory slots */
|
||||
|
||||
hvf_slot *hvf_find_overlap_slot(uint64_t start, uint64_t size)
|
||||
{
|
||||
#define HVF_MAX_SLOTS 512
|
||||
#ifdef DEBUG_HVF
|
||||
#define DPRINTF(fmt, ...) \
|
||||
do { fprintf(stdout, fmt, ## __VA_ARGS__); } while (0)
|
||||
#else
|
||||
#define DPRINTF(fmt, ...) \
|
||||
do { } while (0)
|
||||
#endif
|
||||
|
||||
#define qemu_abort(...) do { g_error(__VA_ARGS__); g_abort(); } while (0)
|
||||
|
||||
pthread_rwlock_t mem_lock = PTHREAD_RWLOCK_INITIALIZER;
|
||||
|
||||
hvf_slot *hvf_find_overlap_slot(uint64_t start, uint64_t end) {
|
||||
hvf_slot *slot;
|
||||
int x;
|
||||
for (x = 0; x < hvf_state->num_slots; ++x) {
|
||||
slot = &hvf_state->slots[x];
|
||||
if (slot->size && start < (slot->start + slot->size) &&
|
||||
(start + size) > slot->start) {
|
||||
if (slot->size && start < (slot->start + slot->size) && end > slot->start)
|
||||
return slot;
|
||||
}
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
@@ -85,22 +94,236 @@ struct mac_slot {
|
||||
uint64_t size;
|
||||
uint64_t gpa_start;
|
||||
uint64_t gva;
|
||||
void* hva;
|
||||
};
|
||||
|
||||
struct mac_slot mac_slots[32];
|
||||
struct mac_slot mac_slots[HVF_MAX_SLOTS];
|
||||
|
||||
static int do_hvf_set_memory(hvf_slot *slot, hv_memory_flags_t flags)
|
||||
{
|
||||
#define ALIGN(x, y) (((x)+(y)-1) & ~((y)-1))
|
||||
|
||||
void* hvf_gpa2hva(uint64_t gpa, bool* found) {
|
||||
struct mac_slot *mslot;
|
||||
*found = false;
|
||||
|
||||
for (uint32_t i = 0; i < HVF_MAX_SLOTS; i++) {
|
||||
mslot = &mac_slots[i];
|
||||
if (!mslot->present) continue;
|
||||
if (gpa >= mslot->gpa_start &&
|
||||
gpa < mslot->gpa_start + mslot->size) {
|
||||
*found = true;
|
||||
return (void*)((char*)(mslot->hva) + (gpa - mslot->gpa_start));
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
#define min(a, b) ((a) < (b) ? (a) : (b))
|
||||
int hvf_hva2gpa(void* hva, uint64_t length, int array_size,
|
||||
uint64_t* gpa, uint64_t* size) {
|
||||
struct mac_slot *mslot;
|
||||
int count = 0;
|
||||
|
||||
for (uint32_t i = 0; i < HVF_MAX_SLOTS; i++) {
|
||||
mslot = &mac_slots[i];
|
||||
if (!mslot->present) continue;
|
||||
|
||||
uintptr_t hva_start_num = (uintptr_t)mslot->hva;
|
||||
uintptr_t hva_num = (uintptr_t)hva;
|
||||
// Start of this hva region is in this slot.
|
||||
if (hva_num >= hva_start_num &&
|
||||
hva_num < hva_start_num + mslot->size) {
|
||||
if (count < array_size) {
|
||||
gpa[count] = mslot->gpa_start + (hva_num - hva_start_num);
|
||||
size[count] = min(length,
|
||||
mslot->size - (hva_num - hva_start_num));
|
||||
}
|
||||
count++;
|
||||
// End of this hva region is in this slot.
|
||||
// Its start is outside of this slot.
|
||||
} else if (hva_num + length <= hva_start_num + mslot->size &&
|
||||
hva_num + length > hva_start_num) {
|
||||
if (count < array_size) {
|
||||
gpa[count] = mslot->gpa_start;
|
||||
size[count] = hva_num + length - hva_start_num;
|
||||
}
|
||||
count++;
|
||||
// This slot belongs to this hva region completely.
|
||||
} else if (hva_num + length > hva_start_num + mslot->size &&
|
||||
hva_num < hva_start_num) {
|
||||
if (count < array_size) {
|
||||
gpa[count] = mslot->gpa_start;
|
||||
size[count] = mslot->size;
|
||||
}
|
||||
count++;
|
||||
}
|
||||
}
|
||||
return count;
|
||||
}
|
||||
|
||||
static hvf_slot* hvf_next_free_slot() {
|
||||
hvf_slot* mem = 0;
|
||||
int x;
|
||||
|
||||
for (x = 0; x < hvf_state->num_slots; ++x) {
|
||||
mem = &hvf_state->slots[x];
|
||||
if (!mem->size) {
|
||||
return mem;
|
||||
}
|
||||
}
|
||||
|
||||
return mem;
|
||||
}
|
||||
|
||||
int __hvf_set_memory(hvf_slot *slot);
|
||||
int __hvf_set_memory_with_flags_locked(hvf_slot *slot, hv_memory_flags_t flags);
|
||||
|
||||
int hvf_map_safe(void* hva, uint64_t gpa, uint64_t size, uint64_t flags) {
|
||||
pthread_rwlock_wrlock(&mem_lock);
|
||||
DPRINTF("%s: hva: [%p 0x%llx] gpa: [0x%llx 0x%llx]\n", __func__,
|
||||
hva, (unsigned long long)(uintptr_t)(((char*)hva) + size),
|
||||
(unsigned long long)gpa,
|
||||
(unsigned long long)gpa + size);
|
||||
|
||||
hvf_slot *mem;
|
||||
mem = hvf_find_overlap_slot(gpa, gpa + size);
|
||||
|
||||
if (mem &&
|
||||
mem->mem == hva &&
|
||||
mem->start == gpa &&
|
||||
mem->size == size) {
|
||||
|
||||
pthread_rwlock_unlock(&mem_lock);
|
||||
return HV_SUCCESS;
|
||||
} else if (mem &&
|
||||
mem->start == gpa &&
|
||||
mem->size == size) {
|
||||
// unmap existing mapping, but only if it coincides
|
||||
mem->size = 0;
|
||||
__hvf_set_memory_with_flags_locked(mem, 0);
|
||||
} else if (mem) {
|
||||
// TODO: Manage and support partially-overlapping user-backed RAM mappings.
|
||||
// for now, consider it fatal.
|
||||
pthread_rwlock_unlock(&mem_lock);
|
||||
qemu_abort("%s: FATAL: tried to map [0x%llx 0x%llx) to %p "
|
||||
"while it was mapped to [0x%llx 0x%llx), %p",
|
||||
__func__,
|
||||
(unsigned long long)gpa,
|
||||
(unsigned long long)gpa + size,
|
||||
hva,
|
||||
(unsigned long long)mem->start,
|
||||
(unsigned long long)mem->start + mem->size,
|
||||
mem->mem);
|
||||
}
|
||||
|
||||
mem = hvf_next_free_slot();
|
||||
|
||||
if (mem->size) {
|
||||
qemu_abort("%s: no free slots\n", __func__);
|
||||
}
|
||||
|
||||
mem->mem = (uint8_t*)hva;
|
||||
mem->start = gpa;
|
||||
mem->size = size;
|
||||
|
||||
int res = __hvf_set_memory_with_flags_locked(mem, (hv_memory_flags_t)flags);
|
||||
|
||||
pthread_rwlock_unlock(&mem_lock);
|
||||
return res;
|
||||
}
|
||||
|
||||
int hvf_unmap_safe(uint64_t gpa, uint64_t size) {
|
||||
DPRINTF("%s: gpa: [0x%llx 0x%llx]\n", __func__,
|
||||
(unsigned long long)gpa,
|
||||
(unsigned long long)gpa + size);
|
||||
pthread_rwlock_wrlock(&mem_lock);
|
||||
|
||||
hvf_slot *mem;
|
||||
int res = 0;
|
||||
mem = hvf_find_overlap_slot(gpa, gpa + size);
|
||||
|
||||
if (mem &&
|
||||
(mem->start != gpa ||
|
||||
mem->size != size)) {
|
||||
|
||||
pthread_rwlock_unlock(&mem_lock);
|
||||
|
||||
qemu_abort("%s: tried to unmap [0x%llx 0x%llx) but partially overlapping "
|
||||
"[0x%llx 0x%llx), %p was encountered",
|
||||
__func__, gpa, gpa + size,
|
||||
mem->start, mem->start + mem->size, mem->mem);
|
||||
} else if (mem) {
|
||||
mem->size = 0;
|
||||
res = __hvf_set_memory_with_flags_locked(mem, 0);
|
||||
} else {
|
||||
// fall through, allow res to be 0 still if slot was not found.
|
||||
}
|
||||
|
||||
pthread_rwlock_unlock(&mem_lock);
|
||||
return res;
|
||||
}
|
||||
|
||||
int hvf_protect_safe(uint64_t gpa, uint64_t size, uint64_t flags) {
|
||||
pthread_rwlock_wrlock(&mem_lock);
|
||||
int res = hv_vm_protect(gpa, size, flags);
|
||||
pthread_rwlock_unlock(&mem_lock);
|
||||
return res;
|
||||
}
|
||||
|
||||
int hvf_remap_safe(void* hva, uint64_t gpa, uint64_t size, uint64_t flags) {
|
||||
pthread_rwlock_wrlock(&mem_lock);
|
||||
int res = hv_vm_unmap(gpa, size);
|
||||
assert_hvf_ok(res);
|
||||
res = hv_vm_map(hva, gpa, size, flags);
|
||||
assert_hvf_ok(res);
|
||||
pthread_rwlock_unlock(&mem_lock);
|
||||
return res;
|
||||
}
|
||||
|
||||
// API for adding and removing mappings of guest RAM and host addrs.
|
||||
// Implementation depends on the hypervisor.
|
||||
static hv_memory_flags_t user_backed_flags_to_hvf_flags(int flags) {
|
||||
hv_memory_flags_t hvf_flags = 0;
|
||||
if (flags & USER_BACKED_RAM_FLAGS_READ) {
|
||||
hvf_flags |= HV_MEMORY_READ;
|
||||
}
|
||||
if (flags & USER_BACKED_RAM_FLAGS_WRITE) {
|
||||
hvf_flags |= HV_MEMORY_WRITE;
|
||||
}
|
||||
if (flags & USER_BACKED_RAM_FLAGS_EXEC) {
|
||||
hvf_flags |= HV_MEMORY_EXEC;
|
||||
}
|
||||
return hvf_flags;
|
||||
}
|
||||
|
||||
static void hvf_user_backed_ram_map(uint64_t gpa, void* hva, uint64_t size, int flags) {
|
||||
hvf_map_safe(hva, gpa, size, user_backed_flags_to_hvf_flags(flags));
|
||||
}
|
||||
|
||||
static void hvf_user_backed_ram_unmap(uint64_t gpa, uint64_t size) {
|
||||
hvf_unmap_safe(gpa, size);
|
||||
}
|
||||
|
||||
int __hvf_set_memory(hvf_slot *slot) {
|
||||
pthread_rwlock_wrlock(&mem_lock);
|
||||
int res = __hvf_set_memory_with_flags_locked(slot, HV_MEMORY_READ | HV_MEMORY_WRITE | HV_MEMORY_EXEC);
|
||||
pthread_rwlock_unlock(&mem_lock);
|
||||
return res;
|
||||
}
|
||||
|
||||
int __hvf_set_memory_with_flags_locked(hvf_slot *slot, hv_memory_flags_t flags) {
|
||||
struct mac_slot *macslot;
|
||||
hv_return_t ret;
|
||||
|
||||
macslot = &mac_slots[slot->slot_id];
|
||||
|
||||
if (macslot->present) {
|
||||
if (macslot->size != slot->size) {
|
||||
macslot->present = 0;
|
||||
ret = hv_vm_unmap(macslot->gpa_start, macslot->size);
|
||||
assert_hvf_ok(ret);
|
||||
DPRINTF("%s: hv_vm_unmap for gpa [0x%llx 0x%llx]\n", __func__,
|
||||
(unsigned long long)macslot->gpa_start,
|
||||
(unsigned long long)(macslot->gpa_start + macslot->size));
|
||||
int unmapres = hv_vm_unmap(macslot->gpa_start, macslot->size);
|
||||
assert_hvf_ok(unmapres);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -111,93 +334,58 @@ static int do_hvf_set_memory(hvf_slot *slot, hv_memory_flags_t flags)
|
||||
macslot->present = 1;
|
||||
macslot->gpa_start = slot->start;
|
||||
macslot->size = slot->size;
|
||||
ret = hv_vm_map(slot->mem, slot->start, slot->size, flags);
|
||||
assert_hvf_ok(ret);
|
||||
macslot->hva = slot->mem;
|
||||
DPRINTF("%s: hv_vm_map for hva 0x%llx gpa [0x%llx 0x%llx]\n", __func__,
|
||||
(unsigned long long)(slot->mem),
|
||||
(unsigned long long)macslot->gpa_start,
|
||||
(unsigned long long)(macslot->gpa_start + macslot->size));
|
||||
int mapres = (hv_vm_map(slot->mem, slot->start, slot->size, flags));
|
||||
assert_hvf_ok(mapres);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void hvf_set_phys_mem(MemoryRegionSection *section, bool add)
|
||||
{
|
||||
static void hvf_set_phys_mem(MemoryRegionSection* section, bool add) {
|
||||
hvf_slot *mem;
|
||||
MemoryRegion *area = section->mr;
|
||||
bool writable = !area->readonly && !area->rom_device;
|
||||
hv_memory_flags_t flags;
|
||||
uint64_t page_size = qemu_real_host_page_size();
|
||||
|
||||
if (!memory_region_is_ram(area)) {
|
||||
if (writable) {
|
||||
return;
|
||||
} else if (!memory_region_is_romd(area)) {
|
||||
/*
|
||||
* If the memory device is not in romd_mode, then we actually want
|
||||
* to remove the hvf memory slot so all accesses will trap.
|
||||
*/
|
||||
add = false;
|
||||
}
|
||||
}
|
||||
|
||||
if (!QEMU_IS_ALIGNED(int128_get64(section->size), page_size) ||
|
||||
!QEMU_IS_ALIGNED(section->offset_within_address_space, page_size)) {
|
||||
/* Not page aligned, so we can not map as RAM */
|
||||
add = false;
|
||||
}
|
||||
if (!memory_region_is_ram(area)) return;
|
||||
if (memory_region_is_user_backed(area)) return;
|
||||
|
||||
mem = hvf_find_overlap_slot(
|
||||
section->offset_within_address_space,
|
||||
int128_get64(section->size));
|
||||
section->offset_within_address_space + int128_get64(section->size));
|
||||
|
||||
if (mem && add) {
|
||||
if (mem->size == int128_get64(section->size) &&
|
||||
mem->start == section->offset_within_address_space &&
|
||||
mem->mem == (memory_region_get_ram_ptr(area) +
|
||||
section->offset_within_region)) {
|
||||
return; /* Same region was attempted to register, go away. */
|
||||
}
|
||||
mem->start == section->offset_within_address_space &&
|
||||
mem->mem == (memory_region_get_ram_ptr(area) + section->offset_within_region))
|
||||
return; // Same region was attempted to register, go away.
|
||||
}
|
||||
|
||||
/* Region needs to be reset. set the size to 0 and remap it. */
|
||||
// Region needs to be reset. set the size to 0 and remap it.
|
||||
if (mem) {
|
||||
mem->size = 0;
|
||||
if (do_hvf_set_memory(mem, 0)) {
|
||||
error_report("Failed to reset overlapping slot");
|
||||
abort();
|
||||
if (__hvf_set_memory(mem)) {
|
||||
qemu_abort("%s: Failed to reset overlapping slot\n", __func__);
|
||||
}
|
||||
}
|
||||
|
||||
if (!add) {
|
||||
return;
|
||||
}
|
||||
if (!add) return;
|
||||
|
||||
if (area->readonly ||
|
||||
(!memory_region_is_ram(area) && memory_region_is_romd(area))) {
|
||||
flags = HV_MEMORY_READ | HV_MEMORY_EXEC;
|
||||
} else {
|
||||
flags = HV_MEMORY_READ | HV_MEMORY_WRITE | HV_MEMORY_EXEC;
|
||||
}
|
||||
// Now make a new slot.
|
||||
|
||||
/* Now make a new slot. */
|
||||
int x;
|
||||
mem = hvf_next_free_slot();
|
||||
|
||||
for (x = 0; x < hvf_state->num_slots; ++x) {
|
||||
mem = &hvf_state->slots[x];
|
||||
if (!mem->size) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (x == hvf_state->num_slots) {
|
||||
error_report("No free slots");
|
||||
abort();
|
||||
if (!mem) {
|
||||
qemu_abort("%s: no free slots\n", __func__);
|
||||
}
|
||||
|
||||
mem->size = int128_get64(section->size);
|
||||
mem->mem = memory_region_get_ram_ptr(area) + section->offset_within_region;
|
||||
mem->start = section->offset_within_address_space;
|
||||
mem->region = area;
|
||||
|
||||
if (do_hvf_set_memory(mem, flags)) {
|
||||
error_report("Error registering new memory slot");
|
||||
abort();
|
||||
if (__hvf_set_memory(mem)) {
|
||||
qemu_abort("%s: error regsitering new memory slot\n", __func__);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -319,25 +507,47 @@ bool hvf_allowed;
|
||||
|
||||
static int hvf_accel_init(MachineState *ms)
|
||||
{
|
||||
int x;
|
||||
hv_return_t ret;
|
||||
HVFState *s;
|
||||
HVFState *s = HVF_STATE(ms->accelerator);
|
||||
|
||||
ret = hv_vm_create(HV_VM_DEFAULT);
|
||||
ret = hvf_arch_vm_create(s);
|
||||
assert_hvf_ok(ret);
|
||||
|
||||
s = g_new0(HVFState, 1);
|
||||
hvf_state = s;
|
||||
memory_listener_register(&hvf_memory_listener, &address_space_memory);
|
||||
qemu_set_user_backed_mapping_funcs(
|
||||
hvf_user_backed_ram_map,
|
||||
hvf_user_backed_ram_unmap);
|
||||
|
||||
return hvf_arch_init();
|
||||
}
|
||||
|
||||
#if defined(CONFIG_HVF_PRIVATE) && defined(__aarch64__)
|
||||
|
||||
static bool hvf_get_tso(Object *obj, Error **errp)
|
||||
{
|
||||
HVFState *s = HVF_STATE(obj);
|
||||
return s->tso_mode;
|
||||
}
|
||||
|
||||
static void hvf_set_tso(Object *obj, bool value, Error **errp)
|
||||
{
|
||||
HVFState *s = HVF_STATE(obj);
|
||||
s->tso_mode = value;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
static void hvf_accel_instance_init(Object *obj)
|
||||
{
|
||||
int x;
|
||||
HVFState *s = HVF_STATE(obj);
|
||||
|
||||
s->num_slots = ARRAY_SIZE(s->slots);
|
||||
for (x = 0; x < s->num_slots; ++x) {
|
||||
s->slots[x].size = 0;
|
||||
s->slots[x].slot_id = x;
|
||||
}
|
||||
|
||||
hvf_state = s;
|
||||
memory_listener_register(&hvf_memory_listener, &address_space_memory);
|
||||
|
||||
return hvf_arch_init();
|
||||
}
|
||||
|
||||
static void hvf_accel_class_init(ObjectClass *oc, void *data)
|
||||
@@ -346,12 +556,21 @@ static void hvf_accel_class_init(ObjectClass *oc, void *data)
|
||||
ac->name = "HVF";
|
||||
ac->init_machine = hvf_accel_init;
|
||||
ac->allowed = &hvf_allowed;
|
||||
|
||||
#if defined(CONFIG_HVF_PRIVATE) && defined(__aarch64__)
|
||||
object_class_property_add_bool(oc, "tso",
|
||||
hvf_get_tso, hvf_set_tso);
|
||||
object_class_property_set_description(oc, "tso",
|
||||
"Set on/off to enable/disable total store ordering mode");
|
||||
#endif
|
||||
}
|
||||
|
||||
static const TypeInfo hvf_accel_type = {
|
||||
.name = TYPE_HVF_ACCEL,
|
||||
.parent = TYPE_ACCEL,
|
||||
.instance_init = hvf_accel_instance_init,
|
||||
.class_init = hvf_accel_class_init,
|
||||
.instance_size = sizeof(HVFState),
|
||||
};
|
||||
|
||||
static void hvf_type_init(void)
|
||||
|
||||
+17
-75
@@ -77,9 +77,6 @@
|
||||
do { } while (0)
|
||||
#endif
|
||||
|
||||
/* Default num of memslots to be allocated when VM starts */
|
||||
#define KVM_MEMSLOTS_NR_ALLOC_DEFAULT 16
|
||||
|
||||
struct KVMParkedVcpu {
|
||||
unsigned long vcpu_id;
|
||||
int kvm_fd;
|
||||
@@ -175,57 +172,6 @@ void kvm_resample_fd_notify(int gsi)
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* kvm_slots_grow(): Grow the slots[] array in the KVMMemoryListener
|
||||
*
|
||||
* @kml: The KVMMemoryListener* to grow the slots[] array
|
||||
* @nr_slots_new: The new size of slots[] array
|
||||
*
|
||||
* Returns: True if the array grows larger, false otherwise.
|
||||
*/
|
||||
static bool kvm_slots_grow(KVMMemoryListener *kml, unsigned int nr_slots_new)
|
||||
{
|
||||
unsigned int i, cur = kml->nr_slots_allocated;
|
||||
KVMSlot *slots;
|
||||
|
||||
if (nr_slots_new > kvm_state->nr_slots) {
|
||||
nr_slots_new = kvm_state->nr_slots;
|
||||
}
|
||||
|
||||
if (cur >= nr_slots_new) {
|
||||
/* Big enough, no need to grow, or we reached max */
|
||||
return false;
|
||||
}
|
||||
|
||||
if (cur == 0) {
|
||||
slots = g_new0(KVMSlot, nr_slots_new);
|
||||
} else {
|
||||
assert(kml->slots);
|
||||
slots = g_renew(KVMSlot, kml->slots, nr_slots_new);
|
||||
/*
|
||||
* g_renew() doesn't initialize extended buffers, however kvm
|
||||
* memslots require fields to be zero-initialized. E.g. pointers,
|
||||
* memory_size field, etc.
|
||||
*/
|
||||
memset(&slots[cur], 0x0, sizeof(slots[0]) * (nr_slots_new - cur));
|
||||
}
|
||||
|
||||
for (i = cur; i < nr_slots_new; i++) {
|
||||
slots[i].slot = i;
|
||||
}
|
||||
|
||||
kml->slots = slots;
|
||||
kml->nr_slots_allocated = nr_slots_new;
|
||||
trace_kvm_slots_grow(cur, nr_slots_new);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
static bool kvm_slots_double(KVMMemoryListener *kml)
|
||||
{
|
||||
return kvm_slots_grow(kml, kml->nr_slots_allocated * 2);
|
||||
}
|
||||
|
||||
int kvm_get_max_memslots(void)
|
||||
{
|
||||
KVMState *s = KVM_STATE(current_accel());
|
||||
@@ -236,26 +182,15 @@ int kvm_get_max_memslots(void)
|
||||
/* Called with KVMMemoryListener.slots_lock held */
|
||||
static KVMSlot *kvm_get_free_slot(KVMMemoryListener *kml)
|
||||
{
|
||||
unsigned int n;
|
||||
KVMState *s = kvm_state;
|
||||
int i;
|
||||
|
||||
for (i = 0; i < kml->nr_slots_allocated; i++) {
|
||||
for (i = 0; i < s->nr_slots; i++) {
|
||||
if (kml->slots[i].memory_size == 0) {
|
||||
return &kml->slots[i];
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* If no free slots, try to grow first by doubling. Cache the old size
|
||||
* here to avoid another round of search: if the grow succeeded, it
|
||||
* means slots[] now must have the existing "n" slots occupied,
|
||||
* followed by one or more free slots starting from slots[n].
|
||||
*/
|
||||
n = kml->nr_slots_allocated;
|
||||
if (kvm_slots_double(kml)) {
|
||||
return &kml->slots[n];
|
||||
}
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
@@ -289,9 +224,10 @@ static KVMSlot *kvm_lookup_matching_slot(KVMMemoryListener *kml,
|
||||
hwaddr start_addr,
|
||||
hwaddr size)
|
||||
{
|
||||
KVMState *s = kvm_state;
|
||||
int i;
|
||||
|
||||
for (i = 0; i < kml->nr_slots_allocated; i++) {
|
||||
for (i = 0; i < s->nr_slots; i++) {
|
||||
KVMSlot *mem = &kml->slots[i];
|
||||
|
||||
if (start_addr == mem->start_addr && size == mem->memory_size) {
|
||||
@@ -333,7 +269,7 @@ int kvm_physical_memory_addr_from_host(KVMState *s, void *ram,
|
||||
int i, ret = 0;
|
||||
|
||||
kvm_slots_lock();
|
||||
for (i = 0; i < kml->nr_slots_allocated; i++) {
|
||||
for (i = 0; i < s->nr_slots; i++) {
|
||||
KVMSlot *mem = &kml->slots[i];
|
||||
|
||||
if (ram >= mem->ram && ram < mem->ram + mem->memory_size) {
|
||||
@@ -1055,7 +991,7 @@ static int kvm_physical_log_clear(KVMMemoryListener *kml,
|
||||
|
||||
kvm_slots_lock();
|
||||
|
||||
for (i = 0; i < kml->nr_slots_allocated; i++) {
|
||||
for (i = 0; i < s->nr_slots; i++) {
|
||||
mem = &kml->slots[i];
|
||||
/* Discard slots that are empty or do not overlap the section */
|
||||
if (!mem->memory_size ||
|
||||
@@ -1546,14 +1482,19 @@ static void kvm_log_sync(MemoryListener *listener,
|
||||
static void kvm_log_sync_global(MemoryListener *l)
|
||||
{
|
||||
KVMMemoryListener *kml = container_of(l, KVMMemoryListener, listener);
|
||||
KVMState *s = kvm_state;
|
||||
KVMSlot *mem;
|
||||
int i;
|
||||
|
||||
/* Flush all kernel dirty addresses into KVMSlot dirty bitmap */
|
||||
kvm_dirty_ring_flush();
|
||||
|
||||
/*
|
||||
* TODO: make this faster when nr_slots is big while there are
|
||||
* only a few used slots (small VMs).
|
||||
*/
|
||||
kvm_slots_lock();
|
||||
for (i = 0; i < kml->nr_slots_allocated; i++) {
|
||||
for (i = 0; i < s->nr_slots; i++) {
|
||||
mem = &kml->slots[i];
|
||||
if (mem->memory_size && mem->flags & KVM_MEM_LOG_DIRTY_PAGES) {
|
||||
kvm_slot_sync_dirty_pages(mem);
|
||||
@@ -1662,9 +1603,12 @@ void kvm_memory_listener_register(KVMState *s, KVMMemoryListener *kml,
|
||||
{
|
||||
int i;
|
||||
|
||||
kml->slots = g_new0(KVMSlot, s->nr_slots);
|
||||
kml->as_id = as_id;
|
||||
|
||||
kvm_slots_grow(kml, KVM_MEMSLOTS_NR_ALLOC_DEFAULT);
|
||||
for (i = 0; i < s->nr_slots; i++) {
|
||||
kml->slots[i].slot = i;
|
||||
}
|
||||
|
||||
kml->listener.region_add = kvm_region_add;
|
||||
kml->listener.region_del = kvm_region_del;
|
||||
@@ -2350,7 +2294,7 @@ static int kvm_init(MachineState *ms)
|
||||
KVMState *s;
|
||||
const KVMCapabilityInfo *missing_cap;
|
||||
int ret;
|
||||
int type;
|
||||
int type = 0;
|
||||
uint64_t dirty_log_manual_caps;
|
||||
|
||||
qemu_mutex_init(&kml_slots_lock);
|
||||
@@ -2414,8 +2358,6 @@ static int kvm_init(MachineState *ms)
|
||||
type = mc->kvm_type(ms, kvm_type);
|
||||
} else if (mc->kvm_type) {
|
||||
type = mc->kvm_type(ms, NULL);
|
||||
} else {
|
||||
type = kvm_arch_get_default_type(ms);
|
||||
}
|
||||
|
||||
do {
|
||||
|
||||
@@ -26,4 +26,3 @@ kvm_dirty_ring_reap(uint64_t count, int64_t t) "reaped %"PRIu64" pages (took %"P
|
||||
kvm_dirty_ring_reaper_kick(const char *reason) "%s"
|
||||
kvm_dirty_ring_flush(int finished) "%d"
|
||||
|
||||
kvm_slots_grow(unsigned int old, unsigned int new) "%u -> %u"
|
||||
@@ -27,6 +27,7 @@
|
||||
#include "disas/disas.h"
|
||||
#include "exec/exec-all.h"
|
||||
#include "tcg/tcg.h"
|
||||
#include "tcg/tcg-apple-jit.h"
|
||||
#include "qemu/atomic.h"
|
||||
#include "qemu/compiler.h"
|
||||
#include "qemu/timer.h"
|
||||
@@ -186,7 +187,7 @@ static bool tb_lookup_cmp(const void *p, const void *d)
|
||||
const TranslationBlock *tb = p;
|
||||
const struct tb_desc *desc = d;
|
||||
|
||||
if (tb_pc(tb) == desc->pc &&
|
||||
if ((TARGET_TB_PCREL || tb_pc(tb) == desc->pc) &&
|
||||
tb_page_addr0(tb) == desc->page_addr0 &&
|
||||
tb->cs_base == desc->cs_base &&
|
||||
tb->flags == desc->flags &&
|
||||
@@ -238,7 +239,7 @@ static TranslationBlock *tb_htable_lookup(CPUState *cpu, target_ulong pc,
|
||||
return NULL;
|
||||
}
|
||||
desc.page_addr0 = phys_pc;
|
||||
h = tb_hash_func(phys_pc, pc,
|
||||
h = tb_hash_func(phys_pc, (TARGET_TB_PCREL ? 0 : pc),
|
||||
flags, cflags, *cpu->trace_dstate);
|
||||
return qht_lookup_custom(&tb_ctx.htable, &desc, h, tb_lookup_cmp);
|
||||
}
|
||||
|
||||
+1
-1
@@ -1817,7 +1817,7 @@ static void *atomic_mmu_lookup(CPUArchState *env, target_ulong addr,
|
||||
} else /* if (prot & PAGE_READ) */ {
|
||||
tlb_addr = tlbe->addr_read;
|
||||
if (!tlb_hit(tlb_addr, addr)) {
|
||||
if (!VICTIM_TLB_HIT(addr_read, addr)) {
|
||||
if (!VICTIM_TLB_HIT(addr_write, addr)) {
|
||||
tlb_fill(env_cpu(env), addr, size,
|
||||
MMU_DATA_LOAD, mmu_idx, retaddr);
|
||||
index = tlb_index(env, mmu_idx, addr);
|
||||
|
||||
@@ -24,6 +24,7 @@
|
||||
#include "exec/translate-all.h"
|
||||
#include "sysemu/tcg.h"
|
||||
#include "tcg/tcg.h"
|
||||
#include "tcg/tcg-apple-jit.h"
|
||||
#include "tb-hash.h"
|
||||
#include "tb-context.h"
|
||||
#include "internal.h"
|
||||
@@ -34,7 +35,7 @@ static bool tb_cmp(const void *ap, const void *bp)
|
||||
const TranslationBlock *a = ap;
|
||||
const TranslationBlock *b = bp;
|
||||
|
||||
return (tb_pc(a) == tb_pc(b) &&
|
||||
return ((TARGET_TB_PCREL || tb_pc(a) == tb_pc(b)) &&
|
||||
a->cs_base == b->cs_base &&
|
||||
a->flags == b->flags &&
|
||||
(tb_cflags(a) & ~CF_INVALID) == (tb_cflags(b) & ~CF_INVALID) &&
|
||||
@@ -269,7 +270,7 @@ static void do_tb_phys_invalidate(TranslationBlock *tb, bool rm_from_page_list)
|
||||
|
||||
/* remove the TB from the hash list */
|
||||
phys_pc = tb_page_addr0(tb);
|
||||
h = tb_hash_func(phys_pc, tb_pc(tb),
|
||||
h = tb_hash_func(phys_pc, (TARGET_TB_PCREL ? 0 : tb_pc(tb)),
|
||||
tb->flags, orig_cflags, tb->trace_vcpu_dstate);
|
||||
if (!qht_remove(&tb_ctx.htable, tb, h)) {
|
||||
return;
|
||||
@@ -459,7 +460,7 @@ TranslationBlock *tb_link_page(TranslationBlock *tb, tb_page_addr_t phys_pc,
|
||||
}
|
||||
|
||||
/* add in the hash table */
|
||||
h = tb_hash_func(phys_pc, tb_pc(tb),
|
||||
h = tb_hash_func(phys_pc, (TARGET_TB_PCREL ? 0 : tb_pc(tb)),
|
||||
tb->flags, tb->cflags, tb->trace_vcpu_dstate);
|
||||
qht_insert(&tb_ctx.htable, tb, h, &existing_tb);
|
||||
|
||||
|
||||
@@ -100,9 +100,14 @@ static void *mttcg_cpu_thread_fn(void *arg)
|
||||
break;
|
||||
case EXCP_HALTED:
|
||||
/*
|
||||
* Usually cpu->halted is set, but may have already been
|
||||
* reset by another thread by the time we arrive here.
|
||||
* during start-up the vCPU is reset and the thread is
|
||||
* kicked several times. If we don't ensure we go back
|
||||
* to sleep in the halted state we won't cleanly
|
||||
* start-up when the vCPU is enabled.
|
||||
*
|
||||
* cpu->halted should ensure we sleep in wait_io_event
|
||||
*/
|
||||
g_assert(cpu->halted);
|
||||
break;
|
||||
case EXCP_ATOMIC:
|
||||
qemu_mutex_unlock_iothread();
|
||||
|
||||
@@ -47,6 +47,11 @@ void tcg_cpu_init_cflags(CPUState *cpu, bool parallel)
|
||||
uint32_t cflags = cpu->cluster_index << CF_CLUSTER_SHIFT;
|
||||
cflags |= parallel ? CF_PARALLEL : 0;
|
||||
cflags |= icount_enabled() ? CF_USE_ICOUNT : 0;
|
||||
#if defined(CONFIG_TCG_THREADED_INTERPRETER)
|
||||
// GOTO_PTR is too complex to emit a simple gadget for.
|
||||
// We'll let C handle it, since the overhead is similar.
|
||||
cflags |= CF_NO_GOTO_PTR;
|
||||
#endif
|
||||
cpu->tcg_cflags = cflags;
|
||||
}
|
||||
|
||||
|
||||
@@ -24,6 +24,7 @@
|
||||
#include "disas/disas.h"
|
||||
#include "exec/exec-all.h"
|
||||
#include "tcg/tcg.h"
|
||||
#include "tcg/tcg-apple-jit.h"
|
||||
#if defined(CONFIG_USER_ONLY)
|
||||
#include "qemu.h"
|
||||
#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
|
||||
@@ -818,7 +819,9 @@ TranslationBlock *tb_gen_code(CPUState *cpu,
|
||||
|
||||
gen_code_buf = tcg_ctx->code_gen_ptr;
|
||||
tb->tc.ptr = tcg_splitwx_to_rx(gen_code_buf);
|
||||
#if !TARGET_TB_PCREL
|
||||
tb->pc = pc;
|
||||
#endif
|
||||
tb->cs_base = cs_base;
|
||||
tb->flags = flags;
|
||||
tb->cflags = cflags;
|
||||
|
||||
+24
-10
@@ -894,10 +894,6 @@ size_t AUD_read(SWVoiceIn *sw, void *buf, size_t size)
|
||||
|
||||
int AUD_get_buffer_size_out(SWVoiceOut *sw)
|
||||
{
|
||||
if (!sw) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
return sw->hw->samples * sw->hw->info.bytes_per_frame;
|
||||
}
|
||||
|
||||
@@ -1413,12 +1409,21 @@ void audio_run(AudioState *s, const char *msg)
|
||||
#endif
|
||||
}
|
||||
|
||||
void audio_generic_initialize_buffer_in(HWVoiceIn *hw)
|
||||
{
|
||||
if (hw->buf_emul) {
|
||||
g_free(hw->buf_emul);
|
||||
}
|
||||
|
||||
hw->size_emul = hw->samples * hw->info.bytes_per_frame;
|
||||
hw->buf_emul = g_malloc(hw->size_emul);
|
||||
hw->pos_emul = hw->pending_emul = 0;
|
||||
}
|
||||
|
||||
void audio_generic_run_buffer_in(HWVoiceIn *hw)
|
||||
{
|
||||
if (unlikely(!hw->buf_emul)) {
|
||||
hw->size_emul = hw->samples * hw->info.bytes_per_frame;
|
||||
hw->buf_emul = g_malloc(hw->size_emul);
|
||||
hw->pos_emul = hw->pending_emul = 0;
|
||||
audio_generic_initialize_buffer_in(hw);
|
||||
}
|
||||
|
||||
while (hw->pending_emul < hw->size_emul) {
|
||||
@@ -1452,6 +1457,17 @@ void audio_generic_put_buffer_in(HWVoiceIn *hw, void *buf, size_t size)
|
||||
hw->pending_emul -= size;
|
||||
}
|
||||
|
||||
void audio_generic_initialize_buffer_out(HWVoiceOut *hw)
|
||||
{
|
||||
if (hw->buf_emul) {
|
||||
g_free(hw->buf_emul);
|
||||
}
|
||||
|
||||
hw->size_emul = hw->samples * hw->info.bytes_per_frame;
|
||||
hw->buf_emul = g_malloc(hw->size_emul);
|
||||
hw->pos_emul = hw->pending_emul = 0;
|
||||
}
|
||||
|
||||
size_t audio_generic_buffer_get_free(HWVoiceOut *hw)
|
||||
{
|
||||
if (hw->buf_emul) {
|
||||
@@ -1483,9 +1499,7 @@ void audio_generic_run_buffer_out(HWVoiceOut *hw)
|
||||
void *audio_generic_get_buffer_out(HWVoiceOut *hw, size_t *size)
|
||||
{
|
||||
if (unlikely(!hw->buf_emul)) {
|
||||
hw->size_emul = hw->samples * hw->info.bytes_per_frame;
|
||||
hw->buf_emul = g_malloc(hw->size_emul);
|
||||
hw->pos_emul = hw->pending_emul = 0;
|
||||
audio_generic_initialize_buffer_out(hw);
|
||||
}
|
||||
|
||||
*size = MIN(hw->size_emul - hw->pending_emul,
|
||||
|
||||
@@ -190,9 +190,11 @@ struct audio_pcm_ops {
|
||||
void (*volume_in)(HWVoiceIn *hw, Volume *vol);
|
||||
};
|
||||
|
||||
void audio_generic_initialize_buffer_in(HWVoiceIn *hw);
|
||||
void audio_generic_run_buffer_in(HWVoiceIn *hw);
|
||||
void *audio_generic_get_buffer_in(HWVoiceIn *hw, size_t *size);
|
||||
void audio_generic_put_buffer_in(HWVoiceIn *hw, void *buf, size_t size);
|
||||
void audio_generic_initialize_buffer_out(HWVoiceOut *hw);
|
||||
void audio_generic_run_buffer_out(HWVoiceOut *hw);
|
||||
size_t audio_generic_buffer_get_free(HWVoiceOut *hw);
|
||||
void *audio_generic_get_buffer_out(HWVoiceOut *hw, size_t *size);
|
||||
|
||||
+28
-22
@@ -360,7 +360,10 @@ static OSStatus audioDeviceIOProc(
|
||||
static OSStatus init_out_device(coreaudioVoiceOut *core)
|
||||
{
|
||||
OSStatus status;
|
||||
AudioDeviceID deviceID;
|
||||
AudioValueRange frameRange;
|
||||
UInt32 audioDevicePropertyBufferFrameSize;
|
||||
AudioDeviceIOProcID ioprocid;
|
||||
|
||||
AudioStreamBasicDescription streamBasicDescription = {
|
||||
.mBitsPerChannel = core->hw.info.bits,
|
||||
@@ -373,20 +376,19 @@ static OSStatus init_out_device(coreaudioVoiceOut *core)
|
||||
.mSampleRate = core->hw.info.freq
|
||||
};
|
||||
|
||||
status = coreaudio_get_voice(&core->outputDeviceID);
|
||||
status = coreaudio_get_voice(&deviceID);
|
||||
if (status != kAudioHardwareNoError) {
|
||||
coreaudio_playback_logerr (status,
|
||||
"Could not get default output Device\n");
|
||||
return status;
|
||||
}
|
||||
if (core->outputDeviceID == kAudioDeviceUnknown) {
|
||||
if (deviceID == kAudioDeviceUnknown) {
|
||||
dolog ("Could not initialize playback - Unknown Audiodevice\n");
|
||||
return status;
|
||||
}
|
||||
|
||||
/* get minimum and maximum buffer frame sizes */
|
||||
status = coreaudio_get_framesizerange(core->outputDeviceID,
|
||||
&frameRange);
|
||||
status = coreaudio_get_framesizerange(deviceID, &frameRange);
|
||||
if (status == kAudioHardwareBadObjectError) {
|
||||
return 0;
|
||||
}
|
||||
@@ -397,31 +399,31 @@ static OSStatus init_out_device(coreaudioVoiceOut *core)
|
||||
}
|
||||
|
||||
if (frameRange.mMinimum > core->frameSizeSetting) {
|
||||
core->audioDevicePropertyBufferFrameSize = (UInt32) frameRange.mMinimum;
|
||||
audioDevicePropertyBufferFrameSize = (UInt32) frameRange.mMinimum;
|
||||
dolog ("warning: Upsizing Buffer Frames to %f\n", frameRange.mMinimum);
|
||||
} else if (frameRange.mMaximum < core->frameSizeSetting) {
|
||||
core->audioDevicePropertyBufferFrameSize = (UInt32) frameRange.mMaximum;
|
||||
audioDevicePropertyBufferFrameSize = (UInt32) frameRange.mMaximum;
|
||||
dolog ("warning: Downsizing Buffer Frames to %f\n", frameRange.mMaximum);
|
||||
} else {
|
||||
core->audioDevicePropertyBufferFrameSize = core->frameSizeSetting;
|
||||
audioDevicePropertyBufferFrameSize = core->frameSizeSetting;
|
||||
}
|
||||
|
||||
/* set Buffer Frame Size */
|
||||
status = coreaudio_set_framesize(core->outputDeviceID,
|
||||
&core->audioDevicePropertyBufferFrameSize);
|
||||
status = coreaudio_set_framesize(deviceID,
|
||||
&audioDevicePropertyBufferFrameSize);
|
||||
if (status == kAudioHardwareBadObjectError) {
|
||||
return 0;
|
||||
}
|
||||
if (status != kAudioHardwareNoError) {
|
||||
coreaudio_playback_logerr (status,
|
||||
"Could not set device buffer frame size %" PRIu32 "\n",
|
||||
(uint32_t)core->audioDevicePropertyBufferFrameSize);
|
||||
(uint32_t)audioDevicePropertyBufferFrameSize);
|
||||
return status;
|
||||
}
|
||||
|
||||
/* get Buffer Frame Size */
|
||||
status = coreaudio_get_framesize(core->outputDeviceID,
|
||||
&core->audioDevicePropertyBufferFrameSize);
|
||||
status = coreaudio_get_framesize(deviceID,
|
||||
&audioDevicePropertyBufferFrameSize);
|
||||
if (status == kAudioHardwareBadObjectError) {
|
||||
return 0;
|
||||
}
|
||||
@@ -430,11 +432,9 @@ static OSStatus init_out_device(coreaudioVoiceOut *core)
|
||||
"Could not get device buffer frame size\n");
|
||||
return status;
|
||||
}
|
||||
core->hw.samples = core->bufferCount * core->audioDevicePropertyBufferFrameSize;
|
||||
|
||||
/* set Samplerate */
|
||||
status = coreaudio_set_streamformat(core->outputDeviceID,
|
||||
&streamBasicDescription);
|
||||
status = coreaudio_set_streamformat(deviceID, &streamBasicDescription);
|
||||
if (status == kAudioHardwareBadObjectError) {
|
||||
return 0;
|
||||
}
|
||||
@@ -442,7 +442,6 @@ static OSStatus init_out_device(coreaudioVoiceOut *core)
|
||||
coreaudio_playback_logerr (status,
|
||||
"Could not set samplerate %lf\n",
|
||||
streamBasicDescription.mSampleRate);
|
||||
core->outputDeviceID = kAudioDeviceUnknown;
|
||||
return status;
|
||||
}
|
||||
|
||||
@@ -456,20 +455,25 @@ static OSStatus init_out_device(coreaudioVoiceOut *core)
|
||||
* Therefore, the specified callback must be designed to avoid a deadlock
|
||||
* with the callers of AudioObjectGetPropertyData.
|
||||
*/
|
||||
core->ioprocid = NULL;
|
||||
status = AudioDeviceCreateIOProcID(core->outputDeviceID,
|
||||
ioprocid = NULL;
|
||||
status = AudioDeviceCreateIOProcID(deviceID,
|
||||
audioDeviceIOProc,
|
||||
&core->hw,
|
||||
&core->ioprocid);
|
||||
&ioprocid);
|
||||
if (status == kAudioHardwareBadDeviceError) {
|
||||
return 0;
|
||||
}
|
||||
if (status != kAudioHardwareNoError || core->ioprocid == NULL) {
|
||||
if (status != kAudioHardwareNoError || ioprocid == NULL) {
|
||||
coreaudio_playback_logerr (status, "Could not set IOProc\n");
|
||||
core->outputDeviceID = kAudioDeviceUnknown;
|
||||
return status;
|
||||
}
|
||||
|
||||
core->outputDeviceID = deviceID;
|
||||
core->audioDevicePropertyBufferFrameSize = audioDevicePropertyBufferFrameSize;
|
||||
core->hw.samples = core->bufferCount * core->audioDevicePropertyBufferFrameSize;
|
||||
audio_generic_initialize_buffer_out(&core->hw);
|
||||
core->ioprocid = ioprocid;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -553,7 +557,9 @@ static OSStatus handle_voice_change(
|
||||
fini_out_device(core);
|
||||
}
|
||||
|
||||
if (!init_out_device(core)) {
|
||||
init_out_device(core);
|
||||
|
||||
if (core->outputDeviceID) {
|
||||
update_device_playback_state(core);
|
||||
}
|
||||
|
||||
|
||||
+1
-2
@@ -29,8 +29,7 @@ endforeach
|
||||
|
||||
if dbus_display
|
||||
module_ss = ss.source_set()
|
||||
module_ss.add(when: [gio, dbus_display1_dep],
|
||||
if_true: files('dbusaudio.c'))
|
||||
module_ss.add(when: gio, if_true: files('dbusaudio.c'))
|
||||
audio_modules += {'dbus': module_ss}
|
||||
endif
|
||||
|
||||
|
||||
@@ -23,7 +23,6 @@
|
||||
|
||||
#include "qemu/osdep.h"
|
||||
#include "sysemu/cryptodev.h"
|
||||
#include "qemu/error-report.h"
|
||||
#include "qapi/error.h"
|
||||
#include "standard-headers/linux/virtio_crypto.h"
|
||||
#include "crypto/cipher.h"
|
||||
@@ -386,8 +385,8 @@ static int cryptodev_builtin_create_session(
|
||||
case VIRTIO_CRYPTO_HASH_CREATE_SESSION:
|
||||
case VIRTIO_CRYPTO_MAC_CREATE_SESSION:
|
||||
default:
|
||||
error_report("Unsupported opcode :%" PRIu32 "",
|
||||
sess_info->op_code);
|
||||
error_setg(&local_error, "Unsupported opcode :%" PRIu32 "",
|
||||
sess_info->op_code);
|
||||
return -VIRTIO_CRYPTO_NOTSUPP;
|
||||
}
|
||||
|
||||
@@ -417,9 +416,7 @@ static int cryptodev_builtin_close_session(
|
||||
CRYPTODEV_BACKEND_BUILTIN(backend);
|
||||
CryptoDevBackendBuiltinSession *session;
|
||||
|
||||
if (session_id >= MAX_NUM_SESSIONS || !builtin->sessions[session_id]) {
|
||||
return -VIRTIO_CRYPTO_INVSESS;
|
||||
}
|
||||
assert(session_id < MAX_NUM_SESSIONS && builtin->sessions[session_id]);
|
||||
|
||||
session = builtin->sessions[session_id];
|
||||
if (session->cipher) {
|
||||
@@ -547,8 +544,8 @@ static int cryptodev_builtin_operation(
|
||||
|
||||
if (op_info->session_id >= MAX_NUM_SESSIONS ||
|
||||
builtin->sessions[op_info->session_id] == NULL) {
|
||||
error_report("Cannot find a valid session id: %" PRIu64 "",
|
||||
op_info->session_id);
|
||||
error_setg(&local_error, "Cannot find a valid session id: %" PRIu64 "",
|
||||
op_info->session_id);
|
||||
return -VIRTIO_CRYPTO_INVSESS;
|
||||
}
|
||||
|
||||
|
||||
@@ -283,7 +283,8 @@ static int cryptodev_vhost_user_create_session(
|
||||
break;
|
||||
|
||||
default:
|
||||
error_report("Unsupported opcode :%" PRIu32 "", sess_info->op_code);
|
||||
error_setg(&local_error, "Unsupported opcode :%" PRIu32 "",
|
||||
sess_info->op_code);
|
||||
return -VIRTIO_CRYPTO_NOTSUPP;
|
||||
}
|
||||
|
||||
|
||||
@@ -54,7 +54,7 @@ cryptodev_vhost_init(
|
||||
CryptoDevBackendVhost *crypto;
|
||||
Error *local_err = NULL;
|
||||
|
||||
crypto = g_new0(CryptoDevBackendVhost, 1);
|
||||
crypto = g_new(CryptoDevBackendVhost, 1);
|
||||
crypto->dev.max_queues = 1;
|
||||
crypto->dev.nvqs = 1;
|
||||
crypto->dev.vqs = crypto->vqs;
|
||||
|
||||
@@ -112,8 +112,12 @@ static int tpm_util_request(int fd,
|
||||
void *response,
|
||||
size_t responselen)
|
||||
{
|
||||
GPollFD fds[1] = { {.fd = fd, .events = G_IO_IN } };
|
||||
fd_set readfds;
|
||||
int n;
|
||||
struct timeval tv = {
|
||||
.tv_sec = 1,
|
||||
.tv_usec = 0,
|
||||
};
|
||||
|
||||
n = write(fd, request, requestlen);
|
||||
if (n < 0) {
|
||||
@@ -123,8 +127,11 @@ static int tpm_util_request(int fd,
|
||||
return -EFAULT;
|
||||
}
|
||||
|
||||
FD_ZERO(&readfds);
|
||||
FD_SET(fd, &readfds);
|
||||
|
||||
/* wait for a second */
|
||||
TFR(n = g_poll(fds, 1, 1000));
|
||||
n = select(fd + 1, &readfds, NULL, NULL, &tv);
|
||||
if (n != 1) {
|
||||
return -errno;
|
||||
}
|
||||
|
||||
@@ -85,7 +85,6 @@ static BlockDriverState *bdrv_open_inherit(const char *filename,
|
||||
BlockDriverState *parent,
|
||||
const BdrvChildClass *child_class,
|
||||
BdrvChildRole child_role,
|
||||
bool parse_filename,
|
||||
Error **errp);
|
||||
|
||||
static bool bdrv_recurse_has_child(BlockDriverState *bs,
|
||||
@@ -2052,8 +2051,7 @@ static void parse_json_protocol(QDict *options, const char **pfilename,
|
||||
* block driver has been specified explicitly.
|
||||
*/
|
||||
static int bdrv_fill_options(QDict **options, const char *filename,
|
||||
int *flags, bool allow_parse_filename,
|
||||
Error **errp)
|
||||
int *flags, Error **errp)
|
||||
{
|
||||
const char *drvname;
|
||||
bool protocol = *flags & BDRV_O_PROTOCOL;
|
||||
@@ -2095,7 +2093,7 @@ static int bdrv_fill_options(QDict **options, const char *filename,
|
||||
if (protocol && filename) {
|
||||
if (!qdict_haskey(*options, "filename")) {
|
||||
qdict_put_str(*options, "filename", filename);
|
||||
parse_filename = allow_parse_filename;
|
||||
parse_filename = true;
|
||||
} else {
|
||||
error_setg(errp, "Can't specify 'file' and 'filename' options at "
|
||||
"the same time");
|
||||
@@ -3518,8 +3516,7 @@ int bdrv_open_backing_file(BlockDriverState *bs, QDict *parent_options,
|
||||
}
|
||||
|
||||
backing_hd = bdrv_open_inherit(backing_filename, reference, options, 0, bs,
|
||||
&child_of_bds, bdrv_backing_role(bs), true,
|
||||
errp);
|
||||
&child_of_bds, bdrv_backing_role(bs), errp);
|
||||
if (!backing_hd) {
|
||||
bs->open_flags |= BDRV_O_NO_BACKING;
|
||||
error_prepend(errp, "Could not open backing file: ");
|
||||
@@ -3552,8 +3549,7 @@ free_exit:
|
||||
static BlockDriverState *
|
||||
bdrv_open_child_bs(const char *filename, QDict *options, const char *bdref_key,
|
||||
BlockDriverState *parent, const BdrvChildClass *child_class,
|
||||
BdrvChildRole child_role, bool allow_none,
|
||||
bool parse_filename, Error **errp)
|
||||
BdrvChildRole child_role, bool allow_none, Error **errp)
|
||||
{
|
||||
BlockDriverState *bs = NULL;
|
||||
QDict *image_options;
|
||||
@@ -3584,8 +3580,7 @@ bdrv_open_child_bs(const char *filename, QDict *options, const char *bdref_key,
|
||||
}
|
||||
|
||||
bs = bdrv_open_inherit(filename, reference, image_options, 0,
|
||||
parent, child_class, child_role, parse_filename,
|
||||
errp);
|
||||
parent, child_class, child_role, errp);
|
||||
if (!bs) {
|
||||
goto done;
|
||||
}
|
||||
@@ -3595,28 +3590,6 @@ done:
|
||||
return bs;
|
||||
}
|
||||
|
||||
static BdrvChild *bdrv_open_child_common(const char *filename,
|
||||
QDict *options, const char *bdref_key,
|
||||
BlockDriverState *parent,
|
||||
const BdrvChildClass *child_class,
|
||||
BdrvChildRole child_role,
|
||||
bool allow_none, bool parse_filename,
|
||||
Error **errp)
|
||||
{
|
||||
BlockDriverState *bs;
|
||||
|
||||
GLOBAL_STATE_CODE();
|
||||
|
||||
bs = bdrv_open_child_bs(filename, options, bdref_key, parent, child_class,
|
||||
child_role, allow_none, parse_filename, errp);
|
||||
if (bs == NULL) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
return bdrv_attach_child(parent, bs, bdref_key, child_class, child_role,
|
||||
errp);
|
||||
}
|
||||
|
||||
/*
|
||||
* Opens a disk image whose options are given as BlockdevRef in another block
|
||||
* device's options.
|
||||
@@ -3638,9 +3611,18 @@ BdrvChild *bdrv_open_child(const char *filename,
|
||||
BdrvChildRole child_role,
|
||||
bool allow_none, Error **errp)
|
||||
{
|
||||
return bdrv_open_child_common(filename, options, bdref_key, parent,
|
||||
child_class, child_role, allow_none, false,
|
||||
errp);
|
||||
BlockDriverState *bs;
|
||||
|
||||
GLOBAL_STATE_CODE();
|
||||
|
||||
bs = bdrv_open_child_bs(filename, options, bdref_key, parent, child_class,
|
||||
child_role, allow_none, errp);
|
||||
if (bs == NULL) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
return bdrv_attach_child(parent, bs, bdref_key, child_class, child_role,
|
||||
errp);
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -3657,8 +3639,8 @@ int bdrv_open_file_child(const char *filename,
|
||||
role = parent->drv->is_filter ?
|
||||
(BDRV_CHILD_FILTERED | BDRV_CHILD_PRIMARY) : BDRV_CHILD_IMAGE;
|
||||
|
||||
if (!bdrv_open_child_common(filename, options, bdref_key, parent,
|
||||
&child_of_bds, role, false, true, errp))
|
||||
if (!bdrv_open_child(filename, options, bdref_key, parent,
|
||||
&child_of_bds, role, false, errp))
|
||||
{
|
||||
return -EINVAL;
|
||||
}
|
||||
@@ -3703,8 +3685,7 @@ BlockDriverState *bdrv_open_blockdev_ref(BlockdevRef *ref, Error **errp)
|
||||
|
||||
}
|
||||
|
||||
bs = bdrv_open_inherit(NULL, reference, qdict, 0, NULL, NULL, 0, false,
|
||||
errp);
|
||||
bs = bdrv_open_inherit(NULL, reference, qdict, 0, NULL, NULL, 0, errp);
|
||||
obj = NULL;
|
||||
qobject_unref(obj);
|
||||
visit_free(v);
|
||||
@@ -3794,7 +3775,7 @@ static BlockDriverState *bdrv_open_inherit(const char *filename,
|
||||
BlockDriverState *parent,
|
||||
const BdrvChildClass *child_class,
|
||||
BdrvChildRole child_role,
|
||||
bool parse_filename, Error **errp)
|
||||
Error **errp)
|
||||
{
|
||||
int ret;
|
||||
BlockBackend *file = NULL;
|
||||
@@ -3838,11 +3819,9 @@ static BlockDriverState *bdrv_open_inherit(const char *filename,
|
||||
}
|
||||
|
||||
/* json: syntax counts as explicit options, as if in the QDict */
|
||||
if (parse_filename) {
|
||||
parse_json_protocol(options, &filename, &local_err);
|
||||
if (local_err) {
|
||||
goto fail;
|
||||
}
|
||||
parse_json_protocol(options, &filename, &local_err);
|
||||
if (local_err) {
|
||||
goto fail;
|
||||
}
|
||||
|
||||
bs->explicit_options = qdict_clone_shallow(options);
|
||||
@@ -3867,8 +3846,7 @@ static BlockDriverState *bdrv_open_inherit(const char *filename,
|
||||
parent->open_flags, parent->options);
|
||||
}
|
||||
|
||||
ret = bdrv_fill_options(&options, filename, &flags, parse_filename,
|
||||
&local_err);
|
||||
ret = bdrv_fill_options(&options, filename, &flags, &local_err);
|
||||
if (ret < 0) {
|
||||
goto fail;
|
||||
}
|
||||
@@ -3937,7 +3915,7 @@ static BlockDriverState *bdrv_open_inherit(const char *filename,
|
||||
|
||||
file_bs = bdrv_open_child_bs(filename, options, "file", bs,
|
||||
&child_of_bds, BDRV_CHILD_IMAGE,
|
||||
true, true, &local_err);
|
||||
true, &local_err);
|
||||
if (local_err) {
|
||||
goto fail;
|
||||
}
|
||||
@@ -4084,7 +4062,7 @@ BlockDriverState *bdrv_open(const char *filename, const char *reference,
|
||||
GLOBAL_STATE_CODE();
|
||||
|
||||
return bdrv_open_inherit(filename, reference, options, flags, NULL,
|
||||
NULL, 0, true, errp);
|
||||
NULL, 0, errp);
|
||||
}
|
||||
|
||||
/* Return true if the NULL-terminated @list contains @str */
|
||||
|
||||
+3
-5
@@ -74,7 +74,7 @@ typedef struct {
|
||||
CoQueue bounce_available;
|
||||
|
||||
/* The value of the "mem-region-alignment" property */
|
||||
uint64_t mem_region_alignment;
|
||||
size_t mem_region_alignment;
|
||||
|
||||
/* Can we skip adding/deleting blkio_mem_regions? */
|
||||
bool needs_mem_regions;
|
||||
@@ -808,10 +808,8 @@ static int blkio_file_open(BlockDriverState *bs, QDict *options, int flags,
|
||||
}
|
||||
|
||||
bs->supported_write_flags = BDRV_REQ_FUA | BDRV_REQ_REGISTERED_BUF;
|
||||
bs->supported_zero_flags = BDRV_REQ_MAY_UNMAP | BDRV_REQ_NO_FALLBACK;
|
||||
#ifdef CONFIG_BLKIO_WRITE_ZEROS_FUA
|
||||
bs->supported_zero_flags |= BDRV_REQ_FUA;
|
||||
#endif
|
||||
bs->supported_zero_flags = BDRV_REQ_FUA | BDRV_REQ_MAY_UNMAP |
|
||||
BDRV_REQ_NO_FALLBACK;
|
||||
|
||||
qemu_mutex_init(&s->blkio_lock);
|
||||
qemu_co_mutex_init(&s->bounce_lock);
|
||||
|
||||
+8
-25
@@ -321,39 +321,22 @@ typedef struct {
|
||||
static void coroutine_fn blk_log_writes_co_do_log(BlkLogWritesLogReq *lr)
|
||||
{
|
||||
BDRVBlkLogWritesState *s = lr->bs->opaque;
|
||||
|
||||
/*
|
||||
* Determine the offsets and sizes of different parts of the entry, and
|
||||
* update the state of the driver.
|
||||
*
|
||||
* This needs to be done in one go, before any actual I/O is done, as the
|
||||
* log entry may have to be written in two parts, and the state of the
|
||||
* driver may be modified by other driver operations while waiting for the
|
||||
* I/O to complete.
|
||||
*/
|
||||
const uint64_t entry_start_sector = s->cur_log_sector;
|
||||
const uint64_t entry_offset = entry_start_sector << s->sectorbits;
|
||||
const uint64_t qiov_aligned_size = ROUND_UP(lr->qiov->size, s->sectorsize);
|
||||
const uint64_t entry_aligned_size = qiov_aligned_size +
|
||||
ROUND_UP(lr->zero_size, s->sectorsize);
|
||||
const uint64_t entry_nr_sectors = entry_aligned_size >> s->sectorbits;
|
||||
uint64_t cur_log_offset = s->cur_log_sector << s->sectorbits;
|
||||
|
||||
s->nr_entries++;
|
||||
s->cur_log_sector += entry_nr_sectors;
|
||||
s->cur_log_sector +=
|
||||
ROUND_UP(lr->qiov->size, s->sectorsize) >> s->sectorbits;
|
||||
|
||||
/*
|
||||
* Write the log entry. Note that if this is a "write zeroes" operation,
|
||||
* only the entry header is written here, with the zeroing being done
|
||||
* separately below.
|
||||
*/
|
||||
lr->log_ret = bdrv_co_pwritev(s->log_file, entry_offset, lr->qiov->size,
|
||||
lr->log_ret = bdrv_co_pwritev(s->log_file, cur_log_offset, lr->qiov->size,
|
||||
lr->qiov, 0);
|
||||
|
||||
/* Logging for the "write zeroes" operation */
|
||||
if (lr->log_ret == 0 && lr->zero_size) {
|
||||
const uint64_t zeroes_offset = entry_offset + qiov_aligned_size;
|
||||
cur_log_offset = s->cur_log_sector << s->sectorbits;
|
||||
s->cur_log_sector +=
|
||||
ROUND_UP(lr->zero_size, s->sectorsize) >> s->sectorbits;
|
||||
|
||||
lr->log_ret = bdrv_co_pwrite_zeroes(s->log_file, zeroes_offset,
|
||||
lr->log_ret = bdrv_co_pwrite_zeroes(s->log_file, cur_log_offset,
|
||||
lr->zero_size, 0);
|
||||
}
|
||||
|
||||
|
||||
@@ -64,8 +64,7 @@ typedef struct BDRVCopyBeforeWriteState {
|
||||
|
||||
/*
|
||||
* @frozen_read_reqs: current read requests for fleecing user in bs->file
|
||||
* node. These areas must not be rewritten by guest. There can be multiple
|
||||
* overlapping read requests.
|
||||
* node. These areas must not be rewritten by guest.
|
||||
*/
|
||||
BlockReqList frozen_read_reqs;
|
||||
|
||||
|
||||
+12
-39
@@ -37,15 +37,8 @@
|
||||
|
||||
// #define DEBUG_VERBOSE
|
||||
|
||||
/* CURL 7.85.0 switches to a string based API for specifying
|
||||
* the desired protocols.
|
||||
*/
|
||||
#if LIBCURL_VERSION_NUM >= 0x075500
|
||||
#define PROTOCOLS "HTTP,HTTPS,FTP,FTPS"
|
||||
#else
|
||||
#define PROTOCOLS (CURLPROTO_HTTP | CURLPROTO_HTTPS | \
|
||||
CURLPROTO_FTP | CURLPROTO_FTPS)
|
||||
#endif
|
||||
|
||||
#define CURL_NUM_STATES 8
|
||||
#define CURL_NUM_ACB 8
|
||||
@@ -161,9 +154,13 @@ static int curl_timer_cb(CURLM *multi, long timeout_ms, void *opaque)
|
||||
static int curl_sock_cb(CURL *curl, curl_socket_t fd, int action,
|
||||
void *userp, void *sp)
|
||||
{
|
||||
BDRVCURLState *s = userp;
|
||||
BDRVCURLState *s;
|
||||
CURLState *state = NULL;
|
||||
CURLSocket *socket;
|
||||
|
||||
curl_easy_getinfo(curl, CURLINFO_PRIVATE, (char **)&state);
|
||||
s = state->s;
|
||||
|
||||
socket = g_hash_table_lookup(s->sockets, GINT_TO_POINTER(fd));
|
||||
if (!socket) {
|
||||
socket = g_new0(CURLSocket, 1);
|
||||
@@ -512,18 +509,9 @@ static int curl_init_state(BDRVCURLState *s, CURLState *state)
|
||||
* obscure protocols. For example, do not allow POP3/SMTP/IMAP see
|
||||
* CVE-2013-0249.
|
||||
*
|
||||
* Restricting protocols is only supported from 7.19.4 upwards. Note:
|
||||
* version 7.85.0 deprecates CURLOPT_*PROTOCOLS in favour of a string
|
||||
* based CURLOPT_*PROTOCOLS_STR API.
|
||||
* Restricting protocols is only supported from 7.19.4 upwards.
|
||||
*/
|
||||
#if LIBCURL_VERSION_NUM >= 0x075500
|
||||
if (curl_easy_setopt(state->curl,
|
||||
CURLOPT_PROTOCOLS_STR, PROTOCOLS) ||
|
||||
curl_easy_setopt(state->curl,
|
||||
CURLOPT_REDIR_PROTOCOLS_STR, PROTOCOLS)) {
|
||||
goto err;
|
||||
}
|
||||
#elif LIBCURL_VERSION_NUM >= 0x071304
|
||||
#if LIBCURL_VERSION_NUM >= 0x071304
|
||||
if (curl_easy_setopt(state->curl, CURLOPT_PROTOCOLS, PROTOCOLS) ||
|
||||
curl_easy_setopt(state->curl, CURLOPT_REDIR_PROTOCOLS, PROTOCOLS)) {
|
||||
goto err;
|
||||
@@ -608,7 +596,6 @@ static void curl_attach_aio_context(BlockDriverState *bs,
|
||||
assert(!s->multi);
|
||||
s->multi = curl_multi_init();
|
||||
s->aio_context = new_context;
|
||||
curl_multi_setopt(s->multi, CURLMOPT_SOCKETDATA, s);
|
||||
curl_multi_setopt(s->multi, CURLMOPT_SOCKETFUNCTION, curl_sock_cb);
|
||||
curl_multi_setopt(s->multi, CURLMOPT_TIMERDATA, s);
|
||||
curl_multi_setopt(s->multi, CURLMOPT_TIMERFUNCTION, curl_timer_cb);
|
||||
@@ -682,12 +669,7 @@ static int curl_open(BlockDriverState *bs, QDict *options, int flags,
|
||||
const char *file;
|
||||
const char *cookie;
|
||||
const char *cookie_secret;
|
||||
/* CURL >= 7.55.0 uses curl_off_t for content length instead of a double */
|
||||
#if LIBCURL_VERSION_NUM >= 0x073700
|
||||
curl_off_t cl;
|
||||
#else
|
||||
double cl;
|
||||
#endif
|
||||
double d;
|
||||
const char *secretid;
|
||||
const char *protocol_delimiter;
|
||||
int ret;
|
||||
@@ -814,36 +796,27 @@ static int curl_open(BlockDriverState *bs, QDict *options, int flags,
|
||||
}
|
||||
if (curl_easy_perform(state->curl))
|
||||
goto out;
|
||||
/* CURL 7.55.0 deprecates CURLINFO_CONTENT_LENGTH_DOWNLOAD in favour of
|
||||
* the *_T version which returns a more sensible type for content length.
|
||||
*/
|
||||
#if LIBCURL_VERSION_NUM >= 0x073700
|
||||
if (curl_easy_getinfo(state->curl, CURLINFO_CONTENT_LENGTH_DOWNLOAD_T, &cl)) {
|
||||
if (curl_easy_getinfo(state->curl, CURLINFO_CONTENT_LENGTH_DOWNLOAD, &d)) {
|
||||
goto out;
|
||||
}
|
||||
#else
|
||||
if (curl_easy_getinfo(state->curl, CURLINFO_CONTENT_LENGTH_DOWNLOAD, &cl)) {
|
||||
goto out;
|
||||
}
|
||||
#endif
|
||||
/* Prior CURL 7.19.4 return value of 0 could mean that the file size is not
|
||||
* know or the size is zero. From 7.19.4 CURL returns -1 if size is not
|
||||
* known and zero if it is really zero-length file. */
|
||||
#if LIBCURL_VERSION_NUM >= 0x071304
|
||||
if (cl < 0) {
|
||||
if (d < 0) {
|
||||
pstrcpy(state->errmsg, CURL_ERROR_SIZE,
|
||||
"Server didn't report file size.");
|
||||
goto out;
|
||||
}
|
||||
#else
|
||||
if (cl <= 0) {
|
||||
if (d <= 0) {
|
||||
pstrcpy(state->errmsg, CURL_ERROR_SIZE,
|
||||
"Unknown file size or zero-length file.");
|
||||
goto out;
|
||||
}
|
||||
#endif
|
||||
|
||||
s->len = cl;
|
||||
s->len = d;
|
||||
|
||||
if ((!strncasecmp(s->url, "http://", strlen("http://"))
|
||||
|| !strncasecmp(s->url, "https://", strlen("https://")))
|
||||
|
||||
+19
-2
@@ -43,10 +43,10 @@
|
||||
|
||||
#if defined(__APPLE__) && (__MACH__)
|
||||
#include <sys/ioctl.h>
|
||||
#if defined(HAVE_HOST_BLOCK_DEVICE)
|
||||
#include <paths.h>
|
||||
#include <sys/param.h>
|
||||
#include <sys/mount.h>
|
||||
#if defined(HAVE_HOST_BLOCK_DEVICE)
|
||||
#include <paths.h>
|
||||
#include <IOKit/IOKitLib.h>
|
||||
#include <IOKit/IOBSD.h>
|
||||
#include <IOKit/storage/IOMediaBSDClient.h>
|
||||
@@ -130,6 +130,14 @@
|
||||
#define RAW_LOCK_PERM_BASE 100
|
||||
#define RAW_LOCK_SHARED_BASE 200
|
||||
|
||||
/*
|
||||
* qemu_lock_fd_test always returns 0 when fd is not open for writing and
|
||||
* exclusive is true on macOS 11.3.1.
|
||||
*/
|
||||
#ifdef __APPLE__
|
||||
#define RAW_LOCK_WRITES
|
||||
#endif
|
||||
|
||||
typedef struct BDRVRawState {
|
||||
int fd;
|
||||
bool use_lock;
|
||||
@@ -673,7 +681,11 @@ static int raw_open_common(BlockDriverState *bs, QDict *options,
|
||||
false);
|
||||
|
||||
s->open_flags = open_flags;
|
||||
#ifdef RAW_LOCK_WRITES
|
||||
raw_parse_flags(bdrv_flags, &s->open_flags, s->use_lock);
|
||||
#else
|
||||
raw_parse_flags(bdrv_flags, &s->open_flags, false);
|
||||
#endif
|
||||
|
||||
s->fd = -1;
|
||||
fd = qemu_open(filename, s->open_flags, errp);
|
||||
@@ -1038,6 +1050,11 @@ static int raw_reconfigure_getfd(BlockDriverState *bs, int flags,
|
||||
bool has_writers = perm &
|
||||
(BLK_PERM_WRITE | BLK_PERM_WRITE_UNCHANGED | BLK_PERM_RESIZE);
|
||||
int fcntl_flags = O_APPEND | O_NONBLOCK;
|
||||
#ifdef RAW_LOCK_WRITES
|
||||
if (s->use_lock) {
|
||||
has_writers = true;
|
||||
}
|
||||
#endif
|
||||
#ifdef O_NOATIME
|
||||
fcntl_flags |= O_NOATIME;
|
||||
#endif
|
||||
|
||||
-13
@@ -2087,9 +2087,6 @@ static int coroutine_fn bdrv_aligned_pwritev(BdrvChild *child,
|
||||
if (bs->detect_zeroes == BLOCKDEV_DETECT_ZEROES_OPTIONS_UNMAP) {
|
||||
flags |= BDRV_REQ_MAY_UNMAP;
|
||||
}
|
||||
|
||||
/* Can't use optimization hint with bufferless zero write */
|
||||
flags &= ~BDRV_REQ_REGISTERED_BUF;
|
||||
}
|
||||
|
||||
if (ret < 0) {
|
||||
@@ -2595,16 +2592,6 @@ static int coroutine_fn bdrv_co_block_status(BlockDriverState *bs,
|
||||
ret |= (ret2 & BDRV_BLOCK_ZERO);
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Now that the recursive search was done, clear the flag. Otherwise,
|
||||
* with more complicated block graphs like snapshot-access ->
|
||||
* copy-before-write -> qcow2, where the return value will be propagated
|
||||
* further up to a parent bdrv_co_do_block_status() call, both the
|
||||
* BDRV_BLOCK_RECURSE and BDRV_BLOCK_ZERO flags would be set, which is
|
||||
* not allowed.
|
||||
*/
|
||||
ret &= ~BDRV_BLOCK_RECURSE;
|
||||
}
|
||||
|
||||
out:
|
||||
|
||||
@@ -268,7 +268,6 @@ iscsi_co_generic_cb(struct iscsi_context *iscsi, int status,
|
||||
timer_mod(&iTask->retry_timer,
|
||||
qemu_clock_get_ms(QEMU_CLOCK_REALTIME) + retry_time);
|
||||
iTask->do_retry = 1;
|
||||
return;
|
||||
} else if (status == SCSI_STATUS_CHECK_CONDITION) {
|
||||
int error = iscsi_translate_sense(&task->sense);
|
||||
if (error == EAGAIN) {
|
||||
|
||||
@@ -213,17 +213,15 @@ void hmp_commit(Monitor *mon, const QDict *qdict)
|
||||
error_report("Device '%s' not found", device);
|
||||
return;
|
||||
}
|
||||
if (!blk_is_available(blk)) {
|
||||
error_report("Device '%s' has no medium", device);
|
||||
return;
|
||||
}
|
||||
|
||||
bs = bdrv_skip_implicit_filters(blk_bs(blk));
|
||||
aio_context = bdrv_get_aio_context(bs);
|
||||
aio_context_acquire(aio_context);
|
||||
|
||||
if (!blk_is_available(blk)) {
|
||||
error_report("Device '%s' has no medium", device);
|
||||
aio_context_release(aio_context);
|
||||
return;
|
||||
}
|
||||
|
||||
ret = bdrv_commit(bs);
|
||||
|
||||
aio_context_release(aio_context);
|
||||
@@ -413,8 +411,7 @@ void hmp_nbd_server_start(Monitor *mon, const QDict *qdict)
|
||||
goto exit;
|
||||
}
|
||||
|
||||
nbd_server_start(addr, NULL, NULL, NBD_DEFAULT_MAX_CONNECTIONS,
|
||||
&local_err);
|
||||
nbd_server_start(addr, NULL, NULL, 0, &local_err);
|
||||
qapi_free_SocketAddress(addr);
|
||||
if (local_err != NULL) {
|
||||
goto exit;
|
||||
|
||||
+3
-4
@@ -419,10 +419,9 @@ static bool nvme_process_completion(NVMeQueuePair *q)
|
||||
q->cq_phase = !q->cq_phase;
|
||||
}
|
||||
cid = le16_to_cpu(c->cid);
|
||||
if (cid == 0 || cid > NVME_NUM_REQS) {
|
||||
warn_report("NVMe: Unexpected CID in completion queue: %" PRIu32
|
||||
", should be within: 1..%u inclusively", cid,
|
||||
NVME_NUM_REQS);
|
||||
if (cid == 0 || cid > NVME_QUEUE_SIZE) {
|
||||
warn_report("NVMe: Unexpected CID in completion queue: %"PRIu32", "
|
||||
"queue size: %u", cid, NVME_QUEUE_SIZE);
|
||||
continue;
|
||||
}
|
||||
trace_nvme_complete_command(s, q->index, cid);
|
||||
|
||||
@@ -115,7 +115,7 @@ static int update_header_sync(BlockDriverState *bs)
|
||||
return bdrv_flush(bs->file->bs);
|
||||
}
|
||||
|
||||
static inline void bitmap_table_bswap_be(uint64_t *bitmap_table, size_t size)
|
||||
static inline void bitmap_table_to_be(uint64_t *bitmap_table, size_t size)
|
||||
{
|
||||
size_t i;
|
||||
|
||||
@@ -1401,10 +1401,9 @@ static int store_bitmap(BlockDriverState *bs, Qcow2Bitmap *bm, Error **errp)
|
||||
goto fail;
|
||||
}
|
||||
|
||||
bitmap_table_bswap_be(tb, tb_size);
|
||||
bitmap_table_to_be(tb, tb_size);
|
||||
ret = bdrv_pwrite(bs->file, tb_offset, tb_size * sizeof(tb[0]), tb, 0);
|
||||
if (ret < 0) {
|
||||
bitmap_table_bswap_be(tb, tb_size);
|
||||
error_setg_errno(errp, -ret, "Failed to write bitmap '%s' to file",
|
||||
bm_name);
|
||||
goto fail;
|
||||
|
||||
+1
-16
@@ -1614,22 +1614,7 @@ static int coroutine_fn qcow2_do_open(BlockDriverState *bs, QDict *options,
|
||||
goto fail;
|
||||
}
|
||||
|
||||
if (open_data_file && (flags & BDRV_O_NO_IO)) {
|
||||
/*
|
||||
* Don't open the data file for 'qemu-img info' so that it can be used
|
||||
* to verify that an untrusted qcow2 image doesn't refer to external
|
||||
* files.
|
||||
*
|
||||
* Note: This still makes has_data_file() return true.
|
||||
*/
|
||||
if (s->incompatible_features & QCOW2_INCOMPAT_DATA_FILE) {
|
||||
s->data_file = NULL;
|
||||
} else {
|
||||
s->data_file = bs->file;
|
||||
}
|
||||
qdict_extract_subqdict(options, NULL, "data-file.");
|
||||
qdict_del(options, "data-file");
|
||||
} else if (open_data_file) {
|
||||
if (open_data_file) {
|
||||
/* Open external data file */
|
||||
s->data_file = bdrv_open_child(NULL, options, "data-file", bs,
|
||||
&child_of_bds, BDRV_CHILD_DATA,
|
||||
|
||||
@@ -340,7 +340,6 @@ static void bdrv_qed_detach_aio_context(BlockDriverState *bs)
|
||||
|
||||
qed_cancel_need_check_timer(s);
|
||||
timer_free(s->need_check_timer);
|
||||
s->need_check_timer = NULL;
|
||||
}
|
||||
|
||||
static void bdrv_qed_attach_aio_context(BlockDriverState *bs,
|
||||
|
||||
+2
-2
@@ -110,7 +110,7 @@ static int raw_apply_options(BlockDriverState *bs, BDRVRawState *s,
|
||||
if (offset > real_size) {
|
||||
error_setg(errp, "Offset (%" PRIu64 ") cannot be greater than "
|
||||
"size of the containing file (%" PRId64 ")",
|
||||
offset, real_size);
|
||||
s->offset, real_size);
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
@@ -118,7 +118,7 @@ static int raw_apply_options(BlockDriverState *bs, BDRVRawState *s,
|
||||
error_setg(errp, "The sum of offset (%" PRIu64 ") and size "
|
||||
"(%" PRIu64 ") has to be smaller or equal to the "
|
||||
" actual size of the containing file (%" PRId64 ")",
|
||||
offset, size, real_size);
|
||||
s->offset, s->size, real_size);
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
|
||||
@@ -20,6 +20,8 @@
|
||||
void reqlist_init_req(BlockReqList *reqs, BlockReq *req, int64_t offset,
|
||||
int64_t bytes)
|
||||
{
|
||||
assert(!reqlist_find_conflict(reqs, offset, bytes));
|
||||
|
||||
*req = (BlockReq) {
|
||||
.offset = offset,
|
||||
.bytes = bytes,
|
||||
|
||||
+1
-4
@@ -190,10 +190,8 @@ static BlockDriverState *bdrv_snapshot_fallback(BlockDriverState *bs)
|
||||
int bdrv_can_snapshot(BlockDriverState *bs)
|
||||
{
|
||||
BlockDriver *drv = bs->drv;
|
||||
|
||||
GLOBAL_STATE_CODE();
|
||||
|
||||
if (!drv || !bdrv_is_inserted(bs) || !bdrv_is_writable(bs)) {
|
||||
if (!drv || !bdrv_is_inserted(bs) || bdrv_is_read_only(bs)) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -286,7 +284,6 @@ int bdrv_snapshot_goto(BlockDriverState *bs,
|
||||
bdrv_unref_child(bs, fallback);
|
||||
|
||||
ret = bdrv_snapshot_goto(fallback_bs, snapshot_id, errp);
|
||||
memset(bs->opaque, 0, drv->instance_size);
|
||||
open_ret = drv->bdrv_open(bs, options, bs->open_flags, &local_err);
|
||||
qobject_unref(options);
|
||||
if (open_ret < 0) {
|
||||
|
||||
@@ -859,6 +859,9 @@ static int ssh_file_open(BlockDriverState *bs, QDict *options, int bdrv_flags,
|
||||
goto err;
|
||||
}
|
||||
|
||||
/* Go non-blocking. */
|
||||
ssh_set_blocking(s->session, 0);
|
||||
|
||||
if (s->attrs->type == SSH_FILEXFER_TYPE_REGULAR) {
|
||||
bs->supported_truncate_flags = BDRV_REQ_ZERO_WRITE;
|
||||
}
|
||||
|
||||
+1
-1
@@ -980,7 +980,7 @@ static int vhdx_log_write(BlockDriverState *bs, BDRVVHDXState *s,
|
||||
sector_write = merged_sector;
|
||||
} else if (i == sectors - 1 && trailing_length) {
|
||||
/* partial sector at the end of the buffer */
|
||||
ret = bdrv_pread(bs->file, file_offset + trailing_length,
|
||||
ret = bdrv_pread(bs->file, file_offset,
|
||||
VHDX_LOG_SECTOR_SIZE - trailing_length,
|
||||
merged_sector + trailing_length, 0);
|
||||
if (ret < 0) {
|
||||
|
||||
+8
-20
@@ -346,41 +346,29 @@ static int vmdk_write_cid(BlockDriverState *bs, uint32_t cid)
|
||||
BDRVVmdkState *s = bs->opaque;
|
||||
int ret = 0;
|
||||
|
||||
size_t desc_buf_size;
|
||||
|
||||
if (s->desc_offset == 0) {
|
||||
desc_buf_size = bdrv_getlength(bs->file->bs);
|
||||
if (desc_buf_size > 16ULL << 20) {
|
||||
error_report("VMDK description file too big");
|
||||
return -EFBIG;
|
||||
}
|
||||
} else {
|
||||
desc_buf_size = DESC_SIZE;
|
||||
}
|
||||
|
||||
desc = g_malloc0(desc_buf_size);
|
||||
tmp_desc = g_malloc0(desc_buf_size);
|
||||
ret = bdrv_pread(bs->file, s->desc_offset, desc_buf_size, desc, 0);
|
||||
desc = g_malloc0(DESC_SIZE);
|
||||
tmp_desc = g_malloc0(DESC_SIZE);
|
||||
ret = bdrv_pread(bs->file, s->desc_offset, DESC_SIZE, desc, 0);
|
||||
if (ret < 0) {
|
||||
goto out;
|
||||
}
|
||||
|
||||
desc[desc_buf_size - 1] = '\0';
|
||||
desc[DESC_SIZE - 1] = '\0';
|
||||
tmp_str = strstr(desc, "parentCID");
|
||||
if (tmp_str == NULL) {
|
||||
ret = -EINVAL;
|
||||
goto out;
|
||||
}
|
||||
|
||||
pstrcpy(tmp_desc, desc_buf_size, tmp_str);
|
||||
pstrcpy(tmp_desc, DESC_SIZE, tmp_str);
|
||||
p_name = strstr(desc, "CID");
|
||||
if (p_name != NULL) {
|
||||
p_name += sizeof("CID");
|
||||
snprintf(p_name, desc_buf_size - (p_name - desc), "%" PRIx32 "\n", cid);
|
||||
pstrcat(desc, desc_buf_size, tmp_desc);
|
||||
snprintf(p_name, DESC_SIZE - (p_name - desc), "%" PRIx32 "\n", cid);
|
||||
pstrcat(desc, DESC_SIZE, tmp_desc);
|
||||
}
|
||||
|
||||
ret = bdrv_pwrite_sync(bs->file, s->desc_offset, desc_buf_size, desc, 0);
|
||||
ret = bdrv_pwrite_sync(bs->file, s->desc_offset, DESC_SIZE, desc, 0);
|
||||
|
||||
out:
|
||||
g_free(desc);
|
||||
|
||||
+14
-13
@@ -1368,9 +1368,8 @@ static int open_file(BDRVVVFATState* s,mapping_t* mapping)
|
||||
return -1;
|
||||
vvfat_close_current_file(s);
|
||||
s->current_fd = fd;
|
||||
s->current_mapping = mapping;
|
||||
}
|
||||
|
||||
s->current_mapping = mapping;
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -1408,9 +1407,7 @@ read_cluster_directory:
|
||||
|
||||
assert(s->current_fd);
|
||||
|
||||
offset = s->cluster_size *
|
||||
((cluster_num - s->current_mapping->begin)
|
||||
+ s->current_mapping->info.file.offset);
|
||||
offset=s->cluster_size*(cluster_num-s->current_mapping->begin)+s->current_mapping->info.file.offset;
|
||||
if(lseek(s->current_fd, offset, SEEK_SET)!=offset)
|
||||
return -3;
|
||||
s->cluster=s->cluster_buffer;
|
||||
@@ -1880,6 +1877,7 @@ static uint32_t get_cluster_count_for_direntry(BDRVVVFATState* s,
|
||||
|
||||
uint32_t cluster_num = begin_of_direntry(direntry);
|
||||
uint32_t offset = 0;
|
||||
int first_mapping_index = -1;
|
||||
mapping_t* mapping = NULL;
|
||||
const char* basename2 = NULL;
|
||||
|
||||
@@ -1930,9 +1928,8 @@ static uint32_t get_cluster_count_for_direntry(BDRVVVFATState* s,
|
||||
(mapping->mode & MODE_DIRECTORY) == 0) {
|
||||
|
||||
/* was modified in qcow */
|
||||
if (offset != s->cluster_size
|
||||
* ((cluster_num - mapping->begin)
|
||||
+ mapping->info.file.offset)) {
|
||||
if (offset != mapping->info.file.offset + s->cluster_size
|
||||
* (cluster_num - mapping->begin)) {
|
||||
/* offset of this cluster in file chain has changed */
|
||||
abort();
|
||||
copy_it = 1;
|
||||
@@ -1941,9 +1938,14 @@ static uint32_t get_cluster_count_for_direntry(BDRVVVFATState* s,
|
||||
|
||||
if (strcmp(basename, basename2))
|
||||
copy_it = 1;
|
||||
first_mapping_index = array_index(&(s->mapping), mapping);
|
||||
}
|
||||
|
||||
if (mapping->first_mapping_index != first_mapping_index
|
||||
&& mapping->info.file.offset > 0) {
|
||||
abort();
|
||||
copy_it = 1;
|
||||
}
|
||||
assert(mapping->first_mapping_index == -1
|
||||
|| mapping->info.file.offset > 0);
|
||||
|
||||
/* need to write out? */
|
||||
if (!was_modified && is_file(direntry)) {
|
||||
@@ -2400,7 +2402,7 @@ static int commit_mappings(BDRVVVFATState* s,
|
||||
(mapping->end - mapping->begin);
|
||||
} else
|
||||
next_mapping->info.file.offset = mapping->info.file.offset +
|
||||
(mapping->end - mapping->begin);
|
||||
mapping->end - mapping->begin;
|
||||
|
||||
mapping = next_mapping;
|
||||
}
|
||||
@@ -2520,9 +2522,8 @@ static int commit_one_file(BDRVVVFATState* s,
|
||||
return -1;
|
||||
}
|
||||
|
||||
for (i = 0; i < offset; i += s->cluster_size) {
|
||||
for (i = s->cluster_size; i < offset; i += s->cluster_size)
|
||||
c = modified_fat_get(s, c);
|
||||
}
|
||||
|
||||
fd = qemu_open_old(mapping->path, O_RDWR | O_CREAT | O_BINARY, 0666);
|
||||
if (fd < 0) {
|
||||
|
||||
+6
-53
@@ -21,18 +21,12 @@
|
||||
#include "io/channel-socket.h"
|
||||
#include "io/net-listener.h"
|
||||
|
||||
typedef struct NBDConn {
|
||||
QIOChannelSocket *cioc;
|
||||
QLIST_ENTRY(NBDConn) next;
|
||||
} NBDConn;
|
||||
|
||||
typedef struct NBDServerData {
|
||||
QIONetListener *listener;
|
||||
QCryptoTLSCreds *tlscreds;
|
||||
char *tlsauthz;
|
||||
uint32_t max_connections;
|
||||
uint32_t connections;
|
||||
QLIST_HEAD(, NBDConn) conns;
|
||||
} NBDServerData;
|
||||
|
||||
static NBDServerData *nbd_server;
|
||||
@@ -57,14 +51,6 @@ int nbd_server_max_connections(void)
|
||||
|
||||
static void nbd_blockdev_client_closed(NBDClient *client, bool ignored)
|
||||
{
|
||||
NBDConn *conn = nbd_client_owner(client);
|
||||
|
||||
assert(qemu_in_main_thread() && nbd_server);
|
||||
|
||||
object_unref(OBJECT(conn->cioc));
|
||||
QLIST_REMOVE(conn, next);
|
||||
g_free(conn);
|
||||
|
||||
nbd_client_put(client);
|
||||
assert(nbd_server->connections > 0);
|
||||
nbd_server->connections--;
|
||||
@@ -74,56 +60,31 @@ static void nbd_blockdev_client_closed(NBDClient *client, bool ignored)
|
||||
static void nbd_accept(QIONetListener *listener, QIOChannelSocket *cioc,
|
||||
gpointer opaque)
|
||||
{
|
||||
NBDConn *conn = g_new0(NBDConn, 1);
|
||||
|
||||
assert(qemu_in_main_thread() && nbd_server);
|
||||
nbd_server->connections++;
|
||||
object_ref(OBJECT(cioc));
|
||||
conn->cioc = cioc;
|
||||
QLIST_INSERT_HEAD(&nbd_server->conns, conn, next);
|
||||
nbd_update_server_watch(nbd_server);
|
||||
|
||||
qio_channel_set_name(QIO_CHANNEL(cioc), "nbd-server");
|
||||
/* TODO - expose handshake timeout as QMP option */
|
||||
nbd_client_new(cioc, NBD_DEFAULT_HANDSHAKE_MAX_SECS,
|
||||
nbd_server->tlscreds, nbd_server->tlsauthz,
|
||||
nbd_blockdev_client_closed, conn);
|
||||
nbd_client_new(cioc, nbd_server->tlscreds, nbd_server->tlsauthz,
|
||||
nbd_blockdev_client_closed);
|
||||
}
|
||||
|
||||
static void nbd_update_server_watch(NBDServerData *s)
|
||||
{
|
||||
if (s->listener) {
|
||||
if (!s->max_connections || s->connections < s->max_connections) {
|
||||
qio_net_listener_set_client_func(s->listener, nbd_accept, NULL,
|
||||
NULL);
|
||||
} else {
|
||||
qio_net_listener_set_client_func(s->listener, NULL, NULL, NULL);
|
||||
}
|
||||
if (!s->max_connections || s->connections < s->max_connections) {
|
||||
qio_net_listener_set_client_func(s->listener, nbd_accept, NULL, NULL);
|
||||
} else {
|
||||
qio_net_listener_set_client_func(s->listener, NULL, NULL, NULL);
|
||||
}
|
||||
}
|
||||
|
||||
static void nbd_server_free(NBDServerData *server)
|
||||
{
|
||||
NBDConn *conn, *tmp;
|
||||
|
||||
if (!server) {
|
||||
return;
|
||||
}
|
||||
|
||||
/*
|
||||
* Forcefully close the listener socket, and any clients that have
|
||||
* not yet disconnected on their own.
|
||||
*/
|
||||
qio_net_listener_disconnect(server->listener);
|
||||
object_unref(OBJECT(server->listener));
|
||||
server->listener = NULL;
|
||||
QLIST_FOREACH_SAFE(conn, &server->conns, next, tmp) {
|
||||
qio_channel_shutdown(QIO_CHANNEL(conn->cioc), QIO_CHANNEL_SHUTDOWN_BOTH,
|
||||
NULL);
|
||||
}
|
||||
|
||||
AIO_WAIT_WHILE_UNLOCKED(NULL, server->connections > 0);
|
||||
|
||||
if (server->tlscreds) {
|
||||
object_unref(OBJECT(server->tlscreds));
|
||||
}
|
||||
@@ -207,10 +168,6 @@ void nbd_server_start(SocketAddress *addr, const char *tls_creds,
|
||||
|
||||
void nbd_server_start_options(NbdServerOptions *arg, Error **errp)
|
||||
{
|
||||
if (!arg->has_max_connections) {
|
||||
arg->max_connections = NBD_DEFAULT_MAX_CONNECTIONS;
|
||||
}
|
||||
|
||||
nbd_server_start(arg->addr, arg->tls_creds, arg->tls_authz,
|
||||
arg->max_connections, errp);
|
||||
}
|
||||
@@ -223,10 +180,6 @@ void qmp_nbd_server_start(SocketAddressLegacy *addr,
|
||||
{
|
||||
SocketAddress *addr_flat = socket_address_flatten(addr);
|
||||
|
||||
if (!has_max_connections) {
|
||||
max_connections = NBD_DEFAULT_MAX_CONNECTIONS;
|
||||
}
|
||||
|
||||
nbd_server_start(addr_flat, tls_creds, tls_authz, max_connections, errp);
|
||||
qapi_free_SocketAddress(addr_flat);
|
||||
}
|
||||
|
||||
+4
-14
@@ -152,22 +152,12 @@ void blockdev_mark_auto_del(BlockBackend *blk)
|
||||
|
||||
JOB_LOCK_GUARD();
|
||||
|
||||
do {
|
||||
job = block_job_next_locked(NULL);
|
||||
while (job && (job->job.cancelled ||
|
||||
job->job.deferred_to_main_loop ||
|
||||
!block_job_has_bdrv(job, blk_bs(blk))))
|
||||
{
|
||||
job = block_job_next_locked(job);
|
||||
}
|
||||
if (job) {
|
||||
/*
|
||||
* This drops the job lock temporarily and polls, so we need to
|
||||
* restart processing the list from the start after this.
|
||||
*/
|
||||
for (job = block_job_next_locked(NULL); job;
|
||||
job = block_job_next_locked(job)) {
|
||||
if (block_job_has_bdrv(job, blk_bs(blk))) {
|
||||
job_cancel_locked(&job->job, false);
|
||||
}
|
||||
} while (job);
|
||||
}
|
||||
|
||||
dinfo->auto_del = 1;
|
||||
}
|
||||
|
||||
+3
-19
@@ -108,27 +108,11 @@ static void pty_chr_update_read_handler(Chardev *chr)
|
||||
static int char_pty_chr_write(Chardev *chr, const uint8_t *buf, int len)
|
||||
{
|
||||
PtyChardev *s = PTY_CHARDEV(chr);
|
||||
GPollFD pfd;
|
||||
int rc;
|
||||
|
||||
if (s->connected) {
|
||||
return io_channel_send(s->ioc, buf, len);
|
||||
if (!s->connected) {
|
||||
return len;
|
||||
}
|
||||
|
||||
/*
|
||||
* The other side might already be re-connected, but the timer might
|
||||
* not have fired yet. So let's check here whether we can write again:
|
||||
*/
|
||||
pfd.fd = QIO_CHANNEL_FILE(s->ioc)->fd;
|
||||
pfd.events = G_IO_OUT;
|
||||
pfd.revents = 0;
|
||||
TFR(rc = g_poll(&pfd, 1, 0));
|
||||
g_assert(rc >= 0);
|
||||
if (!(pfd.revents & G_IO_HUP) && (pfd.revents & G_IO_OUT)) {
|
||||
io_channel_send(s->ioc, buf, len);
|
||||
}
|
||||
|
||||
return len;
|
||||
return io_channel_send(s->ioc, buf, len);
|
||||
}
|
||||
|
||||
static GSource *pty_chr_add_watch(Chardev *chr, GIOCondition cond)
|
||||
|
||||
@@ -1065,7 +1065,6 @@ static void char_socket_finalize(Object *obj)
|
||||
qio_net_listener_set_client_func_full(s->listener, NULL, NULL,
|
||||
NULL, chr->gcontext);
|
||||
object_unref(OBJECT(s->listener));
|
||||
s->listener = NULL;
|
||||
}
|
||||
if (s->tls_creds) {
|
||||
object_unref(OBJECT(s->tls_creds));
|
||||
|
||||
@@ -41,7 +41,6 @@
|
||||
/* init terminal so that we can grab keys */
|
||||
static struct termios oldtty;
|
||||
static int old_fd0_flags;
|
||||
static int old_fd1_flags;
|
||||
static bool stdio_in_use;
|
||||
static bool stdio_allow_signal;
|
||||
static bool stdio_echo_state;
|
||||
@@ -51,8 +50,6 @@ static void term_exit(void)
|
||||
if (stdio_in_use) {
|
||||
tcsetattr(0, TCSANOW, &oldtty);
|
||||
fcntl(0, F_SETFL, old_fd0_flags);
|
||||
fcntl(1, F_SETFL, old_fd1_flags);
|
||||
stdio_in_use = false;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -105,7 +102,6 @@ static void qemu_chr_open_stdio(Chardev *chr,
|
||||
|
||||
stdio_in_use = true;
|
||||
old_fd0_flags = fcntl(0, F_GETFL);
|
||||
old_fd1_flags = fcntl(1, F_GETFL);
|
||||
tcgetattr(0, &oldtty);
|
||||
if (!g_unix_set_fd_nonblocking(0, true, NULL)) {
|
||||
error_setg_errno(errp, errno, "Failed to set FD nonblocking");
|
||||
|
||||
@@ -33,7 +33,6 @@
|
||||
struct WinStdioChardev {
|
||||
Chardev parent;
|
||||
HANDLE hStdIn;
|
||||
DWORD dwOldMode;
|
||||
HANDLE hInputReadyEvent;
|
||||
HANDLE hInputDoneEvent;
|
||||
HANDLE hInputThread;
|
||||
@@ -160,7 +159,6 @@ static void qemu_chr_open_stdio(Chardev *chr,
|
||||
}
|
||||
|
||||
is_console = GetConsoleMode(stdio->hStdIn, &dwMode) != 0;
|
||||
stdio->dwOldMode = dwMode;
|
||||
|
||||
if (is_console) {
|
||||
if (qemu_add_wait_object(stdio->hStdIn,
|
||||
@@ -223,9 +221,6 @@ static void char_win_stdio_finalize(Object *obj)
|
||||
{
|
||||
WinStdioChardev *stdio = WIN_STDIO_CHARDEV(obj);
|
||||
|
||||
if (stdio->hStdIn != INVALID_HANDLE_VALUE) {
|
||||
SetConsoleMode(stdio->hStdIn, stdio->dwOldMode);
|
||||
}
|
||||
if (stdio->hInputReadyEvent != INVALID_HANDLE_VALUE) {
|
||||
CloseHandle(stdio->hInputReadyEvent);
|
||||
}
|
||||
|
||||
+1
-1
@@ -519,7 +519,7 @@ static const ChardevClass *char_get_class(const char *driver, Error **errp)
|
||||
|
||||
if (object_class_is_abstract(oc)) {
|
||||
error_setg(errp, QERR_INVALID_PARAMETER_VALUE, "driver",
|
||||
"a non-abstract device type");
|
||||
"an abstract device type");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
||||
@@ -69,11 +69,11 @@ safe_syscall_end:
|
||||
|
||||
/* code path setting errno */
|
||||
0: neg a0, a0
|
||||
tail safe_syscall_set_errno_tail
|
||||
j safe_syscall_set_errno_tail
|
||||
|
||||
/* code path when we didn't execute the syscall */
|
||||
2: li a0, QEMU_ERESTARTSYS
|
||||
tail safe_syscall_set_errno_tail
|
||||
j safe_syscall_set_errno_tail
|
||||
|
||||
.cfi_endproc
|
||||
.size safe_syscall_base, .-safe_syscall_base
|
||||
@@ -290,6 +290,7 @@ meson=""
|
||||
ninja=""
|
||||
bindir="bin"
|
||||
skip_meson=no
|
||||
shared_lib="no"
|
||||
vfio_user_server="disabled"
|
||||
|
||||
# The following Meson options are handled manually (still they
|
||||
@@ -896,6 +897,12 @@ for opt do
|
||||
;;
|
||||
--enable-jemalloc) meson_option_parse --enable-malloc=jemalloc jemalloc
|
||||
;;
|
||||
--enable-shared-lib)
|
||||
shared_lib="yes"
|
||||
plugins="no"
|
||||
;;
|
||||
--disable-shared-lib) shared_lib="no"
|
||||
;;
|
||||
# everything else has the same name in configure and meson
|
||||
--*) meson_option_parse "$opt" "$optarg"
|
||||
;;
|
||||
@@ -907,6 +914,10 @@ if test "$plugins" = "yes" -a "$tcg" = "disabled"; then
|
||||
error_exit "Can't enable plugins on non-TCG builds"
|
||||
fi
|
||||
|
||||
if test "$plugins" = "yes" -a "$shared_lib" = "yes"; then
|
||||
error_exit "Can't enable plugins on shared library builds"
|
||||
fi
|
||||
|
||||
case $git_submodules_action in
|
||||
update|validate)
|
||||
if test ! -e "$source_path/.git"; then
|
||||
@@ -1031,7 +1042,7 @@ Advanced options (experts only):
|
||||
--disable-stack-protector disable compiler-provided stack protection
|
||||
--cpu=CPU Build for host CPU [$cpu]
|
||||
--with-coroutine=BACKEND coroutine backend. Supported options:
|
||||
ucontext, sigaltstack, windows
|
||||
ucontext, libucontext, sigaltstack, windows
|
||||
--enable-plugins
|
||||
enable plugins via shared library loading
|
||||
--disable-containers don't use containers for cross-building
|
||||
@@ -1595,12 +1606,26 @@ else
|
||||
error_exit "only the 'windows' coroutine backend is valid for Windows"
|
||||
fi
|
||||
;;
|
||||
libucontext)
|
||||
;;
|
||||
*)
|
||||
error_exit "unknown coroutine backend $coroutine"
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
|
||||
case $coroutine in
|
||||
libucontext)
|
||||
git_submodules="${git_submodules} subprojects/libucontext"
|
||||
coroutine_impl=ucontext
|
||||
libucontext="enabled"
|
||||
;;
|
||||
*)
|
||||
coroutine_impl=$coroutine
|
||||
libucontext="disabled"
|
||||
;;
|
||||
esac
|
||||
|
||||
##################################################
|
||||
# SafeStack
|
||||
|
||||
@@ -2378,7 +2403,7 @@ if [ "$bsd" = "yes" ] ; then
|
||||
echo "CONFIG_BSD=y" >> $config_host_mak
|
||||
fi
|
||||
|
||||
echo "CONFIG_COROUTINE_BACKEND=$coroutine" >> $config_host_mak
|
||||
echo "CONFIG_COROUTINE_BACKEND=$coroutine_impl" >> $config_host_mak
|
||||
|
||||
if test "$have_asan_iface_fiber" = "yes" ; then
|
||||
echo "CONFIG_ASAN_IFACE_FIBER=y" >> $config_host_mak
|
||||
@@ -2392,6 +2417,10 @@ if test "$plugins" = "yes" ; then
|
||||
echo "CONFIG_PLUGIN=y" >> $config_host_mak
|
||||
fi
|
||||
|
||||
if test "$shared_lib" = "yes" ; then
|
||||
echo "CONFIG_SHARED_LIBRARY_BUILD=y" >> $config_host_mak
|
||||
fi
|
||||
|
||||
if test -n "$gdb_bin"; then
|
||||
gdb_version=$($gdb_bin --version | head -n 1)
|
||||
if version_ge ${gdb_version##* } 9.1; then
|
||||
@@ -2416,7 +2445,7 @@ echo "QEMU_OBJCFLAGS=$QEMU_OBJCFLAGS" >> $config_host_mak
|
||||
echo "GLIB_CFLAGS=$glib_cflags" >> $config_host_mak
|
||||
echo "GLIB_LIBS=$glib_libs" >> $config_host_mak
|
||||
echo "GLIB_BINDIR=$glib_bindir" >> $config_host_mak
|
||||
echo "GLIB_VERSION=$($pkg_config --modversion glib-2.0)" >> $config_host_mak
|
||||
echo "GLIB_VERSION=$(pkg-config --modversion glib-2.0)" >> $config_host_mak
|
||||
echo "QEMU_LDFLAGS=$QEMU_LDFLAGS" >> $config_host_mak
|
||||
echo "EXESUF=$EXESUF" >> $config_host_mak
|
||||
|
||||
@@ -2558,7 +2587,11 @@ if test "$skip_meson" = no; then
|
||||
if has $sdl2_config; then
|
||||
echo "sdl2-config = [$(meson_quote $sdl2_config)]" >> $cross
|
||||
fi
|
||||
echo "strip = [$(meson_quote $strip)]" >> $cross
|
||||
if test "$shared_lib" = "yes"; then
|
||||
echo "strip = [$(meson_quote $strip), '-x']" >> $cross
|
||||
else
|
||||
echo "strip = [$(meson_quote $strip)]" >> $cross
|
||||
fi
|
||||
echo "widl = [$(meson_quote $widl)]" >> $cross
|
||||
echo "windres = [$(meson_quote $windres)]" >> $cross
|
||||
if test "$cross_compile" = "yes"; then
|
||||
|
||||
@@ -323,7 +323,7 @@ virgl_cmd_set_scanout(VuGpu *g,
|
||||
struct virtio_gpu_ctrl_command *cmd)
|
||||
{
|
||||
struct virtio_gpu_set_scanout ss;
|
||||
struct virgl_renderer_resource_info info;
|
||||
struct virgl_renderer_texture_info info;
|
||||
int ret;
|
||||
|
||||
VUGPU_FILL_CMD(ss);
|
||||
@@ -338,7 +338,7 @@ virgl_cmd_set_scanout(VuGpu *g,
|
||||
memset(&info, 0, sizeof(info));
|
||||
|
||||
if (ss.resource_id && ss.r.width && ss.r.height) {
|
||||
ret = virgl_renderer_resource_get_info(ss.resource_id, &info);
|
||||
ret = virgl_renderer_borrow_texture_for_scanout(ss.resource_id, &info);
|
||||
if (ret == -1) {
|
||||
g_critical("%s: illegal resource specified %d\n",
|
||||
__func__, ss.resource_id);
|
||||
|
||||
@@ -33,7 +33,7 @@ bool qcrypto_pbkdf2_supports(QCryptoHashAlgorithm hash)
|
||||
case QCRYPTO_HASH_ALG_SHA384:
|
||||
case QCRYPTO_HASH_ALG_SHA512:
|
||||
case QCRYPTO_HASH_ALG_RIPEMD160:
|
||||
return qcrypto_hash_supports(hash);
|
||||
return true;
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -33,7 +33,7 @@ bool qcrypto_pbkdf2_supports(QCryptoHashAlgorithm hash)
|
||||
case QCRYPTO_HASH_ALG_SHA384:
|
||||
case QCRYPTO_HASH_ALG_SHA512:
|
||||
case QCRYPTO_HASH_ALG_RIPEMD160:
|
||||
return qcrypto_hash_supports(hash);
|
||||
return true;
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
|
||||
+7
-46
@@ -19,7 +19,6 @@
|
||||
*/
|
||||
|
||||
#include "qemu/osdep.h"
|
||||
#include "qemu/thread.h"
|
||||
#include "qapi/error.h"
|
||||
#include "crypto/pbkdf.h"
|
||||
#ifndef _WIN32
|
||||
@@ -86,28 +85,12 @@ static int qcrypto_pbkdf2_get_thread_cpu(unsigned long long *val_ms,
|
||||
#endif
|
||||
}
|
||||
|
||||
typedef struct CountItersData {
|
||||
QCryptoHashAlgorithm hash;
|
||||
const uint8_t *key;
|
||||
size_t nkey;
|
||||
const uint8_t *salt;
|
||||
size_t nsalt;
|
||||
size_t nout;
|
||||
uint64_t iterations;
|
||||
Error **errp;
|
||||
} CountItersData;
|
||||
|
||||
static void *threaded_qcrypto_pbkdf2_count_iters(void *data)
|
||||
uint64_t qcrypto_pbkdf2_count_iters(QCryptoHashAlgorithm hash,
|
||||
const uint8_t *key, size_t nkey,
|
||||
const uint8_t *salt, size_t nsalt,
|
||||
size_t nout,
|
||||
Error **errp)
|
||||
{
|
||||
CountItersData *iters_data = (CountItersData *) data;
|
||||
QCryptoHashAlgorithm hash = iters_data->hash;
|
||||
const uint8_t *key = iters_data->key;
|
||||
size_t nkey = iters_data->nkey;
|
||||
const uint8_t *salt = iters_data->salt;
|
||||
size_t nsalt = iters_data->nsalt;
|
||||
size_t nout = iters_data->nout;
|
||||
Error **errp = iters_data->errp;
|
||||
|
||||
uint64_t ret = -1;
|
||||
g_autofree uint8_t *out = g_new(uint8_t, nout);
|
||||
uint64_t iterations = (1 << 15);
|
||||
@@ -131,10 +114,7 @@ static void *threaded_qcrypto_pbkdf2_count_iters(void *data)
|
||||
|
||||
delta_ms = end_ms - start_ms;
|
||||
|
||||
if (delta_ms == 0) { /* sanity check */
|
||||
error_setg(errp, "Unable to get accurate CPU usage");
|
||||
goto cleanup;
|
||||
} else if (delta_ms > 500) {
|
||||
if (delta_ms > 500) {
|
||||
break;
|
||||
} else if (delta_ms < 100) {
|
||||
iterations = iterations * 10;
|
||||
@@ -149,24 +129,5 @@ static void *threaded_qcrypto_pbkdf2_count_iters(void *data)
|
||||
|
||||
cleanup:
|
||||
memset(out, 0, nout);
|
||||
iters_data->iterations = ret;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
uint64_t qcrypto_pbkdf2_count_iters(QCryptoHashAlgorithm hash,
|
||||
const uint8_t *key, size_t nkey,
|
||||
const uint8_t *salt, size_t nsalt,
|
||||
size_t nout,
|
||||
Error **errp)
|
||||
{
|
||||
CountItersData data = {
|
||||
hash, key, nkey, salt, nsalt, nout, 0, errp
|
||||
};
|
||||
QemuThread thread;
|
||||
|
||||
qemu_thread_create(&thread, "pbkdf2", threaded_qcrypto_pbkdf2_count_iters,
|
||||
&data, QEMU_THREAD_JOINABLE);
|
||||
qemu_thread_join(&thread);
|
||||
|
||||
return data.iterations;
|
||||
return ret;
|
||||
}
|
||||
@@ -243,7 +243,6 @@ qcrypto_tls_creds_psk_finalize(Object *obj)
|
||||
QCryptoTLSCredsPSK *creds = QCRYPTO_TLS_CREDS_PSK(obj);
|
||||
|
||||
qcrypto_tls_creds_psk_unload(creds);
|
||||
g_free(creds->username);
|
||||
}
|
||||
|
||||
static void
|
||||
|
||||
@@ -151,6 +151,8 @@ static void initialize_debug_host(CPUDebug *s)
|
||||
#endif
|
||||
#if defined(CONFIG_TCG_INTERPRETER)
|
||||
s->info.print_insn = print_insn_tci;
|
||||
#elif defined(CONFIG_TCG_THREADED_INTERPRETER)
|
||||
s->info.print_insn = print_insn_tcti;
|
||||
#elif defined(__i386__)
|
||||
s->info.mach = bfd_mach_i386_i386;
|
||||
s->info.cap_arch = CS_ARCH_X86;
|
||||
|
||||
+3
-66
@@ -2159,22 +2159,7 @@ static const char *csr_name(int csrno)
|
||||
case 0x0383: return "mibound";
|
||||
case 0x0384: return "mdbase";
|
||||
case 0x0385: return "mdbound";
|
||||
case 0x03a0: return "pmpcfg0";
|
||||
case 0x03a1: return "pmpcfg1";
|
||||
case 0x03a2: return "pmpcfg2";
|
||||
case 0x03a3: return "pmpcfg3";
|
||||
case 0x03a4: return "pmpcfg4";
|
||||
case 0x03a5: return "pmpcfg5";
|
||||
case 0x03a6: return "pmpcfg6";
|
||||
case 0x03a7: return "pmpcfg7";
|
||||
case 0x03a8: return "pmpcfg8";
|
||||
case 0x03a9: return "pmpcfg9";
|
||||
case 0x03aa: return "pmpcfg10";
|
||||
case 0x03ab: return "pmpcfg11";
|
||||
case 0x03ac: return "pmpcfg12";
|
||||
case 0x03ad: return "pmpcfg13";
|
||||
case 0x03ae: return "pmpcfg14";
|
||||
case 0x03af: return "pmpcfg15";
|
||||
case 0x03a0: return "pmpcfg3";
|
||||
case 0x03b0: return "pmpaddr0";
|
||||
case 0x03b1: return "pmpaddr1";
|
||||
case 0x03b2: return "pmpaddr2";
|
||||
@@ -2188,57 +2173,9 @@ static const char *csr_name(int csrno)
|
||||
case 0x03ba: return "pmpaddr10";
|
||||
case 0x03bb: return "pmpaddr11";
|
||||
case 0x03bc: return "pmpaddr12";
|
||||
case 0x03bd: return "pmpaddr13";
|
||||
case 0x03be: return "pmpaddr14";
|
||||
case 0x03bd: return "pmpaddr14";
|
||||
case 0x03be: return "pmpaddr13";
|
||||
case 0x03bf: return "pmpaddr15";
|
||||
case 0x03c0: return "pmpaddr16";
|
||||
case 0x03c1: return "pmpaddr17";
|
||||
case 0x03c2: return "pmpaddr18";
|
||||
case 0x03c3: return "pmpaddr19";
|
||||
case 0x03c4: return "pmpaddr20";
|
||||
case 0x03c5: return "pmpaddr21";
|
||||
case 0x03c6: return "pmpaddr22";
|
||||
case 0x03c7: return "pmpaddr23";
|
||||
case 0x03c8: return "pmpaddr24";
|
||||
case 0x03c9: return "pmpaddr25";
|
||||
case 0x03ca: return "pmpaddr26";
|
||||
case 0x03cb: return "pmpaddr27";
|
||||
case 0x03cc: return "pmpaddr28";
|
||||
case 0x03cd: return "pmpaddr29";
|
||||
case 0x03ce: return "pmpaddr30";
|
||||
case 0x03cf: return "pmpaddr31";
|
||||
case 0x03d0: return "pmpaddr32";
|
||||
case 0x03d1: return "pmpaddr33";
|
||||
case 0x03d2: return "pmpaddr34";
|
||||
case 0x03d3: return "pmpaddr35";
|
||||
case 0x03d4: return "pmpaddr36";
|
||||
case 0x03d5: return "pmpaddr37";
|
||||
case 0x03d6: return "pmpaddr38";
|
||||
case 0x03d7: return "pmpaddr39";
|
||||
case 0x03d8: return "pmpaddr40";
|
||||
case 0x03d9: return "pmpaddr41";
|
||||
case 0x03da: return "pmpaddr42";
|
||||
case 0x03db: return "pmpaddr43";
|
||||
case 0x03dc: return "pmpaddr44";
|
||||
case 0x03dd: return "pmpaddr45";
|
||||
case 0x03de: return "pmpaddr46";
|
||||
case 0x03df: return "pmpaddr47";
|
||||
case 0x03e0: return "pmpaddr48";
|
||||
case 0x03e1: return "pmpaddr49";
|
||||
case 0x03e2: return "pmpaddr50";
|
||||
case 0x03e3: return "pmpaddr51";
|
||||
case 0x03e4: return "pmpaddr52";
|
||||
case 0x03e5: return "pmpaddr53";
|
||||
case 0x03e6: return "pmpaddr54";
|
||||
case 0x03e7: return "pmpaddr55";
|
||||
case 0x03e8: return "pmpaddr56";
|
||||
case 0x03e9: return "pmpaddr57";
|
||||
case 0x03ea: return "pmpaddr58";
|
||||
case 0x03eb: return "pmpaddr59";
|
||||
case 0x03ec: return "pmpaddr60";
|
||||
case 0x03ed: return "pmpaddr61";
|
||||
case 0x03ee: return "pmpaddr62";
|
||||
case 0x03ef: return "pmpaddr63";
|
||||
case 0x0780: return "mtohost";
|
||||
case 0x0781: return "mfromhost";
|
||||
case 0x0782: return "mreset";
|
||||
|
||||
@@ -233,8 +233,8 @@ Use the more generic event ``DEVICE_UNPLUG_GUEST_ERROR`` instead.
|
||||
System emulator machines
|
||||
------------------------
|
||||
|
||||
Arm ``virt`` machine ``dtb-kaslr-seed`` property (since 7.1)
|
||||
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
|
||||
Arm ``virt`` machine ``dtb-kaslr-seed`` property
|
||||
''''''''''''''''''''''''''''''''''''''''''''''''
|
||||
|
||||
The ``dtb-kaslr-seed`` property on the ``virt`` board has been
|
||||
deprecated; use the new name ``dtb-randomness`` instead. The new name
|
||||
|
||||
@@ -8,4 +8,4 @@ QEMU is a trademark of Fabrice Bellard.
|
||||
QEMU is released under the `GNU General Public
|
||||
License <https://www.gnu.org/licenses/gpl-2.0.txt>`__, version 2. Parts
|
||||
of QEMU have specific licenses, see file
|
||||
`LICENSE <https://gitlab.com/qemu-project/qemu/-/raw/master/LICENSE>`__.
|
||||
`LICENSE <https://git.qemu.org/?p=qemu.git;a=blob_plain;f=LICENSE>`__.
|
||||
@@ -702,8 +702,8 @@ reason the maintainers strongly suspected no one actually used it.
|
||||
TCG introspection features
|
||||
--------------------------
|
||||
|
||||
TCG trace-events (removed in 7.0)
|
||||
'''''''''''''''''''''''''''''''''
|
||||
TCG trace-events (since 6.2)
|
||||
''''''''''''''''''''''''''''
|
||||
|
||||
The ability to add new TCG trace points had bit rotted and as the
|
||||
feature can be replicated with TCG plugins it was removed. If
|
||||
|
||||
@@ -193,7 +193,7 @@ Target-dependent emulator sourcesets:
|
||||
Each emulator also includes sources for files in the ``hw/`` and ``target/``
|
||||
subdirectories. The subdirectory used for each emulator comes
|
||||
from the target's definition of ``TARGET_BASE_ARCH`` or (if missing)
|
||||
``TARGET_ARCH``, as found in ``configs/targets/*.mak``.
|
||||
``TARGET_ARCH``, as found in ``default-configs/targets/*.mak``.
|
||||
|
||||
Each subdirectory in ``hw/`` adds one sourceset to the ``hw_arch`` dictionary,
|
||||
for example::
|
||||
@@ -250,8 +250,8 @@ Utility sourcesets:
|
||||
The following files concur in the definition of which files are linked
|
||||
into each emulator:
|
||||
|
||||
``configs/devices/*.mak``
|
||||
The files under ``configs/devices/`` control the boards and devices
|
||||
``default-configs/devices/*.mak``
|
||||
The files under ``default-configs/devices/`` control the boards and devices
|
||||
that are built into each QEMU system emulation targets. They merely contain
|
||||
a list of config variable definitions such as::
|
||||
|
||||
@@ -260,11 +260,11 @@ into each emulator:
|
||||
CONFIG_XLNX_VERSAL=y
|
||||
|
||||
``*/Kconfig``
|
||||
These files are processed together with ``configs/devices/*.mak`` and
|
||||
These files are processed together with ``default-configs/devices/*.mak`` and
|
||||
describe the dependencies between various features, subsystems and
|
||||
device models. They are described in :ref:`kconfig`
|
||||
|
||||
``configs/targets/*.mak``
|
||||
``default-configs/targets/*.mak``
|
||||
These files mostly define symbols that appear in the ``*-config-target.h``
|
||||
file for each emulator [#cfgtarget]_. However, the ``TARGET_ARCH``
|
||||
and ``TARGET_BASE_ARCH`` will also be used to select the ``hw/`` and
|
||||
|
||||
@@ -38,7 +38,7 @@ originated in the Linux kernel, though it was heavily simplified and
|
||||
the handling of dependencies is stricter in QEMU.
|
||||
|
||||
Unlike Linux, there is no user interface to edit the configuration, which
|
||||
is instead specified in per-target files under the ``configs/``
|
||||
is instead specified in per-target files under the ``default-configs/``
|
||||
directory of the QEMU source tree. This is because, unlike Linux,
|
||||
configuration and dependencies can be treated as a black box when building
|
||||
QEMU; the default configuration that QEMU ships with should be okay in
|
||||
@@ -103,7 +103,7 @@ directives can be included:
|
||||
**default value**: ``default <value> [if <expr>]``
|
||||
|
||||
Default values are assigned to the config symbol if no other value was
|
||||
set by the user via ``configs/*.mak`` files, and only if
|
||||
set by the user via ``default-configs/*.mak`` files, and only if
|
||||
``select`` or ``depends on`` directives do not force the value to true
|
||||
or false respectively. ``<value>`` can be ``y`` or ``n``; it cannot
|
||||
be an arbitrary Boolean expression. However, a condition for applying
|
||||
@@ -119,7 +119,7 @@ directives can be included:
|
||||
This is similar to ``select`` as it applies a lower limit of ``y``
|
||||
to another symbol. However, the lower limit is only a default
|
||||
and the "implied" symbol's value may still be set to ``n`` from a
|
||||
``configs/*.mak`` files. The following two examples are
|
||||
``default-configs/*.mak`` files. The following two examples are
|
||||
equivalent::
|
||||
|
||||
config FOO
|
||||
@@ -146,7 +146,7 @@ declares its dependencies in different ways:
|
||||
bool
|
||||
|
||||
Subsystems always default to false (they have no ``default`` directive)
|
||||
and are never visible in ``configs/*.mak`` files. It's
|
||||
and are never visible in ``default-configs/*.mak`` files. It's
|
||||
up to other symbols to ``select`` whatever subsystems they require.
|
||||
|
||||
They sometimes have ``select`` directives to bring in other required
|
||||
@@ -229,7 +229,7 @@ declares its dependencies in different ways:
|
||||
cannot be started at all without it. It should be listed under
|
||||
``imply`` if (depending on the QEMU command line) the board may or
|
||||
may not be started without it. Boards also default to false; they are
|
||||
enabled by the ``configs/*.mak`` for the target they apply to.
|
||||
enabled by the ``default-configs/*.mak`` for the target they apply to.
|
||||
|
||||
**internal elements**
|
||||
|
||||
@@ -241,18 +241,18 @@ declares its dependencies in different ways:
|
||||
|
||||
Internal elements group code that is useful in several boards or
|
||||
devices. They are usually enabled with ``select`` and in turn select
|
||||
other elements; they are never visible in ``configs/*.mak``
|
||||
other elements; they are never visible in ``default-configs/*.mak``
|
||||
files, and often not even in the Makefile.
|
||||
|
||||
Writing and modifying default configurations
|
||||
--------------------------------------------
|
||||
|
||||
In addition to the Kconfig files under hw/, each target also includes
|
||||
a file called ``configs/TARGETNAME-softmmu.mak``. These files
|
||||
a file called ``default-configs/TARGETNAME-softmmu.mak``. These files
|
||||
initialize some Kconfig variables to non-default values and provide the
|
||||
starting point to turn on devices and subsystems.
|
||||
|
||||
A file in ``configs/`` looks like the following example::
|
||||
A file in ``default-configs/`` looks like the following example::
|
||||
|
||||
# Default configuration for alpha-softmmu
|
||||
|
||||
|
||||
@@ -61,7 +61,6 @@ There are several old APIs that use the main loop AioContext:
|
||||
* LEGACY qemu_aio_set_event_notifier() - monitor an event notifier
|
||||
* LEGACY timer_new_ms() - create a timer
|
||||
* LEGACY qemu_bh_new() - create a BH
|
||||
* LEGACY qemu_bh_new_guarded() - create a BH with a device re-entrancy guard
|
||||
* LEGACY qemu_aio_wait() - run an event loop iteration
|
||||
|
||||
Since they implicitly work on the main loop they cannot be used in code that
|
||||
@@ -73,14 +72,8 @@ Instead, use the AioContext functions directly (see include/block/aio.h):
|
||||
* aio_set_event_notifier() - monitor an event notifier
|
||||
* aio_timer_new() - create a timer
|
||||
* aio_bh_new() - create a BH
|
||||
* aio_bh_new_guarded() - create a BH with a device re-entrancy guard
|
||||
* aio_poll() - run an event loop iteration
|
||||
|
||||
The qemu_bh_new_guarded/aio_bh_new_guarded APIs accept a "MemReentrancyGuard"
|
||||
argument, which is used to check for and prevent re-entrancy problems. For
|
||||
BHs associated with devices, the reentrancy-guard is contained in the
|
||||
corresponding DeviceState and named "mem_reentrancy_guard".
|
||||
|
||||
The AioContext can be obtained from the IOThread using
|
||||
iothread_get_aio_context() or for the main loop using qemu_get_aio_context().
|
||||
Code that takes an AioContext argument works both in IOThreads or the main
|
||||
|
||||
@@ -473,12 +473,6 @@ thus some extra preparation steps will be required first
|
||||
the ``libvirt-ci`` submodule to point to a commit that contains
|
||||
the ``mappings.yml`` update.
|
||||
|
||||
For enterprise distros that default to old, end-of-life versions of the
|
||||
Python runtime, QEMU uses a separate set of mappings that work with more
|
||||
recent versions. These can be found in ``tests/lcitool/mappings.yml``.
|
||||
Modifying this file should not be necessary unless the new pre-requisite
|
||||
is a Python library or tool.
|
||||
|
||||
|
||||
Adding new OS distros
|
||||
^^^^^^^^^^^^^^^^^^^^^
|
||||
@@ -996,7 +990,7 @@ class. Here's a simple usage example:
|
||||
self.vm.launch()
|
||||
res = self.vm.command('human-monitor-command',
|
||||
command_line='info version')
|
||||
self.assertRegex(res, r'^(\d+\.\d+\.\d)')
|
||||
self.assertRegexpMatches(res, r'^(\d+\.\d+\.\d)')
|
||||
|
||||
To execute your test, run:
|
||||
|
||||
@@ -1057,7 +1051,7 @@ and hypothetical example follows:
|
||||
'human-monitor-command',
|
||||
command_line='info version')
|
||||
|
||||
self.assertEqual(first_res, second_res, third_res)
|
||||
self.assertEquals(first_res, second_res, third_res)
|
||||
|
||||
At test "tear down", ``avocado_qemu.Test`` handles all the QEMUMachines
|
||||
shutdown.
|
||||
|
||||
@@ -111,9 +111,9 @@ A vring state description
|
||||
A vring address description
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
+-------+-------+------------+------+-----------+-----+
|
||||
| index | flags | descriptor | used | available | log |
|
||||
+-------+-------+------------+------+-----------+-----+
|
||||
+-------+-------+------+------------+------+-----------+-----+
|
||||
| index | flags | size | descriptor | used | available | log |
|
||||
+-------+-------+------+------------+------+-----------+-----+
|
||||
|
||||
:index: a 32-bit vring index
|
||||
|
||||
|
||||
@@ -117,13 +117,13 @@ to support the multiple thread compression migration:
|
||||
{qemu} migrate_set_capability compress on
|
||||
|
||||
3. Set the compression thread count on source:
|
||||
{qemu} migrate_set_parameter compress-threads 12
|
||||
{qemu} migrate_set_parameter compress_threads 12
|
||||
|
||||
4. Set the compression level on the source:
|
||||
{qemu} migrate_set_parameter compress-level 1
|
||||
{qemu} migrate_set_parameter compress_level 1
|
||||
|
||||
5. Set the decompression thread count on destination:
|
||||
{qemu} migrate_set_parameter decompress-threads 3
|
||||
{qemu} migrate_set_parameter decompress_threads 3
|
||||
|
||||
6. Start outgoing migration:
|
||||
{qemu} migrate -d tcp:destination.host:4444
|
||||
@@ -133,9 +133,9 @@ to support the multiple thread compression migration:
|
||||
|
||||
The following are the default settings:
|
||||
compress: off
|
||||
compress-threads: 8
|
||||
decompress-threads: 2
|
||||
compress-level: 1 (which means best speed)
|
||||
compress_threads: 8
|
||||
decompress_threads: 2
|
||||
compress_level: 1 (which means best speed)
|
||||
|
||||
So, only the first two steps are required to use the multiple
|
||||
thread compression in migration. You can do more if the default
|
||||
|
||||
+1
-1
@@ -89,7 +89,7 @@ RUNNING:
|
||||
First, set the migration speed to match your hardware's capabilities:
|
||||
|
||||
QEMU Monitor Command:
|
||||
$ migrate_set_parameter max-bandwidth 40g # or whatever is the MAX of your RDMA device
|
||||
$ migrate_set_parameter max_bandwidth 40g # or whatever is the MAX of your RDMA device
|
||||
|
||||
Next, on the destination machine, add the following to the QEMU command line:
|
||||
|
||||
|
||||
@@ -1,2 +0,0 @@
|
||||
sphinx==5.3.0
|
||||
sphinx_rtd_theme==1.1.1
|
||||
@@ -19,7 +19,7 @@ __version__ = '1.0'
|
||||
|
||||
def get_infiles(env):
|
||||
for x in env.found_docs:
|
||||
yield str(env.doc2path(x))
|
||||
yield env.doc2path(x)
|
||||
yield from ((os.path.join(env.srcdir, dep)
|
||||
for dep in env.dependencies[x]))
|
||||
for mod in sys.modules.values():
|
||||
|
||||
@@ -1,9 +1,8 @@
|
||||
During the graphical emulation, you can use special key combinations from
|
||||
the following table to change modes. By default the modifier is Ctrl-Alt
|
||||
(used in the table below) which can be changed with ``-display`` suboption
|
||||
``mod=`` where appropriate. For example, ``-display sdl,
|
||||
grab-mod=lshift-lctrl-lalt`` changes the modifier key to Ctrl-Alt-Shift,
|
||||
while ``-display sdl,grab-mod=rctrl`` changes it to the right Ctrl key.
|
||||
During the graphical emulation, you can use special key combinations to
|
||||
change modes. The default key mappings are shown below, but if you use
|
||||
``-alt-grab`` then the modifier is Ctrl-Alt-Shift (instead of Ctrl-Alt)
|
||||
and if you use ``-ctrl-grab`` then the modifier is the right Ctrl key
|
||||
(instead of Ctrl-Alt):
|
||||
|
||||
Ctrl-Alt-f
|
||||
Toggle full screen
|
||||
@@ -29,7 +28,7 @@ Ctrl-Alt-n
|
||||
*3*
|
||||
Serial port
|
||||
|
||||
Ctrl-Alt-g
|
||||
Ctrl-Alt
|
||||
Toggle mouse and keyboard grab.
|
||||
|
||||
In the virtual consoles, you can use Ctrl-Up, Ctrl-Down, Ctrl-PageUp and
|
||||
|
||||
@@ -2,7 +2,7 @@ Multi-process QEMU
|
||||
==================
|
||||
|
||||
This document describes how to configure and use multi-process qemu.
|
||||
For the design document refer to docs/devel/multi-process.rst.
|
||||
For the design document refer to docs/devel/qemu-multiprocess.
|
||||
|
||||
1) Configuration
|
||||
----------------
|
||||
|
||||
+2
-2
@@ -1298,8 +1298,8 @@ static bool get_next_page(GuestPhysBlock **blockptr, uint64_t *pfnptr,
|
||||
|
||||
memcpy(buf + addr % page_size, hbuf, n);
|
||||
addr += n;
|
||||
if (addr % page_size == 0 || addr >= block->target_end) {
|
||||
/* we filled up the page or the current block is finished */
|
||||
if (addr % page_size == 0) {
|
||||
/* we filled up the page */
|
||||
break;
|
||||
}
|
||||
} else {
|
||||
|
||||
+1
-1
@@ -5135,7 +5135,7 @@ float32 float32_exp2(float32 a, float_status *status)
|
||||
float64_unpack_canonical(&rp, float64_one, status);
|
||||
for (i = 0 ; i < 15 ; i++) {
|
||||
float64_unpack_canonical(&tp, float32_exp2_coefficients[i], status);
|
||||
rp = *parts_muladd(&tp, &xnp, &rp, 0, status);
|
||||
rp = *parts_muladd(&tp, &xp, &rp, 0, status);
|
||||
xnp = *parts_mul(&xnp, &xp, status);
|
||||
}
|
||||
|
||||
|
||||
@@ -26,7 +26,6 @@
|
||||
#include "qemu/xattr.h"
|
||||
#include "9p-iov-marshal.h"
|
||||
#include "hw/9pfs/9p-proxy.h"
|
||||
#include "hw/9pfs/9p-util.h"
|
||||
#include "fsdev/9p-iov-marshal.h"
|
||||
|
||||
#define PROGNAME "virtfs-proxy-helper"
|
||||
@@ -339,28 +338,6 @@ static void resetugid(int suid, int sgid)
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Open regular file or directory. Attempts to open any special file are
|
||||
* rejected.
|
||||
*
|
||||
* returns file descriptor or -1 on error
|
||||
*/
|
||||
static int open_regular(const char *pathname, int flags, mode_t mode)
|
||||
{
|
||||
int fd;
|
||||
|
||||
fd = open(pathname, flags, mode);
|
||||
if (fd < 0) {
|
||||
return fd;
|
||||
}
|
||||
|
||||
if (close_if_special_file(fd) < 0) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
return fd;
|
||||
}
|
||||
|
||||
/*
|
||||
* send response in two parts
|
||||
* 1) ProxyHeader
|
||||
@@ -705,7 +682,7 @@ static int do_create(struct iovec *iovec)
|
||||
if (ret < 0) {
|
||||
goto unmarshal_err_out;
|
||||
}
|
||||
ret = open_regular(path.data, flags, mode);
|
||||
ret = open(path.data, flags, mode);
|
||||
if (ret < 0) {
|
||||
ret = -errno;
|
||||
}
|
||||
@@ -730,7 +707,7 @@ static int do_open(struct iovec *iovec)
|
||||
if (ret < 0) {
|
||||
goto err_out;
|
||||
}
|
||||
ret = open_regular(path.data, flags, 0);
|
||||
ret = open(path.data, flags);
|
||||
if (ret < 0) {
|
||||
ret = -errno;
|
||||
}
|
||||
|
||||
@@ -13,8 +13,6 @@
|
||||
#ifndef QEMU_9P_UTIL_H
|
||||
#define QEMU_9P_UTIL_H
|
||||
|
||||
#include "qemu/error-report.h"
|
||||
|
||||
#ifdef O_PATH
|
||||
#define O_PATH_9P_UTIL O_PATH
|
||||
#else
|
||||
@@ -114,38 +112,6 @@ static inline void close_preserve_errno(int fd)
|
||||
errno = serrno;
|
||||
}
|
||||
|
||||
/**
|
||||
* close_if_special_file() - Close @fd if neither regular file nor directory.
|
||||
*
|
||||
* @fd: file descriptor of open file
|
||||
* Return: 0 on regular file or directory, -1 otherwise
|
||||
*
|
||||
* CVE-2023-2861: Prohibit opening any special file directly on host
|
||||
* (especially device files), as a compromised client could potentially gain
|
||||
* access outside exported tree under certain, unsafe setups. We expect
|
||||
* client to handle I/O on special files exclusively on guest side.
|
||||
*/
|
||||
static inline int close_if_special_file(int fd)
|
||||
{
|
||||
struct stat stbuf;
|
||||
|
||||
if (fstat(fd, &stbuf) < 0) {
|
||||
close_preserve_errno(fd);
|
||||
return -1;
|
||||
}
|
||||
if (!S_ISREG(stbuf.st_mode) && !S_ISDIR(stbuf.st_mode)) {
|
||||
error_report_once(
|
||||
"9p: broken or compromised client detected; attempt to open "
|
||||
"special file (i.e. neither regular file, nor directory)"
|
||||
);
|
||||
close(fd);
|
||||
errno = ENXIO;
|
||||
return -1;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static inline int openat_dir(int dirfd, const char *name)
|
||||
{
|
||||
return openat(dirfd, name,
|
||||
@@ -180,10 +146,6 @@ again:
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (close_if_special_file(fd) < 0) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
serrno = errno;
|
||||
/* O_NONBLOCK was only needed to open the file. Let's drop it. We don't
|
||||
* do that with O_PATH since fcntl(F_SETFL) isn't supported, and openat()
|
||||
|
||||
+14
-42
@@ -440,24 +440,16 @@ void coroutine_fn v9fs_reclaim_fd(V9fsPDU *pdu)
|
||||
V9fsFidState *f;
|
||||
GHashTableIter iter;
|
||||
gpointer fid;
|
||||
int err;
|
||||
int nclosed = 0;
|
||||
|
||||
/* prevent multiple coroutines running this function simultaniously */
|
||||
if (s->reclaiming) {
|
||||
return;
|
||||
}
|
||||
s->reclaiming = true;
|
||||
|
||||
g_hash_table_iter_init(&iter, s->fids);
|
||||
|
||||
QSLIST_HEAD(, V9fsFidState) reclaim_list =
|
||||
QSLIST_HEAD_INITIALIZER(reclaim_list);
|
||||
|
||||
/* Pick FIDs to be closed, collect them on reclaim_list. */
|
||||
while (g_hash_table_iter_next(&iter, &fid, (gpointer *) &f)) {
|
||||
/*
|
||||
* Unlinked fids cannot be reclaimed, skip those, and also skip fids
|
||||
* Unlink fids cannot be reclaimed. Check
|
||||
* for them and skip them. Also skip fids
|
||||
* currently being operated on.
|
||||
*/
|
||||
if (f->ref || f->flags & FID_NON_RECLAIMABLE) {
|
||||
@@ -507,34 +499,23 @@ void coroutine_fn v9fs_reclaim_fd(V9fsPDU *pdu)
|
||||
}
|
||||
}
|
||||
/*
|
||||
* Close the picked FIDs altogether on a background I/O driver thread. Do
|
||||
* this all at once to keep latency (i.e. amount of thread hops between main
|
||||
* thread <-> fs driver background thread) as low as possible.
|
||||
* Now close the fid in reclaim list. Free them if they
|
||||
* are already clunked.
|
||||
*/
|
||||
v9fs_co_run_in_worker({
|
||||
QSLIST_FOREACH(f, &reclaim_list, reclaim_next) {
|
||||
err = (f->fid_type == P9_FID_DIR) ?
|
||||
s->ops->closedir(&s->ctx, &f->fs_reclaim) :
|
||||
s->ops->close(&s->ctx, &f->fs_reclaim);
|
||||
if (!err) {
|
||||
/* total_open_fd must only be mutated on main thread */
|
||||
nclosed++;
|
||||
}
|
||||
}
|
||||
});
|
||||
total_open_fd -= nclosed;
|
||||
/* Free the closed FIDs. */
|
||||
while (!QSLIST_EMPTY(&reclaim_list)) {
|
||||
f = QSLIST_FIRST(&reclaim_list);
|
||||
QSLIST_REMOVE(&reclaim_list, f, V9fsFidState, reclaim_next);
|
||||
if (f->fid_type == P9_FID_FILE) {
|
||||
v9fs_co_close(pdu, &f->fs_reclaim);
|
||||
} else if (f->fid_type == P9_FID_DIR) {
|
||||
v9fs_co_closedir(pdu, &f->fs_reclaim);
|
||||
}
|
||||
/*
|
||||
* Now drop the fid reference, free it
|
||||
* if clunked.
|
||||
*/
|
||||
put_fid(pdu, f);
|
||||
}
|
||||
|
||||
s->reclaiming = false;
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -1624,13 +1605,11 @@ static void coroutine_fn v9fs_getattr(void *opaque)
|
||||
retval = -ENOENT;
|
||||
goto out_nofid;
|
||||
}
|
||||
if ((fidp->fid_type == P9_FID_FILE && fidp->fs.fd != -1) ||
|
||||
(fidp->fid_type == P9_FID_DIR && fidp->fs.dir.stream))
|
||||
{
|
||||
retval = v9fs_co_fstat(pdu, fidp, &stbuf);
|
||||
} else {
|
||||
retval = v9fs_co_lstat(pdu, &fidp->path, &stbuf);
|
||||
}
|
||||
/*
|
||||
* Currently we only support BASIC fields in stat, so there is no
|
||||
* need to look at request_mask.
|
||||
*/
|
||||
retval = v9fs_co_lstat(pdu, &fidp->path, &stbuf);
|
||||
if (retval < 0) {
|
||||
goto out;
|
||||
}
|
||||
@@ -2617,11 +2596,6 @@ static void coroutine_fn v9fs_readdir(void *opaque)
|
||||
retval = -EINVAL;
|
||||
goto out_nofid;
|
||||
}
|
||||
if (fidp->fid_type != P9_FID_DIR) {
|
||||
warn_report_once("9p: bad client: T_readdir on non-directory stream");
|
||||
retval = -ENOTDIR;
|
||||
goto out;
|
||||
}
|
||||
if (!fidp->fs.dir.stream) {
|
||||
retval = -EINVAL;
|
||||
goto out;
|
||||
@@ -4319,8 +4293,6 @@ int v9fs_device_realize_common(V9fsState *s, const V9fsTransport *t,
|
||||
s->ctx.fst = &fse->fst;
|
||||
fsdev_throttle_init(s->ctx.fst);
|
||||
|
||||
s->reclaiming = false;
|
||||
|
||||
rc = 0;
|
||||
out:
|
||||
if (rc) {
|
||||
|
||||
@@ -363,7 +363,6 @@ struct V9fsState {
|
||||
uint64_t qp_ndevices; /* Amount of entries in qpd_table. */
|
||||
uint16_t qp_affix_next;
|
||||
uint64_t qp_fullpath_next;
|
||||
bool reclaiming;
|
||||
};
|
||||
|
||||
/* 9p2000.L open flags */
|
||||
|
||||
@@ -48,9 +48,3 @@ v9fs_readlink(uint16_t tag, uint8_t id, int32_t fid) "tag %d id %d fid %d"
|
||||
v9fs_readlink_return(uint16_t tag, uint8_t id, char* target) "tag %d id %d name %s"
|
||||
v9fs_setattr(uint16_t tag, uint8_t id, int32_t fid, int32_t valid, int32_t mode, int32_t uid, int32_t gid, int64_t size, int64_t atime_sec, int64_t mtime_sec) "tag %u id %u fid %d iattr={valid %d mode %d uid %d gid %d size %"PRId64" atime=%"PRId64" mtime=%"PRId64" }"
|
||||
v9fs_setattr_return(uint16_t tag, uint8_t id) "tag %u id %u"
|
||||
|
||||
# xen-9p-backend.c
|
||||
xen_9pfs_alloc(char *name) "name %s"
|
||||
xen_9pfs_connect(char *name) "name %s"
|
||||
xen_9pfs_disconnect(char *name) "name %s"
|
||||
xen_9pfs_free(char *name) "name %s"
|
||||
+14
-26
@@ -24,8 +24,6 @@
|
||||
#include "qemu/option.h"
|
||||
#include "fsdev/qemu-fsdev.h"
|
||||
|
||||
#include "trace.h"
|
||||
|
||||
#define VERSIONS "1"
|
||||
#define MAX_RINGS 8
|
||||
#define MAX_RING_ORDER 9
|
||||
@@ -62,7 +60,6 @@ typedef struct Xen9pfsDev {
|
||||
|
||||
int num_rings;
|
||||
Xen9pfsRing *rings;
|
||||
MemReentrancyGuard mem_reentrancy_guard;
|
||||
} Xen9pfsDev;
|
||||
|
||||
static void xen_9pfs_disconnect(struct XenLegacyDevice *xendev);
|
||||
@@ -338,8 +335,6 @@ static void xen_9pfs_disconnect(struct XenLegacyDevice *xendev)
|
||||
Xen9pfsDev *xen_9pdev = container_of(xendev, Xen9pfsDev, xendev);
|
||||
int i;
|
||||
|
||||
trace_xen_9pfs_disconnect(xendev->name);
|
||||
|
||||
for (i = 0; i < xen_9pdev->num_rings; i++) {
|
||||
if (xen_9pdev->rings[i].evtchndev != NULL) {
|
||||
qemu_set_fd_handler(xenevtchn_fd(xen_9pdev->rings[i].evtchndev),
|
||||
@@ -348,40 +343,39 @@ static void xen_9pfs_disconnect(struct XenLegacyDevice *xendev)
|
||||
xen_9pdev->rings[i].local_port);
|
||||
xen_9pdev->rings[i].evtchndev = NULL;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static int xen_9pfs_free(struct XenLegacyDevice *xendev)
|
||||
{
|
||||
Xen9pfsDev *xen_9pdev = container_of(xendev, Xen9pfsDev, xendev);
|
||||
int i;
|
||||
|
||||
if (xen_9pdev->rings[0].evtchndev != NULL) {
|
||||
xen_9pfs_disconnect(xendev);
|
||||
}
|
||||
|
||||
for (i = 0; i < xen_9pdev->num_rings; i++) {
|
||||
if (xen_9pdev->rings[i].data != NULL) {
|
||||
xen_be_unmap_grant_refs(&xen_9pdev->xendev,
|
||||
xen_9pdev->rings[i].data,
|
||||
(1 << xen_9pdev->rings[i].ring_order));
|
||||
xen_9pdev->rings[i].data = NULL;
|
||||
}
|
||||
if (xen_9pdev->rings[i].intf != NULL) {
|
||||
xen_be_unmap_grant_refs(&xen_9pdev->xendev,
|
||||
xen_9pdev->rings[i].intf,
|
||||
1);
|
||||
xen_9pdev->rings[i].intf = NULL;
|
||||
}
|
||||
if (xen_9pdev->rings[i].bh != NULL) {
|
||||
qemu_bh_delete(xen_9pdev->rings[i].bh);
|
||||
xen_9pdev->rings[i].bh = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
g_free(xen_9pdev->id);
|
||||
xen_9pdev->id = NULL;
|
||||
g_free(xen_9pdev->tag);
|
||||
xen_9pdev->tag = NULL;
|
||||
g_free(xen_9pdev->path);
|
||||
xen_9pdev->path = NULL;
|
||||
g_free(xen_9pdev->security_model);
|
||||
xen_9pdev->security_model = NULL;
|
||||
g_free(xen_9pdev->rings);
|
||||
xen_9pdev->rings = NULL;
|
||||
}
|
||||
|
||||
static int xen_9pfs_free(struct XenLegacyDevice *xendev)
|
||||
{
|
||||
trace_xen_9pfs_free(xendev->name);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -393,8 +387,6 @@ static int xen_9pfs_connect(struct XenLegacyDevice *xendev)
|
||||
V9fsState *s = &xen_9pdev->state;
|
||||
QemuOpts *fsdev;
|
||||
|
||||
trace_xen_9pfs_connect(xendev->name);
|
||||
|
||||
if (xenstore_read_fe_int(&xen_9pdev->xendev, "num-rings",
|
||||
&xen_9pdev->num_rings) == -1 ||
|
||||
xen_9pdev->num_rings > MAX_RINGS || xen_9pdev->num_rings < 1) {
|
||||
@@ -449,9 +441,7 @@ static int xen_9pfs_connect(struct XenLegacyDevice *xendev)
|
||||
xen_9pdev->rings[i].ring.out = xen_9pdev->rings[i].data +
|
||||
XEN_FLEX_RING_SIZE(ring_order);
|
||||
|
||||
xen_9pdev->rings[i].bh = qemu_bh_new_guarded(xen_9pfs_bh,
|
||||
&xen_9pdev->rings[i],
|
||||
&xen_9pdev->mem_reentrancy_guard);
|
||||
xen_9pdev->rings[i].bh = qemu_bh_new(xen_9pfs_bh, &xen_9pdev->rings[i]);
|
||||
xen_9pdev->rings[i].out_cons = 0;
|
||||
xen_9pdev->rings[i].out_size = 0;
|
||||
xen_9pdev->rings[i].inprogress = false;
|
||||
@@ -504,8 +494,6 @@ out:
|
||||
|
||||
static void xen_9pfs_alloc(struct XenLegacyDevice *xendev)
|
||||
{
|
||||
trace_xen_9pfs_alloc(xendev->name);
|
||||
|
||||
xenstore_write_be_str(xendev, "versions", VERSIONS);
|
||||
xenstore_write_be_int(xendev, "max-rings", MAX_RINGS);
|
||||
xenstore_write_be_int(xendev, "max-ring-page-order", MAX_RING_ORDER);
|
||||
|
||||
@@ -52,9 +52,6 @@ static const MemoryRegionOps AcpiCpuHotplug_ops = {
|
||||
.endianness = DEVICE_LITTLE_ENDIAN,
|
||||
.valid = {
|
||||
.min_access_size = 1,
|
||||
.max_access_size = 4,
|
||||
},
|
||||
.impl = {
|
||||
.max_access_size = 1,
|
||||
},
|
||||
};
|
||||
|
||||
@@ -947,7 +947,6 @@ static const VMStateDescription erst_vmstate = {
|
||||
|
||||
static void erst_realizefn(PCIDevice *pci_dev, Error **errp)
|
||||
{
|
||||
ERRP_GUARD();
|
||||
ERSTDeviceState *s = ACPIERST(pci_dev);
|
||||
|
||||
trace_acpi_erst_realizefn_in();
|
||||
@@ -965,15 +964,9 @@ static void erst_realizefn(PCIDevice *pci_dev, Error **errp)
|
||||
|
||||
/* HostMemoryBackend size will be multiple of PAGE_SIZE */
|
||||
s->storage_size = object_property_get_int(OBJECT(s->hostmem), "size", errp);
|
||||
if (*errp) {
|
||||
return;
|
||||
}
|
||||
|
||||
/* Initialize backend storage and record_count */
|
||||
check_erst_backend_storage(s, errp);
|
||||
if (*errp) {
|
||||
return;
|
||||
}
|
||||
|
||||
/* BAR 0: Programming registers */
|
||||
memory_region_init_io(&s->iomem_mr, OBJECT(pci_dev), &erst_reg_ops, s,
|
||||
@@ -984,9 +977,6 @@ static void erst_realizefn(PCIDevice *pci_dev, Error **errp)
|
||||
memory_region_init_ram(&s->exchange_mr, OBJECT(pci_dev),
|
||||
"erst.exchange",
|
||||
le32_to_cpu(s->header->record_size), errp);
|
||||
if (*errp) {
|
||||
return;
|
||||
}
|
||||
pci_register_bar(pci_dev, 1, PCI_BASE_ADDRESS_SPACE_MEMORY,
|
||||
&s->exchange_mr);
|
||||
|
||||
|
||||
Loaded 100 of 794 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user