mirror of
https://github.com/izzy2lost/xemu.git
synced 2026-07-06 00:20:22 -07:00
Merge tag 'pull-request-2022-09-26' of https://gitlab.com/thuth/qemu into staging
* Fix emulation of the LZRF instruction * Fix "noexec" TCG test on s390x * Implement SHA-512 and random number generator instructions * Support for zPCI interpretation on s390x hosts * Removal of the "slirp" submodule # -----BEGIN PGP SIGNATURE----- # # iQJFBAABCAAvFiEEJ7iIR+7gJQEY8+q5LtnXdP5wLbUFAmMx26URHHRodXRoQHJl # ZGhhdC5jb20ACgkQLtnXdP5wLbUaOw/7Bu1ghYJyzjR8raXSzOP8KmyltKb0s0zd # rFpagZCeBiNGHAL2IaKHc3vw+oFy/TTWhrFLt+imDo2swDIIAWCb/bY2/snKX4c8 # feF0io7JTdNCWvS/9ng6qL/fGSNM6V2osYyN5fEm46DM7gC3GlAu5vP2TCVoIifw # AXDANd6XngoCAFBdixGNi0yxAmiLCou/1S+lJ7hCbx1oICPPTrzuGBwyQ+IELJOD # DUGFb+Dl4z+tv8OYRhdvoSTCz75IhsAXeny2+coffvW70BDSyhzIAtVeo2azVGvT # aOVRJt+g7H/mJ0vH20M/7pakdwvHs3zciw5oHUJSsEW1HzsqNgl+AEEUzXivipaN # LYp5//klqjjAu12hFQbzmbhD/vUw2+8mRgbJdKOz7rSrZ/K8f+jqIbbU5r8t1oyy # BqLo2i0EVBfAomzbHMD/kmrumiSNIlfSDwScAoIKAO6P3oy/Sg2twMhPlFRWAnI0 # 46dQS1rLuU0nV4tMCAQoXxRxjQXytCOhaF9G+qe9ogLufHG+Uy+j3IeunyAUl9GR # EcnRB0GFjWfZKeUsR9qev2pvgOZXeg4u+wpjGM7pmfpZw89nBqCj0UVAthXlSKoz # ru3HcuBJTBtxwYkSCsPMEDCk/FhJN0D+N205qg+6SY28R57WjTPFLvZPRmhkH03E # jN8rurLISAM= # =FeSy # -----END PGP SIGNATURE----- # gpg: Signature made Mon 26 Sep 2022 13:04:37 EDT # gpg: using RSA key 27B88847EEE0250118F3EAB92ED9D774FE702DB5 # gpg: issuer "thuth@redhat.com" # gpg: Good signature from "Thomas Huth <th.huth@gmx.de>" [full] # gpg: aka "Thomas Huth <thuth@redhat.com>" [full] # gpg: aka "Thomas Huth <huth@tuxfamily.org>" [full] # gpg: aka "Thomas Huth <th.huth@posteo.de>" [unknown] # Primary key fingerprint: 27B8 8847 EEE0 2501 18F3 EAB9 2ED9 D774 FE70 2DB5 * tag 'pull-request-2022-09-26' of https://gitlab.com/thuth/qemu: Remove the slirp submodule (i.e. compile only with an external libslirp) s390x/s390-virtio-ccw: add zpcii-disable machine property s390x/pci: reflect proper maxstbl for groups of interpreted devices s390x/pci: let intercept devices have separate PCI groups s390x/pci: enable adapter event notification for interpreted devices s390x/pci: don't fence interpreted devices without MSI-X s390x/pci: enable for load/store interpretation s390x/pci: add routine to get host function handle from CLP info Update linux headers to v6.0-rc4 configure: Add -Wno-gnu-variable-sized-type-not-at-end target/s390x: support PRNO_TRNG instruction target/s390x: support SHA-512 extensions linux-user/host/s390: Add vector instructions to host_signal_write() s390x/tcg: Fix opcode for lzrf Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
This commit is contained in:
@@ -41,8 +41,7 @@ build-system-ubuntu:
|
||||
job: amd64-ubuntu2004-container
|
||||
variables:
|
||||
IMAGE: ubuntu2004
|
||||
CONFIGURE_ARGS: --enable-docs --enable-fdt=system --enable-slirp=system
|
||||
--enable-capstone
|
||||
CONFIGURE_ARGS: --enable-docs --enable-fdt=system --enable-capstone
|
||||
TARGETS: aarch64-softmmu alpha-softmmu cris-softmmu hppa-softmmu
|
||||
microblazeel-softmmu mips64el-softmmu
|
||||
MAKE_CHECK_ARGS: check-build
|
||||
@@ -120,7 +119,7 @@ build-system-fedora:
|
||||
variables:
|
||||
IMAGE: fedora
|
||||
CONFIGURE_ARGS: --disable-gcrypt --enable-nettle --enable-docs
|
||||
--enable-fdt=system --enable-slirp=system --enable-capstone
|
||||
--enable-fdt=system --enable-slirp --enable-capstone
|
||||
TARGETS: tricore-softmmu microblaze-softmmu mips-softmmu
|
||||
xtensa-softmmu m68k-softmmu riscv32-softmmu ppc-softmmu sparc64-softmmu
|
||||
MAKE_CHECK_ARGS: check-build
|
||||
@@ -339,10 +338,8 @@ clang-user:
|
||||
# On gitlab runners, default value sometimes end up calling 2 lds concurrently and
|
||||
# triggers an Out-Of-Memory error
|
||||
#
|
||||
# Since slirp callbacks are used in QEMU Timers, slirp needs to be compiled together
|
||||
# with QEMU and linked as a static library to avoid false positives in CFI checks.
|
||||
# This can be accomplished by using -enable-slirp=git, which avoids the use of
|
||||
# a system-wide version of the library
|
||||
# Since slirp callbacks are used in QEMU Timers, we cannot use libslirp with
|
||||
# CFI builds, and thus have to disable it here.
|
||||
#
|
||||
# Split in three sets of build/check/avocado to limit the execution time of each
|
||||
# job
|
||||
@@ -355,7 +352,7 @@ build-cfi-aarch64:
|
||||
AR: llvm-ar
|
||||
IMAGE: fedora
|
||||
CONFIGURE_ARGS: --cc=clang --cxx=clang++ --enable-cfi --enable-cfi-debug
|
||||
--enable-safe-stack --enable-slirp=git
|
||||
--enable-safe-stack --disable-slirp
|
||||
TARGETS: aarch64-softmmu
|
||||
MAKE_CHECK_ARGS: check-build
|
||||
# FIXME: This job is often failing, likely due to out-of-memory problems in
|
||||
@@ -395,7 +392,7 @@ build-cfi-ppc64-s390x:
|
||||
AR: llvm-ar
|
||||
IMAGE: fedora
|
||||
CONFIGURE_ARGS: --cc=clang --cxx=clang++ --enable-cfi --enable-cfi-debug
|
||||
--enable-safe-stack --enable-slirp=git
|
||||
--enable-safe-stack --disable-slirp
|
||||
TARGETS: ppc64-softmmu s390x-softmmu
|
||||
MAKE_CHECK_ARGS: check-build
|
||||
# FIXME: This job is often failing, likely due to out-of-memory problems in
|
||||
@@ -435,7 +432,7 @@ build-cfi-x86_64:
|
||||
AR: llvm-ar
|
||||
IMAGE: fedora
|
||||
CONFIGURE_ARGS: --cc=clang --cxx=clang++ --enable-cfi --enable-cfi-debug
|
||||
--enable-safe-stack --enable-slirp=git
|
||||
--enable-safe-stack --disable-slirp
|
||||
TARGETS: x86_64-softmmu
|
||||
MAKE_CHECK_ARGS: check-build
|
||||
timeout: 70m
|
||||
@@ -469,7 +466,7 @@ tsan-build:
|
||||
variables:
|
||||
IMAGE: ubuntu2004
|
||||
CONFIGURE_ARGS: --enable-tsan --cc=clang-10 --cxx=clang++-10
|
||||
--enable-trace-backends=ust --enable-fdt=system --enable-slirp=system
|
||||
--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
|
||||
|
||||
@@ -571,7 +568,6 @@ build-without-default-features:
|
||||
--disable-capstone
|
||||
--disable-pie
|
||||
--disable-qom-cast-debug
|
||||
--disable-slirp
|
||||
--disable-strip
|
||||
TARGETS: avr-softmmu i386-softmmu mips64-softmmu s390x-softmmu sh4-softmmu
|
||||
sparc64-softmmu hexagon-linux-user i386-linux-user s390x-linux-user
|
||||
|
||||
@@ -46,9 +46,6 @@
|
||||
[submodule "roms/edk2"]
|
||||
path = roms/edk2
|
||||
url = https://gitlab.com/qemu-project/edk2.git
|
||||
[submodule "slirp"]
|
||||
path = slirp
|
||||
url = https://gitlab.com/qemu-project/libslirp.git
|
||||
[submodule "roms/opensbi"]
|
||||
path = roms/opensbi
|
||||
url = https://gitlab.com/qemu-project/opensbi.git
|
||||
|
||||
@@ -2985,7 +2985,6 @@ F: include/hw/registerfields.h
|
||||
SLIRP
|
||||
M: Samuel Thibault <samuel.thibault@ens-lyon.org>
|
||||
S: Maintained
|
||||
F: slirp/
|
||||
F: net/slirp.c
|
||||
F: include/net/slirp.h
|
||||
T: git https://people.debian.org/~sthibault/qemu.git slirp
|
||||
|
||||
@@ -319,11 +319,6 @@ vfio_user_server="disabled"
|
||||
# are included in the automatically generated help message)
|
||||
|
||||
# 1. Track which submodules are needed
|
||||
if test "$default_feature" = no ; then
|
||||
slirp="disabled"
|
||||
else
|
||||
slirp="auto"
|
||||
fi
|
||||
fdt="auto"
|
||||
|
||||
# 2. Automatically enable/disable other options
|
||||
@@ -827,14 +822,6 @@ for opt do
|
||||
;;
|
||||
--disable-tsan) tsan="no"
|
||||
;;
|
||||
--disable-slirp) slirp="disabled"
|
||||
;;
|
||||
--enable-slirp) slirp="enabled"
|
||||
;;
|
||||
--enable-slirp=git) slirp="internal"
|
||||
;;
|
||||
--enable-slirp=*) slirp="$optarg"
|
||||
;;
|
||||
--disable-tcg) tcg="disabled"
|
||||
plugins="no"
|
||||
;;
|
||||
@@ -1253,6 +1240,7 @@ add_to nowarn_flags -Wno-string-plus-int
|
||||
add_to nowarn_flags -Wno-typedef-redefinition
|
||||
add_to nowarn_flags -Wno-tautological-type-limit-compare
|
||||
add_to nowarn_flags -Wno-psabi
|
||||
add_to nowarn_flags -Wno-gnu-variable-sized-type-not-at-end
|
||||
|
||||
gcc_flags="$warn_flags $nowarn_flags"
|
||||
|
||||
@@ -1817,16 +1805,6 @@ EOF
|
||||
fi
|
||||
fi
|
||||
|
||||
##########################################
|
||||
# check for slirp
|
||||
|
||||
case "$slirp" in
|
||||
auto | enabled | internal)
|
||||
# Simpler to always update submodule, even if not needed.
|
||||
git_submodules="${git_submodules} slirp"
|
||||
;;
|
||||
esac
|
||||
|
||||
##########################################
|
||||
# functions to probe cross compilers
|
||||
|
||||
@@ -2734,7 +2712,6 @@ if test "$skip_meson" = no; then
|
||||
test "$fdt" != auto && meson_option_add "-Dfdt=$fdt"
|
||||
test -n "${LIB_FUZZING_ENGINE+xxx}" && meson_option_add "-Dfuzzing_engine=$LIB_FUZZING_ENGINE"
|
||||
test "$qemu_suffix" != qemu && meson_option_add "-Dqemu_suffix=$qemu_suffix"
|
||||
test "$slirp" != auto && meson_option_add "-Dslirp=$slirp"
|
||||
test "$smbd" != '' && meson_option_add "-Dsmbd=$smbd"
|
||||
test "$tcg" != enabled && meson_option_add "-Dtcg=$tcg"
|
||||
test "$vfio_user_server" != auto && meson_option_add "-Dvfio_user_server=$vfio_user_server"
|
||||
|
||||
@@ -23,6 +23,7 @@ s390x_ss.add(when: 'CONFIG_KVM', if_true: files(
|
||||
's390-skeys-kvm.c',
|
||||
's390-stattrib-kvm.c',
|
||||
'pv.c',
|
||||
's390-pci-kvm.c',
|
||||
))
|
||||
s390x_ss.add(when: 'CONFIG_TCG', if_true: files(
|
||||
'tod-tcg.c',
|
||||
|
||||
+104
-7
@@ -16,6 +16,7 @@
|
||||
#include "qapi/visitor.h"
|
||||
#include "hw/s390x/s390-pci-bus.h"
|
||||
#include "hw/s390x/s390-pci-inst.h"
|
||||
#include "hw/s390x/s390-pci-kvm.h"
|
||||
#include "hw/s390x/s390-pci-vfio.h"
|
||||
#include "hw/pci/pci_bus.h"
|
||||
#include "hw/qdev-properties.h"
|
||||
@@ -189,7 +190,10 @@ void s390_pci_sclp_deconfigure(SCCB *sccb)
|
||||
rc = SCLP_RC_NO_ACTION_REQUIRED;
|
||||
break;
|
||||
default:
|
||||
if (pbdev->summary_ind) {
|
||||
if (pbdev->interp && (pbdev->fh & FH_MASK_ENABLE)) {
|
||||
/* Interpreted devices were using interrupt forwarding */
|
||||
s390_pci_kvm_aif_disable(pbdev);
|
||||
} else if (pbdev->summary_ind) {
|
||||
pci_dereg_irqs(pbdev);
|
||||
}
|
||||
if (pbdev->iommu->enabled) {
|
||||
@@ -744,13 +748,14 @@ static void s390_pci_iommu_free(S390pciState *s, PCIBus *bus, int32_t devfn)
|
||||
object_unref(OBJECT(iommu));
|
||||
}
|
||||
|
||||
S390PCIGroup *s390_group_create(int id)
|
||||
S390PCIGroup *s390_group_create(int id, int host_id)
|
||||
{
|
||||
S390PCIGroup *group;
|
||||
S390pciState *s = s390_get_phb();
|
||||
|
||||
group = g_new0(S390PCIGroup, 1);
|
||||
group->id = id;
|
||||
group->host_id = host_id;
|
||||
QTAILQ_INSERT_TAIL(&s->zpci_groups, group, link);
|
||||
return group;
|
||||
}
|
||||
@@ -768,12 +773,25 @@ S390PCIGroup *s390_group_find(int id)
|
||||
return NULL;
|
||||
}
|
||||
|
||||
S390PCIGroup *s390_group_find_host_sim(int host_id)
|
||||
{
|
||||
S390PCIGroup *group;
|
||||
S390pciState *s = s390_get_phb();
|
||||
|
||||
QTAILQ_FOREACH(group, &s->zpci_groups, link) {
|
||||
if (group->id >= ZPCI_SIM_GRP_START && group->host_id == host_id) {
|
||||
return group;
|
||||
}
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
||||
static void s390_pci_init_default_group(void)
|
||||
{
|
||||
S390PCIGroup *group;
|
||||
ClpRspQueryPciGrp *resgrp;
|
||||
|
||||
group = s390_group_create(ZPCI_DEFAULT_FN_GRP);
|
||||
group = s390_group_create(ZPCI_DEFAULT_FN_GRP, ZPCI_DEFAULT_FN_GRP);
|
||||
resgrp = &group->zpci_group;
|
||||
resgrp->fr = 1;
|
||||
resgrp->dasm = 0;
|
||||
@@ -821,6 +839,7 @@ static void s390_pcihost_realize(DeviceState *dev, Error **errp)
|
||||
NULL, g_free);
|
||||
s->zpci_table = g_hash_table_new_full(g_int_hash, g_int_equal, NULL, NULL);
|
||||
s->bus_no = 0;
|
||||
s->next_sim_grp = ZPCI_SIM_GRP_START;
|
||||
QTAILQ_INIT(&s->pending_sei);
|
||||
QTAILQ_INIT(&s->zpci_devs);
|
||||
QTAILQ_INIT(&s->zpci_dma_limit);
|
||||
@@ -880,6 +899,10 @@ static int s390_pci_msix_init(S390PCIBusDevice *pbdev)
|
||||
|
||||
static void s390_pci_msix_free(S390PCIBusDevice *pbdev)
|
||||
{
|
||||
if (pbdev->msix.entries == 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
memory_region_del_subregion(&pbdev->iommu->mr, &pbdev->msix_notify_mr);
|
||||
object_unparent(OBJECT(&pbdev->msix_notify_mr));
|
||||
}
|
||||
@@ -971,12 +994,51 @@ static void s390_pci_update_subordinate(PCIDevice *dev, uint32_t nr)
|
||||
}
|
||||
}
|
||||
|
||||
static int s390_pci_interp_plug(S390pciState *s, S390PCIBusDevice *pbdev)
|
||||
{
|
||||
uint32_t idx, fh;
|
||||
|
||||
if (!s390_pci_get_host_fh(pbdev, &fh)) {
|
||||
return -EPERM;
|
||||
}
|
||||
|
||||
/*
|
||||
* The host device is already in an enabled state, but we always present
|
||||
* the initial device state to the guest as disabled (ZPCI_FS_DISABLED).
|
||||
* Therefore, mask off the enable bit from the passthrough handle until
|
||||
* the guest issues a CLP SET PCI FN later to enable the device.
|
||||
*/
|
||||
pbdev->fh = fh & ~FH_MASK_ENABLE;
|
||||
|
||||
/* Next, see if the idx is already in-use */
|
||||
idx = pbdev->fh & FH_MASK_INDEX;
|
||||
if (pbdev->idx != idx) {
|
||||
if (s390_pci_find_dev_by_idx(s, idx)) {
|
||||
return -EINVAL;
|
||||
}
|
||||
/*
|
||||
* Update the idx entry with the passed through idx
|
||||
* If the relinquished idx is lower than next_idx, use it
|
||||
* to replace next_idx
|
||||
*/
|
||||
g_hash_table_remove(s->zpci_table, &pbdev->idx);
|
||||
if (idx < s->next_idx) {
|
||||
s->next_idx = idx;
|
||||
}
|
||||
pbdev->idx = idx;
|
||||
g_hash_table_insert(s->zpci_table, &pbdev->idx, pbdev);
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void s390_pcihost_plug(HotplugHandler *hotplug_dev, DeviceState *dev,
|
||||
Error **errp)
|
||||
{
|
||||
S390pciState *s = S390_PCI_HOST_BRIDGE(hotplug_dev);
|
||||
PCIDevice *pdev = NULL;
|
||||
S390PCIBusDevice *pbdev = NULL;
|
||||
int rc;
|
||||
|
||||
if (object_dynamic_cast(OBJECT(dev), TYPE_PCI_BRIDGE)) {
|
||||
PCIBridge *pb = PCI_BRIDGE(dev);
|
||||
@@ -1022,15 +1084,41 @@ static void s390_pcihost_plug(HotplugHandler *hotplug_dev, DeviceState *dev,
|
||||
set_pbdev_info(pbdev);
|
||||
|
||||
if (object_dynamic_cast(OBJECT(dev), "vfio-pci")) {
|
||||
pbdev->fh |= FH_SHM_VFIO;
|
||||
/*
|
||||
* By default, interpretation is always requested; if the available
|
||||
* facilities indicate it is not available, fallback to the
|
||||
* interception model.
|
||||
*/
|
||||
if (pbdev->interp) {
|
||||
if (s390_pci_kvm_interp_allowed()) {
|
||||
rc = s390_pci_interp_plug(s, pbdev);
|
||||
if (rc) {
|
||||
error_setg(errp, "Plug failed for zPCI device in "
|
||||
"interpretation mode: %d", rc);
|
||||
return;
|
||||
}
|
||||
} else {
|
||||
DPRINTF("zPCI interpretation facilities missing.\n");
|
||||
pbdev->interp = false;
|
||||
pbdev->forwarding_assist = false;
|
||||
}
|
||||
}
|
||||
pbdev->iommu->dma_limit = s390_pci_start_dma_count(s, pbdev);
|
||||
/* Fill in CLP information passed via the vfio region */
|
||||
s390_pci_get_clp_info(pbdev);
|
||||
if (!pbdev->interp) {
|
||||
/* Do vfio passthrough but intercept for I/O */
|
||||
pbdev->fh |= FH_SHM_VFIO;
|
||||
pbdev->forwarding_assist = false;
|
||||
}
|
||||
} else {
|
||||
pbdev->fh |= FH_SHM_EMUL;
|
||||
/* Always intercept emulated devices */
|
||||
pbdev->interp = false;
|
||||
pbdev->forwarding_assist = false;
|
||||
}
|
||||
|
||||
if (s390_pci_msix_init(pbdev)) {
|
||||
if (s390_pci_msix_init(pbdev) && !pbdev->interp) {
|
||||
error_setg(errp, "MSI-X support is mandatory "
|
||||
"in the S390 architecture");
|
||||
return;
|
||||
@@ -1177,7 +1265,10 @@ static void s390_pcihost_reset(DeviceState *dev)
|
||||
/* Process all pending unplug requests */
|
||||
QTAILQ_FOREACH_SAFE(pbdev, &s->zpci_devs, link, next) {
|
||||
if (pbdev->unplug_requested) {
|
||||
if (pbdev->summary_ind) {
|
||||
if (pbdev->interp && (pbdev->fh & FH_MASK_ENABLE)) {
|
||||
/* Interpreted devices were using interrupt forwarding */
|
||||
s390_pci_kvm_aif_disable(pbdev);
|
||||
} else if (pbdev->summary_ind) {
|
||||
pci_dereg_irqs(pbdev);
|
||||
}
|
||||
if (pbdev->iommu->enabled) {
|
||||
@@ -1315,7 +1406,10 @@ static void s390_pci_device_reset(DeviceState *dev)
|
||||
break;
|
||||
}
|
||||
|
||||
if (pbdev->summary_ind) {
|
||||
if (pbdev->interp && (pbdev->fh & FH_MASK_ENABLE)) {
|
||||
/* Interpreted devices were using interrupt forwarding */
|
||||
s390_pci_kvm_aif_disable(pbdev);
|
||||
} else if (pbdev->summary_ind) {
|
||||
pci_dereg_irqs(pbdev);
|
||||
}
|
||||
if (pbdev->iommu->enabled) {
|
||||
@@ -1360,6 +1454,9 @@ static Property s390_pci_device_properties[] = {
|
||||
DEFINE_PROP_UINT16("uid", S390PCIBusDevice, uid, UID_UNDEFINED),
|
||||
DEFINE_PROP_S390_PCI_FID("fid", S390PCIBusDevice, fid),
|
||||
DEFINE_PROP_STRING("target", S390PCIBusDevice, target),
|
||||
DEFINE_PROP_BOOL("interpret", S390PCIBusDevice, interp, true),
|
||||
DEFINE_PROP_BOOL("forwarding-assist", S390PCIBusDevice, forwarding_assist,
|
||||
true),
|
||||
DEFINE_PROP_END_OF_LIST(),
|
||||
};
|
||||
|
||||
|
||||
@@ -18,6 +18,8 @@
|
||||
#include "sysemu/hw_accel.h"
|
||||
#include "hw/s390x/s390-pci-inst.h"
|
||||
#include "hw/s390x/s390-pci-bus.h"
|
||||
#include "hw/s390x/s390-pci-kvm.h"
|
||||
#include "hw/s390x/s390-pci-vfio.h"
|
||||
#include "hw/s390x/tod.h"
|
||||
|
||||
#ifndef DEBUG_S390PCI_INST
|
||||
@@ -246,6 +248,20 @@ int clp_service_call(S390CPU *cpu, uint8_t r2, uintptr_t ra)
|
||||
goto out;
|
||||
}
|
||||
|
||||
/*
|
||||
* Take this opportunity to make sure we still have an accurate
|
||||
* host fh. It's possible part of the handle changed while the
|
||||
* device was disabled to the guest (e.g. vfio hot reset for
|
||||
* ISM during plug)
|
||||
*/
|
||||
if (pbdev->interp) {
|
||||
/* Take this opportunity to make sure we are sync'd with host */
|
||||
if (!s390_pci_get_host_fh(pbdev, &pbdev->fh) ||
|
||||
!(pbdev->fh & FH_MASK_ENABLE)) {
|
||||
stw_p(&ressetpci->hdr.rsp, CLP_RC_SETPCIFN_FH);
|
||||
goto out;
|
||||
}
|
||||
}
|
||||
pbdev->fh |= FH_MASK_ENABLE;
|
||||
pbdev->state = ZPCI_FS_ENABLED;
|
||||
stl_p(&ressetpci->fh, pbdev->fh);
|
||||
@@ -1050,6 +1066,32 @@ static void fmb_update(void *opaque)
|
||||
timer_mod(pbdev->fmb_timer, t + pbdev->pci_group->zpci_group.mui);
|
||||
}
|
||||
|
||||
static int mpcifc_reg_int_interp(S390PCIBusDevice *pbdev, ZpciFib *fib)
|
||||
{
|
||||
int rc;
|
||||
|
||||
rc = s390_pci_kvm_aif_enable(pbdev, fib, pbdev->forwarding_assist);
|
||||
if (rc) {
|
||||
DPRINTF("Failed to enable interrupt forwarding\n");
|
||||
return rc;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int mpcifc_dereg_int_interp(S390PCIBusDevice *pbdev, ZpciFib *fib)
|
||||
{
|
||||
int rc;
|
||||
|
||||
rc = s390_pci_kvm_aif_disable(pbdev);
|
||||
if (rc) {
|
||||
DPRINTF("Failed to disable interrupt forwarding\n");
|
||||
return rc;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
int mpcifc_service_call(S390CPU *cpu, uint8_t r1, uint64_t fiba, uint8_t ar,
|
||||
uintptr_t ra)
|
||||
{
|
||||
@@ -1104,7 +1146,12 @@ int mpcifc_service_call(S390CPU *cpu, uint8_t r1, uint64_t fiba, uint8_t ar,
|
||||
|
||||
switch (oc) {
|
||||
case ZPCI_MOD_FC_REG_INT:
|
||||
if (pbdev->summary_ind) {
|
||||
if (pbdev->interp) {
|
||||
if (mpcifc_reg_int_interp(pbdev, &fib)) {
|
||||
cc = ZPCI_PCI_LS_ERR;
|
||||
s390_set_status_code(env, r1, ZPCI_MOD_ST_SEQUENCE);
|
||||
}
|
||||
} else if (pbdev->summary_ind) {
|
||||
cc = ZPCI_PCI_LS_ERR;
|
||||
s390_set_status_code(env, r1, ZPCI_MOD_ST_SEQUENCE);
|
||||
} else if (reg_irqs(env, pbdev, fib)) {
|
||||
@@ -1113,7 +1160,12 @@ int mpcifc_service_call(S390CPU *cpu, uint8_t r1, uint64_t fiba, uint8_t ar,
|
||||
}
|
||||
break;
|
||||
case ZPCI_MOD_FC_DEREG_INT:
|
||||
if (!pbdev->summary_ind) {
|
||||
if (pbdev->interp) {
|
||||
if (mpcifc_dereg_int_interp(pbdev, &fib)) {
|
||||
cc = ZPCI_PCI_LS_ERR;
|
||||
s390_set_status_code(env, r1, ZPCI_MOD_ST_SEQUENCE);
|
||||
}
|
||||
} else if (!pbdev->summary_ind) {
|
||||
cc = ZPCI_PCI_LS_ERR;
|
||||
s390_set_status_code(env, r1, ZPCI_MOD_ST_SEQUENCE);
|
||||
} else {
|
||||
|
||||
@@ -0,0 +1,54 @@
|
||||
/*
|
||||
* s390 zPCI KVM interfaces
|
||||
*
|
||||
* Copyright 2022 IBM Corp.
|
||||
* Author(s): Matthew Rosato <mjrosato@linux.ibm.com>
|
||||
*
|
||||
* This work is licensed under the terms of the GNU GPL, version 2 or (at
|
||||
* your option) any later version. See the COPYING file in the top-level
|
||||
* directory.
|
||||
*/
|
||||
|
||||
#include "qemu/osdep.h"
|
||||
|
||||
#include <linux/kvm.h>
|
||||
|
||||
#include "kvm/kvm_s390x.h"
|
||||
#include "hw/s390x/pv.h"
|
||||
#include "hw/s390x/s390-pci-bus.h"
|
||||
#include "hw/s390x/s390-pci-kvm.h"
|
||||
#include "hw/s390x/s390-pci-inst.h"
|
||||
#include "cpu_models.h"
|
||||
|
||||
bool s390_pci_kvm_interp_allowed(void)
|
||||
{
|
||||
return (kvm_s390_get_zpci_op() && !s390_is_pv() &&
|
||||
!object_property_get_bool(OBJECT(qdev_get_machine()),
|
||||
"zpcii-disable", NULL));
|
||||
}
|
||||
|
||||
int s390_pci_kvm_aif_enable(S390PCIBusDevice *pbdev, ZpciFib *fib, bool assist)
|
||||
{
|
||||
struct kvm_s390_zpci_op args = {
|
||||
.fh = pbdev->fh,
|
||||
.op = KVM_S390_ZPCIOP_REG_AEN,
|
||||
.u.reg_aen.ibv = fib->aibv,
|
||||
.u.reg_aen.sb = fib->aisb,
|
||||
.u.reg_aen.noi = FIB_DATA_NOI(fib->data),
|
||||
.u.reg_aen.isc = FIB_DATA_ISC(fib->data),
|
||||
.u.reg_aen.sbo = FIB_DATA_AISBO(fib->data),
|
||||
.u.reg_aen.flags = (assist) ? 0 : KVM_S390_ZPCIOP_REGAEN_HOST
|
||||
};
|
||||
|
||||
return kvm_vm_ioctl(kvm_state, KVM_S390_ZPCI_OP, &args);
|
||||
}
|
||||
|
||||
int s390_pci_kvm_aif_disable(S390PCIBusDevice *pbdev)
|
||||
{
|
||||
struct kvm_s390_zpci_op args = {
|
||||
.fh = pbdev->fh,
|
||||
.op = KVM_S390_ZPCIOP_DEREG_AEN
|
||||
};
|
||||
|
||||
return kvm_vm_ioctl(kvm_state, KVM_S390_ZPCI_OP, &args);
|
||||
}
|
||||
+109
-20
@@ -124,18 +124,44 @@ static void s390_pci_read_base(S390PCIBusDevice *pbdev,
|
||||
pbdev->zpci_fn.pft = 0;
|
||||
}
|
||||
|
||||
static bool get_host_fh(S390PCIBusDevice *pbdev, struct vfio_device_info *info,
|
||||
uint32_t *fh)
|
||||
{
|
||||
struct vfio_info_cap_header *hdr;
|
||||
struct vfio_device_info_cap_zpci_base *cap;
|
||||
VFIOPCIDevice *vpci = container_of(pbdev->pdev, VFIOPCIDevice, pdev);
|
||||
|
||||
hdr = vfio_get_device_info_cap(info, VFIO_DEVICE_INFO_CAP_ZPCI_BASE);
|
||||
|
||||
/* Can only get the host fh with version 2 or greater */
|
||||
if (hdr == NULL || hdr->version < 2) {
|
||||
trace_s390_pci_clp_cap(vpci->vbasedev.name,
|
||||
VFIO_DEVICE_INFO_CAP_ZPCI_BASE);
|
||||
return false;
|
||||
}
|
||||
cap = (void *) hdr;
|
||||
|
||||
*fh = cap->fh;
|
||||
return true;
|
||||
}
|
||||
|
||||
static void s390_pci_read_group(S390PCIBusDevice *pbdev,
|
||||
struct vfio_device_info *info)
|
||||
{
|
||||
struct vfio_info_cap_header *hdr;
|
||||
struct vfio_device_info_cap_zpci_group *cap;
|
||||
S390pciState *s = s390_get_phb();
|
||||
ClpRspQueryPciGrp *resgrp;
|
||||
VFIOPCIDevice *vpci = container_of(pbdev->pdev, VFIOPCIDevice, pdev);
|
||||
uint8_t start_gid = pbdev->zpci_fn.pfgid;
|
||||
|
||||
hdr = vfio_get_device_info_cap(info, VFIO_DEVICE_INFO_CAP_ZPCI_GROUP);
|
||||
|
||||
/* If capability not provided, just use the default group */
|
||||
if (hdr == NULL) {
|
||||
/*
|
||||
* If capability not provided or the underlying hostdev is simulated, just
|
||||
* use the default group.
|
||||
*/
|
||||
if (hdr == NULL || pbdev->zpci_fn.pfgid >= ZPCI_SIM_GRP_START) {
|
||||
trace_s390_pci_clp_cap(vpci->vbasedev.name,
|
||||
VFIO_DEVICE_INFO_CAP_ZPCI_GROUP);
|
||||
pbdev->zpci_fn.pfgid = ZPCI_DEFAULT_FN_GRP;
|
||||
@@ -144,11 +170,40 @@ static void s390_pci_read_group(S390PCIBusDevice *pbdev,
|
||||
}
|
||||
cap = (void *) hdr;
|
||||
|
||||
/*
|
||||
* For an intercept device, let's use an existing simulated group if one
|
||||
* one was already created for other intercept devices in this group.
|
||||
* If not, create a new simulated group if any are still available.
|
||||
* If all else fails, just fall back on the default group.
|
||||
*/
|
||||
if (!pbdev->interp) {
|
||||
pbdev->pci_group = s390_group_find_host_sim(pbdev->zpci_fn.pfgid);
|
||||
if (pbdev->pci_group) {
|
||||
/* Use existing simulated group */
|
||||
pbdev->zpci_fn.pfgid = pbdev->pci_group->id;
|
||||
return;
|
||||
} else {
|
||||
if (s->next_sim_grp == ZPCI_DEFAULT_FN_GRP) {
|
||||
/* All out of simulated groups, use default */
|
||||
trace_s390_pci_clp_cap(vpci->vbasedev.name,
|
||||
VFIO_DEVICE_INFO_CAP_ZPCI_GROUP);
|
||||
pbdev->zpci_fn.pfgid = ZPCI_DEFAULT_FN_GRP;
|
||||
pbdev->pci_group = s390_group_find(ZPCI_DEFAULT_FN_GRP);
|
||||
return;
|
||||
} else {
|
||||
/* We can assign a new simulated group */
|
||||
pbdev->zpci_fn.pfgid = s->next_sim_grp;
|
||||
s->next_sim_grp++;
|
||||
/* Fall through to create the new sim group using CLP info */
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* See if the PCI group is already defined, create if not */
|
||||
pbdev->pci_group = s390_group_find(pbdev->zpci_fn.pfgid);
|
||||
|
||||
if (!pbdev->pci_group) {
|
||||
pbdev->pci_group = s390_group_create(pbdev->zpci_fn.pfgid);
|
||||
pbdev->pci_group = s390_group_create(pbdev->zpci_fn.pfgid, start_gid);
|
||||
|
||||
resgrp = &pbdev->pci_group->zpci_group;
|
||||
if (cap->flags & VFIO_DEVICE_INFO_ZPCI_FLAG_REFRESH) {
|
||||
@@ -158,7 +213,11 @@ static void s390_pci_read_group(S390PCIBusDevice *pbdev,
|
||||
resgrp->msia = cap->msi_addr;
|
||||
resgrp->mui = cap->mui;
|
||||
resgrp->i = cap->noi;
|
||||
resgrp->maxstbl = cap->maxstbl;
|
||||
if (pbdev->interp && hdr->version >= 2) {
|
||||
resgrp->maxstbl = cap->imaxstbl;
|
||||
} else {
|
||||
resgrp->maxstbl = cap->maxstbl;
|
||||
}
|
||||
resgrp->version = cap->version;
|
||||
resgrp->dtsm = ZPCI_DTSM;
|
||||
}
|
||||
@@ -217,25 +276,13 @@ static void s390_pci_read_pfip(S390PCIBusDevice *pbdev,
|
||||
memcpy(pbdev->zpci_fn.pfip, cap->pfip, CLP_PFIP_NR_SEGMENTS);
|
||||
}
|
||||
|
||||
/*
|
||||
* This function will issue the VFIO_DEVICE_GET_INFO ioctl and look for
|
||||
* capabilities that contain information about CLP features provided by the
|
||||
* underlying host.
|
||||
* On entry, defaults have already been placed into the guest CLP response
|
||||
* buffers. On exit, defaults will have been overwritten for any CLP features
|
||||
* found in the capability chain; defaults will remain for any CLP features not
|
||||
* found in the chain.
|
||||
*/
|
||||
void s390_pci_get_clp_info(S390PCIBusDevice *pbdev)
|
||||
static struct vfio_device_info *get_device_info(S390PCIBusDevice *pbdev,
|
||||
uint32_t argsz)
|
||||
{
|
||||
g_autofree struct vfio_device_info *info = NULL;
|
||||
struct vfio_device_info *info = g_malloc0(argsz);
|
||||
VFIOPCIDevice *vfio_pci;
|
||||
uint32_t argsz;
|
||||
int fd;
|
||||
|
||||
argsz = sizeof(*info);
|
||||
info = g_malloc0(argsz);
|
||||
|
||||
vfio_pci = container_of(pbdev->pdev, VFIOPCIDevice, pdev);
|
||||
fd = vfio_pci->vbasedev.fd;
|
||||
|
||||
@@ -250,7 +297,8 @@ retry:
|
||||
|
||||
if (ioctl(fd, VFIO_DEVICE_GET_INFO, info)) {
|
||||
trace_s390_pci_clp_dev_info(vfio_pci->vbasedev.name);
|
||||
return;
|
||||
g_free(info);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
if (info->argsz > argsz) {
|
||||
@@ -259,6 +307,47 @@ retry:
|
||||
goto retry;
|
||||
}
|
||||
|
||||
return info;
|
||||
}
|
||||
|
||||
/*
|
||||
* Get the host function handle from the vfio CLP capabilities chain. Returns
|
||||
* true if a fh value was placed into the provided buffer. Returns false
|
||||
* if a fh could not be obtained (ioctl failed or capabilitiy version does
|
||||
* not include the fh)
|
||||
*/
|
||||
bool s390_pci_get_host_fh(S390PCIBusDevice *pbdev, uint32_t *fh)
|
||||
{
|
||||
g_autofree struct vfio_device_info *info = NULL;
|
||||
|
||||
assert(fh);
|
||||
|
||||
info = get_device_info(pbdev, sizeof(*info));
|
||||
if (!info) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return get_host_fh(pbdev, info, fh);
|
||||
}
|
||||
|
||||
/*
|
||||
* This function will issue the VFIO_DEVICE_GET_INFO ioctl and look for
|
||||
* capabilities that contain information about CLP features provided by the
|
||||
* underlying host.
|
||||
* On entry, defaults have already been placed into the guest CLP response
|
||||
* buffers. On exit, defaults will have been overwritten for any CLP features
|
||||
* found in the capability chain; defaults will remain for any CLP features not
|
||||
* found in the chain.
|
||||
*/
|
||||
void s390_pci_get_clp_info(S390PCIBusDevice *pbdev)
|
||||
{
|
||||
g_autofree struct vfio_device_info *info = NULL;
|
||||
|
||||
info = get_device_info(pbdev, sizeof(*info));
|
||||
if (!info) {
|
||||
return;
|
||||
}
|
||||
|
||||
/*
|
||||
* Find the CLP features provided and fill in the guest CLP responses.
|
||||
* Always call s390_pci_read_base first as information from this could
|
||||
|
||||
@@ -645,6 +645,21 @@ static inline void machine_set_dea_key_wrap(Object *obj, bool value,
|
||||
ms->dea_key_wrap = value;
|
||||
}
|
||||
|
||||
static inline bool machine_get_zpcii_disable(Object *obj, Error **errp)
|
||||
{
|
||||
S390CcwMachineState *ms = S390_CCW_MACHINE(obj);
|
||||
|
||||
return ms->zpcii_disable;
|
||||
}
|
||||
|
||||
static inline void machine_set_zpcii_disable(Object *obj, bool value,
|
||||
Error **errp)
|
||||
{
|
||||
S390CcwMachineState *ms = S390_CCW_MACHINE(obj);
|
||||
|
||||
ms->zpcii_disable = value;
|
||||
}
|
||||
|
||||
static S390CcwMachineClass *current_mc;
|
||||
|
||||
/*
|
||||
@@ -740,6 +755,13 @@ static inline void s390_machine_initfn(Object *obj)
|
||||
"Up to 8 chars in set of [A-Za-z0-9. ] (lower case chars converted"
|
||||
" to upper case) to pass to machine loader, boot manager,"
|
||||
" and guest kernel");
|
||||
|
||||
object_property_add_bool(obj, "zpcii-disable",
|
||||
machine_get_zpcii_disable,
|
||||
machine_set_zpcii_disable);
|
||||
object_property_set_description(obj, "zpcii-disable",
|
||||
"disable zPCI interpretation facilties");
|
||||
object_property_set_bool(obj, "zpcii-disable", false, NULL);
|
||||
}
|
||||
|
||||
static const TypeInfo ccw_machine_info = {
|
||||
@@ -803,8 +825,13 @@ DEFINE_CCW_MACHINE(7_2, "7.2", true);
|
||||
|
||||
static void ccw_machine_7_1_instance_options(MachineState *machine)
|
||||
{
|
||||
static const S390FeatInit qemu_cpu_feat = { S390_FEAT_LIST_QEMU_V7_1 };
|
||||
S390CcwMachineState *ms = S390_CCW_MACHINE(machine);
|
||||
|
||||
ccw_machine_7_2_instance_options(machine);
|
||||
s390_cpudef_featoff_greater(16, 1, S390_FEAT_PAIE);
|
||||
s390_set_qemu_cpu_model(0x8561, 15, 1, qemu_cpu_feat);
|
||||
ms->zpcii_disable = true;
|
||||
}
|
||||
|
||||
static void ccw_machine_7_1_class_options(MachineClass *mc)
|
||||
|
||||
@@ -315,13 +315,16 @@ typedef struct ZpciFmb {
|
||||
QEMU_BUILD_BUG_MSG(offsetof(ZpciFmb, fmt0) != 48, "padding in ZpciFmb");
|
||||
|
||||
#define ZPCI_DEFAULT_FN_GRP 0xFF
|
||||
#define ZPCI_SIM_GRP_START 0xF0
|
||||
typedef struct S390PCIGroup {
|
||||
ClpRspQueryPciGrp zpci_group;
|
||||
int id;
|
||||
int host_id;
|
||||
QTAILQ_ENTRY(S390PCIGroup) link;
|
||||
} S390PCIGroup;
|
||||
S390PCIGroup *s390_group_create(int id);
|
||||
S390PCIGroup *s390_group_create(int id, int host_id);
|
||||
S390PCIGroup *s390_group_find(int id);
|
||||
S390PCIGroup *s390_group_find_host_sim(int host_id);
|
||||
|
||||
struct S390PCIBusDevice {
|
||||
DeviceState qdev;
|
||||
@@ -350,6 +353,8 @@ struct S390PCIBusDevice {
|
||||
IndAddr *indicator;
|
||||
bool pci_unplug_request_processed;
|
||||
bool unplug_requested;
|
||||
bool interp;
|
||||
bool forwarding_assist;
|
||||
QTAILQ_ENTRY(S390PCIBusDevice) link;
|
||||
};
|
||||
|
||||
@@ -368,6 +373,7 @@ struct S390pciState {
|
||||
QTAILQ_HEAD(, S390PCIBusDevice) zpci_devs;
|
||||
QTAILQ_HEAD(, S390PCIDMACount) zpci_dma_limit;
|
||||
QTAILQ_HEAD(, S390PCIGroup) zpci_groups;
|
||||
uint8_t next_sim_grp;
|
||||
};
|
||||
|
||||
S390pciState *s390_get_phb(void);
|
||||
|
||||
@@ -0,0 +1,38 @@
|
||||
/*
|
||||
* s390 PCI KVM interfaces
|
||||
*
|
||||
* Copyright 2022 IBM Corp.
|
||||
* Author(s): Matthew Rosato <mjrosato@linux.ibm.com>
|
||||
*
|
||||
* This work is licensed under the terms of the GNU GPL, version 2 or (at
|
||||
* your option) any later version. See the COPYING file in the top-level
|
||||
* directory.
|
||||
*/
|
||||
|
||||
#ifndef HW_S390_PCI_KVM_H
|
||||
#define HW_S390_PCI_KVM_H
|
||||
|
||||
#include "hw/s390x/s390-pci-bus.h"
|
||||
#include "hw/s390x/s390-pci-inst.h"
|
||||
|
||||
#ifdef CONFIG_KVM
|
||||
bool s390_pci_kvm_interp_allowed(void);
|
||||
int s390_pci_kvm_aif_enable(S390PCIBusDevice *pbdev, ZpciFib *fib, bool assist);
|
||||
int s390_pci_kvm_aif_disable(S390PCIBusDevice *pbdev);
|
||||
#else
|
||||
static inline bool s390_pci_kvm_interp_allowed(void)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
static inline int s390_pci_kvm_aif_enable(S390PCIBusDevice *pbdev, ZpciFib *fib,
|
||||
bool assist)
|
||||
{
|
||||
return -EINVAL;
|
||||
}
|
||||
static inline int s390_pci_kvm_aif_disable(S390PCIBusDevice *pbdev)
|
||||
{
|
||||
return -EINVAL;
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
@@ -20,6 +20,7 @@ bool s390_pci_update_dma_avail(int fd, unsigned int *avail);
|
||||
S390PCIDMACount *s390_pci_start_dma_count(S390pciState *s,
|
||||
S390PCIBusDevice *pbdev);
|
||||
void s390_pci_end_dma_count(S390pciState *s, S390PCIDMACount *cnt);
|
||||
bool s390_pci_get_host_fh(S390PCIBusDevice *pbdev, uint32_t *fh);
|
||||
void s390_pci_get_clp_info(S390PCIBusDevice *pbdev);
|
||||
#else
|
||||
static inline bool s390_pci_update_dma_avail(int fd, unsigned int *avail)
|
||||
@@ -33,6 +34,10 @@ static inline S390PCIDMACount *s390_pci_start_dma_count(S390pciState *s,
|
||||
}
|
||||
static inline void s390_pci_end_dma_count(S390pciState *s,
|
||||
S390PCIDMACount *cnt) { }
|
||||
static inline bool s390_pci_get_host_fh(S390PCIBusDevice *pbdev, uint32_t *fh)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
static inline void s390_pci_get_clp_info(S390PCIBusDevice *pbdev) { }
|
||||
#endif
|
||||
|
||||
|
||||
@@ -27,6 +27,7 @@ struct S390CcwMachineState {
|
||||
bool aes_key_wrap;
|
||||
bool dea_key_wrap;
|
||||
bool pv;
|
||||
bool zpcii_disable;
|
||||
uint8_t loadparm[8];
|
||||
};
|
||||
|
||||
|
||||
@@ -10,12 +10,13 @@
|
||||
#define SETUP_EFI 4
|
||||
#define SETUP_APPLE_PROPERTIES 5
|
||||
#define SETUP_JAILHOUSE 6
|
||||
#define SETUP_CC_BLOB 7
|
||||
#define SETUP_IMA 8
|
||||
#define SETUP_RNG_SEED 9
|
||||
#define SETUP_ENUM_MAX SETUP_RNG_SEED
|
||||
|
||||
#define SETUP_INDIRECT (1<<31)
|
||||
|
||||
/* SETUP_INDIRECT | max(SETUP_*) */
|
||||
#define SETUP_TYPE_MAX (SETUP_INDIRECT | SETUP_JAILHOUSE)
|
||||
#define SETUP_TYPE_MAX (SETUP_ENUM_MAX | SETUP_INDIRECT)
|
||||
|
||||
/* ram_size flags */
|
||||
#define RAMDISK_IMAGE_START_MASK 0x07FF
|
||||
|
||||
@@ -558,7 +558,7 @@ extern "C" {
|
||||
*
|
||||
* The main surface is Y-tiled and is at plane index 0 whereas CCS is linear
|
||||
* and at index 1. The clear color is stored at index 2, and the pitch should
|
||||
* be ignored. The clear color structure is 256 bits. The first 128 bits
|
||||
* be 64 bytes aligned. The clear color structure is 256 bits. The first 128 bits
|
||||
* represents Raw Clear Color Red, Green, Blue and Alpha color each represented
|
||||
* by 32 bits. The raw clear color is consumed by the 3d engine and generates
|
||||
* the converted clear color of size 64 bits. The first 32 bits store the Lower
|
||||
@@ -571,6 +571,53 @@ extern "C" {
|
||||
*/
|
||||
#define I915_FORMAT_MOD_Y_TILED_GEN12_RC_CCS_CC fourcc_mod_code(INTEL, 8)
|
||||
|
||||
/*
|
||||
* Intel Tile 4 layout
|
||||
*
|
||||
* This is a tiled layout using 4KB tiles in a row-major layout. It has the same
|
||||
* shape as Tile Y at two granularities: 4KB (128B x 32) and 64B (16B x 4). It
|
||||
* only differs from Tile Y at the 256B granularity in between. At this
|
||||
* granularity, Tile Y has a shape of 16B x 32 rows, but this tiling has a shape
|
||||
* of 64B x 8 rows.
|
||||
*/
|
||||
#define I915_FORMAT_MOD_4_TILED fourcc_mod_code(INTEL, 9)
|
||||
|
||||
/*
|
||||
* Intel color control surfaces (CCS) for DG2 render compression.
|
||||
*
|
||||
* The main surface is Tile 4 and at plane index 0. The CCS data is stored
|
||||
* outside of the GEM object in a reserved memory area dedicated for the
|
||||
* storage of the CCS data for all RC/RC_CC/MC compressible GEM objects. The
|
||||
* main surface pitch is required to be a multiple of four Tile 4 widths.
|
||||
*/
|
||||
#define I915_FORMAT_MOD_4_TILED_DG2_RC_CCS fourcc_mod_code(INTEL, 10)
|
||||
|
||||
/*
|
||||
* Intel color control surfaces (CCS) for DG2 media compression.
|
||||
*
|
||||
* The main surface is Tile 4 and at plane index 0. For semi-planar formats
|
||||
* like NV12, the Y and UV planes are Tile 4 and are located at plane indices
|
||||
* 0 and 1, respectively. The CCS for all planes are stored outside of the
|
||||
* GEM object in a reserved memory area dedicated for the storage of the
|
||||
* CCS data for all RC/RC_CC/MC compressible GEM objects. The main surface
|
||||
* pitch is required to be a multiple of four Tile 4 widths.
|
||||
*/
|
||||
#define I915_FORMAT_MOD_4_TILED_DG2_MC_CCS fourcc_mod_code(INTEL, 11)
|
||||
|
||||
/*
|
||||
* Intel Color Control Surface with Clear Color (CCS) for DG2 render compression.
|
||||
*
|
||||
* The main surface is Tile 4 and at plane index 0. The CCS data is stored
|
||||
* outside of the GEM object in a reserved memory area dedicated for the
|
||||
* storage of the CCS data for all RC/RC_CC/MC compressible GEM objects. The
|
||||
* main surface pitch is required to be a multiple of four Tile 4 widths. The
|
||||
* clear color is stored at plane index 1 and the pitch should be 64 bytes
|
||||
* aligned. The format of the 256 bits of clear color data matches the one used
|
||||
* for the I915_FORMAT_MOD_Y_TILED_GEN12_RC_CCS_CC modifier, see its description
|
||||
* for details.
|
||||
*/
|
||||
#define I915_FORMAT_MOD_4_TILED_DG2_RC_CCS_CC fourcc_mod_code(INTEL, 12)
|
||||
|
||||
/*
|
||||
* Tiled, NV12MT, grouped in 64 (pixels) x 32 (lines) -sized macroblocks
|
||||
*
|
||||
@@ -608,6 +655,28 @@ extern "C" {
|
||||
*/
|
||||
#define DRM_FORMAT_MOD_QCOM_COMPRESSED fourcc_mod_code(QCOM, 1)
|
||||
|
||||
/*
|
||||
* Qualcomm Tiled Format
|
||||
*
|
||||
* Similar to DRM_FORMAT_MOD_QCOM_COMPRESSED but not compressed.
|
||||
* Implementation may be platform and base-format specific.
|
||||
*
|
||||
* Each macrotile consists of m x n (mostly 4 x 4) tiles.
|
||||
* Pixel data pitch/stride is aligned with macrotile width.
|
||||
* Pixel data height is aligned with macrotile height.
|
||||
* Entire pixel data buffer is aligned with 4k(bytes).
|
||||
*/
|
||||
#define DRM_FORMAT_MOD_QCOM_TILED3 fourcc_mod_code(QCOM, 3)
|
||||
|
||||
/*
|
||||
* Qualcomm Alternate Tiled Format
|
||||
*
|
||||
* Alternate tiled format typically only used within GMEM.
|
||||
* Implementation may be platform and base-format specific.
|
||||
*/
|
||||
#define DRM_FORMAT_MOD_QCOM_TILED2 fourcc_mod_code(QCOM, 2)
|
||||
|
||||
|
||||
/* Vivante framebuffer modifiers */
|
||||
|
||||
/*
|
||||
@@ -1293,6 +1362,7 @@ drm_fourcc_canonicalize_nvidia_format_mod(uint64_t modifier)
|
||||
#define AMD_FMT_MOD_TILE_VER_GFX9 1
|
||||
#define AMD_FMT_MOD_TILE_VER_GFX10 2
|
||||
#define AMD_FMT_MOD_TILE_VER_GFX10_RBPLUS 3
|
||||
#define AMD_FMT_MOD_TILE_VER_GFX11 4
|
||||
|
||||
/*
|
||||
* 64K_S is the same for GFX9/GFX10/GFX10_RBPLUS and hence has GFX9 as canonical
|
||||
@@ -1308,6 +1378,7 @@ drm_fourcc_canonicalize_nvidia_format_mod(uint64_t modifier)
|
||||
#define AMD_FMT_MOD_TILE_GFX9_64K_S_X 25
|
||||
#define AMD_FMT_MOD_TILE_GFX9_64K_D_X 26
|
||||
#define AMD_FMT_MOD_TILE_GFX9_64K_R_X 27
|
||||
#define AMD_FMT_MOD_TILE_GFX11_256K_R_X 31
|
||||
|
||||
#define AMD_FMT_MOD_DCC_BLOCK_64B 0
|
||||
#define AMD_FMT_MOD_DCC_BLOCK_128B 1
|
||||
|
||||
@@ -257,7 +257,7 @@ struct ethtool_tunable {
|
||||
uint32_t id;
|
||||
uint32_t type_id;
|
||||
uint32_t len;
|
||||
void *data[0];
|
||||
void *data[];
|
||||
};
|
||||
|
||||
#define DOWNSHIFT_DEV_DEFAULT_COUNT 0xff
|
||||
@@ -322,7 +322,7 @@ struct ethtool_regs {
|
||||
uint32_t cmd;
|
||||
uint32_t version;
|
||||
uint32_t len;
|
||||
uint8_t data[0];
|
||||
uint8_t data[];
|
||||
};
|
||||
|
||||
/**
|
||||
@@ -348,7 +348,7 @@ struct ethtool_eeprom {
|
||||
uint32_t magic;
|
||||
uint32_t offset;
|
||||
uint32_t len;
|
||||
uint8_t data[0];
|
||||
uint8_t data[];
|
||||
};
|
||||
|
||||
/**
|
||||
@@ -752,7 +752,7 @@ struct ethtool_gstrings {
|
||||
uint32_t cmd;
|
||||
uint32_t string_set;
|
||||
uint32_t len;
|
||||
uint8_t data[0];
|
||||
uint8_t data[];
|
||||
};
|
||||
|
||||
/**
|
||||
@@ -777,7 +777,7 @@ struct ethtool_sset_info {
|
||||
uint32_t cmd;
|
||||
uint32_t reserved;
|
||||
uint64_t sset_mask;
|
||||
uint32_t data[0];
|
||||
uint32_t data[];
|
||||
};
|
||||
|
||||
/**
|
||||
@@ -817,7 +817,7 @@ struct ethtool_test {
|
||||
uint32_t flags;
|
||||
uint32_t reserved;
|
||||
uint32_t len;
|
||||
uint64_t data[0];
|
||||
uint64_t data[];
|
||||
};
|
||||
|
||||
/**
|
||||
@@ -834,7 +834,7 @@ struct ethtool_test {
|
||||
struct ethtool_stats {
|
||||
uint32_t cmd;
|
||||
uint32_t n_stats;
|
||||
uint64_t data[0];
|
||||
uint64_t data[];
|
||||
};
|
||||
|
||||
/**
|
||||
@@ -851,7 +851,7 @@ struct ethtool_stats {
|
||||
struct ethtool_perm_addr {
|
||||
uint32_t cmd;
|
||||
uint32_t size;
|
||||
uint8_t data[0];
|
||||
uint8_t data[];
|
||||
};
|
||||
|
||||
/* boolean flags controlling per-interface behavior characteristics.
|
||||
@@ -1160,7 +1160,7 @@ struct ethtool_rxnfc {
|
||||
struct ethtool_rxfh_indir {
|
||||
uint32_t cmd;
|
||||
uint32_t size;
|
||||
uint32_t ring_index[0];
|
||||
uint32_t ring_index[];
|
||||
};
|
||||
|
||||
/**
|
||||
@@ -1201,7 +1201,7 @@ struct ethtool_rxfh {
|
||||
uint8_t hfunc;
|
||||
uint8_t rsvd8[3];
|
||||
uint32_t rsvd32;
|
||||
uint32_t rss_config[0];
|
||||
uint32_t rss_config[];
|
||||
};
|
||||
#define ETH_RXFH_CONTEXT_ALLOC 0xffffffff
|
||||
#define ETH_RXFH_INDIR_NO_CHANGE 0xffffffff
|
||||
@@ -1286,7 +1286,7 @@ struct ethtool_dump {
|
||||
uint32_t version;
|
||||
uint32_t flag;
|
||||
uint32_t len;
|
||||
uint8_t data[0];
|
||||
uint8_t data[];
|
||||
};
|
||||
|
||||
#define ETH_FW_DUMP_DISABLE 0
|
||||
@@ -1318,7 +1318,7 @@ struct ethtool_get_features_block {
|
||||
struct ethtool_gfeatures {
|
||||
uint32_t cmd;
|
||||
uint32_t size;
|
||||
struct ethtool_get_features_block features[0];
|
||||
struct ethtool_get_features_block features[];
|
||||
};
|
||||
|
||||
/**
|
||||
@@ -1340,7 +1340,7 @@ struct ethtool_set_features_block {
|
||||
struct ethtool_sfeatures {
|
||||
uint32_t cmd;
|
||||
uint32_t size;
|
||||
struct ethtool_set_features_block features[0];
|
||||
struct ethtool_set_features_block features[];
|
||||
};
|
||||
|
||||
/**
|
||||
@@ -1691,6 +1691,7 @@ enum ethtool_link_mode_bit_indices {
|
||||
ETHTOOL_LINK_MODE_400000baseCR4_Full_BIT = 89,
|
||||
ETHTOOL_LINK_MODE_100baseFX_Half_BIT = 90,
|
||||
ETHTOOL_LINK_MODE_100baseFX_Full_BIT = 91,
|
||||
ETHTOOL_LINK_MODE_10baseT1L_Full_BIT = 92,
|
||||
/* must be last entry */
|
||||
__ETHTOOL_LINK_MODE_MASK_NBITS
|
||||
};
|
||||
@@ -2086,7 +2087,7 @@ struct ethtool_link_settings {
|
||||
uint8_t master_slave_state;
|
||||
uint8_t reserved1[1];
|
||||
uint32_t reserved[7];
|
||||
uint32_t link_mode_masks[0];
|
||||
uint32_t link_mode_masks[];
|
||||
/* layout of link_mode_masks fields:
|
||||
* uint32_t map_supported[link_mode_masks_nwords];
|
||||
* uint32_t map_advertising[link_mode_masks_nwords];
|
||||
|
||||
@@ -75,10 +75,13 @@ struct input_id {
|
||||
* Note that input core does not clamp reported values to the
|
||||
* [minimum, maximum] limits, such task is left to userspace.
|
||||
*
|
||||
* The default resolution for main axes (ABS_X, ABS_Y, ABS_Z)
|
||||
* is reported in units per millimeter (units/mm), resolution
|
||||
* for rotational axes (ABS_RX, ABS_RY, ABS_RZ) is reported
|
||||
* in units per radian.
|
||||
* The default resolution for main axes (ABS_X, ABS_Y, ABS_Z,
|
||||
* ABS_MT_POSITION_X, ABS_MT_POSITION_Y) is reported in units
|
||||
* per millimeter (units/mm), resolution for rotational axes
|
||||
* (ABS_RX, ABS_RY, ABS_RZ) is reported in units per radian.
|
||||
* The resolution for the size axes (ABS_MT_TOUCH_MAJOR,
|
||||
* ABS_MT_TOUCH_MINOR, ABS_MT_WIDTH_MAJOR, ABS_MT_WIDTH_MINOR)
|
||||
* is reported in units per millimeter (units/mm).
|
||||
* When INPUT_PROP_ACCELEROMETER is set the resolution changes.
|
||||
* The main axes (ABS_X, ABS_Y, ABS_Z) are then reported in
|
||||
* units per g (units/g) and in units per degree per second
|
||||
@@ -268,6 +271,7 @@ struct input_mask {
|
||||
#define BUS_RMI 0x1D
|
||||
#define BUS_CEC 0x1E
|
||||
#define BUS_INTEL_ISHTP 0x1F
|
||||
#define BUS_AMD_SFH 0x20
|
||||
|
||||
/*
|
||||
* MT_TOOL types
|
||||
|
||||
@@ -616,6 +616,7 @@
|
||||
#define PCI_EXP_SLTCTL_PWR_OFF 0x0400 /* Power Off */
|
||||
#define PCI_EXP_SLTCTL_EIC 0x0800 /* Electromechanical Interlock Control */
|
||||
#define PCI_EXP_SLTCTL_DLLSCE 0x1000 /* Data Link Layer State Changed Enable */
|
||||
#define PCI_EXP_SLTCTL_ASPL_DISABLE 0x2000 /* Auto Slot Power Limit Disable */
|
||||
#define PCI_EXP_SLTCTL_IBPD_DISABLE 0x4000 /* In-band PD disable */
|
||||
#define PCI_EXP_SLTSTA 0x1a /* Slot Status */
|
||||
#define PCI_EXP_SLTSTA_ABP 0x0001 /* Attention Button Pressed */
|
||||
@@ -736,7 +737,8 @@
|
||||
#define PCI_EXT_CAP_ID_DVSEC 0x23 /* Designated Vendor-Specific */
|
||||
#define PCI_EXT_CAP_ID_DLF 0x25 /* Data Link Feature */
|
||||
#define PCI_EXT_CAP_ID_PL_16GT 0x26 /* Physical Layer 16.0 GT/s */
|
||||
#define PCI_EXT_CAP_ID_MAX PCI_EXT_CAP_ID_PL_16GT
|
||||
#define PCI_EXT_CAP_ID_DOE 0x2E /* Data Object Exchange */
|
||||
#define PCI_EXT_CAP_ID_MAX PCI_EXT_CAP_ID_DOE
|
||||
|
||||
#define PCI_EXT_CAP_DSN_SIZEOF 12
|
||||
#define PCI_EXT_CAP_MCAST_ENDPOINT_SIZEOF 40
|
||||
@@ -1102,4 +1104,30 @@
|
||||
#define PCI_PL_16GT_LE_CTRL_USP_TX_PRESET_MASK 0x000000F0
|
||||
#define PCI_PL_16GT_LE_CTRL_USP_TX_PRESET_SHIFT 4
|
||||
|
||||
/* Data Object Exchange */
|
||||
#define PCI_DOE_CAP 0x04 /* DOE Capabilities Register */
|
||||
#define PCI_DOE_CAP_INT_SUP 0x00000001 /* Interrupt Support */
|
||||
#define PCI_DOE_CAP_INT_MSG_NUM 0x00000ffe /* Interrupt Message Number */
|
||||
#define PCI_DOE_CTRL 0x08 /* DOE Control Register */
|
||||
#define PCI_DOE_CTRL_ABORT 0x00000001 /* DOE Abort */
|
||||
#define PCI_DOE_CTRL_INT_EN 0x00000002 /* DOE Interrupt Enable */
|
||||
#define PCI_DOE_CTRL_GO 0x80000000 /* DOE Go */
|
||||
#define PCI_DOE_STATUS 0x0c /* DOE Status Register */
|
||||
#define PCI_DOE_STATUS_BUSY 0x00000001 /* DOE Busy */
|
||||
#define PCI_DOE_STATUS_INT_STATUS 0x00000002 /* DOE Interrupt Status */
|
||||
#define PCI_DOE_STATUS_ERROR 0x00000004 /* DOE Error */
|
||||
#define PCI_DOE_STATUS_DATA_OBJECT_READY 0x80000000 /* Data Object Ready */
|
||||
#define PCI_DOE_WRITE 0x10 /* DOE Write Data Mailbox Register */
|
||||
#define PCI_DOE_READ 0x14 /* DOE Read Data Mailbox Register */
|
||||
|
||||
/* DOE Data Object - note not actually registers */
|
||||
#define PCI_DOE_DATA_OBJECT_HEADER_1_VID 0x0000ffff
|
||||
#define PCI_DOE_DATA_OBJECT_HEADER_1_TYPE 0x00ff0000
|
||||
#define PCI_DOE_DATA_OBJECT_HEADER_2_LENGTH 0x0003ffff
|
||||
|
||||
#define PCI_DOE_DATA_OBJECT_DISC_REQ_3_INDEX 0x000000ff
|
||||
#define PCI_DOE_DATA_OBJECT_DISC_RSP_3_VID 0x0000ffff
|
||||
#define PCI_DOE_DATA_OBJECT_DISC_RSP_3_PROTOCOL 0x00ff0000
|
||||
#define PCI_DOE_DATA_OBJECT_DISC_RSP_3_NEXT_INDEX 0xff000000
|
||||
|
||||
#endif /* LINUX_PCI_REGS_H */
|
||||
|
||||
@@ -87,7 +87,7 @@ struct vhost_msg {
|
||||
|
||||
struct vhost_msg_v2 {
|
||||
uint32_t type;
|
||||
uint32_t reserved;
|
||||
uint32_t asid;
|
||||
union {
|
||||
struct vhost_iotlb_msg iotlb;
|
||||
uint8_t padding[64];
|
||||
@@ -107,7 +107,7 @@ struct vhost_memory_region {
|
||||
struct vhost_memory {
|
||||
uint32_t nregions;
|
||||
uint32_t padding;
|
||||
struct vhost_memory_region regions[0];
|
||||
struct vhost_memory_region regions[];
|
||||
};
|
||||
|
||||
/* VHOST_SCSI specific definitions */
|
||||
@@ -135,7 +135,7 @@ struct vhost_scsi_target {
|
||||
struct vhost_vdpa_config {
|
||||
uint32_t off;
|
||||
uint32_t len;
|
||||
uint8_t buf[0];
|
||||
uint8_t buf[];
|
||||
};
|
||||
|
||||
/* vhost vdpa IOVA range
|
||||
@@ -153,4 +153,15 @@ struct vhost_vdpa_iova_range {
|
||||
/* vhost-net should add virtio_net_hdr for RX, and strip for TX packets. */
|
||||
#define VHOST_NET_F_VIRTIO_NET_HDR 27
|
||||
|
||||
/* Use message type V2 */
|
||||
#define VHOST_BACKEND_F_IOTLB_MSG_V2 0x1
|
||||
/* IOTLB can accept batching hints */
|
||||
#define VHOST_BACKEND_F_IOTLB_BATCH 0x2
|
||||
/* IOTLB can accept address space identifier through V2 type of IOTLB
|
||||
* message
|
||||
*/
|
||||
#define VHOST_BACKEND_F_IOTLB_ASID 0x3
|
||||
/* Device can be suspended */
|
||||
#define VHOST_BACKEND_F_SUSPEND 0x4
|
||||
|
||||
#endif
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user