Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
ee29e78fce | ||
|
|
6807403eed | ||
|
|
f0654b8d91 | ||
|
|
0408443ecb | ||
|
|
35eb3e49a7 | ||
|
|
7e3a2a0ee6 | ||
|
|
149bc216f2 | ||
|
|
df3768b1a4 | ||
|
|
9804d797b9 | ||
|
|
3d7fa1b3e2 | ||
|
|
0b27d262d1 | ||
|
|
ece3cc28df | ||
|
|
c57fe3ac66 | ||
|
|
e4213c3dcb | ||
|
|
bd650df6f7 | ||
|
|
ca5d7bb952 | ||
|
|
b07ff6d447 | ||
|
|
c53db9c66d | ||
|
|
6ce9033339 | ||
|
|
afb890bf17 | ||
|
|
f48ba9b085 | ||
|
|
6f62fc9ff3 | ||
|
|
61687b3b43 | ||
|
|
082940a5a1 | ||
|
|
9aca1a84de | ||
|
|
81ca6c2c9b | ||
|
|
b73e3712a3 | ||
|
|
e08fbea661 | ||
|
|
eed21e9574 | ||
|
|
c6fe98fe79 | ||
|
|
07f686009f | ||
|
|
f417712ef1 | ||
|
|
9abcd968e7 | ||
|
|
ddc13a3c42 | ||
|
|
5ec422a958 | ||
|
|
659835d24b | ||
|
|
e6000bd7c7 | ||
|
|
76b96c053f | ||
|
|
2b8be9cffb | ||
|
|
41e052fc05 | ||
|
|
2e3e5138d6 | ||
|
|
a004dfabea | ||
|
|
9a005e30f5 | ||
|
|
e00c9b4758 | ||
|
|
39a0961d0a | ||
|
|
f7b46e82ce | ||
|
|
a0823c2766 | ||
|
|
51cc8762a0 | ||
|
|
6ea6863f21 | ||
|
|
861fca8ce0 | ||
|
|
c6fe0f315c | ||
|
|
ab4a60c1b7 | ||
|
|
3f481e3305 | ||
|
|
4741ae6b8e | ||
|
|
2429cb7a9f | ||
|
|
f3130798d4 | ||
|
|
cd7beea4a4 | ||
|
|
734314d8ce | ||
|
|
9b7bc39890 | ||
|
|
8394be7faa | ||
|
|
9ca7801c6a | ||
|
|
caeb4489b7 | ||
|
|
d5c41e4491 | ||
|
|
7aaf5f7778 | ||
|
|
e7c2df3fd7 | ||
|
|
6d37a30815 | ||
|
|
e070e5e674 | ||
|
|
d6e7ec1f8e | ||
|
|
b198998b7f | ||
|
|
fd01f5a847 | ||
|
|
227d9450b5 | ||
|
|
393b7ab067 | ||
|
|
eebb7fb506 | ||
|
|
6fca92c9d1 | ||
|
|
162c54b7c1 | ||
|
|
493b1cc785 | ||
|
|
70b0e142e6 | ||
|
|
2e1645ac6a | ||
|
|
610db167da | ||
|
|
e9e41446c2 | ||
|
|
a6fc9a234b | ||
|
|
ad003650d5 | ||
|
|
6332f3c12f | ||
|
|
e4b23890b3 | ||
|
|
9405029750 | ||
|
|
4f048b771d | ||
|
|
dcb9a64d22 | ||
|
|
e1e9d74f57 | ||
|
|
04b3d34d5c | ||
|
|
309051ac40 | ||
|
|
3f7892be24 | ||
|
|
e00b062da7 | ||
|
|
0b7ccfd1d2 | ||
|
|
6a5d6849d1 | ||
|
|
424e6209e5 | ||
|
|
5c3889be15 | ||
|
|
201c9701f5 | ||
|
|
edb47553b0 | ||
|
|
df052d6c1c | ||
|
|
f1efd85486 | ||
|
|
eeb5699176 | ||
|
|
275436de62 | ||
|
|
c57a6fca39 | ||
|
|
e55ec34d3e | ||
|
|
ce252563f2 | ||
|
|
518c3dfdfb | ||
|
|
13cf40e594 | ||
|
|
4002b76c1c | ||
|
|
331c0fa584 | ||
|
|
aba89ef725 |
+13
-21
@@ -162,9 +162,9 @@ crash-test-fedora:
|
||||
build-system-centos:
|
||||
extends: .native_build_job_template
|
||||
needs:
|
||||
job: amd64-centos8-container
|
||||
job: amd64-centos9-container
|
||||
variables:
|
||||
IMAGE: centos8
|
||||
IMAGE: centos9
|
||||
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: centos8
|
||||
IMAGE: centos9
|
||||
MAKE_CHECK_ARGS: check
|
||||
|
||||
avocado-system-centos:
|
||||
@@ -191,7 +191,7 @@ avocado-system-centos:
|
||||
- job: build-system-centos
|
||||
artifacts: true
|
||||
variables:
|
||||
IMAGE: centos8
|
||||
IMAGE: centos9
|
||||
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-centos8-container
|
||||
job: amd64-centos9-container
|
||||
variables:
|
||||
IMAGE: centos8
|
||||
IMAGE: centos9
|
||||
script:
|
||||
- mkdir build
|
||||
- cd build
|
||||
@@ -469,7 +469,6 @@ 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:
|
||||
@@ -560,29 +559,22 @@ build-coroutine-sigaltstack:
|
||||
MAKE_CHECK_ARGS: check-unit
|
||||
|
||||
# Check our reduced build configurations
|
||||
build-without-default-devices:
|
||||
build-without-defaults:
|
||||
extends: .native_build_job_template
|
||||
needs:
|
||||
job: amd64-centos8-container
|
||||
job: amd64-centos9-container
|
||||
variables:
|
||||
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
|
||||
IMAGE: centos9
|
||||
CONFIGURE_ARGS:
|
||||
--without-default-devices
|
||||
--without-default-features
|
||||
--disable-capstone
|
||||
--disable-fdt
|
||||
--disable-pie
|
||||
--disable-qom-cast-debug
|
||||
--disable-strip
|
||||
TARGETS: avr-softmmu i386-softmmu mips64-softmmu s390x-softmmu sh4-softmmu
|
||||
TARGETS: avr-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 SPEED=slow
|
||||
MAKE_CHECK_ARGS: check-unit check-qtest-avr check-qtest-mips64
|
||||
|
||||
build-libvhost-user:
|
||||
extends: .base_job_template
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
.cirrus_build_job:
|
||||
extends: .base_job_template
|
||||
stage: build
|
||||
image: registry.gitlab.com/libvirt/libvirt-ci/cirrus-run:master
|
||||
image: registry.gitlab.com/libvirt/libvirt-ci/cirrus-run:latest
|
||||
needs: []
|
||||
timeout: 80m
|
||||
allow_failure: true
|
||||
@@ -63,11 +63,12 @@ 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-1
|
||||
CIRRUS_VM_IMAGE_NAME: freebsd-13-3
|
||||
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:
|
||||
@@ -83,6 +84,7 @@ 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
|
||||
|
||||
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
include:
|
||||
- local: '/.gitlab-ci.d/container-template.yml'
|
||||
|
||||
amd64-centos8-container:
|
||||
amd64-centos9-container:
|
||||
extends: .container_job_template
|
||||
variables:
|
||||
NAME: centos8
|
||||
NAME: centos9
|
||||
|
||||
amd64-fedora-container:
|
||||
extends: .container_job_template
|
||||
|
||||
@@ -115,6 +115,7 @@ 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,85 +0,0 @@
|
||||
# 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
|
||||
@@ -1,27 +0,0 @@
|
||||
#
|
||||
# Docker image to cross-compile EDK2 firmware binaries
|
||||
#
|
||||
FROM ubuntu:18.04
|
||||
|
||||
MAINTAINER Philippe Mathieu-Daudé <f4bug@amsat.org>
|
||||
|
||||
# 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:19.03.1
|
||||
image: docker:stable
|
||||
services:
|
||||
- docker:19.03.1-dind
|
||||
- docker:stable-dind
|
||||
variables:
|
||||
GIT_DEPTH: 3
|
||||
IMAGE_TAG: $CI_REGISTRY_IMAGE:opensbi-cross-build
|
||||
|
||||
@@ -15,6 +15,7 @@ RUN apt update \
|
||||
ca-certificates \
|
||||
git \
|
||||
make \
|
||||
python3 \
|
||||
wget \
|
||||
&& \
|
||||
\
|
||||
|
||||
@@ -4,7 +4,6 @@
|
||||
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'
|
||||
|
||||
@@ -1,9 +1,7 @@
|
||||
.shared_msys2_builder:
|
||||
extends: .base_job_template
|
||||
tags:
|
||||
- shared-windows
|
||||
- windows
|
||||
- windows-1809
|
||||
- saas-windows-medium-amd64
|
||||
cache:
|
||||
key: "${CI_JOB_NAME}-cache"
|
||||
paths:
|
||||
|
||||
@@ -3257,8 +3257,6 @@ 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 <mst@redhat.com>
|
||||
|
||||
@@ -23,6 +23,7 @@
|
||||
|
||||
#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"
|
||||
@@ -385,8 +386,8 @@ static int cryptodev_builtin_create_session(
|
||||
case VIRTIO_CRYPTO_HASH_CREATE_SESSION:
|
||||
case VIRTIO_CRYPTO_MAC_CREATE_SESSION:
|
||||
default:
|
||||
error_setg(&local_error, "Unsupported opcode :%" PRIu32 "",
|
||||
sess_info->op_code);
|
||||
error_report("Unsupported opcode :%" PRIu32 "",
|
||||
sess_info->op_code);
|
||||
return -VIRTIO_CRYPTO_NOTSUPP;
|
||||
}
|
||||
|
||||
@@ -416,7 +417,9 @@ static int cryptodev_builtin_close_session(
|
||||
CRYPTODEV_BACKEND_BUILTIN(backend);
|
||||
CryptoDevBackendBuiltinSession *session;
|
||||
|
||||
assert(session_id < MAX_NUM_SESSIONS && builtin->sessions[session_id]);
|
||||
if (session_id >= MAX_NUM_SESSIONS || !builtin->sessions[session_id]) {
|
||||
return -VIRTIO_CRYPTO_INVSESS;
|
||||
}
|
||||
|
||||
session = builtin->sessions[session_id];
|
||||
if (session->cipher) {
|
||||
@@ -544,8 +547,8 @@ static int cryptodev_builtin_operation(
|
||||
|
||||
if (op_info->session_id >= MAX_NUM_SESSIONS ||
|
||||
builtin->sessions[op_info->session_id] == NULL) {
|
||||
error_setg(&local_error, "Cannot find a valid session id: %" PRIu64 "",
|
||||
op_info->session_id);
|
||||
error_report("Cannot find a valid session id: %" PRIu64 "",
|
||||
op_info->session_id);
|
||||
return -VIRTIO_CRYPTO_INVSESS;
|
||||
}
|
||||
|
||||
|
||||
@@ -85,6 +85,7 @@ 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,
|
||||
@@ -2051,7 +2052,8 @@ 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, Error **errp)
|
||||
int *flags, bool allow_parse_filename,
|
||||
Error **errp)
|
||||
{
|
||||
const char *drvname;
|
||||
bool protocol = *flags & BDRV_O_PROTOCOL;
|
||||
@@ -2093,7 +2095,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 = true;
|
||||
parse_filename = allow_parse_filename;
|
||||
} else {
|
||||
error_setg(errp, "Can't specify 'file' and 'filename' options at "
|
||||
"the same time");
|
||||
@@ -3516,7 +3518,8 @@ 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), errp);
|
||||
&child_of_bds, bdrv_backing_role(bs), true,
|
||||
errp);
|
||||
if (!backing_hd) {
|
||||
bs->open_flags |= BDRV_O_NO_BACKING;
|
||||
error_prepend(errp, "Could not open backing file: ");
|
||||
@@ -3549,7 +3552,8 @@ 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, Error **errp)
|
||||
BdrvChildRole child_role, bool allow_none,
|
||||
bool parse_filename, Error **errp)
|
||||
{
|
||||
BlockDriverState *bs = NULL;
|
||||
QDict *image_options;
|
||||
@@ -3580,7 +3584,8 @@ 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, errp);
|
||||
parent, child_class, child_role, parse_filename,
|
||||
errp);
|
||||
if (!bs) {
|
||||
goto done;
|
||||
}
|
||||
@@ -3590,6 +3595,28 @@ 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.
|
||||
@@ -3611,18 +3638,9 @@ BdrvChild *bdrv_open_child(const char *filename,
|
||||
BdrvChildRole child_role,
|
||||
bool allow_none, Error **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);
|
||||
return bdrv_open_child_common(filename, options, bdref_key, parent,
|
||||
child_class, child_role, allow_none, false,
|
||||
errp);
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -3639,8 +3657,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(filename, options, bdref_key, parent,
|
||||
&child_of_bds, role, false, errp))
|
||||
if (!bdrv_open_child_common(filename, options, bdref_key, parent,
|
||||
&child_of_bds, role, false, true, errp))
|
||||
{
|
||||
return -EINVAL;
|
||||
}
|
||||
@@ -3685,7 +3703,8 @@ BlockDriverState *bdrv_open_blockdev_ref(BlockdevRef *ref, Error **errp)
|
||||
|
||||
}
|
||||
|
||||
bs = bdrv_open_inherit(NULL, reference, qdict, 0, NULL, NULL, 0, errp);
|
||||
bs = bdrv_open_inherit(NULL, reference, qdict, 0, NULL, NULL, 0, false,
|
||||
errp);
|
||||
obj = NULL;
|
||||
qobject_unref(obj);
|
||||
visit_free(v);
|
||||
@@ -3775,7 +3794,7 @@ static BlockDriverState *bdrv_open_inherit(const char *filename,
|
||||
BlockDriverState *parent,
|
||||
const BdrvChildClass *child_class,
|
||||
BdrvChildRole child_role,
|
||||
Error **errp)
|
||||
bool parse_filename, Error **errp)
|
||||
{
|
||||
int ret;
|
||||
BlockBackend *file = NULL;
|
||||
@@ -3819,9 +3838,11 @@ static BlockDriverState *bdrv_open_inherit(const char *filename,
|
||||
}
|
||||
|
||||
/* json: syntax counts as explicit options, as if in the QDict */
|
||||
parse_json_protocol(options, &filename, &local_err);
|
||||
if (local_err) {
|
||||
goto fail;
|
||||
if (parse_filename) {
|
||||
parse_json_protocol(options, &filename, &local_err);
|
||||
if (local_err) {
|
||||
goto fail;
|
||||
}
|
||||
}
|
||||
|
||||
bs->explicit_options = qdict_clone_shallow(options);
|
||||
@@ -3846,7 +3867,8 @@ static BlockDriverState *bdrv_open_inherit(const char *filename,
|
||||
parent->open_flags, parent->options);
|
||||
}
|
||||
|
||||
ret = bdrv_fill_options(&options, filename, &flags, &local_err);
|
||||
ret = bdrv_fill_options(&options, filename, &flags, parse_filename,
|
||||
&local_err);
|
||||
if (ret < 0) {
|
||||
goto fail;
|
||||
}
|
||||
@@ -3915,7 +3937,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, &local_err);
|
||||
true, true, &local_err);
|
||||
if (local_err) {
|
||||
goto fail;
|
||||
}
|
||||
@@ -4062,7 +4084,7 @@ BlockDriverState *bdrv_open(const char *filename, const char *reference,
|
||||
GLOBAL_STATE_CODE();
|
||||
|
||||
return bdrv_open_inherit(filename, reference, options, flags, NULL,
|
||||
NULL, 0, errp);
|
||||
NULL, 0, true, errp);
|
||||
}
|
||||
|
||||
/* Return true if the NULL-terminated @list contains @str */
|
||||
|
||||
+16
-1
@@ -1614,7 +1614,22 @@ static int coroutine_fn qcow2_do_open(BlockDriverState *bs, QDict *options,
|
||||
goto fail;
|
||||
}
|
||||
|
||||
if (open_data_file) {
|
||||
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) {
|
||||
/* Open external data file */
|
||||
s->data_file = bdrv_open_child(NULL, options, "data-file", bs,
|
||||
&child_of_bds, BDRV_CHILD_DATA,
|
||||
|
||||
@@ -41,6 +41,7 @@
|
||||
/* 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;
|
||||
@@ -50,6 +51,8 @@ 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;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -102,6 +105,7 @@ 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");
|
||||
|
||||
+64
-1
@@ -2159,7 +2159,22 @@ static const char *csr_name(int csrno)
|
||||
case 0x0383: return "mibound";
|
||||
case 0x0384: return "mdbase";
|
||||
case 0x0385: return "mdbound";
|
||||
case 0x03a0: return "pmpcfg3";
|
||||
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 0x03b0: return "pmpaddr0";
|
||||
case 0x03b1: return "pmpaddr1";
|
||||
case 0x03b2: return "pmpaddr2";
|
||||
@@ -2176,6 +2191,54 @@ static const char *csr_name(int csrno)
|
||||
case 0x03bd: return "pmpaddr13";
|
||||
case 0x03be: return "pmpaddr14";
|
||||
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";
|
||||
|
||||
@@ -473,6 +473,12 @@ 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
|
||||
^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
+5
-1
@@ -77,6 +77,7 @@ static void build_hmat_lb(GArray *table_data, HMAT_LB_Info *hmat_lb,
|
||||
uint32_t *initiator_list)
|
||||
{
|
||||
int i, index;
|
||||
uint32_t initiator_to_index[MAX_NODES] = {};
|
||||
HMAT_LB_Data *lb_data;
|
||||
uint16_t *entry_list;
|
||||
uint32_t base;
|
||||
@@ -120,6 +121,8 @@ static void build_hmat_lb(GArray *table_data, HMAT_LB_Info *hmat_lb,
|
||||
/* Initiator Proximity Domain List */
|
||||
for (i = 0; i < num_initiator; i++) {
|
||||
build_append_int_noprefix(table_data, initiator_list[i], 4);
|
||||
/* Reverse mapping for array possitions */
|
||||
initiator_to_index[initiator_list[i]] = i;
|
||||
}
|
||||
|
||||
/* Target Proximity Domain List */
|
||||
@@ -131,7 +134,8 @@ static void build_hmat_lb(GArray *table_data, HMAT_LB_Info *hmat_lb,
|
||||
entry_list = g_new0(uint16_t, num_initiator * num_target);
|
||||
for (i = 0; i < hmat_lb->list->len; i++) {
|
||||
lb_data = &g_array_index(hmat_lb->list, HMAT_LB_Data, i);
|
||||
index = lb_data->initiator * num_target + lb_data->target;
|
||||
index = initiator_to_index[lb_data->initiator] * num_target +
|
||||
lb_data->target;
|
||||
|
||||
entry_list[index] = (uint16_t)(lb_data->data / hmat_lb->base);
|
||||
}
|
||||
|
||||
+2
-1
@@ -24,6 +24,7 @@
|
||||
#include "hw/qdev-clock.h"
|
||||
#include "hw/qdev-properties.h"
|
||||
#include "qapi/error.h"
|
||||
#include "qemu/bswap.h"
|
||||
#include "qemu/units.h"
|
||||
#include "sysemu/sysemu.h"
|
||||
|
||||
@@ -369,7 +370,7 @@ static void npcm7xx_init_fuses(NPCM7xxState *s)
|
||||
* The initial mask of disabled modules indicates the chip derivative (e.g.
|
||||
* NPCM750 or NPCM730).
|
||||
*/
|
||||
value = tswap32(nc->disabled_modules);
|
||||
value = cpu_to_le32(nc->disabled_modules);
|
||||
npcm7xx_otp_array_write(&s->fuse_array, &value, NPCM7XX_FUSE_DERIVATIVE,
|
||||
sizeof(value));
|
||||
}
|
||||
|
||||
+38
-17
@@ -84,7 +84,11 @@ struct NANDFlashState {
|
||||
|
||||
void (*blk_write)(NANDFlashState *s);
|
||||
void (*blk_erase)(NANDFlashState *s);
|
||||
void (*blk_load)(NANDFlashState *s, uint64_t addr, int offset);
|
||||
/*
|
||||
* Returns %true when block containing (@addr + @offset) is
|
||||
* successfully loaded, otherwise %false.
|
||||
*/
|
||||
bool (*blk_load)(NANDFlashState *s, uint64_t addr, unsigned offset);
|
||||
|
||||
uint32_t ioaddr_vmstate;
|
||||
};
|
||||
@@ -243,9 +247,30 @@ static inline void nand_pushio_byte(NANDFlashState *s, uint8_t value)
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* nand_load_block: Load block containing (s->addr + @offset).
|
||||
* Returns length of data available at @offset in this block.
|
||||
*/
|
||||
static unsigned nand_load_block(NANDFlashState *s, unsigned offset)
|
||||
{
|
||||
unsigned iolen;
|
||||
|
||||
if (!s->blk_load(s, s->addr, offset)) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
iolen = (1 << s->page_shift);
|
||||
if (s->gnd) {
|
||||
iolen += 1 << s->oob_shift;
|
||||
}
|
||||
assert(offset <= iolen);
|
||||
iolen -= offset;
|
||||
|
||||
return iolen;
|
||||
}
|
||||
|
||||
static void nand_command(NANDFlashState *s)
|
||||
{
|
||||
unsigned int offset;
|
||||
switch (s->cmd) {
|
||||
case NAND_CMD_READ0:
|
||||
s->iolen = 0;
|
||||
@@ -271,12 +296,7 @@ static void nand_command(NANDFlashState *s)
|
||||
case NAND_CMD_NOSERIALREAD2:
|
||||
if (!(nand_flash_ids[s->chip_id].options & NAND_SAMSUNG_LP))
|
||||
break;
|
||||
offset = s->addr & ((1 << s->addr_shift) - 1);
|
||||
s->blk_load(s, s->addr, offset);
|
||||
if (s->gnd)
|
||||
s->iolen = (1 << s->page_shift) - offset;
|
||||
else
|
||||
s->iolen = (1 << s->page_shift) + (1 << s->oob_shift) - offset;
|
||||
s->iolen = nand_load_block(s, s->addr & ((1 << s->addr_shift) - 1));
|
||||
break;
|
||||
|
||||
case NAND_CMD_RESET:
|
||||
@@ -597,12 +617,7 @@ uint32_t nand_getio(DeviceState *dev)
|
||||
if (!s->iolen && s->cmd == NAND_CMD_READ0) {
|
||||
offset = (int) (s->addr & ((1 << s->addr_shift) - 1)) + s->offset;
|
||||
s->offset = 0;
|
||||
|
||||
s->blk_load(s, s->addr, offset);
|
||||
if (s->gnd)
|
||||
s->iolen = (1 << s->page_shift) - offset;
|
||||
else
|
||||
s->iolen = (1 << s->page_shift) + (1 << s->oob_shift) - offset;
|
||||
s->iolen = nand_load_block(s, offset);
|
||||
}
|
||||
|
||||
if (s->ce || s->iolen <= 0) {
|
||||
@@ -763,11 +778,15 @@ static void glue(nand_blk_erase_, NAND_PAGE_SIZE)(NANDFlashState *s)
|
||||
}
|
||||
}
|
||||
|
||||
static void glue(nand_blk_load_, NAND_PAGE_SIZE)(NANDFlashState *s,
|
||||
uint64_t addr, int offset)
|
||||
static bool glue(nand_blk_load_, NAND_PAGE_SIZE)(NANDFlashState *s,
|
||||
uint64_t addr, unsigned offset)
|
||||
{
|
||||
if (PAGE(addr) >= s->pages) {
|
||||
return;
|
||||
return false;
|
||||
}
|
||||
|
||||
if (offset > NAND_PAGE_SIZE + OOB_SIZE) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (s->blk) {
|
||||
@@ -795,6 +814,8 @@ static void glue(nand_blk_load_, NAND_PAGE_SIZE)(NANDFlashState *s,
|
||||
offset, NAND_PAGE_SIZE + OOB_SIZE - offset);
|
||||
s->ioaddr = s->io;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
static void glue(nand_init_, NAND_PAGE_SIZE)(NANDFlashState *s)
|
||||
|
||||
@@ -985,8 +985,7 @@ static void virtser_port_device_realize(DeviceState *dev, Error **errp)
|
||||
return;
|
||||
}
|
||||
|
||||
port->bh = qemu_bh_new_guarded(flush_queued_data_bh, port,
|
||||
&dev->mem_reentrancy_guard);
|
||||
port->bh = virtio_bh_new_guarded(dev, flush_queued_data_bh, port);
|
||||
port->elem = NULL;
|
||||
}
|
||||
|
||||
|
||||
@@ -80,6 +80,7 @@ GlobalProperty hw_compat_5_2[] = {
|
||||
{ "PIIX4_PM", "smm-compat", "on"},
|
||||
{ "virtio-blk-device", "report-discard-granularity", "off" },
|
||||
{ "virtio-net-pci-base", "vectors", "3"},
|
||||
{ "nvme", "msix-exclusive-bar", "on"},
|
||||
};
|
||||
const size_t hw_compat_5_2_len = G_N_ELEMENTS(hw_compat_5_2);
|
||||
|
||||
|
||||
@@ -1746,6 +1746,13 @@ static void vga_draw_blank(VGACommonState *s, int full_update)
|
||||
if (s->last_scr_width <= 0 || s->last_scr_height <= 0)
|
||||
return;
|
||||
|
||||
if (is_buffer_shared(surface)) {
|
||||
/* unshare buffer, otherwise the blanking corrupts vga vram */
|
||||
surface = qemu_create_displaysurface(s->last_scr_width,
|
||||
s->last_scr_height);
|
||||
dpy_gfx_replace_surface(s->con, surface);
|
||||
}
|
||||
|
||||
w = s->last_scr_width * surface_bytes_per_pixel(surface);
|
||||
d = surface_data(surface);
|
||||
for(i = 0; i < s->last_scr_height; i++) {
|
||||
|
||||
@@ -1356,10 +1356,8 @@ void virtio_gpu_device_realize(DeviceState *qdev, Error **errp)
|
||||
|
||||
g->ctrl_vq = virtio_get_queue(vdev, 0);
|
||||
g->cursor_vq = virtio_get_queue(vdev, 1);
|
||||
g->ctrl_bh = qemu_bh_new_guarded(virtio_gpu_ctrl_bh, g,
|
||||
&qdev->mem_reentrancy_guard);
|
||||
g->cursor_bh = qemu_bh_new_guarded(virtio_gpu_cursor_bh, g,
|
||||
&qdev->mem_reentrancy_guard);
|
||||
g->ctrl_bh = virtio_bh_new_guarded(qdev, virtio_gpu_ctrl_bh, g);
|
||||
g->cursor_bh = virtio_bh_new_guarded(qdev, virtio_gpu_cursor_bh, g);
|
||||
QTAILQ_INIT(&g->reslist);
|
||||
QTAILQ_INIT(&g->cmdq);
|
||||
QTAILQ_INIT(&g->fenceq);
|
||||
|
||||
+10
-10
@@ -175,24 +175,24 @@ static uint64_t xlnx_dpdma_desc_get_source_address(DPDMADescriptor *desc,
|
||||
|
||||
switch (frag) {
|
||||
case 0:
|
||||
addr = desc->source_address
|
||||
+ (extract32(desc->address_extension, 16, 12) << 20);
|
||||
addr = (uint64_t)desc->source_address
|
||||
+ (extract64(desc->address_extension, 16, 16) << 32);
|
||||
break;
|
||||
case 1:
|
||||
addr = desc->source_address2
|
||||
+ (extract32(desc->address_extension_23, 0, 12) << 8);
|
||||
addr = (uint64_t)desc->source_address2
|
||||
+ (extract64(desc->address_extension_23, 0, 16) << 32);
|
||||
break;
|
||||
case 2:
|
||||
addr = desc->source_address3
|
||||
+ (extract32(desc->address_extension_23, 16, 12) << 20);
|
||||
addr = (uint64_t)desc->source_address3
|
||||
+ (extract64(desc->address_extension_23, 16, 16) << 32);
|
||||
break;
|
||||
case 3:
|
||||
addr = desc->source_address4
|
||||
+ (extract32(desc->address_extension_45, 0, 12) << 8);
|
||||
addr = (uint64_t)desc->source_address4
|
||||
+ (extract64(desc->address_extension_45, 0, 16) << 32);
|
||||
break;
|
||||
case 4:
|
||||
addr = desc->source_address5
|
||||
+ (extract32(desc->address_extension_45, 16, 12) << 20);
|
||||
addr = (uint64_t)desc->source_address5
|
||||
+ (extract64(desc->address_extension_45, 16, 16) << 32);
|
||||
break;
|
||||
default:
|
||||
addr = 0;
|
||||
|
||||
+2
-2
@@ -1658,7 +1658,7 @@ static MemTxResult gic_cpu_read(GICState *s, int cpu, int offset,
|
||||
*data = s->h_apr[gic_get_vcpu_real_id(cpu)];
|
||||
} else if (gic_cpu_ns_access(s, cpu, attrs)) {
|
||||
/* NS view of GICC_APR<n> is the top half of GIC_NSAPR<n> */
|
||||
*data = gic_apr_ns_view(s, regno, cpu);
|
||||
*data = gic_apr_ns_view(s, cpu, regno);
|
||||
} else {
|
||||
*data = s->apr[regno][cpu];
|
||||
}
|
||||
@@ -1746,7 +1746,7 @@ static MemTxResult gic_cpu_write(GICState *s, int cpu, int offset,
|
||||
s->h_apr[gic_get_vcpu_real_id(cpu)] = value;
|
||||
} else if (gic_cpu_ns_access(s, cpu, attrs)) {
|
||||
/* NS view of GICC_APR<n> is the top half of GIC_NSAPR<n> */
|
||||
gic_apr_write_ns_view(s, regno, cpu, value);
|
||||
gic_apr_write_ns_view(s, cpu, regno, value);
|
||||
} else {
|
||||
s->apr[regno][cpu] = value;
|
||||
}
|
||||
|
||||
@@ -1065,7 +1065,7 @@ static uint64_t icc_hppir0_value(GICv3CPUState *cs, CPUARMState *env)
|
||||
*/
|
||||
bool irq_is_secure;
|
||||
|
||||
if (cs->hppi.prio == 0xff) {
|
||||
if (icc_no_enabled_hppi(cs)) {
|
||||
return INTID_SPURIOUS;
|
||||
}
|
||||
|
||||
@@ -1102,7 +1102,7 @@ static uint64_t icc_hppir1_value(GICv3CPUState *cs, CPUARMState *env)
|
||||
*/
|
||||
bool irq_is_secure;
|
||||
|
||||
if (cs->hppi.prio == 0xff) {
|
||||
if (icc_no_enabled_hppi(cs)) {
|
||||
return INTID_SPURIOUS;
|
||||
}
|
||||
|
||||
|
||||
@@ -957,13 +957,13 @@ DeviceState *riscv_aplic_create(hwaddr addr, hwaddr size,
|
||||
qdev_prop_set_bit(dev, "msimode", msimode);
|
||||
qdev_prop_set_bit(dev, "mmode", mmode);
|
||||
|
||||
sysbus_realize_and_unref(SYS_BUS_DEVICE(dev), &error_fatal);
|
||||
sysbus_mmio_map(SYS_BUS_DEVICE(dev), 0, addr);
|
||||
|
||||
if (parent) {
|
||||
riscv_aplic_add_child(parent, dev);
|
||||
}
|
||||
|
||||
sysbus_realize_and_unref(SYS_BUS_DEVICE(dev), &error_fatal);
|
||||
sysbus_mmio_map(SYS_BUS_DEVICE(dev), 0, addr);
|
||||
|
||||
if (!msimode) {
|
||||
for (i = 0; i < num_harts; i++) {
|
||||
CPUState *cpu = qemu_get_cpu(hartid_base + i);
|
||||
|
||||
@@ -273,6 +273,7 @@ static void qdev_applesmc_isa_reset(DeviceState *dev)
|
||||
/* Remove existing entries */
|
||||
QLIST_FOREACH_SAFE(d, &s->data_def, node, next) {
|
||||
QLIST_REMOVE(d, node);
|
||||
g_free(d);
|
||||
}
|
||||
s->status = 0x00;
|
||||
s->status_1e = 0x00;
|
||||
|
||||
+7
-53
@@ -108,14 +108,6 @@ e1000e_intmgr_timer_resume(E1000IntrDelayTimer *timer)
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
e1000e_intmgr_timer_pause(E1000IntrDelayTimer *timer)
|
||||
{
|
||||
if (timer->running) {
|
||||
timer_del(timer->timer);
|
||||
}
|
||||
}
|
||||
|
||||
static inline void
|
||||
e1000e_intrmgr_stop_timer(E1000IntrDelayTimer *timer)
|
||||
{
|
||||
@@ -397,24 +389,6 @@ e1000e_intrmgr_resume(E1000ECore *core)
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
e1000e_intrmgr_pause(E1000ECore *core)
|
||||
{
|
||||
int i;
|
||||
|
||||
e1000e_intmgr_timer_pause(&core->radv);
|
||||
e1000e_intmgr_timer_pause(&core->rdtr);
|
||||
e1000e_intmgr_timer_pause(&core->raid);
|
||||
e1000e_intmgr_timer_pause(&core->tidv);
|
||||
e1000e_intmgr_timer_pause(&core->tadv);
|
||||
|
||||
e1000e_intmgr_timer_pause(&core->itr);
|
||||
|
||||
for (i = 0; i < E1000E_MSIX_VEC_NUM; i++) {
|
||||
e1000e_intmgr_timer_pause(&core->eitr[i]);
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
e1000e_intrmgr_reset(E1000ECore *core)
|
||||
{
|
||||
@@ -3336,12 +3310,6 @@ e1000e_core_read(E1000ECore *core, hwaddr addr, unsigned size)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static inline void
|
||||
e1000e_autoneg_pause(E1000ECore *core)
|
||||
{
|
||||
timer_del(core->autoneg_timer);
|
||||
}
|
||||
|
||||
static void
|
||||
e1000e_autoneg_resume(E1000ECore *core)
|
||||
{
|
||||
@@ -3353,22 +3321,6 @@ e1000e_autoneg_resume(E1000ECore *core)
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
e1000e_vm_state_change(void *opaque, bool running, RunState state)
|
||||
{
|
||||
E1000ECore *core = opaque;
|
||||
|
||||
if (running) {
|
||||
trace_e1000e_vm_state_running();
|
||||
e1000e_intrmgr_resume(core);
|
||||
e1000e_autoneg_resume(core);
|
||||
} else {
|
||||
trace_e1000e_vm_state_stopped();
|
||||
e1000e_autoneg_pause(core);
|
||||
e1000e_intrmgr_pause(core);
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
e1000e_core_pci_realize(E1000ECore *core,
|
||||
const uint16_t *eeprom_templ,
|
||||
@@ -3381,9 +3333,6 @@ e1000e_core_pci_realize(E1000ECore *core,
|
||||
e1000e_autoneg_timer, core);
|
||||
e1000e_intrmgr_pci_realize(core);
|
||||
|
||||
core->vmstate =
|
||||
qemu_add_vm_change_state_handler(e1000e_vm_state_change, core);
|
||||
|
||||
for (i = 0; i < E1000E_NUM_QUEUES; i++) {
|
||||
net_tx_pkt_init(&core->tx[i].tx_pkt, core->owner,
|
||||
E1000E_MAX_TX_FRAGS, core->has_vnet);
|
||||
@@ -3408,8 +3357,6 @@ e1000e_core_pci_uninit(E1000ECore *core)
|
||||
|
||||
e1000e_intrmgr_pci_unint(core);
|
||||
|
||||
qemu_del_vm_change_state_handler(core->vmstate);
|
||||
|
||||
for (i = 0; i < E1000E_NUM_QUEUES; i++) {
|
||||
net_tx_pkt_reset(core->tx[i].tx_pkt);
|
||||
net_tx_pkt_uninit(core->tx[i].tx_pkt);
|
||||
@@ -3561,5 +3508,12 @@ e1000e_core_post_load(E1000ECore *core)
|
||||
*/
|
||||
nc->link_down = (core->mac[STATUS] & E1000_STATUS_LU) == 0;
|
||||
|
||||
/*
|
||||
* we need to restart intrmgr timers, as an older version of
|
||||
* QEMU can have stopped them before migration
|
||||
*/
|
||||
e1000e_intrmgr_resume(core);
|
||||
e1000e_autoneg_resume(core);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -100,8 +100,6 @@ struct E1000Core {
|
||||
E1000IntrDelayTimer eitr[E1000E_MSIX_VEC_NUM];
|
||||
bool eitr_intr_pending[E1000E_MSIX_VEC_NUM];
|
||||
|
||||
VMChangeStateEntry *vmstate;
|
||||
|
||||
uint32_t itr_guest_value;
|
||||
uint32_t eitr_guest_value[E1000E_MSIX_VEC_NUM];
|
||||
|
||||
|
||||
+24
-4
@@ -155,6 +155,12 @@ do { fprintf(stderr, "lan9118: error: " fmt , ## __VA_ARGS__);} while (0)
|
||||
|
||||
#define GPT_TIMER_EN 0x20000000
|
||||
|
||||
/*
|
||||
* The MAC Interface Layer (MIL), within the MAC, contains a 2K Byte transmit
|
||||
* and a 128 Byte receive FIFO which is separate from the TX and RX FIFOs.
|
||||
*/
|
||||
#define MIL_TXFIFO_SIZE 2048
|
||||
|
||||
enum tx_state {
|
||||
TX_IDLE,
|
||||
TX_B,
|
||||
@@ -171,7 +177,7 @@ typedef struct {
|
||||
int32_t pad;
|
||||
int32_t fifo_used;
|
||||
int32_t len;
|
||||
uint8_t data[2048];
|
||||
uint8_t data[MIL_TXFIFO_SIZE];
|
||||
} LAN9118Packet;
|
||||
|
||||
static const VMStateDescription vmstate_lan9118_packet = {
|
||||
@@ -187,7 +193,7 @@ static const VMStateDescription vmstate_lan9118_packet = {
|
||||
VMSTATE_INT32(pad, LAN9118Packet),
|
||||
VMSTATE_INT32(fifo_used, LAN9118Packet),
|
||||
VMSTATE_INT32(len, LAN9118Packet),
|
||||
VMSTATE_UINT8_ARRAY(data, LAN9118Packet, 2048),
|
||||
VMSTATE_UINT8_ARRAY(data, LAN9118Packet, MIL_TXFIFO_SIZE),
|
||||
VMSTATE_END_OF_LIST()
|
||||
}
|
||||
};
|
||||
@@ -549,7 +555,7 @@ static ssize_t lan9118_receive(NetClientState *nc, const uint8_t *buf,
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (size >= 2048 || size < 14) {
|
||||
if (size >= MIL_TXFIFO_SIZE || size < 14) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
@@ -798,8 +804,22 @@ static void tx_fifo_push(lan9118_state *s, uint32_t val)
|
||||
/* Documentation is somewhat unclear on the ordering of bytes
|
||||
in FIFO words. Empirical results show it to be little-endian.
|
||||
*/
|
||||
/* TODO: FIFO overflow checking. */
|
||||
while (n--) {
|
||||
if (s->txp->len == MIL_TXFIFO_SIZE) {
|
||||
/*
|
||||
* No more space in the FIFO. The datasheet is not
|
||||
* precise about this case. We choose what is easiest
|
||||
* to model: the packet is truncated, and TXE is raised.
|
||||
*
|
||||
* Note, it could be a fragmented packet, but we currently
|
||||
* do not handle that (see earlier TX_B case).
|
||||
*/
|
||||
qemu_log_mask(LOG_GUEST_ERROR,
|
||||
"MIL TX FIFO overrun, discarding %u byte%s\n",
|
||||
n, n > 1 ? "s" : "");
|
||||
s->int_sts |= TXE_INT;
|
||||
break;
|
||||
}
|
||||
s->txp->data[s->txp->len] = val & 0xff;
|
||||
s->txp->len++;
|
||||
val >>= 8;
|
||||
|
||||
+1
-1
@@ -632,7 +632,7 @@ static inline int ladr_match(PCNetState *s, const uint8_t *buf, int size)
|
||||
{
|
||||
struct qemu_ether_header *hdr = (void *)buf;
|
||||
if ((*(hdr->ether_dhost)&0x01) &&
|
||||
((uint64_t *)&s->csr[8])[0] != 0LL) {
|
||||
(s->csr[8] | s->csr[9] | s->csr[10] | s->csr[11]) != 0) {
|
||||
uint8_t ladr[8] = {
|
||||
s->csr[8] & 0xff, s->csr[8] >> 8,
|
||||
s->csr[9] & 0xff, s->csr[9] >> 8,
|
||||
|
||||
+18
-8
@@ -2646,18 +2646,14 @@ static int32_t virtio_net_flush_tx(VirtIONetQueue *q)
|
||||
out_sg = elem->out_sg;
|
||||
if (out_num < 1) {
|
||||
virtio_error(vdev, "virtio-net header not in first element");
|
||||
virtqueue_detach_element(q->tx_vq, elem, 0);
|
||||
g_free(elem);
|
||||
return -EINVAL;
|
||||
goto detach;
|
||||
}
|
||||
|
||||
if (n->has_vnet_hdr) {
|
||||
if (iov_to_buf(out_sg, out_num, 0, &vhdr, n->guest_hdr_len) <
|
||||
n->guest_hdr_len) {
|
||||
virtio_error(vdev, "virtio-net header incorrect");
|
||||
virtqueue_detach_element(q->tx_vq, elem, 0);
|
||||
g_free(elem);
|
||||
return -EINVAL;
|
||||
goto detach;
|
||||
}
|
||||
if (n->needs_vnet_hdr_swap) {
|
||||
virtio_net_hdr_swap(vdev, (void *) &vhdr);
|
||||
@@ -2688,6 +2684,11 @@ static int32_t virtio_net_flush_tx(VirtIONetQueue *q)
|
||||
n->guest_hdr_len, -1);
|
||||
out_num = sg_num;
|
||||
out_sg = sg;
|
||||
|
||||
if (out_num < 1) {
|
||||
virtio_error(vdev, "virtio-net nothing to send");
|
||||
goto detach;
|
||||
}
|
||||
}
|
||||
|
||||
ret = qemu_sendv_packet_async(qemu_get_subqueue(n->nic, queue_index),
|
||||
@@ -2708,6 +2709,11 @@ drop:
|
||||
}
|
||||
}
|
||||
return num_packets;
|
||||
|
||||
detach:
|
||||
virtqueue_detach_element(q->tx_vq, elem, 0);
|
||||
g_free(elem);
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
static void virtio_net_tx_timer(void *opaque);
|
||||
@@ -2746,6 +2752,10 @@ static void virtio_net_handle_tx_bh(VirtIODevice *vdev, VirtQueue *vq)
|
||||
VirtIONet *n = VIRTIO_NET(vdev);
|
||||
VirtIONetQueue *q = &n->vqs[vq2q(virtio_get_queue_index(vq))];
|
||||
|
||||
if (unlikely(n->vhost_started)) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (unlikely((n->status & VIRTIO_NET_S_LINK_UP) == 0)) {
|
||||
virtio_net_drop_tx_queue_data(vdev, vq);
|
||||
return;
|
||||
@@ -3307,7 +3317,7 @@ static bool virtio_net_guest_notifier_pending(VirtIODevice *vdev, int idx)
|
||||
VirtIONet *n = VIRTIO_NET(vdev);
|
||||
NetClientState *nc;
|
||||
assert(n->vhost_started);
|
||||
if (!virtio_vdev_has_feature(vdev, VIRTIO_NET_F_MQ) && idx == 2) {
|
||||
if (!n->multiqueue && idx == 2) {
|
||||
/* Must guard against invalid features and bogus queue index
|
||||
* from being set by malicious guest, or penetrated through
|
||||
* buggy migration stream.
|
||||
@@ -3330,7 +3340,7 @@ static void virtio_net_guest_notifier_mask(VirtIODevice *vdev, int idx,
|
||||
VirtIONet *n = VIRTIO_NET(vdev);
|
||||
NetClientState *nc;
|
||||
assert(n->vhost_started);
|
||||
if (!virtio_vdev_has_feature(vdev, VIRTIO_NET_F_MQ) && idx == 2) {
|
||||
if (!n->multiqueue && idx == 2) {
|
||||
/* Must guard against invalid features and bogus queue index
|
||||
* from being set by malicious guest, or penetrated through
|
||||
* buggy migration stream.
|
||||
|
||||
+99
-81
@@ -6980,7 +6980,7 @@ static const MemoryRegionOps nvme_cmb_ops = {
|
||||
},
|
||||
};
|
||||
|
||||
static void nvme_check_constraints(NvmeCtrl *n, Error **errp)
|
||||
static bool nvme_check_params(NvmeCtrl *n, Error **errp)
|
||||
{
|
||||
NvmeParams *params = &n->params;
|
||||
|
||||
@@ -6994,38 +6994,43 @@ static void nvme_check_constraints(NvmeCtrl *n, Error **errp)
|
||||
if (n->namespace.blkconf.blk && n->subsys) {
|
||||
error_setg(errp, "subsystem support is unavailable with legacy "
|
||||
"namespace ('drive' property)");
|
||||
return;
|
||||
return false;
|
||||
}
|
||||
|
||||
if (params->max_ioqpairs < 1 ||
|
||||
params->max_ioqpairs > NVME_MAX_IOQPAIRS) {
|
||||
error_setg(errp, "max_ioqpairs must be between 1 and %d",
|
||||
NVME_MAX_IOQPAIRS);
|
||||
return;
|
||||
return false;
|
||||
}
|
||||
|
||||
if (params->msix_qsize < 1 ||
|
||||
params->msix_qsize > PCI_MSIX_FLAGS_QSIZE + 1) {
|
||||
error_setg(errp, "msix_qsize must be between 1 and %d",
|
||||
PCI_MSIX_FLAGS_QSIZE + 1);
|
||||
return;
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!params->serial) {
|
||||
error_setg(errp, "serial property not set");
|
||||
return;
|
||||
return false;
|
||||
}
|
||||
|
||||
if (n->pmr.dev) {
|
||||
if (params->msix_exclusive_bar) {
|
||||
error_setg(errp, "not enough BARs available to enable PMR");
|
||||
return false;
|
||||
}
|
||||
|
||||
if (host_memory_backend_is_mapped(n->pmr.dev)) {
|
||||
error_setg(errp, "can't use already busy memdev: %s",
|
||||
object_get_canonical_path_component(OBJECT(n->pmr.dev)));
|
||||
return;
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!is_power_of_2(n->pmr.dev->size)) {
|
||||
error_setg(errp, "pmr backend size needs to be power of 2 in size");
|
||||
return;
|
||||
return false;
|
||||
}
|
||||
|
||||
host_memory_backend_set_mapped(n->pmr.dev, true);
|
||||
@@ -7034,64 +7039,64 @@ static void nvme_check_constraints(NvmeCtrl *n, Error **errp)
|
||||
if (n->params.zasl > n->params.mdts) {
|
||||
error_setg(errp, "zoned.zasl (Zone Append Size Limit) must be less "
|
||||
"than or equal to mdts (Maximum Data Transfer Size)");
|
||||
return;
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!n->params.vsl) {
|
||||
error_setg(errp, "vsl must be non-zero");
|
||||
return;
|
||||
return false;
|
||||
}
|
||||
|
||||
if (params->sriov_max_vfs) {
|
||||
if (!n->subsys) {
|
||||
error_setg(errp, "subsystem is required for the use of SR-IOV");
|
||||
return;
|
||||
return false;
|
||||
}
|
||||
|
||||
if (params->sriov_max_vfs > NVME_MAX_VFS) {
|
||||
error_setg(errp, "sriov_max_vfs must be between 0 and %d",
|
||||
NVME_MAX_VFS);
|
||||
return;
|
||||
return false;
|
||||
}
|
||||
|
||||
if (params->cmb_size_mb) {
|
||||
error_setg(errp, "CMB is not supported with SR-IOV");
|
||||
return;
|
||||
return false;
|
||||
}
|
||||
|
||||
if (n->pmr.dev) {
|
||||
error_setg(errp, "PMR is not supported with SR-IOV");
|
||||
return;
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!params->sriov_vq_flexible || !params->sriov_vi_flexible) {
|
||||
error_setg(errp, "both sriov_vq_flexible and sriov_vi_flexible"
|
||||
" must be set for the use of SR-IOV");
|
||||
return;
|
||||
return false;
|
||||
}
|
||||
|
||||
if (params->sriov_vq_flexible < params->sriov_max_vfs * 2) {
|
||||
error_setg(errp, "sriov_vq_flexible must be greater than or equal"
|
||||
" to %d (sriov_max_vfs * 2)", params->sriov_max_vfs * 2);
|
||||
return;
|
||||
return false;
|
||||
}
|
||||
|
||||
if (params->max_ioqpairs < params->sriov_vq_flexible + 2) {
|
||||
error_setg(errp, "(max_ioqpairs - sriov_vq_flexible) must be"
|
||||
" greater than or equal to 2");
|
||||
return;
|
||||
return false;
|
||||
}
|
||||
|
||||
if (params->sriov_vi_flexible < params->sriov_max_vfs) {
|
||||
error_setg(errp, "sriov_vi_flexible must be greater than or equal"
|
||||
" to %d (sriov_max_vfs)", params->sriov_max_vfs);
|
||||
return;
|
||||
return false;
|
||||
}
|
||||
|
||||
if (params->msix_qsize < params->sriov_vi_flexible + 1) {
|
||||
error_setg(errp, "(msix_qsize - sriov_vi_flexible) must be"
|
||||
" greater than or equal to 1");
|
||||
return;
|
||||
return false;
|
||||
}
|
||||
|
||||
if (params->sriov_max_vi_per_vf &&
|
||||
@@ -7099,7 +7104,7 @@ static void nvme_check_constraints(NvmeCtrl *n, Error **errp)
|
||||
error_setg(errp, "sriov_max_vi_per_vf must meet:"
|
||||
" (sriov_max_vi_per_vf - 1) %% %d == 0 and"
|
||||
" sriov_max_vi_per_vf >= 1", NVME_VF_RES_GRANULARITY);
|
||||
return;
|
||||
return false;
|
||||
}
|
||||
|
||||
if (params->sriov_max_vq_per_vf &&
|
||||
@@ -7108,9 +7113,11 @@ static void nvme_check_constraints(NvmeCtrl *n, Error **errp)
|
||||
error_setg(errp, "sriov_max_vq_per_vf must meet:"
|
||||
" (sriov_max_vq_per_vf - 1) %% %d == 0 and"
|
||||
" sriov_max_vq_per_vf >= 2", NVME_VF_RES_GRANULARITY);
|
||||
return;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
static void nvme_init_state(NvmeCtrl *n)
|
||||
@@ -7219,13 +7226,18 @@ static void nvme_init_pmr(NvmeCtrl *n, PCIDevice *pci_dev)
|
||||
memory_region_set_enabled(&n->pmr.dev->mr, false);
|
||||
}
|
||||
|
||||
static uint64_t nvme_bar_size(unsigned total_queues, unsigned total_irqs,
|
||||
unsigned *msix_table_offset,
|
||||
unsigned *msix_pba_offset)
|
||||
static uint64_t nvme_mbar_size(unsigned total_queues, unsigned total_irqs,
|
||||
unsigned *msix_table_offset,
|
||||
unsigned *msix_pba_offset)
|
||||
{
|
||||
uint64_t bar_size, msix_table_size, msix_pba_size;
|
||||
uint64_t bar_size, msix_table_size;
|
||||
|
||||
bar_size = sizeof(NvmeBar) + 2 * total_queues * NVME_DB_SIZE;
|
||||
|
||||
if (total_irqs == 0) {
|
||||
goto out;
|
||||
}
|
||||
|
||||
bar_size = QEMU_ALIGN_UP(bar_size, 4 * KiB);
|
||||
|
||||
if (msix_table_offset) {
|
||||
@@ -7240,11 +7252,10 @@ static uint64_t nvme_bar_size(unsigned total_queues, unsigned total_irqs,
|
||||
*msix_pba_offset = bar_size;
|
||||
}
|
||||
|
||||
msix_pba_size = QEMU_ALIGN_UP(total_irqs, 64) / 8;
|
||||
bar_size += msix_pba_size;
|
||||
bar_size += QEMU_ALIGN_UP(total_irqs, 64) / 8;
|
||||
|
||||
bar_size = pow2ceil(bar_size);
|
||||
return bar_size;
|
||||
out:
|
||||
return pow2ceil(bar_size);
|
||||
}
|
||||
|
||||
static void nvme_init_sriov(NvmeCtrl *n, PCIDevice *pci_dev, uint16_t offset)
|
||||
@@ -7252,7 +7263,7 @@ static void nvme_init_sriov(NvmeCtrl *n, PCIDevice *pci_dev, uint16_t offset)
|
||||
uint16_t vf_dev_id = n->params.use_intel_id ?
|
||||
PCI_DEVICE_ID_INTEL_NVME : PCI_DEVICE_ID_REDHAT_NVME;
|
||||
NvmePriCtrlCap *cap = &n->pri_ctrl_cap;
|
||||
uint64_t bar_size = nvme_bar_size(le16_to_cpu(cap->vqfrsm),
|
||||
uint64_t bar_size = nvme_mbar_size(le16_to_cpu(cap->vqfrsm),
|
||||
le16_to_cpu(cap->vifrsm),
|
||||
NULL, NULL);
|
||||
|
||||
@@ -7286,15 +7297,14 @@ static int nvme_add_pm_capability(PCIDevice *pci_dev, uint8_t offset)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int nvme_init_pci(NvmeCtrl *n, PCIDevice *pci_dev, Error **errp)
|
||||
static bool nvme_init_pci(NvmeCtrl *n, PCIDevice *pci_dev, Error **errp)
|
||||
{
|
||||
ERRP_GUARD();
|
||||
uint8_t *pci_conf = pci_dev->config;
|
||||
uint64_t bar_size;
|
||||
unsigned msix_table_offset, msix_pba_offset;
|
||||
unsigned msix_table_offset = 0, msix_pba_offset = 0;
|
||||
int ret;
|
||||
|
||||
Error *err = NULL;
|
||||
|
||||
pci_conf[PCI_INTERRUPT_PIN] = 1;
|
||||
pci_config_set_prog_interface(pci_conf, 0x2);
|
||||
|
||||
@@ -7314,31 +7324,45 @@ static int nvme_init_pci(NvmeCtrl *n, PCIDevice *pci_dev, Error **errp)
|
||||
pcie_ari_init(pci_dev, 0x100, 1);
|
||||
}
|
||||
|
||||
/* add one to max_ioqpairs to account for the admin queue pair */
|
||||
bar_size = nvme_bar_size(n->params.max_ioqpairs + 1, n->params.msix_qsize,
|
||||
&msix_table_offset, &msix_pba_offset);
|
||||
|
||||
memory_region_init(&n->bar0, OBJECT(n), "nvme-bar0", bar_size);
|
||||
memory_region_init_io(&n->iomem, OBJECT(n), &nvme_mmio_ops, n, "nvme",
|
||||
msix_table_offset);
|
||||
memory_region_add_subregion(&n->bar0, 0, &n->iomem);
|
||||
|
||||
if (pci_is_vf(pci_dev)) {
|
||||
pcie_sriov_vf_register_bar(pci_dev, 0, &n->bar0);
|
||||
} else {
|
||||
if (n->params.msix_exclusive_bar && !pci_is_vf(pci_dev)) {
|
||||
bar_size = nvme_mbar_size(n->params.max_ioqpairs + 1, 0, NULL, NULL);
|
||||
memory_region_init_io(&n->iomem, OBJECT(n), &nvme_mmio_ops, n, "nvme",
|
||||
bar_size);
|
||||
pci_register_bar(pci_dev, 0, PCI_BASE_ADDRESS_SPACE_MEMORY |
|
||||
PCI_BASE_ADDRESS_MEM_TYPE_64, &n->bar0);
|
||||
}
|
||||
ret = msix_init(pci_dev, n->params.msix_qsize,
|
||||
&n->bar0, 0, msix_table_offset,
|
||||
&n->bar0, 0, msix_pba_offset, 0, &err);
|
||||
if (ret < 0) {
|
||||
if (ret == -ENOTSUP) {
|
||||
warn_report_err(err);
|
||||
PCI_BASE_ADDRESS_MEM_TYPE_64, &n->iomem);
|
||||
ret = msix_init_exclusive_bar(pci_dev, n->params.msix_qsize, 4, errp);
|
||||
} else {
|
||||
assert(n->params.msix_qsize >= 1);
|
||||
|
||||
/* add one to max_ioqpairs to account for the admin queue pair */
|
||||
bar_size = nvme_mbar_size(n->params.max_ioqpairs + 1,
|
||||
n->params.msix_qsize, &msix_table_offset,
|
||||
&msix_pba_offset);
|
||||
|
||||
memory_region_init(&n->bar0, OBJECT(n), "nvme-bar0", bar_size);
|
||||
memory_region_init_io(&n->iomem, OBJECT(n), &nvme_mmio_ops, n, "nvme",
|
||||
msix_table_offset);
|
||||
memory_region_add_subregion(&n->bar0, 0, &n->iomem);
|
||||
|
||||
if (pci_is_vf(pci_dev)) {
|
||||
pcie_sriov_vf_register_bar(pci_dev, 0, &n->bar0);
|
||||
} else {
|
||||
error_propagate(errp, err);
|
||||
return ret;
|
||||
pci_register_bar(pci_dev, 0, PCI_BASE_ADDRESS_SPACE_MEMORY |
|
||||
PCI_BASE_ADDRESS_MEM_TYPE_64, &n->bar0);
|
||||
}
|
||||
|
||||
ret = msix_init(pci_dev, n->params.msix_qsize,
|
||||
&n->bar0, 0, msix_table_offset,
|
||||
&n->bar0, 0, msix_pba_offset, 0, errp);
|
||||
}
|
||||
|
||||
if (ret == -ENOTSUP) {
|
||||
/* report that msix is not supported, but do not error out */
|
||||
warn_report_err(*errp);
|
||||
*errp = NULL;
|
||||
} else if (ret < 0) {
|
||||
/* propagate error to caller */
|
||||
return false;
|
||||
}
|
||||
|
||||
nvme_update_msixcap_ts(pci_dev, n->conf_msix_qsize);
|
||||
@@ -7355,7 +7379,7 @@ static int nvme_init_pci(NvmeCtrl *n, PCIDevice *pci_dev, Error **errp)
|
||||
nvme_init_sriov(n, pci_dev, 0x120);
|
||||
}
|
||||
|
||||
return 0;
|
||||
return true;
|
||||
}
|
||||
|
||||
static void nvme_init_subnqn(NvmeCtrl *n)
|
||||
@@ -7509,21 +7533,24 @@ static void nvme_realize(PCIDevice *pci_dev, Error **errp)
|
||||
{
|
||||
NvmeCtrl *n = NVME(pci_dev);
|
||||
NvmeNamespace *ns;
|
||||
Error *local_err = NULL;
|
||||
NvmeCtrl *pn = NVME(pcie_sriov_get_pf(pci_dev));
|
||||
|
||||
if (pci_is_vf(pci_dev)) {
|
||||
/*
|
||||
* VFs derive settings from the parent. PF's lifespan exceeds
|
||||
* that of VF's, so it's safe to share params.serial.
|
||||
* that of VF's.
|
||||
*/
|
||||
memcpy(&n->params, &pn->params, sizeof(NvmeParams));
|
||||
|
||||
/*
|
||||
* Set PF's serial value to a new string memory to prevent 'serial'
|
||||
* property object release of PF when a VF is removed from the system.
|
||||
*/
|
||||
n->params.serial = g_strdup(pn->params.serial);
|
||||
n->subsys = pn->subsys;
|
||||
}
|
||||
|
||||
nvme_check_constraints(n, &local_err);
|
||||
if (local_err) {
|
||||
error_propagate(errp, local_err);
|
||||
if (!nvme_check_params(n, errp)) {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -7531,11 +7558,10 @@ static void nvme_realize(PCIDevice *pci_dev, Error **errp)
|
||||
&pci_dev->qdev, n->parent_obj.qdev.id);
|
||||
|
||||
if (nvme_init_subsys(n, errp)) {
|
||||
error_propagate(errp, local_err);
|
||||
return;
|
||||
}
|
||||
nvme_init_state(n);
|
||||
if (nvme_init_pci(n, pci_dev, errp)) {
|
||||
if (!nvme_init_pci(n, pci_dev, errp)) {
|
||||
return;
|
||||
}
|
||||
nvme_init_ctrl(n, pci_dev);
|
||||
@@ -7622,6 +7648,8 @@ static Property nvme_props[] = {
|
||||
params.sriov_max_vi_per_vf, 0),
|
||||
DEFINE_PROP_UINT8("sriov_max_vq_per_vf", NvmeCtrl,
|
||||
params.sriov_max_vq_per_vf, 0),
|
||||
DEFINE_PROP_BOOL("msix-exclusive-bar", NvmeCtrl, params.msix_exclusive_bar,
|
||||
false),
|
||||
DEFINE_PROP_END_OF_LIST(),
|
||||
};
|
||||
|
||||
@@ -7676,36 +7704,26 @@ static void nvme_pci_reset(DeviceState *qdev)
|
||||
nvme_ctrl_reset(n, NVME_RESET_FUNCTION);
|
||||
}
|
||||
|
||||
static void nvme_sriov_pre_write_ctrl(PCIDevice *dev, uint32_t address,
|
||||
uint32_t val, int len)
|
||||
static void nvme_sriov_post_write_config(PCIDevice *dev, uint16_t old_num_vfs)
|
||||
{
|
||||
NvmeCtrl *n = NVME(dev);
|
||||
NvmeSecCtrlEntry *sctrl;
|
||||
uint16_t sriov_cap = dev->exp.sriov_cap;
|
||||
uint32_t off = address - sriov_cap;
|
||||
int i, num_vfs;
|
||||
int i;
|
||||
|
||||
if (!sriov_cap) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (range_covers_byte(off, len, PCI_SRIOV_CTRL)) {
|
||||
if (!(val & PCI_SRIOV_CTRL_VFE)) {
|
||||
num_vfs = pci_get_word(dev->config + sriov_cap + PCI_SRIOV_NUM_VF);
|
||||
for (i = 0; i < num_vfs; i++) {
|
||||
sctrl = &n->sec_ctrl_list.sec[i];
|
||||
nvme_virt_set_state(n, le16_to_cpu(sctrl->scid), false);
|
||||
}
|
||||
}
|
||||
for (i = pcie_sriov_num_vfs(dev); i < old_num_vfs; i++) {
|
||||
sctrl = &n->sec_ctrl_list.sec[i];
|
||||
nvme_virt_set_state(n, le16_to_cpu(sctrl->scid), false);
|
||||
}
|
||||
}
|
||||
|
||||
static void nvme_pci_write_config(PCIDevice *dev, uint32_t address,
|
||||
uint32_t val, int len)
|
||||
{
|
||||
nvme_sriov_pre_write_ctrl(dev, address, val, len);
|
||||
uint16_t old_num_vfs = pcie_sriov_num_vfs(dev);
|
||||
|
||||
pci_default_write_config(dev, address, val, len);
|
||||
pcie_cap_flr_write_config(dev, address, val, len);
|
||||
nvme_sriov_post_write_config(dev, old_num_vfs);
|
||||
}
|
||||
|
||||
static const VMStateDescription nvme_vmstate = {
|
||||
|
||||
@@ -427,6 +427,7 @@ typedef struct NvmeParams {
|
||||
uint16_t sriov_vi_flexible;
|
||||
uint8_t sriov_max_vq_per_vf;
|
||||
uint8_t sriov_max_vi_per_vf;
|
||||
bool msix_exclusive_bar;
|
||||
} NvmeParams;
|
||||
|
||||
typedef struct NvmeCtrl {
|
||||
|
||||
@@ -176,6 +176,9 @@ static void register_vfs(PCIDevice *dev)
|
||||
|
||||
assert(sriov_cap > 0);
|
||||
num_vfs = pci_get_word(dev->config + sriov_cap + PCI_SRIOV_NUM_VF);
|
||||
if (num_vfs > pci_get_word(dev->config + sriov_cap + PCI_SRIOV_TOTAL_VF)) {
|
||||
return;
|
||||
}
|
||||
|
||||
dev->exp.sriov_pf.vf = g_new(PCIDevice *, num_vfs);
|
||||
|
||||
@@ -299,3 +302,8 @@ PCIDevice *pcie_sriov_get_vf_at_index(PCIDevice *dev, int n)
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
||||
uint16_t pcie_sriov_num_vfs(PCIDevice *dev)
|
||||
{
|
||||
return dev->exp.sriov_pf.num_vfs;
|
||||
}
|
||||
|
||||
+3
-6
@@ -4602,13 +4602,10 @@ static void spapr_machine_class_init(ObjectClass *oc, void *data)
|
||||
mc->block_default_type = IF_SCSI;
|
||||
|
||||
/*
|
||||
* Setting max_cpus to INT32_MAX. Both KVM and TCG max_cpus values
|
||||
* should be limited by the host capability instead of hardcoded.
|
||||
* max_cpus for KVM guests will be checked in kvm_init(), and TCG
|
||||
* guests are welcome to have as many CPUs as the host are capable
|
||||
* of emulate.
|
||||
* While KVM determines max cpus in kvm_init() using kvm_max_vcpus(),
|
||||
* In TCG the limit is restricted by the range of CPU IPIs available.
|
||||
*/
|
||||
mc->max_cpus = INT32_MAX;
|
||||
mc->max_cpus = SPAPR_IRQ_NR_IPIS;
|
||||
|
||||
mc->no_parallel = 1;
|
||||
mc->default_boot_order = "";
|
||||
|
||||
+4
-2
@@ -23,6 +23,8 @@
|
||||
|
||||
#include "trace.h"
|
||||
|
||||
QEMU_BUILD_BUG_ON(SPAPR_IRQ_NR_IPIS > SPAPR_XIRQ_BASE);
|
||||
|
||||
static const TypeInfo spapr_intc_info = {
|
||||
.name = TYPE_SPAPR_INTC,
|
||||
.parent = TYPE_INTERFACE,
|
||||
@@ -329,7 +331,7 @@ void spapr_irq_init(SpaprMachineState *spapr, Error **errp)
|
||||
int i;
|
||||
|
||||
dev = qdev_new(TYPE_SPAPR_XIVE);
|
||||
qdev_prop_set_uint32(dev, "nr-irqs", smc->nr_xirqs + SPAPR_XIRQ_BASE);
|
||||
qdev_prop_set_uint32(dev, "nr-irqs", smc->nr_xirqs + SPAPR_IRQ_NR_IPIS);
|
||||
/*
|
||||
* 8 XIVE END structures per CPU. One for each available
|
||||
* priority
|
||||
@@ -356,7 +358,7 @@ void spapr_irq_init(SpaprMachineState *spapr, Error **errp)
|
||||
}
|
||||
|
||||
spapr->qirqs = qemu_allocate_irqs(spapr_set_irq, spapr,
|
||||
smc->nr_xirqs + SPAPR_XIRQ_BASE);
|
||||
smc->nr_xirqs + SPAPR_IRQ_NR_IPIS);
|
||||
|
||||
/*
|
||||
* Mostly we don't actually need this until reset, except that not
|
||||
|
||||
@@ -273,7 +273,7 @@ static ssize_t vfu_object_cfg_access(vfu_ctx_t *vfu_ctx, char * const buf,
|
||||
while (bytes > 0) {
|
||||
len = (bytes > pci_access_width) ? pci_access_width : bytes;
|
||||
if (is_write) {
|
||||
memcpy(&val, ptr, len);
|
||||
val = ldn_le_p(ptr, len);
|
||||
pci_host_config_write_common(o->pci_dev, offset,
|
||||
pci_config_size(o->pci_dev),
|
||||
val, len);
|
||||
@@ -281,7 +281,7 @@ static ssize_t vfu_object_cfg_access(vfu_ctx_t *vfu_ctx, char * const buf,
|
||||
} else {
|
||||
val = pci_host_config_read_common(o->pci_dev, offset,
|
||||
pci_config_size(o->pci_dev), len);
|
||||
memcpy(ptr, &val, len);
|
||||
stn_le_p(ptr, len, val);
|
||||
trace_vfu_cfg_read(offset, val);
|
||||
}
|
||||
offset += len;
|
||||
|
||||
+1
-1
@@ -5,7 +5,7 @@
|
||||
*
|
||||
* Copyright (c) 2016 Artyom Tarasenko
|
||||
*
|
||||
* This code is licensed under the GNU GPL v3 or (at your option) any later
|
||||
* This code is licensed under the GNU GPL v2 or (at your option) any later
|
||||
* version.
|
||||
*/
|
||||
|
||||
|
||||
+46
-14
@@ -188,7 +188,7 @@ static const char *names[] = {
|
||||
#define LSI_TAG_VALID (1 << 16)
|
||||
|
||||
/* Maximum instructions to process. */
|
||||
#define LSI_MAX_INSN 10000
|
||||
#define LSI_MAX_INSN 100
|
||||
|
||||
typedef struct lsi_request {
|
||||
SCSIRequest *req;
|
||||
@@ -205,6 +205,7 @@ enum {
|
||||
LSI_WAIT_RESELECT, /* Wait Reselect instruction has been issued */
|
||||
LSI_DMA_SCRIPTS, /* processing DMA from lsi_execute_script */
|
||||
LSI_DMA_IN_PROGRESS, /* DMA operation is in progress */
|
||||
LSI_WAIT_SCRIPTS, /* SCRIPTS stopped because of instruction count limit */
|
||||
};
|
||||
|
||||
enum {
|
||||
@@ -224,6 +225,7 @@ struct LSIState {
|
||||
MemoryRegion ram_io;
|
||||
MemoryRegion io_io;
|
||||
AddressSpace pci_io_as;
|
||||
QEMUTimer *scripts_timer;
|
||||
|
||||
int carry; /* ??? Should this be an a visible register somewhere? */
|
||||
int status;
|
||||
@@ -415,6 +417,7 @@ static void lsi_soft_reset(LSIState *s)
|
||||
s->sbr = 0;
|
||||
assert(QTAILQ_EMPTY(&s->queue));
|
||||
assert(!s->current);
|
||||
timer_del(s->scripts_timer);
|
||||
}
|
||||
|
||||
static int lsi_dma_40bit(LSIState *s)
|
||||
@@ -570,8 +573,9 @@ static inline void lsi_set_phase(LSIState *s, int phase)
|
||||
s->sstat1 = (s->sstat1 & ~PHASE_MASK) | phase;
|
||||
}
|
||||
|
||||
static void lsi_bad_phase(LSIState *s, int out, int new_phase)
|
||||
static int lsi_bad_phase(LSIState *s, int out, int new_phase)
|
||||
{
|
||||
int ret = 0;
|
||||
/* Trigger a phase mismatch. */
|
||||
if (s->ccntl0 & LSI_CCNTL0_ENPMJ) {
|
||||
if ((s->ccntl0 & LSI_CCNTL0_PMJCTL)) {
|
||||
@@ -584,8 +588,10 @@ static void lsi_bad_phase(LSIState *s, int out, int new_phase)
|
||||
trace_lsi_bad_phase_interrupt();
|
||||
lsi_script_scsi_interrupt(s, LSI_SIST0_MA, 0);
|
||||
lsi_stop_script(s);
|
||||
ret = 1;
|
||||
}
|
||||
lsi_set_phase(s, new_phase);
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
@@ -789,7 +795,7 @@ static int lsi_queue_req(LSIState *s, SCSIRequest *req, uint32_t len)
|
||||
static void lsi_command_complete(SCSIRequest *req, size_t resid)
|
||||
{
|
||||
LSIState *s = LSI53C895A(req->bus->qbus.parent);
|
||||
int out;
|
||||
int out, stop = 0;
|
||||
|
||||
out = (s->sstat1 & PHASE_MASK) == PHASE_DO;
|
||||
trace_lsi_command_complete(req->status);
|
||||
@@ -797,7 +803,10 @@ static void lsi_command_complete(SCSIRequest *req, size_t resid)
|
||||
s->command_complete = 2;
|
||||
if (s->waiting && s->dbc != 0) {
|
||||
/* Raise phase mismatch for short transfers. */
|
||||
lsi_bad_phase(s, out, PHASE_ST);
|
||||
stop = lsi_bad_phase(s, out, PHASE_ST);
|
||||
if (stop) {
|
||||
s->waiting = 0;
|
||||
}
|
||||
} else {
|
||||
lsi_set_phase(s, PHASE_ST);
|
||||
}
|
||||
@@ -807,7 +816,9 @@ static void lsi_command_complete(SCSIRequest *req, size_t resid)
|
||||
lsi_request_free(s, s->current);
|
||||
scsi_req_unref(req);
|
||||
}
|
||||
lsi_resume_script(s);
|
||||
if (!stop) {
|
||||
lsi_resume_script(s);
|
||||
}
|
||||
}
|
||||
|
||||
/* Callback to indicate that the SCSI layer has completed a transfer. */
|
||||
@@ -1127,6 +1138,12 @@ static void lsi_wait_reselect(LSIState *s)
|
||||
}
|
||||
}
|
||||
|
||||
static void lsi_scripts_timer_start(LSIState *s)
|
||||
{
|
||||
trace_lsi_scripts_timer_start();
|
||||
timer_mod(s->scripts_timer, qemu_clock_get_us(QEMU_CLOCK_VIRTUAL) + 500);
|
||||
}
|
||||
|
||||
static void lsi_execute_script(LSIState *s)
|
||||
{
|
||||
PCIDevice *pci_dev = PCI_DEVICE(s);
|
||||
@@ -1136,6 +1153,11 @@ static void lsi_execute_script(LSIState *s)
|
||||
int insn_processed = 0;
|
||||
static int reentrancy_level;
|
||||
|
||||
if (s->waiting == LSI_WAIT_SCRIPTS) {
|
||||
timer_del(s->scripts_timer);
|
||||
s->waiting = LSI_NOWAIT;
|
||||
}
|
||||
|
||||
reentrancy_level++;
|
||||
|
||||
s->istat1 |= LSI_ISTAT1_SRUN;
|
||||
@@ -1143,8 +1165,8 @@ again:
|
||||
/*
|
||||
* Some windows drivers make the device spin waiting for a memory location
|
||||
* to change. If we have executed more than LSI_MAX_INSN instructions then
|
||||
* assume this is the case and force an unexpected device disconnect. This
|
||||
* is apparently sufficient to beat the drivers into submission.
|
||||
* assume this is the case and start a timer. Until the timer fires, the
|
||||
* host CPU has a chance to run and change the memory location.
|
||||
*
|
||||
* Another issue (CVE-2023-0330) can occur if the script is programmed to
|
||||
* trigger itself again and again. Avoid this problem by stopping after
|
||||
@@ -1152,13 +1174,9 @@ again:
|
||||
* which should be enough for all valid use cases).
|
||||
*/
|
||||
if (++insn_processed > LSI_MAX_INSN || reentrancy_level > 8) {
|
||||
if (!(s->sien0 & LSI_SIST0_UDC)) {
|
||||
qemu_log_mask(LOG_GUEST_ERROR,
|
||||
"lsi_scsi: inf. loop with UDC masked");
|
||||
}
|
||||
lsi_script_scsi_interrupt(s, LSI_SIST0_UDC, 0);
|
||||
lsi_disconnect(s);
|
||||
trace_lsi_execute_script_stop();
|
||||
s->waiting = LSI_WAIT_SCRIPTS;
|
||||
lsi_scripts_timer_start(s);
|
||||
reentrancy_level--;
|
||||
return;
|
||||
}
|
||||
insn = read_dword(s, s->dsp);
|
||||
@@ -2196,6 +2214,9 @@ static int lsi_post_load(void *opaque, int version_id)
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
if (s->waiting == LSI_WAIT_SCRIPTS) {
|
||||
lsi_scripts_timer_start(s);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -2293,6 +2314,15 @@ static const struct SCSIBusInfo lsi_scsi_info = {
|
||||
.cancel = lsi_request_cancelled
|
||||
};
|
||||
|
||||
static void scripts_timer_cb(void *opaque)
|
||||
{
|
||||
LSIState *s = opaque;
|
||||
|
||||
trace_lsi_scripts_timer_triggered();
|
||||
s->waiting = LSI_NOWAIT;
|
||||
lsi_execute_script(s);
|
||||
}
|
||||
|
||||
static void lsi_scsi_realize(PCIDevice *dev, Error **errp)
|
||||
{
|
||||
LSIState *s = LSI53C895A(dev);
|
||||
@@ -2312,6 +2342,7 @@ static void lsi_scsi_realize(PCIDevice *dev, Error **errp)
|
||||
"lsi-ram", 0x2000);
|
||||
memory_region_init_io(&s->io_io, OBJECT(s), &lsi_io_ops, s,
|
||||
"lsi-io", 256);
|
||||
s->scripts_timer = timer_new_us(QEMU_CLOCK_VIRTUAL, scripts_timer_cb, s);
|
||||
|
||||
/*
|
||||
* Since we use the address-space API to interact with ram_io, disable the
|
||||
@@ -2336,6 +2367,7 @@ static void lsi_scsi_exit(PCIDevice *dev)
|
||||
LSIState *s = LSI53C895A(dev);
|
||||
|
||||
address_space_destroy(&s->pci_io_as);
|
||||
timer_del(s->scripts_timer);
|
||||
}
|
||||
|
||||
static void lsi_class_init(ObjectClass *klass, void *data)
|
||||
|
||||
@@ -765,7 +765,6 @@ static void scsi_generic_realize(SCSIDevice *s, Error **errp)
|
||||
|
||||
/* Only used by scsi-block, but initialize it nevertheless to be clean. */
|
||||
s->default_scsi_version = -1;
|
||||
s->io_timeout = DEFAULT_IO_TIMEOUT;
|
||||
scsi_generic_read_device_inquiry(s);
|
||||
}
|
||||
|
||||
|
||||
@@ -299,6 +299,8 @@ lsi_execute_script_stop(void) "SCRIPTS execution stopped"
|
||||
lsi_awoken(void) "Woken by SIGP"
|
||||
lsi_reg_read(const char *name, int offset, uint8_t ret) "Read reg %s 0x%x = 0x%02x"
|
||||
lsi_reg_write(const char *name, int offset, uint8_t val) "Write reg %s 0x%x = 0x%02x"
|
||||
lsi_scripts_timer_triggered(void) "SCRIPTS timer triggered"
|
||||
lsi_scripts_timer_start(void) "SCRIPTS timer started"
|
||||
|
||||
# virtio-scsi.c
|
||||
virtio_scsi_cmd_req(int lun, uint32_t tag, uint8_t cmd) "virtio_scsi_cmd_req lun=%u tag=0x%x cmd=0x%x"
|
||||
|
||||
@@ -473,6 +473,7 @@ static uint32_t sdhci_read_dataport(SDHCIState *s, unsigned size)
|
||||
}
|
||||
|
||||
for (i = 0; i < size; i++) {
|
||||
assert(s->data_count < s->buf_maxsz);
|
||||
value |= s->fifo_buffer[s->data_count] << i * 8;
|
||||
s->data_count++;
|
||||
/* check if we've read all valid data (blksize bytes) from buffer */
|
||||
@@ -561,6 +562,7 @@ static void sdhci_write_dataport(SDHCIState *s, uint32_t value, unsigned size)
|
||||
}
|
||||
|
||||
for (i = 0; i < size; i++) {
|
||||
assert(s->data_count < s->buf_maxsz);
|
||||
s->fifo_buffer[s->data_count] = value & 0xFF;
|
||||
s->data_count++;
|
||||
value >>= 8;
|
||||
@@ -1208,6 +1210,12 @@ sdhci_write(void *opaque, hwaddr offset, uint64_t val, unsigned size)
|
||||
if (!(s->capareg & R_SDHC_CAPAB_SDMA_MASK)) {
|
||||
value &= ~SDHC_TRNS_DMA;
|
||||
}
|
||||
|
||||
/* TRNMOD writes are inhibited while Command Inhibit (DAT) is true */
|
||||
if (s->prnsts & SDHC_DATA_INHIBIT) {
|
||||
mask |= 0xffff;
|
||||
}
|
||||
|
||||
MASKED_WRITE(s->trnmod, mask, value & SDHC_TRNMOD_MASK);
|
||||
MASKED_WRITE(s->cmdreg, mask >> 16, value >> 16);
|
||||
|
||||
|
||||
@@ -1057,8 +1057,8 @@ static void virtio_crypto_device_realize(DeviceState *dev, Error **errp)
|
||||
vcrypto->vqs[i].dataq =
|
||||
virtio_add_queue(vdev, 1024, virtio_crypto_handle_dataq_bh);
|
||||
vcrypto->vqs[i].dataq_bh =
|
||||
qemu_bh_new_guarded(virtio_crypto_dataq_bh, &vcrypto->vqs[i],
|
||||
&dev->mem_reentrancy_guard);
|
||||
virtio_bh_new_guarded(dev, virtio_crypto_dataq_bh,
|
||||
&vcrypto->vqs[i]);
|
||||
vcrypto->vqs[i].vcrypto = vcrypto;
|
||||
}
|
||||
|
||||
|
||||
+20
-3
@@ -732,7 +732,6 @@ static void vring_packed_event_read(VirtIODevice *vdev,
|
||||
/* Make sure flags is seen before off_wrap */
|
||||
smp_rmb();
|
||||
e->off_wrap = virtio_lduw_phys_cached(vdev, cache, off_off);
|
||||
virtio_tswap16s(vdev, &e->flags);
|
||||
}
|
||||
|
||||
static void vring_packed_off_wrap_write(VirtIODevice *vdev,
|
||||
@@ -1367,12 +1366,20 @@ static void virtqueue_packed_flush(VirtQueue *vq, unsigned int count)
|
||||
return;
|
||||
}
|
||||
|
||||
/*
|
||||
* For indirect element's 'ndescs' is 1.
|
||||
* For all other elemment's 'ndescs' is the
|
||||
* number of descriptors chained by NEXT (as set in virtqueue_packed_pop).
|
||||
* So When the 'elem' be filled into the descriptor ring,
|
||||
* The 'idx' of this 'elem' shall be
|
||||
* the value of 'vq->used_idx' plus the 'ndescs'.
|
||||
*/
|
||||
ndescs += vq->used_elems[0].ndescs;
|
||||
for (i = 1; i < count; i++) {
|
||||
virtqueue_packed_fill_desc(vq, &vq->used_elems[i], i, false);
|
||||
virtqueue_packed_fill_desc(vq, &vq->used_elems[i], ndescs, false);
|
||||
ndescs += vq->used_elems[i].ndescs;
|
||||
}
|
||||
virtqueue_packed_fill_desc(vq, &vq->used_elems[0], 0, true);
|
||||
ndescs += vq->used_elems[0].ndescs;
|
||||
|
||||
vq->inuse -= ndescs;
|
||||
vq->used_idx += ndescs;
|
||||
@@ -5021,3 +5028,13 @@ static void virtio_register_types(void)
|
||||
}
|
||||
|
||||
type_init(virtio_register_types)
|
||||
|
||||
QEMUBH *virtio_bh_new_guarded_full(DeviceState *dev,
|
||||
QEMUBHFunc *cb, void *opaque,
|
||||
const char *name)
|
||||
{
|
||||
DeviceState *transport = qdev_get_parent_bus(dev)->parent;
|
||||
|
||||
return qemu_bh_new_full(cb, opaque, name,
|
||||
&transport->mem_reentrancy_guard);
|
||||
}
|
||||
|
||||
@@ -74,4 +74,7 @@ PCIDevice *pcie_sriov_get_pf(PCIDevice *dev);
|
||||
*/
|
||||
PCIDevice *pcie_sriov_get_vf_at_index(PCIDevice *dev, int n);
|
||||
|
||||
/* Returns the current number of virtual functions. */
|
||||
uint16_t pcie_sriov_num_vfs(PCIDevice *dev);
|
||||
|
||||
#endif /* QEMU_PCIE_SRIOV_H */
|
||||
|
||||
@@ -14,9 +14,21 @@
|
||||
#include "qom/object.h"
|
||||
|
||||
/*
|
||||
* IRQ range offsets per device type
|
||||
* The XIVE IRQ backend uses the same layout as the XICS backend but
|
||||
* covers the full range of the IRQ number space. The IRQ numbers for
|
||||
* the CPU IPIs are allocated at the bottom of this space, below 4K,
|
||||
* to preserve compatibility with XICS which does not use that range.
|
||||
*/
|
||||
|
||||
/*
|
||||
* CPU IPI range (XIVE only)
|
||||
*/
|
||||
#define SPAPR_IRQ_IPI 0x0
|
||||
#define SPAPR_IRQ_NR_IPIS 0x1000
|
||||
|
||||
/*
|
||||
* IRQ range offsets per device type
|
||||
*/
|
||||
|
||||
#define SPAPR_XIRQ_BASE XICS_IRQ_BASE /* 0x1000 */
|
||||
#define SPAPR_IRQ_EPOW (SPAPR_XIRQ_BASE + 0x0000)
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
*
|
||||
* Copyright (c) 2016 Artyom Tarasenko
|
||||
*
|
||||
* This code is licensed under the GNU GPL v3 or (at your option) any later
|
||||
* This code is licensed under the GNU GPL v2 or (at your option) any later
|
||||
* version.
|
||||
*/
|
||||
|
||||
|
||||
@@ -23,6 +23,7 @@
|
||||
#include "standard-headers/linux/virtio_ring.h"
|
||||
#include "qom/object.h"
|
||||
#include "hw/virtio/vhost.h"
|
||||
#include "block/aio.h"
|
||||
|
||||
/*
|
||||
* A guest should never accept this. It implies negotiation is broken
|
||||
@@ -463,4 +464,10 @@ static inline bool virtio_device_disabled(VirtIODevice *vdev)
|
||||
bool virtio_legacy_allowed(VirtIODevice *vdev);
|
||||
bool virtio_legacy_check_disabled(VirtIODevice *vdev);
|
||||
|
||||
QEMUBH *virtio_bh_new_guarded_full(DeviceState *dev,
|
||||
QEMUBHFunc *cb, void *opaque,
|
||||
const char *name);
|
||||
#define virtio_bh_new_guarded(dev, cb, opaque) \
|
||||
virtio_bh_new_guarded_full((dev), (cb), (opaque), (stringify(cb)))
|
||||
|
||||
#endif
|
||||
|
||||
+26
-15
@@ -2297,18 +2297,13 @@ static abi_long do_setsockopt(int sockfd, int level, int optname,
|
||||
switch (optname) {
|
||||
case ALG_SET_KEY:
|
||||
{
|
||||
char *alg_key = g_malloc(optlen);
|
||||
|
||||
char *alg_key = lock_user(VERIFY_READ, optval_addr, optlen, 1);
|
||||
if (!alg_key) {
|
||||
return -TARGET_ENOMEM;
|
||||
}
|
||||
if (copy_from_user(alg_key, optval_addr, optlen)) {
|
||||
g_free(alg_key);
|
||||
return -TARGET_EFAULT;
|
||||
}
|
||||
ret = get_errno(setsockopt(sockfd, level, optname,
|
||||
alg_key, optlen));
|
||||
g_free(alg_key);
|
||||
unlock_user(alg_key, optval_addr, optlen);
|
||||
break;
|
||||
}
|
||||
case ALG_SET_AEAD_AUTHSIZE:
|
||||
@@ -7233,11 +7228,17 @@ static inline int tswapid(int id)
|
||||
#else
|
||||
#define __NR_sys_setresgid __NR_setresgid
|
||||
#endif
|
||||
#ifdef __NR_setgroups32
|
||||
#define __NR_sys_setgroups __NR_setgroups32
|
||||
#else
|
||||
#define __NR_sys_setgroups __NR_setgroups
|
||||
#endif
|
||||
|
||||
_syscall1(int, sys_setuid, uid_t, uid)
|
||||
_syscall1(int, sys_setgid, gid_t, gid)
|
||||
_syscall3(int, sys_setresuid, uid_t, ruid, uid_t, euid, uid_t, suid)
|
||||
_syscall3(int, sys_setresgid, gid_t, rgid, gid_t, egid, gid_t, sgid)
|
||||
_syscall2(int, sys_setgroups, int, size, gid_t *, grouplist)
|
||||
|
||||
void syscall_init(void)
|
||||
{
|
||||
@@ -8759,14 +8760,24 @@ static abi_long do_syscall1(CPUArchState *cpu_env, int num, abi_long arg1,
|
||||
#ifdef TARGET_NR_waitid
|
||||
case TARGET_NR_waitid:
|
||||
{
|
||||
struct rusage ru;
|
||||
siginfo_t info;
|
||||
info.si_pid = 0;
|
||||
ret = get_errno(safe_waitid(arg1, arg2, &info, arg4, NULL));
|
||||
if (!is_error(ret) && arg3 && info.si_pid != 0) {
|
||||
if (!(p = lock_user(VERIFY_WRITE, arg3, sizeof(target_siginfo_t), 0)))
|
||||
|
||||
ret = get_errno(safe_waitid(arg1, arg2, (arg3 ? &info : NULL),
|
||||
arg4, (arg5 ? &ru : NULL)));
|
||||
if (!is_error(ret)) {
|
||||
if (arg3) {
|
||||
p = lock_user(VERIFY_WRITE, arg3,
|
||||
sizeof(target_siginfo_t), 0);
|
||||
if (!p) {
|
||||
return -TARGET_EFAULT;
|
||||
}
|
||||
host_to_target_siginfo(p, &info);
|
||||
unlock_user(p, arg3, sizeof(target_siginfo_t));
|
||||
}
|
||||
if (arg5 && host_to_target_rusage(arg5, &ru)) {
|
||||
return -TARGET_EFAULT;
|
||||
host_to_target_siginfo(p, &info);
|
||||
unlock_user(p, arg3, sizeof(target_siginfo_t));
|
||||
}
|
||||
}
|
||||
}
|
||||
return ret;
|
||||
@@ -11448,7 +11459,7 @@ static abi_long do_syscall1(CPUArchState *cpu_env, int num, abi_long arg1,
|
||||
unlock_user(target_grouplist, arg2,
|
||||
gidsetsize * sizeof(target_id));
|
||||
}
|
||||
return get_errno(setgroups(gidsetsize, grouplist));
|
||||
return get_errno(sys_setgroups(gidsetsize, grouplist));
|
||||
}
|
||||
case TARGET_NR_fchown:
|
||||
return get_errno(fchown(arg1, low2highuid(arg2), low2highgid(arg3)));
|
||||
@@ -11784,7 +11795,7 @@ static abi_long do_syscall1(CPUArchState *cpu_env, int num, abi_long arg1,
|
||||
}
|
||||
unlock_user(target_grouplist, arg2, 0);
|
||||
}
|
||||
return get_errno(setgroups(gidsetsize, grouplist));
|
||||
return get_errno(sys_setgroups(gidsetsize, grouplist));
|
||||
}
|
||||
#endif
|
||||
#ifdef TARGET_NR_fchown32
|
||||
|
||||
+4
-1
@@ -415,7 +415,10 @@ static int init_blk_migration(QEMUFile *f)
|
||||
}
|
||||
|
||||
sectors = bdrv_nb_sectors(bs);
|
||||
if (sectors <= 0) {
|
||||
if (sectors == 0) {
|
||||
continue;
|
||||
}
|
||||
if (sectors < 0) {
|
||||
ret = sectors;
|
||||
bdrv_next_cleanup(&it);
|
||||
goto out;
|
||||
|
||||
+1
-1
@@ -668,7 +668,7 @@ void *gpa2hva(MemoryRegion **p_mr, hwaddr addr, uint64_t size, Error **errp)
|
||||
}
|
||||
|
||||
if (!memory_region_is_ram(mrs.mr) && !memory_region_is_romd(mrs.mr)) {
|
||||
error_setg(errp, "Memory at address 0x%" HWADDR_PRIx "is not RAM", addr);
|
||||
error_setg(errp, "Memory at address 0x%" HWADDR_PRIx " is not RAM", addr);
|
||||
memory_region_unref(mrs.mr);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
+24
-4
@@ -596,13 +596,31 @@ static int nbd_request_simple_option(QIOChannel *ioc, int opt, bool strict,
|
||||
return 1;
|
||||
}
|
||||
|
||||
/* Callback to learn when QIO TLS upgrade is complete */
|
||||
struct NBDTLSClientHandshakeData {
|
||||
bool complete;
|
||||
Error *error;
|
||||
GMainLoop *loop;
|
||||
};
|
||||
|
||||
static void nbd_client_tls_handshake(QIOTask *task, void *opaque)
|
||||
{
|
||||
struct NBDTLSClientHandshakeData *data = opaque;
|
||||
|
||||
qio_task_propagate_error(task, &data->error);
|
||||
data->complete = true;
|
||||
if (data->loop) {
|
||||
g_main_loop_quit(data->loop);
|
||||
}
|
||||
}
|
||||
|
||||
static QIOChannel *nbd_receive_starttls(QIOChannel *ioc,
|
||||
QCryptoTLSCreds *tlscreds,
|
||||
const char *hostname, Error **errp)
|
||||
{
|
||||
int ret;
|
||||
QIOChannelTLS *tioc;
|
||||
struct NBDTLSHandshakeData data = { 0 };
|
||||
struct NBDTLSClientHandshakeData data = { 0 };
|
||||
|
||||
ret = nbd_request_simple_option(ioc, NBD_OPT_STARTTLS, true, errp);
|
||||
if (ret <= 0) {
|
||||
@@ -619,18 +637,20 @@ static QIOChannel *nbd_receive_starttls(QIOChannel *ioc,
|
||||
return NULL;
|
||||
}
|
||||
qio_channel_set_name(QIO_CHANNEL(tioc), "nbd-client-tls");
|
||||
data.loop = g_main_loop_new(g_main_context_default(), FALSE);
|
||||
trace_nbd_receive_starttls_tls_handshake();
|
||||
qio_channel_tls_handshake(tioc,
|
||||
nbd_tls_handshake,
|
||||
nbd_client_tls_handshake,
|
||||
&data,
|
||||
NULL,
|
||||
NULL);
|
||||
|
||||
if (!data.complete) {
|
||||
data.loop = g_main_loop_new(g_main_context_default(), FALSE);
|
||||
g_main_loop_run(data.loop);
|
||||
assert(data.complete);
|
||||
g_main_loop_unref(data.loop);
|
||||
}
|
||||
g_main_loop_unref(data.loop);
|
||||
|
||||
if (data.error) {
|
||||
error_propagate(errp, data.error);
|
||||
object_unref(OBJECT(tioc));
|
||||
|
||||
@@ -47,17 +47,6 @@ int nbd_drop(QIOChannel *ioc, size_t size, Error **errp)
|
||||
}
|
||||
|
||||
|
||||
void nbd_tls_handshake(QIOTask *task,
|
||||
void *opaque)
|
||||
{
|
||||
struct NBDTLSHandshakeData *data = opaque;
|
||||
|
||||
qio_task_propagate_error(task, &data->error);
|
||||
data->complete = true;
|
||||
g_main_loop_quit(data->loop);
|
||||
}
|
||||
|
||||
|
||||
const char *nbd_opt_lookup(uint32_t opt)
|
||||
{
|
||||
switch (opt) {
|
||||
|
||||
@@ -71,16 +71,6 @@ static inline int nbd_write(QIOChannel *ioc, const void *buffer, size_t size,
|
||||
return qio_channel_write_all(ioc, buffer, size, errp) < 0 ? -EIO : 0;
|
||||
}
|
||||
|
||||
struct NBDTLSHandshakeData {
|
||||
GMainLoop *loop;
|
||||
bool complete;
|
||||
Error *error;
|
||||
};
|
||||
|
||||
|
||||
void nbd_tls_handshake(QIOTask *task,
|
||||
void *opaque);
|
||||
|
||||
int nbd_drop(QIOChannel *ioc, size_t size, Error **errp);
|
||||
|
||||
#endif
|
||||
|
||||
+82
-48
@@ -189,8 +189,9 @@ static inline void set_be_option_rep(NBDOptionReply *rep, uint32_t option,
|
||||
|
||||
/* Send a reply header, including length, but no payload.
|
||||
* Return -errno on error, 0 on success. */
|
||||
static int nbd_negotiate_send_rep_len(NBDClient *client, uint32_t type,
|
||||
uint32_t len, Error **errp)
|
||||
static coroutine_fn int
|
||||
nbd_negotiate_send_rep_len(NBDClient *client, uint32_t type,
|
||||
uint32_t len, Error **errp)
|
||||
{
|
||||
NBDOptionReply rep;
|
||||
|
||||
@@ -205,15 +206,15 @@ static int nbd_negotiate_send_rep_len(NBDClient *client, uint32_t type,
|
||||
|
||||
/* Send a reply header with default 0 length.
|
||||
* Return -errno on error, 0 on success. */
|
||||
static int nbd_negotiate_send_rep(NBDClient *client, uint32_t type,
|
||||
Error **errp)
|
||||
static coroutine_fn int
|
||||
nbd_negotiate_send_rep(NBDClient *client, uint32_t type, Error **errp)
|
||||
{
|
||||
return nbd_negotiate_send_rep_len(client, type, 0, errp);
|
||||
}
|
||||
|
||||
/* Send an error reply.
|
||||
* Return -errno on error, 0 on success. */
|
||||
static int G_GNUC_PRINTF(4, 0)
|
||||
static coroutine_fn int G_GNUC_PRINTF(4, 0)
|
||||
nbd_negotiate_send_rep_verr(NBDClient *client, uint32_t type,
|
||||
Error **errp, const char *fmt, va_list va)
|
||||
{
|
||||
@@ -253,7 +254,7 @@ nbd_sanitize_name(const char *name)
|
||||
|
||||
/* Send an error reply.
|
||||
* Return -errno on error, 0 on success. */
|
||||
static int G_GNUC_PRINTF(4, 5)
|
||||
static coroutine_fn int G_GNUC_PRINTF(4, 5)
|
||||
nbd_negotiate_send_rep_err(NBDClient *client, uint32_t type,
|
||||
Error **errp, const char *fmt, ...)
|
||||
{
|
||||
@@ -269,7 +270,7 @@ nbd_negotiate_send_rep_err(NBDClient *client, uint32_t type,
|
||||
/* Drop remainder of the current option, and send a reply with the
|
||||
* given error type and message. Return -errno on read or write
|
||||
* failure; or 0 if connection is still live. */
|
||||
static int G_GNUC_PRINTF(4, 0)
|
||||
static coroutine_fn int G_GNUC_PRINTF(4, 0)
|
||||
nbd_opt_vdrop(NBDClient *client, uint32_t type, Error **errp,
|
||||
const char *fmt, va_list va)
|
||||
{
|
||||
@@ -282,7 +283,7 @@ nbd_opt_vdrop(NBDClient *client, uint32_t type, Error **errp,
|
||||
return ret;
|
||||
}
|
||||
|
||||
static int G_GNUC_PRINTF(4, 5)
|
||||
static coroutine_fn int G_GNUC_PRINTF(4, 5)
|
||||
nbd_opt_drop(NBDClient *client, uint32_t type, Error **errp,
|
||||
const char *fmt, ...)
|
||||
{
|
||||
@@ -296,7 +297,7 @@ nbd_opt_drop(NBDClient *client, uint32_t type, Error **errp,
|
||||
return ret;
|
||||
}
|
||||
|
||||
static int G_GNUC_PRINTF(3, 4)
|
||||
static coroutine_fn int G_GNUC_PRINTF(3, 4)
|
||||
nbd_opt_invalid(NBDClient *client, Error **errp, const char *fmt, ...)
|
||||
{
|
||||
int ret;
|
||||
@@ -313,8 +314,9 @@ nbd_opt_invalid(NBDClient *client, Error **errp, const char *fmt, ...)
|
||||
* If @check_nul, require that no NUL bytes appear in buffer.
|
||||
* Return -errno on I/O error, 0 if option was completely handled by
|
||||
* sending a reply about inconsistent lengths, or 1 on success. */
|
||||
static int nbd_opt_read(NBDClient *client, void *buffer, size_t size,
|
||||
bool check_nul, Error **errp)
|
||||
static coroutine_fn int
|
||||
nbd_opt_read(NBDClient *client, void *buffer, size_t size,
|
||||
bool check_nul, Error **errp)
|
||||
{
|
||||
if (size > client->optlen) {
|
||||
return nbd_opt_invalid(client, errp,
|
||||
@@ -337,7 +339,8 @@ static int nbd_opt_read(NBDClient *client, void *buffer, size_t size,
|
||||
/* Drop size bytes from the unparsed payload of the current option.
|
||||
* Return -errno on I/O error, 0 if option was completely handled by
|
||||
* sending a reply about inconsistent lengths, or 1 on success. */
|
||||
static int nbd_opt_skip(NBDClient *client, size_t size, Error **errp)
|
||||
static coroutine_fn int
|
||||
nbd_opt_skip(NBDClient *client, size_t size, Error **errp)
|
||||
{
|
||||
if (size > client->optlen) {
|
||||
return nbd_opt_invalid(client, errp,
|
||||
@@ -360,8 +363,9 @@ static int nbd_opt_skip(NBDClient *client, size_t size, Error **errp)
|
||||
* Return -errno on I/O error, 0 if option was completely handled by
|
||||
* sending a reply about inconsistent lengths, or 1 on success.
|
||||
*/
|
||||
static int nbd_opt_read_name(NBDClient *client, char **name, uint32_t *length,
|
||||
Error **errp)
|
||||
static coroutine_fn int
|
||||
nbd_opt_read_name(NBDClient *client, char **name, uint32_t *length,
|
||||
Error **errp)
|
||||
{
|
||||
int ret;
|
||||
uint32_t len;
|
||||
@@ -396,8 +400,8 @@ static int nbd_opt_read_name(NBDClient *client, char **name, uint32_t *length,
|
||||
|
||||
/* Send a single NBD_REP_SERVER reply to NBD_OPT_LIST, including payload.
|
||||
* Return -errno on error, 0 on success. */
|
||||
static int nbd_negotiate_send_rep_list(NBDClient *client, NBDExport *exp,
|
||||
Error **errp)
|
||||
static coroutine_fn int
|
||||
nbd_negotiate_send_rep_list(NBDClient *client, NBDExport *exp, Error **errp)
|
||||
{
|
||||
ERRP_GUARD();
|
||||
size_t name_len, desc_len;
|
||||
@@ -438,7 +442,8 @@ static int nbd_negotiate_send_rep_list(NBDClient *client, NBDExport *exp,
|
||||
|
||||
/* Process the NBD_OPT_LIST command, with a potential series of replies.
|
||||
* Return -errno on error, 0 on success. */
|
||||
static int nbd_negotiate_handle_list(NBDClient *client, Error **errp)
|
||||
static coroutine_fn int
|
||||
nbd_negotiate_handle_list(NBDClient *client, Error **errp)
|
||||
{
|
||||
NBDExport *exp;
|
||||
assert(client->opt == NBD_OPT_LIST);
|
||||
@@ -453,7 +458,8 @@ static int nbd_negotiate_handle_list(NBDClient *client, Error **errp)
|
||||
return nbd_negotiate_send_rep(client, NBD_REP_ACK, errp);
|
||||
}
|
||||
|
||||
static void nbd_check_meta_export(NBDClient *client)
|
||||
static coroutine_fn void
|
||||
nbd_check_meta_export(NBDClient *client)
|
||||
{
|
||||
if (client->exp != client->export_meta.exp) {
|
||||
client->export_meta.count = 0;
|
||||
@@ -462,8 +468,9 @@ static void nbd_check_meta_export(NBDClient *client)
|
||||
|
||||
/* Send a reply to NBD_OPT_EXPORT_NAME.
|
||||
* Return -errno on error, 0 on success. */
|
||||
static int nbd_negotiate_handle_export_name(NBDClient *client, bool no_zeroes,
|
||||
Error **errp)
|
||||
static coroutine_fn int
|
||||
nbd_negotiate_handle_export_name(NBDClient *client, bool no_zeroes,
|
||||
Error **errp)
|
||||
{
|
||||
ERRP_GUARD();
|
||||
g_autofree char *name = NULL;
|
||||
@@ -523,9 +530,9 @@ static int nbd_negotiate_handle_export_name(NBDClient *client, bool no_zeroes,
|
||||
/* Send a single NBD_REP_INFO, with a buffer @buf of @length bytes.
|
||||
* The buffer does NOT include the info type prefix.
|
||||
* Return -errno on error, 0 if ready to send more. */
|
||||
static int nbd_negotiate_send_info(NBDClient *client,
|
||||
uint16_t info, uint32_t length, void *buf,
|
||||
Error **errp)
|
||||
static coroutine_fn int
|
||||
nbd_negotiate_send_info(NBDClient *client, uint16_t info, uint32_t length,
|
||||
void *buf, Error **errp)
|
||||
{
|
||||
int rc;
|
||||
|
||||
@@ -552,7 +559,8 @@ static int nbd_negotiate_send_info(NBDClient *client,
|
||||
* -errno transmission error occurred or @fatal was requested, errp is set
|
||||
* 0 error message successfully sent to client, errp is not set
|
||||
*/
|
||||
static int nbd_reject_length(NBDClient *client, bool fatal, Error **errp)
|
||||
static coroutine_fn int
|
||||
nbd_reject_length(NBDClient *client, bool fatal, Error **errp)
|
||||
{
|
||||
int ret;
|
||||
|
||||
@@ -570,7 +578,8 @@ static int nbd_reject_length(NBDClient *client, bool fatal, Error **errp)
|
||||
/* Handle NBD_OPT_INFO and NBD_OPT_GO.
|
||||
* Return -errno on error, 0 if ready for next option, and 1 to move
|
||||
* into transmission phase. */
|
||||
static int nbd_negotiate_handle_info(NBDClient *client, Error **errp)
|
||||
static coroutine_fn int
|
||||
nbd_negotiate_handle_info(NBDClient *client, Error **errp)
|
||||
{
|
||||
int rc;
|
||||
g_autofree char *name = NULL;
|
||||
@@ -729,15 +738,33 @@ static int nbd_negotiate_handle_info(NBDClient *client, Error **errp)
|
||||
return rc;
|
||||
}
|
||||
|
||||
/* Callback to learn when QIO TLS upgrade is complete */
|
||||
struct NBDTLSServerHandshakeData {
|
||||
bool complete;
|
||||
Error *error;
|
||||
Coroutine *co;
|
||||
};
|
||||
|
||||
static void
|
||||
nbd_server_tls_handshake(QIOTask *task, void *opaque)
|
||||
{
|
||||
struct NBDTLSServerHandshakeData *data = opaque;
|
||||
|
||||
qio_task_propagate_error(task, &data->error);
|
||||
data->complete = true;
|
||||
if (!qemu_coroutine_entered(data->co)) {
|
||||
aio_co_wake(data->co);
|
||||
}
|
||||
}
|
||||
|
||||
/* Handle NBD_OPT_STARTTLS. Return NULL to drop connection, or else the
|
||||
* new channel for all further (now-encrypted) communication. */
|
||||
static QIOChannel *nbd_negotiate_handle_starttls(NBDClient *client,
|
||||
Error **errp)
|
||||
static coroutine_fn QIOChannel *
|
||||
nbd_negotiate_handle_starttls(NBDClient *client, Error **errp)
|
||||
{
|
||||
QIOChannel *ioc;
|
||||
QIOChannelTLS *tioc;
|
||||
struct NBDTLSHandshakeData data = { 0 };
|
||||
struct NBDTLSServerHandshakeData data = { 0 };
|
||||
|
||||
assert(client->opt == NBD_OPT_STARTTLS);
|
||||
|
||||
@@ -758,17 +785,18 @@ static QIOChannel *nbd_negotiate_handle_starttls(NBDClient *client,
|
||||
|
||||
qio_channel_set_name(QIO_CHANNEL(tioc), "nbd-server-tls");
|
||||
trace_nbd_negotiate_handle_starttls_handshake();
|
||||
data.loop = g_main_loop_new(g_main_context_default(), FALSE);
|
||||
data.co = qemu_coroutine_self();
|
||||
qio_channel_tls_handshake(tioc,
|
||||
nbd_tls_handshake,
|
||||
nbd_server_tls_handshake,
|
||||
&data,
|
||||
NULL,
|
||||
NULL);
|
||||
|
||||
if (!data.complete) {
|
||||
g_main_loop_run(data.loop);
|
||||
qemu_coroutine_yield();
|
||||
assert(data.complete);
|
||||
}
|
||||
g_main_loop_unref(data.loop);
|
||||
|
||||
if (data.error) {
|
||||
object_unref(OBJECT(tioc));
|
||||
error_propagate(errp, data.error);
|
||||
@@ -784,10 +812,9 @@ static QIOChannel *nbd_negotiate_handle_starttls(NBDClient *client,
|
||||
*
|
||||
* For NBD_OPT_LIST_META_CONTEXT @context_id is ignored, 0 is used instead.
|
||||
*/
|
||||
static int nbd_negotiate_send_meta_context(NBDClient *client,
|
||||
const char *context,
|
||||
uint32_t context_id,
|
||||
Error **errp)
|
||||
static coroutine_fn int
|
||||
nbd_negotiate_send_meta_context(NBDClient *client, const char *context,
|
||||
uint32_t context_id, Error **errp)
|
||||
{
|
||||
NBDOptionReplyMetaContext opt;
|
||||
struct iovec iov[] = {
|
||||
@@ -812,8 +839,9 @@ static int nbd_negotiate_send_meta_context(NBDClient *client,
|
||||
* Return true if @query matches @pattern, or if @query is empty when
|
||||
* the @client is performing _LIST_.
|
||||
*/
|
||||
static bool nbd_meta_empty_or_pattern(NBDClient *client, const char *pattern,
|
||||
const char *query)
|
||||
static coroutine_fn bool
|
||||
nbd_meta_empty_or_pattern(NBDClient *client, const char *pattern,
|
||||
const char *query)
|
||||
{
|
||||
if (!*query) {
|
||||
trace_nbd_negotiate_meta_query_parse("empty");
|
||||
@@ -830,7 +858,8 @@ static bool nbd_meta_empty_or_pattern(NBDClient *client, const char *pattern,
|
||||
/*
|
||||
* Return true and adjust @str in place if it begins with @prefix.
|
||||
*/
|
||||
static bool nbd_strshift(const char **str, const char *prefix)
|
||||
static coroutine_fn bool
|
||||
nbd_strshift(const char **str, const char *prefix)
|
||||
{
|
||||
size_t len = strlen(prefix);
|
||||
|
||||
@@ -846,8 +875,9 @@ static bool nbd_strshift(const char **str, const char *prefix)
|
||||
* Handle queries to 'base' namespace. For now, only the base:allocation
|
||||
* context is available. Return true if @query has been handled.
|
||||
*/
|
||||
static bool nbd_meta_base_query(NBDClient *client, NBDExportMetaContexts *meta,
|
||||
const char *query)
|
||||
static coroutine_fn bool
|
||||
nbd_meta_base_query(NBDClient *client, NBDExportMetaContexts *meta,
|
||||
const char *query)
|
||||
{
|
||||
if (!nbd_strshift(&query, "base:")) {
|
||||
return false;
|
||||
@@ -866,8 +896,9 @@ static bool nbd_meta_base_query(NBDClient *client, NBDExportMetaContexts *meta,
|
||||
* and qemu:allocation-depth contexts are available. Return true if @query
|
||||
* has been handled.
|
||||
*/
|
||||
static bool nbd_meta_qemu_query(NBDClient *client, NBDExportMetaContexts *meta,
|
||||
const char *query)
|
||||
static coroutine_fn bool
|
||||
nbd_meta_qemu_query(NBDClient *client, NBDExportMetaContexts *meta,
|
||||
const char *query)
|
||||
{
|
||||
size_t i;
|
||||
|
||||
@@ -931,8 +962,9 @@ static bool nbd_meta_qemu_query(NBDClient *client, NBDExportMetaContexts *meta,
|
||||
*
|
||||
* Return -errno on I/O error, 0 if option was completely handled by
|
||||
* sending a reply about inconsistent lengths, or 1 on success. */
|
||||
static int nbd_negotiate_meta_query(NBDClient *client,
|
||||
NBDExportMetaContexts *meta, Error **errp)
|
||||
static coroutine_fn int
|
||||
nbd_negotiate_meta_query(NBDClient *client,
|
||||
NBDExportMetaContexts *meta, Error **errp)
|
||||
{
|
||||
int ret;
|
||||
g_autofree char *query = NULL;
|
||||
@@ -971,8 +1003,9 @@ static int nbd_negotiate_meta_query(NBDClient *client,
|
||||
* Handle NBD_OPT_LIST_META_CONTEXT and NBD_OPT_SET_META_CONTEXT
|
||||
*
|
||||
* Return -errno on I/O error, or 0 if option was completely handled. */
|
||||
static int nbd_negotiate_meta_queries(NBDClient *client,
|
||||
NBDExportMetaContexts *meta, Error **errp)
|
||||
static coroutine_fn int
|
||||
nbd_negotiate_meta_queries(NBDClient *client,
|
||||
NBDExportMetaContexts *meta, Error **errp)
|
||||
{
|
||||
int ret;
|
||||
g_autofree char *export_name = NULL;
|
||||
@@ -1096,7 +1129,8 @@ static int nbd_negotiate_meta_queries(NBDClient *client,
|
||||
* 1 if client sent NBD_OPT_ABORT, i.e. on valid disconnect,
|
||||
* errp is not set
|
||||
*/
|
||||
static int nbd_negotiate_options(NBDClient *client, Error **errp)
|
||||
static coroutine_fn int
|
||||
nbd_negotiate_options(NBDClient *client, Error **errp)
|
||||
{
|
||||
uint32_t flags;
|
||||
bool fixedNewstyle = false;
|
||||
|
||||
+3
-3
@@ -149,14 +149,14 @@ SRST
|
||||
platform and configuration dependent.
|
||||
|
||||
``interleave-granularity=granularity`` sets the granularity of
|
||||
interleave. Default 256KiB. Only 256KiB, 512KiB, 1024KiB, 2048KiB
|
||||
4096KiB, 8192KiB and 16384KiB granularities supported.
|
||||
interleave. Default 256 (bytes). Only 256, 512, 1k, 2k,
|
||||
4k, 8k and 16k granularities supported.
|
||||
|
||||
Example:
|
||||
|
||||
::
|
||||
|
||||
-machine cxl-fmw.0.targets.0=cxl.0,cxl-fmw.0.targets.1=cxl.1,cxl-fmw.0.size=128G,cxl-fmw.0.interleave-granularity=512k
|
||||
-machine cxl-fmw.0.targets.0=cxl.0,cxl-fmw.0.targets.1=cxl.1,cxl-fmw.0.size=128G,cxl-fmw.0.interleave-granularity=512
|
||||
ERST
|
||||
|
||||
DEF("M", HAS_ARG, QEMU_OPTION_M,
|
||||
|
||||
@@ -34,5 +34,5 @@ git submodule update --init
|
||||
CryptoPkg/Library/OpensslLib/openssl \
|
||||
MdeModulePkg/Library/BrotliCustomDecompressLib/brotli)
|
||||
popd
|
||||
tar --exclude=.git -cjf ${destination}.tar.bz2 ${destination}
|
||||
tar --exclude=.git -cJf ${destination}.tar.xz ${destination}
|
||||
rm -rf ${destination}
|
||||
|
||||
+11
-12
@@ -853,19 +853,18 @@ void qmp_device_add(QDict *qdict, QObject **ret_data, Error **errp)
|
||||
return;
|
||||
}
|
||||
dev = qdev_device_add(opts, errp);
|
||||
|
||||
/*
|
||||
* Drain all pending RCU callbacks. This is done because
|
||||
* some bus related operations can delay a device removal
|
||||
* (in this case this can happen if device is added and then
|
||||
* removed due to a configuration error)
|
||||
* to a RCU callback, but user might expect that this interface
|
||||
* will finish its job completely once qmp command returns result
|
||||
* to the user
|
||||
*/
|
||||
drain_call_rcu();
|
||||
|
||||
if (!dev) {
|
||||
/*
|
||||
* Drain all pending RCU callbacks. This is done because
|
||||
* some bus related operations can delay a device removal
|
||||
* (in this case this can happen if device is added and then
|
||||
* removed due to a configuration error)
|
||||
* to a RCU callback, but user might expect that this interface
|
||||
* will finish its job completely once qmp command returns result
|
||||
* to the user
|
||||
*/
|
||||
drain_call_rcu();
|
||||
|
||||
qemu_opts_del(opts);
|
||||
return;
|
||||
}
|
||||
|
||||
+5
-1
@@ -190,7 +190,11 @@ void arm_cpu_sve_finalize(ARMCPU *cpu, Error **errp)
|
||||
* No explicit bits enabled, and no implicit bits from sve-max-vq.
|
||||
*/
|
||||
if (!cpu_isar_feature(aa64_sve, cpu)) {
|
||||
/* SVE is disabled and so are all vector lengths. Good. */
|
||||
/*
|
||||
* SVE is disabled and so are all vector lengths. Good.
|
||||
* Disable all SVE extensions as well.
|
||||
*/
|
||||
cpu->isar.id_aa64zfr0 = 0;
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
+79
-17
@@ -7852,31 +7852,89 @@ void register_cp_regs_for_features(ARMCPU *cpu)
|
||||
#ifdef CONFIG_USER_ONLY
|
||||
static const ARMCPRegUserSpaceInfo v8_user_idregs[] = {
|
||||
{ .name = "ID_AA64PFR0_EL1",
|
||||
.exported_bits = 0x000f000f00ff0000,
|
||||
.fixed_bits = 0x0000000000000011 },
|
||||
.exported_bits = R_ID_AA64PFR0_FP_MASK |
|
||||
R_ID_AA64PFR0_ADVSIMD_MASK |
|
||||
R_ID_AA64PFR0_SVE_MASK |
|
||||
R_ID_AA64PFR0_DIT_MASK,
|
||||
.fixed_bits = (0x1u << R_ID_AA64PFR0_EL0_SHIFT) |
|
||||
(0x1u << R_ID_AA64PFR0_EL1_SHIFT) },
|
||||
{ .name = "ID_AA64PFR1_EL1",
|
||||
.exported_bits = 0x00000000000000f0 },
|
||||
.exported_bits = R_ID_AA64PFR1_BT_MASK |
|
||||
R_ID_AA64PFR1_SSBS_MASK |
|
||||
R_ID_AA64PFR1_MTE_MASK |
|
||||
R_ID_AA64PFR1_SME_MASK },
|
||||
{ .name = "ID_AA64PFR*_EL1_RESERVED",
|
||||
.is_glob = true },
|
||||
{ .name = "ID_AA64ZFR0_EL1" },
|
||||
.is_glob = true },
|
||||
{ .name = "ID_AA64ZFR0_EL1",
|
||||
.exported_bits = R_ID_AA64ZFR0_SVEVER_MASK |
|
||||
R_ID_AA64ZFR0_AES_MASK |
|
||||
R_ID_AA64ZFR0_BITPERM_MASK |
|
||||
R_ID_AA64ZFR0_BFLOAT16_MASK |
|
||||
R_ID_AA64ZFR0_SHA3_MASK |
|
||||
R_ID_AA64ZFR0_SM4_MASK |
|
||||
R_ID_AA64ZFR0_I8MM_MASK |
|
||||
R_ID_AA64ZFR0_F32MM_MASK |
|
||||
R_ID_AA64ZFR0_F64MM_MASK },
|
||||
{ .name = "ID_AA64SMFR0_EL1",
|
||||
.exported_bits = R_ID_AA64SMFR0_F32F32_MASK |
|
||||
R_ID_AA64SMFR0_B16F32_MASK |
|
||||
R_ID_AA64SMFR0_F16F32_MASK |
|
||||
R_ID_AA64SMFR0_I8I32_MASK |
|
||||
R_ID_AA64SMFR0_F64F64_MASK |
|
||||
R_ID_AA64SMFR0_I16I64_MASK |
|
||||
R_ID_AA64SMFR0_FA64_MASK },
|
||||
{ .name = "ID_AA64MMFR0_EL1",
|
||||
.fixed_bits = 0x00000000ff000000 },
|
||||
{ .name = "ID_AA64MMFR1_EL1" },
|
||||
.exported_bits = R_ID_AA64MMFR0_ECV_MASK,
|
||||
.fixed_bits = (0xfu << R_ID_AA64MMFR0_TGRAN64_SHIFT) |
|
||||
(0xfu << R_ID_AA64MMFR0_TGRAN4_SHIFT) },
|
||||
{ .name = "ID_AA64MMFR1_EL1",
|
||||
.exported_bits = R_ID_AA64MMFR1_AFP_MASK },
|
||||
{ .name = "ID_AA64MMFR2_EL1",
|
||||
.exported_bits = R_ID_AA64MMFR2_AT_MASK },
|
||||
{ .name = "ID_AA64MMFR*_EL1_RESERVED",
|
||||
.is_glob = true },
|
||||
.is_glob = true },
|
||||
{ .name = "ID_AA64DFR0_EL1",
|
||||
.fixed_bits = 0x0000000000000006 },
|
||||
{ .name = "ID_AA64DFR1_EL1" },
|
||||
.fixed_bits = (0x6u << R_ID_AA64DFR0_DEBUGVER_SHIFT) },
|
||||
{ .name = "ID_AA64DFR1_EL1" },
|
||||
{ .name = "ID_AA64DFR*_EL1_RESERVED",
|
||||
.is_glob = true },
|
||||
.is_glob = true },
|
||||
{ .name = "ID_AA64AFR*",
|
||||
.is_glob = true },
|
||||
.is_glob = true },
|
||||
{ .name = "ID_AA64ISAR0_EL1",
|
||||
.exported_bits = 0x00fffffff0fffff0 },
|
||||
.exported_bits = R_ID_AA64ISAR0_AES_MASK |
|
||||
R_ID_AA64ISAR0_SHA1_MASK |
|
||||
R_ID_AA64ISAR0_SHA2_MASK |
|
||||
R_ID_AA64ISAR0_CRC32_MASK |
|
||||
R_ID_AA64ISAR0_ATOMIC_MASK |
|
||||
R_ID_AA64ISAR0_RDM_MASK |
|
||||
R_ID_AA64ISAR0_SHA3_MASK |
|
||||
R_ID_AA64ISAR0_SM3_MASK |
|
||||
R_ID_AA64ISAR0_SM4_MASK |
|
||||
R_ID_AA64ISAR0_DP_MASK |
|
||||
R_ID_AA64ISAR0_FHM_MASK |
|
||||
R_ID_AA64ISAR0_TS_MASK |
|
||||
R_ID_AA64ISAR0_RNDR_MASK },
|
||||
{ .name = "ID_AA64ISAR1_EL1",
|
||||
.exported_bits = 0x000000f0ffffffff },
|
||||
.exported_bits = R_ID_AA64ISAR1_DPB_MASK |
|
||||
R_ID_AA64ISAR1_APA_MASK |
|
||||
R_ID_AA64ISAR1_API_MASK |
|
||||
R_ID_AA64ISAR1_JSCVT_MASK |
|
||||
R_ID_AA64ISAR1_FCMA_MASK |
|
||||
R_ID_AA64ISAR1_LRCPC_MASK |
|
||||
R_ID_AA64ISAR1_GPA_MASK |
|
||||
R_ID_AA64ISAR1_GPI_MASK |
|
||||
R_ID_AA64ISAR1_FRINTTS_MASK |
|
||||
R_ID_AA64ISAR1_SB_MASK |
|
||||
R_ID_AA64ISAR1_BF16_MASK |
|
||||
R_ID_AA64ISAR1_DGH_MASK |
|
||||
R_ID_AA64ISAR1_I8MM_MASK },
|
||||
{ .name = "ID_AA64ISAR2_EL1",
|
||||
.exported_bits = R_ID_AA64ISAR2_WFXT_MASK |
|
||||
R_ID_AA64ISAR2_RPRES_MASK |
|
||||
R_ID_AA64ISAR2_GPA3_MASK |
|
||||
R_ID_AA64ISAR2_APA3_MASK },
|
||||
{ .name = "ID_AA64ISAR*_EL1_RESERVED",
|
||||
.is_glob = true },
|
||||
.is_glob = true },
|
||||
};
|
||||
modify_arm_cp_regs(v8_idregs, v8_user_idregs);
|
||||
#endif
|
||||
@@ -8194,8 +8252,12 @@ void register_cp_regs_for_features(ARMCPU *cpu)
|
||||
#ifdef CONFIG_USER_ONLY
|
||||
static const ARMCPRegUserSpaceInfo id_v8_user_midr_cp_reginfo[] = {
|
||||
{ .name = "MIDR_EL1",
|
||||
.exported_bits = 0x00000000ffffffff },
|
||||
{ .name = "REVIDR_EL1" },
|
||||
.exported_bits = R_MIDR_EL1_REVISION_MASK |
|
||||
R_MIDR_EL1_PARTNUM_MASK |
|
||||
R_MIDR_EL1_ARCHITECTURE_MASK |
|
||||
R_MIDR_EL1_VARIANT_MASK |
|
||||
R_MIDR_EL1_IMPLEMENTER_MASK },
|
||||
{ .name = "REVIDR_EL1" },
|
||||
};
|
||||
modify_arm_cp_regs(id_v8_midr_cp_reginfo, id_v8_user_midr_cp_reginfo);
|
||||
#endif
|
||||
|
||||
+65
-65
@@ -187,85 +187,85 @@ struct hvf_sreg_match {
|
||||
};
|
||||
|
||||
static struct hvf_sreg_match hvf_sreg_match[] = {
|
||||
{ HV_SYS_REG_DBGBVR0_EL1, HVF_SYSREG(0, 0, 14, 0, 4) },
|
||||
{ HV_SYS_REG_DBGBCR0_EL1, HVF_SYSREG(0, 0, 14, 0, 5) },
|
||||
{ HV_SYS_REG_DBGWVR0_EL1, HVF_SYSREG(0, 0, 14, 0, 6) },
|
||||
{ HV_SYS_REG_DBGWCR0_EL1, HVF_SYSREG(0, 0, 14, 0, 7) },
|
||||
{ HV_SYS_REG_DBGBVR0_EL1, HVF_SYSREG(0, 0, 2, 0, 4) },
|
||||
{ HV_SYS_REG_DBGBCR0_EL1, HVF_SYSREG(0, 0, 2, 0, 5) },
|
||||
{ HV_SYS_REG_DBGWVR0_EL1, HVF_SYSREG(0, 0, 2, 0, 6) },
|
||||
{ HV_SYS_REG_DBGWCR0_EL1, HVF_SYSREG(0, 0, 2, 0, 7) },
|
||||
|
||||
{ HV_SYS_REG_DBGBVR1_EL1, HVF_SYSREG(0, 1, 14, 0, 4) },
|
||||
{ HV_SYS_REG_DBGBCR1_EL1, HVF_SYSREG(0, 1, 14, 0, 5) },
|
||||
{ HV_SYS_REG_DBGWVR1_EL1, HVF_SYSREG(0, 1, 14, 0, 6) },
|
||||
{ HV_SYS_REG_DBGWCR1_EL1, HVF_SYSREG(0, 1, 14, 0, 7) },
|
||||
{ HV_SYS_REG_DBGBVR1_EL1, HVF_SYSREG(0, 1, 2, 0, 4) },
|
||||
{ HV_SYS_REG_DBGBCR1_EL1, HVF_SYSREG(0, 1, 2, 0, 5) },
|
||||
{ HV_SYS_REG_DBGWVR1_EL1, HVF_SYSREG(0, 1, 2, 0, 6) },
|
||||
{ HV_SYS_REG_DBGWCR1_EL1, HVF_SYSREG(0, 1, 2, 0, 7) },
|
||||
|
||||
{ HV_SYS_REG_DBGBVR2_EL1, HVF_SYSREG(0, 2, 14, 0, 4) },
|
||||
{ HV_SYS_REG_DBGBCR2_EL1, HVF_SYSREG(0, 2, 14, 0, 5) },
|
||||
{ HV_SYS_REG_DBGWVR2_EL1, HVF_SYSREG(0, 2, 14, 0, 6) },
|
||||
{ HV_SYS_REG_DBGWCR2_EL1, HVF_SYSREG(0, 2, 14, 0, 7) },
|
||||
{ HV_SYS_REG_DBGBVR2_EL1, HVF_SYSREG(0, 2, 2, 0, 4) },
|
||||
{ HV_SYS_REG_DBGBCR2_EL1, HVF_SYSREG(0, 2, 2, 0, 5) },
|
||||
{ HV_SYS_REG_DBGWVR2_EL1, HVF_SYSREG(0, 2, 2, 0, 6) },
|
||||
{ HV_SYS_REG_DBGWCR2_EL1, HVF_SYSREG(0, 2, 2, 0, 7) },
|
||||
|
||||
{ HV_SYS_REG_DBGBVR3_EL1, HVF_SYSREG(0, 3, 14, 0, 4) },
|
||||
{ HV_SYS_REG_DBGBCR3_EL1, HVF_SYSREG(0, 3, 14, 0, 5) },
|
||||
{ HV_SYS_REG_DBGWVR3_EL1, HVF_SYSREG(0, 3, 14, 0, 6) },
|
||||
{ HV_SYS_REG_DBGWCR3_EL1, HVF_SYSREG(0, 3, 14, 0, 7) },
|
||||
{ HV_SYS_REG_DBGBVR3_EL1, HVF_SYSREG(0, 3, 2, 0, 4) },
|
||||
{ HV_SYS_REG_DBGBCR3_EL1, HVF_SYSREG(0, 3, 2, 0, 5) },
|
||||
{ HV_SYS_REG_DBGWVR3_EL1, HVF_SYSREG(0, 3, 2, 0, 6) },
|
||||
{ HV_SYS_REG_DBGWCR3_EL1, HVF_SYSREG(0, 3, 2, 0, 7) },
|
||||
|
||||
{ HV_SYS_REG_DBGBVR4_EL1, HVF_SYSREG(0, 4, 14, 0, 4) },
|
||||
{ HV_SYS_REG_DBGBCR4_EL1, HVF_SYSREG(0, 4, 14, 0, 5) },
|
||||
{ HV_SYS_REG_DBGWVR4_EL1, HVF_SYSREG(0, 4, 14, 0, 6) },
|
||||
{ HV_SYS_REG_DBGWCR4_EL1, HVF_SYSREG(0, 4, 14, 0, 7) },
|
||||
{ HV_SYS_REG_DBGBVR4_EL1, HVF_SYSREG(0, 4, 2, 0, 4) },
|
||||
{ HV_SYS_REG_DBGBCR4_EL1, HVF_SYSREG(0, 4, 2, 0, 5) },
|
||||
{ HV_SYS_REG_DBGWVR4_EL1, HVF_SYSREG(0, 4, 2, 0, 6) },
|
||||
{ HV_SYS_REG_DBGWCR4_EL1, HVF_SYSREG(0, 4, 2, 0, 7) },
|
||||
|
||||
{ HV_SYS_REG_DBGBVR5_EL1, HVF_SYSREG(0, 5, 14, 0, 4) },
|
||||
{ HV_SYS_REG_DBGBCR5_EL1, HVF_SYSREG(0, 5, 14, 0, 5) },
|
||||
{ HV_SYS_REG_DBGWVR5_EL1, HVF_SYSREG(0, 5, 14, 0, 6) },
|
||||
{ HV_SYS_REG_DBGWCR5_EL1, HVF_SYSREG(0, 5, 14, 0, 7) },
|
||||
{ HV_SYS_REG_DBGBVR5_EL1, HVF_SYSREG(0, 5, 2, 0, 4) },
|
||||
{ HV_SYS_REG_DBGBCR5_EL1, HVF_SYSREG(0, 5, 2, 0, 5) },
|
||||
{ HV_SYS_REG_DBGWVR5_EL1, HVF_SYSREG(0, 5, 2, 0, 6) },
|
||||
{ HV_SYS_REG_DBGWCR5_EL1, HVF_SYSREG(0, 5, 2, 0, 7) },
|
||||
|
||||
{ HV_SYS_REG_DBGBVR6_EL1, HVF_SYSREG(0, 6, 14, 0, 4) },
|
||||
{ HV_SYS_REG_DBGBCR6_EL1, HVF_SYSREG(0, 6, 14, 0, 5) },
|
||||
{ HV_SYS_REG_DBGWVR6_EL1, HVF_SYSREG(0, 6, 14, 0, 6) },
|
||||
{ HV_SYS_REG_DBGWCR6_EL1, HVF_SYSREG(0, 6, 14, 0, 7) },
|
||||
{ HV_SYS_REG_DBGBVR6_EL1, HVF_SYSREG(0, 6, 2, 0, 4) },
|
||||
{ HV_SYS_REG_DBGBCR6_EL1, HVF_SYSREG(0, 6, 2, 0, 5) },
|
||||
{ HV_SYS_REG_DBGWVR6_EL1, HVF_SYSREG(0, 6, 2, 0, 6) },
|
||||
{ HV_SYS_REG_DBGWCR6_EL1, HVF_SYSREG(0, 6, 2, 0, 7) },
|
||||
|
||||
{ HV_SYS_REG_DBGBVR7_EL1, HVF_SYSREG(0, 7, 14, 0, 4) },
|
||||
{ HV_SYS_REG_DBGBCR7_EL1, HVF_SYSREG(0, 7, 14, 0, 5) },
|
||||
{ HV_SYS_REG_DBGWVR7_EL1, HVF_SYSREG(0, 7, 14, 0, 6) },
|
||||
{ HV_SYS_REG_DBGWCR7_EL1, HVF_SYSREG(0, 7, 14, 0, 7) },
|
||||
{ HV_SYS_REG_DBGBVR7_EL1, HVF_SYSREG(0, 7, 2, 0, 4) },
|
||||
{ HV_SYS_REG_DBGBCR7_EL1, HVF_SYSREG(0, 7, 2, 0, 5) },
|
||||
{ HV_SYS_REG_DBGWVR7_EL1, HVF_SYSREG(0, 7, 2, 0, 6) },
|
||||
{ HV_SYS_REG_DBGWCR7_EL1, HVF_SYSREG(0, 7, 2, 0, 7) },
|
||||
|
||||
{ HV_SYS_REG_DBGBVR8_EL1, HVF_SYSREG(0, 8, 14, 0, 4) },
|
||||
{ HV_SYS_REG_DBGBCR8_EL1, HVF_SYSREG(0, 8, 14, 0, 5) },
|
||||
{ HV_SYS_REG_DBGWVR8_EL1, HVF_SYSREG(0, 8, 14, 0, 6) },
|
||||
{ HV_SYS_REG_DBGWCR8_EL1, HVF_SYSREG(0, 8, 14, 0, 7) },
|
||||
{ HV_SYS_REG_DBGBVR8_EL1, HVF_SYSREG(0, 8, 2, 0, 4) },
|
||||
{ HV_SYS_REG_DBGBCR8_EL1, HVF_SYSREG(0, 8, 2, 0, 5) },
|
||||
{ HV_SYS_REG_DBGWVR8_EL1, HVF_SYSREG(0, 8, 2, 0, 6) },
|
||||
{ HV_SYS_REG_DBGWCR8_EL1, HVF_SYSREG(0, 8, 2, 0, 7) },
|
||||
|
||||
{ HV_SYS_REG_DBGBVR9_EL1, HVF_SYSREG(0, 9, 14, 0, 4) },
|
||||
{ HV_SYS_REG_DBGBCR9_EL1, HVF_SYSREG(0, 9, 14, 0, 5) },
|
||||
{ HV_SYS_REG_DBGWVR9_EL1, HVF_SYSREG(0, 9, 14, 0, 6) },
|
||||
{ HV_SYS_REG_DBGWCR9_EL1, HVF_SYSREG(0, 9, 14, 0, 7) },
|
||||
{ HV_SYS_REG_DBGBVR9_EL1, HVF_SYSREG(0, 9, 2, 0, 4) },
|
||||
{ HV_SYS_REG_DBGBCR9_EL1, HVF_SYSREG(0, 9, 2, 0, 5) },
|
||||
{ HV_SYS_REG_DBGWVR9_EL1, HVF_SYSREG(0, 9, 2, 0, 6) },
|
||||
{ HV_SYS_REG_DBGWCR9_EL1, HVF_SYSREG(0, 9, 2, 0, 7) },
|
||||
|
||||
{ HV_SYS_REG_DBGBVR10_EL1, HVF_SYSREG(0, 10, 14, 0, 4) },
|
||||
{ HV_SYS_REG_DBGBCR10_EL1, HVF_SYSREG(0, 10, 14, 0, 5) },
|
||||
{ HV_SYS_REG_DBGWVR10_EL1, HVF_SYSREG(0, 10, 14, 0, 6) },
|
||||
{ HV_SYS_REG_DBGWCR10_EL1, HVF_SYSREG(0, 10, 14, 0, 7) },
|
||||
{ HV_SYS_REG_DBGBVR10_EL1, HVF_SYSREG(0, 10, 2, 0, 4) },
|
||||
{ HV_SYS_REG_DBGBCR10_EL1, HVF_SYSREG(0, 10, 2, 0, 5) },
|
||||
{ HV_SYS_REG_DBGWVR10_EL1, HVF_SYSREG(0, 10, 2, 0, 6) },
|
||||
{ HV_SYS_REG_DBGWCR10_EL1, HVF_SYSREG(0, 10, 2, 0, 7) },
|
||||
|
||||
{ HV_SYS_REG_DBGBVR11_EL1, HVF_SYSREG(0, 11, 14, 0, 4) },
|
||||
{ HV_SYS_REG_DBGBCR11_EL1, HVF_SYSREG(0, 11, 14, 0, 5) },
|
||||
{ HV_SYS_REG_DBGWVR11_EL1, HVF_SYSREG(0, 11, 14, 0, 6) },
|
||||
{ HV_SYS_REG_DBGWCR11_EL1, HVF_SYSREG(0, 11, 14, 0, 7) },
|
||||
{ HV_SYS_REG_DBGBVR11_EL1, HVF_SYSREG(0, 11, 2, 0, 4) },
|
||||
{ HV_SYS_REG_DBGBCR11_EL1, HVF_SYSREG(0, 11, 2, 0, 5) },
|
||||
{ HV_SYS_REG_DBGWVR11_EL1, HVF_SYSREG(0, 11, 2, 0, 6) },
|
||||
{ HV_SYS_REG_DBGWCR11_EL1, HVF_SYSREG(0, 11, 2, 0, 7) },
|
||||
|
||||
{ HV_SYS_REG_DBGBVR12_EL1, HVF_SYSREG(0, 12, 14, 0, 4) },
|
||||
{ HV_SYS_REG_DBGBCR12_EL1, HVF_SYSREG(0, 12, 14, 0, 5) },
|
||||
{ HV_SYS_REG_DBGWVR12_EL1, HVF_SYSREG(0, 12, 14, 0, 6) },
|
||||
{ HV_SYS_REG_DBGWCR12_EL1, HVF_SYSREG(0, 12, 14, 0, 7) },
|
||||
{ HV_SYS_REG_DBGBVR12_EL1, HVF_SYSREG(0, 12, 2, 0, 4) },
|
||||
{ HV_SYS_REG_DBGBCR12_EL1, HVF_SYSREG(0, 12, 2, 0, 5) },
|
||||
{ HV_SYS_REG_DBGWVR12_EL1, HVF_SYSREG(0, 12, 2, 0, 6) },
|
||||
{ HV_SYS_REG_DBGWCR12_EL1, HVF_SYSREG(0, 12, 2, 0, 7) },
|
||||
|
||||
{ HV_SYS_REG_DBGBVR13_EL1, HVF_SYSREG(0, 13, 14, 0, 4) },
|
||||
{ HV_SYS_REG_DBGBCR13_EL1, HVF_SYSREG(0, 13, 14, 0, 5) },
|
||||
{ HV_SYS_REG_DBGWVR13_EL1, HVF_SYSREG(0, 13, 14, 0, 6) },
|
||||
{ HV_SYS_REG_DBGWCR13_EL1, HVF_SYSREG(0, 13, 14, 0, 7) },
|
||||
{ HV_SYS_REG_DBGBVR13_EL1, HVF_SYSREG(0, 13, 2, 0, 4) },
|
||||
{ HV_SYS_REG_DBGBCR13_EL1, HVF_SYSREG(0, 13, 2, 0, 5) },
|
||||
{ HV_SYS_REG_DBGWVR13_EL1, HVF_SYSREG(0, 13, 2, 0, 6) },
|
||||
{ HV_SYS_REG_DBGWCR13_EL1, HVF_SYSREG(0, 13, 2, 0, 7) },
|
||||
|
||||
{ HV_SYS_REG_DBGBVR14_EL1, HVF_SYSREG(0, 14, 14, 0, 4) },
|
||||
{ HV_SYS_REG_DBGBCR14_EL1, HVF_SYSREG(0, 14, 14, 0, 5) },
|
||||
{ HV_SYS_REG_DBGWVR14_EL1, HVF_SYSREG(0, 14, 14, 0, 6) },
|
||||
{ HV_SYS_REG_DBGWCR14_EL1, HVF_SYSREG(0, 14, 14, 0, 7) },
|
||||
{ HV_SYS_REG_DBGBVR14_EL1, HVF_SYSREG(0, 14, 2, 0, 4) },
|
||||
{ HV_SYS_REG_DBGBCR14_EL1, HVF_SYSREG(0, 14, 2, 0, 5) },
|
||||
{ HV_SYS_REG_DBGWVR14_EL1, HVF_SYSREG(0, 14, 2, 0, 6) },
|
||||
{ HV_SYS_REG_DBGWCR14_EL1, HVF_SYSREG(0, 14, 2, 0, 7) },
|
||||
|
||||
{ HV_SYS_REG_DBGBVR15_EL1, HVF_SYSREG(0, 15, 14, 0, 4) },
|
||||
{ HV_SYS_REG_DBGBCR15_EL1, HVF_SYSREG(0, 15, 14, 0, 5) },
|
||||
{ HV_SYS_REG_DBGWVR15_EL1, HVF_SYSREG(0, 15, 14, 0, 6) },
|
||||
{ HV_SYS_REG_DBGWCR15_EL1, HVF_SYSREG(0, 15, 14, 0, 7) },
|
||||
{ HV_SYS_REG_DBGBVR15_EL1, HVF_SYSREG(0, 15, 2, 0, 4) },
|
||||
{ HV_SYS_REG_DBGBCR15_EL1, HVF_SYSREG(0, 15, 2, 0, 5) },
|
||||
{ HV_SYS_REG_DBGWVR15_EL1, HVF_SYSREG(0, 15, 2, 0, 6) },
|
||||
{ HV_SYS_REG_DBGWCR15_EL1, HVF_SYSREG(0, 15, 2, 0, 7) },
|
||||
|
||||
#ifdef SYNC_NO_RAW_REGS
|
||||
/*
|
||||
@@ -277,7 +277,7 @@ static struct hvf_sreg_match hvf_sreg_match[] = {
|
||||
{ HV_SYS_REG_MPIDR_EL1, HVF_SYSREG(0, 0, 3, 0, 5) },
|
||||
{ HV_SYS_REG_ID_AA64PFR0_EL1, HVF_SYSREG(0, 4, 3, 0, 0) },
|
||||
#endif
|
||||
{ HV_SYS_REG_ID_AA64PFR1_EL1, HVF_SYSREG(0, 4, 3, 0, 2) },
|
||||
{ HV_SYS_REG_ID_AA64PFR1_EL1, HVF_SYSREG(0, 4, 3, 0, 1) },
|
||||
{ HV_SYS_REG_ID_AA64DFR0_EL1, HVF_SYSREG(0, 5, 3, 0, 0) },
|
||||
{ HV_SYS_REG_ID_AA64DFR1_EL1, HVF_SYSREG(0, 5, 3, 0, 1) },
|
||||
{ HV_SYS_REG_ID_AA64ISAR0_EL1, HVF_SYSREG(0, 6, 3, 0, 0) },
|
||||
|
||||
@@ -103,6 +103,21 @@ static TCGv_ptr get_tile_rowcol(DisasContext *s, int esz, int rs,
|
||||
return addr;
|
||||
}
|
||||
|
||||
/*
|
||||
* Resolve tile.size[0] to a host pointer.
|
||||
* Used by e.g. outer product insns where we require the entire tile.
|
||||
*/
|
||||
static TCGv_ptr get_tile(DisasContext *s, int esz, int tile)
|
||||
{
|
||||
TCGv_ptr addr = tcg_temp_new_ptr();
|
||||
int offset;
|
||||
|
||||
offset = tile * sizeof(ARMVectorReg) + offsetof(CPUARMState, zarray);
|
||||
|
||||
tcg_gen_addi_ptr(addr, cpu_env, offset);
|
||||
return addr;
|
||||
}
|
||||
|
||||
static bool trans_ZERO(DisasContext *s, arg_ZERO *a)
|
||||
{
|
||||
if (!dc_isar_feature(aa64_sme, s)) {
|
||||
@@ -279,8 +294,7 @@ static bool do_adda(DisasContext *s, arg_adda *a, MemOp esz,
|
||||
return true;
|
||||
}
|
||||
|
||||
/* Sum XZR+zad to find ZAd. */
|
||||
za = get_tile_rowcol(s, esz, 31, a->zad, false);
|
||||
za = get_tile(s, esz, a->zad);
|
||||
zn = vec_full_reg_ptr(s, a->zn);
|
||||
pn = pred_full_reg_ptr(s, a->pn);
|
||||
pm = pred_full_reg_ptr(s, a->pm);
|
||||
@@ -310,8 +324,7 @@ static bool do_outprod(DisasContext *s, arg_op *a, MemOp esz,
|
||||
return true;
|
||||
}
|
||||
|
||||
/* Sum XZR+zad to find ZAd. */
|
||||
za = get_tile_rowcol(s, esz, 31, a->zad, false);
|
||||
za = get_tile(s, esz, a->zad);
|
||||
zn = vec_full_reg_ptr(s, a->zn);
|
||||
zm = vec_full_reg_ptr(s, a->zm);
|
||||
pn = pred_full_reg_ptr(s, a->pn);
|
||||
@@ -337,8 +350,7 @@ static bool do_outprod_fpst(DisasContext *s, arg_op *a, MemOp esz,
|
||||
return true;
|
||||
}
|
||||
|
||||
/* Sum XZR+zad to find ZAd. */
|
||||
za = get_tile_rowcol(s, esz, 31, a->zad, false);
|
||||
za = get_tile(s, esz, a->zad);
|
||||
zn = vec_full_reg_ptr(s, a->zn);
|
||||
zm = vec_full_reg_ptr(s, a->zm);
|
||||
pn = pred_full_reg_ptr(s, a->pn);
|
||||
|
||||
@@ -842,7 +842,7 @@ void HELPER(gvec_fcmlah_idx)(void *vd, void *vn, void *vm, void *va,
|
||||
intptr_t index = extract32(desc, SIMD_DATA_SHIFT + 2, 2);
|
||||
uint32_t neg_real = flip ^ neg_imag;
|
||||
intptr_t elements = opr_sz / sizeof(float16);
|
||||
intptr_t eltspersegment = 16 / sizeof(float16);
|
||||
intptr_t eltspersegment = MIN(16 / sizeof(float16), elements);
|
||||
intptr_t i, j;
|
||||
|
||||
/* Shift boolean to the sign bit so we can xor to negate. */
|
||||
@@ -904,7 +904,7 @@ void HELPER(gvec_fcmlas_idx)(void *vd, void *vn, void *vm, void *va,
|
||||
intptr_t index = extract32(desc, SIMD_DATA_SHIFT + 2, 2);
|
||||
uint32_t neg_real = flip ^ neg_imag;
|
||||
intptr_t elements = opr_sz / sizeof(float32);
|
||||
intptr_t eltspersegment = 16 / sizeof(float32);
|
||||
intptr_t eltspersegment = MIN(16 / sizeof(float32), elements);
|
||||
intptr_t i, j;
|
||||
|
||||
/* Shift boolean to the sign bit so we can xor to negate. */
|
||||
|
||||
@@ -3473,6 +3473,7 @@ static bool trans_be(DisasContext *ctx, arg_be *a)
|
||||
tcg_gen_addi_reg(cpu_iaoq_b, cpu_iaoq_f, 4);
|
||||
tcg_gen_mov_i64(cpu_iasq_f, new_spc);
|
||||
tcg_gen_mov_i64(cpu_iasq_b, cpu_iasq_f);
|
||||
nullify_set(ctx, 0);
|
||||
} else {
|
||||
copy_iaoq_entry(cpu_iaoq_f, ctx->iaoq_b, cpu_iaoq_b);
|
||||
if (ctx->iaoq_b == -1) {
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
# define TARGET_VIRT_ADDR_SPACE_BITS 32
|
||||
#endif
|
||||
#define TARGET_PAGE_BITS 12
|
||||
#define NB_MMU_MODES 5
|
||||
#define NB_MMU_MODES 8
|
||||
|
||||
#ifndef CONFIG_USER_ONLY
|
||||
# define TARGET_TB_PCREL 1
|
||||
|
||||
+2
-4
@@ -5297,10 +5297,8 @@ void cpu_x86_cpuid(CPUX86State *env, uint32_t index, uint32_t count,
|
||||
int host_vcpus_per_cache = 1 + ((*eax & 0x3FFC000) >> 14);
|
||||
int vcpus_per_socket = env->nr_dies * cs->nr_cores *
|
||||
cs->nr_threads;
|
||||
if (cs->nr_cores > 1) {
|
||||
*eax &= ~0xFC000000;
|
||||
*eax |= (pow2ceil(cs->nr_cores) - 1) << 26;
|
||||
}
|
||||
*eax &= ~0xFC000000;
|
||||
*eax |= (pow2ceil(cs->nr_cores) - 1) << 26;
|
||||
if (host_vcpus_per_cache > vcpus_per_socket) {
|
||||
*eax &= ~0x3FFC000;
|
||||
*eax |= (pow2ceil(vcpus_per_socket) - 1) << 14;
|
||||
|
||||
+39
-11
@@ -2182,17 +2182,42 @@ uint64_t cpu_get_tsc(CPUX86State *env);
|
||||
#define cpu_list x86_cpu_list
|
||||
|
||||
/* MMU modes definitions */
|
||||
#define MMU_KSMAP_IDX 0
|
||||
#define MMU_USER_IDX 1
|
||||
#define MMU_KNOSMAP_IDX 2
|
||||
#define MMU_NESTED_IDX 3
|
||||
#define MMU_PHYS_IDX 4
|
||||
#define MMU_KSMAP64_IDX 0
|
||||
#define MMU_KSMAP32_IDX 1
|
||||
#define MMU_USER64_IDX 2
|
||||
#define MMU_USER32_IDX 3
|
||||
#define MMU_KNOSMAP64_IDX 4
|
||||
#define MMU_KNOSMAP32_IDX 5
|
||||
#define MMU_PHYS_IDX 6
|
||||
#define MMU_NESTED_IDX 7
|
||||
|
||||
#ifdef CONFIG_USER_ONLY
|
||||
#ifdef TARGET_X86_64
|
||||
#define MMU_USER_IDX MMU_USER64_IDX
|
||||
#else
|
||||
#define MMU_USER_IDX MMU_USER32_IDX
|
||||
#endif
|
||||
#endif
|
||||
|
||||
static inline int cpu_mmu_index(CPUX86State *env, bool ifetch)
|
||||
{
|
||||
return (env->hflags & HF_CPL_MASK) == 3 ? MMU_USER_IDX :
|
||||
(!(env->hflags & HF_SMAP_MASK) || (env->eflags & AC_MASK))
|
||||
? MMU_KNOSMAP_IDX : MMU_KSMAP_IDX;
|
||||
int mmu_index_32 = (env->hflags & HF_CS64_MASK) ? 0 : 1;
|
||||
int mmu_index_base =
|
||||
(env->hflags & HF_CPL_MASK) == 3 ? MMU_USER64_IDX :
|
||||
!(env->hflags & HF_SMAP_MASK) ? MMU_KNOSMAP64_IDX :
|
||||
(env->eflags & AC_MASK) ? MMU_KNOSMAP64_IDX : MMU_KSMAP64_IDX;
|
||||
|
||||
return mmu_index_base + mmu_index_32;
|
||||
}
|
||||
|
||||
static inline bool is_mmu_index_smap(int mmu_index)
|
||||
{
|
||||
return (mmu_index & ~1) == MMU_KSMAP64_IDX;
|
||||
}
|
||||
|
||||
static inline bool is_mmu_index_user(int mmu_index)
|
||||
{
|
||||
return (mmu_index & ~1) == MMU_USER64_IDX;
|
||||
}
|
||||
|
||||
static inline bool is_mmu_index_32(int mmu_index)
|
||||
@@ -2203,9 +2228,12 @@ static inline bool is_mmu_index_32(int mmu_index)
|
||||
|
||||
static inline int cpu_mmu_index_kernel(CPUX86State *env)
|
||||
{
|
||||
return !(env->hflags & HF_SMAP_MASK) ? MMU_KNOSMAP_IDX :
|
||||
((env->hflags & HF_CPL_MASK) < 3 && (env->eflags & AC_MASK))
|
||||
? MMU_KNOSMAP_IDX : MMU_KSMAP_IDX;
|
||||
int mmu_index_32 = (env->hflags & HF_LMA_MASK) ? 0 : 1;
|
||||
int mmu_index_base =
|
||||
!(env->hflags & HF_SMAP_MASK) ? MMU_KNOSMAP64_IDX :
|
||||
((env->hflags & HF_CPL_MASK) < 3 && (env->eflags & AC_MASK)) ? MMU_KNOSMAP64_IDX : MMU_KSMAP64_IDX;
|
||||
|
||||
return mmu_index_base + mmu_index_32;
|
||||
}
|
||||
|
||||
#define CC_DST (env->cc_dst)
|
||||
|
||||
@@ -427,7 +427,7 @@ static void do_inject_x86_mce(CPUState *cs, run_on_cpu_data data)
|
||||
if (need_reset) {
|
||||
emit_guest_memory_failure(MEMORY_FAILURE_ACTION_RESET, ar,
|
||||
recursive);
|
||||
monitor_puts(params->mon, msg);
|
||||
monitor_printf(params->mon, "%s", msg);
|
||||
qemu_log_mask(CPU_LOG_RESET, "%s\n", msg);
|
||||
qemu_system_reset_request(SHUTDOWN_CAUSE_GUEST_RESET);
|
||||
return;
|
||||
|
||||
@@ -81,7 +81,7 @@ int kvm_hv_handle_exit(X86CPU *cpu, struct kvm_hyperv_exit *exit)
|
||||
*/
|
||||
async_safe_run_on_cpu(CPU(cpu), async_synic_update, RUN_ON_CPU_NULL);
|
||||
|
||||
return 0;
|
||||
return EXCP_INTERRUPT;
|
||||
case KVM_EXIT_HYPERV_HCALL: {
|
||||
uint16_t code = exit->u.hcall.input & 0xffff;
|
||||
bool fast = exit->u.hcall.input & HV_HYPERCALL_FAST;
|
||||
|
||||
@@ -1418,9 +1418,9 @@ static bool has_cpuid_feature(DisasContext *s, X86CPUIDFeature cpuid)
|
||||
case X86_FEAT_PCLMULQDQ:
|
||||
return (s->cpuid_ext_features & CPUID_EXT_PCLMULQDQ);
|
||||
case X86_FEAT_SSE:
|
||||
return (s->cpuid_ext_features & CPUID_SSE);
|
||||
return (s->cpuid_features & CPUID_SSE);
|
||||
case X86_FEAT_SSE2:
|
||||
return (s->cpuid_ext_features & CPUID_SSE2);
|
||||
return (s->cpuid_features & CPUID_SSE2);
|
||||
case X86_FEAT_SSE3:
|
||||
return (s->cpuid_ext_features & CPUID_EXT_SSE3);
|
||||
case X86_FEAT_SSSE3:
|
||||
|
||||
@@ -3011,6 +3011,11 @@ void helper_xsetbv(CPUX86State *env, uint32_t ecx, uint64_t mask)
|
||||
goto do_gpf;
|
||||
}
|
||||
|
||||
/* SSE can be disabled, but only if AVX is disabled too. */
|
||||
if ((mask & (XSTATE_SSE_MASK | XSTATE_YMM_MASK)) == XSTATE_YMM_MASK) {
|
||||
goto do_gpf;
|
||||
}
|
||||
|
||||
/* Disallow enabling unimplemented features. */
|
||||
cpu_x86_cpuid(env, 0x0d, 0, &ena_lo, &dummy, &dummy, &ena_hi);
|
||||
ena = ((uint64_t)ena_hi << 32) | ena_lo;
|
||||
|
||||
@@ -135,7 +135,7 @@ static bool mmu_translate(CPUX86State *env, const TranslateParams *in,
|
||||
{
|
||||
const target_ulong addr = in->addr;
|
||||
const int pg_mode = in->pg_mode;
|
||||
const bool is_user = (in->mmu_idx == MMU_USER_IDX);
|
||||
const bool is_user = is_mmu_index_user(in->mmu_idx);
|
||||
const MMUAccessType access_type = in->access_type;
|
||||
uint64_t ptep, pte, rsvd_mask;
|
||||
PTETranslate pte_trans = {
|
||||
@@ -355,7 +355,7 @@ do_check_protect_pse36:
|
||||
}
|
||||
|
||||
int prot = 0;
|
||||
if (in->mmu_idx != MMU_KSMAP_IDX || !(ptep & PG_USER_MASK)) {
|
||||
if (!is_mmu_index_smap(in->mmu_idx) || !(ptep & PG_USER_MASK)) {
|
||||
prot |= PAGE_READ;
|
||||
if ((ptep & PG_RW_MASK) || !(is_user || (pg_mode & PG_MODE_WP))) {
|
||||
prot |= PAGE_WRITE;
|
||||
@@ -541,7 +541,8 @@ static bool get_physical_address(CPUX86State *env, vaddr addr,
|
||||
if (likely(use_stage2)) {
|
||||
in.cr3 = env->nested_cr3;
|
||||
in.pg_mode = env->nested_pg_mode;
|
||||
in.mmu_idx = MMU_USER_IDX;
|
||||
in.mmu_idx =
|
||||
env->nested_pg_mode & PG_MODE_LMA ? MMU_USER64_IDX : MMU_USER32_IDX;
|
||||
in.ptw_idx = MMU_PHYS_IDX;
|
||||
|
||||
if (!mmu_translate(env, &in, out, err)) {
|
||||
|
||||
+18
-15
@@ -2696,7 +2696,7 @@ static void gen_enter(DisasContext *s, int esp_addend, int level)
|
||||
}
|
||||
|
||||
/* Copy the FrameTemp value to EBP. */
|
||||
gen_op_mov_reg_v(s, a_ot, R_EBP, s->T1);
|
||||
gen_op_mov_reg_v(s, d_ot, R_EBP, s->T1);
|
||||
|
||||
/* Compute the final value of ESP. */
|
||||
tcg_gen_subi_tl(s->T1, s->T1, esp_addend + size * level);
|
||||
@@ -2814,13 +2814,17 @@ static void gen_bnd_jmp(DisasContext *s)
|
||||
static void
|
||||
do_gen_eob_worker(DisasContext *s, bool inhibit, bool recheck_tf, bool jr)
|
||||
{
|
||||
bool inhibit_reset;
|
||||
|
||||
gen_update_cc_op(s);
|
||||
|
||||
/* If several instructions disable interrupts, only the first does it. */
|
||||
if (inhibit && !(s->flags & HF_INHIBIT_IRQ_MASK)) {
|
||||
gen_set_hflag(s, HF_INHIBIT_IRQ_MASK);
|
||||
} else {
|
||||
inhibit_reset = false;
|
||||
if (s->flags & HF_INHIBIT_IRQ_MASK) {
|
||||
gen_reset_hflag(s, HF_INHIBIT_IRQ_MASK);
|
||||
inhibit_reset = true;
|
||||
} else if (inhibit) {
|
||||
gen_set_hflag(s, HF_INHIBIT_IRQ_MASK);
|
||||
}
|
||||
|
||||
if (s->base.tb->flags & HF_RF_MASK) {
|
||||
@@ -2829,9 +2833,11 @@ do_gen_eob_worker(DisasContext *s, bool inhibit, bool recheck_tf, bool jr)
|
||||
if (recheck_tf) {
|
||||
gen_helper_rechecking_single_step(cpu_env);
|
||||
tcg_gen_exit_tb(NULL, 0);
|
||||
} else if (s->flags & HF_TF_MASK) {
|
||||
} else if ((s->flags & HF_TF_MASK) && !inhibit) {
|
||||
gen_helper_single_step(cpu_env);
|
||||
} else if (jr) {
|
||||
} else if (jr &&
|
||||
/* give irqs a chance to happen */
|
||||
!inhibit_reset) {
|
||||
tcg_gen_lookup_and_goto_ptr();
|
||||
} else {
|
||||
tcg_gen_exit_tb(NULL, 0);
|
||||
@@ -6053,7 +6059,8 @@ static bool disas_insn(DisasContext *s, CPUState *cpu)
|
||||
gen_ldst_modrm(env, s, modrm, ot, OR_TMP0, 1);
|
||||
break;
|
||||
case 0xee: /* rdpkru */
|
||||
if (prefixes & PREFIX_LOCK) {
|
||||
if (s->prefix & (PREFIX_LOCK | PREFIX_DATA
|
||||
| PREFIX_REPZ | PREFIX_REPNZ)) {
|
||||
goto illegal_op;
|
||||
}
|
||||
tcg_gen_trunc_tl_i32(s->tmp2_i32, cpu_regs[R_ECX]);
|
||||
@@ -6061,7 +6068,8 @@ static bool disas_insn(DisasContext *s, CPUState *cpu)
|
||||
tcg_gen_extr_i64_tl(cpu_regs[R_EAX], cpu_regs[R_EDX], s->tmp1_i64);
|
||||
break;
|
||||
case 0xef: /* wrpkru */
|
||||
if (prefixes & PREFIX_LOCK) {
|
||||
if (s->prefix & (PREFIX_LOCK | PREFIX_DATA
|
||||
| PREFIX_REPZ | PREFIX_REPNZ)) {
|
||||
goto illegal_op;
|
||||
}
|
||||
tcg_gen_concat_tl_i64(s->tmp1_i64, cpu_regs[R_EAX],
|
||||
@@ -6782,12 +6790,7 @@ static bool disas_insn(DisasContext *s, CPUState *cpu)
|
||||
modrm = x86_ldub_code(env, s);
|
||||
reg = ((modrm >> 3) & 7) | REX_R(s);
|
||||
|
||||
if (s->prefix & PREFIX_DATA) {
|
||||
ot = MO_16;
|
||||
} else {
|
||||
ot = mo_64_32(dflag);
|
||||
}
|
||||
|
||||
ot = dflag;
|
||||
gen_ldst_modrm(env, s, modrm, ot, OR_TMP0, 0);
|
||||
gen_extu(ot, s->T0);
|
||||
tcg_gen_mov_tl(cpu_cc_src, s->T0);
|
||||
@@ -6953,7 +6956,7 @@ static void i386_tr_init_disas_context(DisasContextBase *dcbase, CPUState *cpu)
|
||||
dc->cpuid_7_0_ecx_features = env->features[FEAT_7_0_ECX];
|
||||
dc->cpuid_xsave_features = env->features[FEAT_XSAVE];
|
||||
dc->jmp_opt = !((cflags & CF_NO_GOTO_TB) ||
|
||||
(flags & (HF_TF_MASK | HF_INHIBIT_IRQ_MASK)));
|
||||
(flags & (HF_RF_MASK | HF_TF_MASK | HF_INHIBIT_IRQ_MASK)));
|
||||
/*
|
||||
* If jmp_opt, we want to handle each string instruction individually.
|
||||
* For icount also disable repz optimization so that each iteration
|
||||
|
||||
+41
-33
@@ -33,31 +33,45 @@ const char * const fregnames[32] = {
|
||||
"f24", "f25", "f26", "f27", "f28", "f29", "f30", "f31",
|
||||
};
|
||||
|
||||
static const char * const excp_names[] = {
|
||||
[EXCCODE_INT] = "Interrupt",
|
||||
[EXCCODE_PIL] = "Page invalid exception for load",
|
||||
[EXCCODE_PIS] = "Page invalid exception for store",
|
||||
[EXCCODE_PIF] = "Page invalid exception for fetch",
|
||||
[EXCCODE_PME] = "Page modified exception",
|
||||
[EXCCODE_PNR] = "Page Not Readable exception",
|
||||
[EXCCODE_PNX] = "Page Not Executable exception",
|
||||
[EXCCODE_PPI] = "Page Privilege error",
|
||||
[EXCCODE_ADEF] = "Address error for instruction fetch",
|
||||
[EXCCODE_ADEM] = "Address error for Memory access",
|
||||
[EXCCODE_SYS] = "Syscall",
|
||||
[EXCCODE_BRK] = "Break",
|
||||
[EXCCODE_INE] = "Instruction Non-Existent",
|
||||
[EXCCODE_IPE] = "Instruction privilege error",
|
||||
[EXCCODE_FPD] = "Floating Point Disabled",
|
||||
[EXCCODE_FPE] = "Floating Point Exception",
|
||||
[EXCCODE_DBP] = "Debug breakpoint",
|
||||
[EXCCODE_BCE] = "Bound Check Exception",
|
||||
struct TypeExcp {
|
||||
int32_t exccode;
|
||||
const char * const name;
|
||||
};
|
||||
|
||||
static const struct TypeExcp excp_names[] = {
|
||||
{EXCCODE_INT, "Interrupt"},
|
||||
{EXCCODE_PIL, "Page invalid exception for load"},
|
||||
{EXCCODE_PIS, "Page invalid exception for store"},
|
||||
{EXCCODE_PIF, "Page invalid exception for fetch"},
|
||||
{EXCCODE_PME, "Page modified exception"},
|
||||
{EXCCODE_PNR, "Page Not Readable exception"},
|
||||
{EXCCODE_PNX, "Page Not Executable exception"},
|
||||
{EXCCODE_PPI, "Page Privilege error"},
|
||||
{EXCCODE_ADEF, "Address error for instruction fetch"},
|
||||
{EXCCODE_ADEM, "Address error for Memory access"},
|
||||
{EXCCODE_SYS, "Syscall"},
|
||||
{EXCCODE_BRK, "Break"},
|
||||
{EXCCODE_INE, "Instruction Non-Existent"},
|
||||
{EXCCODE_IPE, "Instruction privilege error"},
|
||||
{EXCCODE_FPD, "Floating Point Disabled"},
|
||||
{EXCCODE_FPE, "Floating Point Exception"},
|
||||
{EXCCODE_DBP, "Debug breakpoint"},
|
||||
{EXCCODE_BCE, "Bound Check Exception"},
|
||||
{EXCCODE_SXD, "128 bit vector instructions Disable exception"},
|
||||
{EXCCODE_ASXD, "256 bit vector instructions Disable exception"},
|
||||
{EXCP_HLT, "EXCP_HLT"},
|
||||
};
|
||||
|
||||
const char *loongarch_exception_name(int32_t exception)
|
||||
{
|
||||
assert(excp_names[exception]);
|
||||
return excp_names[exception];
|
||||
int i;
|
||||
|
||||
for (i = 0; i < ARRAY_SIZE(excp_names); i++) {
|
||||
if (excp_names[i].exccode == exception) {
|
||||
return excp_names[i].name;
|
||||
}
|
||||
}
|
||||
return "Unknown";
|
||||
}
|
||||
|
||||
void G_NORETURN do_raise_exception(CPULoongArchState *env,
|
||||
@@ -66,7 +80,7 @@ void G_NORETURN do_raise_exception(CPULoongArchState *env,
|
||||
{
|
||||
CPUState *cs = env_cpu(env);
|
||||
|
||||
qemu_log_mask(CPU_LOG_INT, "%s: %d (%s)\n",
|
||||
qemu_log_mask(CPU_LOG_INT, "%s: expection: %d (%s)\n",
|
||||
__func__,
|
||||
exception,
|
||||
loongarch_exception_name(exception));
|
||||
@@ -143,22 +157,16 @@ static void loongarch_cpu_do_interrupt(CPUState *cs)
|
||||
CPULoongArchState *env = &cpu->env;
|
||||
bool update_badinstr = 1;
|
||||
int cause = -1;
|
||||
const char *name;
|
||||
bool tlbfill = FIELD_EX64(env->CSR_TLBRERA, CSR_TLBRERA, ISTLBR);
|
||||
uint32_t vec_size = FIELD_EX64(env->CSR_ECFG, CSR_ECFG, VS);
|
||||
|
||||
if (cs->exception_index != EXCCODE_INT) {
|
||||
if (cs->exception_index < 0 ||
|
||||
cs->exception_index >= ARRAY_SIZE(excp_names)) {
|
||||
name = "unknown";
|
||||
} else {
|
||||
name = excp_names[cs->exception_index];
|
||||
}
|
||||
|
||||
qemu_log_mask(CPU_LOG_INT,
|
||||
"%s enter: pc " TARGET_FMT_lx " ERA " TARGET_FMT_lx
|
||||
" TLBRERA " TARGET_FMT_lx " %s exception\n", __func__,
|
||||
env->pc, env->CSR_ERA, env->CSR_TLBRERA, name);
|
||||
" TLBRERA " TARGET_FMT_lx " exception: %d (%s)\n",
|
||||
__func__, env->pc, env->CSR_ERA, env->CSR_TLBRERA,
|
||||
cs->exception_index,
|
||||
loongarch_exception_name(cs->exception_index));
|
||||
}
|
||||
|
||||
switch (cs->exception_index) {
|
||||
@@ -645,7 +653,7 @@ void loongarch_cpu_dump_state(CPUState *cs, FILE *f, int flags)
|
||||
qemu_fprintf(f, "EENTRY=%016" PRIx64 "\n", env->CSR_EENTRY);
|
||||
qemu_fprintf(f, "PRCFG1=%016" PRIx64 ", PRCFG2=%016" PRIx64 ","
|
||||
" PRCFG3=%016" PRIx64 "\n",
|
||||
env->CSR_PRCFG1, env->CSR_PRCFG3, env->CSR_PRCFG3);
|
||||
env->CSR_PRCFG1, env->CSR_PRCFG2, env->CSR_PRCFG3);
|
||||
qemu_fprintf(f, "TLBRENTRY=%016" PRIx64 "\n", env->CSR_TLBRENTRY);
|
||||
qemu_fprintf(f, "TLBRBADV=%016" PRIx64 "\n", env->CSR_TLBRBADV);
|
||||
qemu_fprintf(f, "TLBRERA=%016" PRIx64 "\n", env->CSR_TLBRERA);
|
||||
|
||||
@@ -528,6 +528,7 @@ static void _decode_opc(DisasContext * ctx)
|
||||
tcg_gen_movi_i32(REG(B11_8), B7_0s);
|
||||
return;
|
||||
case 0x9000: /* mov.w @(disp,PC),Rn */
|
||||
CHECK_NOT_DELAY_SLOT
|
||||
{
|
||||
TCGv addr = tcg_const_i32(ctx->base.pc_next + 4 + B7_0 * 2);
|
||||
tcg_gen_qemu_ld_i32(REG(B11_8), addr, ctx->memidx, MO_TESW);
|
||||
@@ -535,6 +536,7 @@ static void _decode_opc(DisasContext * ctx)
|
||||
}
|
||||
return;
|
||||
case 0xd000: /* mov.l @(disp,PC),Rn */
|
||||
CHECK_NOT_DELAY_SLOT
|
||||
{
|
||||
TCGv addr = tcg_const_i32((ctx->base.pc_next + 4 + B7_0 * 4) & ~3);
|
||||
tcg_gen_qemu_ld_i32(REG(B11_8), addr, ctx->memidx, MO_TESL);
|
||||
@@ -1295,6 +1297,7 @@ static void _decode_opc(DisasContext * ctx)
|
||||
}
|
||||
return;
|
||||
case 0xc700: /* mova @(disp,PC),R0 */
|
||||
CHECK_NOT_DELAY_SLOT
|
||||
tcg_gen_movi_i32(REG(0), ((ctx->base.pc_next & 0xfffffffc) +
|
||||
4 + B7_0 * 4) & ~3);
|
||||
return;
|
||||
|
||||
@@ -332,8 +332,7 @@ static void tcg_out_movi(TCGContext *s, TCGType type, TCGReg rd,
|
||||
* back to the slow path.
|
||||
*/
|
||||
|
||||
intptr_t pc_offset;
|
||||
tcg_target_long val_lo, val_hi, pc_hi, offset_hi;
|
||||
intptr_t src_rx, pc_offset;
|
||||
tcg_target_long hi32, hi52;
|
||||
bool rd_high_bits_are_ones;
|
||||
|
||||
@@ -344,24 +343,23 @@ static void tcg_out_movi(TCGContext *s, TCGType type, TCGReg rd,
|
||||
}
|
||||
|
||||
/* PC-relative cases. */
|
||||
pc_offset = tcg_pcrel_diff(s, (void *)val);
|
||||
if (pc_offset == sextreg(pc_offset, 0, 22) && (pc_offset & 3) == 0) {
|
||||
/* Single pcaddu2i. */
|
||||
tcg_out_opc_pcaddu2i(s, rd, pc_offset >> 2);
|
||||
return;
|
||||
src_rx = (intptr_t)tcg_splitwx_to_rx(s->code_ptr);
|
||||
if ((val & 3) == 0) {
|
||||
pc_offset = val - src_rx;
|
||||
if (pc_offset == sextreg(pc_offset, 0, 22)) {
|
||||
/* Single pcaddu2i. */
|
||||
tcg_out_opc_pcaddu2i(s, rd, pc_offset >> 2);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
if (pc_offset == (int32_t)pc_offset) {
|
||||
/* Offset within 32 bits; load with pcalau12i + ori. */
|
||||
val_lo = sextreg(val, 0, 12);
|
||||
val_hi = val >> 12;
|
||||
pc_hi = (val - pc_offset) >> 12;
|
||||
offset_hi = val_hi - pc_hi;
|
||||
|
||||
tcg_debug_assert(offset_hi == sextreg(offset_hi, 0, 20));
|
||||
tcg_out_opc_pcalau12i(s, rd, offset_hi);
|
||||
pc_offset = (val >> 12) - (src_rx >> 12);
|
||||
if (pc_offset == sextreg(pc_offset, 0, 20)) {
|
||||
/* Load with pcalau12i + ori. */
|
||||
tcg_target_long val_lo = val & 0xfff;
|
||||
tcg_out_opc_pcalau12i(s, rd, pc_offset);
|
||||
if (val_lo != 0) {
|
||||
tcg_out_opc_ori(s, rd, rd, val_lo & 0xfff);
|
||||
tcg_out_opc_ori(s, rd, rd, val_lo);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
+9
-10
@@ -1634,16 +1634,10 @@ static bool fold_nand(OptContext *ctx, TCGOp *op)
|
||||
return false;
|
||||
}
|
||||
|
||||
static bool fold_neg(OptContext *ctx, TCGOp *op)
|
||||
static bool fold_neg_no_const(OptContext *ctx, TCGOp *op)
|
||||
{
|
||||
uint64_t z_mask;
|
||||
|
||||
if (fold_const1(ctx, op)) {
|
||||
return true;
|
||||
}
|
||||
|
||||
/* Set to 1 all bits to the left of the rightmost. */
|
||||
z_mask = arg_info(op->args[1])->z_mask;
|
||||
uint64_t z_mask = arg_info(op->args[1])->z_mask;
|
||||
ctx->z_mask = -(z_mask & -z_mask);
|
||||
|
||||
/*
|
||||
@@ -1654,6 +1648,11 @@ static bool fold_neg(OptContext *ctx, TCGOp *op)
|
||||
return true;
|
||||
}
|
||||
|
||||
static bool fold_neg(OptContext *ctx, TCGOp *op)
|
||||
{
|
||||
return fold_const1(ctx, op) || fold_neg_no_const(ctx, op);
|
||||
}
|
||||
|
||||
static bool fold_nor(OptContext *ctx, TCGOp *op)
|
||||
{
|
||||
if (fold_const2_commutative(ctx, op) ||
|
||||
@@ -1907,7 +1906,7 @@ static bool fold_shift(OptContext *ctx, TCGOp *op)
|
||||
* will not reduced the number of input sign repetitions.
|
||||
*/
|
||||
sign = (s_mask & -s_mask) >> 1;
|
||||
if (!(z_mask & sign)) {
|
||||
if (sign && !(z_mask & sign)) {
|
||||
ctx->s_mask = s_mask;
|
||||
}
|
||||
break;
|
||||
@@ -1949,7 +1948,7 @@ static bool fold_sub_to_neg(OptContext *ctx, TCGOp *op)
|
||||
if (have_neg) {
|
||||
op->opc = neg_op;
|
||||
op->args[1] = op->args[2];
|
||||
return fold_neg(ctx, op);
|
||||
return fold_neg_no_const(ctx, op);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -542,12 +542,12 @@ class BootLinuxConsole(LinuxKernelTest):
|
||||
:avocado: tags=accel:tcg
|
||||
"""
|
||||
deb_url = ('https://apt.armbian.com/pool/main/l/'
|
||||
'linux-5.10.16-sunxi/linux-image-current-sunxi_21.02.2_armhf.deb')
|
||||
deb_hash = '9fa84beda245cabf0b4fa84cf6eaa7738ead1da0'
|
||||
'linux-6.6.16/linux-image-current-sunxi_24.2.1_armhf__6.6.16-Seb3e-D6b4a-P2359-Ce96bHfe66-HK01ba-V014b-B067e-R448a.deb')
|
||||
deb_hash = 'f7c3c8c5432f765445dc6e7eab02f3bbe668256b'
|
||||
deb_path = self.fetch_asset(deb_url, asset_hash=deb_hash)
|
||||
kernel_path = self.extract_from_deb(deb_path,
|
||||
'/boot/vmlinuz-5.10.16-sunxi')
|
||||
dtb_path = '/usr/lib/linux-image-current-sunxi/sun4i-a10-cubieboard.dtb'
|
||||
'/boot/vmlinuz-6.6.16-current-sunxi')
|
||||
dtb_path = '/usr/lib/linux-image-6.6.16-current-sunxi/sun4i-a10-cubieboard.dtb'
|
||||
dtb_path = self.extract_from_deb(deb_path, dtb_path)
|
||||
initrd_url = ('https://github.com/groeck/linux-build-test/raw/'
|
||||
'2eb0a73b5d5a28df3170c546ddaaa9757e1e0848/rootfs/'
|
||||
@@ -583,12 +583,12 @@ class BootLinuxConsole(LinuxKernelTest):
|
||||
:avocado: tags=accel:tcg
|
||||
"""
|
||||
deb_url = ('https://apt.armbian.com/pool/main/l/'
|
||||
'linux-5.10.16-sunxi/linux-image-current-sunxi_21.02.2_armhf.deb')
|
||||
deb_hash = '9fa84beda245cabf0b4fa84cf6eaa7738ead1da0'
|
||||
'linux-6.6.16/linux-image-current-sunxi_24.2.1_armhf__6.6.16-Seb3e-D6b4a-P2359-Ce96bHfe66-HK01ba-V014b-B067e-R448a.deb')
|
||||
deb_hash = 'f7c3c8c5432f765445dc6e7eab02f3bbe668256b'
|
||||
deb_path = self.fetch_asset(deb_url, asset_hash=deb_hash)
|
||||
kernel_path = self.extract_from_deb(deb_path,
|
||||
'/boot/vmlinuz-5.10.16-sunxi')
|
||||
dtb_path = '/usr/lib/linux-image-current-sunxi/sun4i-a10-cubieboard.dtb'
|
||||
'/boot/vmlinuz-6.6.16-current-sunxi')
|
||||
dtb_path = '/usr/lib/linux-image-6.6.16-current-sunxi/sun4i-a10-cubieboard.dtb'
|
||||
dtb_path = self.extract_from_deb(deb_path, dtb_path)
|
||||
rootfs_url = ('https://github.com/groeck/linux-build-test/raw/'
|
||||
'2eb0a73b5d5a28df3170c546ddaaa9757e1e0848/rootfs/'
|
||||
@@ -713,12 +713,12 @@ class BootLinuxConsole(LinuxKernelTest):
|
||||
:avocado: tags=accel:tcg
|
||||
"""
|
||||
deb_url = ('https://apt.armbian.com/pool/main/l/'
|
||||
'linux-5.10.16-sunxi/linux-image-current-sunxi_21.02.2_armhf.deb')
|
||||
deb_hash = '9fa84beda245cabf0b4fa84cf6eaa7738ead1da0'
|
||||
'linux-6.6.16/linux-image-current-sunxi_24.2.1_armhf__6.6.16-Seb3e-D6b4a-P2359-Ce96bHfe66-HK01ba-V014b-B067e-R448a.deb')
|
||||
deb_hash = 'f7c3c8c5432f765445dc6e7eab02f3bbe668256b'
|
||||
deb_path = self.fetch_asset(deb_url, asset_hash=deb_hash)
|
||||
kernel_path = self.extract_from_deb(deb_path,
|
||||
'/boot/vmlinuz-5.10.16-sunxi')
|
||||
dtb_path = '/usr/lib/linux-image-current-sunxi/sun8i-h3-orangepi-pc.dtb'
|
||||
'/boot/vmlinuz-6.6.16-current-sunxi')
|
||||
dtb_path = '/usr/lib/linux-image-6.6.16-current-sunxi/sun8i-h3-orangepi-pc.dtb'
|
||||
dtb_path = self.extract_from_deb(deb_path, dtb_path)
|
||||
|
||||
self.vm.set_console()
|
||||
@@ -739,12 +739,12 @@ class BootLinuxConsole(LinuxKernelTest):
|
||||
:avocado: tags=machine:orangepi-pc
|
||||
"""
|
||||
deb_url = ('https://apt.armbian.com/pool/main/l/'
|
||||
'linux-5.10.16-sunxi/linux-image-current-sunxi_21.02.2_armhf.deb')
|
||||
deb_hash = '9fa84beda245cabf0b4fa84cf6eaa7738ead1da0'
|
||||
'linux-6.6.16/linux-image-current-sunxi_24.2.1_armhf__6.6.16-Seb3e-D6b4a-P2359-Ce96bHfe66-HK01ba-V014b-B067e-R448a.deb')
|
||||
deb_hash = 'f7c3c8c5432f765445dc6e7eab02f3bbe668256b'
|
||||
deb_path = self.fetch_asset(deb_url, asset_hash=deb_hash)
|
||||
kernel_path = self.extract_from_deb(deb_path,
|
||||
'/boot/vmlinuz-5.10.16-sunxi')
|
||||
dtb_path = '/usr/lib/linux-image-current-sunxi/sun8i-h3-orangepi-pc.dtb'
|
||||
'/boot/vmlinuz-6.6.16-current-sunxi')
|
||||
dtb_path = '/usr/lib/linux-image-6.6.16-current-sunxi/sun8i-h3-orangepi-pc.dtb'
|
||||
dtb_path = self.extract_from_deb(deb_path, dtb_path)
|
||||
initrd_url = ('https://github.com/groeck/linux-build-test/raw/'
|
||||
'2eb0a73b5d5a28df3170c546ddaaa9757e1e0848/rootfs/'
|
||||
@@ -785,12 +785,12 @@ class BootLinuxConsole(LinuxKernelTest):
|
||||
self.require_netdev('user')
|
||||
|
||||
deb_url = ('https://apt.armbian.com/pool/main/l/'
|
||||
'linux-5.10.16-sunxi/linux-image-current-sunxi_21.02.2_armhf.deb')
|
||||
deb_hash = '9fa84beda245cabf0b4fa84cf6eaa7738ead1da0'
|
||||
'linux-6.6.16/linux-image-current-sunxi_24.2.1_armhf__6.6.16-Seb3e-D6b4a-P2359-Ce96bHfe66-HK01ba-V014b-B067e-R448a.deb')
|
||||
deb_hash = 'f7c3c8c5432f765445dc6e7eab02f3bbe668256b'
|
||||
deb_path = self.fetch_asset(deb_url, asset_hash=deb_hash)
|
||||
kernel_path = self.extract_from_deb(deb_path,
|
||||
'/boot/vmlinuz-5.10.16-sunxi')
|
||||
dtb_path = '/usr/lib/linux-image-current-sunxi/sun8i-h3-orangepi-pc.dtb'
|
||||
'/boot/vmlinuz-6.6.16-current-sunxi')
|
||||
dtb_path = '/usr/lib/linux-image-6.6.16-current-sunxi/sun8i-h3-orangepi-pc.dtb'
|
||||
dtb_path = self.extract_from_deb(deb_path, dtb_path)
|
||||
rootfs_url = ('http://storage.kernelci.org/images/rootfs/buildroot/'
|
||||
'buildroot-baseline/20221116.0/armel/rootfs.ext2.xz')
|
||||
|
||||
@@ -185,12 +185,12 @@ class ReplayKernelNormal(ReplayKernelBase):
|
||||
:avocado: tags=machine:cubieboard
|
||||
"""
|
||||
deb_url = ('https://apt.armbian.com/pool/main/l/'
|
||||
'linux-5.10.16-sunxi/linux-image-current-sunxi_21.02.2_armhf.deb')
|
||||
deb_hash = '9fa84beda245cabf0b4fa84cf6eaa7738ead1da0'
|
||||
'linux-6.6.16/linux-image-current-sunxi_24.2.1_armhf__6.6.16-Seb3e-D6b4a-P2359-Ce96bHfe66-HK01ba-V014b-B067e-R448a.deb')
|
||||
deb_hash = 'f7c3c8c5432f765445dc6e7eab02f3bbe668256b'
|
||||
deb_path = self.fetch_asset(deb_url, asset_hash=deb_hash)
|
||||
kernel_path = self.extract_from_deb(deb_path,
|
||||
'/boot/vmlinuz-5.10.16-sunxi')
|
||||
dtb_path = '/usr/lib/linux-image-current-sunxi/sun4i-a10-cubieboard.dtb'
|
||||
'/boot/vmlinuz-6.6.16-current-sunxi')
|
||||
dtb_path = '/usr/lib/linux-image-6.6.16-current-sunxi/sun4i-a10-cubieboard.dtb'
|
||||
dtb_path = self.extract_from_deb(deb_path, dtb_path)
|
||||
initrd_url = ('https://github.com/groeck/linux-build-test/raw/'
|
||||
'2eb0a73b5d5a28df3170c546ddaaa9757e1e0848/rootfs/'
|
||||
|
||||
@@ -1,15 +1,14 @@
|
||||
# THIS FILE WAS AUTO-GENERATED
|
||||
#
|
||||
# $ lcitool dockerfile --layers all centos-stream-8 qemu
|
||||
# $ lcitool dockerfile --layers all centos-stream-9 qemu
|
||||
#
|
||||
# https://gitlab.com/libvirt/libvirt-ci
|
||||
|
||||
FROM quay.io/centos/centos:stream8
|
||||
FROM quay.io/centos/centos:stream9
|
||||
|
||||
RUN dnf distro-sync -y && \
|
||||
dnf install 'dnf-command(config-manager)' -y && \
|
||||
dnf config-manager --set-enabled -y powertools && \
|
||||
dnf install -y centos-release-advanced-virtualization && \
|
||||
dnf config-manager --set-enabled -y crb && \
|
||||
dnf install -y epel-release && \
|
||||
dnf install -y epel-next-release && \
|
||||
dnf install -y \
|
||||
@@ -43,7 +42,6 @@ RUN dnf distro-sync -y && \
|
||||
glib2-static \
|
||||
glibc-langpack-en \
|
||||
glibc-static \
|
||||
glusterfs-api-devel \
|
||||
gnutls-devel \
|
||||
gtk3-devel \
|
||||
hostname \
|
||||
@@ -102,19 +100,18 @@ RUN dnf distro-sync -y && \
|
||||
python3-pip \
|
||||
python3-sphinx \
|
||||
python3-sphinx_rtd_theme \
|
||||
python3-tomli \
|
||||
rdma-core-devel \
|
||||
rpm \
|
||||
sed \
|
||||
snappy-devel \
|
||||
spice-protocol \
|
||||
spice-server-devel \
|
||||
systemd-devel \
|
||||
systemtap-sdt-devel \
|
||||
tar \
|
||||
texinfo \
|
||||
usbredir-devel \
|
||||
util-linux \
|
||||
virglrenderer-devel \
|
||||
vte291-devel \
|
||||
which \
|
||||
xfsprogs-devel \
|
||||
@@ -1,10 +1,10 @@
|
||||
# THIS FILE WAS AUTO-GENERATED
|
||||
#
|
||||
# $ lcitool dockerfile --layers all --cross mingw32 fedora-35 qemu
|
||||
# $ lcitool dockerfile --layers all --cross mingw32 fedora-37 qemu
|
||||
#
|
||||
# https://gitlab.com/libvirt/libvirt-ci
|
||||
|
||||
FROM registry.fedoraproject.org/fedora:35
|
||||
FROM registry.fedoraproject.org/fedora:37
|
||||
|
||||
RUN dnf install -y nosync && \
|
||||
echo -e '#!/bin/sh\n\
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
# THIS FILE WAS AUTO-GENERATED
|
||||
#
|
||||
# $ lcitool dockerfile --layers all --cross mingw64 fedora-35 qemu
|
||||
# $ lcitool dockerfile --layers all --cross mingw64 fedora-37 qemu
|
||||
#
|
||||
# https://gitlab.com/libvirt/libvirt-ci
|
||||
|
||||
FROM registry.fedoraproject.org/fedora:35
|
||||
FROM registry.fedoraproject.org/fedora:37
|
||||
|
||||
RUN dnf install -y nosync && \
|
||||
echo -e '#!/bin/sh\n\
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
# THIS FILE WAS AUTO-GENERATED
|
||||
#
|
||||
# $ lcitool dockerfile --layers all fedora-35 qemu
|
||||
# $ lcitool dockerfile --layers all fedora-37 qemu
|
||||
#
|
||||
# https://gitlab.com/libvirt/libvirt-ci
|
||||
|
||||
FROM registry.fedoraproject.org/fedora:35
|
||||
FROM registry.fedoraproject.org/fedora:37
|
||||
|
||||
RUN dnf install -y nosync && \
|
||||
echo -e '#!/bin/sh\n\
|
||||
|
||||
@@ -90,16 +90,9 @@ RUN zypper update -y && \
|
||||
pcre-devel-static \
|
||||
perl-base \
|
||||
pkgconfig \
|
||||
python3-Pillow \
|
||||
python3-PyYAML \
|
||||
python3-Sphinx \
|
||||
python3-base \
|
||||
python3-numpy \
|
||||
python3-opencv \
|
||||
python3-pip \
|
||||
python3-setuptools \
|
||||
python3-sphinx_rtd_theme \
|
||||
python3-wheel \
|
||||
python39-base \
|
||||
python39-pip \
|
||||
python39-setuptools \
|
||||
rdma-core-devel \
|
||||
rpm \
|
||||
sed \
|
||||
@@ -131,10 +124,15 @@ RUN zypper update -y && \
|
||||
ln -s /usr/bin/ccache /usr/libexec/ccache-wrappers/g++ && \
|
||||
ln -s /usr/bin/ccache /usr/libexec/ccache-wrappers/gcc
|
||||
|
||||
RUN /usr/bin/pip3 install meson==0.56.0
|
||||
RUN /usr/bin/pip3.9 install \
|
||||
PyYAML \
|
||||
meson==0.63.2 \
|
||||
pillow \
|
||||
sphinx \
|
||||
sphinx-rtd-theme
|
||||
|
||||
ENV CCACHE_WRAPPERSDIR "/usr/libexec/ccache-wrappers"
|
||||
ENV LANG "en_US.UTF-8"
|
||||
ENV MAKE "/usr/bin/make"
|
||||
ENV NINJA "/usr/bin/ninja"
|
||||
ENV PYTHON "/usr/bin/python3"
|
||||
ENV PYTHON "/usr/bin/python3.9"
|
||||
|
||||
@@ -140,7 +140,7 @@ RUN export DEBIAN_FRONTEND=noninteractive && \
|
||||
ln -s /usr/bin/ccache /usr/libexec/ccache-wrappers/g++ && \
|
||||
ln -s /usr/bin/ccache /usr/libexec/ccache-wrappers/gcc
|
||||
|
||||
RUN /usr/bin/pip3 install meson==0.56.0
|
||||
RUN /usr/bin/pip3 install meson==0.63.2
|
||||
|
||||
ENV CCACHE_WRAPPERSDIR "/usr/libexec/ccache-wrappers"
|
||||
ENV LANG "en_US.UTF-8"
|
||||
|
||||
+1
-1
Submodule tests/lcitool/libvirt-ci updated: e3eb28cf2e...319a534c22
@@ -0,0 +1,60 @@
|
||||
mappings:
|
||||
flake8:
|
||||
OpenSUSELeap153:
|
||||
|
||||
meson:
|
||||
OpenSUSELeap153:
|
||||
|
||||
python3:
|
||||
OpenSUSELeap153: python39-base
|
||||
|
||||
python3-PyYAML:
|
||||
OpenSUSELeap153:
|
||||
|
||||
python3-devel:
|
||||
OpenSUSELeap153: python39-devel
|
||||
|
||||
python3-docutils:
|
||||
OpenSUSELeap153:
|
||||
|
||||
python3-numpy:
|
||||
OpenSUSELeap153:
|
||||
|
||||
python3-opencv:
|
||||
OpenSUSELeap153:
|
||||
|
||||
python3-pillow:
|
||||
OpenSUSELeap153:
|
||||
|
||||
python3-pip:
|
||||
OpenSUSELeap153: python39-pip
|
||||
|
||||
python3-pillow:
|
||||
OpenSUSELeap153:
|
||||
|
||||
python3-selinux:
|
||||
OpenSUSELeap153:
|
||||
|
||||
python3-setuptools:
|
||||
OpenSUSELeap153: python39-setuptools
|
||||
|
||||
python3-sphinx:
|
||||
OpenSUSELeap153:
|
||||
|
||||
python3-sphinx-rtd-theme:
|
||||
OpenSUSELeap153:
|
||||
|
||||
python3-venv:
|
||||
OpenSUSELeap153: python39-base
|
||||
|
||||
python3-wheel:
|
||||
OpenSUSELeap153: python39-pip
|
||||
|
||||
pypi_mappings:
|
||||
# Request more recent version
|
||||
meson:
|
||||
default: meson==0.63.2
|
||||
|
||||
# Drop packages that need devel headers
|
||||
python3-numpy:
|
||||
OpenSUSELeap153:
|
||||
@@ -108,10 +108,10 @@ try:
|
||||
# Standard native builds
|
||||
#
|
||||
generate_dockerfile("alpine", "alpine-316")
|
||||
generate_dockerfile("centos8", "centos-stream-8")
|
||||
generate_dockerfile("centos9", "centos-stream-9")
|
||||
generate_dockerfile("debian-amd64", "debian-11",
|
||||
trailer="".join(debian11_extras))
|
||||
generate_dockerfile("fedora", "fedora-35")
|
||||
generate_dockerfile("fedora", "fedora-37")
|
||||
generate_dockerfile("opensuse-leap", "opensuse-leap-153")
|
||||
generate_dockerfile("ubuntu2004", "ubuntu-2004",
|
||||
trailer="".join(ubuntu2004_tsanhack))
|
||||
@@ -161,12 +161,12 @@ try:
|
||||
trailer=cross_build("s390x-linux-gnu-",
|
||||
"s390x-softmmu,s390x-linux-user"))
|
||||
|
||||
generate_dockerfile("fedora-win32-cross", "fedora-35",
|
||||
generate_dockerfile("fedora-win32-cross", "fedora-37",
|
||||
cross="mingw32",
|
||||
trailer=cross_build("i686-w64-mingw32-",
|
||||
"i386-softmmu"))
|
||||
|
||||
generate_dockerfile("fedora-win64-cross", "fedora-35",
|
||||
generate_dockerfile("fedora-win64-cross", "fedora-37",
|
||||
cross="mingw64",
|
||||
trailer=cross_build("x86_64-w64-mingw32-",
|
||||
"x86_64-softmmu"))
|
||||
|
||||
@@ -0,0 +1,3 @@
|
||||
paths:
|
||||
pip3: /usr/bin/pip3.8
|
||||
python: /usr/bin/python3.8
|
||||
@@ -0,0 +1,3 @@
|
||||
paths:
|
||||
pip3: /usr/bin/pip3.9
|
||||
python: /usr/bin/python3.9
|
||||
@@ -326,12 +326,14 @@ $QEMU_IMG amend -o "data_file=foo" "$TEST_IMG"
|
||||
echo
|
||||
_make_test_img -o "compat=1.1,data_file=$TEST_IMG.data" 64M
|
||||
$QEMU_IMG amend -o "data_file=foo" "$TEST_IMG"
|
||||
_img_info --format-specific
|
||||
$QEMU_IO -c "read 0 4k" "$TEST_IMG" 2>&1 | _filter_testdir | _filter_imgfmt
|
||||
$QEMU_IO -c "open -o data-file.filename=$TEST_IMG.data,file.filename=$TEST_IMG" -c "read 0 4k" | _filter_qemu_io
|
||||
TEST_IMG="data-file.filename=$TEST_IMG.data,file.filename=$TEST_IMG" _img_info --format-specific --image-opts
|
||||
|
||||
echo
|
||||
$QEMU_IMG amend -o "data_file=" --image-opts "data-file.filename=$TEST_IMG.data,file.filename=$TEST_IMG"
|
||||
_img_info --format-specific
|
||||
$QEMU_IO -c "read 0 4k" "$TEST_IMG" 2>&1 | _filter_testdir | _filter_imgfmt
|
||||
$QEMU_IO -c "open -o data-file.filename=$TEST_IMG.data,file.filename=$TEST_IMG" -c "read 0 4k" | _filter_qemu_io
|
||||
TEST_IMG="data-file.filename=$TEST_IMG.data,file.filename=$TEST_IMG" _img_info --format-specific --image-opts
|
||||
|
||||
echo
|
||||
|
||||
@@ -545,7 +545,9 @@ Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=67108864
|
||||
qemu-img: data-file can only be set for images that use an external data file
|
||||
|
||||
Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=67108864 data_file=TEST_DIR/t.IMGFMT.data
|
||||
qemu-img: Could not open 'TEST_DIR/t.IMGFMT': Could not open 'foo': No such file or directory
|
||||
qemu-io: can't open device TEST_DIR/t.IMGFMT: Could not open 'foo': No such file or directory
|
||||
read 4096/4096 bytes at offset 0
|
||||
4 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
|
||||
image: TEST_DIR/t.IMGFMT
|
||||
file format: IMGFMT
|
||||
virtual size: 64 MiB (67108864 bytes)
|
||||
@@ -560,7 +562,9 @@ Format specific information:
|
||||
corrupt: false
|
||||
extended l2: false
|
||||
|
||||
qemu-img: Could not open 'TEST_DIR/t.IMGFMT': 'data-file' is required for this image
|
||||
qemu-io: can't open device TEST_DIR/t.IMGFMT: 'data-file' is required for this image
|
||||
read 4096/4096 bytes at offset 0
|
||||
4 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
|
||||
image: TEST_DIR/t.IMGFMT
|
||||
file format: IMGFMT
|
||||
virtual size: 64 MiB (67108864 bytes)
|
||||
|
||||
+16
-3
@@ -215,9 +215,22 @@ $QEMU_IMG convert -f $IMGFMT -O $IMGFMT -n -C "$TEST_IMG.src" "$TEST_IMG"
|
||||
$QEMU_IMG compare -f $IMGFMT -F $IMGFMT "$TEST_IMG.src" "$TEST_IMG"
|
||||
|
||||
# blkdebug doesn't support copy offloading, so this tests the error path
|
||||
$QEMU_IMG amend -f $IMGFMT -o "data_file=blkdebug::$TEST_IMG.data" "$TEST_IMG"
|
||||
$QEMU_IMG convert -f $IMGFMT -O $IMGFMT -n -C "$TEST_IMG.src" "$TEST_IMG"
|
||||
$QEMU_IMG compare -f $IMGFMT -F $IMGFMT "$TEST_IMG.src" "$TEST_IMG"
|
||||
test_img_with_blkdebug="json:{
|
||||
'driver': 'qcow2',
|
||||
'file': {
|
||||
'driver': 'file',
|
||||
'filename': '$TEST_IMG'
|
||||
},
|
||||
'data-file': {
|
||||
'driver': 'blkdebug',
|
||||
'image': {
|
||||
'driver': 'file',
|
||||
'filename': '$TEST_IMG.data'
|
||||
}
|
||||
}
|
||||
}"
|
||||
$QEMU_IMG convert -f $IMGFMT -O $IMGFMT -n -C "$TEST_IMG.src" "$test_img_with_blkdebug"
|
||||
$QEMU_IMG compare -f $IMGFMT -F $IMGFMT "$TEST_IMG.src" "$test_img_with_blkdebug"
|
||||
|
||||
echo
|
||||
echo "=== Flushing should flush the data file ==="
|
||||
|
||||
+11
-3
@@ -60,8 +60,16 @@ _make_test_img -o cluster_size=2M,data_file="$TEST_IMG.orig" \
|
||||
# "write" 2G of data without using any space.
|
||||
# (qemu-img create does not like it, though, because null-co does not
|
||||
# support image creation.)
|
||||
$QEMU_IMG amend -o data_file="json:{'driver':'null-co',,'size':'4294967296'}" \
|
||||
"$TEST_IMG"
|
||||
test_img_with_null_data="json:{
|
||||
'driver': '$IMGFMT',
|
||||
'file': {
|
||||
'filename': '$TEST_IMG'
|
||||
},
|
||||
'data-file': {
|
||||
'driver': 'null-co',
|
||||
'size':'4294967296'
|
||||
}
|
||||
}"
|
||||
|
||||
# This gives us a range of:
|
||||
# 2^31 - 512 + 768 - 1 = 2^31 + 255 > 2^31
|
||||
@@ -74,7 +82,7 @@ $QEMU_IMG amend -o data_file="json:{'driver':'null-co',,'size':'4294967296'}" \
|
||||
# on L2 boundaries, we need large L2 tables; hence the cluster size of
|
||||
# 2 MB. (Anything from 256 kB should work, though, because then one L2
|
||||
# table covers 8 GB.)
|
||||
$QEMU_IO -c "write 768 $((2 ** 31 - 512))" "$TEST_IMG" | _filter_qemu_io
|
||||
$QEMU_IO -c "write 768 $((2 ** 31 - 512))" "$test_img_with_null_data" | _filter_qemu_io
|
||||
|
||||
_check_test_img
|
||||
|
||||
|
||||
@@ -10,6 +10,7 @@ VPATH += $(AARCH64_SRC)
|
||||
|
||||
# Base architecture tests
|
||||
AARCH64_TESTS=fcvt pcalign-a64
|
||||
AARCH64_TESTS += test-2248 test-2150
|
||||
|
||||
fcvt: LDFLAGS+=-lm
|
||||
|
||||
@@ -23,7 +24,8 @@ config-cc.mak: Makefile
|
||||
$(call cc-option,-march=armv8.1-a+sve2, CROSS_CC_HAS_SVE2); \
|
||||
$(call cc-option,-march=armv8.3-a, CROSS_CC_HAS_ARMV8_3); \
|
||||
$(call cc-option,-mbranch-protection=standard, CROSS_CC_HAS_ARMV8_BTI); \
|
||||
$(call cc-option,-march=armv8.5-a+memtag, CROSS_CC_HAS_ARMV8_MTE)) 3> config-cc.mak
|
||||
$(call cc-option,-march=armv8.5-a+memtag, CROSS_CC_HAS_ARMV8_MTE); \
|
||||
$(call cc-option,-Wa$(COMMA)-march=armv9-a+sme, CROSS_AS_HAS_ARMV9_SME)) 3> config-cc.mak
|
||||
-include config-cc.mak
|
||||
|
||||
# Pauth Tests
|
||||
@@ -50,11 +52,15 @@ AARCH64_TESTS += mte-1 mte-2 mte-3 mte-4 mte-5 mte-6 mte-7
|
||||
mte-%: CFLAGS += -march=armv8.5-a+memtag
|
||||
endif
|
||||
|
||||
ifneq ($(CROSS_CC_HAS_SVE),)
|
||||
# SME Tests
|
||||
ifneq ($(CROSS_AS_HAS_ARMV9_SME),)
|
||||
AARCH64_TESTS += sme-outprod1
|
||||
endif
|
||||
|
||||
# System Registers Tests
|
||||
AARCH64_TESTS += sysregs
|
||||
sysregs: CFLAGS+=-march=armv8.1-a+sve
|
||||
|
||||
ifneq ($(CROSS_CC_HAS_SVE),)
|
||||
# SVE ioctl test
|
||||
AARCH64_TESTS += sve-ioctls
|
||||
sve-ioctls: CFLAGS+=-march=armv8.1-a+sve
|
||||
|
||||
@@ -0,0 +1,83 @@
|
||||
/*
|
||||
* SME outer product, 1 x 1.
|
||||
* SPDX-License-Identifier: GPL-2.0-or-later
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
|
||||
extern void foo(float *dst);
|
||||
|
||||
asm(
|
||||
" .arch_extension sme\n"
|
||||
" .type foo, @function\n"
|
||||
"foo:\n"
|
||||
" stp x29, x30, [sp, -80]!\n"
|
||||
" mov x29, sp\n"
|
||||
" stp d8, d9, [sp, 16]\n"
|
||||
" stp d10, d11, [sp, 32]\n"
|
||||
" stp d12, d13, [sp, 48]\n"
|
||||
" stp d14, d15, [sp, 64]\n"
|
||||
" smstart\n"
|
||||
" ptrue p0.s, vl4\n"
|
||||
" fmov z0.s, #1.0\n"
|
||||
/*
|
||||
* An outer product of a vector of 1.0 by itself should be a matrix of 1.0.
|
||||
* Note that we are using tile 1 here (za1.s) rather than tile 0.
|
||||
*/
|
||||
" zero {za}\n"
|
||||
" fmopa za1.s, p0/m, p0/m, z0.s, z0.s\n"
|
||||
/*
|
||||
* Read the first 4x4 sub-matrix of elements from tile 1:
|
||||
* Note that za1h should be interchangable here.
|
||||
*/
|
||||
" mov w12, #0\n"
|
||||
" mova z0.s, p0/m, za1v.s[w12, #0]\n"
|
||||
" mova z1.s, p0/m, za1v.s[w12, #1]\n"
|
||||
" mova z2.s, p0/m, za1v.s[w12, #2]\n"
|
||||
" mova z3.s, p0/m, za1v.s[w12, #3]\n"
|
||||
/*
|
||||
* And store them to the input pointer (dst in the C code):
|
||||
*/
|
||||
" st1w {z0.s}, p0, [x0]\n"
|
||||
" add x0, x0, #16\n"
|
||||
" st1w {z1.s}, p0, [x0]\n"
|
||||
" add x0, x0, #16\n"
|
||||
" st1w {z2.s}, p0, [x0]\n"
|
||||
" add x0, x0, #16\n"
|
||||
" st1w {z3.s}, p0, [x0]\n"
|
||||
" smstop\n"
|
||||
" ldp d8, d9, [sp, 16]\n"
|
||||
" ldp d10, d11, [sp, 32]\n"
|
||||
" ldp d12, d13, [sp, 48]\n"
|
||||
" ldp d14, d15, [sp, 64]\n"
|
||||
" ldp x29, x30, [sp], 80\n"
|
||||
" ret\n"
|
||||
" .size foo, . - foo"
|
||||
);
|
||||
|
||||
int main()
|
||||
{
|
||||
float dst[16];
|
||||
int i, j;
|
||||
|
||||
foo(dst);
|
||||
|
||||
for (i = 0; i < 16; i++) {
|
||||
if (dst[i] != 1.0f) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (i == 16) {
|
||||
return 0; /* success */
|
||||
}
|
||||
|
||||
/* failure */
|
||||
for (i = 0; i < 4; ++i) {
|
||||
for (j = 0; j < 4; ++j) {
|
||||
printf("%f ", (double)dst[i * 4 + j]);
|
||||
}
|
||||
printf("\n");
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user