Compare commits
43 Commits
factory
...
opensuse-7
Author | SHA1 | Date | |
---|---|---|---|
|
216b4f2783 | ||
|
abd8d76d6c | ||
|
c0e5f3ef15 | ||
|
c6178f8fe9 | ||
|
4e3ca926b4 | ||
|
5575395078 | ||
|
07b0cc7d65 | ||
|
57aa1fbc47 | ||
63fd2b2cc0 | |||
|
496be330c6 | ||
|
3615ae91ea | ||
|
7c072fbd45 | ||
|
33ee00e645 | ||
|
6c27cdd901 | ||
|
2e6c40f5cf | ||
10c9e6816c | |||
3077177805 | |||
|
47a17d0b35 | ||
|
11f65aa600 | ||
8c45edfeb0 | |||
|
63d333e653 | ||
|
8ff08bf1c5 | ||
ff24a22deb | |||
|
9a24152172 | ||
|
07f23f6c63 | ||
0497406566 | |||
|
81ed78ce9c | ||
|
006a0333f9 | ||
|
b967452ef0 | ||
|
9636002e87 | ||
|
250116f48d | ||
|
71c20d91ef | ||
|
103a7fd837 | ||
|
e64d252609 | ||
|
cd6371c896 | ||
|
470b19be64 | ||
|
873de0dafc | ||
|
6b4370cd85 | ||
|
417a4d0c24 | ||
|
519edfe6f4 | ||
|
ac6364519a | ||
|
10bdd62119 | ||
|
1bc9938eca |
@@ -11,7 +11,6 @@
|
||||
#include "qemu/osdep.h"
|
||||
#include <liburing.h>
|
||||
#include "block/aio.h"
|
||||
#include "qemu/error-report.h"
|
||||
#include "qemu/queue.h"
|
||||
#include "block/block.h"
|
||||
#include "block/raw-aio.h"
|
||||
@@ -19,7 +18,6 @@
|
||||
#include "qapi/error.h"
|
||||
#include "trace.h"
|
||||
|
||||
|
||||
/* io_uring ring size */
|
||||
#define MAX_ENTRIES 128
|
||||
|
||||
@@ -432,17 +430,8 @@ LuringState *luring_init(Error **errp)
|
||||
}
|
||||
|
||||
ioq_init(&s->io_q);
|
||||
#ifdef CONFIG_LIBURING_REGISTER_RING_FD
|
||||
if (io_uring_register_ring_fd(&s->ring) < 0) {
|
||||
/*
|
||||
* Only warn about this error: we will fallback to the non-optimized
|
||||
* io_uring operations.
|
||||
*/
|
||||
warn_report("failed to register linux io_uring ring file descriptor");
|
||||
}
|
||||
#endif
|
||||
|
||||
return s;
|
||||
|
||||
}
|
||||
|
||||
void luring_cleanup(LuringState *s)
|
||||
|
@@ -21,6 +21,7 @@
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
* THE SOFTWARE.
|
||||
*/
|
||||
#define HW_POISON_H /* avoid poison since we patch against rules it "enforces" */
|
||||
#include "qemu/osdep.h"
|
||||
#include "qemu/error-report.h"
|
||||
#include "qapi/error.h"
|
||||
|
@@ -22,6 +22,7 @@
|
||||
* THE SOFTWARE.
|
||||
*/
|
||||
|
||||
#define HW_POISON_H /* avoid poison since we patch against rules it "enforces" */
|
||||
#include "qemu/osdep.h"
|
||||
#include "qapi/error.h"
|
||||
#include "qemu/module.h"
|
||||
@@ -198,6 +199,17 @@ static void mux_chr_accept_input(Chardev *chr)
|
||||
be->chr_read(be->opaque,
|
||||
&d->buffer[m][d->cons[m]++ & MUX_BUFFER_MASK], 1);
|
||||
}
|
||||
|
||||
#if defined(TARGET_S390X)
|
||||
/*
|
||||
* We're still not able to sync producer and consumer, so let's wait a bit
|
||||
* and try again by then.
|
||||
*/
|
||||
if (d->prod[m] != d->cons[m]) {
|
||||
qemu_mod_timer(d->accept_timer, qemu_get_clock_ns(vm_clock)
|
||||
+ (int64_t)100000);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
static int mux_chr_can_read(void *opaque)
|
||||
@@ -332,6 +344,10 @@ static void qemu_chr_open_mux(Chardev *chr,
|
||||
}
|
||||
|
||||
d->focus = -1;
|
||||
#if defined(TARGET_S390X)
|
||||
d->accept_timer = qemu_new_timer_ns(vm_clock,
|
||||
(QEMUTimerCB *)mux_chr_accept_input, chr);
|
||||
#endif
|
||||
/* only default to opened state if we've realized the initial
|
||||
* set of muxes
|
||||
*/
|
||||
|
@@ -22,6 +22,7 @@
|
||||
* THE SOFTWARE.
|
||||
*/
|
||||
|
||||
#define HW_POISON_H /* avoid poison since we patch against rules it "enforces" */
|
||||
#include "qemu/osdep.h"
|
||||
#include "qemu/cutils.h"
|
||||
#include "monitor/monitor.h"
|
||||
|
@@ -37,6 +37,9 @@ struct MuxChardev {
|
||||
Chardev parent;
|
||||
CharBackend *backends[MAX_MUX];
|
||||
CharBackend chr;
|
||||
#if defined(TARGET_S390X)
|
||||
QEMUTimer *accept_timer;
|
||||
#endif
|
||||
int focus;
|
||||
int mux_cnt;
|
||||
int term_got_escape;
|
||||
|
1
configure
vendored
1
configure
vendored
@@ -1258,6 +1258,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"
|
||||
|
||||
|
@@ -1,4 +1,4 @@
|
||||
executable('ivshmem-client', files('ivshmem-client.c', 'main.c'), genh,
|
||||
dependencies: glib,
|
||||
build_by_default: targetos == 'linux',
|
||||
install: false)
|
||||
install: true)
|
||||
|
@@ -1,4 +1,4 @@
|
||||
executable('ivshmem-server', files('ivshmem-server.c', 'main.c'), genh,
|
||||
dependencies: [qemuutil, rt],
|
||||
build_by_default: targetos == 'linux',
|
||||
install: false)
|
||||
install: true)
|
||||
|
@@ -270,6 +270,9 @@ static void xen_block_realize(XenDevice *xendev, Error **errp)
|
||||
|
||||
xen_block_set_size(blockdev);
|
||||
|
||||
if (!monitor_add_blk(conf->blk, blockdev->drive->id, errp)) {
|
||||
return;
|
||||
}
|
||||
blockdev->dataplane =
|
||||
xen_block_dataplane_create(xendev, blk, conf->logical_block_size,
|
||||
blockdev->props.iothread);
|
||||
@@ -722,6 +725,8 @@ static XenBlockDrive *xen_block_drive_create(const char *id,
|
||||
const char *mode = qdict_get_try_str(opts, "mode");
|
||||
const char *direct_io_safe = qdict_get_try_str(opts, "direct-io-safe");
|
||||
const char *discard_enable = qdict_get_try_str(opts, "discard-enable");
|
||||
const char *suse_diskcache_disable_flush = qdict_get_try_str(opts,
|
||||
"suse-diskcache-disable-flush");
|
||||
char *driver = NULL;
|
||||
char *filename = NULL;
|
||||
XenBlockDrive *drive = NULL;
|
||||
@@ -802,6 +807,16 @@ static XenBlockDrive *xen_block_drive_create(const char *id,
|
||||
}
|
||||
}
|
||||
|
||||
if (suse_diskcache_disable_flush) {
|
||||
unsigned long value;
|
||||
if (!qemu_strtoul(suse_diskcache_disable_flush, NULL, 2, &value) && !!value) {
|
||||
QDict *cache_qdict = qdict_new();
|
||||
|
||||
qdict_put_bool(cache_qdict, "no-flush", true);
|
||||
qdict_put_obj(file_layer, "cache", QOBJECT(cache_qdict));
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* It is necessary to turn file locking off as an emulated device
|
||||
* may have already opened the same image file.
|
||||
|
@@ -367,7 +367,7 @@ static void pc_q35_machine_options(MachineClass *m)
|
||||
machine_class_allow_dynamic_sysbus_dev(m, TYPE_INTEL_IOMMU_DEVICE);
|
||||
machine_class_allow_dynamic_sysbus_dev(m, TYPE_RAMFB_DEVICE);
|
||||
machine_class_allow_dynamic_sysbus_dev(m, TYPE_VMBUS_BRIDGE);
|
||||
m->max_cpus = 288;
|
||||
m->max_cpus = 1024;
|
||||
}
|
||||
|
||||
static void pc_q35_7_1_machine_options(MachineClass *m)
|
||||
@@ -388,6 +388,7 @@ static void pc_q35_7_0_machine_options(MachineClass *m)
|
||||
pc_q35_7_1_machine_options(m);
|
||||
m->alias = NULL;
|
||||
pcmc->enforce_amd_1tb_hole = false;
|
||||
m->max_cpus = 288;
|
||||
compat_props_add(m->compat_props, hw_compat_7_0, hw_compat_7_0_len);
|
||||
compat_props_add(m->compat_props, pc_compat_7_0, pc_compat_7_0_len);
|
||||
}
|
||||
|
@@ -70,7 +70,7 @@ static const VMStateDescription vmstate_pci_tulip = {
|
||||
static void tulip_desc_read(TULIPState *s, hwaddr p,
|
||||
struct tulip_descriptor *desc)
|
||||
{
|
||||
const MemTxAttrs attrs = MEMTXATTRS_UNSPECIFIED;
|
||||
const MemTxAttrs attrs = { .memory = true };
|
||||
|
||||
if (s->csr[0] & CSR0_DBO) {
|
||||
ldl_be_pci_dma(&s->dev, p, &desc->status, attrs);
|
||||
@@ -88,7 +88,7 @@ static void tulip_desc_read(TULIPState *s, hwaddr p,
|
||||
static void tulip_desc_write(TULIPState *s, hwaddr p,
|
||||
struct tulip_descriptor *desc)
|
||||
{
|
||||
const MemTxAttrs attrs = MEMTXATTRS_UNSPECIFIED;
|
||||
const MemTxAttrs attrs = { .memory = true };
|
||||
|
||||
if (s->csr[0] & CSR0_DBO) {
|
||||
stl_be_pci_dma(&s->dev, p, desc->status, attrs);
|
||||
|
@@ -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',
|
||||
|
@@ -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 {
|
||||
|
52
hw/s390x/s390-pci-kvm.c
Normal file
52
hw/s390x/s390-pci-kvm.c
Normal file
@@ -0,0 +1,52 @@
|
||||
/*
|
||||
* 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();
|
||||
}
|
||||
|
||||
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);
|
||||
}
|
@@ -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
|
||||
|
@@ -1927,7 +1927,7 @@ static void megasas_command_cancelled(SCSIRequest *req)
|
||||
{
|
||||
MegasasCmd *cmd = req->hba_private;
|
||||
|
||||
if (!cmd) {
|
||||
if (!cmd || !cmd->frame) {
|
||||
return;
|
||||
}
|
||||
cmd->frame->header.cmd_status = MFI_STAT_SCSI_IO_FAILED;
|
||||
|
@@ -322,11 +322,17 @@ static void scsi_read_complete(void * opaque, int ret)
|
||||
if (r->req.cmd.buf[0] == READ_CAPACITY_10 &&
|
||||
(ldl_be_p(&r->buf[0]) != 0xffffffffU || s->max_lba == 0)) {
|
||||
s->blocksize = ldl_be_p(&r->buf[4]);
|
||||
s->max_lba = ldl_be_p(&r->buf[0]) & 0xffffffffULL;
|
||||
BlockBackend *blk = s->conf.blk;
|
||||
BlockDriverState *bs = blk_bs(blk);
|
||||
s->max_lba = bs->total_sectors - 1;
|
||||
stl_be_p(&r->buf[0], s->max_lba);
|
||||
} else if (r->req.cmd.buf[0] == SERVICE_ACTION_IN_16 &&
|
||||
(r->req.cmd.buf[1] & 31) == SAI_READ_CAPACITY_16) {
|
||||
s->blocksize = ldl_be_p(&r->buf[8]);
|
||||
s->max_lba = ldq_be_p(&r->buf[0]);
|
||||
BlockBackend *blk = s->conf.blk;
|
||||
BlockDriverState *bs = blk_bs(blk);
|
||||
s->max_lba = bs->total_sectors - 1;
|
||||
stq_be_p(&r->buf[0], s->max_lba);
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -391,7 +397,10 @@ static void scsi_write_complete(void * opaque, int ret)
|
||||
|
||||
aio_context_acquire(blk_get_aio_context(s->conf.blk));
|
||||
|
||||
if (ret || r->req.io_canceled) {
|
||||
if (ret || r->req.io_canceled ||
|
||||
r->io_header.status != SCSI_HOST_OK ||
|
||||
(r->io_header.driver_status & SG_ERR_DRIVER_TIMEOUT) ||
|
||||
r->io_header.status != GOOD) {
|
||||
scsi_command_complete_noio(r, ret);
|
||||
goto done;
|
||||
}
|
||||
|
@@ -1180,6 +1180,7 @@ void smbios_entry_add(QemuOpts *opts, Error **errp)
|
||||
struct smbios_structure_header *header;
|
||||
int size;
|
||||
struct smbios_table *table; /* legacy mode only */
|
||||
uint8_t *dbl_nulls, *orig_end;
|
||||
|
||||
if (!qemu_opts_validate(opts, qemu_smbios_file_opts, errp)) {
|
||||
return;
|
||||
@@ -1192,11 +1193,21 @@ void smbios_entry_add(QemuOpts *opts, Error **errp)
|
||||
}
|
||||
|
||||
/*
|
||||
* NOTE: standard double '\0' terminator expected, per smbios spec.
|
||||
* (except in legacy mode, where the second '\0' is implicit and
|
||||
* will be inserted by the BIOS).
|
||||
* NOTE: standard double '\0' terminator expected, per smbios spec,
|
||||
* unless the data is formatted for legacy mode, which is used by
|
||||
* pc-i440fx-2.0 and earlier machine types. Legacy mode structures
|
||||
* without strings have no '\0' terminators, and those with strings
|
||||
* also don't have an additional '\0' terminator at the end of the
|
||||
* final string '\0' terminator. The BIOS will add the '\0' terminators
|
||||
* to comply with the smbios spec.
|
||||
* For greater compatibility, regardless of the machine type used,
|
||||
* either format is accepted.
|
||||
*/
|
||||
smbios_tables = g_realloc(smbios_tables, smbios_tables_len + size);
|
||||
smbios_tables = g_realloc(smbios_tables, smbios_tables_len + size + 2);
|
||||
orig_end = smbios_tables + smbios_tables_len + size;
|
||||
/* add extra null bytes to end in case of legacy file data */
|
||||
*orig_end = '\0';
|
||||
*(orig_end + 1) = '\0';
|
||||
header = (struct smbios_structure_header *)(smbios_tables +
|
||||
smbios_tables_len);
|
||||
|
||||
@@ -1211,6 +1222,19 @@ void smbios_entry_add(QemuOpts *opts, Error **errp)
|
||||
header->type);
|
||||
return;
|
||||
}
|
||||
for (dbl_nulls = smbios_tables + smbios_tables_len + header->length;
|
||||
dbl_nulls + 2 <= orig_end; dbl_nulls++) {
|
||||
if (*dbl_nulls == '\0' && *(dbl_nulls + 1) == '\0') {
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (dbl_nulls + 2 < orig_end) {
|
||||
error_setg(errp, "SMBIOS file data malformed");
|
||||
return;
|
||||
}
|
||||
/* increase size by how many extra nulls were actually needed */
|
||||
size += dbl_nulls + 2 - orig_end;
|
||||
smbios_tables = g_realloc(smbios_tables, smbios_tables_len + size);
|
||||
set_bit(header->type, have_binfile_bitmap);
|
||||
|
||||
if (header->type == 4) {
|
||||
@@ -1231,6 +1255,17 @@ void smbios_entry_add(QemuOpts *opts, Error **errp)
|
||||
* delete the one we don't need from smbios_set_defaults(),
|
||||
* once we know which machine version has been requested.
|
||||
*/
|
||||
if (dbl_nulls + 2 == orig_end) {
|
||||
/* chop off nulls to get legacy format */
|
||||
if (header->length + 2 == size) {
|
||||
size -= 2;
|
||||
} else {
|
||||
size -= 1;
|
||||
}
|
||||
} else {
|
||||
/* undo conversion from legacy format to per-spec format */
|
||||
size -= dbl_nulls + 2 - orig_end;
|
||||
}
|
||||
if (!smbios_entries) {
|
||||
smbios_entries_len = sizeof(uint16_t);
|
||||
smbios_entries = g_malloc0(smbios_entries_len);
|
||||
|
@@ -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);
|
||||
|
38
include/hw/s390x/s390-pci-kvm.h
Normal file
38
include/hw/s390x/s390-pci-kvm.h
Normal file
@@ -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
|
||||
|
||||
|
@@ -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
|
||||
|
@@ -38,7 +38,7 @@ struct virtio_9p_config {
|
||||
/* length of the tag name */
|
||||
__virtio16 tag_len;
|
||||
/* non-NULL terminated tag name */
|
||||
uint8_t tag[0];
|
||||
uint8_t tag[];
|
||||
} QEMU_PACKED;
|
||||
|
||||
#endif /* _LINUX_VIRTIO_9P_H */
|
||||
|
@@ -52,7 +52,7 @@
|
||||
* rest are per-device feature bits.
|
||||
*/
|
||||
#define VIRTIO_TRANSPORT_F_START 28
|
||||
#define VIRTIO_TRANSPORT_F_END 38
|
||||
#define VIRTIO_TRANSPORT_F_END 41
|
||||
|
||||
#ifndef VIRTIO_CONFIG_NO_LEGACY
|
||||
/* Do we get callbacks when the ring is completely used, even if we've
|
||||
@@ -96,4 +96,9 @@
|
||||
* Does the device support Single Root I/O Virtualization?
|
||||
*/
|
||||
#define VIRTIO_F_SR_IOV 37
|
||||
|
||||
/*
|
||||
* This feature indicates that the driver can reset a queue individually.
|
||||
*/
|
||||
#define VIRTIO_F_RING_RESET 40
|
||||
#endif /* _LINUX_VIRTIO_CONFIG_H */
|
||||
|
@@ -73,12 +73,12 @@
|
||||
* Virtio Transitional IDs
|
||||
*/
|
||||
|
||||
#define VIRTIO_TRANS_ID_NET 1000 /* transitional virtio net */
|
||||
#define VIRTIO_TRANS_ID_BLOCK 1001 /* transitional virtio block */
|
||||
#define VIRTIO_TRANS_ID_BALLOON 1002 /* transitional virtio balloon */
|
||||
#define VIRTIO_TRANS_ID_CONSOLE 1003 /* transitional virtio console */
|
||||
#define VIRTIO_TRANS_ID_SCSI 1004 /* transitional virtio SCSI */
|
||||
#define VIRTIO_TRANS_ID_RNG 1005 /* transitional virtio rng */
|
||||
#define VIRTIO_TRANS_ID_9P 1009 /* transitional virtio 9p console */
|
||||
#define VIRTIO_TRANS_ID_NET 0x1000 /* transitional virtio net */
|
||||
#define VIRTIO_TRANS_ID_BLOCK 0x1001 /* transitional virtio block */
|
||||
#define VIRTIO_TRANS_ID_BALLOON 0x1002 /* transitional virtio balloon */
|
||||
#define VIRTIO_TRANS_ID_CONSOLE 0x1003 /* transitional virtio console */
|
||||
#define VIRTIO_TRANS_ID_SCSI 0x1004 /* transitional virtio SCSI */
|
||||
#define VIRTIO_TRANS_ID_RNG 0x1005 /* transitional virtio rng */
|
||||
#define VIRTIO_TRANS_ID_9P 0x1009 /* transitional virtio 9p console */
|
||||
|
||||
#endif /* _LINUX_VIRTIO_IDS_H */
|
||||
|
@@ -56,7 +56,7 @@
|
||||
#define VIRTIO_NET_F_MQ 22 /* Device supports Receive Flow
|
||||
* Steering */
|
||||
#define VIRTIO_NET_F_CTRL_MAC_ADDR 23 /* Set MAC address */
|
||||
|
||||
#define VIRTIO_NET_F_NOTF_COAL 53 /* Device supports notifications coalescing */
|
||||
#define VIRTIO_NET_F_HASH_REPORT 57 /* Supports hash report */
|
||||
#define VIRTIO_NET_F_RSS 60 /* Supports RSS RX steering */
|
||||
#define VIRTIO_NET_F_RSC_EXT 61 /* extended coalescing info */
|
||||
@@ -355,4 +355,36 @@ struct virtio_net_hash_config {
|
||||
#define VIRTIO_NET_CTRL_GUEST_OFFLOADS 5
|
||||
#define VIRTIO_NET_CTRL_GUEST_OFFLOADS_SET 0
|
||||
|
||||
/*
|
||||
* Control notifications coalescing.
|
||||
*
|
||||
* Request the device to change the notifications coalescing parameters.
|
||||
*
|
||||
* Available with the VIRTIO_NET_F_NOTF_COAL feature bit.
|
||||
*/
|
||||
#define VIRTIO_NET_CTRL_NOTF_COAL 6
|
||||
/*
|
||||
* Set the tx-usecs/tx-max-packets parameters.
|
||||
*/
|
||||
struct virtio_net_ctrl_coal_tx {
|
||||
/* Maximum number of packets to send before a TX notification */
|
||||
uint32_t tx_max_packets;
|
||||
/* Maximum number of usecs to delay a TX notification */
|
||||
uint32_t tx_usecs;
|
||||
};
|
||||
|
||||
#define VIRTIO_NET_CTRL_NOTF_COAL_TX_SET 0
|
||||
|
||||
/*
|
||||
* Set the rx-usecs/rx-max-packets parameters.
|
||||
*/
|
||||
struct virtio_net_ctrl_coal_rx {
|
||||
/* Maximum number of packets to receive before a RX notification */
|
||||
uint32_t rx_max_packets;
|
||||
/* Maximum number of usecs to delay a RX notification */
|
||||
uint32_t rx_usecs;
|
||||
};
|
||||
|
||||
#define VIRTIO_NET_CTRL_NOTF_COAL_RX_SET 1
|
||||
|
||||
#endif /* _LINUX_VIRTIO_NET_H */
|
||||
|
@@ -202,6 +202,8 @@ struct virtio_pci_cfg_cap {
|
||||
#define VIRTIO_PCI_COMMON_Q_AVAILHI 44
|
||||
#define VIRTIO_PCI_COMMON_Q_USEDLO 48
|
||||
#define VIRTIO_PCI_COMMON_Q_USEDHI 52
|
||||
#define VIRTIO_PCI_COMMON_Q_NDATA 56
|
||||
#define VIRTIO_PCI_COMMON_Q_RESET 58
|
||||
|
||||
#endif /* VIRTIO_PCI_NO_MODERN */
|
||||
|
||||
|
@@ -91,15 +91,21 @@
|
||||
#define VRING_USED_ALIGN_SIZE 4
|
||||
#define VRING_DESC_ALIGN_SIZE 16
|
||||
|
||||
/* Virtio ring descriptors: 16 bytes. These can chain together via "next". */
|
||||
/**
|
||||
* struct vring_desc - Virtio ring descriptors,
|
||||
* 16 bytes long. These can chain together via @next.
|
||||
*
|
||||
* @addr: buffer address (guest-physical)
|
||||
* @len: buffer length
|
||||
* @flags: descriptor flags
|
||||
* @next: index of the next descriptor in the chain,
|
||||
* if the VRING_DESC_F_NEXT flag is set. We chain unused
|
||||
* descriptors via this, too.
|
||||
*/
|
||||
struct vring_desc {
|
||||
/* Address (guest-physical). */
|
||||
__virtio64 addr;
|
||||
/* Length. */
|
||||
__virtio32 len;
|
||||
/* The flags as indicated above. */
|
||||
__virtio16 flags;
|
||||
/* We chain unused descriptors via this, too */
|
||||
__virtio16 next;
|
||||
};
|
||||
|
||||
|
@@ -75,9 +75,11 @@ struct kvm_regs {
|
||||
|
||||
/* KVM_ARM_SET_DEVICE_ADDR ioctl id encoding */
|
||||
#define KVM_ARM_DEVICE_TYPE_SHIFT 0
|
||||
#define KVM_ARM_DEVICE_TYPE_MASK (0xffff << KVM_ARM_DEVICE_TYPE_SHIFT)
|
||||
#define KVM_ARM_DEVICE_TYPE_MASK GENMASK(KVM_ARM_DEVICE_TYPE_SHIFT + 15, \
|
||||
KVM_ARM_DEVICE_TYPE_SHIFT)
|
||||
#define KVM_ARM_DEVICE_ID_SHIFT 16
|
||||
#define KVM_ARM_DEVICE_ID_MASK (0xffff << KVM_ARM_DEVICE_ID_SHIFT)
|
||||
#define KVM_ARM_DEVICE_ID_MASK GENMASK(KVM_ARM_DEVICE_ID_SHIFT + 15, \
|
||||
KVM_ARM_DEVICE_ID_SHIFT)
|
||||
|
||||
/* Supported device IDs */
|
||||
#define KVM_ARM_DEVICE_VGIC_V2 0
|
||||
@@ -139,8 +141,10 @@ struct kvm_guest_debug_arch {
|
||||
__u64 dbg_wvr[KVM_ARM_MAX_DBG_REGS];
|
||||
};
|
||||
|
||||
#define KVM_DEBUG_ARCH_HSR_HIGH_VALID (1 << 0)
|
||||
struct kvm_debug_exit_arch {
|
||||
__u32 hsr;
|
||||
__u32 hsr_high; /* ESR_EL2[61:32] */
|
||||
__u64 far; /* used for watchpoints */
|
||||
};
|
||||
|
||||
@@ -332,6 +336,31 @@ struct kvm_arm_copy_mte_tags {
|
||||
#define KVM_ARM64_SVE_VLS_WORDS \
|
||||
((KVM_ARM64_SVE_VQ_MAX - KVM_ARM64_SVE_VQ_MIN) / 64 + 1)
|
||||
|
||||
/* Bitmap feature firmware registers */
|
||||
#define KVM_REG_ARM_FW_FEAT_BMAP (0x0016 << KVM_REG_ARM_COPROC_SHIFT)
|
||||
#define KVM_REG_ARM_FW_FEAT_BMAP_REG(r) (KVM_REG_ARM64 | KVM_REG_SIZE_U64 | \
|
||||
KVM_REG_ARM_FW_FEAT_BMAP | \
|
||||
((r) & 0xffff))
|
||||
|
||||
#define KVM_REG_ARM_STD_BMAP KVM_REG_ARM_FW_FEAT_BMAP_REG(0)
|
||||
|
||||
enum {
|
||||
KVM_REG_ARM_STD_BIT_TRNG_V1_0 = 0,
|
||||
};
|
||||
|
||||
#define KVM_REG_ARM_STD_HYP_BMAP KVM_REG_ARM_FW_FEAT_BMAP_REG(1)
|
||||
|
||||
enum {
|
||||
KVM_REG_ARM_STD_HYP_BIT_PV_TIME = 0,
|
||||
};
|
||||
|
||||
#define KVM_REG_ARM_VENDOR_HYP_BMAP KVM_REG_ARM_FW_FEAT_BMAP_REG(2)
|
||||
|
||||
enum {
|
||||
KVM_REG_ARM_VENDOR_HYP_BIT_FUNC_FEAT = 0,
|
||||
KVM_REG_ARM_VENDOR_HYP_BIT_PTP = 1,
|
||||
};
|
||||
|
||||
/* Device Control API: ARM VGIC */
|
||||
#define KVM_DEV_ARM_VGIC_GRP_ADDR 0
|
||||
#define KVM_DEV_ARM_VGIC_GRP_DIST_REGS 1
|
||||
|
@@ -383,7 +383,7 @@ __SYSCALL(__NR_syslog, sys_syslog)
|
||||
|
||||
/* kernel/ptrace.c */
|
||||
#define __NR_ptrace 117
|
||||
__SYSCALL(__NR_ptrace, sys_ptrace)
|
||||
__SC_COMP(__NR_ptrace, sys_ptrace, compat_sys_ptrace)
|
||||
|
||||
/* kernel/sched/core.c */
|
||||
#define __NR_sched_setparam 118
|
||||
@@ -779,7 +779,7 @@ __SYSCALL(__NR_rseq, sys_rseq)
|
||||
#define __NR_kexec_file_load 294
|
||||
__SYSCALL(__NR_kexec_file_load, sys_kexec_file_load)
|
||||
/* 295 through 402 are unassigned to sync up with generic numbers, don't use */
|
||||
#if __BITS_PER_LONG == 32
|
||||
#if defined(__SYSCALL_COMPAT) || __BITS_PER_LONG == 32
|
||||
#define __NR_clock_gettime64 403
|
||||
__SYSCALL(__NR_clock_gettime64, sys_clock_gettime)
|
||||
#define __NR_clock_settime64 404
|
||||
|
@@ -82,6 +82,25 @@ struct kvm_riscv_timer {
|
||||
__u64 state;
|
||||
};
|
||||
|
||||
/*
|
||||
* ISA extension IDs specific to KVM. This is not the same as the host ISA
|
||||
* extension IDs as that is internal to the host and should not be exposed
|
||||
* to the guest. This should always be contiguous to keep the mapping simple
|
||||
* in KVM implementation.
|
||||
*/
|
||||
enum KVM_RISCV_ISA_EXT_ID {
|
||||
KVM_RISCV_ISA_EXT_A = 0,
|
||||
KVM_RISCV_ISA_EXT_C,
|
||||
KVM_RISCV_ISA_EXT_D,
|
||||
KVM_RISCV_ISA_EXT_F,
|
||||
KVM_RISCV_ISA_EXT_H,
|
||||
KVM_RISCV_ISA_EXT_I,
|
||||
KVM_RISCV_ISA_EXT_M,
|
||||
KVM_RISCV_ISA_EXT_SVPBMT,
|
||||
KVM_RISCV_ISA_EXT_SSTC,
|
||||
KVM_RISCV_ISA_EXT_MAX,
|
||||
};
|
||||
|
||||
/* Possible states for kvm_riscv_timer */
|
||||
#define KVM_RISCV_TIMER_STATE_OFF 0
|
||||
#define KVM_RISCV_TIMER_STATE_ON 1
|
||||
@@ -123,6 +142,9 @@ struct kvm_riscv_timer {
|
||||
#define KVM_REG_RISCV_FP_D_REG(name) \
|
||||
(offsetof(struct __riscv_d_ext_state, name) / sizeof(__u64))
|
||||
|
||||
/* ISA Extension registers are mapped as type 7 */
|
||||
#define KVM_REG_RISCV_ISA_EXT (0x07 << KVM_REG_RISCV_TYPE_SHIFT)
|
||||
|
||||
#endif
|
||||
|
||||
#endif /* __LINUX_KVM_RISCV_H */
|
||||
|
@@ -15,12 +15,13 @@
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#ifdef __LP64__
|
||||
#if defined(__LP64__) && !defined(__SYSCALL_COMPAT)
|
||||
#define __ARCH_WANT_NEW_STAT
|
||||
#define __ARCH_WANT_SET_GET_RLIMIT
|
||||
#endif /* __LP64__ */
|
||||
|
||||
#define __ARCH_WANT_SYS_CLONE3
|
||||
#define __ARCH_WANT_MEMFD_SECRET
|
||||
|
||||
#include <asm-generic/unistd.h>
|
||||
|
||||
|
@@ -74,6 +74,7 @@ struct kvm_s390_io_adapter_req {
|
||||
#define KVM_S390_VM_CRYPTO 2
|
||||
#define KVM_S390_VM_CPU_MODEL 3
|
||||
#define KVM_S390_VM_MIGRATION 4
|
||||
#define KVM_S390_VM_CPU_TOPOLOGY 5
|
||||
|
||||
/* kvm attributes for mem_ctrl */
|
||||
#define KVM_S390_VM_MEM_ENABLE_CMMA 0
|
||||
|
@@ -198,13 +198,13 @@ struct kvm_msrs {
|
||||
__u32 nmsrs; /* number of msrs in entries */
|
||||
__u32 pad;
|
||||
|
||||
struct kvm_msr_entry entries[0];
|
||||
struct kvm_msr_entry entries[];
|
||||
};
|
||||
|
||||
/* for KVM_GET_MSR_INDEX_LIST */
|
||||
struct kvm_msr_list {
|
||||
__u32 nmsrs; /* number of msrs in entries */
|
||||
__u32 indices[0];
|
||||
__u32 indices[];
|
||||
};
|
||||
|
||||
/* Maximum size of any access bitmap in bytes */
|
||||
@@ -241,7 +241,7 @@ struct kvm_cpuid_entry {
|
||||
struct kvm_cpuid {
|
||||
__u32 nent;
|
||||
__u32 padding;
|
||||
struct kvm_cpuid_entry entries[0];
|
||||
struct kvm_cpuid_entry entries[];
|
||||
};
|
||||
|
||||
struct kvm_cpuid_entry2 {
|
||||
@@ -263,7 +263,7 @@ struct kvm_cpuid_entry2 {
|
||||
struct kvm_cpuid2 {
|
||||
__u32 nent;
|
||||
__u32 padding;
|
||||
struct kvm_cpuid_entry2 entries[0];
|
||||
struct kvm_cpuid_entry2 entries[];
|
||||
};
|
||||
|
||||
/* for KVM_GET_PIT and KVM_SET_PIT */
|
||||
@@ -306,7 +306,8 @@ struct kvm_pit_state {
|
||||
struct kvm_pit_channel_state channels[3];
|
||||
};
|
||||
|
||||
#define KVM_PIT_FLAGS_HPET_LEGACY 0x00000001
|
||||
#define KVM_PIT_FLAGS_HPET_LEGACY 0x00000001
|
||||
#define KVM_PIT_FLAGS_SPEAKER_DATA_ON 0x00000002
|
||||
|
||||
struct kvm_pit_state2 {
|
||||
struct kvm_pit_channel_state channels[3];
|
||||
@@ -325,6 +326,7 @@ struct kvm_reinject_control {
|
||||
#define KVM_VCPUEVENT_VALID_SHADOW 0x00000004
|
||||
#define KVM_VCPUEVENT_VALID_SMM 0x00000008
|
||||
#define KVM_VCPUEVENT_VALID_PAYLOAD 0x00000010
|
||||
#define KVM_VCPUEVENT_VALID_TRIPLE_FAULT 0x00000020
|
||||
|
||||
/* Interrupt shadow states */
|
||||
#define KVM_X86_SHADOW_INT_MOV_SS 0x01
|
||||
@@ -359,7 +361,10 @@ struct kvm_vcpu_events {
|
||||
__u8 smm_inside_nmi;
|
||||
__u8 latched_init;
|
||||
} smi;
|
||||
__u8 reserved[27];
|
||||
struct {
|
||||
__u8 pending;
|
||||
} triple_fault;
|
||||
__u8 reserved[26];
|
||||
__u8 exception_has_payload;
|
||||
__u64 exception_payload;
|
||||
};
|
||||
@@ -389,7 +394,7 @@ struct kvm_xsave {
|
||||
* the contents of CPUID leaf 0xD on the host.
|
||||
*/
|
||||
__u32 region[1024];
|
||||
__u32 extra[0];
|
||||
__u32 extra[];
|
||||
};
|
||||
|
||||
#define KVM_MAX_XCRS 16
|
||||
@@ -428,11 +433,13 @@ struct kvm_sync_regs {
|
||||
struct kvm_vcpu_events events;
|
||||
};
|
||||
|
||||
#define KVM_X86_QUIRK_LINT0_REENABLED (1 << 0)
|
||||
#define KVM_X86_QUIRK_CD_NW_CLEARED (1 << 1)
|
||||
#define KVM_X86_QUIRK_LAPIC_MMIO_HOLE (1 << 2)
|
||||
#define KVM_X86_QUIRK_OUT_7E_INC_RIP (1 << 3)
|
||||
#define KVM_X86_QUIRK_MISC_ENABLE_NO_MWAIT (1 << 4)
|
||||
#define KVM_X86_QUIRK_LINT0_REENABLED (1 << 0)
|
||||
#define KVM_X86_QUIRK_CD_NW_CLEARED (1 << 1)
|
||||
#define KVM_X86_QUIRK_LAPIC_MMIO_HOLE (1 << 2)
|
||||
#define KVM_X86_QUIRK_OUT_7E_INC_RIP (1 << 3)
|
||||
#define KVM_X86_QUIRK_MISC_ENABLE_NO_MWAIT (1 << 4)
|
||||
#define KVM_X86_QUIRK_FIX_HYPERCALL_INSN (1 << 5)
|
||||
#define KVM_X86_QUIRK_MWAIT_NEVER_UD_FAULTS (1 << 6)
|
||||
|
||||
#define KVM_STATE_NESTED_FORMAT_VMX 0
|
||||
#define KVM_STATE_NESTED_FORMAT_SVM 1
|
||||
@@ -515,7 +522,7 @@ struct kvm_pmu_event_filter {
|
||||
__u32 fixed_counter_bitmap;
|
||||
__u32 flags;
|
||||
__u32 pad[4];
|
||||
__u64 events[0];
|
||||
__u64 events[];
|
||||
};
|
||||
|
||||
#define KVM_PMU_EVENT_ALLOW 0
|
||||
|
@@ -5,20 +5,6 @@
|
||||
#define MAP_32BIT 0x40 /* only give out 32bit addresses */
|
||||
|
||||
#ifdef CONFIG_X86_INTEL_MEMORY_PROTECTION_KEYS
|
||||
/*
|
||||
* Take the 4 protection key bits out of the vma->vm_flags
|
||||
* value and turn them in to the bits that we can put in
|
||||
* to a pte.
|
||||
*
|
||||
* Only override these if Protection Keys are available
|
||||
* (which is only on 64-bit).
|
||||
*/
|
||||
#define arch_vm_get_page_prot(vm_flags) __pgprot( \
|
||||
((vm_flags) & VM_PKEY_BIT0 ? _PAGE_PKEY_BIT0 : 0) | \
|
||||
((vm_flags) & VM_PKEY_BIT1 ? _PAGE_PKEY_BIT1 : 0) | \
|
||||
((vm_flags) & VM_PKEY_BIT2 ? _PAGE_PKEY_BIT2 : 0) | \
|
||||
((vm_flags) & VM_PKEY_BIT3 ? _PAGE_PKEY_BIT3 : 0))
|
||||
|
||||
#define arch_calc_vm_prot_bits(prot, key) ( \
|
||||
((key) & 0x1 ? VM_PKEY_BIT0 : 0) | \
|
||||
((key) & 0x2 ? VM_PKEY_BIT1 : 0) | \
|
||||
|
@@ -270,6 +270,8 @@ struct kvm_xen_exit {
|
||||
#define KVM_EXIT_X86_BUS_LOCK 33
|
||||
#define KVM_EXIT_XEN 34
|
||||
#define KVM_EXIT_RISCV_SBI 35
|
||||
#define KVM_EXIT_RISCV_CSR 36
|
||||
#define KVM_EXIT_NOTIFY 37
|
||||
|
||||
/* For KVM_EXIT_INTERNAL_ERROR */
|
||||
/* Emulate instruction failed. */
|
||||
@@ -444,6 +446,9 @@ struct kvm_run {
|
||||
#define KVM_SYSTEM_EVENT_SHUTDOWN 1
|
||||
#define KVM_SYSTEM_EVENT_RESET 2
|
||||
#define KVM_SYSTEM_EVENT_CRASH 3
|
||||
#define KVM_SYSTEM_EVENT_WAKEUP 4
|
||||
#define KVM_SYSTEM_EVENT_SUSPEND 5
|
||||
#define KVM_SYSTEM_EVENT_SEV_TERM 6
|
||||
__u32 type;
|
||||
__u32 ndata;
|
||||
union {
|
||||
@@ -491,6 +496,18 @@ struct kvm_run {
|
||||
unsigned long args[6];
|
||||
unsigned long ret[2];
|
||||
} riscv_sbi;
|
||||
/* KVM_EXIT_RISCV_CSR */
|
||||
struct {
|
||||
unsigned long csr_num;
|
||||
unsigned long new_value;
|
||||
unsigned long write_mask;
|
||||
unsigned long ret_value;
|
||||
} riscv_csr;
|
||||
/* KVM_EXIT_NOTIFY */
|
||||
struct {
|
||||
#define KVM_NOTIFY_CONTEXT_INVALID (1 << 0)
|
||||
__u32 flags;
|
||||
} notify;
|
||||
/* Fix the size of the union. */
|
||||
char padding[256];
|
||||
};
|
||||
@@ -537,7 +554,7 @@ struct kvm_coalesced_mmio {
|
||||
|
||||
struct kvm_coalesced_mmio_ring {
|
||||
__u32 first, last;
|
||||
struct kvm_coalesced_mmio coalesced_mmio[0];
|
||||
struct kvm_coalesced_mmio coalesced_mmio[];
|
||||
};
|
||||
|
||||
#define KVM_COALESCED_MMIO_MAX \
|
||||
@@ -616,7 +633,7 @@ struct kvm_clear_dirty_log {
|
||||
/* for KVM_SET_SIGNAL_MASK */
|
||||
struct kvm_signal_mask {
|
||||
__u32 len;
|
||||
__u8 sigset[0];
|
||||
__u8 sigset[];
|
||||
};
|
||||
|
||||
/* for KVM_TPR_ACCESS_REPORTING */
|
||||
@@ -644,6 +661,7 @@ struct kvm_vapic_addr {
|
||||
#define KVM_MP_STATE_OPERATING 7
|
||||
#define KVM_MP_STATE_LOAD 8
|
||||
#define KVM_MP_STATE_AP_RESET_HOLD 9
|
||||
#define KVM_MP_STATE_SUSPENDED 10
|
||||
|
||||
struct kvm_mp_state {
|
||||
__u32 mp_state;
|
||||
@@ -1148,8 +1166,15 @@ struct kvm_ppc_resize_hpt {
|
||||
#define KVM_CAP_S390_MEM_OP_EXTENSION 211
|
||||
#define KVM_CAP_PMU_CAPABILITY 212
|
||||
#define KVM_CAP_DISABLE_QUIRKS2 213
|
||||
/* #define KVM_CAP_VM_TSC_CONTROL 214 */
|
||||
#define KVM_CAP_VM_TSC_CONTROL 214
|
||||
#define KVM_CAP_SYSTEM_EVENT_DATA 215
|
||||
#define KVM_CAP_ARM_SYSTEM_SUSPEND 216
|
||||
#define KVM_CAP_S390_PROTECTED_DUMP 217
|
||||
#define KVM_CAP_X86_TRIPLE_FAULT_EVENT 218
|
||||
#define KVM_CAP_X86_NOTIFY_VMEXIT 219
|
||||
#define KVM_CAP_VM_DISABLE_NX_HUGE_PAGES 220
|
||||
#define KVM_CAP_S390_ZPCI_OP 221
|
||||
#define KVM_CAP_S390_CPU_TOPOLOGY 222
|
||||
|
||||
#ifdef KVM_CAP_IRQ_ROUTING
|
||||
|
||||
@@ -1214,7 +1239,7 @@ struct kvm_irq_routing_entry {
|
||||
struct kvm_irq_routing {
|
||||
__u32 nr;
|
||||
__u32 flags;
|
||||
struct kvm_irq_routing_entry entries[0];
|
||||
struct kvm_irq_routing_entry entries[];
|
||||
};
|
||||
|
||||
#endif
|
||||
@@ -1238,6 +1263,7 @@ struct kvm_x86_mce {
|
||||
#define KVM_XEN_HVM_CONFIG_SHARED_INFO (1 << 2)
|
||||
#define KVM_XEN_HVM_CONFIG_RUNSTATE (1 << 3)
|
||||
#define KVM_XEN_HVM_CONFIG_EVTCHN_2LEVEL (1 << 4)
|
||||
#define KVM_XEN_HVM_CONFIG_EVTCHN_SEND (1 << 5)
|
||||
|
||||
struct kvm_xen_hvm_config {
|
||||
__u32 flags;
|
||||
@@ -1333,7 +1359,7 @@ struct kvm_dirty_tlb {
|
||||
|
||||
struct kvm_reg_list {
|
||||
__u64 n; /* number of regs */
|
||||
__u64 reg[0];
|
||||
__u64 reg[];
|
||||
};
|
||||
|
||||
struct kvm_one_reg {
|
||||
@@ -1476,7 +1502,8 @@ struct kvm_s390_ucas_mapping {
|
||||
#define KVM_SET_PIT2 _IOW(KVMIO, 0xa0, struct kvm_pit_state2)
|
||||
/* Available with KVM_CAP_PPC_GET_PVINFO */
|
||||
#define KVM_PPC_GET_PVINFO _IOW(KVMIO, 0xa1, struct kvm_ppc_pvinfo)
|
||||
/* Available with KVM_CAP_TSC_CONTROL */
|
||||
/* Available with KVM_CAP_TSC_CONTROL for a vCPU, or with
|
||||
* KVM_CAP_VM_TSC_CONTROL to set defaults for a VM */
|
||||
#define KVM_SET_TSC_KHZ _IO(KVMIO, 0xa2)
|
||||
#define KVM_GET_TSC_KHZ _IO(KVMIO, 0xa3)
|
||||
/* Available with KVM_CAP_PCI_2_3 */
|
||||
@@ -1651,6 +1678,55 @@ struct kvm_s390_pv_unp {
|
||||
__u64 tweak;
|
||||
};
|
||||
|
||||
enum pv_cmd_dmp_id {
|
||||
KVM_PV_DUMP_INIT,
|
||||
KVM_PV_DUMP_CONFIG_STOR_STATE,
|
||||
KVM_PV_DUMP_COMPLETE,
|
||||
KVM_PV_DUMP_CPU,
|
||||
};
|
||||
|
||||
struct kvm_s390_pv_dmp {
|
||||
__u64 subcmd;
|
||||
__u64 buff_addr;
|
||||
__u64 buff_len;
|
||||
__u64 gaddr; /* For dump storage state */
|
||||
__u64 reserved[4];
|
||||
};
|
||||
|
||||
enum pv_cmd_info_id {
|
||||
KVM_PV_INFO_VM,
|
||||
KVM_PV_INFO_DUMP,
|
||||
};
|
||||
|
||||
struct kvm_s390_pv_info_dump {
|
||||
__u64 dump_cpu_buffer_len;
|
||||
__u64 dump_config_mem_buffer_per_1m;
|
||||
__u64 dump_config_finalize_len;
|
||||
};
|
||||
|
||||
struct kvm_s390_pv_info_vm {
|
||||
__u64 inst_calls_list[4];
|
||||
__u64 max_cpus;
|
||||
__u64 max_guests;
|
||||
__u64 max_guest_addr;
|
||||
__u64 feature_indication;
|
||||
};
|
||||
|
||||
struct kvm_s390_pv_info_header {
|
||||
__u32 id;
|
||||
__u32 len_max;
|
||||
__u32 len_written;
|
||||
__u32 reserved;
|
||||
};
|
||||
|
||||
struct kvm_s390_pv_info {
|
||||
struct kvm_s390_pv_info_header header;
|
||||
union {
|
||||
struct kvm_s390_pv_info_dump dump;
|
||||
struct kvm_s390_pv_info_vm vm;
|
||||
};
|
||||
};
|
||||
|
||||
enum pv_cmd_id {
|
||||
KVM_PV_ENABLE,
|
||||
KVM_PV_DISABLE,
|
||||
@@ -1659,6 +1735,8 @@ enum pv_cmd_id {
|
||||
KVM_PV_VERIFY,
|
||||
KVM_PV_PREP_RESET,
|
||||
KVM_PV_UNSHARE_ALL,
|
||||
KVM_PV_INFO,
|
||||
KVM_PV_DUMP,
|
||||
};
|
||||
|
||||
struct kvm_pv_cmd {
|
||||
@@ -1692,6 +1770,32 @@ struct kvm_xen_hvm_attr {
|
||||
struct {
|
||||
__u64 gfn;
|
||||
} shared_info;
|
||||
struct {
|
||||
__u32 send_port;
|
||||
__u32 type; /* EVTCHNSTAT_ipi / EVTCHNSTAT_interdomain */
|
||||
__u32 flags;
|
||||
#define KVM_XEN_EVTCHN_DEASSIGN (1 << 0)
|
||||
#define KVM_XEN_EVTCHN_UPDATE (1 << 1)
|
||||
#define KVM_XEN_EVTCHN_RESET (1 << 2)
|
||||
/*
|
||||
* Events sent by the guest are either looped back to
|
||||
* the guest itself (potentially on a different port#)
|
||||
* or signalled via an eventfd.
|
||||
*/
|
||||
union {
|
||||
struct {
|
||||
__u32 port;
|
||||
__u32 vcpu;
|
||||
__u32 priority;
|
||||
} port;
|
||||
struct {
|
||||
__u32 port; /* Zero for eventfd */
|
||||
__s32 fd;
|
||||
} eventfd;
|
||||
__u32 padding[4];
|
||||
} deliver;
|
||||
} evtchn;
|
||||
__u32 xen_version;
|
||||
__u64 pad[8];
|
||||
} u;
|
||||
};
|
||||
@@ -1700,11 +1804,17 @@ struct kvm_xen_hvm_attr {
|
||||
#define KVM_XEN_ATTR_TYPE_LONG_MODE 0x0
|
||||
#define KVM_XEN_ATTR_TYPE_SHARED_INFO 0x1
|
||||
#define KVM_XEN_ATTR_TYPE_UPCALL_VECTOR 0x2
|
||||
/* Available with KVM_CAP_XEN_HVM / KVM_XEN_HVM_CONFIG_EVTCHN_SEND */
|
||||
#define KVM_XEN_ATTR_TYPE_EVTCHN 0x3
|
||||
#define KVM_XEN_ATTR_TYPE_XEN_VERSION 0x4
|
||||
|
||||
/* Per-vCPU Xen attributes */
|
||||
#define KVM_XEN_VCPU_GET_ATTR _IOWR(KVMIO, 0xca, struct kvm_xen_vcpu_attr)
|
||||
#define KVM_XEN_VCPU_SET_ATTR _IOW(KVMIO, 0xcb, struct kvm_xen_vcpu_attr)
|
||||
|
||||
/* Available with KVM_CAP_XEN_HVM / KVM_XEN_HVM_CONFIG_EVTCHN_SEND */
|
||||
#define KVM_XEN_HVM_EVTCHN_SEND _IOW(KVMIO, 0xd0, struct kvm_irq_routing_xen_evtchn)
|
||||
|
||||
#define KVM_GET_SREGS2 _IOR(KVMIO, 0xcc, struct kvm_sregs2)
|
||||
#define KVM_SET_SREGS2 _IOW(KVMIO, 0xcd, struct kvm_sregs2)
|
||||
|
||||
@@ -1722,6 +1832,13 @@ struct kvm_xen_vcpu_attr {
|
||||
__u64 time_blocked;
|
||||
__u64 time_offline;
|
||||
} runstate;
|
||||
__u32 vcpu_id;
|
||||
struct {
|
||||
__u32 port;
|
||||
__u32 priority;
|
||||
__u64 expires_ns;
|
||||
} timer;
|
||||
__u8 vector;
|
||||
} u;
|
||||
};
|
||||
|
||||
@@ -1732,6 +1849,10 @@ struct kvm_xen_vcpu_attr {
|
||||
#define KVM_XEN_VCPU_ATTR_TYPE_RUNSTATE_CURRENT 0x3
|
||||
#define KVM_XEN_VCPU_ATTR_TYPE_RUNSTATE_DATA 0x4
|
||||
#define KVM_XEN_VCPU_ATTR_TYPE_RUNSTATE_ADJUST 0x5
|
||||
/* Available with KVM_CAP_XEN_HVM / KVM_XEN_HVM_CONFIG_EVTCHN_SEND */
|
||||
#define KVM_XEN_VCPU_ATTR_TYPE_VCPU_ID 0x6
|
||||
#define KVM_XEN_VCPU_ATTR_TYPE_TIMER 0x7
|
||||
#define KVM_XEN_VCPU_ATTR_TYPE_UPCALL_VECTOR 0x8
|
||||
|
||||
/* Secure Encrypted Virtualization command */
|
||||
enum sev_cmd_id {
|
||||
@@ -2032,7 +2153,7 @@ struct kvm_stats_header {
|
||||
#define KVM_STATS_UNIT_SECONDS (0x2 << KVM_STATS_UNIT_SHIFT)
|
||||
#define KVM_STATS_UNIT_CYCLES (0x3 << KVM_STATS_UNIT_SHIFT)
|
||||
#define KVM_STATS_UNIT_BOOLEAN (0x4 << KVM_STATS_UNIT_SHIFT)
|
||||
#define KVM_STATS_UNIT_MAX KVM_STATS_UNIT_CYCLES
|
||||
#define KVM_STATS_UNIT_MAX KVM_STATS_UNIT_BOOLEAN
|
||||
|
||||
#define KVM_STATS_BASE_SHIFT 8
|
||||
#define KVM_STATS_BASE_MASK (0xF << KVM_STATS_BASE_SHIFT)
|
||||
@@ -2067,4 +2188,41 @@ struct kvm_stats_desc {
|
||||
/* Available with KVM_CAP_XSAVE2 */
|
||||
#define KVM_GET_XSAVE2 _IOR(KVMIO, 0xcf, struct kvm_xsave)
|
||||
|
||||
/* Available with KVM_CAP_S390_PROTECTED_DUMP */
|
||||
#define KVM_S390_PV_CPU_COMMAND _IOWR(KVMIO, 0xd0, struct kvm_pv_cmd)
|
||||
|
||||
/* Available with KVM_CAP_X86_NOTIFY_VMEXIT */
|
||||
#define KVM_X86_NOTIFY_VMEXIT_ENABLED (1ULL << 0)
|
||||
#define KVM_X86_NOTIFY_VMEXIT_USER (1ULL << 1)
|
||||
|
||||
/* Available with KVM_CAP_S390_ZPCI_OP */
|
||||
#define KVM_S390_ZPCI_OP _IOW(KVMIO, 0xd1, struct kvm_s390_zpci_op)
|
||||
|
||||
struct kvm_s390_zpci_op {
|
||||
/* in */
|
||||
__u32 fh; /* target device */
|
||||
__u8 op; /* operation to perform */
|
||||
__u8 pad[3];
|
||||
union {
|
||||
/* for KVM_S390_ZPCIOP_REG_AEN */
|
||||
struct {
|
||||
__u64 ibv; /* Guest addr of interrupt bit vector */
|
||||
__u64 sb; /* Guest addr of summary bit */
|
||||
__u32 flags;
|
||||
__u32 noi; /* Number of interrupts */
|
||||
__u8 isc; /* Guest interrupt subclass */
|
||||
__u8 sbo; /* Offset of guest summary bit vector */
|
||||
__u16 pad;
|
||||
} reg_aen;
|
||||
__u64 reserved[8];
|
||||
} u;
|
||||
};
|
||||
|
||||
/* types for kvm_s390_zpci_op->op */
|
||||
#define KVM_S390_ZPCIOP_REG_AEN 0
|
||||
#define KVM_S390_ZPCIOP_DEREG_AEN 1
|
||||
|
||||
/* flags for kvm_s390_zpci_op->u.reg_aen.flags */
|
||||
#define KVM_S390_ZPCIOP_REGAEN_HOST (1 << 0)
|
||||
|
||||
#endif /* __LINUX_KVM_H */
|
||||
|
@@ -33,7 +33,8 @@
|
||||
UFFD_FEATURE_THREAD_ID | \
|
||||
UFFD_FEATURE_MINOR_HUGETLBFS | \
|
||||
UFFD_FEATURE_MINOR_SHMEM | \
|
||||
UFFD_FEATURE_EXACT_ADDRESS)
|
||||
UFFD_FEATURE_EXACT_ADDRESS | \
|
||||
UFFD_FEATURE_WP_HUGETLBFS_SHMEM)
|
||||
#define UFFD_API_IOCTLS \
|
||||
((__u64)1 << _UFFDIO_REGISTER | \
|
||||
(__u64)1 << _UFFDIO_UNREGISTER | \
|
||||
@@ -47,7 +48,8 @@
|
||||
#define UFFD_API_RANGE_IOCTLS_BASIC \
|
||||
((__u64)1 << _UFFDIO_WAKE | \
|
||||
(__u64)1 << _UFFDIO_COPY | \
|
||||
(__u64)1 << _UFFDIO_CONTINUE)
|
||||
(__u64)1 << _UFFDIO_CONTINUE | \
|
||||
(__u64)1 << _UFFDIO_WRITEPROTECT)
|
||||
|
||||
/*
|
||||
* Valid ioctl command number range with this API is from 0x00 to
|
||||
@@ -194,6 +196,9 @@ struct uffdio_api {
|
||||
* UFFD_FEATURE_EXACT_ADDRESS indicates that the exact address of page
|
||||
* faults would be provided and the offset within the page would not be
|
||||
* masked.
|
||||
*
|
||||
* UFFD_FEATURE_WP_HUGETLBFS_SHMEM indicates that userfaultfd
|
||||
* write-protection mode is supported on both shmem and hugetlbfs.
|
||||
*/
|
||||
#define UFFD_FEATURE_PAGEFAULT_FLAG_WP (1<<0)
|
||||
#define UFFD_FEATURE_EVENT_FORK (1<<1)
|
||||
@@ -207,6 +212,7 @@ struct uffdio_api {
|
||||
#define UFFD_FEATURE_MINOR_HUGETLBFS (1<<9)
|
||||
#define UFFD_FEATURE_MINOR_SHMEM (1<<10)
|
||||
#define UFFD_FEATURE_EXACT_ADDRESS (1<<11)
|
||||
#define UFFD_FEATURE_WP_HUGETLBFS_SHMEM (1<<12)
|
||||
__u64 features;
|
||||
|
||||
__u64 ioctls;
|
||||
|
@@ -210,6 +210,53 @@ struct vduse_vq_eventfd {
|
||||
*/
|
||||
#define VDUSE_VQ_INJECT_IRQ _IOW(VDUSE_BASE, 0x17, __u32)
|
||||
|
||||
/**
|
||||
* struct vduse_iova_umem - userspace memory configuration for one IOVA region
|
||||
* @uaddr: start address of userspace memory, it must be aligned to page size
|
||||
* @iova: start of the IOVA region
|
||||
* @size: size of the IOVA region
|
||||
* @reserved: for future use, needs to be initialized to zero
|
||||
*
|
||||
* Structure used by VDUSE_IOTLB_REG_UMEM and VDUSE_IOTLB_DEREG_UMEM
|
||||
* ioctls to register/de-register userspace memory for IOVA regions
|
||||
*/
|
||||
struct vduse_iova_umem {
|
||||
__u64 uaddr;
|
||||
__u64 iova;
|
||||
__u64 size;
|
||||
__u64 reserved[3];
|
||||
};
|
||||
|
||||
/* Register userspace memory for IOVA regions */
|
||||
#define VDUSE_IOTLB_REG_UMEM _IOW(VDUSE_BASE, 0x18, struct vduse_iova_umem)
|
||||
|
||||
/* De-register the userspace memory. Caller should set iova and size field. */
|
||||
#define VDUSE_IOTLB_DEREG_UMEM _IOW(VDUSE_BASE, 0x19, struct vduse_iova_umem)
|
||||
|
||||
/**
|
||||
* struct vduse_iova_info - information of one IOVA region
|
||||
* @start: start of the IOVA region
|
||||
* @last: last of the IOVA region
|
||||
* @capability: capability of the IOVA regsion
|
||||
* @reserved: for future use, needs to be initialized to zero
|
||||
*
|
||||
* Structure used by VDUSE_IOTLB_GET_INFO ioctl to get information of
|
||||
* one IOVA region.
|
||||
*/
|
||||
struct vduse_iova_info {
|
||||
__u64 start;
|
||||
__u64 last;
|
||||
#define VDUSE_IOVA_CAP_UMEM (1 << 0)
|
||||
__u64 capability;
|
||||
__u64 reserved[3];
|
||||
};
|
||||
|
||||
/*
|
||||
* Find the first IOVA region that overlaps with the range [start, last]
|
||||
* and return some information on it. Caller should set start and last fields.
|
||||
*/
|
||||
#define VDUSE_IOTLB_GET_INFO _IOWR(VDUSE_BASE, 0x1a, struct vduse_iova_info)
|
||||
|
||||
/* The control messages definition for read(2)/write(2) on /dev/vduse/$NAME */
|
||||
|
||||
/**
|
||||
|
@@ -643,7 +643,7 @@ enum {
|
||||
};
|
||||
|
||||
/**
|
||||
* VFIO_DEVICE_GET_PCI_HOT_RESET_INFO - _IORW(VFIO_TYPE, VFIO_BASE + 12,
|
||||
* VFIO_DEVICE_GET_PCI_HOT_RESET_INFO - _IOWR(VFIO_TYPE, VFIO_BASE + 12,
|
||||
* struct vfio_pci_hot_reset_info)
|
||||
*
|
||||
* Return: 0 on success, -errno on failure:
|
||||
@@ -770,7 +770,7 @@ struct vfio_device_ioeventfd {
|
||||
#define VFIO_DEVICE_IOEVENTFD _IO(VFIO_TYPE, VFIO_BASE + 16)
|
||||
|
||||
/**
|
||||
* VFIO_DEVICE_FEATURE - _IORW(VFIO_TYPE, VFIO_BASE + 17,
|
||||
* VFIO_DEVICE_FEATURE - _IOWR(VFIO_TYPE, VFIO_BASE + 17,
|
||||
* struct vfio_device_feature)
|
||||
*
|
||||
* Get, set, or probe feature data of the device. The feature is selected
|
||||
|
@@ -29,6 +29,9 @@ struct vfio_device_info_cap_zpci_base {
|
||||
__u16 fmb_length; /* Measurement Block Length (in bytes) */
|
||||
__u8 pft; /* PCI Function Type */
|
||||
__u8 gid; /* PCI function group ID */
|
||||
/* End of version 1 */
|
||||
__u32 fh; /* PCI function handle */
|
||||
/* End of version 2 */
|
||||
};
|
||||
|
||||
/**
|
||||
@@ -47,6 +50,10 @@ struct vfio_device_info_cap_zpci_group {
|
||||
__u16 noi; /* Maximum number of MSIs */
|
||||
__u16 maxstbl; /* Maximum Store Block Length */
|
||||
__u8 version; /* Supported PCI Version */
|
||||
/* End of version 1 */
|
||||
__u8 reserved;
|
||||
__u16 imaxstbl; /* Maximum Interpreted Store Block Length */
|
||||
/* End of version 2 */
|
||||
};
|
||||
|
||||
/**
|
||||
|
@@ -89,11 +89,6 @@
|
||||
|
||||
/* Set or get vhost backend capability */
|
||||
|
||||
/* Use message type V2 */
|
||||
#define VHOST_BACKEND_F_IOTLB_MSG_V2 0x1
|
||||
/* IOTLB can accept batching hints */
|
||||
#define VHOST_BACKEND_F_IOTLB_BATCH 0x2
|
||||
|
||||
#define VHOST_SET_BACKEND_FEATURES _IOW(VHOST_VIRTIO, 0x25, __u64)
|
||||
#define VHOST_GET_BACKEND_FEATURES _IOR(VHOST_VIRTIO, 0x26, __u64)
|
||||
|
||||
@@ -150,11 +145,39 @@
|
||||
/* Get the valid iova range */
|
||||
#define VHOST_VDPA_GET_IOVA_RANGE _IOR(VHOST_VIRTIO, 0x78, \
|
||||
struct vhost_vdpa_iova_range)
|
||||
|
||||
/* Get the config size */
|
||||
#define VHOST_VDPA_GET_CONFIG_SIZE _IOR(VHOST_VIRTIO, 0x79, __u32)
|
||||
|
||||
/* Get the count of all virtqueues */
|
||||
#define VHOST_VDPA_GET_VQS_COUNT _IOR(VHOST_VIRTIO, 0x80, __u32)
|
||||
|
||||
/* Get the number of virtqueue groups. */
|
||||
#define VHOST_VDPA_GET_GROUP_NUM _IOR(VHOST_VIRTIO, 0x81, __u32)
|
||||
|
||||
/* Get the number of address spaces. */
|
||||
#define VHOST_VDPA_GET_AS_NUM _IOR(VHOST_VIRTIO, 0x7A, unsigned int)
|
||||
|
||||
/* Get the group for a virtqueue: read index, write group in num,
|
||||
* The virtqueue index is stored in the index field of
|
||||
* vhost_vring_state. The group for this specific virtqueue is
|
||||
* returned via num field of vhost_vring_state.
|
||||
*/
|
||||
#define VHOST_VDPA_GET_VRING_GROUP _IOWR(VHOST_VIRTIO, 0x7B, \
|
||||
struct vhost_vring_state)
|
||||
/* Set the ASID for a virtqueue group. The group index is stored in
|
||||
* the index field of vhost_vring_state, the ASID associated with this
|
||||
* group is stored at num field of vhost_vring_state.
|
||||
*/
|
||||
#define VHOST_VDPA_SET_GROUP_ASID _IOW(VHOST_VIRTIO, 0x7C, \
|
||||
struct vhost_vring_state)
|
||||
|
||||
/* Suspend a device so it does not process virtqueue requests anymore
|
||||
*
|
||||
* After the return of ioctl the device must preserve all the necessary state
|
||||
* (the virtqueue vring base plus the possible device specific states) that is
|
||||
* required for restoring in the future. The device must not change its
|
||||
* configuration after that point.
|
||||
*/
|
||||
#define VHOST_VDPA_SUSPEND _IO(VHOST_VIRTIO, 0x7D)
|
||||
|
||||
#endif
|
||||
|
@@ -96,9 +96,7 @@
|
||||
IOCTL(BLKROGET, IOC_R, MK_PTR(TYPE_INT))
|
||||
IOCTL(BLKRRPART, 0, TYPE_NULL)
|
||||
IOCTL(BLKGETSIZE, IOC_R, MK_PTR(TYPE_ULONG))
|
||||
#ifdef BLKGETSIZE64
|
||||
IOCTL(BLKGETSIZE64, IOC_R, MK_PTR(TYPE_ULONGLONG))
|
||||
#endif
|
||||
IOCTL(BLKFLSBUF, 0, TYPE_NULL)
|
||||
IOCTL(BLKRASET, 0, TYPE_INT)
|
||||
IOCTL(BLKRAGET, IOC_R, MK_PTR(TYPE_LONG))
|
||||
@@ -107,33 +105,15 @@
|
||||
IOCTL_SPECIAL(BLKPG, IOC_W, do_ioctl_blkpg,
|
||||
MK_PTR(MK_STRUCT(STRUCT_blkpg_ioctl_arg)))
|
||||
|
||||
#ifdef BLKDISCARD
|
||||
IOCTL(BLKDISCARD, IOC_W, MK_PTR(MK_ARRAY(TYPE_ULONGLONG, 2)))
|
||||
#endif
|
||||
#ifdef BLKIOMIN
|
||||
IOCTL(BLKIOMIN, IOC_R, MK_PTR(TYPE_INT))
|
||||
#endif
|
||||
#ifdef BLKIOOPT
|
||||
IOCTL(BLKIOOPT, IOC_R, MK_PTR(TYPE_INT))
|
||||
#endif
|
||||
#ifdef BLKALIGNOFF
|
||||
IOCTL(BLKALIGNOFF, IOC_R, MK_PTR(TYPE_INT))
|
||||
#endif
|
||||
#ifdef BLKPBSZGET
|
||||
IOCTL(BLKPBSZGET, IOC_R, MK_PTR(TYPE_INT))
|
||||
#endif
|
||||
#ifdef BLKDISCARDZEROES
|
||||
IOCTL(BLKDISCARDZEROES, IOC_R, MK_PTR(TYPE_INT))
|
||||
#endif
|
||||
#ifdef BLKSECDISCARD
|
||||
IOCTL(BLKSECDISCARD, IOC_W, MK_PTR(MK_ARRAY(TYPE_ULONGLONG, 2)))
|
||||
#endif
|
||||
#ifdef BLKROTATIONAL
|
||||
IOCTL(BLKROTATIONAL, IOC_R, MK_PTR(TYPE_SHORT))
|
||||
#endif
|
||||
#ifdef BLKZEROOUT
|
||||
IOCTL(BLKZEROOUT, IOC_W, MK_PTR(MK_ARRAY(TYPE_ULONGLONG, 2)))
|
||||
#endif
|
||||
|
||||
IOCTL(FDMSGON, 0, TYPE_NULL)
|
||||
IOCTL(FDMSGOFF, 0, TYPE_NULL)
|
||||
@@ -149,17 +129,13 @@
|
||||
IOCTL(FDTWADDLE, 0, TYPE_NULL)
|
||||
IOCTL(FDEJECT, 0, TYPE_NULL)
|
||||
|
||||
#ifdef FIBMAP
|
||||
IOCTL(FIBMAP, IOC_W | IOC_R, MK_PTR(TYPE_LONG))
|
||||
#endif
|
||||
#ifdef FICLONE
|
||||
IOCTL(FICLONE, IOC_W, TYPE_INT)
|
||||
IOCTL(FICLONERANGE, IOC_W, MK_PTR(MK_STRUCT(STRUCT_file_clone_range)))
|
||||
#endif
|
||||
|
||||
#ifdef FIGETBSZ
|
||||
IOCTL(FIGETBSZ, IOC_R, MK_PTR(TYPE_LONG))
|
||||
#endif
|
||||
#ifdef CONFIG_FIEMAP
|
||||
IOCTL_SPECIAL(FS_IOC_FIEMAP, IOC_W | IOC_R, do_ioctl_fs_ioc_fiemap,
|
||||
MK_PTR(MK_STRUCT(STRUCT_fiemap)))
|
||||
|
@@ -31,10 +31,6 @@ enum {
|
||||
#include <asm/posix_types.h> /* for __kernel_old_dev_t */
|
||||
#include <asm/types.h> /* for __u64 */
|
||||
|
||||
#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,0) /* This is a guess. */
|
||||
#define __kernel_old_dev_t __kernel_dev_t
|
||||
#endif
|
||||
|
||||
/* Backwards compatibility version */
|
||||
struct loop_info {
|
||||
int lo_number; /* ioctl r/o */
|
||||
|
@@ -111,6 +111,31 @@
|
||||
#define FS_IOC32_SETFLAGS _IOW('f', 2, int)
|
||||
#define FS_IOC32_GETVERSION _IOR('v', 1, int)
|
||||
#define FS_IOC32_SETVERSION _IOW('v', 2, int)
|
||||
|
||||
#define BLKGETSIZE64 _IOR(0x12,114,size_t)
|
||||
#define BLKDISCARD _IO(0x12,119)
|
||||
#define BLKIOMIN _IO(0x12,120)
|
||||
#define BLKIOOPT _IO(0x12,121)
|
||||
#define BLKALIGNOFF _IO(0x12,122)
|
||||
#define BLKPBSZGET _IO(0x12,123)
|
||||
#define BLKDISCARDZEROES _IO(0x12,124)
|
||||
#define BLKSECDISCARD _IO(0x12,125)
|
||||
#define BLKROTATIONAL _IO(0x12,126)
|
||||
#define BLKZEROOUT _IO(0x12,127)
|
||||
|
||||
#define FIBMAP _IO(0x00,1)
|
||||
#define FIGETBSZ _IO(0x00,2)
|
||||
|
||||
struct file_clone_range {
|
||||
__s64 src_fd;
|
||||
__u64 src_offset;
|
||||
__u64 src_length;
|
||||
__u64 dest_offset;
|
||||
};
|
||||
|
||||
#define FICLONE _IOW(0x94, 9, int)
|
||||
#define FICLONERANGE _IOW(0x94, 13, struct file_clone_range)
|
||||
|
||||
#else
|
||||
#include <linux/fs.h>
|
||||
#endif
|
||||
@@ -2500,16 +2525,12 @@ set_timeout:
|
||||
case NETLINK_DROP_MEMBERSHIP:
|
||||
case NETLINK_BROADCAST_ERROR:
|
||||
case NETLINK_NO_ENOBUFS:
|
||||
#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 2, 0)
|
||||
case NETLINK_LISTEN_ALL_NSID:
|
||||
case NETLINK_CAP_ACK:
|
||||
#endif /* LINUX_VERSION_CODE >= KERNEL_VERSION(4, 2, 0) */
|
||||
#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 12, 0)
|
||||
case NETLINK_EXT_ACK:
|
||||
#endif /* LINUX_VERSION_CODE >= KERNEL_VERSION(4, 12, 0) */
|
||||
#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 20, 0)
|
||||
case NETLINK_GET_STRICT_CHK:
|
||||
#endif /* LINUX_VERSION_CODE >= KERNEL_VERSION(4, 12, 0) */
|
||||
#endif /* LINUX_VERSION_CODE >= KERNEL_VERSION(4, 20, 0) */
|
||||
break;
|
||||
default:
|
||||
goto unimplemented;
|
||||
@@ -2878,16 +2899,12 @@ get_timeout:
|
||||
case NETLINK_PKTINFO:
|
||||
case NETLINK_BROADCAST_ERROR:
|
||||
case NETLINK_NO_ENOBUFS:
|
||||
#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 2, 0)
|
||||
case NETLINK_LISTEN_ALL_NSID:
|
||||
case NETLINK_CAP_ACK:
|
||||
#endif /* LINUX_VERSION_CODE >= KERNEL_VERSION(4, 2, 0) */
|
||||
#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 12, 0)
|
||||
case NETLINK_EXT_ACK:
|
||||
#endif /* LINUX_VERSION_CODE >= KERNEL_VERSION(4, 12, 0) */
|
||||
#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 20, 0)
|
||||
case NETLINK_GET_STRICT_CHK:
|
||||
#endif /* LINUX_VERSION_CODE >= KERNEL_VERSION(4, 12, 0) */
|
||||
#endif /* LINUX_VERSION_CODE >= KERNEL_VERSION(4, 20, 0) */
|
||||
if (get_user_u32(len, optlen)) {
|
||||
return -TARGET_EFAULT;
|
||||
}
|
||||
@@ -2904,7 +2921,6 @@ get_timeout:
|
||||
return -TARGET_EFAULT;
|
||||
}
|
||||
break;
|
||||
#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 2, 0)
|
||||
case NETLINK_LIST_MEMBERSHIPS:
|
||||
{
|
||||
uint32_t *results;
|
||||
@@ -2935,7 +2951,6 @@ get_timeout:
|
||||
unlock_user(results, optval_addr, 0);
|
||||
break;
|
||||
}
|
||||
#endif /* LINUX_VERSION_CODE >= KERNEL_VERSION(4, 2, 0) */
|
||||
default:
|
||||
goto unimplemented;
|
||||
}
|
||||
@@ -6405,8 +6420,8 @@ static abi_long do_prctl_inval1(CPUArchState *env, abi_long arg2)
|
||||
#define do_prctl_sme_set_vl do_prctl_inval1
|
||||
#endif
|
||||
|
||||
static abi_long do_prctl(CPUArchState *env, abi_long option, abi_long arg2,
|
||||
abi_long arg3, abi_long arg4, abi_long arg5)
|
||||
static abi_long do_prctl(CPUArchState *env, abi_ulong option, abi_ulong arg2,
|
||||
abi_ulong arg3, abi_ulong arg4, abi_ulong arg5)
|
||||
{
|
||||
abi_long ret;
|
||||
|
||||
@@ -8157,7 +8172,8 @@ static int is_proc_myself(const char *filename, const char *entry)
|
||||
}
|
||||
|
||||
#if HOST_BIG_ENDIAN != TARGET_BIG_ENDIAN || \
|
||||
defined(TARGET_SPARC) || defined(TARGET_M68K) || defined(TARGET_HPPA)
|
||||
defined(TARGET_SPARC) || defined(TARGET_M68K) || \
|
||||
defined(TARGET_HPPA) || defined(TARGET_ARM)
|
||||
static int is_proc(const char *filename, const char *entry)
|
||||
{
|
||||
return strcmp(filename, entry) == 0;
|
||||
@@ -8229,6 +8245,27 @@ static int open_cpuinfo(CPUArchState *cpu_env, int fd)
|
||||
}
|
||||
#endif
|
||||
|
||||
#if defined(TARGET_ARM)
|
||||
static int open_cpuinfo(CPUArchState *cpu_env, int fd)
|
||||
{
|
||||
dprintf(fd,
|
||||
"Processor : ARMv7 Processor rev 5 (v7l)\n"
|
||||
"BogoMIPS : 799.53\n"
|
||||
"Features : swp half thumb fastmult vfp edsp thumbee neon vfpv3\n"
|
||||
"CPU implementer : 0x41\n"
|
||||
"CPU architecture: 7\n"
|
||||
"CPU variant : 0x2\n"
|
||||
"CPU part : 0xc08\n"
|
||||
"CPU revision : 5\n"
|
||||
"\n"
|
||||
"Hardware : Genesi Efika MX (Smarttop)\n"
|
||||
"Revision : 51030\n"
|
||||
"Serial : 0000000000000000\n");
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
#if defined(TARGET_M68K)
|
||||
static int open_hardware(CPUArchState *cpu_env, int fd)
|
||||
{
|
||||
@@ -8253,7 +8290,7 @@ static int do_openat(CPUArchState *cpu_env, int dirfd, const char *pathname, int
|
||||
#if HOST_BIG_ENDIAN != TARGET_BIG_ENDIAN
|
||||
{ "/proc/net/route", open_net_route, is_proc },
|
||||
#endif
|
||||
#if defined(TARGET_SPARC) || defined(TARGET_HPPA)
|
||||
#if defined(TARGET_SPARC) || defined(TARGET_HPPA) || defined(TARGET_ARM)
|
||||
{ "/proc/cpuinfo", open_cpuinfo, is_proc },
|
||||
#endif
|
||||
#if defined(TARGET_M68K)
|
||||
@@ -8559,10 +8596,10 @@ _syscall2(int, pivot_root, const char *, new_root, const char *, put_old)
|
||||
* of syscall results, can be performed.
|
||||
* All errnos that do_syscall() returns must be -TARGET_<errcode>.
|
||||
*/
|
||||
static abi_long do_syscall1(CPUArchState *cpu_env, int num, abi_long arg1,
|
||||
abi_long arg2, abi_long arg3, abi_long arg4,
|
||||
abi_long arg5, abi_long arg6, abi_long arg7,
|
||||
abi_long arg8)
|
||||
static abi_long do_syscall1(CPUArchState *cpu_env, int num, abi_ulong arg1,
|
||||
abi_ulong arg2, abi_ulong arg3, abi_ulong arg4,
|
||||
abi_ulong arg5, abi_ulong arg6, abi_ulong arg7,
|
||||
abi_ulong arg8)
|
||||
{
|
||||
CPUState *cpu = env_cpu(cpu_env);
|
||||
abi_long ret;
|
||||
@@ -8914,8 +8951,13 @@ static abi_long do_syscall1(CPUArchState *cpu_env, int num, abi_long arg1,
|
||||
return ret;
|
||||
#endif
|
||||
#ifdef TARGET_NR_lseek
|
||||
case TARGET_NR_lseek:
|
||||
return get_errno(lseek(arg1, arg2, arg3));
|
||||
case TARGET_NR_lseek: {
|
||||
off_t off = arg2;
|
||||
if (arg3 != SEEK_SET) {
|
||||
off = (abi_long)arg2;
|
||||
}
|
||||
return get_errno(lseek(arg1, off, arg3));
|
||||
}
|
||||
#endif
|
||||
#if defined(TARGET_NR_getxpid) && defined(TARGET_ALPHA)
|
||||
/* Alpha specific */
|
||||
@@ -13181,10 +13223,10 @@ static abi_long do_syscall1(CPUArchState *cpu_env, int num, abi_long arg1,
|
||||
return ret;
|
||||
}
|
||||
|
||||
abi_long do_syscall(CPUArchState *cpu_env, int num, abi_long arg1,
|
||||
abi_long arg2, abi_long arg3, abi_long arg4,
|
||||
abi_long arg5, abi_long arg6, abi_long arg7,
|
||||
abi_long arg8)
|
||||
abi_long do_syscall(CPUArchState *cpu_env, int num, abi_ulong arg1,
|
||||
abi_ulong arg2, abi_ulong arg3, abi_ulong arg4,
|
||||
abi_ulong arg5, abi_ulong arg6, abi_ulong arg7,
|
||||
abi_ulong arg8)
|
||||
{
|
||||
CPUState *cpu = env_cpu(cpu_env);
|
||||
abi_long ret;
|
||||
|
@@ -59,10 +59,10 @@ int info_is_fdpic(struct image_info *info);
|
||||
|
||||
void target_set_brk(abi_ulong new_brk);
|
||||
void syscall_init(void);
|
||||
abi_long do_syscall(CPUArchState *cpu_env, int num, abi_long arg1,
|
||||
abi_long arg2, abi_long arg3, abi_long arg4,
|
||||
abi_long arg5, abi_long arg6, abi_long arg7,
|
||||
abi_long arg8);
|
||||
abi_long do_syscall(CPUArchState *cpu_env, int num, abi_ulong arg1,
|
||||
abi_ulong arg2, abi_ulong arg3, abi_ulong arg4,
|
||||
abi_ulong arg5, abi_ulong arg6, abi_ulong arg7,
|
||||
abi_ulong arg8);
|
||||
extern __thread CPUState *thread_cpu;
|
||||
G_NORETURN void cpu_loop(CPUArchState *env);
|
||||
abi_long get_errno(abi_long ret);
|
||||
|
@@ -9,6 +9,6 @@
|
||||
#define X86_64_TARGET_ELF_H
|
||||
static inline const char *cpu_get_model(uint32_t eflags)
|
||||
{
|
||||
return "qemu64";
|
||||
return "max";
|
||||
}
|
||||
#endif
|
||||
|
15
meson.build
15
meson.build
@@ -248,6 +248,18 @@ if targetos == 'linux'
|
||||
add_project_arguments('-isystem', meson.current_source_dir() / 'linux-headers',
|
||||
'-isystem', 'linux-headers',
|
||||
language: ['c', 'cpp'])
|
||||
|
||||
if not cc.compiles('''
|
||||
#include <linux/version.h>
|
||||
int main(void) {
|
||||
#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 18, 0)
|
||||
#error "QEMU requires Linux kernel headers version >= 4.18.0"
|
||||
#endif
|
||||
return 0;
|
||||
}''')
|
||||
error('QEMU requires Linux kernel headers version >= 4.18.0')
|
||||
endif
|
||||
|
||||
endif
|
||||
|
||||
add_project_arguments('-iquote', '.',
|
||||
@@ -1736,7 +1748,7 @@ config_host_data.set_quoted('CONFIG_SYSCONFDIR', get_option('prefix') / get_opti
|
||||
if config_host.has_key('CONFIG_MODULES')
|
||||
config_host_data.set('CONFIG_STAMP', run_command(
|
||||
meson.current_source_dir() / 'scripts/qemu-stamp.py',
|
||||
meson.project_version(), get_option('pkgversion'), '--',
|
||||
meson.project_version(), '--',
|
||||
meson.current_source_dir() / 'configure',
|
||||
capture: true, check: true).stdout().strip())
|
||||
endif
|
||||
@@ -1793,7 +1805,6 @@ config_host_data.set('CONFIG_LIBNFS', libnfs.found())
|
||||
config_host_data.set('CONFIG_LIBSSH', libssh.found())
|
||||
config_host_data.set('CONFIG_LINUX_AIO', libaio.found())
|
||||
config_host_data.set('CONFIG_LINUX_IO_URING', linux_io_uring.found())
|
||||
config_host_data.set('CONFIG_LIBURING_REGISTER_RING_FD', cc.has_function('io_uring_register_ring_fd', prefix: '#include <liburing.h>', dependencies:linux_io_uring))
|
||||
config_host_data.set('CONFIG_LIBPMEM', libpmem.found())
|
||||
config_host_data.set('CONFIG_NUMA', numa.found())
|
||||
config_host_data.set('CONFIG_OPENGL', opengl.found())
|
||||
|
@@ -2950,7 +2950,7 @@ void qmp_xen_save_devices_state(const char *filename, bool has_live, bool live,
|
||||
* So call bdrv_inactivate_all (release locks) here to let the other
|
||||
* side of the migration take control of the images.
|
||||
*/
|
||||
if (live && !saved_vm_running) {
|
||||
if (!saved_vm_running) {
|
||||
ret = bdrv_inactivate_all();
|
||||
if (ret) {
|
||||
error_setg(errp, "%s: bdrv_inactivate_all() failed (%d)",
|
||||
|
@@ -124,7 +124,12 @@ static int parse_acl_file(const char *filename, ACLList *acl_list)
|
||||
}
|
||||
|
||||
if (strcmp(cmd, "deny") == 0) {
|
||||
acl_rule = g_malloc(sizeof(*acl_rule));
|
||||
acl_rule = calloc(1, sizeof(*acl_rule));
|
||||
if (!acl_rule) {
|
||||
fclose(f);
|
||||
errno = ENOMEM;
|
||||
return -1;
|
||||
}
|
||||
if (strcmp(arg, "all") == 0) {
|
||||
acl_rule->type = ACL_DENY_ALL;
|
||||
} else {
|
||||
@@ -133,7 +138,12 @@ static int parse_acl_file(const char *filename, ACLList *acl_list)
|
||||
}
|
||||
QSIMPLEQ_INSERT_TAIL(acl_list, acl_rule, entry);
|
||||
} else if (strcmp(cmd, "allow") == 0) {
|
||||
acl_rule = g_malloc(sizeof(*acl_rule));
|
||||
acl_rule = calloc(1, sizeof(*acl_rule));
|
||||
if (!acl_rule) {
|
||||
fclose(f);
|
||||
errno = ENOMEM;
|
||||
return -1;
|
||||
}
|
||||
if (strcmp(arg, "all") == 0) {
|
||||
acl_rule->type = ACL_ALLOW_ALL;
|
||||
} else {
|
||||
@@ -438,6 +448,18 @@ int main(int argc, char **argv)
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
#ifndef CONFIG_LIBCAP
|
||||
/*
|
||||
* avoid sending the fd as root user if running suid to not fool
|
||||
* peer credentials to daemons that dont expect that
|
||||
*/
|
||||
if (setuid(getuid()) < 0) {
|
||||
fprintf(stderr, "Failed to drop privileges.\n");
|
||||
ret = EXIT_FAILURE;
|
||||
goto cleanup;
|
||||
}
|
||||
#endif
|
||||
|
||||
/* write fd to the domain socket */
|
||||
if (send_fd(unixfd, fd) == -1) {
|
||||
fprintf(stderr, "failed to write fd to unix socket: %s\n",
|
||||
@@ -459,7 +481,7 @@ cleanup:
|
||||
}
|
||||
while ((acl_rule = QSIMPLEQ_FIRST(&acl_list)) != NULL) {
|
||||
QSIMPLEQ_REMOVE_HEAD(&acl_list, entry);
|
||||
g_free(acl_rule);
|
||||
free(acl_rule);
|
||||
}
|
||||
|
||||
return ret;
|
||||
|
@@ -52,6 +52,12 @@ SEABIOS_EXTRAVERSION="-prebuilt.qemu.org"
|
||||
#
|
||||
EDK2_EFIROM = edk2/BaseTools/Source/C/bin/EfiRom
|
||||
|
||||
# NB: Certain SUSE qemu subpackages use date information, but we want
|
||||
# reproducible builds, so we use a pre-determined timestamp, rather
|
||||
# than the current timestamp to acheive consistent results build to
|
||||
# build.
|
||||
PACKAGING_TIMESTAMP = $(shell date -r ../VERSION +%s)
|
||||
|
||||
default help:
|
||||
@echo "nothing is build by default"
|
||||
@echo "available build targets:"
|
||||
@@ -104,7 +110,7 @@ build-seabios-config-%: config.%
|
||||
|
||||
.PHONY: sgabios skiboot qboot
|
||||
sgabios:
|
||||
$(MAKE) -C sgabios
|
||||
$(MAKE) -C sgabios PACKAGING_TIMESTAMP=$(PACKAGING_TIMESTAMP)
|
||||
cp sgabios/sgabios.bin ../pc-bios
|
||||
|
||||
|
||||
@@ -123,11 +129,13 @@ efi-rom-%: build-pxe-roms build-efi-roms edk2-basetools
|
||||
|
||||
build-pxe-roms:
|
||||
$(MAKE) -C ipxe/src CONFIG=qemu \
|
||||
PACKAGING_TIMESTAMP=$(PACKAGING_TIMESTAMP) \
|
||||
CROSS_COMPILE=$(x86_64_cross_prefix) \
|
||||
$(patsubst %,bin/%.rom,$(pxerom_targets))
|
||||
|
||||
build-efi-roms: build-pxe-roms
|
||||
$(MAKE) -C ipxe/src CONFIG=qemu \
|
||||
PACKAGING_TIMESTAMP=$(PACKAGING_TIMESTAMP) \
|
||||
CROSS_COMPILE=$(x86_64_cross_prefix) \
|
||||
$(patsubst %,bin-x86_64-efi/%.efidrv,$(pxerom_targets))
|
||||
|
||||
@@ -143,15 +151,15 @@ build-efi-roms: build-pxe-roms
|
||||
# efirom
|
||||
#
|
||||
edk2-basetools:
|
||||
cd edk2/BaseTools && git submodule update --init --force \
|
||||
Source/C/BrotliCompress/brotli
|
||||
$(MAKE) -C edk2/BaseTools \
|
||||
PYTHON_COMMAND=$${EDK2_PYTHON_COMMAND:-python3} \
|
||||
EXTRA_OPTFLAGS='$(EDK2_BASETOOLS_OPTFLAGS)' \
|
||||
EXTRA_LDFLAGS='$(EDK2_BASETOOLS_LDFLAGS)'
|
||||
|
||||
slof:
|
||||
$(MAKE) -C SLOF CROSS=$(powerpc64_cross_prefix) qemu
|
||||
$(MAKE) -C SLOF CROSS=$(powerpc64_cross_prefix) \
|
||||
PACKAGING_TIMESTAMP=$(PACKAGING_TIMESTAMP) \
|
||||
qemu
|
||||
cp SLOF/boot_rom.bin ../pc-bios/slof.bin
|
||||
|
||||
u-boot.e500:
|
||||
@@ -189,7 +197,7 @@ MESON = meson
|
||||
NINJA = ninja
|
||||
qboot:
|
||||
mkdir -p qboot/build
|
||||
$(MESON) setup $(if $(wildcard qboot/build/meson-private),--wipe,) qboot qboot/build
|
||||
$(MESON) setup $(if $(x86_64_cross_prefix),--cross-file qboot/cross.ini,) $(if $(wildcard qboot/build/meson-private),--wipe,) qboot qboot/build
|
||||
$(NINJA) -C qboot/build
|
||||
cp qboot/build/bios.bin ../pc-bios/qboot.rom
|
||||
|
||||
|
@@ -116,7 +116,15 @@ qemu_edk2_get_cross_prefix()
|
||||
# force soft-float cross-compiler on Debian
|
||||
printf 'arm-linux-gnueabi-'
|
||||
else
|
||||
printf '%s-linux-gnu-\n' "$gcc_arch"
|
||||
if [ "$emulation_target" == arm ]; then
|
||||
printf '%s-suse-linux-gnueabi-\n' "$gcc_arch"
|
||||
else
|
||||
if [ "$gcc_arch" == i686 ]; then
|
||||
printf '%s-suse-linux-\n' "i586"
|
||||
else
|
||||
printf '%s-suse-linux-\n' "$gcc_arch"
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
}
|
||||
|
||||
|
@@ -1,4 +1,4 @@
|
||||
#!/usr/bin/env python3
|
||||
#!/usr/bin/python3
|
||||
#
|
||||
# Migration Stream Analyzer
|
||||
#
|
||||
|
@@ -341,7 +341,7 @@ BINFMT_SET=qemu_register_interpreter
|
||||
SYSTEMDDIR="/etc/binfmt.d"
|
||||
DEBIANDIR="/usr/share/binfmts"
|
||||
|
||||
QEMU_PATH=/usr/local/bin
|
||||
QEMU_PATH=/usr/bin
|
||||
CREDENTIAL=no
|
||||
PERSISTENT=no
|
||||
PRESERVE_ARG0=no
|
||||
|
@@ -1,4 +1,4 @@
|
||||
#!/usr/bin/env python3
|
||||
#!/usr/bin/python3
|
||||
#
|
||||
# Compares vmstate information stored in JSON format, obtained from
|
||||
# the -dump-vmstate QEMU command.
|
||||
|
@@ -2077,11 +2077,13 @@ RAMBlock *qemu_ram_alloc_from_fd(ram_addr_t size, MemoryRegion *mr,
|
||||
return NULL;
|
||||
}
|
||||
|
||||
#ifndef TARGET_PPC
|
||||
if (kvm_enabled() && !kvm_has_sync_mmu()) {
|
||||
error_setg(errp,
|
||||
"host lacks kvm mmu notifiers, -mem-path unsupported");
|
||||
return NULL;
|
||||
}
|
||||
#endif
|
||||
|
||||
size = HOST_PAGE_ALIGN(size);
|
||||
file_size = get_file_size(fd);
|
||||
|
12
softmmu/vl.c
12
softmmu/vl.c
@@ -42,6 +42,7 @@
|
||||
#include "sysemu/reset.h"
|
||||
#include "sysemu/runstate.h"
|
||||
#include "sysemu/runstate-action.h"
|
||||
#include <sys/resource.h>
|
||||
#include "sysemu/seccomp.h"
|
||||
#include "sysemu/tcg.h"
|
||||
#include "sysemu/xen.h"
|
||||
@@ -2613,6 +2614,17 @@ void qemu_init(int argc, char **argv, char **envp)
|
||||
MachineClass *machine_class;
|
||||
bool userconfig = true;
|
||||
FILE *vmstate_dump_file = NULL;
|
||||
struct rlimit rlimit_as;
|
||||
|
||||
/*
|
||||
* Try to raise the soft address space limit.
|
||||
* Default on SLES 11 SP2 is 80% of physical+swap memory.
|
||||
*/
|
||||
getrlimit(RLIMIT_AS, &rlimit_as);
|
||||
if (rlimit_as.rlim_cur < rlimit_as.rlim_max) {
|
||||
rlimit_as.rlim_cur = rlimit_as.rlim_max;
|
||||
setrlimit(RLIMIT_AS, &rlimit_as);
|
||||
}
|
||||
|
||||
qemu_add_opts(&qemu_drive_opts);
|
||||
qemu_add_drive_opts(&qemu_legacy_drive_opts);
|
||||
|
@@ -26,7 +26,7 @@
|
||||
#define TARGET_MAX_INSN_SIZE 16
|
||||
|
||||
#if defined(TARGET_X86_64)
|
||||
# define TCG_PHYS_ADDR_BITS 40
|
||||
# define TCG_PHYS_ADDR_BITS 42
|
||||
#else
|
||||
# define TCG_PHYS_ADDR_BITS 36
|
||||
#endif
|
||||
|
@@ -157,6 +157,7 @@ static int cap_ri;
|
||||
static int cap_hpage_1m;
|
||||
static int cap_vcpu_resets;
|
||||
static int cap_protected;
|
||||
static int cap_zpci_op;
|
||||
|
||||
static bool mem_op_storage_key_support;
|
||||
|
||||
@@ -362,6 +363,7 @@ int kvm_arch_init(MachineState *ms, KVMState *s)
|
||||
cap_s390_irq = kvm_check_extension(s, KVM_CAP_S390_INJECT_IRQ);
|
||||
cap_vcpu_resets = kvm_check_extension(s, KVM_CAP_S390_VCPU_RESETS);
|
||||
cap_protected = kvm_check_extension(s, KVM_CAP_S390_PROTECTED);
|
||||
cap_zpci_op = kvm_check_extension(s, KVM_CAP_S390_ZPCI_OP);
|
||||
|
||||
kvm_vm_enable_cap(s, KVM_CAP_S390_USER_SIGP, 0);
|
||||
kvm_vm_enable_cap(s, KVM_CAP_S390_VECTOR_REGISTERS, 0);
|
||||
@@ -2574,3 +2576,8 @@ bool kvm_arch_cpu_check_are_resettable(void)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
int kvm_s390_get_zpci_op(void)
|
||||
{
|
||||
return cap_zpci_op;
|
||||
}
|
||||
|
@@ -27,6 +27,7 @@ void kvm_s390_vcpu_interrupt_pre_save(S390CPU *cpu);
|
||||
int kvm_s390_vcpu_interrupt_post_load(S390CPU *cpu);
|
||||
int kvm_s390_get_hpage_1m(void);
|
||||
int kvm_s390_get_ri(void);
|
||||
int kvm_s390_get_zpci_op(void);
|
||||
int kvm_s390_get_clock(uint8_t *tod_high, uint64_t *tod_clock);
|
||||
int kvm_s390_get_clock_ext(uint8_t *tod_high, uint64_t *tod_clock);
|
||||
int kvm_s390_set_clock(uint8_t tod_high, uint64_t tod_clock);
|
||||
|
@@ -1,7 +1,7 @@
|
||||
QA output created by 162
|
||||
|
||||
=== NBD ===
|
||||
qemu-img: Could not open 'json:{"driver": "nbd", "host": -1}': address resolution failed for -1:10809: Name or service not known
|
||||
qemu-img: Could not open 'json:{"driver": "nbd", "host": 42}': Failed to connect socket: Network is unreachable
|
||||
image: nbd://localhost:PORT
|
||||
image: nbd+unix://?socket=42
|
||||
|
||||
|
@@ -85,7 +85,7 @@ _timed_wait_for()
|
||||
timeout=yes
|
||||
|
||||
QEMU_STATUS[$h]=0
|
||||
read_timeout="-t ${QEMU_COMM_TIMEOUT}"
|
||||
read_timeout="-t $((${QEMU_COMM_TIMEOUT}*3))"
|
||||
if [ -n "${GDB_OPTIONS}" ]; then
|
||||
read_timeout=
|
||||
fi
|
||||
|
@@ -39,6 +39,10 @@ qtests_pci = \
|
||||
qtests_cxl = \
|
||||
(config_all_devices.has_key('CONFIG_CXL') ? ['cxl-test'] : [])
|
||||
|
||||
# display-vga-test currently fails in OBS, for ppc64
|
||||
qtests_pci_novga = \
|
||||
(config_all_devices.has_key('CONFIG_IVSHMEM_DEVICE') ? ['ivshmem-test'] : [])
|
||||
|
||||
qtests_i386 = \
|
||||
(slirp.found() ? ['pxe-test', 'test-netfilter'] : []) + \
|
||||
(config_host.has_key('CONFIG_POSIX') ? ['test-filter-mirror'] : []) + \
|
||||
@@ -167,7 +171,7 @@ qtests_ppc64 = \
|
||||
(slirp.found() ? ['pxe-test'] : []) + \
|
||||
(config_all_devices.has_key('CONFIG_USB_UHCI') ? ['usb-hcd-uhci-test'] : []) + \
|
||||
(config_all_devices.has_key('CONFIG_USB_XHCI_NEC') ? ['usb-hcd-xhci-test'] : []) + \
|
||||
qtests_pci + ['migration-test', 'numa-test', 'cpu-plug-test', 'drive_del-test']
|
||||
qtests_pci_novga + ['migration-test', 'numa-test', 'cpu-plug-test', 'drive_del-test']
|
||||
|
||||
qtests_sh4 = (config_all_devices.has_key('CONFIG_ISA_TESTDEV') ? ['endianness-test'] : [])
|
||||
qtests_sh4eb = (config_all_devices.has_key('CONFIG_ISA_TESTDEV') ? ['endianness-test'] : [])
|
||||
|
@@ -996,17 +996,20 @@ static void register_vhost_user_test(void)
|
||||
"virtio-net",
|
||||
test_migrate, &opts);
|
||||
|
||||
opts.before = vhost_user_test_setup_reconnect;
|
||||
qos_add_test("vhost-user/reconnect", "virtio-net",
|
||||
test_reconnect, &opts);
|
||||
/* keeps failing on build-system since Aug 15 2017 */
|
||||
if (getenv("QTEST_VHOST_USER_FIXME")) {
|
||||
opts.before = vhost_user_test_setup_reconnect;
|
||||
qos_add_test("vhost-user/reconnect", "virtio-net",
|
||||
test_reconnect, &opts);
|
||||
|
||||
opts.before = vhost_user_test_setup_connect_fail;
|
||||
qos_add_test("vhost-user/connect-fail", "virtio-net",
|
||||
test_vhost_user_started, &opts);
|
||||
opts.before = vhost_user_test_setup_connect_fail;
|
||||
qos_add_test("vhost-user/connect-fail", "virtio-net",
|
||||
test_vhost_user_started, &opts);
|
||||
|
||||
opts.before = vhost_user_test_setup_flags_mismatch;
|
||||
qos_add_test("vhost-user/flags-mismatch", "virtio-net",
|
||||
test_vhost_user_started, &opts);
|
||||
opts.before = vhost_user_test_setup_flags_mismatch;
|
||||
qos_add_test("vhost-user/flags-mismatch", "virtio-net",
|
||||
test_vhost_user_started, &opts);
|
||||
}
|
||||
|
||||
opts.before = vhost_user_test_setup_multiqueue;
|
||||
opts.edge.extra_device_opts = "mq=on";
|
||||
|
@@ -1231,10 +1231,6 @@ static inline int modify_ldt(int func, void * ptr, unsigned long bytecount)
|
||||
return syscall(__NR_modify_ldt, func, ptr, bytecount);
|
||||
}
|
||||
|
||||
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 5, 66)
|
||||
#define modify_ldt_ldt_s user_desc
|
||||
#endif
|
||||
|
||||
#define MK_SEL(n) (((n) << 3) | 7)
|
||||
|
||||
uint8_t seg_data1[4096];
|
||||
@@ -1272,7 +1268,7 @@ uint8_t seg_data2[4096];
|
||||
/* NOTE: we use Linux modify_ldt syscall */
|
||||
void test_segs(void)
|
||||
{
|
||||
struct modify_ldt_ldt_s ldt;
|
||||
struct user_desc ldt;
|
||||
long long ldt_table[3];
|
||||
int res, res2;
|
||||
char tmp;
|
||||
@@ -1374,7 +1370,7 @@ extern char code16_func3;
|
||||
|
||||
void test_code16(void)
|
||||
{
|
||||
struct modify_ldt_ldt_s ldt;
|
||||
struct user_desc ldt;
|
||||
int res, res2;
|
||||
|
||||
/* build a code segment */
|
||||
@@ -1781,7 +1777,7 @@ void test_exceptions(void)
|
||||
}
|
||||
|
||||
{
|
||||
struct modify_ldt_ldt_s ldt;
|
||||
struct user_desc ldt;
|
||||
ldt.entry_number = 1;
|
||||
ldt.base_addr = (unsigned long)&seg_data1;
|
||||
ldt.limit = (sizeof(seg_data1) + 0xfff) >> 12;
|
||||
|
@@ -99,7 +99,6 @@ Build/bios-tables-test.%.efi: build-edk2-tools
|
||||
+./build.sh $(edk2_dir) BiosTablesTest $* $@
|
||||
|
||||
build-edk2-tools:
|
||||
cd $(edk2_dir)/BaseTools && git submodule update --init --force
|
||||
$(MAKE) -C $(edk2_dir)/BaseTools \
|
||||
PYTHON_COMMAND=$${EDK2_PYTHON_COMMAND:-python3} \
|
||||
EXTRA_OPTFLAGS='$(EDK2_BASETOOLS_OPTFLAGS)' \
|
||||
|
@@ -1,3 +1,4 @@
|
||||
#define HW_POISON_H /* avoid poison since we patch against rules it "enforces" */
|
||||
#include "qemu/osdep.h"
|
||||
#include <glib/gstdio.h>
|
||||
|
||||
|
Reference in New Issue
Block a user