/qemu/tests/unit/ |
H A D | test-virtio-dmabuf.c | 2 * QEMU tests for shared dma-buf API 22 #include "hw/virtio/virtio-dmabuf.h" 27 QemuUUID uuid; in test_add_remove_resources() local 31 qemu_uuid_generate(&uuid); in test_add_remove_resources() 34 g_assert(virtio_add_dmabuf(&uuid, dmabuf_fd)); in test_add_remove_resources() 35 g_assert_cmpint(virtio_lookup_dmabuf(&uuid), ==, dmabuf_fd); in test_add_remove_resources() 37 g_assert(virtio_remove_resource(&uuid)); in test_add_remove_resources() 39 g_assert_cmpint(virtio_lookup_dmabuf(&uuid), ==, -1); in test_add_remove_resources() 45 QemuUUID uuid; in test_add_remove_dev() local 46 struct vhost_dev *dev = g_new0(struct vhost_dev, 1); in test_add_remove_dev() local [all …]
|
/qemu/hw/display/ |
H A D | virtio-dmabuf.c | 2 * Virtio Shared dma-buf 10 * See the COPYING file in the top-level directory. 15 #include "hw/virtio/virtio-dmabuf.h" 22 * uuid_equal_func: wrapper for UUID is_equal function to 30 static bool virtio_add_resource(QemuUUID *uuid, VirtioSharedObject *value) in virtio_add_resource() argument 41 if (g_hash_table_lookup(resource_uuids, uuid) == NULL) { in virtio_add_resource() 42 g_hash_table_insert(resource_uuids, uuid, value); in virtio_add_resource() 51 bool virtio_add_dmabuf(QemuUUID *uuid, int udmabuf_fd) in virtio_add_dmabuf() argument 59 vso->type = TYPE_DMABUF; in virtio_add_dmabuf() 60 vso->value = GINT_TO_POINTER(udmabuf_fd); in virtio_add_dmabuf() [all …]
|
/qemu/include/hw/virtio/ |
H A D | virtio-dmabuf.h | 2 * Virtio Shared dma-buf 10 * See the COPYING file in the top-level directory. 16 #include "qemu/uuid.h" 31 * virtio_add_dmabuf() - Add a new dma-buf resource to the lookup table 32 * @uuid: new resource's UUID 33 * @dmabuf_fd: the dma-buf descriptor that will be stored and shared with 37 * Note: @dmabuf_fd must be a valid (non-negative) file descriptor. 39 * Return: true if the UUID did not exist and the resource has been added, 40 * false if another resource with the same UUID already existed. 41 * Note that if it finds a repeated UUID, the resource is not inserted in [all …]
|
/qemu/subprojects/libvhost-user/ |
H A D | libvhost-user.h | 8 * Marc-André Lureau <mlureau@redhat.com> 11 * later. See the COPYING file in the top-level directory. 23 #include "standard-headers/linux/virtio_ring.h" 25 /* Based on qemu/hw/virtio/vhost-user.c */ 36 * limit is sufficient to support many DIMMs and virtio-mem in 37 * "dynamic-memslots" mode. 75 #define VHOST_USER_PROTOCOL_FEATURE_MASK ((1 << VHOST_USER_PROTOCOL_F_MAX) - 1) 186 unsigned char uuid[UUID_LEN]; member 235 typedef uint64_t (*vu_get_features_cb) (VuDev *dev); 236 typedef void (*vu_set_features_cb) (VuDev *dev, uint64_t features); [all …]
|
H A D | libvhost-user.c | 9 * Marc-André Lureau <mlureau@redhat.com> 13 * later. See the COPYING file in the top-level directory. 39 #include "standard-headers/linux/virtio_config.h" 57 #include "libvhost-user.h" 83 #define ALIGN_UP(n, m) ALIGN_DOWN((n) + (m) - 1, (m)) 114 bool vu_has_feature(VuDev *dev, in vu_has_feature() argument 117 return has_feature(dev->features, fbit); in vu_has_feature() 120 static inline bool vu_has_protocol_feature(VuDev *dev, unsigned int fbit) in vu_has_protocol_feature() argument 122 return has_feature(dev->protocol_features, fbit); in vu_has_protocol_feature() 179 vu_panic(VuDev *dev, const char *msg, ...) in vu_panic() argument [all …]
|
/qemu/hw/pci-host/ |
H A D | gpex-acpi.c | 2 #include "hw/acpi/aml-build.h" 3 #include "hw/pci-host/gpex.h" 10 static void acpi_dsdt_add_pci_route_table(Aml *dev, uint32_t irq, in acpi_dsdt_add_pci_route_table() argument 29 aml_append(dev, aml_name_decl("_PRT", rt_pkg)); in acpi_dsdt_add_pci_route_table() 53 static void acpi_dsdt_add_pci_osc(Aml *dev) in acpi_dsdt_add_pci_osc() argument 55 Aml *method, *UUID, *ifctx, *ifctx1, *elsectx, *buf; in acpi_dsdt_add_pci_osc() local 58 aml_append(dev, aml_name_decl("SUPP", aml_int(0))); in acpi_dsdt_add_pci_osc() 59 aml_append(dev, aml_name_decl("CTRL", aml_int(0))); in acpi_dsdt_add_pci_osc() 66 * The _OSC interface for a PCI/PCI-X/PCI Express hierarchy is in acpi_dsdt_add_pci_osc() 67 * identified by the Universal Unique IDentifier (UUID) in acpi_dsdt_add_pci_osc() [all …]
|
/qemu/hw/acpi/ |
H A D | cxl.c | 25 #include "hw/mem/memory-device.h" 27 #include "hw/acpi/aml-build.h" 28 #include "hw/acpi/bios-linker-loader.h" 31 #include "qemu/uuid.h" 33 void build_cxl_dsm_method(Aml *dev) in build_cxl_dsm_method() argument 39 Aml *function, *uuid; in build_cxl_dsm_method() local 41 uuid = aml_arg(0); in build_cxl_dsm_method() 45 uuid, aml_touuid("F365F9A6-A7DE-4071-A66A-B40C0B4F8E52"))); in build_cxl_dsm_method() 70 * Return: A package containing two elements - a WORD that returns in build_cxl_dsm_method() 99 aml_append(dev, method); in build_cxl_dsm_method() [all …]
|
H A D | ipmi.c | 7 * See the COPYING file in the top-level directory. 12 #include "hw/acpi/aml-build.h" 24 switch (info->memspace) { in aml_ipmi_crs() 26 aml_append(crs, aml_io(AML_DECODE16, info->base_address, in aml_ipmi_crs() 27 info->base_address + info->register_length - 1, in aml_ipmi_crs() 28 info->register_spacing, info->register_length)); in aml_ipmi_crs() 36 info->base_address, in aml_ipmi_crs() 37 info->base_address + info->register_length - 1, in aml_ipmi_crs() 38 info->register_spacing, info->register_length)); in aml_ipmi_crs() 46 info->base_address, in aml_ipmi_crs() [all …]
|
H A D | tpm.c | 23 void tpm_build_ppi_acpi(TPMIf *tpm, Aml *dev) in tpm_build_ppi_acpi() argument 41 aml_append(dev, in tpm_build_ppi_acpi() 52 aml_append(dev, field); in tpm_build_ppi_acpi() 56 aml_append(dev, in tpm_build_ppi_acpi() 64 aml_append(dev, field); in tpm_build_ppi_acpi() 87 aml_append(dev, method); in tpm_build_ppi_acpi() 96 aml_append(dev, aml_name_decl("TPM2", pak)); in tpm_build_ppi_acpi() 103 aml_append(dev, aml_name_decl("TPM3", pak)); in tpm_build_ppi_acpi() 109 Aml *function, *arguments, *rev, *op, *op_arg, *op_flags, *uuid; in tpm_build_ppi_acpi() local 111 uuid = aml_arg(0); in tpm_build_ppi_acpi() [all …]
|
H A D | nvdimm.c | 30 #include "qemu/uuid.h" 33 #include "hw/acpi/aml-build.h" 34 #include "hw/acpi/bios-linker-loader.h" 37 #include "qemu/nvdimm-utils.h" 157 * ACPI device - nfit_memdev.nfit_handle matches with the value returned 192 for (list = device_list; list; list = list->next) { in nvdimm_get_device_by_handle() 193 NVDIMMDevice *nvd = list->data; in nvdimm_get_device_by_handle() 209 nvdimm_build_structure_spa(GArray *structures, DeviceState *dev) in nvdimm_build_structure_spa() argument 212 uint64_t addr = object_property_get_uint(OBJECT(dev), PC_DIMM_ADDR_PROP, in nvdimm_build_structure_spa() 214 uint64_t size = object_property_get_uint(OBJECT(dev), PC_DIMM_SIZE_PROP, in nvdimm_build_structure_spa() [all …]
|
H A D | aml-build.c | 24 #include "hw/acpi/aml-build.h" 63 for (i = maxlen - len; i > 0; i--) { in build_append_padded_str() 70 g_array_append_vals(array, val->data, val->len); in build_append_array() 80 entry->base = base; in crs_range_insert() 81 entry->limit = limit; in crs_range_insert() 94 range_set->io_ranges = g_ptr_array_new_with_free_func(crs_range_free); in crs_range_set_init() 95 range_set->mem_ranges = g_ptr_array_new_with_free_func(crs_range_free); in crs_range_set_init() 96 range_set->mem_64bit_ranges = in crs_range_set_init() 102 g_ptr_array_free(range_set->io_ranges, true); in crs_range_set_free() 103 g_ptr_array_free(range_set->mem_ranges, true); in crs_range_set_free() [all …]
|
/qemu/hw/ipmi/ |
H A D | pci_ipmi_bt.c | 31 #define TYPE_PCI_IPMI_BT "pci-ipmi-bt" 35 PCIDevice dev; member 38 uint32_t uuid; member 45 ipmi_bt_get_fwinfo(&pib->bt, info); in pci_ipmi_bt_get_fwinfo() 46 info->irq_source = IPMI_PCI_IRQ; in pci_ipmi_bt_get_fwinfo() 47 info->interrupt_number = pci_intx(&pib->dev); in pci_ipmi_bt_get_fwinfo() 48 info->i2c_slave_address = pib->bt.bmc->slave_addr; in pci_ipmi_bt_get_fwinfo() 49 info->uuid = pib->uuid; in pci_ipmi_bt_get_fwinfo() 54 PCIIPMIBTDevice *pib = ib->opaque; in pci_ipmi_raise_irq() 56 pci_set_irq(&pib->dev, true); in pci_ipmi_raise_irq() [all …]
|
H A D | pci_ipmi_kcs.c | 31 #define TYPE_PCI_IPMI_KCS "pci-ipmi-kcs" 35 PCIDevice dev; member 38 uint32_t uuid; member 45 ipmi_kcs_get_fwinfo(&pik->kcs, info); in pci_ipmi_kcs_get_fwinfo() 46 info->irq_source = IPMI_PCI_IRQ; in pci_ipmi_kcs_get_fwinfo() 47 info->interrupt_number = pci_intx(&pik->dev); in pci_ipmi_kcs_get_fwinfo() 48 info->uuid = pik->uuid; in pci_ipmi_kcs_get_fwinfo() 53 PCIIPMIKCSDevice *pik = ik->opaque; in pci_ipmi_raise_irq() 55 pci_set_irq(&pik->dev, true); in pci_ipmi_raise_irq() 60 PCIIPMIKCSDevice *pik = ik->opaque; in pci_ipmi_lower_irq() [all …]
|
H A D | isa_ipmi_bt.c | 31 #include "hw/qdev-properties.h" 36 #define TYPE_ISA_IPMI_BT "isa-ipmi-bt" 40 ISADevice dev; member 44 uint32_t uuid; member 51 ipmi_bt_get_fwinfo(&iib->bt, info); in isa_ipmi_bt_get_fwinfo() 52 info->irq_source = IPMI_ISA_IRQ; in isa_ipmi_bt_get_fwinfo() 53 info->interrupt_number = iib->isairq; in isa_ipmi_bt_get_fwinfo() 54 info->i2c_slave_address = iib->bt.bmc->slave_addr; in isa_ipmi_bt_get_fwinfo() 55 info->uuid = iib->uuid; in isa_ipmi_bt_get_fwinfo() 60 ISAIPMIBTDevice *iib = ib->opaque; in isa_ipmi_bt_raise_irq() [all …]
|
H A D | isa_ipmi_kcs.c | 31 #include "hw/qdev-properties.h" 36 #define TYPE_ISA_IPMI_KCS "isa-ipmi-kcs" 40 ISADevice dev; member 44 uint32_t uuid; member 51 ipmi_kcs_get_fwinfo(&iik->kcs, info); in isa_ipmi_kcs_get_fwinfo() 52 info->irq_source = IPMI_ISA_IRQ; in isa_ipmi_kcs_get_fwinfo() 53 info->interrupt_number = iik->isairq; in isa_ipmi_kcs_get_fwinfo() 54 info->uuid = iik->uuid; in isa_ipmi_kcs_get_fwinfo() 59 ISAIPMIKCSDevice *iik = ik->opaque; in isa_ipmi_kcs_raise_irq() 61 qemu_irq_raise(iik->irq); in isa_ipmi_kcs_raise_irq() [all …]
|
H A D | smbus_ipmi.c | 28 #include "qemu/error-report.h" 33 #define TYPE_SMBUS_IPMI "smbus-ipmi" 71 uint32_t uuid; member 84 if (sid->waiting_rsp == msg_id) { in smbus_ipmi_handle_rsp() 85 sid->waiting_rsp++; in smbus_ipmi_handle_rsp() 91 memcpy(sid->outmsg, rsp, rsp_len); in smbus_ipmi_handle_rsp() 92 sid->outlen = rsp_len; in smbus_ipmi_handle_rsp() 93 sid->outpos = 0; in smbus_ipmi_handle_rsp() 94 sid->currblk = 0; in smbus_ipmi_handle_rsp() 109 uint8_t *msg = sid->inmsg; in smbus_ipmi_send_msg() [all …]
|
/qemu/hw/virtio/ |
H A D | vhost-user.c | 2 * vhost-user 7 * See the COPYING file in the top-level directory. 13 #include "hw/virtio/virtio-dmabuf.h" 15 #include "hw/virtio/virtio-crypto.h" 16 #include "hw/virtio/vhost-user.h" 17 #include "hw/virtio/vhost-backend.h" 19 #include "hw/virtio/virtio-net.h" 20 #include "chardev/char-fe.h" 21 #include "io/channel-socket.h" 23 #include "qemu/error-report.h" [all …]
|
/qemu/include/hw/mem/ |
H A D | nvdimm.h | 2 * Non-Volatile Dual In-line Memory Module Virtualization Implementation 20 * See the COPYING file in the top-level directory. 26 #include "hw/mem/pc-dimm.h" 27 #include "hw/acpi/bios-linker-loader.h" 28 #include "qemu/uuid.h" 29 #include "hw/acpi/aml-build.h" 43 #define NVDIMM_LABEL_SIZE_PROP "label-size" 44 #define NVDIMM_UUID_PROP "uuid" 75 * backend (e.g., files on HDD, /dev/pmemX, etc.) cannot guarantee 87 * The PPC64 - spapr requires each nvdimm device have a uuid. [all …]
|
/qemu/hw/vmapple/ |
H A D | vmapple.c | 7 * See the COPYING file in the top-level directory. 9 * SPDX-License-Identifier: GPL-2.0-or-later 11 * VMApple is the device model that the macOS built-in hypervisor called 20 #include "qemu/error-report.h" 21 #include "qemu/guest-random.h" 22 #include "qemu/help-texts.h" 31 #include "hw/qdev-properties.h" 40 #include "hw/pci-host/gpex.h" 41 #include "hw/usb/hcd-xhci-pci.h" 42 #include "hw/virtio/virtio-pci.h" [all …]
|
/qemu/tests/qtest/migration/ |
H A D | misc-tests.c | 4 * Copyright (c) 2016-2018 Red Hat, Inc. and/or its affiliates 5 * based on the vhost-user-test.c that is: 9 * See the COPYING file in the top-level directory. 18 #include "migration/migration-qmp.h" 19 #include "migration/migration-util.h" 21 #define ANALYZE_SCRIPT "scripts/analyze-migration.py" 44 .opts_source = "-uuid 11111111-1111-1111-1111-111111111111", in test_analyze_script() 67 migrate_set_capability(from, "validate-uuid", true); in test_analyze_script() 68 migrate_set_capability(from, "x-ignore-shared", true); in test_analyze_script() 80 open("/dev/null", O_WRONLY); in test_analyze_script() [all …]
|
/qemu/pc-bios/s390-ccw/ |
H A D | netmain.c | 2 * S390 virtio-ccw network boot loading program 6 * Based on the S390 virtio-ccw loading program (main.c) 35 #include "s390-ccw.h" 38 #include "s390-time.h" 49 /* STSI 3.2.2 offset of first vmdb + offset of uuid inside vmdb */ 65 return dest_timer - get_time_ms(); in get_timer() 76 * client MAC, client IP, TFTP-server MAC, TFTP-server IP, 80 * non-0 : error condition occurred. 85 int rc = -1; in dhcp() 93 printf("\b\b\b%03d", i - 1); in dhcp() [all …]
|
/qemu/hw/core/ |
H A D | qdev-properties-system.c | 3 * (parts specific for qemu-system-*) 5 * This file is based on code from hw/qdev-properties.c from 10 * See the COPYING file in the top-level directory. 14 #include "hw/qdev-properties.h" 15 #include "hw/qdev-properties-system.h" 18 #include "qapi/qapi-types-block.h" 19 #include "qapi/qapi-types-machine.h" 20 #include "qapi/qapi-types-migration.h" 21 #include "qapi/qapi-visit-virtio.h" 26 #include "qemu/uuid.h" [all …]
|
/qemu/hw/ppc/ |
H A D | spapr_nvdimm.c | 4 * Copyright (c) 2019-2020, IBM Corporation. 30 #include "qemu/nvdimm-utils.h" 34 #include "block/thread-pool.h" 37 #include "hw/qdev-properties.h" 55 #define TYPE_SPAPR_NVDIMM "spapr-nvdimm" 73 MemoryRegion *mr = host_memory_backend_get_memory(dimm->hostmem); in spapr_nvdimm_validate() 75 QemuUUID uuid; in spapr_nvdimm_validate() local 78 if (!mc->nvdimm_supported) { in spapr_nvdimm_validate() 83 if (!ms->nvdimms_state->is_enabled) { in spapr_nvdimm_validate() 90 error_setg(errp, "PAPR requires NVDIMM devices to have label-size set"); in spapr_nvdimm_validate() [all …]
|
/qemu/docs/system/devices/ |
H A D | nvme.rst | 5 QEMU provides NVMe emulation through the ``nvme``, ``nvme-ns`` and 6 ``nvme-subsys`` devices. 12 `Simple Copy`_, `Zoned Namespaces`_, `metadata`_ and `End-to-End Data 19 -------------------- 32 .. code-block:: console 34 -drive file=nvm.img,if=none,id=nvm 35 -device nvme,serial=deadbeef,drive=nvm 38 are mentioned here, but see ``-device nvme,help`` to list all possible 46 The number of MSI-X vectors that the device should support. 51 ``use-intel-id`` (default: ``off``) [all …]
|
/qemu/hw/gpio/ |
H A D | zaurus.c | 2 * Copyright (c) 2006-2008 Openedhand Ltd. 68 level = s->gpio_level & s->gpio_dir; in scoop_gpio_handler_update() 70 for (diff = s->prev_level ^ level; diff; diff ^= 1 << bit) { in scoop_gpio_handler_update() 72 qemu_set_irq(s->handler[bit], (level >> bit) & 1); in scoop_gpio_handler_update() 75 s->prev_level = level; in scoop_gpio_handler_update() 85 return s->mcr; in scoop_read() 87 return s->cdr; in scoop_read() 89 return s->status; in scoop_read() 91 return s->power; in scoop_read() 93 return s->ccr; in scoop_read() [all …]
|