mirror of
https://github.com/izzy2lost/xemu.git
synced 2026-07-06 00:20:22 -07:00
Merge tag 'for_upstream' of git://git.kernel.org/pub/scm/virt/kvm/mst/qemu into staging
virtio,pci,pc: features,fixes,cleanups New virtio mem options. A vhost-user cleanup. Control over smbios entry point type. Config interrupt support for vdpa. Fixes, cleanups all over the place. Signed-off-by: Michael S. Tsirkin <mst@redhat.com> # gpg: Signature made Fri 07 Jan 2022 04:30:41 PM PST # gpg: using RSA key 5D09FD0871C8F85B94CA8A0D281F0DB8D28D5469 # gpg: issuer "mst@redhat.com" # gpg: Good signature from "Michael S. Tsirkin <mst@kernel.org>" [undefined] # gpg: aka "Michael S. Tsirkin <mst@redhat.com>" [undefined] # gpg: WARNING: This key is not certified with a trusted signature! # gpg: There is no indication that the signature belongs to the owner. # Primary key fingerprint: 0270 606B 6F3C DF3D 0B17 0970 C350 3912 AFBE 8E67 # Subkey fingerprint: 5D09 FD08 71C8 F85B 94CA 8A0D 281F 0DB8 D28D 5469 * tag 'for_upstream' of git://git.kernel.org/pub/scm/virt/kvm/mst/qemu: (55 commits) tests: acpi: Add updated TPM related tables acpi: tpm: Add missing device identification objects tests: acpi: prepare for updated TPM related tables virtio/vhost-vsock: don't double close vhostfd, remove redundant cleanup hw/scsi/vhost-scsi: don't double close vhostfd on error hw/scsi/vhost-scsi: don't leak vqs on error docs: reSTify virtio-balloon-stats documentation and move to docs/interop hw/i386/pc: Add missing property descriptions acpihp: simplify acpi_pcihp_disable_root_bus tests: acpi: SLIC: update expected blobs tests: acpi: add SLIC table test tests: acpi: whitelist expected blobs before changing them acpi: fix QEMU crash when started with SLIC table intel-iommu: correctly check passthrough during translation virtio-mem: Set "unplugged-inaccessible=auto" for the 7.0 machine on x86 virtio-mem: Support VIRTIO_MEM_F_UNPLUGGED_INACCESSIBLE linux-headers: sync VIRTIO_MEM_F_UNPLUGGED_INACCESSIBLE MAINTAINERS: Add a separate entry for acpi/VIOT tables virtio: signal after wrapping packed used_idx virtio-mem: Support "prealloc=on" option ... Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
This commit is contained in:
@@ -1777,6 +1777,13 @@ F: docs/specs/acpi_mem_hotplug.rst
|
||||
F: docs/specs/acpi_pci_hotplug.rst
|
||||
F: docs/specs/acpi_hw_reduced_hotplug.rst
|
||||
|
||||
ACPI/VIOT
|
||||
M: Jean-Philippe Brucker <jean-philippe@linaro.org>
|
||||
R: Ani Sinha <ani@anisinha.ca>
|
||||
S: Supported
|
||||
F: hw/acpi/viot.c
|
||||
F: hw/acpi/viot.h
|
||||
|
||||
ACPI/HEST/GHES
|
||||
R: Dongjiu Geng <gengdongjiu1@gmail.com>
|
||||
L: qemu-arm@nongnu.org
|
||||
@@ -1925,6 +1932,7 @@ virtio-balloon
|
||||
M: Michael S. Tsirkin <mst@redhat.com>
|
||||
M: David Hildenbrand <david@redhat.com>
|
||||
S: Maintained
|
||||
F: docs/interop/virtio-balloon-stats.rst
|
||||
F: hw/virtio/virtio-balloon*.c
|
||||
F: include/hw/virtio/virtio-balloon.h
|
||||
F: softmmu/balloon.c
|
||||
|
||||
+10
-7
@@ -290,13 +290,6 @@ static ssize_t tcp_chr_recv(Chardev *chr, char *buf, size_t len)
|
||||
NULL);
|
||||
}
|
||||
|
||||
if (ret == QIO_CHANNEL_ERR_BLOCK) {
|
||||
errno = EAGAIN;
|
||||
ret = -1;
|
||||
} else if (ret == -1) {
|
||||
errno = EIO;
|
||||
}
|
||||
|
||||
if (msgfds_num) {
|
||||
/* close and clean read_msgfds */
|
||||
for (i = 0; i < s->read_msgfds_num; i++) {
|
||||
@@ -325,6 +318,13 @@ static ssize_t tcp_chr_recv(Chardev *chr, char *buf, size_t len)
|
||||
#endif
|
||||
}
|
||||
|
||||
if (ret == QIO_CHANNEL_ERR_BLOCK) {
|
||||
errno = EAGAIN;
|
||||
ret = -1;
|
||||
} else if (ret == -1) {
|
||||
errno = EIO;
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
@@ -525,6 +525,7 @@ static int tcp_chr_sync_read(Chardev *chr, const uint8_t *buf, int len)
|
||||
{
|
||||
SocketChardev *s = SOCKET_CHARDEV(chr);
|
||||
int size;
|
||||
int saved_errno;
|
||||
|
||||
if (s->state != TCP_CHARDEV_STATE_CONNECTED) {
|
||||
return 0;
|
||||
@@ -532,6 +533,7 @@ static int tcp_chr_sync_read(Chardev *chr, const uint8_t *buf, int len)
|
||||
|
||||
qio_channel_set_blocking(s->ioc, true, NULL);
|
||||
size = tcp_chr_recv(chr, (void *) buf, len);
|
||||
saved_errno = errno;
|
||||
if (s->state != TCP_CHARDEV_STATE_DISCONNECTED) {
|
||||
qio_channel_set_blocking(s->ioc, false, NULL);
|
||||
}
|
||||
@@ -540,6 +542,7 @@ static int tcp_chr_sync_read(Chardev *chr, const uint8_t *buf, int len)
|
||||
tcp_chr_disconnect(chr);
|
||||
}
|
||||
|
||||
errno = saved_errno;
|
||||
return size;
|
||||
}
|
||||
|
||||
|
||||
@@ -22,3 +22,4 @@ are useful for making QEMU interoperate with other software.
|
||||
vhost-user
|
||||
vhost-user-gpu
|
||||
vhost-vdpa
|
||||
virtio-balloon-stats
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
virtio balloon memory statistics
|
||||
Virtio balloon memory statistics
|
||||
================================
|
||||
|
||||
The virtio balloon driver supports guest memory statistics reporting. These
|
||||
@@ -9,10 +9,12 @@ Before querying the available stats, clients first have to enable polling.
|
||||
This is done by writing a time interval value (in seconds) to the
|
||||
guest-stats-polling-interval property. This value can be:
|
||||
|
||||
> 0 enables polling in the specified interval. If polling is already
|
||||
> 0
|
||||
enables polling in the specified interval. If polling is already
|
||||
enabled, the polling time interval is changed to the new value
|
||||
|
||||
0 disables polling. Previous polled statistics are still valid and
|
||||
0
|
||||
disables polling. Previous polled statistics are still valid and
|
||||
can be queried.
|
||||
|
||||
Once polling is enabled, the virtio-balloon device in QEMU will start
|
||||
@@ -22,7 +24,7 @@ interval.
|
||||
To retrieve those stats, clients have to query the guest-stats property,
|
||||
which will return a dictionary containing:
|
||||
|
||||
o A key named 'stats', containing all available stats. If the guest
|
||||
* A key named 'stats', containing all available stats. If the guest
|
||||
doesn't support a particular stat, or if it couldn't be retrieved,
|
||||
its value will be -1. Currently, the following stats are supported:
|
||||
|
||||
@@ -37,7 +39,7 @@ which will return a dictionary containing:
|
||||
- stat-htlb-pgalloc
|
||||
- stat-htlb-pgfail
|
||||
|
||||
o A key named last-update, which contains the last stats update
|
||||
* A key named last-update, which contains the last stats update
|
||||
timestamp in seconds. Since this timestamp is generated by the host,
|
||||
a buggy guest can't influence its value. The value is 0 if the guest
|
||||
has not updated the stats (yet).
|
||||
@@ -61,32 +63,32 @@ It's also important to note the following:
|
||||
respond to the request the timer will never be re-armed, which has
|
||||
the same effect as disabling polling
|
||||
|
||||
Here are a few examples. QEMU is started with '-device virtio-balloon',
|
||||
which generates '/machine/peripheral-anon/device[1]' as the QOM path for
|
||||
Here are a few examples. QEMU is started with ``-device virtio-balloon``,
|
||||
which generates ``/machine/peripheral-anon/device[1]`` as the QOM path for
|
||||
the balloon device.
|
||||
|
||||
Enable polling with 2 seconds interval:
|
||||
Enable polling with 2 seconds interval::
|
||||
|
||||
{ "execute": "qom-set",
|
||||
"arguments": { "path": "/machine/peripheral-anon/device[1]",
|
||||
"property": "guest-stats-polling-interval", "value": 2 } }
|
||||
{ "execute": "qom-set",
|
||||
"arguments": { "path": "/machine/peripheral-anon/device[1]",
|
||||
"property": "guest-stats-polling-interval", "value": 2 } }
|
||||
|
||||
{ "return": {} }
|
||||
{ "return": {} }
|
||||
|
||||
Change polling to 10 seconds:
|
||||
Change polling to 10 seconds::
|
||||
|
||||
{ "execute": "qom-set",
|
||||
"arguments": { "path": "/machine/peripheral-anon/device[1]",
|
||||
"property": "guest-stats-polling-interval", "value": 10 } }
|
||||
{ "execute": "qom-set",
|
||||
"arguments": { "path": "/machine/peripheral-anon/device[1]",
|
||||
"property": "guest-stats-polling-interval", "value": 10 } }
|
||||
|
||||
{ "return": {} }
|
||||
{ "return": {} }
|
||||
|
||||
Get stats:
|
||||
Get stats::
|
||||
|
||||
{ "execute": "qom-get",
|
||||
"arguments": { "path": "/machine/peripheral-anon/device[1]",
|
||||
"property": "guest-stats" } }
|
||||
{
|
||||
{ "execute": "qom-get",
|
||||
"arguments": { "path": "/machine/peripheral-anon/device[1]",
|
||||
"property": "guest-stats" } }
|
||||
{
|
||||
"return": {
|
||||
"stats": {
|
||||
"stat-swap-out": 0,
|
||||
@@ -98,12 +100,12 @@ Get stats:
|
||||
},
|
||||
"last-update": 1358529861
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Disable polling:
|
||||
Disable polling::
|
||||
|
||||
{ "execute": "qom-set",
|
||||
"arguments": { "path": "/machine/peripheral-anon/device[1]",
|
||||
"property": "stats-polling-interval", "value": 0 } }
|
||||
{ "execute": "qom-set",
|
||||
"arguments": { "path": "/machine/peripheral-anon/device[1]",
|
||||
"property": "stats-polling-interval", "value": 0 } }
|
||||
|
||||
{ "return": {} }
|
||||
{ "return": {} }
|
||||
+2
-2
@@ -345,8 +345,8 @@ int acpi_get_slic_oem(AcpiSlicOem *oem)
|
||||
struct acpi_table_header *hdr = (void *)(u - sizeof(hdr->_length));
|
||||
|
||||
if (memcmp(hdr->sig, "SLIC", 4) == 0) {
|
||||
oem->id = hdr->oem_id;
|
||||
oem->table_id = hdr->oem_table_id;
|
||||
oem->id = g_strndup(hdr->oem_id, 6);
|
||||
oem->table_id = g_strndup(hdr->oem_table_id, 8);
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
+5
-7
@@ -128,20 +128,15 @@ static void acpi_set_pci_info(void)
|
||||
|
||||
static void acpi_pcihp_disable_root_bus(void)
|
||||
{
|
||||
static bool root_hp_disabled;
|
||||
Object *host = acpi_get_i386_pci_host();
|
||||
PCIBus *bus;
|
||||
|
||||
if (root_hp_disabled) {
|
||||
return;
|
||||
}
|
||||
|
||||
bus = PCI_HOST_BRIDGE(host)->bus;
|
||||
if (bus) {
|
||||
if (bus && qbus_is_hotpluggable(BUS(bus))) {
|
||||
/* setting the hotplug handler to NULL makes the bus non-hotpluggable */
|
||||
qbus_set_hotplug_handler(BUS(bus), NULL);
|
||||
}
|
||||
root_hp_disabled = true;
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -491,6 +486,9 @@ static void pci_write(void *opaque, hwaddr addr, uint64_t data,
|
||||
}
|
||||
|
||||
bus = acpi_pcihp_find_hotplug_bus(s, s->hotplug_select);
|
||||
if (!bus) {
|
||||
break;
|
||||
}
|
||||
QTAILQ_FOREACH_SAFE(kid, &bus->qbus.children, sibling, next) {
|
||||
Object *o = OBJECT(kid->child);
|
||||
PCIDevice *dev = PCI_DEVICE(o);
|
||||
|
||||
@@ -229,6 +229,7 @@ static void acpi_dsdt_add_tpm(Aml *scope, VirtMachineState *vms)
|
||||
|
||||
Aml *dev = aml_device("TPM0");
|
||||
aml_append(dev, aml_name_decl("_HID", aml_string("MSFT0101")));
|
||||
aml_append(dev, aml_name_decl("_STR", aml_string("TPM 2.0 Device")));
|
||||
aml_append(dev, aml_name_decl("_UID", aml_int(0)));
|
||||
|
||||
Aml *crs = aml_resource_template();
|
||||
|
||||
+1
-1
@@ -1589,7 +1589,7 @@ static void virt_build_smbios(VirtMachineState *vms)
|
||||
|
||||
smbios_set_defaults("QEMU", product,
|
||||
vmc->smbios_old_sys_ver ? "1.0" : mc->name, false,
|
||||
true, SMBIOS_ENTRY_POINT_30);
|
||||
true, SMBIOS_ENTRY_POINT_TYPE_64);
|
||||
|
||||
smbios_get_tables(MACHINE(vms), NULL, 0,
|
||||
&smbios_tables, &smbios_tables_len,
|
||||
|
||||
@@ -100,7 +100,7 @@ static int vhost_user_blk_handle_config_change(struct vhost_dev *dev)
|
||||
&local_err);
|
||||
if (ret < 0) {
|
||||
error_report_err(local_err);
|
||||
return -1;
|
||||
return ret;
|
||||
}
|
||||
|
||||
/* valid for resize only */
|
||||
@@ -252,6 +252,7 @@ static uint64_t vhost_user_blk_get_features(VirtIODevice *vdev,
|
||||
VHostUserBlk *s = VHOST_USER_BLK(vdev);
|
||||
|
||||
/* Turn on pre-defined features */
|
||||
virtio_add_feature(&features, VIRTIO_BLK_F_SIZE_MAX);
|
||||
virtio_add_feature(&features, VIRTIO_BLK_F_SEG_MAX);
|
||||
virtio_add_feature(&features, VIRTIO_BLK_F_GEOMETRY);
|
||||
virtio_add_feature(&features, VIRTIO_BLK_F_TOPOLOGY);
|
||||
@@ -511,7 +512,7 @@ static void vhost_user_blk_device_realize(DeviceState *dev, Error **errp)
|
||||
*errp = NULL;
|
||||
}
|
||||
ret = vhost_user_blk_realize_connect(s, errp);
|
||||
} while (ret == -EPROTO && retries--);
|
||||
} while (ret < 0 && retries--);
|
||||
|
||||
if (ret < 0) {
|
||||
goto virtio_err;
|
||||
|
||||
@@ -485,6 +485,9 @@ vhost_user_gpu_guest_notifier_pending(VirtIODevice *vdev, int idx)
|
||||
{
|
||||
VhostUserGPU *g = VHOST_USER_GPU(vdev);
|
||||
|
||||
if (idx == VIRTIO_CONFIG_IRQ_IDX) {
|
||||
return false;
|
||||
}
|
||||
return vhost_virtqueue_pending(&g->vhost->dev, idx);
|
||||
}
|
||||
|
||||
@@ -493,6 +496,9 @@ vhost_user_gpu_guest_notifier_mask(VirtIODevice *vdev, int idx, bool mask)
|
||||
{
|
||||
VhostUserGPU *g = VHOST_USER_GPU(vdev);
|
||||
|
||||
if (idx == VIRTIO_CONFIG_IRQ_IDX) {
|
||||
return;
|
||||
}
|
||||
vhost_virtqueue_mask(&g->vhost->dev, vdev, idx, mask);
|
||||
}
|
||||
|
||||
|
||||
@@ -1812,11 +1812,15 @@ build_dsdt(GArray *table_data, BIOSLinker *linker,
|
||||
dev = aml_device("TPM");
|
||||
aml_append(dev, aml_name_decl("_HID",
|
||||
aml_string("MSFT0101")));
|
||||
aml_append(dev,
|
||||
aml_name_decl("_STR",
|
||||
aml_string("TPM 2.0 Device")));
|
||||
} else {
|
||||
dev = aml_device("ISA.TPM");
|
||||
aml_append(dev, aml_name_decl("_HID",
|
||||
aml_eisaid("PNP0C31")));
|
||||
}
|
||||
aml_append(dev, aml_name_decl("_UID", aml_int(1)));
|
||||
|
||||
aml_append(dev, aml_name_decl("_STA", aml_int(0xF)));
|
||||
crs = aml_resource_template();
|
||||
@@ -1844,12 +1848,15 @@ build_dsdt(GArray *table_data, BIOSLinker *linker,
|
||||
if (TPM_IS_CRB(tpm)) {
|
||||
dev = aml_device("TPM");
|
||||
aml_append(dev, aml_name_decl("_HID", aml_string("MSFT0101")));
|
||||
aml_append(dev, aml_name_decl("_STR",
|
||||
aml_string("TPM 2.0 Device")));
|
||||
crs = aml_resource_template();
|
||||
aml_append(crs, aml_memory32_fixed(TPM_CRB_ADDR_BASE,
|
||||
TPM_CRB_ADDR_SIZE, AML_READ_WRITE));
|
||||
aml_append(dev, aml_name_decl("_CRS", crs));
|
||||
|
||||
aml_append(dev, aml_name_decl("_STA", aml_int(0xf)));
|
||||
aml_append(dev, aml_name_decl("_UID", aml_int(1)));
|
||||
|
||||
tpm_build_ppi_acpi(tpm, dev);
|
||||
|
||||
@@ -2723,6 +2730,8 @@ void acpi_build(AcpiBuildTables *tables, MachineState *machine)
|
||||
|
||||
/* Cleanup memory that's no longer used. */
|
||||
g_array_free(table_offsets, true);
|
||||
g_free(slic_oem.id);
|
||||
g_free(slic_oem.table_id);
|
||||
}
|
||||
|
||||
static void acpi_ram_update(MemoryRegion *mr, GArray *data)
|
||||
|
||||
+23
-15
@@ -1516,11 +1516,29 @@ static int vtd_sync_shadow_page_table(VTDAddressSpace *vtd_as)
|
||||
* 1st-level translation or 2nd-level translation, it depends
|
||||
* on PGTT setting.
|
||||
*/
|
||||
static bool vtd_dev_pt_enabled(VTDAddressSpace *as)
|
||||
static bool vtd_dev_pt_enabled(IntelIOMMUState *s, VTDContextEntry *ce)
|
||||
{
|
||||
VTDPASIDEntry pe;
|
||||
int ret;
|
||||
|
||||
if (s->root_scalable) {
|
||||
ret = vtd_ce_get_rid2pasid_entry(s, ce, &pe);
|
||||
if (ret) {
|
||||
error_report_once("%s: vtd_ce_get_rid2pasid_entry error: %"PRId32,
|
||||
__func__, ret);
|
||||
return false;
|
||||
}
|
||||
return (VTD_PE_GET_TYPE(&pe) == VTD_SM_PASID_ENTRY_PT);
|
||||
}
|
||||
|
||||
return (vtd_ce_get_type(ce) == VTD_CONTEXT_TT_PASS_THROUGH);
|
||||
|
||||
}
|
||||
|
||||
static bool vtd_as_pt_enabled(VTDAddressSpace *as)
|
||||
{
|
||||
IntelIOMMUState *s;
|
||||
VTDContextEntry ce;
|
||||
VTDPASIDEntry pe;
|
||||
int ret;
|
||||
|
||||
assert(as);
|
||||
@@ -1538,17 +1556,7 @@ static bool vtd_dev_pt_enabled(VTDAddressSpace *as)
|
||||
return false;
|
||||
}
|
||||
|
||||
if (s->root_scalable) {
|
||||
ret = vtd_ce_get_rid2pasid_entry(s, &ce, &pe);
|
||||
if (ret) {
|
||||
error_report_once("%s: vtd_ce_get_rid2pasid_entry error: %"PRId32,
|
||||
__func__, ret);
|
||||
return false;
|
||||
}
|
||||
return (VTD_PE_GET_TYPE(&pe) == VTD_SM_PASID_ENTRY_PT);
|
||||
}
|
||||
|
||||
return (vtd_ce_get_type(&ce) == VTD_CONTEXT_TT_PASS_THROUGH);
|
||||
return vtd_dev_pt_enabled(s, &ce);
|
||||
}
|
||||
|
||||
/* Return whether the device is using IOMMU translation. */
|
||||
@@ -1560,7 +1568,7 @@ static bool vtd_switch_address_space(VTDAddressSpace *as)
|
||||
|
||||
assert(as);
|
||||
|
||||
use_iommu = as->iommu_state->dmar_enabled && !vtd_dev_pt_enabled(as);
|
||||
use_iommu = as->iommu_state->dmar_enabled && !vtd_as_pt_enabled(as);
|
||||
|
||||
trace_vtd_switch_address_space(pci_bus_num(as->bus),
|
||||
VTD_PCI_SLOT(as->devfn),
|
||||
@@ -1753,7 +1761,7 @@ static bool vtd_do_iommu_translate(VTDAddressSpace *vtd_as, PCIBus *bus,
|
||||
* We don't need to translate for pass-through context entries.
|
||||
* Also, let's ignore IOTLB caching as well for PT devices.
|
||||
*/
|
||||
if (vtd_ce_get_type(&ce) == VTD_CONTEXT_TT_PASS_THROUGH) {
|
||||
if (vtd_dev_pt_enabled(s, &ce)) {
|
||||
entry->iova = addr & VTD_PAGE_MASK_4K;
|
||||
entry->translated_addr = entry->iova;
|
||||
entry->addr_mask = ~VTD_PAGE_MASK_4K;
|
||||
|
||||
+37
-1
@@ -77,6 +77,7 @@
|
||||
#include "hw/mem/nvdimm.h"
|
||||
#include "qapi/error.h"
|
||||
#include "qapi/qapi-visit-common.h"
|
||||
#include "qapi/qapi-visit-machine.h"
|
||||
#include "qapi/visitor.h"
|
||||
#include "hw/core/cpu.h"
|
||||
#include "hw/usb.h"
|
||||
@@ -94,7 +95,9 @@
|
||||
#include "trace.h"
|
||||
#include CONFIG_DEVICES
|
||||
|
||||
GlobalProperty pc_compat_6_2[] = {};
|
||||
GlobalProperty pc_compat_6_2[] = {
|
||||
{ "virtio-mem", "unplugged-inaccessible", "off" },
|
||||
};
|
||||
const size_t pc_compat_6_2_len = G_N_ELEMENTS(pc_compat_6_2);
|
||||
|
||||
GlobalProperty pc_compat_6_1[] = {
|
||||
@@ -1524,6 +1527,23 @@ static void pc_machine_set_default_bus_bypass_iommu(Object *obj, bool value,
|
||||
pcms->default_bus_bypass_iommu = value;
|
||||
}
|
||||
|
||||
static void pc_machine_get_smbios_ep(Object *obj, Visitor *v, const char *name,
|
||||
void *opaque, Error **errp)
|
||||
{
|
||||
PCMachineState *pcms = PC_MACHINE(obj);
|
||||
SmbiosEntryPointType smbios_entry_point_type = pcms->smbios_entry_point_type;
|
||||
|
||||
visit_type_SmbiosEntryPointType(v, name, &smbios_entry_point_type, errp);
|
||||
}
|
||||
|
||||
static void pc_machine_set_smbios_ep(Object *obj, Visitor *v, const char *name,
|
||||
void *opaque, Error **errp)
|
||||
{
|
||||
PCMachineState *pcms = PC_MACHINE(obj);
|
||||
|
||||
visit_type_SmbiosEntryPointType(v, name, &pcms->smbios_entry_point_type, errp);
|
||||
}
|
||||
|
||||
static void pc_machine_get_max_ram_below_4g(Object *obj, Visitor *v,
|
||||
const char *name, void *opaque,
|
||||
Error **errp)
|
||||
@@ -1614,6 +1634,8 @@ static void pc_machine_initfn(Object *obj)
|
||||
pcms->vmport = ON_OFF_AUTO_OFF;
|
||||
#endif /* CONFIG_VMPORT */
|
||||
pcms->max_ram_below_4g = 0; /* use default */
|
||||
pcms->smbios_entry_point_type = SMBIOS_ENTRY_POINT_TYPE_32;
|
||||
|
||||
/* acpi build is enabled by default if machine supports it */
|
||||
pcms->acpi_build_enabled = PC_MACHINE_GET_CLASS(pcms)->has_acpi_build;
|
||||
pcms->smbus_enabled = true;
|
||||
@@ -1737,15 +1759,23 @@ static void pc_machine_class_init(ObjectClass *oc, void *data)
|
||||
|
||||
object_class_property_add_bool(oc, PC_MACHINE_SMBUS,
|
||||
pc_machine_get_smbus, pc_machine_set_smbus);
|
||||
object_class_property_set_description(oc, PC_MACHINE_SMBUS,
|
||||
"Enable/disable system management bus");
|
||||
|
||||
object_class_property_add_bool(oc, PC_MACHINE_SATA,
|
||||
pc_machine_get_sata, pc_machine_set_sata);
|
||||
object_class_property_set_description(oc, PC_MACHINE_SATA,
|
||||
"Enable/disable Serial ATA bus");
|
||||
|
||||
object_class_property_add_bool(oc, PC_MACHINE_PIT,
|
||||
pc_machine_get_pit, pc_machine_set_pit);
|
||||
object_class_property_set_description(oc, PC_MACHINE_PIT,
|
||||
"Enable/disable Intel 8254 programmable interval timer emulation");
|
||||
|
||||
object_class_property_add_bool(oc, "hpet",
|
||||
pc_machine_get_hpet, pc_machine_set_hpet);
|
||||
object_class_property_set_description(oc, "hpet",
|
||||
"Enable/disable high precision event timer emulation");
|
||||
|
||||
object_class_property_add_bool(oc, "default-bus-bypass-iommu",
|
||||
pc_machine_get_default_bus_bypass_iommu,
|
||||
@@ -1756,6 +1786,12 @@ static void pc_machine_class_init(ObjectClass *oc, void *data)
|
||||
NULL, NULL);
|
||||
object_class_property_set_description(oc, PC_MACHINE_MAX_FW_SIZE,
|
||||
"Maximum combined firmware size");
|
||||
|
||||
object_class_property_add(oc, PC_MACHINE_SMBIOS_EP, "str",
|
||||
pc_machine_get_smbios_ep, pc_machine_set_smbios_ep,
|
||||
NULL, NULL);
|
||||
object_class_property_set_description(oc, PC_MACHINE_SMBIOS_EP,
|
||||
"SMBIOS Entry Point type [32, 64]");
|
||||
}
|
||||
|
||||
static const TypeInfo pc_machine_info = {
|
||||
|
||||
+1
-1
@@ -177,7 +177,7 @@ static void pc_init1(MachineState *machine,
|
||||
smbios_set_defaults("QEMU", "Standard PC (i440FX + PIIX, 1996)",
|
||||
mc->name, pcmc->smbios_legacy_mode,
|
||||
pcmc->smbios_uuid_encoded,
|
||||
SMBIOS_ENTRY_POINT_21);
|
||||
pcms->smbios_entry_point_type);
|
||||
}
|
||||
|
||||
/* allocate ram and load rom/bios */
|
||||
|
||||
+1
-1
@@ -200,7 +200,7 @@ static void pc_q35_init(MachineState *machine)
|
||||
smbios_set_defaults("QEMU", "Standard PC (Q35 + ICH9, 2009)",
|
||||
mc->name, pcmc->smbios_legacy_mode,
|
||||
pcmc->smbios_uuid_encoded,
|
||||
SMBIOS_ENTRY_POINT_21);
|
||||
pcms->smbios_entry_point_type);
|
||||
}
|
||||
|
||||
/* allocate ram and load rom/bios */
|
||||
|
||||
@@ -101,3 +101,12 @@ int vhost_net_set_mtu(struct vhost_net *net, uint16_t mtu)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
bool vhost_net_config_pending(VHostNetState *net)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
void vhost_net_config_mask(VHostNetState *net, VirtIODevice *dev, bool mask)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -457,6 +457,15 @@ void vhost_net_virtqueue_mask(VHostNetState *net, VirtIODevice *dev,
|
||||
vhost_virtqueue_mask(&net->dev, dev, idx, mask);
|
||||
}
|
||||
|
||||
bool vhost_net_config_pending(VHostNetState *net)
|
||||
{
|
||||
return vhost_config_pending(&net->dev);
|
||||
}
|
||||
|
||||
void vhost_net_config_mask(VHostNetState *net, VirtIODevice *dev, bool mask)
|
||||
{
|
||||
vhost_config_mask(&net->dev, dev, mask);
|
||||
}
|
||||
VHostNetState *get_vhost_net(NetClientState *nc)
|
||||
{
|
||||
VHostNetState *vhost_net = 0;
|
||||
|
||||
+8
-2
@@ -3168,6 +3168,9 @@ static bool virtio_net_guest_notifier_pending(VirtIODevice *vdev, int idx)
|
||||
VirtIONet *n = VIRTIO_NET(vdev);
|
||||
NetClientState *nc = qemu_get_subqueue(n->nic, vq2q(idx));
|
||||
assert(n->vhost_started);
|
||||
if (idx == VIRTIO_CONFIG_IRQ_IDX) {
|
||||
return vhost_net_config_pending(get_vhost_net(nc->peer));
|
||||
}
|
||||
return vhost_net_virtqueue_pending(get_vhost_net(nc->peer), idx);
|
||||
}
|
||||
|
||||
@@ -3177,8 +3180,11 @@ static void virtio_net_guest_notifier_mask(VirtIODevice *vdev, int idx,
|
||||
VirtIONet *n = VIRTIO_NET(vdev);
|
||||
NetClientState *nc = qemu_get_subqueue(n->nic, vq2q(idx));
|
||||
assert(n->vhost_started);
|
||||
vhost_net_virtqueue_mask(get_vhost_net(nc->peer),
|
||||
vdev, idx, mask);
|
||||
if (idx == VIRTIO_CONFIG_IRQ_IDX) {
|
||||
vhost_net_config_mask(get_vhost_net(nc->peer), vdev, mask);
|
||||
return;
|
||||
}
|
||||
vhost_net_virtqueue_mask(get_vhost_net(nc->peer), vdev, idx, mask);
|
||||
}
|
||||
|
||||
static void virtio_net_set_config_size(VirtIONet *n, uint64_t host_features)
|
||||
|
||||
+2
-7
@@ -1390,7 +1390,7 @@ static void pci_update_mappings(PCIDevice *d)
|
||||
|
||||
/* now do the real mapping */
|
||||
if (r->addr != PCI_BAR_UNMAPPED) {
|
||||
trace_pci_update_mappings_del(d, pci_dev_bus_num(d),
|
||||
trace_pci_update_mappings_del(d->name, pci_dev_bus_num(d),
|
||||
PCI_SLOT(d->devfn),
|
||||
PCI_FUNC(d->devfn),
|
||||
i, r->addr, r->size);
|
||||
@@ -1398,7 +1398,7 @@ static void pci_update_mappings(PCIDevice *d)
|
||||
}
|
||||
r->addr = new_addr;
|
||||
if (r->addr != PCI_BAR_UNMAPPED) {
|
||||
trace_pci_update_mappings_add(d, pci_dev_bus_num(d),
|
||||
trace_pci_update_mappings_add(d->name, pci_dev_bus_num(d),
|
||||
PCI_SLOT(d->devfn),
|
||||
PCI_FUNC(d->devfn),
|
||||
i, r->addr, r->size);
|
||||
@@ -1497,11 +1497,6 @@ static void pci_irq_handler(void *opaque, int irq_num, int level)
|
||||
pci_change_irq_level(pci_dev, irq_num, change);
|
||||
}
|
||||
|
||||
static inline int pci_intx(PCIDevice *pci_dev)
|
||||
{
|
||||
return pci_get_byte(pci_dev->config + PCI_INTERRUPT_PIN) - 1;
|
||||
}
|
||||
|
||||
qemu_irq pci_allocate_irq(PCIDevice *pci_dev)
|
||||
{
|
||||
int intx = pci_intx(pci_dev);
|
||||
|
||||
+4
-2
@@ -79,7 +79,8 @@ void pci_host_config_write_common(PCIDevice *pci_dev, uint32_t addr,
|
||||
return;
|
||||
}
|
||||
|
||||
trace_pci_cfg_write(pci_dev->name, PCI_SLOT(pci_dev->devfn),
|
||||
trace_pci_cfg_write(pci_dev->name, pci_dev_bus_num(pci_dev),
|
||||
PCI_SLOT(pci_dev->devfn),
|
||||
PCI_FUNC(pci_dev->devfn), addr, val);
|
||||
pci_dev->config_write(pci_dev, addr, val, MIN(len, limit - addr));
|
||||
}
|
||||
@@ -104,7 +105,8 @@ uint32_t pci_host_config_read_common(PCIDevice *pci_dev, uint32_t addr,
|
||||
}
|
||||
|
||||
ret = pci_dev->config_read(pci_dev, addr, MIN(len, limit - addr));
|
||||
trace_pci_cfg_read(pci_dev->name, PCI_SLOT(pci_dev->devfn),
|
||||
trace_pci_cfg_read(pci_dev->name, pci_dev_bus_num(pci_dev),
|
||||
PCI_SLOT(pci_dev->devfn),
|
||||
PCI_FUNC(pci_dev->devfn), addr, ret);
|
||||
|
||||
return ret;
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user